bokeh

Interactive Slider using Bokeh

我的梦境 提交于 2019-12-05 07:20:06
问题 I'm trying to use a bokeh interactive slider to modify the contents of a plot, similar the example here. I have a two nested lists x and y . I simply want the slider to change the index of the lists to plot. i.e. If the slider index = 0, then plot x[0] vs y[0] , if the slider index is 1, plot x[1] vs y[1] , etc... The documentation example computes the new data on the fly, which is not feasible for the data that I need to work with. When I run the code below, nothing shows up in the plot... I

How do I integrate a Bokeh Server into a Pyramids Application?

久未见 提交于 2019-12-05 06:49:00
问题 In order of complexity, with Pyramids, I can create static bokeh graphs and then incorperate them with div tags like outlined here. The Bokeh documentations explain clearly how one can setup a bokeh server for interactive data exploration, and I have successfully created such an application. What I would like to do though is to have an interactive graph within a Pyramids view page. The requirements of this page would be as followed: Upon loading of the view, a bokeh server is somehow started,

Image plot in bokeh with tight axes and matching aspect ratio

怎甘沉沦 提交于 2019-12-05 05:59:02
I'm using bokeh 1.0.1 version inside a Django application and I would like to display microscopic surface images as zoomable image plots with a color-encoded height and colorbar. In principle this works, but I have problems to get plots with the correct aspect ratio only showing the image without space around. Here is an example for what I want to achieve: The resulting plot should show an image of random data having a width of sx=10 and a height of sy=5 in data space (image size ) have axes limited to (0,sx) and (0,sy) , on initial view and when zooming a square on the screen should match a

Bokeh dynamically changing BoxAnnotation

安稳与你 提交于 2019-12-05 05:07:20
Is there possible to update bokeh figure's renderes in IPython's interact function. I have code which looks like: x = [0, 1, 2, 3, 4] y = [0, 1, 2, 3, 4] source = ColumnDataSource(data=dict(x=x, y=y) f = figure() f.line(x, y, source=source) show(f) def update_func(selected_data): source.data['y'] = ... source.push_notebook() <here I would like to add BoxAnnotation to figure f, and rerender it> interactive(update_func, selected_data=[0,1,2]) You could use CustomJS to insert some JavaScript code that will be used to change the bottom and top values of the BoxAnnotation. I'm using the Slider from

Bokeh Interactive legend hide multiple glyphs

£可爱£侵袭症+ 提交于 2019-12-05 05:07:08
I've enabled the hide legend option for my dataset. When I click it, only one bar goes off and others stay. I'm not quite sure what is causing the issue. Here's the bar plot before and after: . Here's what my data looks like: Here's the code: p = Bar(output,'Programs',values="Averages", group="University",plot_width=600,plot_height=400, title="Comparison") p.legend.click_policy="hide" output_file("bar.html") show(p) It is not currently (Bokeh 0.12.6) possible to hide all the bars via legend.click_policy="hide" , as stated in the documentation : Interactive legend features currently work on

Bokeh widgets call CustomJS and Python callback for single event?

寵の児 提交于 2019-12-05 04:53:34
I have a Bokeh application that makes use of the Python callbacks for various widget events. With certain events, I'd like to execute some JavaScript code before making the callback to the Python function. Is this possible? In this case, the Python callback is potentially long-running, and I'd like to start and stop a Javascript spinner object before and after the long-running Python code executes. As of Bokeh 1.0.4, "busy" / "done" events (to enable things like triggering spinners or other UI events) are still an open feature request. In the mean time, your best bet is to use some "dummy"

How to configure Nginx with gunicorn and bokeh serve

一个人想着一个人 提交于 2019-12-05 02:54:31
问题 I want to serve a flask app that uses embedded bokeh serve from a server on my local network. To illustrate I made an example using the bokeh serve example and a docker image to replicate the server. The docker image runs Nginx and Gunicorn. I think there is a problem with my nginx configuration routing the requests to the /bkapp uri. I have detailed the problem and provided all source code in the following git repo I have started a discussion on bokeh google group Single Container In order

Automatically fit Bokeh plot to screen?

有些话、适合烂在心里 提交于 2019-12-05 02:29:24
Is there a simple way to automatically fit a Bokeh plot to the screen used to display your browser? Right now I'm setting the plot width and height manually. Note: when I say fit I mean that I want the plot to fill 80% of the visible screen. In more recent bokeh versions, yes you can do this (easily). plots and layouts now have a sizing_mode property which by default is set to fixed . The other values include scale_width , scale_height , and scale_both . import bokeh.plotting import bokeh.layouts fig1 = bokeh.plotting.figure() fig1.sizing_mode = 'scale_width' fig2 = bokeh.plotting.figure()

Upload a CSV file and read it in Bokeh Web app

自古美人都是妖i 提交于 2019-12-05 01:43:06
I have a Bokeh plotting app, and I need to allow the user to upload a CSV file and modify the plots according to the data in it. Is it possible to do this with the available widgets of Bokeh? Thank you very much. Although there is no native Bokeh widget for file input. It is quite doable to extend the current tools provided by Bokeh. This answer will try to guide you through the steps of creating a custom widget and modifying the bokeh javascript to read, parse and output the file. First though a lot of the credit goes to bigreddot's previous answer on creating the widget. I simply extended

Using bokeh: How does one plot variable size nodes, and node colors?

你。 提交于 2019-12-05 01:19:57
问题 I am trying to display a graph using networkx with bokeh 12.7 that Has node size based on node degrees Color based on another node attribute. Desired Output: Data Setup import pandas as pd import numpy as np import networkx as nx import seaborn as sns from bokeh.io import show, output_notebook #output_file, from bokeh.plotting import figure from bokeh.models.graphs import from_networkx from bokeh.models import GraphRenderer, StaticLayoutProvider, LinearColorMapper, ColumnDataSource from bokeh