shamrock.utils.plot.DotGraph#
- class shamrock.utils.plot.DotGraph(dot_source)#
Bases:
objectWrap a Graphviz DOT graph source so it renders as inline SVG.
Meant to display the solver graphs produced by e.g.
model.get_solver_dot_graph()orsetup_node.get_dot()in the sphinx-gallery generated examples: sphinx-gallery captures the_repr_html_of an expression left bare as the last statement of a code block (the same mechanism Jupyter uses for rich display), so no custom scraper is needed. See https://stackoverflow.com/a/65117672 for the technique this is based on._repr_html_is only defined if the graphviz python package (and the Graphvizdotexecutable) are installed; otherwise this falls back to__repr__, i.e. the raw DOT source.Parameters#
- dot_sourcestr
Source of the graph in the DOT language.
Methods