☰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

How to change factor_cmap-factors in js-callback?

Community Supportcustomjs
p-himik
p-himik

Haven’t checked the code yet, but at this point, given the previous discussion, I start to think that what you want may better be handled differently.
Have you considered just using tabs that each have their own factors? This way, you don’t have to switch any values - you just update what you have to, and the 1D or 2D factors can be selected by switching to different tabs.

⌁   Link to post
Higem
Higem

The problem with switching from 2d to 1d is gone - I’ve created 2 separated figures and they subsititute each other if user wants to plot single-groupedby array or double-groupedby one.

So, 1st figure (and vbar/line) for 1d-factors.
2nd figure is for 2d-factors. And it works good. I want that different groups had their own colors to show. For example, here - https://imgur.com/a/qRufGiD - group “0” can have green color and group “1” must have red color. And I can do it if I set fill_color parameter to vbar like:
fill_color=factor_cmap(‘Column’, palette=[‘green’, ‘red’], factors=[“0”,“1”], start=1, end=2)
But I can’t be confident that there always will be [“0”, “1”] as the factors. I must change them according to the 2nd column (2nd grouped-by column) of data aggregated.

And I didn’t find any method how to change these vbar.glyph.fill_color.factors.

⌁   Link to post

End of archived discussion · Replies are disabled