Class GraphViz
In: lib/graphviz/types.rb
lib/graphviz/ext.rb
lib/graphviz/elements.rb
lib/graphviz/theory.rb
lib/graphviz/edge.rb
lib/graphviz/xml.rb
lib/graphviz/nothugly.rb
lib/graphviz/attrs.rb
lib/graphviz/family_tree/person.rb
lib/graphviz/family_tree/couple.rb
lib/graphviz/family_tree/sibling.rb
lib/graphviz/family_tree/generation.rb
lib/graphviz/graphml.rb
lib/graphviz/types/html_string.rb
lib/graphviz/types/esc_string.rb
lib/graphviz/types/lbl_string.rb
lib/graphviz/types/gv_double.rb
lib/graphviz/node.rb
lib/graphviz/family_tree.rb
lib/graphviz/math/matrix.rb
lib/graphviz.rb
Parent: Object

>> x = "hello\n\t\l\"world\""

> "hello\n\t\l\"world\""

>> puts x.inspect.gsub( "\\", "\" ) "hello\n\t\l\"world\""

OR

>> x = ‘hello\n\t\l"world"’

> "hello\n\t\l\"world\""

>> puts x.inspect.gsub( "\\", "\" ) "hello\n\t\l\"world\""

Methods

-   <<   >   >>   []   []=   add_edge   add_graph   add_node   default   each_attribut   each_edge   each_graph   each_node   edge_count   get_edge_at_index   get_graph   get_node   get_node_at_index   graph_count   id   name   new   node_count   nothugly   options   output   parse   root_graph   save   subgraph   type  

Included Modules

Constants GVUtils

Classes and Modules

Class GraphViz::Attrs
Class GraphViz::Edge
Class GraphViz::Elements
Class GraphViz::Ext
Class GraphViz::FamilyTree
Class GraphViz::GraphML
Class GraphViz::Math
Class GraphViz::Node
Class GraphViz::Theory
Class GraphViz::Types
Class GraphViz::XML

External Aliases

graph -> graph_attrs
node -> node_attrs
edge -> edge_attrs

Attributes

edge  [RW]  This accessor allow you to set global edges attributs
graph  [RW]  This accessor allow you to set global graph attributs
node  [RW]  This accessor allow you to set global nodes attributs

Public Class methods

Change default options (:use, :path, :errors and :output)

Create a new graph object

Options :

  • :output : Output format (Constants::FORMATS) (default : dot)
  • :file : Output file name (default : nil)
  • :use : Program to use (Constants::PROGRAMS) (default : dot)
  • :path : Program PATH
  • :parent : Parent graph (default : nil)
  • :type : Graph type (Constants::GRAPHTYPE) (default : digraph)
  • :errors : DOT error level (default 1)
    • 0 = Error + Warning
    • 1 = Error
    • 2 = none

Transform to pretty up the SVG output

For more information, see www.hokstad.com/making-graphviz-output-pretty-with-xsl.html and www.hokstad.com/making-graphviz-output-pretty-with-xsl-updated.html

You can use the :nothugly option to GraphViz#output :

  graph.output( :svg => "myGraph.svg", :nothugly => true )

Or directly on an SVG output graph :

  GraphViz.nothugly( "myGraph.svg" )

Create a new graph from a GraphViz File

Options :

  • :output : Output format (Constants::FORMATS) (default : dot)
  • :file : Output file name (default : none)
  • :use : Program to use (Constants::PROGRAMS) (default : dot)
  • :path : Program PATH

Public Instance methods

-( oNode )

Alias for #<<

Create an edge between the current cluster and the node or cluster oNode

>( oNode )

Alias for #<<

>>( oNode )

Alias for #<<

Get the value of the graph attribut xAttrName

Set value xValue to the graph attribut xAttrName

Create a new edge

In:

  • oNodeOne : First node (or node list)
  • oNodeTwo : Second Node (or node list)
  • hOpts : Edge attributs

Create a new graph

In:

  • xGraphName : Graph name
  • hOpts : Graph attributs

Create a new node

In:

  • xNodeName : Name of the new node
  • hOpts : Node attributs

Return the GraphViz::Node object created

Calls block once for each attribut of the graph, passing the name and value to the block as a two-element array.

Allow you to traverse edges

Allow you to traverse graphs

Allow you to traverse nodes

Get the number of edges

Return the edge object for the given index

Return the graph object for the given name (or nil)

Return the node object for the given name (or nil)

Return the node object for the given index

Get the number of graphs

id()

Alias for name

Get the graph name

Get the number of nodes

Generate the graph

Options :

  • :output : Output format (Constants::FORMATS)
  • :file : Output file name
  • :use : Program to use (Constants::PROGRAMS)
  • :path : Program PATH
  • :<format> => <file> : <file> can be
  • :errors : DOT error level (default 1)
    • 0 = Error + Warning
    • 1 = Error
    • 2 = none

Return the root graph

save( hOpts = {} )

Alias for output

subgraph( xGraphName = nil, hOpts = {}, &block )

Alias for add_graph

Return the graph type (graph digraph)

[Validate]