9

I'm trying to draw a graph on an ASP webpage. I'm hoping an API can be helpful, but so far I have not been able to find one.

The graph contains labeled nodes and unlabeled directional edges. The ideal output would be something like this.

Anybody know of anything pre-built than can help?

Dominique Fortin
  • 2,212
  • 15
  • 20
Kenn
  • 2,379
  • 2
  • 29
  • 38

9 Answers9

5

Definitely graphviz. The image on the wikipedia link you are pointing at was made in graphviz. From its description page the graph description file looked like this:

graph untitled {
    graph[bgcolor="transparent"];
    node [fontname="Bitstream Vera Sans", fontsize="22.00", shape=circle, style="bold,filled" fillcolor=white];
    edge [style=bold];
    1;2;3;4;5;6;
    6 -- 4 -- 5 -- 1 -- 2 -- 3 -- 4;
    2 -- 5;
}

If that code were saved into a file input.dot, the command they would have used to actually generate the graph would probably have been:

neato -Tsvg input.dot > graph.svg
wxs
  • 5,617
  • 5
  • 36
  • 51
3

We produce mxGraph, which supports ASP.NET, and most other mainstream server-side technologies. It's entirely JavaScript client-side, with just a thin layer to communicate written in .NET, so there isn't much ASP.NET required. But we do supply a ASP project for visual studio as one of the examples.

Frodo Baggins
  • 8,290
  • 6
  • 45
  • 55
3

I am not sure about ASP interface, but you may want to check out graphviz.

/Allan

Allan Wind
  • 23,068
  • 5
  • 28
  • 38
1

You could use QuickGraph to easily model the graph programatically, then export it to GraphViz or GLEE, then render it to PNG.

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
1

Well, here's another answer 2 years later. Protovis now does force-directed graph layouts rendered in browser: http://vis.stanford.edu/protovis/ex/force.html Might be easier if you can't install client-side software. Also it's fun and interactive!

wxs
  • 5,617
  • 5
  • 36
  • 51
1

GraphViz does a nice job for tiny graphs, but not for huge ones. If your graph is reasonlably large, try aiSee or have a look at the alternatives on this list.

ЯegDwight
  • 24,821
  • 10
  • 45
  • 52
1

I would recommend zedgraph

Paul Dolphin
  • 758
  • 2
  • 8
  • 18
0

Disclaimer: I'm Image-Charts founder.

If you are looking for an web API:

https://image-charts.com/chart
?cht=gv
&chl=graph g{1;2;3;4;5;6; 6 -- 4 -- 5 -- 1 -- 2 -- 3 -- 4; 2 -- 5;)

FGRibreau
  • 7,021
  • 2
  • 39
  • 48
0

You might be able to pull this off with Google's Chart API. It is very easy to get started with.

Brian
  • 13,412
  • 10
  • 56
  • 82