# d3blocks turns a pandas DataFrame into an interactive d3 chart

> d3blocks is a Python package that wraps the d3 javascript library behind named chart functions such as d3.sankey() and d3.chord(), producing interactive, stand-alone HTML output for notebooks, Colab and Streamlit apps.

**d3blocks/d3blocks** — The Python library to create stand-alone and interactive d3 charts.

- Repository: https://github.com/d3blocks/d3blocks
- Stars: 769 · Forks: 68
- Language: Jupyter Notebook
- License: GPL-3.0
- Published: 2026-10-21 · Updated: 2026-10-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/d3blocks-d3blocks

## Named chart functions instead of a javascript layer you maintain

d3blocks is a Python package that builds on the graphics of d3 javascript, and its whole pitch is that you can create the charts you want with a few lines of Python code. The audience it names is data scientists, and the problem it solves is specific. d3 has an enormous amount of capability, but using it from a notebook means writing javascript, wiring up a rendering container and maintaining that code. d3blocks moves that work into the package, so the Python side is a call. The output is interactive and stand-alone, which is the property that matters when a chart has to be emailed to someone or opened from a file system, and it is also why the project advertises itself as interactive charts without deployment friction, in the title of the Medium article the documentation links to. The trade-off is the usual one with a wrapper library. You get the chart types the package implements and not the whole d3 feature set, and a chart that needs a custom layout or an unusual interaction means going around the wrapper rather than extending it.

## Twelve blocks, each with its own function name

The available charts are listed as a table, and each entry pairs a name with the exact function to call. D3graph is d3.d3graph(), Radialgraph is d3.radialgraph(), Elasticgraph is d3.elasticgraph(), and the Sankey diagram is d3.sankey(). The set continues with Movingbubbles as d3.movingbubbles(), Scatter as d3.scatter(), Heatmap as d3.heatmap(), the Chord diagram as d3.chord(), Timeseries as d3.timeseries(), the Image slider as d3.imageslider() and the Violin plot as d3.violin(), with Particles listed as well. The naming is worth noting because it tells you the shape of the API: every block is reached through the d3 namespace in the same way, so a notebook that uses a heatmap and a Sankey diagram reads consistently. Each block has its own documentation page on the Sphinx site, linked from the table, with a description and further reading. The blocks are specialised by design rather than being general purpose plotting primitives, which is the right trade for a library aimed at producing a finished chart in a few lines, and the wrong one if your data needs a layout the table does not list.

## d3graph and a dependency list that does the heavy lifting

The package manifest shows a dependency set built around data work rather than plotting. The declared requirements are numpy, pandas, tqdm, jinja2, requests, scikit-learn, colourmap at 1.1.10 or newer, datazets at 0.1.7 or newer, ismember at 1.0.1 or newer and d3graph at 3.2.0 or newer:

```toml
dependencies = [
    'numpy',
    'colourmap>=1.1.10',
    'datazets>=0.1.7',
    'd3graph>=3.2.0',
    'ismember>=1.0.1',
    'pandas',
    'tqdm',
    'requests',
    'jinja2',
    'scikit-learn',
]
```

Two of these deserve a second look. d3graph is the network visualisation package that the D3graph and Radialgraph blocks are built on, so a project that already uses it gets a consistent look. jinja2 is the templating engine, which is the mechanism behind the stand-alone output: the chart is rendered into a self-contained document rather than being served by a running process. scikit-learn, requests and datazets sit alongside, and the classifier list marks the package as intended for education and for science and research work, and as operating system independent. The project also installs a console script:

```toml
[project.scripts]
d3blocks = "d3blocks.skills:main"
```

That entry point points at a skills module, and the package data configuration ships the skills directory with the wheel, which suggests the package also carries reusable assets beyond the chart functions.

## Stand-alone documents, notebooks and a Streamlit directory

The repository layout shows the three ways the library is meant to be consumed. The notebooks directory holds example notebooks and the documentation links a Colab notebook at notebooks/d3blocks.ipynb, so the intended first experience is a notebook where you load data, call a block and look at the result. The docs directory is the Sphinx documentation with the per-block pages. The streamlit directory indicates the chart blocks are also wired for use inside a Streamlit application, which is the natural way to publish a notebook chart to a wider audience without building a frontend. The project also keeps blogs and a chart_ui_conventions.md file, plus an idea_blocks.txt listing candidate blocks, and the primary language recorded for the repository is Jupyter Notebook, which matches how the package is actually used. There is a CITATION.cff file and a CONTRIBUTE.md, and the issue tracker is used for both bug reports and feature requests. The upshot for an adopter is that the library is a notebook-first tool, and the pieces you would need to embed the charts in a larger application are in the repository but are not the primary documented path.

## GPL-3.0-or-later is the term to read before you embed a chart

The licence is the one detail that deserves a careful look before a charting library goes into a product, and d3blocks is licensed GPL-3.0-or-later. The repository carries a LICENSE file and the pyproject declares the same licence, and the version is declared dynamically from the attribute d3blocks.__version__ rather than being written into the manifest, so the installed version and the source version cannot drift apart. The release cadence has been fast. Version 2.1.0 was tagged on 2026-09-23, 2.2.0 on 2026-10-15 and 2.2.1 on 2026-10-19, with the last push on 2026-10-22, so a project that pins d3blocks should expect to move fairly often. GPL-3.0-or-later is a strong copyleft licence with obligations that attach to distributing the library, and combining a charting library with it in a closed product deserves a legal review before you commit. That is not an argument against the package, since the code is published in full and the licence is unambiguous, but it is an argument for deciding early rather than after the charts are already in your product.

## Conclusion

Adopt d3blocks if your audience expects interactive, hoverable d3 charts and your team would rather not write javascript, and if the standalone HTML output is acceptable as the deliverable. Do not adopt it when the chart has to live inside an existing web frontend with its own build pipeline, because the package generates its own documents rather than exporting components. Before you commit, read the LICENSE file, since the project is GPL-3.0-or-later and that is a meaningful constraint for a charting library you may embed in a closed product, and check the chart list against your own data shapes, because the blocks are specialised rather than general purpose.

## FAQ

### What is d3blocks?

It is a Python package that builds on the graphics of the d3 javascript library and lets you create interactive, stand-alone charts with a few lines of Python. The package is published on PyPI as d3blocks and the documentation is built with Sphinx.

### Which charts does d3blocks provide?

The documentation table lists D3graph, Radialgraph, Elasticgraph, Sankey, Movingbubbles, Scatter, Heatmap, Chord diagram, Timeseries, Image slider, Violin plot and Particles, each reached through a function in the d3 namespace such as d3.sankey() or d3.heatmap(). Each block has its own page with examples.

### How do I get d3blocks and its dependencies?

The package is on PyPI and requires Python 3 or newer. Its declared dependencies are numpy, pandas, tqdm, jinja2, requests, scikit-learn, colourmap, datazets, ismember and d3graph, and installing it also provides a console script called d3blocks that maps to d3blocks.skills:main.

### Can I use d3blocks in a notebook or in Colab?

Yes. The repository keeps example notebooks in the notebooks directory, the documentation links a Colab notebook at notebooks/d3blocks.ipynb, and the primary language recorded for the repository is Jupyter Notebook. There is also a streamlit directory for serving the charts inside a Streamlit application.

## Sources

- [d3blocks/d3blocks on GitHub](https://github.com/d3blocks/d3blocks)
- [Issues](https://github.com/d3blocks/d3blocks/issues)
- [License: GPL-3.0](https://github.com/d3blocks/d3blocks/blob/main/LICENSE)
- [README](https://github.com/d3blocks/d3blocks/blob/main/README.md)
- [Releases](https://github.com/d3blocks/d3blocks/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/d3blocks-d3blocks
