
`WaveDrom <https://wavedrom.com/>`_ is a tool that draws timing diagrams (waveforms) from a simple textual description written in `JSON <https://www.json.org/>`_.
DVT renders WaveDrom waveforms in the :ref:`Inspect View`.
The waveform diagram is updated on the fly (as you type).

.. figure:: ../../images/common/wavedrom_overview.png
	:align: center


The waveform description can be:

-  either embedded in comments, surrounded by **@WAVEDROM_START...@WAVEDROM_END** pragmas
-  or in files with \*.json or \*.json5 extensions

When the waveform description is found in a file with a valid extension, the Inspect View will process it's content and render the diagram when opened.
The waveform description file can also be embedded in comments using the **@WAVEDROM_FILE** pragma, followed by its location. The location of the file will be solved relatively to the project root.

To save the diagram as an SVG file, right-click on it in the Inspect View.

DVT offers the ability to view WaveDrom diagrams through tooltips, by hovering over any waveform written inside DVT editors.

.. tip:: 
  
  The WaveDrom documentation is available `here <https://observablehq.com/@drom/wavedrom>`_.

.. note::

  To specify additional file extensions, use the **+dvt_wavedrom_file_ext_add+<extension>** build config directive.
  To clear the extensions list use **+dvt_wavedrom_file_ext_clear**.

.. note::

  To specify additional search file locations to use in junction with **@WAVEDROM_FILE** pragma, use the **+dvt_wavedrom_files_location_add+<location>** build config directive. To clear the extensions list use **+dvt_wavedrom_files_location_clear**.

.. note::

  By default, only waveform descriptions of maximum 5000 characters are rendered.
  You can change this threshold from **menu Window > Preferences** then **DVT > Editors.**

.. note::

	 DVT uses WaveDrom version 3.5.0.
