Hacker Newsnew | past | comments | ask | show | jobs | submit | redux-xplatform's commentslogin

If you need to be able to diff the code for graphs, graphviz (dot language) is great.

If you need auto-layout, it's hard to do much better than graphviz. The creators of graphviz have some good papers on what it takes to do that right. They'll discourage you from wanting to re-invent that particular wheel, if you read them. Tricky bit here is, depending on your exact graph and constraints, it's not exactly fully solvable in the general case, if you want to have no overlap or no crossing lines under any circumstances whatsoever. Still, you'll struggle to do better, and there aren't actually a ton of implementations out there other than Graphviz that are anywhere near as good (at least, as of a couple years ago).

Templating or building programmatically? Great, it's just text. Generating on demand? Decent, it's fairly fast.

If you need pretty, and I mean really pretty, and especially pretty and interactive... well it's less enjoyable for that, but then nothing that is enjoyable for that purpose is much good at the other points above.


Thanks for that, will try out graphviz. I was doing some custom implementation for minimizing edge crossings and it seems to work fine for me but thats mostly for 2-layered graphs. If I am to expand to multi-layer graphs, its going to be fairly more complicated to figure out how to do that and I dont know if it will work well.

Graphviz seems to be great for getting you a mostly-useful auto layout majority of the time.

I have a requirement to be able to mix fixed-positioned nodes along with dynamically changing nodes, I havent used graphviz to know if it could do that. A library like cytoscape works ok or maybe d3 (I am still evaluating these)

Honestly coming into this, I thought graph drawing would be fairly easy and I could look up online for examples - but it seems to be quite opposite, its really complicated to get graphs that are both dynamically generated with the nodes positioned at the same place in case there are similar nodes


Forget the Ivy League—judging from elections from 2000 on, one is incredibly unlikely to become a major party candidate for President, let alone win, without having attended some kind of private college prep school, rather than a public high school. As I recall, Hillary is the only candidate who didn't.

Sure, little Timmy, you can be anything you want, even President. Your parents are rich, right? No? Oh, uh, never mind.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: