WaveDrom generates diagrams for digital waveforms, bit fields, and simple combinational circuits
Reason this release was yanked:
broken on some python versions
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.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d547fe6f29b7bf3ce33a21698626d28c6ba23176c0635136815ad746b87cb64 |
|
MD5 | 4ad940b7034583c6873bb2afe81b11b9 |
|
BLAKE2b-256 | efb2f2e6cc60b4e3c7aa8d60616ac23ba5beaa23311f9e9441f0ecdddcb97d5c |