Graphshaper can generate realistic, scale-free graphs of any size. It is tested with MRI Ruby (1.9.2, 1.9.3 and 2.0.0) and the 1.9 versions of JRuby and Rubinius.
Add this line to your application's Gemfile:
gem 'graphshaper', '~> 0.3.0'
And then execute:
$ bundle
Or install it yourself as:
$ gem install graphshaper
The commandline tool expects one argument: The number of vertices you want your generated graph to have. This is how to use it:
graphshaper [options] size
You can use the following options:
-a
,--arango
: Store the graph in a local ArangoDB instance-l
,--log
: Store the graph in two CSV files for nodes and edges-d
,--dot
: Store the graph in the dot format-p
,--png
: Export the graph as a PNG (you need to install graphviz for that – circo is used for the layout)-j
,--json
: Export the graph as a JSON file--version
: Show version
You can also use the library in your Ruby Code. You can find the documentation here.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Make your changes – don't forget to spec them with RSpec
- Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request