Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.0

Bug #17214 Can not bind port "A" node "1" to another port "B" of that node "1"
Submitted: 2010-03-11 21:43 UTC
From: yoann59 Assigned:
Status: Open Package: Image_GraphViz (version 1.3.0RC3)
PHP Version: 5.2.10 OS: Ubuntu
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 49 - 45 = ?

 
 [2010-03-11 21:43 UTC] yoann59 (Yoann Brieux)
Description: ------------ -------- English -------- Can not bind port "A" node "1" to another port "B" of that node "1" It is impossible to bind a port to another port of one node. Indeed, to do this link, we pass an array as a key node, and value as the port. However, it is not possible to put twice the same key in an array (the first key is overwritten by the second) The port of the second parameter is linked to itself. Function : addEdge -------------------- French / Français -------------------- Impossible de lier un port "A" du noeud "1" vers un autre port "B" de ce même noeud "1" Il est impossible de pouvoir lier un port vers un autre port d'un seul nœud. En effet, pour effectuer cette liaison, nous faisons passer un tableau avec comme clé le noeud, et comme valeur le port. Or, il n'est pas possible de mettre deux fois la même clé dans un tableau (la première clé est écrasé par la deuxième) Le port du deuxième paramètre est donc lier à lui même. Fonction : addEdge Test script: --------------- // $node_output = 1, $node_input = 1 // $port_input = 2, $port_output = 3 // -> $node_output == $node_input $ports = array($node_output => $port_output, $node_input => $port_input); $_graph->addEdge(array($node_output => $node_input), array('URL' => '#', 'color' => 'blue'), $ports); // The port number 3 is linked to itself. Expected result: ---------------- // MyScript $ports = array(array($node_output => $plugin_output), array($node_input => $plugin_input)); $_graph->addEdge(array($node_output => $node_input), array('URL' => '#', 'color' => 'blue'), $ports); // Image_Graphiz function addEdge($edge, $attributes = array(), $ports = array()) { // ... if (is_array($ports)) { if(!is_array($ports[0])) { $ports[0] = array($ports[0]); } if(!is_array($ports[1])) { $ports[0] = array($ports[1]); } if (array_key_exists($from, $ports[0])) { $info['portFrom'] = $ports[0][$from]; } if (array_key_exists($to, $ports[1])) { $info['portTo'] = $ports[1][$to]; } } // ... } Actual result: -------------- The port No. 3 is connected to port No. 2

Comments