alogos._grammar.visualization.tree_with_graphviz
¶
Classes¶
Data structure for wrapping, displaying and exporting a Graphviz graph of a tree. |
Functions¶
|
Represent the derivation tree as Digraph in GraphViz. |
Detailed object descriptions¶
- alogos._grammar.visualization.tree_with_graphviz.create_graphviz_tree(tree, show_node_indices=None, layout_engine=None, fontname=None, fontsize=None, shape_nt=None, shape_unexpanded_nt=None, shape_t=None, fontcolor_nt=None, fontcolor_unexpanded_nt=None, fontcolor_t=None, fillcolor_nt=None, fillcolor_unexpanded_nt=None, fillcolor_t=None)[source]¶
Represent the derivation tree as Digraph in GraphViz.
References
- class alogos._grammar.visualization.tree_with_graphviz.DerivationTreeFigure(given_graph)[source]¶
Data structure for wrapping, displaying and exporting a Graphviz graph of a tree.
- display(self, inline=False)[source]¶
Display the plot in a webbrowser or as IPython rich display representation.
- Parameters:
inline (bool) – If True, the plot will be shown inline in a Jupyter notebook.
- property html_text(self)¶
Create a HTML text representation.
- property html_text_standalone(self)¶
Create a standalone HTML text representation.
- property html_text_partial(self)¶
Create a partial HTML text representation without html, head and body tags.
- property svg_text(self)¶
Create an SVG text representation of the plot, usable in HTML context or SVG file.
- export_html(self, filepath)[source]¶
Export the plot as text file in HTML format.
- Parameters:
filepath (str) – Filepath of the created HTML file. If the file exists it will be overwritten without warning. If the path does not end with “.html” it will be changed to do so. If the parent directory does not exist it will be created.
- Returns:
filepath_used (str) – Filepath of the generated HTML file, guaranteed to end with “.html”.
- export_dot(self, filepath)[source]¶
Export the plot as text file in DOT format.
- Parameters:
filepath (str) – Filepath of the created DOT file. If the file exists it will be overwritten without warning. If the path does not end with “.dot” it will be changed to do so. If the parent directory does not exist it will be created.
- Returns:
filepath_used (str) – Filepath of the generated DOT file, guaranteed to end with “.dot”.
- export_eps(self, filepath)[source]¶
Export the plot as vector graphic in EPS format.
- Parameters:
filepath (str) – Filepath of the created EPS file. If the file exists it will be overwritten without warning. If the path does not end with “.eps” it will be changed to do so. If the parent directory does not exist it will be created.
- Returns:
filepath_used (str) – Filepath of the generated EPS file, guaranteed to end with “.eps”.
- export_gv(self, filepath)[source]¶
Export the plot as text file in GV format.
- Parameters:
filepath (str) – Filepath of the created GV file. If the file exists it will be overwritten without warning. If the path does not end with “.gv” it will be changed to do so. If the parent directory does not exist it will be created.
- Returns:
filepath_used (str) – Filepath of the generated GV file, guaranteed to end with “.gv”.
- export_pdf(self, filepath)[source]¶
Export the plot as vector graphic in PDF format.
- Parameters:
filepath (str) – Filepath of the created PDF file. If the file exists it will be overwritten without warning. If the path does not end with “.pdf” it will be changed to do so. If the parent directory does not exist it will be created.
- Returns:
filepath_used (str) – Filepath of the generated PDF file, guaranteed to end with “.pdf”.
- export_png(self, filepath)[source]¶
Export the plot as raster graphic in PNG format.
- Parameters:
filepath (str) – Filepath of the created PNG file. If the file exists it will be overwritten without warning. If the path does not end with “.png” it will be changed to do so. If the parent directory does not exist it will be created.
- Returns:
filepath_used (str) – Filepath of the generated PNG file, guaranteed to end with “.png”.
- export_ps(self, filepath)[source]¶
Export the plot as vector graphic in PS format.
- Parameters:
filepath (str) – Filepath of the created PS file. If the file exists it will be overwritten without warning. If the path does not end with “.ps” it will be changed to do so. If the parent directory does not exist it will be created.
- Returns:
filepath_used (str) – Filepath of the generated PS file, guaranteed to end with “.ps”.
- export_svg(self, filepath)[source]¶
Export the plot as vector graphic in SVG format.
- Parameters:
filepath (str) – Filepath of the created SVG file. If the file exists it will be overwritten without warning. If the path does not end with “.svg” it will be changed to do so. If the parent directory does not exist it will be created.
- Returns:
filepath_used (str) – Filepath of the generated SVG file, guaranteed to end with “.svg”.