8.2.7.1.1. _DspPlot

class _DspPlot(sitemap=None, *args, engines=None, **kwargs)[source]

Methods

__delattr__

Implement delattr(self, name).

__dir__

Default dir() implementation.

__eq__

Return self==value.

__format__

Default object formatter.

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__getstate__

Helper for pickle.

__gt__

Return self>value.

__hash__

Return hash(self).

__init__

__init_subclass__

This method is called when a class is subclassed.

__iter__

Yield the DOT source code line by line (as graph or subgraph).

__le__

Return self<=value.

__lt__

Return self<value.

__ne__

Return self!=value.

__new__

__reduce__

Helper for pickle.

__reduce_ex__

Helper for pickle.

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__

Size of object in memory, in bytes.

__str__

The DOT source code as string.

__subclasshook__

Abstract classes can override this to customize issubclass().

_a_list

Return assembled DOT a_list string.

_attr

Return DOT node statement line.

_attr_list

Return assembled DOT attribute list string.

_attr_plain

_comment

Return comment header line.

_copy_kwargs

Return the kwargs to create a copy of the instance.

_edge

Return DOT digraph edge statement line.

_edge_plain

Return plain DOT edge statement line.

_get_filepath

Return outfile.with_suffix('.gv').

_get_format

Return format inferred from outfile suffix and/or given format.

_get_parameters

_get_pipe_parameters

_get_render_parameters

_getattr_from_dict

Return self.attrname if attrname is in the instance dictionary (as oposed to on the type).

_head

Return DOT digraph head line.

_head_strict

Return DOT strict head line.

_mkdirs

Recursively create directories up to the path of filename as needed.

_node

Return DOT node statement line.

_pipe_future

_pipe_legacy

_quote

Return DOT identifier from string, quote if needed.

_quote_edge

Return DOT edge statement node_id from string, quote if needed.

_repr_image_jpeg

Return the rendered graph as JPEG bytes.

_repr_image_png

Return the rendered graph as PNG bytes.

_repr_image_svg_xml

Return the rendered graph as SVG string.

_repr_mimebundle_

Return the rendered graph as IPython mimebundle.

_subgraph

Return DOT subgraph head line.

_subgraph_plain

Return plain DOT subgraph head line.

_verify_engine

_verify_format

_verify_formatter

_verify_renderer

_view

Start the right viewer based on file format and platform.

_view_darwin

Open filepath with its default application (mac).

_view_freebsd

Open filepath in the user's preferred application (linux, freebsd).

_view_linux

Open filepath in the user's preferred application (linux, freebsd).

_view_windows

Start filepath with its associated application (windows).

attr

Add a general or graph/node/edge attribute statement.

clear

Reset content to an empty body, clear graph/node/egde_attr mappings.

copy

Return a copied instance of the object.

edge

Create an edge between two nodes.

edges

Create a bunch of edges.

node

Create a node.

pipe

Return the source piped through the Graphviz layout command.

render

Save the source to file and render with the Graphviz engine.

save

Save the DOT source to file.

subgraph

Add the current content of the given sole graph argument

unflatten

Return a new Source instance with the source

view

Save the source to file, open the rendered result in a viewer.

__init__(sitemap=None, *args, engines=None, **kwargs)[source]

Attributes

__annotations__

__dict__

__doc__

__module__

__weakref__

list of weak references to the object

_default_extension

_encoding

_engine

_format

_formatter

_jupyter_mimetype

_pipe_lines

Simplify ._pipe_lines() mocking.

_pipe_lines_string

Simplify ._pipe_lines_string() mocking.

_render

Simplify ._render() mocking.

_renderer

_tail

_unflatten

Simplify ``._unflatten mocking.

directed

True

directory

encoding

The encoding for the saved source file.

engine

The layout engine used for rendering ('dot', 'neato', ...).

filepath

The target path for saving the DOT source file.

format

The output format used for rendering ('pdf', 'png', ...).

formatter

The output formatter used for rendering ('cairo', 'gd', ...).

renderer

The output renderer used for rendering ('cairo', 'gd', ...).

source

The generated DOT source code as string.

name

str: DOT source identifier for the graph or digraph statement.

comment

str: DOT source comment for the first source line.

graph_attr

~typing.Dict[str, str]: Attribute-value pairs applying to the graph.

node_attr

~typing.Dict[str, str]: Attribute-value pairs applying to all nodes.

edge_attr

~typing.Dict[str, str]: Attribute-value pairs applying to all edges.

body

~typing.List[str]: Verbatim DOT source lines including final newline.

strict

bool: Rendering should merge multi-edges.

filename

str: Target file name for saving the DOT source file.

_format = 'svg'
__init__(sitemap=None, *args, engines=None, **kwargs)[source]
render(*args, **kwargs)[source]

Save the source to file and render with the Graphviz engine.

Args:
filename: Filename for saving the source

(defaults to name + '.gv').s

directory: (Sub)directory for source saving and rendering. view (bool): Open the rendered result

with the default application.

cleanup (bool): Delete the source file

after successful rendering.

format: The output format used for rendering

('pdf', 'png', etc.).

renderer: The output renderer used for rendering

('cairo', 'gd', …).

formatter: The output formatter used for rendering

('cairo', 'gd', …).

neato_no_op: Neato layout engine no-op flag. quiet (bool): Suppress stderr output

from the layout subprocess.

quiet_view (bool): Suppress stderr output

from the viewer process (implies view=True, ineffective on Windows platform).

outfile: Path for the rendered output file. engine: Layout engine for rendering

('dot', 'neato', …).

raise_if_result_exists: Raise graphviz.FileExistsError

if the result file exists.

overwrite_source: Allow dot to write to the file it reads from.

Incompatible with raise_if_result_exists.

Returns:

The (possibly relative) path of the rendered file.

Raises:
ValueError: If engine, format, renderer, or formatter

are unknown.

graphviz.RequiredArgumentError: If formatter is given

but renderer is None.

ValueError: If outfile is the same file as the source file

unless overwite_source=True.

graphviz.ExecutableNotFound: If the Graphviz dot executable

is not found.

graphviz.CalledProcessError: If the returncode (exit status)

of the rendering dot subprocess is non-zero.

RuntimeError: If viewer opening is requested but not supported.

Example:
>>> doctest_mark_exe()
>>> import graphviz
>>> dot = graphviz.Graph(name='spam', directory='doctest-output')
>>> dot.render(format='png').replace('\\', '/')
'doctest-output/spam.gv.png'
>>> dot.render(outfile='spam.svg').replace('\\', '/')
'doctest-output/spam.svg'
Note:

The layout command is started from the directory of filepath, so that references to external files (e.g. [image=images/camelot.png]) can be given as paths relative to the DOT source file.

__annotations__ = {'directed': 'bool', 'directory': 'typing.Union[str, bytes]'}
__doc__ = None
__module__ = 'schedula.utils.drw.nodes'