graphid.core.mixin_viz module¶
- class graphid.core.mixin_viz.GraphVisualization[source]¶
Bases:
object
contains plotting related code
- property _error_color¶
- property visual_edge_attrs¶
all edge visual attrs
- property visual_edge_attrs_appearance¶
attrs that pertain to edge color and style
- property visual_edge_attrs_space¶
attrs that pertain to edge positioning in a plot
- property visual_node_attrs¶
- pin_node_layout()[source]¶
Ensures a node layout exists and then sets the pin attribute on each node, which tells graphviz not to change node positions. Useful for making before and after pictures.
- update_visual_attrs(graph=None, show_reviewed_edges=True, show_unreviewed_edges=False, show_inferred_diff=True, show_inferred_same=True, show_recent_review=False, highlight_reviews=True, show_inconsistency=True, wavy=False, simple_labels=False, show_labels=True, reposition=True, use_image=False, edge_overrides=None, node_overrides=None, colorby='name_label', **kwargs)[source]¶
- show_graph(graph=None, use_image=False, update_attrs=True, with_colorbar=False, pnum=(1, 1, 1), zoomable=True, pickable=False, **kwargs)[source]¶
- Parameters:
infr (?)
graph (None) – (default = None)
use_image (bool) – (default = False)
update_attrs (bool) – (default = True)
with_colorbar (bool) – (default = False)
pnum (tuple) – plot number(default = (1, 1, 1))
zoomable (bool) – (default = True)
pickable (bool) – (de = False)
**kwargs – verbose, with_labels, fnum, layout, ax, pos, img_dict, title, layoutkw, framewidth, modify_ax, as_directed, hacknoedge, hacknode, node_labels, arrow_width, fontsize, fontweight, fontname, fontfamilty, fontproperties
Example
>>> # xdoctest: +REQUIRES(module:pygraphviz) >>> from graphid import demo >>> infr = demo.demodata_infr(ccs=util.estarmap( >>> range, [(1, 6), (6, 10), (10, 13), (13, 15), (15, 16), >>> (17, 20)])) >>> pnum_ = util.PlotNums(nRows=1, nCols=3) >>> infr.show_graph(show_cand=True, simple_labels=True, pickable=True, fnum=1, pnum=pnum_()) >>> infr.add_feedback((1, 5), INCMP) >>> infr.add_feedback((14, 18), INCMP) >>> infr.refresh_candidate_edges() >>> infr.show_graph(show_cand=True, simple_labels=True, pickable=True, fnum=1, pnum=pnum_()) >>> infr.add_feedback((17, 18), NEGTV) # add inconsistency >>> infr.apply_nondynamic_update() >>> infr.show_graph(show_cand=True, simple_labels=True, pickable=True, fnum=1, pnum=pnum_()) >>> util.show_if_requested()
- show(graph=None, use_image=False, update_attrs=True, with_colorbar=False, pnum=(1, 1, 1), zoomable=True, pickable=False, **kwargs)¶
- Parameters:
infr (?)
graph (None) – (default = None)
use_image (bool) – (default = False)
update_attrs (bool) – (default = True)
with_colorbar (bool) – (default = False)
pnum (tuple) – plot number(default = (1, 1, 1))
zoomable (bool) – (default = True)
pickable (bool) – (de = False)
**kwargs – verbose, with_labels, fnum, layout, ax, pos, img_dict, title, layoutkw, framewidth, modify_ax, as_directed, hacknoedge, hacknode, node_labels, arrow_width, fontsize, fontweight, fontname, fontfamilty, fontproperties
Example
>>> # xdoctest: +REQUIRES(module:pygraphviz) >>> from graphid import demo >>> infr = demo.demodata_infr(ccs=util.estarmap( >>> range, [(1, 6), (6, 10), (10, 13), (13, 15), (15, 16), >>> (17, 20)])) >>> pnum_ = util.PlotNums(nRows=1, nCols=3) >>> infr.show_graph(show_cand=True, simple_labels=True, pickable=True, fnum=1, pnum=pnum_()) >>> infr.add_feedback((1, 5), INCMP) >>> infr.add_feedback((14, 18), INCMP) >>> infr.refresh_candidate_edges() >>> infr.show_graph(show_cand=True, simple_labels=True, pickable=True, fnum=1, pnum=pnum_()) >>> infr.add_feedback((17, 18), NEGTV) # add inconsistency >>> infr.apply_nondynamic_update() >>> infr.show_graph(show_cand=True, simple_labels=True, pickable=True, fnum=1, pnum=pnum_()) >>> util.show_if_requested()