Adding a context menu(on right click) in standalone HTML

I have a requirement to open a context menu on right-clicking part of a stacked bar. Currently, right click is not a supported event in bokeh javascript events. Currently, I’m showing the standalone HTML in a PySide2 QtWebEngine View, I have a complicated way of achieving this, which involves a lot of wiring between bokeh js events and pyside QWebChannel. BUT I’m looking for a simpler/leaner way to show a context menu and get the plot’s x and y axis values when context menu item is clicked.
Is there a way to this already in Bokeh or should I consider extending Bokeh?

3 Likes