In this post, I will show you how to draw tree-map with a sample dataset on Google Colab
This library makes it easy to develop Plotly Dash apps interactively from within Jupyter environments (e.g. classic Notebook, JupyterLab, Visual Studio Code notebooks, nteract, PyCharm notebooks, etc.).
See the notebooks/getting_started.ipynb for more information and example usage.
You can install the JupyterDash Python package using pip...
$ pip install jupyter-dash
$ conda install -c conda-forge -c plotly jupyter-dash
When used in JupyterLab, JupyterDash depends on the
jupyterlab-dash JupyterLab extension, which requires JupyterLab version 2.0 or above.
This extension is included with the Python package, but in order to activate it JupyterLab must be rebuilt. JupyterLab should automatically produce a popup dialog asking for permission to rebuild, but the rebuild can also be performed manually from the command line using:
$ jupyter lab build
To check that the extension is installed properly, call
jupyter labextension list.
As of version 0.3.0,
!pip install jupyter_dash !pip install --upgrade plotly
import dash from jupyter_dash import JupyterDash import dash_core_components as dcc import dash_html_components as html import plotly.express as px from dash.dependencies import Input, Output
gapminder = px.data.gapminder() # load data gapminder.head() # display data # tree-map gapminder['board'] = 'world' px.treemap(gapminder, path=['board', 'year', 'country'], values='pop')