protected function addNode(BaseGraph $graph, $nodeId, array $components, Node $parentNode = null)
    {
        $absNodeId = (($parentNode instanceof Node) ? $parentNode->getId() : '/').$nodeId;
        $graph->node(
            $absNodeId,
            [
                'label' => $nodeId,
                'shape' => 'none',
                'style' => 'none',
            ]
        );

        if ($parentNode instanceof Node) {
            $graph->edge(
                [$parentNode->getId(), $absNodeId], ['arrowhead' => 'none', 'color' => 'darkgrey', 'penwidth' => .5]
            );
        }

        return $this->addComponents($graph, $components, $graph->get($absNodeId));
    }
protected function addNode(BaseGraph $graph, $nodeId, array $components, Node $parentNode = null)
    {
        $absNodeId = (($parentNode instanceof Node) ? $parentNode->getId() : '/').$nodeId;
        $graph->node(
            $absNodeId,
            [
                'label' => $nodeId,
                'shape' => 'none',
                'style' => 'none',
            ]
        );

        if ($parentNode instanceof Node) {
            $graph->edge(
                [$parentNode->getId(), $absNodeId], ['arrowhead' => 'none', 'color' => 'darkgrey', 'penwidth' => .5]
            );
        }

        return $this->addComponents($graph, $components, $graph->get($absNodeId));
    }
protected function addNode ( BaseGraph $ graph , $ nodeId , array $ components , Node $ parentNode = null ) { $ absNodeId = ( ( $ parentNode instanceof Node ) ? $ parentNode -> getId ( ) : '/' ) . $ nodeId ; $ graph -> node ( $ absNodeId , [ 'label' => $ nodeId , 'shape' => 'none' , 'style' => 'none' , ] ) ; if ( $ parentNode instanceof Node ) { $ graph -> edge ( [ $ parentNode -> getId ( ) , $ absNodeId ] , [ 'arrowhead' => 'none' , 'color' => 'darkgrey' , 'penwidth' => .5 ] ) ; } return $ this -> addComponents ( $ graph , $ components , $ graph -> get ( $ absNodeId ) ) ; }
Add a node to a graph

@param BaseGraph $graph  Graph
@param string $nodeId    Node ID
@param array $components Component list
@param Node $parentNode  Parent node

@return BaseGraph Graph
Add a node to a graph