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:
A basic clock waveform.¶
.. wavedrom::
:caption: A basic clock waveform.
:align: right
signal: [{ name: "Alfa", wave: "01.zx=ud.23.456789" }]
Before you keep reading...
Runestone Academy can only continue if we get support from individuals like you. As a student you are well aware of the high cost of textbooks. Our mission is to provide great books to you for free, but we ask that you consider a $10 donation, more if you can or less if $10 is a burden.