☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Treemap chart

Community Support
_jm
_jm

@odadoun,

Depending on your requirements, you might be able to leverage Holoviz panel to accomplish this with bokeh content as well.

In principle, you can combine bokeh models and figures, plotly, and other functionality in panel. And since the panel server is the bokeh server under the hood, you have all of that functionality too.

bokeh is my go-to visualization framework, but I often find that complementing it with some extras from panel works quite well.

Here’s a very simple example using one of the plotly examples in the link you provided, combined with a bokeh button that just acknowledges that it was pressed, i.e. no link between the button and the treemap.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
import plotly.express as px
import numpy as np

from bokeh.models import Button
import panel as pn

pn.extension('plotly')


def press_cb():
    print("button press")

b = Button(button_type='primary', width=300, label='Press')
b.on_click(press_cb)


df = px.data.gapminder().query("year == 2007")
df["world"] = "world" # in order to have a single root node
fig = px.treemap(df, path=['world', 'continent', 'country'], values='pop',
                  color='lifeExp', hover_data=['iso_alpha'],
                  color_continuous_scale='RdBu',
                  color_continuous_midpoint=np.average(df['lifeExp'], weights=df['pop']))

ui = pn.Column(b, fig)
ui.servable()
⌁   Link to post
Reinhold83
Reinhold83

I believe that it is possible to do it using quads and some geometry equations functions.
I really enjoy bokeh and I am looking for a job as data viz, lets say I managed to get it done, any chance of job in the team? :slight_smile:

⌁   Link to post
Bryan
Bryan

@Reinhold83 When Bokeh 3.0 is released, there will be a new block glyph available that is easier to use for treemaps. It accepts x and y corner coordinates, and width and height, which agrees with some common external treemap libraries.

I don’t really understand your question about a job. Are you asking about paid employment? Bokeh is a volunteer open source project, not a company with employees.

⌁   Link to post
Bryan
Bryan

@Reinhold83 there have definitely been people who have mistaken Bokeh for a business or company over the years, so there was no way for me to know otherwise here. I can’t really do anything but take things at face value. :person_shrugging:

⌁   Link to post
Reinhold83
Reinhold83

Taking the opportunity that you are online an active @bigredot could you tell me if it is possible the discussion I opened, please?

⌁   Link to post

End of archived discussion · Replies are disabled