svn: /pear/peardoc/trunk/en/package/ images/image-graphviz/about.xml images/image-graphviz/example.xml images/image-graphviz/examples/simple.php images/image-graphviz/images/simple.png images/image-graphviz.xml images-entities.xml

[email protected] (Christian Weiske)
Newsgroups php.pear.doc
Message-ID <[email protected]>
cweiske                                  Fri, 04 Sep 2009 21:47:07 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=288071

Log:
add a little image_graphviz documentation

Changed paths:
    A   pear/peardoc/trunk/en/package/images/image-graphviz/
    A   pear/peardoc/trunk/en/package/images/image-graphviz/about.xml
    A   pear/peardoc/trunk/en/package/images/image-graphviz/example.xml
    A   pear/peardoc/trunk/en/package/images/image-graphviz/examples/
    A   pear/peardoc/trunk/en/package/images/image-graphviz/examples/simple.php
    A   pear/peardoc/trunk/en/package/images/image-graphviz/images/
    A   pear/peardoc/trunk/en/package/images/image-graphviz/images/simple.png
    A   pear/peardoc/trunk/en/package/images/image-graphviz.xml
    U   pear/peardoc/trunk/en/package/images-entities.xml

Added: pear/peardoc/trunk/en/package/images/image-graphviz/about.xml
===================================================================
--- pear/peardoc/trunk/en/package/images/image-graphviz/about.xml	                        (rev 0)
+++ pear/peardoc/trunk/en/package/images/image-graphviz/about.xml	2009-09-04 21:47:07 UTC (rev 288071)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<chapter xmlns="http://docbook.org/ns/docbook" version="lillet"
+ xml:id="package.images.image-graphviz.about"
+>
+ <info>
+  <title>About Image_GraphViz</title>
+ </info>
+
+ <para>
+  <classname>Image_GraphViz</classname> is a class that provides
+  methods to generate graphviz (dot) files. It also calls graphviz
+  with all necessary parameters and outputs the generated image
+  to the browser, or stores it into a file.
+ </para>
+ <para>
+  The package supports clusters, nodes, edges and all attributes
+  to either of them. Apart from that, <classname>Image_GraphViz</classname>
+  is able to store and load its own graph definition files.
+ </para>
+ <para>
+  While it abstracts the actual generation of dot files, one still needs
+  to know the
+  <emphasis>dot attributed graph language</emphasis>
+  to take full advantage of the package - especially for style and layout
+  adjustments.
+ </para>
+
+</chapter>

Added: pear/peardoc/trunk/en/package/images/image-graphviz/example.xml
===================================================================
--- pear/peardoc/trunk/en/package/images/image-graphviz/example.xml	                        (rev 0)
+++ pear/peardoc/trunk/en/package/images/image-graphviz/example.xml	2009-09-04 21:47:07 UTC (rev 288071)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<chapter
+ xmlns="http://docbook.org/ns/docbook"
+ xmlns:phd="http://www.php.net/ns/phd"
+ version="lillet"
+ xml:id="package.images.image-graphviz.example"
+>
+ <info>
+  <title>A simple graphviz example</title>
+ </info>
+
+ <para>
+  The following code shows how to use
+  <classname>Image_GraphViz</classname> the easiest way
+  possible - generate a simple directed graph and send it as
+  SVG image to the browser.
+ </para>
+
+ <programlisting role="php">
+  <xi:include parse="text"
+   xmlns:xi="http://www.w3.org/2001/XInclude"
+   href="&package.images.image-graphviz.examples.simple.php;"
+  >
+   <xi:fallback>FIXME:MISSING XINCLUDE CONTENT</xi:fallback>
+  </xi:include>
+ </programlisting>
+
+ <para>
+  The example above will display in your browser as follows:
+ </para>
+
+ <figure>
+  <screenshot>
+   <mediaobject>
+    <alt>Simple example output</alt>
+    <imageobject>
+     <imagedata
+      align="center" format="png"
+      fileref="en/package/images/image-graphviz/images/simple.png"
+     />
+    </imageobject>
+   </mediaobject>
+  </screenshot>
+ </figure>
+
+ <para>
+   The <phd:pearapi phd:package="Image_GraphViz"
+   phd:linkend="Image_GraphViz">constructor</phd:pearapi> does not need
+   any parameters, but one may tell it if the graph is directed,
+   an array of attributes and the name of the graph.
+ </para>
+
+ <para>
+  To generate content, serveral methods are available:
+  <phd:pearapi phd:package="Image_GraphViz"
+   phd:linkend="Image_GraphViz::addEdge()">addEdge()</phd:pearapi>,
+  <phd:pearapi phd:package="Image_GraphViz"
+   phd:linkend="Image_GraphViz::addNode()">addNode()</phd:pearapi>,
+  and <phd:pearapi phd:package="Image_GraphViz"
+   phd:linkend="Image_GraphViz::addCluster()">addCluster()</phd:pearapi>.
+ </para>
+
+ <para>
+  Calling graphviz' <emphasis>dot</emphasis> or <emphasis>neato</emphasis>
+  is being done by <classname>Image_GraphViz</classname> implicitly
+  when calling
+  <phd:pearapi phd:package="Image_GraphViz"
+   phd:linkend="Image_GraphViz::image()">image()</phd:pearapi>
+  or
+  <phd:pearapi phd:package="Image_GraphViz"
+   phd:linkend="Image_GraphViz::fetch()">fetch()</phd:pearapi>.
+  Both can be used to generate and display/return image data in
+  a large number of image formats, including
+  <literal>svg</literal>, <literal>png</literal>, <literal>pdf</literal>
+  and <literal>plain</literal> text.
+ </para>
+
+</chapter>

Added: pear/peardoc/trunk/en/package/images/image-graphviz/examples/simple.php
===================================================================
--- pear/peardoc/trunk/en/package/images/image-graphviz/examples/simple.php	                        (rev 0)
+++ pear/peardoc/trunk/en/package/images/image-graphviz/examples/simple.php	2009-09-04 21:47:07 UTC (rev 288071)
@@ -0,0 +1,8 @@
+<?php
+require_once 'Image/GraphViz.php';
+
+$gv = new Image_GraphViz();
+$gv->addEdge(array('wake up'        => 'visit bathroom'));
+$gv->addEdge(array('visit bathroom' => 'make coffee'));
+$gv->image();
+?>
\ No newline at end of file

Added: pear/peardoc/trunk/en/package/images/image-graphviz/images/simple.png
===================================================================
(Binary files differ)


Property changes on: pear/peardoc/trunk/en/package/images/image-graphviz/images/simple.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: pear/peardoc/trunk/en/package/images/image-graphviz.xml
===================================================================
--- pear/peardoc/trunk/en/package/images/image-graphviz.xml	                        (rev 0)
+++ pear/peardoc/trunk/en/package/images/image-graphviz.xml	2009-09-04 21:47:07 UTC (rev 288071)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<book xmlns="http://docbook.org/ns/docbook" version="lillet"
+ xml:id="package.images.image-graphviz"
+>
+ <info>
+  <title>Image_GraphViz</title>
+  <abstract>
+   <para>
+    <classname>Image_GraphViz</classname> provides an object oriented
+    wrapper to generate and output dot files.
+   </para>
+  </abstract>
+ </info>
+
+ &package.images.image-graphviz.about;
+ &package.images.image-graphviz.example;
+
+</book>

Modified: pear/peardoc/trunk/en/package/images-entities.xml
===================================================================
--- pear/peardoc/trunk/en/package/images-entities.xml	2009-09-04 20:48:16 UTC (rev 288070)
+++ pear/peardoc/trunk/en/package/images-entities.xml	2009-09-04 21:47:07 UTC (rev 288071)
@@ -1,5 +1,6 @@
 &package.images.image-barcode;
 &package.images.image-canvas;
 &package.images.image-graph;
+&package.images.image-graphviz;
 &package.images.image-text;
 &package.images.image-transform;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.