Changelogs » Graphviz






Improve handling of escaped quotes (``\"``). Different from other layout engine
escapes sequences such as ``\l`` and ``\N`` (which are passed on as is by
default), there is no use case for backslash-escaping a literal quote character
because escaping of quotes is done by this library. Therefore, a
backslash-escaped quote (e.g. in ``label='\\"'``) is now treated the same as a
plain unescaped quote, i.e. both ``label='"'`` and ``label='\\"'`` produce
the same DOT source ``[label="\""]`` (a label that renders as a literal quote).
Before this change, use of ``'\\"'`` could break the quoting mechanism creating
invalid or unintended DOT, possibly leading to syntax errors from the rendering

Add notebook section to documentation.

Add ``sphinx.ext.viewcode`` to docs (note that this currently lacks links for
methods, so that not all of the code is linked; use the source repo for reading

Improve test and doc building config.



Fix missing support for four-part versions in ``graphviz.version()``.



Tag Python 3.8 support.

Fix quoting for non-ASCII numerals.



Add explicit support for layout engine escape sequences such as ``\l`` and
``\N``. These already worked implicitly before but where broken by backslash
escaping in ``0.12``, which is reverted by this release. Escaping now resembles
the stdlib ``re`` module: literal backslashes need to be escaped (doubled),
which is most conveniently done by using raw string literals for strings that
use escape sequences (including escaped backslashes), e.g. ``label=r'\\'``.

Add ``escape()`` function (resembling ``re.escape()``) for disabling all
meta-characters in a string for rendering.

Use ``logging`` in example notebook, add notebooks demonstrating layout engines
and escape sequence usage, improve tests with parametrization.



Fix missing escaping of backslashes, e.g. in labels (pull request DNGros).

Add ``quiet`` argument to standalone ``view()`` function, and ``quiet_view``
argument on ``.render()`` and ``.view()`` methods. Supresses the ``stderr``
output of started viewer processes (unavailable on Windows).

Add basic debug logging via the stdlib ``logging`` module.

Reformatted some examples, improved tests by using autospec for mocks.



Include ``stderr`` in ``str()`` of raised ``subprocess.CalledProcessError``.



Add ``quiet`` argument to ``.render()`` and ``.pipe()`` methods of ``Graph``,
``Digraph``, and ``Source`` objects, allowing to suppress ``stderr`` of the
layout subprocess (parity with stand-alone ``render()`` and ``pipe()``

The rendering process for ``render()`` methods and stand-alone function is now
started from the directory of the rendered dot source file. This allows to
render graph descriptions that use relative paths inline (e.g. for referring to
image files to be included) by using paths relative to the source file
location. Previously, such relative paths would need to be given relative to
the directory from which ``render()`` was  started, so this change is backwards
incompatible for code that relied on the previous behaviour.

Drop Python 3.4 support.



Fix broken renderer argument in ``pipe()`` method and function.



Add ``format`` argument to ``Graph/Digraph.render()``. This follows stand-alone
``render()`` function and mirrors the ``Graph/Digraph.pipe()`` method (usually,
``format`` is set on the instance).

Add ``renderer`` and ``formatter`` arguments to ``Graph/Digraph.render()`` and
``pipe()`` methods, as well as stand-alone ``render()`` and ``pipe()`` functions.



Use ``sys.stderr`` to write stderr output from rendering process to stderr
(instead of file descriptor inheritance). Ensures stderr is passed in special
environments such as IDLE.

Suppress rendering process ``stdout`` in ``render()``.

Make ``quiet=True`` also suppress ``stderr`` on success of ``render()`` and
``pipe()`` (exit-status ``0``).

Include ``stderr`` from rendering process in ``CalledProcessError`` exception.



Tag Python 3.7 support (work around subprocess ``close_fds`` issue on Windows).



Fix compatibility with ``python -OO``.



Add ``nohtml()`` to support labels of the form ``'<...>'`` (disabling their default
treatment as HTML strings).

Make default ``'utf-8'`` ``encoding`` more visible.

Set ``encoding = locale.getpreferredencoding()`` when ``encoding`` argument/property is
set to ``None`` explicitly (follow stdlib ```` behaviour).



Add ``Source.from_file()``-classmethod (simpler in-line SVG display of ready-made
.gv files within Jupyter).

Drop Python 3.3 support.



Add ``clear()``-method for ``Graph`` and ``Digraph``.

Add ``grapviz.version()`` function.

Drop dot source extra indent for edge statements following dotguide examples.

Include LICENSE file in wheel.



Fix ``TypeError`` in ``graphviz.pipe()`` with invalid dot code under Python 3.

Add ``copy()``-method for ``Graph``, ``Digraph``, and ``Source``.

Add ``graphviz.render(..., quiet=True)``.

Fix ``graphivz.view()`` exception on unsupported platform.

Raise a dedicated ``RuntimeError`` subclass ``graphviz.ExecutableNotFound`` when the
Graphviz executables are not found.

Port tests from ``nose/unittest`` to ``pytest``, extend, use mocks.



Support setting top-level attrs with ``g.attr(key=value)``.

Add context manager usage of ``subgraph()`` for adding a subgraph in a with-block.

Add json-based output formats to known ``FORMATS`` (Graphviz 2.40+).

Drop extra indent level for DOT source with nonempty ``graph/node/edge_attr``.

Add a final newline to a saved DOT source file if it does not end with one.

Raise ``subprocess.CalledProcessError`` on non-zero exit status from rendering.

Raise early when adding a ``subgraph()`` with ``strict=True`` (avoid DOT syntax error).

Make undocumented ``quote()``, ``quote_edge()``, and ``attributes()`` methods private.



Drop Python 2.6 support (use ``graphviz<0.6`` there).

Improve tests for ``mkdirs()``.

Better document adding custom DOT using the ``body`` attribute.

Add ``view()``-support for FreeBSD (pull request Julien Gamba).



Add ``ENGINES`` and ``FORMATS`` to the documented public API.



Fixed PY3 compatibility.



Add low-level functions ``render()``, ``pipe()``, and ``view()`` for directly working with
existing files and strings.

Support all ``render()``-arguments in the ``view()``-short-cut-method.



Added ``'patchwork'`` engine.



Add support for ``strict`` graphs and digraphs.

Hide ``render/pipe()`` subprocess console window on Windows when invoked from
non-console process (e.g. from IDLE).

Improve documentation markup/wording.

Make ``TestNoent`` more robust.



Make ``_repr_svg_()`` available on ``Source`` (pull request RafalSkolasinski).



Fixed ``view()``-method on Linux under Python 3 (pull request Antony Lee).



Fixed ``view()``-method on Linux and Darwin (pull request Eric L. Frederich).



Added example for HTML-like labels (````).

Added ``Source`` class for rendering verbatim DOT source code.

Added Python 2.6 support (pull request Jim Crist).



Added the ``pipe()``-method directly returning the ``stdout`` of rendering.

Added ``_repr_svg_()`` for inline rendering in IPython notebooks.



Added examples generating some of the graphs from the Graphviz Gallery.

Added sphinx-based API documentation.



Added support for HTML-like labels.



Added support for less common output formats. Removed dropped formats (``'dia'``, ``'pcl'``).

Added ``'osage'`` layout engine.

Documented ``format`` and ``engine`` options in the README.

The ``view()`` convenience method now returns the result file name (like render()).



Added ``attr()`` method for inline switching of node/edge attributes.

Added ``subgraph()`` method (obsoletes separate ``Subgraph`` class).

Add ``cleanup`` option to ``render()``.

Replaced ``dry`` option on ``render()`` with separate ``save()`` method.

Removed undocumented ``append()`` and ``extend()`` methods (if needed, the ``body``
attribute can be edited directly).



Skip empty ``comment`` when creating DOT source.

Document ``graph_attr``, ``node_attr``, and ``edge_attr`` in the README.

More informative exception when Graphviz executables cannot be called.



Fixed missing identifier quoting for DOT keywords (thanks to Paulo Urio).



Made ``format`` and ``engine`` case-insensitive.



Indent ``graph_attr``, ``node_attr``, and ``edge_attr`` lines, adapt nodes and edges.



Fixed ``view()`` failing on paths with forward slashes on Windows.



Added Python 3.3+ support.

Made attributes order stable (sorting plain dicts).

Fixed edgeop in undirected graphs.



Support pdf opening on Linux.

Fixed rendering filenames w/spaces.



Fixed rendering on Mac OS X.



Added format selection, use ``'PDF``' as default.
Added engines selection, use ``'dot'`` as default.
Added source encoding, use ``'UTF-8'`` as default.

Changed constructor arguments order, removed ``compile()`` and ``save()``-method,
reimplemented compilation in ``render()`` method, make interface more similar to
gv.3python (backwards incompatible change).

Double-quote-sign escaping, attribute list quoting.

``mkdirs()`` now correctly supports current directory filenames.



Removed automatic ``'-'`` to ``'&minus;'`` replacement from labels.

Fixed documentation typos.



First public release.