Linking NumericInput to y_range end limit

This is demonstration code which does not function as expected. What am I missing?

import bokeh.plotting
import bokeh.layouts
from bokeh.layouts import layout, column
from bokeh.models import CustomJS,NumericInput
from bokeh.plotting import figure, show

fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries']
counts = [5, 3, 4, 2, 4, 6]

p = figure(x_range=fruits, height=350, title="Fruit Counts",
           toolbar_location=None, tools="")
p.vbar(x=fruits, top=counts, width=0.9)
YRangeUL = NumericInput(title = 'Enter Y upper limit', value=6, low =0)
YRangeUL.js_link('value', p.y_range, "end", attr_selector=1)

p.xgrid.grid_line_color = None
p.y_range.start = 0
c = layout(YRangeUL,p)
show(c)

YRangeUL.value and y_range.end are both just scalar (number) properties, not sequences, so specifying an attr_selector is inappropriate. The example works for me if I remove that.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.