I'm using Bokeh to create scatter plots by passing a ColumnDataSource to the figure.circle function. The data source has columns that designate certain colors for each point, with a hex code in each row, because the coloring scheme I want to use is somewhat complicated.
Is there a way to change the column used to color the circles in the callback of a widget? I'm imagining a dropdown menu allowing users to choose various coloring schemes for the points.
Here is an example of a solution using a
models.Selectwidget andmodels.CustomJSto select out of two coloring schemes defined in theColumnDataSourceofFigure.circle:The output looks like