What is this?
This is a really thin shiv that lets you run static d3js scripts to produce SVG / HTML outputs in your Jupyter notebooks. Underneath the covers, it uses d3-node.
Why is this?
Because it makes writing my dissertation easier. I have some dynamic visualizations that are d3-based. But, for the write-up, I also have static snapshots as illustrations. This is my DRY hack. It let’s me reuse the code in a way that isn’t terribly intrusive. (Well, that, and I don’t like out-of-Jupyter-core JS in my notebooks.)
Installation
Assuming you have node and yarn,
pip install d3nb
Usage
The following snippet runs the given cell source with my_node_project_dir as the working directory, then outputs the SVG. If that directory doesn’t exist, you can run the initial cell magic line as, %%d3nb_svg my_node_project_dir --init to set it up.
%%d3nb_svg my_node_project_dir
var D3Node = require('d3-node')
var d3 = require('d3')
var d3n = new D3Node()
var svg = d3n.createSVG()
// See: https://www.npmjs.com/package/d3-node
// ...
console.log(d3n.svgString())
Metadata
Release files for d3nb 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| d3nb-0.0.2.tar.gz | 4.2 kB | Details |
Release files / d3nb-0.0.2.tar.gz
| Download URL | d3nb-0.0.2.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6bc3bbfb9550fef66ff98358e36975304feb7a354a839b2aa3e9656b624c884e
|
|
BLAKE2b-256 checksum How to use checksums |
73b5bf722eccdb6d32c16d0cc7280a03b0c7839ed539bb6d4fc8e9b947b67067
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |