bokeh

CheckboxGroup in Bokeh to plot additive plots

家住魔仙堡 提交于 2019-12-08 05:00:39
问题 I want to use a checkbox group to represent linearly additive sources. The idea is for the user to be able to turn on or turn off multiple sources of different kinds to display a plot with added values. I implemented a dropdown version where the data had the different combinations as columns of the dataframe so the CustomJS part of the code was as follows: callback = CustomJS(args={'source':source},code=""" // print the selectd value of the select widget - // this is printed in the browser

Access bokeh server URL

浪子不回头ぞ 提交于 2019-12-08 04:37:29
问题 I'd like to access my bokeh application's URL. I tried: curdoc().session_context.server_context.application_context.url But it only gives me the last part of the URL. Also, when acessing the HTTP request object from curdoc().session_context.request Only the arguments member can be queried (as defined in https://docs.bokeh.org/en/latest/docs/user_guide/server.html#accessing-the-http-request). How do I get the complete URL of the running bokeh application? Thanks 回答1: As suggested in the

python bokeh; change Patch colours with CustomJS callback on GMapPlot

不打扰是莪最后的温柔 提交于 2019-12-08 04:05:45
问题 I'm trying to add a button to my bokeh plot that will allow me to change the colour used on a patch glyph that I've added to a GMapPlot using a callback. Currently what I have is: from bokeh.io import output_file, show from bokeh.models import GMapPlot, GMapOptions, ColumnDataSource, DataRange1d, Patch map_options = GMapOptions(lat=-41.281909, lng=174.775993, zoom=13) p = GMapPlot(x_range=DataRange1d(), y_range=DataRange1d(), map_options=map_options, api_key=API_KEY) lats = [-41.281909, -41

Holoviews plot not rendered in cell in JupyterLab

岁酱吖の 提交于 2019-12-08 03:15:36
问题 I recently tried running the 1-Introduction.ipynb notebook in holoviews-examples in jupyterlab 0.32.1 with bokeh 0.12.16, holoviews 1.10.7 and jupyterlab_pyviz 0.5.2 installed. The plots don't seem to be rendered in a cell, however; moreover, I can't move the plot around or delete it (see the below example for when I run the first cell in the notebook containing a scatter plot): Any thoughts as to what could be causing this? I don't have this problem if I use bokeh directly. 回答1: Per

Bokeh - Do not show tooltip if it has missing value

我的未来我决定 提交于 2019-12-08 01:19:36
问题 I'm working on a bokeh figure that shows cluster activity. When a user hovers over a particular processor, I want it to show statistics about the processor. Heres the code: TOOLTIPS = [ ("Usage", "@{usage}%"), ("Name", "@name"), ("PID", "@pid"), ("Command", "@command"), ("User", "@user"), ] p = figure(title="Cluster Activity", plot_width=1200, plot_height=700, x_range=nodes, y_range=list(reversed(cores)), tools='hover', toolbar_location=None, tooltips=TOOLTIPS ) This works, but I don't want

Geoviews: Add a slider to choropleth map

╄→гoц情女王★ 提交于 2019-12-07 21:37:32
问题 I'm working on GeoViews and I'd like to know if we could have a slider as an input for the choropleth map in GeoViews. I've another variable in gdf, which is year. Is it possible to have a slider to show year wise Total_Crimes? Edit: Added more information: gdf dataframe has following variables. beat_num Year Total_Crimes beat district sector geometry 111 2012 1449 1 01 1 POLYGON ((-87.62451050462798 41.88829675314376... 111 2013 1645 1 01 1 POLYGON ((-87.62451050462798 41.88829675314376...

How to add permanent name labels (not interactive ones) on nodes for a networkx graph in bokeh?

瘦欲@ 提交于 2019-12-07 20:58:48
问题 I am trying to add a permanent label on nodes for a networkx graph using spring_layout and bokeh library. I would like for this labels to be re-positioned as the graph scales or refreshed like what string layout does, re-positioning the nodes as the graph scales or refreshed. I tried to create the graph, and layout, then got pos from the string_layout. However, as I call pos=nx.spring_layout(G) , it will generated a set of positions for the nodes in graph G, which I can get coordinates of to

Sliding through images with Bokeh Slider

扶醉桌前 提交于 2019-12-07 19:34:37
问题 I am trying to convey a large amount of scientific data seamlessly with the help of sliders. I am beginning with Bokeh and have close to no knowledge in javascript. I tried to setup a first approach to be able to slide through two images, but I cannot get the image to refresh. Suppose I have 1.png and 2.png in my folder. from bokeh.io import vform from bokeh.models import CustomJS, ColumnDataSource, Slider from bokeh.plotting import Figure, output_file, show output_file('image.html') source =

CheckboxGroup in Bokeh to plot additive plots

╄→гoц情女王★ 提交于 2019-12-07 19:24:27
I want to use a checkbox group to represent linearly additive sources. The idea is for the user to be able to turn on or turn off multiple sources of different kinds to display a plot with added values. I implemented a dropdown version where the data had the different combinations as columns of the dataframe so the CustomJS part of the code was as follows: callback = CustomJS(args={'source':source},code=""" // print the selectd value of the select widget - // this is printed in the browser console. // cb_obj is the callback object, in this case the select // widget. cb_obj.value is the

categorical y-axis and datetime x-axis with Bokeh vbar plot

十年热恋 提交于 2019-12-07 18:40:12
问题 I want to draw a vbar plot using bokeh, where x-axis takes datetime and y-axis takes categorical values. Initially I tried circle plot as follows: import pandas as pd from datetime import datetime from dateutil.parser import parse from bokeh.plotting import figure, show, output_notebook from bokeh.models.ranges import FactorRange x = pd.Series(['2017/1/1', '2017/1/2', '2017/1/3', '2017/1/4']).map(lambda x: parse(x)) y = ["a", "b", "c", "a"] p = figure(x_axis_type='datetime', y_range=list(set