glejeune / Ruby-Graphviz

[MIRROR] Ruby interface to the GraphViz graphing tool
https://gitlab.com/glejeune/ruby-graphviz
Other
609 stars 116 forks source link

Instead of outputting an image, is it possible to get the x,y coordinates of each of the nodes? #28

Closed NullVoxPopuli closed 12 years ago

NullVoxPopuli commented 13 years ago

I'm making an interactive graph with javascript using Raphael.js, and I haven't been able to find where I can get the locations of the Graphvis DOT nodes...

How do I do that?

glejeune commented 13 years ago

I'm not sure to understand what you want. Do you want to be able to get the node position (given by the "pos" attribut - http://graphviz.org/content/attrs#dpos) ?

If yes, I just push a solution (see sample62.rb in branch "tba" - https://github.com/glejeune/Ruby-Graphviz/commit/65aa67af1186dc644574477f47261b7b9b93e021). If it's what you want, I can do something less ugly and merge it to the master for a futur release.

NullVoxPopuli commented 13 years ago

I think that is it. though, it would be REALLY sexy to get a hash or array returned mapping out the shapes' labels to their (x,y) coordinates. =D

glejeune commented 13 years ago

OK let's do it ;)

NullVoxPopuli commented 13 years ago

Should I fork what you linked to? or master?

glejeune commented 13 years ago

You can fork... But if you want to use my ugly patch, you must work in the 'tba' branch.

NullVoxPopuli commented 13 years ago

how long would it take for you to make it non-ugly? and merge into master?

glejeune commented 13 years ago

Hmm... I think I'll take time to do it this weekend ;)

NullVoxPopuli commented 13 years ago

Excellent. I have plenty of time before I need it done. =p Apparently the feature I want to work on is "low priority" lol

NullVoxPopuli commented 13 years ago

I AM thinking about releasing my stuff as a js plugin for drawing directed graphs. =D

glejeune commented 13 years ago

It looks interesting, please get me informed when you publish something

NullVoxPopuli commented 13 years ago

of course ^_^

glejeune commented 12 years ago

Done \o/ and published