I am trying to create multiple figures that sow various info about countries. On top of that, I am trying to have set of buttons that would hide plots of countries across all figures. When using CustomJS callback, I am trying to pass ColumnDataSource with individual countries as columns with respective glyphs in the column. The ColumnDataSource looks like below:
{'index': array([0, 1], dtype=int64), 'US': array([GlyphRenderer(id='1038', ...), GlyphRenderer(id='1157', ...)], dtype=object), 'United Arab Emirates': array([nan, nan]), 'United Kingdom': array([GlyphRenderer(id='1079', ...), GlyphRenderer(id='1198', ...)]}
I then try to pass into CustomJS like below:
callback = CustomJS(args={'source':source}, code="""..."""
However, console in in google chrome shows following error. I am struggling to understand if it is not iterable, because I have objects in each column, or because columns are strings?
Uncaught (in promise) TypeError: (intermediate value)(intermediate value)(intermediate value) is not iterable
When I pass a column directly, it works as I would expect. However, I am trying to put in many countries.
callback = CustomJS(args={'source':source.data['US']}, code="""..."""
Thank you very much, Tomas