1414from graphtik import base , compose , network , operation , plot
1515from graphtik .modifiers import optional
1616from graphtik .netop import NetworkOperation
17+ from graphtik .network import yield_ops
1718from graphtik .plot import (
1819 Plotter ,
1920 Style ,
@@ -477,7 +478,12 @@ def test_node_dot_str1(dot_str_pipeline, monkeypatch):
477478 monkeypatch .setattr (style , "op_link_target" , "_self" )
478479 monkeypatch .setattr (style , "fn_link_target" , "bad" )
479480
480- dot_str = str (dot_str_pipeline .plot ())
481+ ## Test node-hidding & Graph-overlaying.
482+ #
483+ overlay = nx .DiGraph ()
484+ hidden_op = dot_str_pipeline .net .find_op_by_name ("node" )
485+ overlay .add_node (hidden_op , _no_plot = True )
486+ dot_str = str (dot_str_pipeline .plot (graph = overlay ))
481487 print (dot_str )
482488 exp = """
483489 digraph graph_ {
@@ -486,15 +492,6 @@ def test_node_dot_str1(dot_str_pipeline, monkeypatch):
486492 splines=ortho;
487493 <edge> [shape=invhouse];
488494 <digraph: strict> [shape=invhouse];
489- <node> [label=<<TABLE CELLBORDER="0" CELLSPACING="0" STYLE="rounded">
490- <TR>
491- <TD BORDER="1" SIDES="b" ALIGN="left" TOOLTIP="FunctionalOperation(name='node', needs=['edge', 'digraph: strict'], provides=['<graph>'], fn='add')" HREF="abc#{'dot_path': '_operator.add', 'posix_path': '_operator/add'}" TARGET="bad"
492- ><B>OP:</B> <I>node</I></TD>
493- </TR><TR>
494- <TD ALIGN="left" TOOLTIP="Same as a + b." HREF="abc#{'dot_path': '_operator.add', 'posix_path': '_operator/add'}" TARGET="bad"
495- ><B>FN:</B> <built-in function add></TD>
496- </TR>
497- </TABLE>>, shape=plain, tooltip=<node>];
498495 <<graph>> [shape=house];
499496 <cu:sto:m> [label=<<TABLE CELLBORDER="0" CELLSPACING="0" STYLE="rounded">
500497 <TR>
@@ -505,11 +502,8 @@ def test_node_dot_str1(dot_str_pipeline, monkeypatch):
505502 ><B>FN:</B> test.test_plot.func</TD>
506503 </TR>
507504 </TABLE>>, shape=plain, tooltip=<cu:sto:m>];
508- <edge> -> <node>;
509505 <edge> -> <cu:sto:m>;
510- <digraph: strict> -> <node>;
511506 <digraph: strict> -> <cu:sto:m>;
512- <node> -> <<graph>>;
513507 <cu:sto:m> -> <<graph>>;
514508 legend [URL="https://graphtik.readthedocs.io/en/latest/_images/GraphtikLegend.svg", fillcolor=yellow, shape=component, style=filled, target=_top];
515509 }
0 commit comments