MCPcopy Create free account
hub / github.com/pywebio/PyWebIO / bkapp

Function bkapp

demos/bokeh_app.py:13–32  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

11
12
13def bkapp(doc):
14 df = sea_surface_temperature.copy()
15 source = ColumnDataSource(data=df)
16
17 plot = figure(x_axis_type='datetime', y_range=(0, 25),
18 y_axis_label='Temperature (Celsius)',
19 title="Sea Surface Temperature at 43.18, -70.43")
20 plot.line('time', 'temperature', source=source)
21
22 def callback(attr, old, new):
23 if new == 0:
24 data = df
25 else:
26 data = df.rolling('{0}D'.format(new)).mean()
27 source.data = ColumnDataSource.from_df(data)
28
29 slider = Slider(start=0, end=30, value=0, step=1, title="Smoothing by N Days")
30 slider.on_change('value', callback)
31
32 doc.add_root(column([slider, plot], sizing_mode='stretch_width'))
33
34
35def main():

Callers

nothing calls this directly

Calls 1

SliderClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…