Interaction problem between bokeh selection and ipywidgets

Hello !

I have made a scatter plot on a map in a jupyter notebook cell. I have also modified the behavior of the TapTool in JavaScript, now when I click on a point the 49 following are selected too. I have an IntRangeSlider in my jupyter cell that define how many points I want too be selected, it work for the first selection (I forced a selection of the 50 first points) but whenever I use the TapTool the slider stop to work and I get the JS error :
Object { type: “Selection”, id: “ad8a4916-4163-4c4a-b04b-4d9f624945ee” }

[bokeh] Got an event for unknown model

``

I am new to bokeh and this is my first post here. I did not see any informations about special rules. I hope that’s the good place for this kind of question.

Have a nice day !

Brendan

Hi,

In order to help, a complete code sample (e.g. a notebook someone else can take and run) that demonstrates the situation/problem will be needed.

Thanks,

Bryan

···

On Jul 19, 2018, at 07:34, [email protected] wrote:

Hello !

I have made a scatter plot on a map in a jupyter notebook cell. I have also modified the behavior of the TapTool in JavaScript, now when I click on a point the 49 following are selected too. I have an IntRangeSlider in my jupyter cell that define how many points I want too be selected, it work for the first selection (I forced a selection of the 50 first points) but whenever I use the TapTool the slider stop to work and I get the JS error :
[bokeh] Got an event for unknown model
Object { type: "Selection", id: "ad8a4916-4163-4c4a-b04b-4d9f624945ee" }

I am new to bokeh and this is my first post here. I did not see any informations about special rules. I hope that's the good place for this kind of question.

Have a nice day !

Brendan

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/37b5ef64-edf2-475b-be24-7cef9594fcf7%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Well that’s depending on specific files but I am going to try to make a simplified version.

···

2018-07-19 16:48 GMT+02:00 Bryan Van de ven [email protected]:

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi,

In order to help, a complete code sample (e.g. a notebook someone else can take and run) that demonstrates the situation/problem will be needed.

Thanks,

Bryan

On Jul 19, 2018, at 07:34, [email protected] wrote:

Hello !

I have made a scatter plot on a map in a jupyter notebook cell. I have also modified the behavior of the TapTool in JavaScript, now when I click on a point the 49 following are selected too. I have an IntRangeSlider in my jupyter cell that define how many points I want too be selected, it work for the first selection (I forced a selection of the 50 first points) but whenever I use the TapTool the slider stop to work and I get the JS error :

[bokeh] Got an event for unknown model

Object { type: “Selection”, id: “ad8a4916-4163-4c4a-b04b-4d9f624945ee” }

I am new to bokeh and this is my first post here. I did not see any informations about special rules. I hope that’s the good place for this kind of question.

Have a nice day !

Brendan

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/37b5ef64-edf2-475b-be24-7cef9594fcf7%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to a topic in the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/ncjvVhppGPs/unsubscribe.

To unsubscribe from this group and all its topics, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/90A5A592-6832-46E8-A9D2-D0460FEA893F%40anaconda.com.

Brendan Coatanéa
Kerascoet

29290 TREOUERGAT


17 Rue de la 2E D.B

29200 BREST

Tel : +33 (0)6 98 87 94 44

Sorry for the two other messages, it was non working versions of the simplified code.

Here is normally a working one. I would like that the interaction with the plot stays possible after making a selection with the TapTool. Another problem in this version that I don’t understand is the “non-update” of the plot after using a widget. If we want to see the result we need to force update by using the wheel-mouse for example.

import numpy as np
import netCDF4
import random
import time
import os
import glob
from IPython.display import HTML, display

Bokeh related

from bokeh.layouts import layout
from bokeh.models import ColumnDataSource, CustomJS, TapTool, LogTicker, Range
from bokeh.models import ColorBar, Circle, BoxSelectTool, PrintfTickFormatter
from bokeh.models.widgets import Panel, Tabs
from bokeh.models.mappers import LinearColorMapper
from bokeh.palettes import Viridis256, Inferno256, Plasma256
from bokeh.plotting import figure, show
from bokeh.io import push_notebook

Map Related

from bokeh.tile_providers import CARTODBPOSITRON
import pyproj

Jupyter widgets

import ipywidgets as widgets
from ipywidgets import Layout

import sys
from bokeh.io import output_notebook
from IPython.core.display import display, HTML

%matplotlib inline
output_notebook()
display(HTML(“.container { width:100% !important; }”))

SELECTED_DATA = {}
FIRST_INDEX_SELECTED = 0
color_mapper = LinearColorMapper(palette=Viridis256, low=0.001, high=0.002)
paramStruct = “‘lat’: x, ‘lon’: y, ‘color’: color, ‘indice_time’: inds, ‘time’: time”

codeJSClick = “”"
var save_Selec = source.selected;
var l_selected=source.selected;
var indices = l_selected.indices;
if(indices.length <= 1) {
var new_indices = Array.from(new Array(50), (x,i) => i + indices[0]);
l_selected.indices=new_indices;
}
source.selected=l_selected;

var kernel = IPython.notebook.kernel;

source.change.emit();
// Select the data
var inds = source.selected.indices;
var d1 = source.data;
var x = []
var y = []
var color = []
var time = []
for (i = 0; i < inds.length; i++) {
    x.push(d1['lat'][inds[i]])
    y.push(d1['lon'][inds[i]])
    color.push(d1['color'][inds[i]])
    time.push(d1['time'][inds[i]])
}

// Generate a command to execute in Python
data = {""" + paramStruct + """}

var data_str = JSON.stringify(data)
test = new Array()
test = data["time"]
var cmd = ["save_selected(" + data_str + "," + inds[0] + ")",
           "nbSigmas.value = [0,nbSigmas.max]",
           "updateWidgets(" + data +")"]

for (var i = 0; i < cmd.length; i++) {
        // Execute the command on the Python kernel
        kernel.execute(cmd[i], callbacks, {silent : false});
}

“”"

def save_selected(values, indice):
SELECTED_DATA.update(values)
FIRST_INDEX_SELECTED = indice

def updateWidgets(data):
nbSigmas.set_trait(‘max’, len(data[“x”]))
dateSelection.set_trait(‘value’, data[“time”][0])

def update(dateSelected, nbSigmas):
global FIRST_INDEX_SELECTED
idDateSelec = np.argmax(src.data[‘time’] == dateSelected)
FIRST_INDEX_SELECTED = idDateSelec
if “indice_time” in SELECTED_DATA:
src.selected.indices = range(FIRST_INDEX_SELECTED + nbSigmas[0],
FIRST_INDEX_SELECTED + (nbSigmas[1]-1))
else:
src.selected.indices = range(idDateSelec + nbSigmas[0],
idDateSelec+nbSigmas[1])
SELECTED_DATA.update(selectionDataSourceToDataSelect(src))
dateSelection.set_trait(‘options’, src.data[‘time’][0:-50])
push_notebook(handle=handle)

def selectionDataSourceToDataSelect(src):
ids = src.selected.indices
d1 = src.data
x = d1[‘lat’][ids[0]:ids[-1]+1]
y = d1[‘lon’][ids[0]:ids[-1]+1]
color = d1[‘color’][ids[0]:ids[-1]+1]

data = {
    'lat': x, 'lon': y, 'color': color,
    'indice_time': ids, 'time': time,
}
return data

lon = np.array([-0.171875 , -0.13183594, -0.08886719, -0.04199219, 0.0078125 , 0.05859375, 0.11035156, 0.16210938, 0.21386719, 0.26269531,
0.31054688, 0.35449219, 0.39550781, 0.43066406, 0.46191406, 0.48730469, 0.50683594, 0.52050781, 0.52636719, 0.52636719,
0.51953125, 0.50585938, 0.48632812, 0.45996094, 0.42871094, 0.390625 , 0.34863281, 0.30175781, 0.25195312, 0.19824219,
0.14257812, 0.0859375 , 0.02929688, -0.02734375, -0.08398438, -0.13769531, -0.18847656, -0.23632812, -0.28027344, -0.31933594,
-0.35253906, -0.38085938, -0.40234375, -0.41796875, -0.42675781, -0.42871094, -0.42382812, -0.41210938, -0.39453125, -0.37109375,
-0.34179688, -0.30664062, -0.26757812, -0.22460938, -0.17773438, -0.12890625, -0.078125 , -0.02636719, 0.02539062, 0.07714844,
0.12695312, 0.17382812, 0.21875 , 0.25976562, 0.29589844, 0.32714844, 0.35351562, 0.37304688, 0.38671875, 0.39355469,
0.39453125, 0.38769531, 0.375 , 0.35546875, 0.33007812, 0.29785156, 0.26074219, 0.21875 , 0.17285156, 0.12304688,
0.06933594, 0.01464844, -0.04199219, -0.09960938, -0.15625 , -0.21191406, -0.26660156, -0.31738281, -0.36523438, -0.40917969,
-0.44921875, -0.48339844, -0.51171875, -0.53320312, -0.54980469, -0.55859375, -0.56152344, -0.55664062, -0.54589844, -0.52929688,
-0.50585938, -0.4765625 , -0.44238281, -0.40332031, -0.36035156, -0.31445312, -0.265625 , -0.21484375, -0.16308594, -0.11132812,
-0.05957031, -0.00976562, 0.03808594, 0.08300781, 0.12402344, 0.16113281, 0.19238281, 0.21875 , 0.23925781, 0.25292969,
0.26074219, 0.26171875, 0.25585938, 0.24316406, 0.22460938, 0.19921875, 0.16796875, 0.13183594, 0.08984375, 0.04394531,
-0.00585938, -0.05859375, -0.11328125, -0.16992188, -0.22753906, -0.28417969, -0.34082031, -0.39453125, -0.44628906, -0.49511719,
-0.5390625 , -0.57910156, -0.61328125, -0.64257812, -0.66503906, -0.68164062, -0.69140625, -0.69433594, -0.69042969, -0.6796875 ,
-0.66308594, -0.640625 , -0.61230469, -0.578125 , -0.54003906, -0.49707031, -0.45117188, -0.40234375, -0.3515625 , -0.29980469,
-0.24804688, -0.19628906, -0.14648438, -0.09765625, -0.05273438, -0.01171875, 0.02539062, 0.05761719, 0.08398438, 0.10546875,
0.12011719, 0.12792969, 0.12988281, 0.12402344, 0.11230469, 0.09375 , 0.06933594, 0.03808594, 0.00195312, -0.0390625 ,
-0.08496094, -0.13476562, -0.1875 , -0.2421875 , -0.29882812, -0.35546875, -0.41308594, -0.46875 , -0.5234375 , -0.57519531,
-0.62402344, -0.66894531, -0.70898438, -0.74414062, -0.7734375 , -0.79589844, -0.81347656, -0.82324219, -0.82714844, -0.82421875])
lat = np.array([ 0.68652344, 0.63769531, 0.59570312, 0.55859375, 0.52832031, 0.50390625, 0.48632812, 0.47558594, 0.47167969, 0.47460938,
0.484375 , 0.49902344, 0.51953125, 0.54492188, 0.57519531, 0.609375 , 0.64648438, 0.68554688, 0.7265625 , 0.76855469,
0.81054688, 0.85058594, 0.88964844, 0.92578125, 0.95898438, 0.98828125, 1.01269531, 1.03222656, 1.04589844, 1.05371094,
1.0546875 , 1.04882812, 1.03710938, 1.01757812, 0.9921875 , 0.95996094, 0.921875 , 0.87695312, 0.828125 , 0.7734375 ,
0.71484375, 0.65332031, 0.58886719, 0.52148438, 0.45410156, 0.38574219, 0.31835938, 0.25195312, 0.1875 , 0.12597656,
0.06835938, 0.01464844, -0.03417969, -0.07714844, -0.11425781, -0.14550781, -0.16992188, -0.1875 , -0.19921875, -0.203125 ,
-0.20117188, -0.19238281, -0.17773438, -0.15722656, -0.13183594, -0.10253906, -0.06835938, -0.03222656, 0.0078125 , 0.04882812,
0.08984375, 0.13183594, 0.17285156, 0.21191406, 0.24804688, 0.28125 , 0.31152344, 0.3359375 , 0.35546875, 0.37011719,
0.37792969, 0.37890625, 0.37402344, 0.36230469, 0.34375 , 0.31933594, 0.28710938, 0.24902344, 0.20605469, 0.15625 ,
0.10253906, 0.04492188, -0.01757812, -0.08203125, -0.1484375 , -0.21582031, -0.28417969, -0.35253906, -0.41894531, -0.48339844,
-0.54492188, -0.60351562, -0.65722656, -0.70605469, -0.75 , -0.78710938, -0.81835938, -0.84375 , -0.86230469, -0.87402344,
-0.87890625, -0.87695312, -0.86914062, -0.85449219, -0.83496094, -0.80957031, -0.78027344, -0.74707031, -0.70996094, -0.67089844,
-0.62988281, -0.58886719, -0.546875 , -0.50585938, -0.46679688, -0.4296875 , -0.39648438, -0.36621094, -0.34082031, -0.32128906,
-0.30664062, -0.29785156, -0.29589844, -0.30078125, -0.31152344, -0.32910156, -0.35449219, -0.38574219, -0.42285156, -0.46582031,
-0.51464844, -0.56835938, -0.62597656, -0.6875 , -0.75195312, -0.81835938, -0.88671875, -0.95410156, -1.02246094, -1.08886719,
-1.15332031, -1.21582031, -1.27441406, -1.328125 , -1.37792969, -1.421875 , -1.45996094, -1.4921875 , -1.51757812, -1.53613281,
-1.54882812, -1.55371094, -1.55273438, -1.54492188, -1.53125 , -1.51171875, -1.48730469, -1.45800781, -1.42480469, -1.38867188,
-1.34960938, -1.30859375, -1.26660156, -1.22558594, -1.18457031, -1.14453125, -1.10742188, -1.07421875, -1.04394531, -1.01855469,
-0.99804688, -0.98242188, -0.97363281, -0.97070312, -0.97460938, -0.98535156, -1.00292969, -1.02734375, -1.05761719, -1.09472656,
-1.13769531, -1.18652344, -1.23925781, -1.296875 , -1.35839844, -1.42285156, -1.48828125, -1.55664062, -1.625 , -1.69238281])
color = np.array([ 0.00200409, 0.00206905, 0.00214587, 0.00201392, 0.00189193, 0.00195923, 0.00191021, 0.001882 , 0.00194831, 0.00196956,
0.00196121, 0.00188414, 0.00174411, 0.00184762, 0.00173369, 0.00183251, 0.00176188, 0.00180396, 0.00171909, 0.00183143,
0.00174876, 0.00168248, 0.00164353, 0.00192009, 0.00178869, 0.00190568, 0.00209275, 0.00197952, 0.00190033, 0.00200212,
0.00200342, 0.00191751, 0.0019808 , 0.00199884, 0.00195078, 0.00189676, 0.00194192, 0.00186613, 0.00182549, 0.00189666,
0.00179516, 0.00182261, 0.0018464 , 0.00173109, 0.00173263, 0.00172457, 0.00175467, 0.00161785, 0.00174899, 0.001875 ,
0.00193143, 0.00194002, 0.00204015, 0.00202401, 0.00197657, 0.00194868, 0.00202673, 0.00185068, 0.00190061, 0.0020414 ,
0.00192929, 0.00198353, 0.00179371, 0.00182993, 0.0018169 , 0.00167907, 0.00175909, 0.00179411, 0.00170683, 0.00178825,
0.00179316, 0.00163636, 0.00170915, 0.00175064, 0.00178776, 0.00177176, 0.00181669, 0.00194728, 0.00213725, 0.0019295 ,
0.00202896, 0.00198242, 0.00195243, 0.00191677, 0.00186536, 0.00198957, 0.00213642, 0.00200375, 0.00192336, 0.00175295,
0.00181941, 0.00182495, 0.00172867, 0.00175865, 0.00164177, 0.00165076, 0.00179306, 0.00173158, 0.00169447, 0.00176768,
0.00182877, 0.00177093, 0.00192308, 0.00204034, 0.00208546, 0.00201088, 0.00202017, 0.00198812, 0.0019014 , 0.00189005,
0.00195869, 0.00210724, 0.00199503, 0.0020326 , 0.00181474, 0.00184214, 0.00182577, 0.00178856, 0.001686 , 0.00162333,
0.00170661, 0.001707 , 0.00172986, 0.00170692, 0.00181716, 0.00170078, 0.00182268, 0.00186525, 0.0019059 , 0.00206483,
0.00213678, 0.00196053, 0.00190983, 0.00191267, 0.00190473, 0.00192984, 0.00190795, 0.00190993, 0.00182955, 0.00181255,
0.00191372, 0.00175773, 0.00181876, 0.00184896, 0.00175829, 0.00176501, 0.00175465, 0.00177786, 0.00174441, 0.00170815,
0.00177 , 0.00181965, 0.00193651, 0.00190592, 0.0020344 , 0.00209969, 0.00207834, 0.00202309, 0.00188396, 0.00193179,
0.00191767, 0.00205247, 0.00201015, 0.00203554, 0.00195061, 0.00187677, 0.00179643, 0.00175699, 0.00169927, 0.00185435,
0.0017281 , 0.00172805, 0.00175285, 0.00177481, 0.0017795 , 0.00167921, 0.0017962 , 0.00190865, 0.00189548, 0.00199963,
0.00208677, 0.00198876, 0.00212581, 0.00184992, 0.00197287, 0.00186544, 0.00179884, 0.00194016, 0.00194709, 0.00183853,
0.00178762, 0.00172239, 0.00179737, 0.00173459, 0.00177601, 0.0017428 , 0.00184479, 0.00165571, 0.00168028, 0.00168496])
time = np.array([ 2.41772400e+08, 2.41772400e+08, 2.41772401e+08, 2.41772401e+08, 2.41772401e+08, 2.41772401e+08, 2.41772401e+08, 2.41772402e+08, 2.41772402e+08,
2.41772402e+08, 2.41772402e+08, 2.41772402e+08, 2.41772403e+08, 2.41772403e+08, 2.41772403e+08, 2.41772403e+08, 2.41772403e+08, 2.41772404e+08,
2.41772404e+08, 2.41772404e+08, 2.41772404e+08, 2.41772405e+08, 2.41772405e+08, 2.41772405e+08, 2.41772405e+08, 2.41772405e+08, 2.41772406e+08,
2.41772406e+08, 2.41772406e+08, 2.41772406e+08, 2.41772406e+08, 2.41772407e+08, 2.41772407e+08, 2.41772407e+08, 2.41772407e+08, 2.41772407e+08,
2.41772408e+08, 2.41772408e+08, 2.41772408e+08, 2.41772408e+08, 2.41772409e+08, 2.41772409e+08, 2.41772409e+08, 2.41772409e+08, 2.41772409e+08,
2.41772410e+08, 2.41772410e+08, 2.41772410e+08, 2.41772410e+08, 2.41772410e+08, 2.41772411e+08, 2.41772411e+08, 2.41772411e+08, 2.41772411e+08,
2.41772411e+08, 2.41772412e+08, 2.41772412e+08, 2.41772412e+08, 2.41772412e+08, 2.41772412e+08, 2.41772413e+08, 2.41772413e+08, 2.41772413e+08,
2.41772413e+08, 2.41772414e+08, 2.41772414e+08, 2.41772414e+08, 2.41772414e+08, 2.41772414e+08, 2.41772415e+08, 2.41772415e+08, 2.41772415e+08,
2.41772415e+08, 2.41772415e+08, 2.41772416e+08, 2.41772416e+08, 2.41772416e+08, 2.41772416e+08, 2.41772416e+08, 2.41772417e+08, 2.41772417e+08,
2.41772417e+08, 2.41772417e+08, 2.41772418e+08, 2.41772418e+08, 2.41772418e+08, 2.41772418e+08, 2.41772418e+08, 2.41772419e+08, 2.41772419e+08,
2.41772419e+08, 2.41772419e+08, 2.41772419e+08, 2.41772420e+08, 2.41772420e+08, 2.41772420e+08, 2.41772420e+08, 2.41772420e+08, 2.41772421e+08,
2.41772421e+08, 2.41772421e+08, 2.41772421e+08, 2.41772422e+08, 2.41772422e+08, 2.41772422e+08, 2.41772422e+08, 2.41772422e+08, 2.41772423e+08,
2.41772423e+08, 2.41772423e+08, 2.41772423e+08, 2.41772423e+08, 2.41772424e+08, 2.41772424e+08, 2.41772424e+08, 2.41772424e+08, 2.41772424e+08,
2.41772425e+08, 2.41772425e+08, 2.41772425e+08, 2.41772425e+08, 2.41772425e+08, 2.41772426e+08, 2.41772426e+08, 2.41772426e+08, 2.41772426e+08,
2.41772427e+08, 2.41772427e+08, 2.41772427e+08, 2.41772427e+08, 2.41772427e+08, 2.41772428e+08, 2.41772428e+08, 2.41772428e+08, 2.41772428e+08,
2.41772428e+08, 2.41772429e+08, 2.41772429e+08, 2.41772429e+08, 2.41772429e+08, 2.41772429e+08, 2.41772430e+08, 2.41772430e+08, 2.41772430e+08,
2.41772430e+08, 2.41772431e+08, 2.41772431e+08, 2.41772431e+08, 2.41772431e+08, 2.41772431e+08, 2.41772432e+08, 2.41772432e+08, 2.41772432e+08,
2.41772432e+08, 2.41772432e+08, 2.41772433e+08, 2.41772433e+08, 2.41772433e+08, 2.41772433e+08, 2.41772433e+08, 2.41772434e+08, 2.41772434e+08,
2.41772434e+08, 2.41772434e+08, 2.41772435e+08, 2.41772435e+08, 2.41772435e+08, 2.41772435e+08, 2.41772435e+08, 2.41772436e+08, 2.41772436e+08,
2.41772436e+08, 2.41772436e+08, 2.41772436e+08, 2.41772437e+08, 2.41772437e+08, 2.41772437e+08, 2.41772437e+08, 2.41772437e+08, 2.41772438e+08,
2.41772438e+08, 2.41772438e+08, 2.41772438e+08, 2.41772439e+08, 2.41772439e+08, 2.41772439e+08, 2.41772439e+08, 2.41772439e+08, 2.41772440e+08,
2.41772440e+08, 2.41772440e+08, 2.41772440e+08, 2.41772440e+08, 2.41772441e+08, 2.41772441e+08, 2.41772441e+08, 2.41772441e+08, 2.41772441e+08,
2.41772442e+08, 2.41772442e+08])

in_projection = pyproj.Proj(“+init=EPSG:4326”) # wgs84
out_projection = pyproj.Proj(“+init=EPSG:3857”) # google projection
x, y = pyproj.transform(in_projection, out_projection,
lon, lat)
src = ColumnDataSource(data=dict(lat=x, lon=y, color=color, time=time))

p = figure(x_axis_type=“mercator”, y_axis_type=“mercator”,
plot_width=700, plot_height=600)
p.add_tile(CARTODBPOSITRON)

ids = range(0, 50)
src.selected.indices = ids

renderer = p.circle(x=“lat”, y=“lon”, size=7, source=src,
fill_color={‘field’: ‘color’,
‘transform’: color_mapper},
fill_alpha=1, line_color=“firebrick”)

selected_circle_map = Circle(fill_color={‘field’: ‘color’,
‘transform’: color_mapper},
fill_alpha=1, line_color=“firebrick”)
nonselected_circle_map = Circle(fill_color={‘field’: ‘color’,
‘transform’: color_mapper},
fill_alpha=1, line_color=None)

renderer.selection_glyph = selected_circle_map
renderer.nonselection_glyph = nonselected_circle_map

formatter = PrintfTickFormatter(format=‘%.3f’)
color_bar = ColorBar(color_mapper=color_mapper, formatter=formatter,
ticker=LogTicker(), label_standoff=10,
border_line_color=None, location=(0, 0))
p.add_layout(color_bar, ‘right’)

Tools with homemade JS scripts

cb_click = CustomJS(args=dict(source=src), code=codeJSClick)
p.add_tools(TapTool(callback=cb_click))

nbSigmas = widgets.IntRangeSlider(value=[0, 50], min=0, max=50, step=1,
description=‘Nombre de plots:’,
continuous_update=False,
layout=Layout(width=‘30%’, height=‘80px’))
dateSelection = widgets.SelectionSlider(
options=time[0:-50], value=time[0],
description=‘Date :’, disabled=False, step=50,
continuous_update=False, orientation=‘horizontal’,
readout=True, layout=Layout(width=‘90%’, height=‘80px’))

out2 = widgets.interactive_output(update, {“dateSelected”: dateSelection,
“nbSigmas”: nbSigmas})
handle = show(p, notebook_handle=True)
display(nbSigmas,dateSelection, out2)

``

···

Le jeudi 19 juillet 2018 17:10:34 UTC+2, Brendan Coatanéa a écrit :

Well that’s depending on specific files but I am going to try to make a simplified version.

2018-07-19 16:48 GMT+02:00 Bryan Van de ven [email protected]:

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi,

In order to help, a complete code sample (e.g. a notebook someone else can take and run) that demonstrates the situation/problem will be needed.

Thanks,

Bryan

On Jul 19, 2018, at 07:34, [email protected] wrote:

Hello !

I have made a scatter plot on a map in a jupyter notebook cell. I have also modified the behavior of the TapTool in JavaScript, now when I click on a point the 49 following are selected too. I have an IntRangeSlider in my jupyter cell that define how many points I want too be selected, it work for the first selection (I forced a selection of the 50 first points) but whenever I use the TapTool the slider stop to work and I get the JS error :

[bokeh] Got an event for unknown model

Object { type: “Selection”, id: “ad8a4916-4163-4c4a-b04b-4d9f624945ee” }

I am new to bokeh and this is my first post here. I did not see any informations about special rules. I hope that’s the good place for this kind of question.

Have a nice day !

Brendan

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/37b5ef64-edf2-475b-be24-7cef9594fcf7%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to a topic in the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/ncjvVhppGPs/unsubscribe.

To unsubscribe from this group and all its topics, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/90A5A592-6832-46E8-A9D2-D0460FEA893F%40anaconda.com.


Brendan Coatanéa
Kerascoet

29290 TREOUERGAT


17 Rue de la 2E D.B

29200 BREST

Tel : +33 (0)6 98 87 94 44