FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=20036&edit=1

  ID: 20036
  Comment by: mcclimont@internode.on.net
  Reported By: mcclimont at internode dot on dot net
  Summary: Patch to enable default values to be set by node,
                     edge, or graph.
  Status: Open
  Type: Feature/Change Request
  Package: Image_GraphViz
  Operating System: Windows 7
  Package Version: 1.3.0
  PHP Version: 5.5.1
  Roadmap Versions:
  New Comment:

Code to generate the expected result:

<?php
require_once 'GraphViz.php';

$graph = new Image_GraphViz(true, array(), 'GraphVis');

$graph->addAttributes(array(
    'graph' => array('fontname' => 'Helvetica-Oblique', 'fontsize' => 24,
'label' => 'GraphVis')
    , 'node' => array('color' => 'white', 'fontname' => 'Helvetica')
    , 'edge' => array('color' => 'red')));

echo $graph->parse();
?>


Previous Comments:
------------------------------------------------------------------------

[2013-08-14 03:09:30] mcclimont

Added #patch
bug:20036;patch:GraphVis_defaultAttributes.diff;revision:1376446170;.

------------------------------------------------------------------------

[2013-08-14 03:08:08] mcclimont

Description:
------------
The DOT Language (http://www.graphviz.org/content/dot-language) defines
that default values can be defined by using a node, edge, or graph
statement.

The patch attached provides support for adding an attribute (node, edge,
graph) which is array of attributes that will be used as the defaults
for any object of the appropriate type.

Expected result:
----------------
strict digraph GraphViz {
     graph [
         fontname="Helvetica-Oblique";
         fontsize=24;
         label=GraphVis;
     ];
     node [
         color=white;
         fontname=Helvetica;
     ];
     edge [
         color=red;
     ];
}

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 14, '13 at 1:45a
activeAug 14, '13 at 1:45a
posts1
users1
websitepear.php.net

1 user in discussion

Mcclimont: 1 post

People

Translate

site design / logo © 2022 Grokbase