# 7.1. WaveDrom¶

WaveDrom provides digital timing diagrams based on a JSON-formatted description of the waveform. See the home page for extensive documentation on how to create these diagrams.

The Runestone extension allows authors to easily include these diagrams in a Runestone book. The code to embed a diagram closely follows the code used to embed GraphViz diagrams, and therefore supports the same options:

.. wavedrom::

Directive to embed wavedrom code. The input WaveJSON code for wavedrom is given as the content; omit the outermost curly braces ({}). For example:

.. wavedrom::

signal: [{ name: "clk", wave: "010101" }]


produces:

options

:align: alignment of the graph (left, center or right)

The horizontal alignment of the graph.

:caption: caption of the graph (text)

The caption of the graph.

:name: label (text)

The label of the graph.

:class: class names (a list of class names separeted by spaces)

The class name of the graph.

As another example: