Module bokeh: charts package is missing

556 views Asked by At

I am trying to draw visuals like Chord diagram which have relation links. I found few samples which are using module bokeh and charts and Chord for such kind of visualization. But once I am trying use it

from bokeh.charts import output_file, Chord
from bokeh.io import show
from bokeh.sampledata.les_mis import data

getting error ModuleNotFoundError: No module named 'bokeh.charts'

While my bokeh version is 2.3.3

Anyone have any idea why getting error?

1

There are 1 answers

0
mosc9575 On

The functionality you are looking for isn't included in Bokeh anymore. To draw a Chord diagram you can use HoloViews instead, which can use Bokeh as a backend.

The example below comes from the HoloView documentation.

import pandas as pd
import holoviews as hv
from holoviews import opts, dim
from bokeh.sampledata.les_mis import data

hv.extension('bokeh')
hv.output(size=200)

links = pd.DataFrame(data['links'])
hv.Chord(links)

This is the easiest way to draw a Chord diagramm. More complex options are also available.