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

Class: Image_GraphViz

Source Location: /Image_GraphViz-0.3/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->add_node('Node1', array('URL' => 'http://link1', 'label' => 'This is a label', 'shape' => 'box' ) ); $graph->add_node('Node2', array('URL' => 'http://link2', 'fontsize' => '14' ) ); $graph->add_node('Node3', array('URL' => 'http://link3', 'fontsize' => '20' ) );

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

$graph->image();



[ Top ]


Class Variables

$dot_command =  '/path/to/dot'

[line 63]

Path to GraphViz/dot command

Type:   string


[ Top ]

$graph =

[line 77]

Representation of the graph

Type:   array


[ Top ]

$neato_command =  '/path/to/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 ]

add_attributes   [line 207]

void add_attributes( array $attributes)

Add attributes to the graph.
  • Access: public

Parameters:

array   $attributes     Attributes to be added to the graph.

[ Top ]

add_edge   [line 151]

void add_edge( 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 ]

add_node   [line 128]

void add_node( 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 246]

void load( string $file)

Load graph from file.
  • Access: public

Parameters:

string   $file     File to load graph from.

[ Top ]

parse   [line 282]

string parse( )

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

[ Top ]

remove_edge   [line 185]

void remove_edge( array $edge)

Remove an edge from the graph.
  • Access: public

Parameters:

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

[ Top ]

remove_node   [line 138]

void remove_node( Name $name)

Remove a node from the graph.
  • Access: public

Parameters:

Name   $name     of the node to be removed.

[ Top ]

save   [line 259]

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 ]

save_parsed_graph   [line 352]

mixed save_parsed_graph( [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 ]

set_attributes   [line 222]

void set_attributes( array $attributes)

Set attributes of the graph.
  • Access: public

Parameters:

array   $attributes     Attributes to be set for the graph.

[ Top ]

set_directed   [line 234]

void set_directed( 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:43:06 +0200 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.