Hi @ISquared the “tap” event just unconditionally reports the x and y position of every tap. If you want to know when a specific glyph instance is “hit” then it’s more likely you’d want to add a TapTool
to the plot and then install a callback on the selection indices:
source.selected("indices", ...)
Then the new value of indices
will contain indexes into the data source for the glyph that was hit. E.g if the value is [11]
that means you’d look at source.data["colname"][11]
to get the corresponding value from that column.
Regarding adding the pie chart on the tap. My very strong advice is to create an empty plot with an empty wedge
glyph all up front from the Python code. Then in the JS code all you have to do is update the data source for the wedge glyph. JS callbacks are much better suited for updating existing things, rather than creating new whole plots, etc. [1] If you want you could also toggle the plot’s visible
property that that it only shows up when there is data to show.