Domanda

Sto cercando di effettuare alcune visualizzazioni del grafico interattivo nella mia applicazione Web Django utilizzando Python.Ho trovato Graphviz ed è stato in grado di emettere un grafico statico (come immagine .png) sulla mia applicazione utilizzando Pydot (Python Interface to Graphviz's Dot Language).

Tuttavia, sto cercando di rendere i miei grafici più interattivi, come poter evidenziare i nodi quando passerò il mouse, rendendo i nodi cliccati, trascinando i nodi su una posizione diversa e lo zoom sul grafico.

.

C'è un modo in cui potrei farlo in graphviz?O in generale c'è modo di creare un grafico interattivo per la mia applicazione Django senza dover usare il flash?Non voglio usare il flash da quando non sono così familiare e anche da quando voglio visualizzare un set di dati abbastanza grande.

È stato utile?

Soluzione

Try The Javascript Infovis Toolkit. It is all implemented in a browser canvas, so no Flash is needed, only a decent browser with support for the <canvas> tag. Graph visualization examples are here, here and here, other demos are here.

Altri suggerimenti

There is Canviz (source). However, nodes are not yet clickable (they were in an older version that used image maps. The code base has changed and now the rendering is happenning client side using javascript, which is why clickable links is not yet re enabled.

This is the best I found, however they are plenty of others.

mxGraph (Not free)

You can use D3.js for graph visualization (see here for examples of graph visualizations in D3js, and look at How to Make an Interactive Network Visualization).

For back-end (if it is necessary to have something more than just a json file to represent the graph - i.e. if it is large), then you can use a Python module for graphs, NetworkX.

Side note, here is my simple interactive graph visualization example:

enter image description here

You can do something like this very simply just with DOT and HTML.

Generate client-side maps and overlay them over your PNG images. (Insert the map code into the HTML page.)

dot test.dot -Tpng -o test.png -Tcmapx -o test.map

SVG exports are directly clickable.

It seems like an approach that fits what you are trying to do might be to use svg in the browser an/or javascript. I think most of the modern browsers support SVG and would allow you to do some pretty cool interactive graphs. The server could provide a json feed of the datapoints needed to render the graph. I don't know off hand the tools that are available, but I've seen some pretty cool graph demos constructed without flash through client-side approaches.

As an alternative, you could pre-render a bunch of graph images that the user would likely view and then just fetch those as the user interacts with the graph. This might work if the graphs don't change that frequently and if the number of alterations that the user would make is small, but you'd have to re-render every time the graph changes.

I've did what you are trying to do not too long ago. The context was visualizing a gnarly SalesForce schema.

First thing, graphviz is only good for plotting, not really for drawing. You can generate SVG, but I could not get it to work with I.E. after a considerable of (what turned out to be fruitless) effort.

I DID find this Java Applet ZGRViewer to suffice, and while applets feel a bit dated for my taste, it worked very well cross browser.

I basically hand coded a process invoking service that generated the dot files and ran them thought (dotty, is think?) - the visulazation applet reads the native dot file format.

I also came accross something that I thought about for a V2 (which never happened) - it is part of the AJAX control toolkit - Seadragon.

If you want to see the code in ASP.NET, I can post it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top