Show Bokeh plots in Flexx. Example:
import numpy as np from bokeh.plotting import figure from flexx import app, event, ui x = np.linspace(0, 6, 50) p1 = figure() p1.line(x, np.sin(x)) p2 = figure() p2.line(x, np.cos(x)) class Example(app.PyComponent): def init(self): with ui.HSplit(): ui.BokehWidget.from_plot(p1) ui.BokehWidget.from_plot(p2)
Also see examples: bokehdemo.py.
A widget that shows a Bokeh plot object.
For Bokeh 0.12 and up. The plot’s
sizing_modeproperty is set to
stretch_bothunless it was set to something other than
fixed. Other responsive modes are ‘scale_width’, ‘scale_height’ and ‘scale_both`, which all keep aspect ratio while being responsive in a certain direction.
This widget is, like all widgets, a JsComponent; it lives in the browser, while the Bokeh plot is a Python object. Therefore we cannot simply use a property to set the plot. Use
ui.BokehWidget.from_plot(plot)to instantiate the widget from Python.
attribute – The JS-side of the Bokeh plot object.
action – Set the plot using its script/html components.