Hi,
I have multiple plots and a data table all based on the same source.
I have the following callback that opens a window only when a single point is selected.
Now I want that the window is only opened when the point is selected in the figure and not when it is selected in the data table.
Is there a way to check which object triggered the callback? Is there a documentation somewhere, where all JS relevant commands are described?
self.sources[i].callback = CustomJS(args=dict(p=p,source=self.sources[i]), code=“”"
var inds = cb_obj.get(‘selected’)[‘1d’].indices;
var d1 = cb_obj.get(‘data’);
var text = ‘’;
var datatext = ‘’;
if (inds.length == 1)
{
datatext = ('Point '+inds[0]);
var data = “
This is ‘myWindow’ for Point “+inds[0]+” : “+d1[‘Col X’][inds[0]]+”
”;
myWindow = window.open(“data:text/html,” + encodeURIComponent(data),
“_blank”, “width=200,height=100”);
myWindow.focus();
}
“”"
)
``
Thanks in advance and keep up the great work,
Tom
