File: graphviz.rst

package info (click to toggle)
pydata-sphinx-theme 0.16.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,088 kB
  • sloc: python: 2,796; javascript: 701; makefile: 42; sh: 12
file content (29 lines) | stat: -rw-r--r-- 839 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
========
Graphviz
========

Inheritance Diagram
-------------------

If you use :mod:`sphinx.ext.inheritance_diagram` to generate inheritance diagrams with
:mod:`sphinx.ext.graphviz`, and you output the inheritance diagrams in SVG format,
they will automatically adapt to this theme's light or dark mode.

To have the inheritance-diagram render to SVG, inside ``conf.py``, you need
the following option.

.. code-block:: python

    # conf.py
    ...
    graphviz_output_format = 'svg'
    ...

Below is an example of the inheritance diagram for ``matplotlib.figure.Figure``.
Try toggling light/dark mode to see it adapt!

.. inheritance-diagram:: matplotlib.figure.Figure

See the sphinx inheritance-diagram `documentation`_ for more information.

.. _documentation: https://www.sphinx-doc.org/en/master/usage/extensions/inheritance.html