bokeh

How to make Bokeh work with a REST api backend instead of bokeh-serve?

限于喜欢 提交于 2019-12-23 05:19:18
问题 How can I make Bokeh work with my own REST api backend using CustomJS instead of bokeh-serve? components() do not seem to render inputs and inputs seem to come always with a need to run bokeh-serve. 回答1: Barnabas, it is basically impossible to diagnose a problem if you do not provide actual code and describe in extreme detail what you have already tried. FWIW here is a minimal script that renders a Bokeh Button in a Flask app: import flask from bokeh.embed import components from bokeh.core

How can I link the slider to update my plot in bokeh while in a jupyter notebook?

左心房为你撑大大i 提交于 2019-12-23 04:47:36
问题 I have created a function called ed_montecarlo that runs a montecarlo simulation with a set number of iterations and returns the results as a pandas data frame with multiple columns (not all of which are used here.) Currently I am trying to link this to a plot with Bokeh and have a slider that when changed will re-run the function using the new value of the slider. My code is as follows: def modify_doc(doc): source = ColumnDataSource(ed_montecarlo(num=1000)) TOOLS = "pan,wheel_zoom,box_zoom

How to set active tools in Holoviews

强颜欢笑 提交于 2019-12-23 03:41:54
问题 Sometimes my plots get drawn with the pan tool active and sometimes they draw with pan and wheel_zoom active. I'd like to force wheel_zoom to be active upon rendering. Is there a way to do this? 回答1: Since holoviews 1.11.0 was released the original answer has been outdated. HoloViews now has an explicit option to set the active tool(s), called active_tools which accepts a list of tool names or instances, e.g. to activate the wheel_zoom tool by default you would do this: hv.Curve([1, 2, 3])

python Bokeh: DataTable cells styling

点点圈 提交于 2019-12-23 03:13:57
问题 I'd like to have a custom formatter for one my dataTable cells. Say, for example I'd like to have the title column font style in bold. from bokeh.plotting import show from bokeh.models.sources import ColumnDataSource from bokeh.models.widgets import DataTable, TableColumn if __name__ == '__main__': source = ColumnDataSource(data = dict(hello = ["one", "two", "three"])) c0 = TableColumn(field="hello", title= "TITLE IN BOLD?") ds = DataTable(source=source, columns = [c0]) show(ds) Is there a

Slicing data in Bokeh callback to produce dashboard-like interactions

房东的猫 提交于 2019-12-23 02:33:26
问题 I am trying to produce a dashboard like interactions for my bar chart using callback function without using bokeh serve functionality. Ultimately, I would like to be able to change the plot if any of the two drop-down menus is changed. So far this only works when threshold value is hard-coded. I only know how to extract cb_obj value but not from dropdown that is not actually called. I have looked at this and this answer to formulate first attempt. Here is my code: from bokeh.io import show,

Bokeh Mapping Counties

我与影子孤独终老i 提交于 2019-12-23 01:35:13
问题 I am attempting to modify this example with county data for Michigan. In short, it's working, but it seems to be adding some extra shapes here and there in the process of drawing the counties. I'm guessing that in some instances (where there are counties with islands), the island part needs to be listed as a separate "county", but I'm not sure about the other case, such as with Wayne county in the lower right part of the state. Here's a picture of what I currently have: Here's what I did so

How to animate a circle using bokeh

吃可爱长大的小学妹 提交于 2019-12-23 00:24:38
问题 Note from maintainers: This question concerns the obsolete first generation Bokeh server. For details about modern Bokeh server applications, see: https://docs.bokeh.org/en/latest/docs/user_guide/server.html OBSOLETE: I am currently working on this simple project using bokeh plotting through a server, attempting to move a circle in a circle. The two examples that I have been trying to learn from are https://github.com/bokeh/bokeh/blob/master/examples/plotting/server/animated.py and https:/

How to animate a circle using bokeh

核能气质少年 提交于 2019-12-23 00:23:07
问题 Note from maintainers: This question concerns the obsolete first generation Bokeh server. For details about modern Bokeh server applications, see: https://docs.bokeh.org/en/latest/docs/user_guide/server.html OBSOLETE: I am currently working on this simple project using bokeh plotting through a server, attempting to move a circle in a circle. The two examples that I have been trying to learn from are https://github.com/bokeh/bokeh/blob/master/examples/plotting/server/animated.py and https:/

Bokeh, zoom only on single axis, adjust another axis accordingly

流过昼夜 提交于 2019-12-22 18:43:30
问题 How can one make bokeh use zoom only on one axis and automatically scale objects, so they take exactly the space given and add some padding on extreme points off zoom-able axis parallels, while rendering empty space out of scope? In other words (or "madskills" to be exact): Example plot. This is most widely used for stocks plotting, so consider I want to copy zoom behavior of https://www.tradingview.com/chart/?symbol=FX:XAUUSD with Bokeh. Thank you in advance. 回答1: Zoom on X axis only by

Bokeh, zoom only on single axis, adjust another axis accordingly

扶醉桌前 提交于 2019-12-22 18:42:14
问题 How can one make bokeh use zoom only on one axis and automatically scale objects, so they take exactly the space given and add some padding on extreme points off zoom-able axis parallels, while rendering empty space out of scope? In other words (or "madskills" to be exact): Example plot. This is most widely used for stocks plotting, so consider I want to copy zoom behavior of https://www.tradingview.com/chart/?symbol=FX:XAUUSD with Bokeh. Thank you in advance. 回答1: Zoom on X axis only by