WaveDrom generates diagrams for digital waveforms, bit fields, and simple combinational circuits
Reason this release was yanked:
broken cli
Project description
YoWASP WaveDrom package
This package provides a self-contained WaveDrom renderer for JavaScript and Python applications. See the overview of the YoWASP project for details.
Command-line tool
This package installs a command-line tool yowasp-wavedrom
.
Usage: yowasp-wavedrom [<input.json>] [<output.svg>]
API reference (JavaScript)
The @yowasp/wavedrom package has one entry point, render(source): string
. It accepts a JavaScript object in the WaveJSON format and returns an SVG image serialized as a string:
import { render } from '@yowasp/wavedrom';
console.log(render({signal: [{ name: "clk", wave: "p..." }, { name: "data", wave: "01.0" }]}));
// => <svg.../svg>
API reference (Python)
The yowasp-wavedrom package has one entry point, render(source) -> str
. It accepts a Python dictionary in the WaveJSON format and returns an SVG image serialized as a string:
from yowasp_wavedrom import render
print(render({"signal": [{ "name": "clk", "wave": "p..." }, { "name": "data", "wave": "01.0" }]}))
# => <svg.../svg>
Implementation notes
This package embeds the upstream WaveDrom library bundled with the minimal amount of dependencies necessary to produce a serialized SVG, and, for the Python package, with a JavaScript runtime. In addition, the output is post-processed compared to the upstream library as follows:
- The
id
attribute of the root<svg>
element is removed. - The stylesheets are altered to take into account dark color scheme preference via media queries.
- When rendering waveform diagrams, the
default
skin automatically switches between light and dark color scheme, and thelight
skin corresponds to the upstreamdefault
skin.
- When rendering waveform diagrams, the
- Several otherwise blocking bugs are worked around.
Updates
Unlike most YoWASP packages, this package does not automatically track upstream releases. Please open a pull request bumping the version of wavedrom
in package-in.json
if you need a feature from a newer version of WaveDrom.
License
This package is covered by the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for yowasp_wavedrom-3.5.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9abde3fd00fa9e077865ea0385fa6c8667dd9af5edf5d6c3f6e00b9935545b4 |
|
MD5 | c1d2cb0e397e92582baa31aba578697b |
|
BLAKE2b-256 | 0cbd159ad4f2f52c8704a9b9eacf3a1954b3db155db34439938a0b406f3944d0 |