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.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78626223a7b68036a13fb4f4ab635f386a75fa50d3105c6a965d6efc738eb037 |
|
MD5 | 3946eea97a571f8a32d195b757a5ac25 |
|
BLAKE2b-256 | 43207f833a3f52768aa33a30e4400c845ae11a3b472e46cb28e0ead294aa1c58 |