All Projects β†’ ResidentMario β†’ Py_d3

ResidentMario / Py_d3

Licence: mit
D3 block magic for Jupyter notebook.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Py d3

Ml Workspace
πŸ›  All-in-one web-based IDE specialized for machine learning and data science.
Stars: ✭ 2,337 (+446.03%)
Mutual labels:  jupyter-notebook, jupyter, data-visualization
Cookbook 2nd
IPython Cookbook, Second Edition, by Cyrille Rossant, Packt Publishing 2018
Stars: ✭ 704 (+64.49%)
Mutual labels:  jupyter-notebook, jupyter, data-visualization
Cookbook 2nd Code
Code of the IPython Cookbook, Second Edition, by Cyrille Rossant, Packt Publishing 2018 [read-only repository]
Stars: ✭ 541 (+26.4%)
Mutual labels:  jupyter-notebook, jupyter, data-visualization
Floweaver
View flow data as Sankey diagrams
Stars: ✭ 266 (-37.85%)
Mutual labels:  jupyter, data-visualization, d3
Perspective
A data visualization and analytics component, especially well-suited for large and/or streaming datasets.
Stars: ✭ 3,989 (+832.01%)
Mutual labels:  data-visualization, jupyter
Joypy
Joyplots in Python with matplotlib & pandas πŸ“ˆ
Stars: ✭ 322 (-24.77%)
Mutual labels:  jupyter-notebook, data-visualization
Cc150
γ€Šη¨‹εΊε‘˜ι’θ―•ι‡‘ε…Έγ€‹(cc150)
Stars: ✭ 326 (-23.83%)
Mutual labels:  jupyter-notebook, jupyter
Quantitative Notebooks
Educational notebooks on quantitative finance, algorithmic trading, financial modelling and investment strategy
Stars: ✭ 356 (-16.82%)
Mutual labels:  jupyter-notebook, jupyter
Spyder Notebook
Jupyter notebook integration with Spyder
Stars: ✭ 298 (-30.37%)
Mutual labels:  jupyter-notebook, jupyter
Homemade Machine Learning
πŸ€– Python examples of popular machine learning algorithms with interactive Jupyter demos and math being explained
Stars: ✭ 18,594 (+4244.39%)
Mutual labels:  jupyter-notebook, jupyter
Ifsharp
F# for Jupyter Notebooks
Stars: ✭ 424 (-0.93%)
Mutual labels:  jupyter-notebook, jupyter
Ielixir
Jupyter's kernel for Elixir programming language
Stars: ✭ 312 (-27.1%)
Mutual labels:  jupyter-notebook, jupyter
Vimpyter
Edit your Jupyter notebooks in Vim/Neovim
Stars: ✭ 308 (-28.04%)
Mutual labels:  jupyter-notebook, jupyter
Jupyter Edu Book
Teaching and Learning with Jupyter
Stars: ✭ 325 (-24.07%)
Mutual labels:  jupyter-notebook, jupyter
Pydataroad
open source for wechat-official-account (ID: PyDataLab)
Stars: ✭ 302 (-29.44%)
Mutual labels:  jupyter-notebook, data-visualization
Vscodejupyter
Jupyter for Visual Studio Code
Stars: ✭ 337 (-21.26%)
Mutual labels:  jupyter-notebook, jupyter
Britecharts
Client-side reusable Charting Library based on D3.js v5 that allows easy and intuitive use of charts and components that can be composed together creating amazing visualizations.
Stars: ✭ 3,688 (+761.68%)
Mutual labels:  data-visualization, d3
Data Science
Collection of useful data science topics along with code and articles
Stars: ✭ 315 (-26.4%)
Mutual labels:  jupyter-notebook, data-visualization
Bap
Bayesian Analysis with Python (Second Edition)
Stars: ✭ 379 (-11.45%)
Mutual labels:  jupyter-notebook, data-visualization
Enterprise gateway
A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across distributed clusters such as Apache Spark, Kubernetes and others.
Stars: ✭ 412 (-3.74%)
Mutual labels:  jupyter-notebook, jupyter

py_d3 PyPi version t

py_d3 is an IPython extension which adds D3 support to the Jupyter Notebook environment.

D3 is a powerful JavaScript data visualization library, while Jupyter is an intuitive browser-hosted Python development environment. Wouldn't it be great if you could use them together? Now you can.

Quickstart

You can install py_d3 by running pip install py_d3. Then load it into a Jupyter notebook by running%load_ext py_d3.

Use the %%d3 cell magic to define notebook cells with D3 content.

alt text

py_d3 allows you to express even very complex visual ideas within a Jupyter Notebook without much difficulty. A Radial Reingold-Tilford Tree, for example:

alt text

An interactive treemap (original):

alt text

Or even the entire D3 Show Reel animation:

alt text

For more examples refer to the examples notebooks.

Features

Configuration

The cell magic will default to loading the latest stable version of D3.JS available online (via CDNJS; [email protected] at time of writing). To load a specific version, append the version name to the command, e.g. %%d3 "3.5.17". To load D3.JS from a local file pass the filepath, e.g. %%d3 "d3.v5.min.js".

Only one version of D3.JS may be loaded at a time. Both 3.x and 4.x versions of D3 are supported, but you may only run one version of D3 per notebook. You can check which versions are available by running %d3 versions, and check which version is loaded in the current notebook using %d3 version.

Documentation

Pages from the D3 API Reference may be rendered in-notebook using %d3 doc. For example, you can render the d3-array reference by running %d3 doc "d3-array".

Verbose Mode

You can view code to-be-rendered using verbose mode: %d3 -v. This is helpful for debugging your application.

Technical

How it works

Jupyter notebooks allow executing arbitrary JavaScript code using IPython.display.JavaScript, however it makes no effort to restrict the level of DOM objects accessible to executable code. py_d3 works by restricting d3 scope to whatever cell you are running the code in, by monkey-patching the d3.select and d3.selectAll methods (see here for why this works).

Porting

Most HTML-hosted D3 visualizations, even very complex ones, can be made to run inside of a Jupyter Notebook %%d3 cell with just two modifications:

  • Remove any D3 imports in the cell (e.g. <script src="https://d3js.org/d3.v3.js"></script>).
  • Make sure to create and append to a legal HTML document sub-element. d3.select("body").append("g") won't work.

Contributing

See CONTRIBUTING.md for instructions on how to contribute. Pull requests are welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].