Selected event

Could someone let me know what similar commands exists that I can use in from_py_func()

inCustomJS,I dosomething like

m_code = “”"
selection = require(“core/util/selection”)

def update_subplot(allSource = mainplot_source, window=None):

#todo
#…
#index = allSource.selected.indices

indices = selection.get_indices(allSource)"""

I want the same indices in this:
uHelper.main_plot.js_on_event(Tap, CustomJS.from_py_func(uHelper.update_subplot))

``

Thanks a lot

If javascript code is pretty big, the application performance would be dramatically affected. then I use
main_plot_vbars.data_source.on_change(‘selected’, uHelper.handler)

``

and implement the same logic in python function. application performance is dramatically improved.

···

On Thursday, September 20, 2018 at 1:29:41 PM UTC-6, peng wang wrote:

Could someone let me know what similar commands exists that I can use in from_py_func()

inCustomJS,I dosomething like

m_code = “”"
selection = require(“core/util/selection”)

def update_subplot(allSource = mainplot_source, window=None):

#todo
#…
#index = allSource.selected.indices

indices = selection.get_indices(allSource)“”"

I want the same indices in this:
uHelper.main_plot.js_on_event(Tap, CustomJS.from_py_func(uHelper.update_subplot))

``

Thanks a lot