문제

I'd like to:

  1. Represent a DAG according to The Ruby Way.
  2. Generate an image from the DAG.

There would be no more than 100 nodes (and often far less, say, 10 for the 80th percentile case). I do not need to permanently store the data, just the image, so no database considerations need to be made.

도움이 되었습니까?

해결책

Graphviz is the tried-and-true tool for visualizing all sorts of graphs, and it's been around for a while. See: http://www.graphviz.org/

There's Ruby wrapper around it available, see: https://github.com/glejeune/Ruby-Graphviz

(disclaimer: I've used Graphviz, but not the Ruby wrapper)

다른 팁

If all you need to do is output images, I'd feed textual representations into the "dot" tool of graphviz.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top