tags:

views:

358

answers:

2

Has anyone used graphviz-php and if so do they know where I can find any documentation regarding its usage/class structure etc?

Please note that this is the graphviz-php not the pear (image_graphviz).

Thanks

A: 

http://pear.php.net/package/Image_GraphViz/docs/latest/GraphViz/Image_GraphViz.html contains a usage example

Dominik
I saw this one but I installed the php-graphviz rpm is that not different to the pear version?
aHunter
I have just checked and it does appear to be different I there is also a php-pear-image-graphviz rpm.
aHunter
What does rpm -qi php-graphviz show you ?
Dominik
Name : graphviz-php Relocations: (not relocatable)Version : 2.16.1 Vendor: Fedora ProjectRelease : 0.6.fc10 Build Date: Mon 07 Jul 2008 07:22:19 PM BSTGroup : Applications/Multimedia Source RPM: graphviz-2.16.1-0.6.fc10.src.rpmPackager : Fedora ProjectURL : http://www.graphviz.org/Summary : PHP extension for graphvizDescription : PHP extension for graphviz.
aHunter
A: 

I have found an explanation of the graphviz.php as below.

The GraphViz class allows for the creation of and the work with directed and undirected graphs and their visualization with AT&T's GraphViz tools.


  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();

aHunter