Class GraphViz
In: lib/graphviz/attrs.rb
lib/graphviz/edge.rb
lib/graphviz/node.rb
lib/graphviz/parser.rb
lib/graphviz/types/esc_string.rb
lib/graphviz/types/html_string.rb
lib/graphviz/types.rb
lib/graphviz/xml.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   edge_count   get_graph   get_node   name   new   node_count   options   output   parse   save  

Included Modules

Constants

Classes and Modules

Class GraphViz::Attrs
Class GraphViz::Edge
Class GraphViz::Node
Class GraphViz::Parser
Class GraphViz::Types
Class GraphViz::XML

Attributes

edge  [RW]  This accessor allow you to set global edges 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 : none)
  • :use : Program to use (Constants::PROGRAMS) (default : dot)
  • :path : Program PATH
  • :parent : Parent graph (default : none)
  • :type : Graph type (Constants::GRAPHTYPE) (default : digraph)
  • :errors : DOT error level (default 1)
    • 0 = Error + Warning
    • 1 = Error
    • 2 = none

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
  • :parent : Parent graph (default : none)
  • :type : Graph type (Constants::GRAPHTYPE) (default : digraph)

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)
  • *hOpt : Edge attributs

Create a new graph

In:

  • xGraphName : Graph name
  • *hOpt : Graph attributs

Create a new node

In:

  • xNodeName : Name of the new node
  • *hOpt : Node attributs

Return the GraphViz::Node object created

Get the number of edges

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

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

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
    • a file name
    • nil, then the output will be printed to STDOUT
    • String, then the output will be returned as a String
  • :errors : DOT error level (default 1)
    • 0 = Error + Warning
    • 1 = Error
    • 2 = none
save( *hOpt )

Alias for output

[Validate]