Project

gv

0.0
Low commit activity in last 3 years
No release in over a year
Graphviz for Ruby, using libgvc via FFI
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 5.8
>= 10.0
>= 0.9
>= 0.41

Runtime

>= 1.11
 Project Readme

Gem Version Inline docs Build Status

Graphviz FFI

Ruby bindings for libcgraph and libgvc (Graphviz) using FFI.

Installation

Add this line to your application's Gemfile:

gem 'gv'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gv

Usage

Create new graph:

require 'gv'

graph = GV::Graph.open 'g'
graph.edge 'e', graph.node('A'), graph.node('B', shape: 'polygon', label: graph.html('<b>bold</b>'))
# render to string
graph.render 'png'

# or to a file
graph.write 'result.png'

Result

Result

Load existing graph from .dot file:

require 'gv'

graph = GV::Graph.load File.open('g.dot')

# render graph
graph.render

See the documentation for details.

Contributing

  1. Fork it ( https://github.com/furunkel/gv/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request