Skip to content

Commit

Permalink
Add module-level docstring for desmod.dot
Browse files Browse the repository at this point in the history
The new documentation describes and links to relevant Graphviz resources.
  • Loading branch information
jpgrayson committed Feb 1, 2017
1 parent e0a363b commit 2d5550f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions desmod/dot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
"""Generate graphical representation of component hierarchy.
Component hierarchy, connections, and processes can be represented graphically
using the `Graphviz`_ `DOT language`_.
The :func:`component_to_dot()` function produces a DOT language string that can
be rendered into a variety of formats using Graphviz tools. Because the
component hierarchy, connections, and processes are determined dynamically,
:func:`component_to_dot()` must be called with an instantiated component. A
good way to integrate this capabililty into a model is to call
:func:`component_to_dot()` from a component's
:meth:`desmod.component.Component.elab_hook()` method.
The ``dot`` program from `Graphviz`_ may be used to render the generated DOT
language description of the component hierarchy::
dot -Tpng -o foo.png foo.dot
For large component hierarchies, the ``osage`` program (also part of Graphviz)
can produce a more compact layout::
osage -Tpng -o foo.png foo.dot
.. _Graphviz: http://graphviz.org/
.. _DOT language: http://graphviz.org/content/dot-language
"""
from itertools import cycle

from desmod.component import Component
Expand Down

0 comments on commit 2d5550f

Please sign in to comment.