GraphvizOutputProxy

class abjadbooktools.GraphvizOutputProxy(payload, layout='dot', image_layout_specifier=None, image_render_specifier=None)

A Graphviz output proxy.

>>> from abjad.tools import abjadbooktools
>>> meter = metertools.Meter((4, 4))
>>> proxy = abjadbooktools.GraphvizOutputProxy(meter)
>>> print(format(proxy))
abjadbooktools.GraphvizOutputProxy(
    graphtools.GraphvizGraph(
        attributes={
            'bgcolor': 'transparent',
            'fontname': 'Arial',
            'penwidth': 2,
            'truecolor': True,
            },
        children=(
            graphtools.GraphvizNode(
                attributes={
                    'label': '4/4',
                    'shape': 'triangle',
                    },
                ),
            graphtools.GraphvizNode(
                attributes={
                    'label': '1/4',
                    'shape': 'box',
                    },
                ),
            graphtools.GraphvizNode(
                attributes={
                    'label': '1/4',
                    'shape': 'box',
                    },
                ),
            graphtools.GraphvizNode(
                attributes={
                    'label': '1/4',
                    'shape': 'box',
                    },
                ),
            graphtools.GraphvizNode(
                attributes={
                    'label': '1/4',
                    'shape': 'box',
                    },
                ),
            graphtools.GraphvizSubgraph(
                attributes={
                    'style': 'rounded',
                    },
                children=(
                    graphtools.GraphvizNode(
                        attributes={
                            'color': 'white',
                            'fillcolor': 'black',
                            'fontcolor': 'white',
                            'fontname': 'Arial bold',
                            'shape': 'Mrecord',
                            'style': 'filled',
                            },
                        children=(
                            graphtools.GraphvizGroup(
                                children=(
                                    graphtools.GraphvizField(
                                        label='0',
                                        ),
                                    graphtools.GraphvizField(
                                        label='++',
                                        ),
                                    ),
                                ),
                            ),
                        ),
                    graphtools.GraphvizNode(
                        attributes={
                            'color': 'white',
                            'fillcolor': 'black',
                            'fontcolor': 'white',
                            'fontname': 'Arial bold',
                            'shape': 'Mrecord',
                            'style': 'filled',
                            },
                        children=(
                            graphtools.GraphvizGroup(
                                children=(
                                    graphtools.GraphvizField(
                                        label='1/4',
                                        ),
                                    graphtools.GraphvizField(
                                        label='+',
                                        ),
                                    ),
                                ),
                            ),
                        ),
                    graphtools.GraphvizNode(
                        attributes={
                            'color': 'white',
                            'fillcolor': 'black',
                            'fontcolor': 'white',
                            'fontname': 'Arial bold',
                            'shape': 'Mrecord',
                            'style': 'filled',
                            },
                        children=(
                            graphtools.GraphvizGroup(
                                children=(
                                    graphtools.GraphvizField(
                                        label='1/2',
                                        ),
                                    graphtools.GraphvizField(
                                        label='+',
                                        ),
                                    ),
                                ),
                            ),
                        ),
                    graphtools.GraphvizNode(
                        attributes={
                            'color': 'white',
                            'fillcolor': 'black',
                            'fontcolor': 'white',
                            'fontname': 'Arial bold',
                            'shape': 'Mrecord',
                            'style': 'filled',
                            },
                        children=(
                            graphtools.GraphvizGroup(
                                children=(
                                    graphtools.GraphvizField(
                                        label='3/4',
                                        ),
                                    graphtools.GraphvizField(
                                        label='+',
                                        ),
                                    ),
                                ),
                            ),
                        ),
                    graphtools.GraphvizNode(
                        attributes={
                            'shape': 'Mrecord',
                            },
                        children=(
                            graphtools.GraphvizGroup(
                                children=(
                                    graphtools.GraphvizField(
                                        label='1',
                                        ),
                                    graphtools.GraphvizField(
                                        label='++',
                                        ),
                                    ),
                                ),
                            ),
                        ),
                    ),
                edge_attributes={
                    },
                is_cluster=True,
                name='cluster_offsets',
                node_attributes={
                    },
                ),
            ),
        edge_attributes={
            'penwidth': 2,
            },
        is_digraph=True,
        name='G',
        node_attributes={
            'fontname': 'Arial',
            'fontsize': 12,
            'penwidth': 2,
            },
        ),
    layout='dot',
    )
>>> 
>>> proxy.as_latex(relative_output_directory='assets')
['\\noindent\\includegraphics{assets/graphviz-31410f5aefd17473e91ebc219ddff36e.pdf}']

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" [color=1, group=0, label=AbjadValueObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.abctools.AbjadValueObject.AbjadValueObject"; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_abjadbooktools { graph [label=abjadbooktools]; "abjad.tools.abjadbooktools.GraphvizOutputProxy.GraphvizOutputProxy" [color=black, fontcolor=white, group=1, label=<<B>GraphvizOutputProxy</B>>, shape=box, style="filled, rounded"]; "abjad.tools.abjadbooktools.ImageOutputProxy.ImageOutputProxy" [color=2, group=1, label=ImageOutputProxy, shape=oval, style=bold]; "abjad.tools.abjadbooktools.ImageOutputProxy.ImageOutputProxy" -> "abjad.tools.abjadbooktools.GraphvizOutputProxy.GraphvizOutputProxy"; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=3, group=2, label=object, shape=box]; } "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" -> "abjad.tools.abjadbooktools.ImageOutputProxy.ImageOutputProxy"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Attribute summary

as_docutils([configuration, output_directory]) Creates a docutils node representation of the output proxy.
as_latex([configuration, output_directory, ...]) Creates a LaTeX representation of the image output proxy.
file_name_prefix Gets file name prefix of Graphviz output proxy.
file_name_without_extension Gets file name extension of Graphviz output proxy.
image_layout_specifier Gets image specifier.
image_render_specifier Gets image specifier.
layout Gets layout engine name of Graphviz output.
payload Gets images output proxy payload.
render_for_latex(absolute_output_directory) Renders the image output proxy payload for LaTeX inclusion.
__copy__(*arguments) Copies Abjad value object.
__eq__(argument) Is true when all initialization values of Abjad value object equal the initialization values of argument.
__format__([format_specification]) Formats Abjad object.
__hash__() Hashes Abjad value object.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of Abjad object.

Read-only properties

GraphvizOutputProxy.file_name_prefix

Gets file name prefix of Graphviz output proxy.

Returns string.

GraphvizOutputProxy.file_name_without_extension

Gets file name extension of Graphviz output proxy.

Returns string.

(ImageOutputProxy).image_layout_specifier

Gets image specifier.

(ImageOutputProxy).image_render_specifier

Gets image specifier.

GraphvizOutputProxy.layout

Gets layout engine name of Graphviz output.

Returns string.

(ImageOutputProxy).payload

Gets images output proxy payload.

Returns string.

Methods

GraphvizOutputProxy.as_docutils(configuration=None, output_directory=None)

Creates a docutils node representation of the output proxy.

>>> for node in proxy.as_docutils():
...     print(node.pformat())
... 
<abjad_output_block image_layout_specifier="True" image_render_specifier="True" layout="dot" renderer="graphviz" xml:space="preserve">
    digraph G {
        graph [bgcolor=transparent,
            fontname=Arial,
            penwidth=2,
            truecolor=true];
        node [fontname=Arial,
            fontsize=12,
            penwidth=2];
        edge [penwidth=2];
        node_0 [label="4/4",
            shape=triangle];
        node_1 [label="1/4",
            shape=box];
        node_2 [label="1/4",
            shape=box];
        node_3 [label="1/4",
            shape=box];
        node_4 [label="1/4",
            shape=box];
        subgraph cluster_cluster_offsets {
            graph [style=rounded];
            node_5_0 [color=white,
                fillcolor=black,
                fontcolor=white,
                fontname="Arial bold",
                label="{ <f_0_0> 0 | <f_0_1> ++ }",
                shape=Mrecord,
                style=filled];
            node_5_1 [color=white,
                fillcolor=black,
                fontcolor=white,
                fontname="Arial bold",
                label="{ <f_0_0> 1/4 | <f_0_1> + }",
                shape=Mrecord,
                style=filled];
            node_5_2 [color=white,
                fillcolor=black,
                fontcolor=white,
                fontname="Arial bold",
                label="{ <f_0_0> 1/2 | <f_0_1> + }",
                shape=Mrecord,
                style=filled];
            node_5_3 [color=white,
                fillcolor=black,
                fontcolor=white,
                fontname="Arial bold",
                label="{ <f_0_0> 3/4 | <f_0_1> + }",
                shape=Mrecord,
                style=filled];
            node_5_4 [label="{ <f_0_0> 1 | <f_0_1> ++ }",
                shape=Mrecord];
        }
        node_0 -> node_1;
        node_0 -> node_2;
        node_0 -> node_3;
        node_0 -> node_4;
        node_1 -> node_5_0 [style=dotted];
        node_1 -> node_5_1 [style=dotted];
        node_2 -> node_5_1 [style=dotted];
        node_2 -> node_5_2 [style=dotted];
        node_3 -> node_5_2 [style=dotted];
        node_3 -> node_5_3 [style=dotted];
        node_4 -> node_5_3 [style=dotted];
        node_4 -> node_5_4 [style=dotted];
    }

Returns list of docutils nodes.

(ImageOutputProxy).as_latex(configuration=None, output_directory=None, relative_output_directory=None)

Creates a LaTeX representation of the image output proxy.

(ImageOutputProxy).render_for_latex(absolute_output_directory)

Renders the image output proxy payload for LaTeX inclusion.

Special methods

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

(AbjadValueObject).__eq__(argument)

Is true when all initialization values of Abjad value object equal the initialization values of argument.

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

(AbjadValueObject).__hash__()

Hashes Abjad value object.

Returns integer.

(AbjadObject).__ne__(argument)

Is true when Abjad object does not equal argument. Otherwise false.

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.