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.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed2fa93317b5ededbc5789ce7285fd5be8797a7b9cc9f833fd2250672bf14faf |
|
MD5 | cf80fef9d7d6208402ded94fe253257a |
|
BLAKE2b-256 | 36afa4f152c92e617abf807e92af5a2eb3df26287ce9fafa25ac574082b6a5da |