Skip to main content

K3D Jupyter

Downloads Downloads Anaconda-Server Badge CodeQL GitHub Sponsor

K3D lets you create 3D plots backed by WebGL with high-level API (surfaces, isosurfaces, voxels, mesh, point clouds, vtk objects, volume renderer, colormaps, etc). The primary aim of K3D-jupyter is to be easy to use as a standalone package like matplotlib, but also to allow interoperation with existing libraries as VTK. K3D can be run as:

  • Jupyter Notebook / JupyterLab widget (anywidget) 🚀
  • Google Colab widget 🎉
  • VS Code notebooks 🧩
  • Standalone HTML/JS 📑

Since 3.0.0 a plot also chooses how it is lit, through plot.renderer: simple (the default rasteriser), advanced (image-based lighting with ambient occlusion) or cinematic (progressive path tracing). cinematic is experimental — it needs WebGL2 with renderable float textures, does not cover every object (volume_slice is not drawn, mip stays outside the light simulation, only the first volume is path traced), and its API and output may still change; simple and advanced are the stable choices. See Renderers.

Documentation: https://k3d-jupyter.org

Showcase:

Two frames from the renderers 3.0.0 added, both produced by the code in this repository — click either one for how it works.

Curl-noise pearls under the advanced renderer

advanced: image-based lighting and ambient occlusion. A million analytic sphere impostors, with the occlusion in the crevices between strands doing the sculpting.

The Stanford dragon, path traced

cinematic: progressive path tracing. 871k triangles read through VTK, 512 samples, lit only by an environment map — the shadow under the belly and the light the floor throws back into the flank are consequences of the simulation, not effects.

points_cloud

streamlines

volume_rendering

volume_slide_view

transfer_function_editor

YouTube:

Click to watch at YouTube:

Volume renderer

Volume renderer

Volume renderer

Volume renderer

Try it Now!

Watch: Interactive showcase gallery

Installation

PyPI

To install from PyPI use pip:

$ pip install k3d

Conda/Anaconda

To install from conda-forge use:

$ conda install -c conda-forge k3d

Google Colab

Since 3.0.0 (the anywidget migration) no extra steps are needed:

!pip install k3d

import k3d and plot - custom widget activation and the text protocol are no longer required.

Installing directly from GitHub

To install directly from this repository (requires git and node.js + npm to build):

$ pip install git+https://github.com/K3D-tools/K3D-jupyter

This also makes possible installing the most up-to-date development version (same requirements):

$ pip install git+https://github.com/K3D-tools/K3D-jupyter@devel

To install any historical version, replace devel above with any tag or commit hash.

Source

For a development installation (requires npm and node.js),

$ git clone https://github.com/K3D-tools/K3D-jupyter.git
$ cd K3D-jupyter
$ pip install -e .

No separate JupyterLab extension step is needed - the widget ships its own frontend module (anywidget).

Code of Conduct

K3D-jupyter follows the Python Software Foundation Code of Conduct in everything we do.

Kudos

  • Jupyter is my ❤️
  • OpenDreamKit is 🚀
  • Three.js is 🥇

Acknowledgments

Research Infrastructure project This package was created as part of the Horizon 2020 European OpenDreamKit (grant agreement #676541).

Metadata

Release files for k3d 3.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for k3d 3.1.1
File Size Uploaded
k3d-3.1.1.tar.gz 5.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for k3d 3.1.1
File Interpreter ABI Platform
k3d-3.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 MB

Release files / k3d-3.1.1.tar.gz

Download URL k3d-3.1.1.tar.gz
Size 5.4 MB
Tags Source
SHA-256 checksum
How to use checksums
4c485553d0b0f1256d2d6104efaf45389cdbea993df85bb6d7d9b63cbbe0a00a
BLAKE2b-256 checksum
How to use checksums
3009837b95b7ddea2d7e28ff9dc87b219d5e0656f8717a03ebc8f2dee3e8a6e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / k3d-3.1.1-py3-none-any.whl

Download URL k3d-3.1.1-py3-none-any.whl
Size 5.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4d251ecc511ec85f3369c0a396c4ecd41d73945a2c5e0f9af31ad0962eb72e79
BLAKE2b-256 checksum
How to use checksums
9c62131a71c0afbce37c2903479370d08bc00f18d4d2ccaa3ffcc28d6c2c8a0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

3.2.0

2 release files

3.1.2

2 release files

This release

3.1.1 This release

2 release files

3.1.0

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.18.1

2 release files

2.18.0

2 release files

2.16.0

2 release files

2.15.3

2 release files

2.15.2

2 release files

2.15.1

2 release files

2.15.0

2 release files

2.14.5

2 release files

2.14.4

2 release files

2.14.3

2 release files

2.14.2

2 release files

2.14.1

2 release files

2.14.0

2 release files

2.13.1

2 release files

2.13.0

2 release files

2.10.0

2 release files

2.9.7

2 release files

2.9.6

2 release files

2.9.5

2 release files

2.9.4

2 release files

2.9.3

2 release files

2.9.2

2 release files

2.9.1

2 release files

2.9.0

2 release files

2.8.2

2 release files

2.8.1

2 release files

2.8.0

2 release files

2.7.4

2 release files

2.7.3

2 release files

2.7.2

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.9

2 release files

2.6.8

2 release files

2.6.7

2 release files

2.6.6

2 release files

2.6.5

2 release files

2.6.4

2 release files

2.6.3

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.5

2 release files

2.5.3

2 release files

2.5.2

2 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.21

2 release files

2.4.18

2 release files

2.4.17

2 release files

2.4.16

2 release files

2.4.15

2 release files

2.4.14

2 release files

2.4.9

2 release files

2.4.8

2 release files

2.4.7

2 release files

2.4.6

2 release files

2.4.5

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.0.9

2 release files

2.0.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page