Image
[ class tree: Image ] [ index: Image ] [ all elements ]

Class: Image_GraphViz

Source Location: /Image_GraphViz-0.4/GraphViz.php

Class Overview


PEAR::Image_GraphViz


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 57]
PEAR::Image_GraphViz

Purpose

Allows for the creation of and the work with directed and undirected graphs and their visualization with AT&T's GraphViz tools. These can be found at http://www.research.att.com/sw/tools/graphviz/

Example

require_once 'Image/GraphViz.php'; $graph = new Image_GraphViz();

$graph->addNode('Node1', array('URL' => 'http://link1', 'label' => 'This is a label', 'shape' => 'box' ) ); $graph->addNode('Node2', array('URL' => 'http://link2', 'fontsize' => '14' ) ); $graph->addNode('Node3', array('URL' => 'http://link3', 'fontsize' => '20' ) );

$graph->addEdge(array('Node1' => 'Node2'), array('label' => 'Edge Label')); $graph->addEdge(array('Node1' => 'Node2'), array('color' => 'red'));

$graph->image();



[ Top ]


Class Variables

$dotCommand =  'dot'

[line 63]

Path to GraphViz/dot command

Type:   string


[ Top ]

$graph =

[line 77]

Representation of the graph

Type:   array


[ Top ]

$neatoCommand =  'neato'

[line 70]

Path to GraphViz/neato command

Type:   string


[ Top ]



Method Detail

Image_GraphViz (Constructor)   [line 86]

Image_GraphViz Image_GraphViz( [boolean $directed = true], [array $attributes = array()])

Constructor
  • Access: public

Parameters:

boolean   $directed     Directed (true) or undirected (false) graph.
array   $attributes     Attributes of the graph

[ Top ]

addAttributes   [line 222]

void addAttributes( array $attributes)

Add attributes to the graph.
  • Access: public

Parameters:

array   $attributes     Attributes to be added to the graph.

[ Top ]

addEdge   [line 166]

void addEdge( array $edge, [array $attributes = array()])

Add an edge to the graph.
  • Access: public

Parameters:

array   $edge     Start and End node of the edge.
array   $attributes     Attributes of the edge.

[ Top ]

addNode   [line 143]

void addNode( string $name, [array $attributes = array()])

Add a note to the graph.
  • Access: public

Parameters:

string   $name     Name of the node.
array   $attributes     Attributes of the node.

[ Top ]

image   [line 99]

void image( [string $format = 'svg'])

Output image of the graph in a given format.
  • Access: public

Parameters:

string   $format     Format of the output image. This may be one of the formats supported by GraphViz.

[ Top ]

load   [line 261]

void load( string $file)

Load graph from file.
  • Access: public

Parameters:

string   $file     File to load graph from.

[ Top ]

parse   [line 297]

string parse( )

Parse the graph into GraphViz markup.
  • Return: GraphViz markup
  • Access: public

[ Top ]

removeEdge   [line 200]

void removeEdge( array $edge)

Remove an edge from the graph.
  • Access: public

Parameters:

array   $edge     Start and End node of the edge to be removed.

[ Top ]

removeNode   [line 153]

void removeNode( Name $name)

Remove a node from the graph.
  • Access: public

Parameters:

Name   $name     of the node to be removed.

[ Top ]

save   [line 274]

mixed save( [string $file = ''])

Save graph to file.
  • Return: File the graph was saved to, false on failure.
  • Access: public

Parameters:

string   $file     File to save the graph to.

[ Top ]

saveParsedGraph   [line 367]

mixed saveParsedGraph( [string $file = ''])

Save GraphViz markup to file.
  • Return: File to which the GraphViz markup was written, false on failure.
  • Access: public

Parameters:

string   $file     File to write the GraphViz markup to.

[ Top ]

setAttributes   [line 237]

void setAttributes( array $attributes)

Set attributes of the graph.
  • Access: public

Parameters:

array   $attributes     Attributes to be set for the graph.

[ Top ]

setDirected   [line 249]

void setDirected( boolean $directed)

Set directed/undirected flag for the graph.
  • Access: public

Parameters:

boolean   $directed     Directed (true) or undirected (false) graph.

[ Top ]


Documentation generated on Fri, 30 Apr 2004 21:51:44 +0200 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.