Working in a Bokeh plot that includes 35 lines, when trying to make them visible and invisble using checkbox widget this error arises when cliking in one of the elements of the checkbox, and no line disappears. The logs are:
PS C:\Users\407334\pad-s100> bokeh serve plot4.py
2017-02-01 14:42:36,759 Starting Bokeh server version 0.12.4
2017-02-01 15:09:13,523 Starting Bokeh server on port 5006 with applications at paths ['/plot4']
2017-02-01 15:09:13,525 Starting Bokeh server with process id: 11116
2017-02-01 15:10:05,821 200 GET /plot4 (::1) 6733.00ms
2017-02-01 15:10:06,246 WebSocket connection opened
2017-02-01 15:10:06,247 ServerConnection created
2017-02-01 15:10:30,026 error handling message Message 'PATCH-DOC' (revision 1): ValueError('too many values to unpack',
)
The python script used is influenced by this example:
from bokeh.layouts import row
from bokeh.plotting import figure
from bokeh.io import curdoc
from bokeh.palettes import inferno
from bokeh.models.widgets import CheckboxGroup
import pandas as pd
p = figure(title="Motor-Block Monitorization", width=900, plot_height=900, x_axis_type='datetime')
numlines = len(df.columns)
mypalette = inferno(numlines)
line_set = dict()
for (x, column_names, colores) in zip(range(0, numlines), df.columns.values, mypalette):
if column_names != 'Date' and column_names != 'Time':
line_set["line{0}".format(x)] = p.line(df.index, df[column_names], color=colores)
act = range(0, numlines)
checkbox = CheckboxGroup(labels=list(df.columns.values),
active=act)
def update(attr, old, new):
for i, element in line_set:
element.visible = i in checkbox.active
checkbox.on_change('active', update)
main_column = row(p, checkbox)
curdoc().add_root(main_column)
Different options have been tested but the error is still there.
Aucun commentaire:
Enregistrer un commentaire