Library to render Directed Graphs (similar to graphviz) on Google App Engine - java

I am looking for a Java or Python library that can render graphs in the Dot language as image file. The problem is that I need a library that I can use on Google App Engine. Basically I am looking for a library that can convert the text description of a directed graph into an image of the graph.
For example:
Covert this edge list:
[A,B]
[B,C]
[A,C]
[C,D]
Into this image:
I used Graphviz for this example, but I know it is not possible for me to use it with Google App Engine.

Canviz is what you are looking for: it is a JavaScript library for drawing Graphviz graphs to a web browser canvas. It works with most browsers.
Using Canviz has advantages for your web application over generating and sending bitmapped images and imagemaps to the browser:
The server only needs to have Graphviz generate xdot text; this is faster than generating bitmapped images.
Only the xdot text needs to be transferred to the browser; this is smaller than binary image data, and, if the browser supports it (which most do), the text can be gzip- or bzip2-compressed.
The web browser performs the drawing, not the server; this reduces server load.
The user can resize the graph without needing to involve the server; this is faster than having the server draw and send the graph in a different size.
To see it in action, look here.

Google Charts API now supports GraphViz experimentally. (Note that the entire Image Charts project is officially deprecated.)

You could take a look at the flash based perfuse project if just need to display a graph and not having it embedded as an image is acceptable.
They have some example applications of the library such as this Dependency Graph.

I do not think there is such pure python library, the best you can do is use NetworkX, it can draw using matplotlib or pygraphviz. Maybe you can modify networkx's matplotlib code to draw on server side, here is the code
Another problem is google app engine doesn't have any drawing API, but you may simply use SVG to generate such graphs or may be google charts API have something already there.

Related

Display dicom or raw images in 3D

I was wondering what tool can I use to make a single slice (image) into 3D. I can open dicom and raw images in my program but I want to display these images in 3D (just a single image rather than the whole stack). I used some of ImageJ files to open images but I don't like how ImageJ displays the stack in 3D and it doesn't really display a single image in 3d. My program is coded in java and I would like a tool that can be easily integrated into eclipse Kepler. I have found many tools like jogl, java 3d, java 3d workbench, vtk, etc. but I don't know which one to use or are there any other programs that are easier to use or integrate into the system.
EDIT:
I want to do something like this... http://www.welfenlab.de/fileadmin/forschung/gebiete/YaDiV/2008_07_18_Screenshot_YaDiV_1.png
There's a library called ImageJ which can be used to create three-dimensional models from two-dimensional slices. I haven't personally used it, but it looks like it should do the trick.
have you looked at XTK? in particular, lesson 17 seems to be exactly what you are looking for. it is in Javascript, so to integrate into your Java application, you should be able to use one of the many Java/Javascript bridges out there.

Library for programmatically creating class diagram picture with java?

Is there a library in java that allows me to programmatically create class diagram from fetched data (similar to the diagram below)? Specifically, I want to create a database reference diagram (image below).
EDIT:
As to prevent misunderstanding, I did not want a UML Diagram of my java code. Rather, I want to generate diagrams from the data that I got from the database (via Java) and output them in image form.
In two steps , we can create diagrams based on object/table relationships.
Step 1: use DOT (graph description language) to create graph representation of the relationships.
DOT is a plain text graph description language. It is a simple way of describing graphs that both humans and computer programs can use. syntax is very easy to learn. create this file like you create some text file using your preferred programming language.
Step 2: Use DOT reader libraries to render as picture.
There are lot of libraries are available to render DOT file.
Graphviz - A collection of libraries and utilities to manipulate and render graphs
Canviz - a JavaScript library for rendering dot files.
Viz.js - A simple Graphviz JavaScript client
Grappa - A Java wrapper for using the Graphviz libraries.
Beluging - A Python & Google Cloud based viewer of DOT and Beluga extensions.
Tulip can import dot files for analysis
OmniGraffle can import a subset of DOT, producing an editable document. (The result cannot be exported back to DOT, however.)
ZGRViewer, a GraphViz/DOT Viewer link
VizierFX, A Flex graph rendering library link
Gephi - an interactive visualization and exploration platform for all kinds of networks and complex systems, dynamic and hierarchical graphs
I believe most of the libraries listed here: Java graph library for dynamic visualisation should work for that use-case.
If you are looking for ready-made tool that can do this out-of-the box you might want to take a look at the "Reference Graphs" section in the DbVisualizer Gallery.
I don't know whether the solutions can generate an identical image to that, but;
These diagrams are referred to as 'UML diagrams' and generating UML diagrams from a Java project is discussed here;
Generate UML Class Diagram from Java Project

Plot Graph In web application

I am developing a web application using Spring. I need to plot graphs and display them to the user. The values are stored in a database. How do I achieve this?
You have to decide where do you want to create the charts. You have two options:
Creating the chart on the server and send them to the client as image or pdf.
Sending raw data to the client and let them render the charts via html, flash or javascript
Each way has its own advantages and limitations - you have to decide for your specific use case.
If you render the charts on server side you are limited regarding interactivity but you clients don't need much performance to render the charts. Here you have to think about caching to protect your server performance.
On the client side you have to deal with diffent browsers and must think about the client render performance.
If 2. is ok for you, I would recommend using javascript - so your users don't need to install any plugins like flash and you have a lot of possibilites to create nice charts.
There are some nice frameworks to create charts using javascript, for example:
HighCharts
gRaphaƫl
JS Charts
...
I have used Google Charts with Spring MVC before. Normally whenever I have needed to display chart, I have always displayed tabular data along side the chart as well. So, I just take jQuery, parse the html table for data and pass it to google Chart API. You may want to look at the Google Chart pages for examples. It is quite nice.
As #aiolos said, you can generate your chart image in the client or in the Server. I haven't work with JavaScript enabled charts, but when I have to generate charts the server-side way i'll go with Cewolf. It's a Java Library based of JFreeChart that has some useful tags to embed charts in JSP pages.
I tested it in Spring Applications and works like a charm.

Getting Java- and Javascript-generated charts to look similar

I'm having the following scenario: I'm displaying charts in the client side using the Javascript chart library Raphael. On clicking download I need to generate the same chart into pdf and display it to the user. I'm using JFreeChart to create charts on the server side. The problem is that since I'm using two different chart libraries, both look different. What is the solution for this?
The chart should be free for commercial use.
4 options here :
Use Google Chart. http://code.google.com/apis/chart/
JQuery Chart. http://www.1stwebdesigner.com/css/top-jquery-chart-libraries-interactive-charts/
Create Applet, use your JFreeChart and put it on the applet. Then provide the data from javascript to the applet. (If you really insist to make a very similar UI)
On the servlet convert your chart to image, and store it in session. Later on, in your JSP, get the image from the session. check this link for the details. But this one won't exactly the same as option no 3.

Good format for vector graphics for generation in java and use/open/print in windows?

We have a java web application. The application generates a big image with company structure diagramm on it as jpeg. Users download the image and want to print it on DIN A2 (big paper format). The jpeg in this scale has pretty bad quality after printing.
Our idea is to generate an image in vector graphics. What vector graphics format suits the best our needs, considering that we code in java and the users have windows and use MS IE browser?
May be there is a better way archieve this? Like let the browser to display the image and let users to print the page?
PDF has been invented exactly for the same purpose. iText library enables you to draw lines, boxes, circles and insert whatever text you like. If you want to automate it a bit using templates there's JasperReports which utilizes iText.
A well known vector graphics format is Scalable Vector Graphics. It's basically an XML file (starting with <svg> tag. It can be viewed in browsers like Firefox without additional plugins.
For java, you can use the Java 2D API to create SVG format. A tutorial can be found here:
If you need the vector graphic for IE you need VML, similar to SVG but can be rendered by Internet Explorer.
RaphaelJS can be used for vector graphics independent of browser model but it's client side and you may not want to do client side processing on every page load.

Categories

Resources