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: Feedback
  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:

Daniel,

   I think I have successfully created a pull request for this change.
https://github.com/pear/Image_GraphViz/pull/3

   I have also added a php test to cover this change, though with
extremely limited exposure to pear I don't know if I have the test
integrated in to the project correctly. (I've not made any changes to
the package.xml).

Cheers,
Aaron.


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

[2014-04-20 05:08:37] doconnor

-Status: Open
+Status: Feedback
Can I get you to redo this as a universal diff or even better, a pull
request on github?

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

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

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

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

[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
postedApr 23, '14 at 5:29a
activeApr 23, '14 at 5:29a
posts1
users1
websitepear.php.net

1 user in discussion

Mcclimont: 1 post

People

Translate

site design / logo © 2022 Grokbase