bokeh

Bokeh DataTable not show in Flask

江枫思渺然 提交于 2020-02-23 06:03:23
问题 I am developing a Flask web application to show data in a DataTable and also build interactive reports by Bokeh. My below code to show bokeh DataTable not work. from flask import Flask, render_template, request import pandas as pd from bokeh.embed import components from bokeh.models.widgets import DataTable, DateFormatter, TableColumn from bokeh.models.sources import ColumnDataSource app = Flask(__name__) # Load the Iris Data Set iris_df = pd.read_csv("/data/iris.data", names=["Sepal Length",

Dynamic indexes while zooming in Python Bokeh

雨燕双飞 提交于 2020-02-08 07:31:32
问题 I am fairly new to Bokeh and try to achieve the following: I have a dataset with rows containing dates in the format dd-mm-yyyy. The dates are counted and then plotted. When zoomed in I want Bokeh to show the indiviudal dates (that works already). When zoomed out I want Bokeh only to show the months (or years when zoomed out even further). Right know the index gets pretty messy due to individual dates getting closer and closer the more you zoom out. Is there a way to tell Bokeh to change what

Dynamic indexes while zooming in Python Bokeh

北城以北 提交于 2020-02-08 07:31:26
问题 I am fairly new to Bokeh and try to achieve the following: I have a dataset with rows containing dates in the format dd-mm-yyyy. The dates are counted and then plotted. When zoomed in I want Bokeh to show the indiviudal dates (that works already). When zoomed out I want Bokeh only to show the months (or years when zoomed out even further). Right know the index gets pretty messy due to individual dates getting closer and closer the more you zoom out. Is there a way to tell Bokeh to change what

How to create a proportional (pre-defined boundaries) colour bar with bokeh?

一个人想着一个人 提交于 2020-02-04 06:37:06
问题 I would like to plot a graph with a proportional colour bar on the right like graph 1, but with bokeh rather than matplotlib. Here's the matplotlib version with a proportional (pre-defined boundaries) colour bar using matplotlib colors.BoundaryNorm(bounds, cmap.N) : But my current bokeh version has the right hand side colour bar not proportional, although I have given ticker boundaries: My bokeh code: ticker = FixedTicker(ticks=bounds) bounds = [0, 5, 25, 75, 95,100] color_bar = ColorBar

How to create a proportional (pre-defined boundaries) colour bar with bokeh?

风流意气都作罢 提交于 2020-02-04 06:36:47
问题 I would like to plot a graph with a proportional colour bar on the right like graph 1, but with bokeh rather than matplotlib. Here's the matplotlib version with a proportional (pre-defined boundaries) colour bar using matplotlib colors.BoundaryNorm(bounds, cmap.N) : But my current bokeh version has the right hand side colour bar not proportional, although I have given ticker boundaries: My bokeh code: ticker = FixedTicker(ticks=bounds) bounds = [0, 5, 25, 75, 95,100] color_bar = ColorBar

Can I update a bokeh plot without callbacks from the server?

时光总嘲笑我的痴心妄想 提交于 2020-02-02 12:23:46
问题 I want Bokeh to update periodically and arbitrarily when the results from a separate algorithm running in python returns results, not based on any input from the Bokeh interface. I've tried various solutions but they all depend on a callback to a some UI event or a periodic callback as in the code below. import numpy as np from bokeh.plotting import figure, curdoc from bokeh.models import ColumnDataSource, Plot, LinearAxis, Grid from bokeh.models.glyphs import MultiLine from time import sleep

Bokeh dynamically changing BoxAnnotation

こ雲淡風輕ζ 提交于 2020-02-02 01:03:43
问题 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]) 回答1: As of Bokeh 0.11 the push_notebook function can

load graph data from files on button click with bokeh

匆匆过客 提交于 2020-01-31 05:50:05
问题 I'm trying to use toggle buttons in Bokeh to create an interactive website where a user can click toggle buttons to select which graphs are plotted. The buttons would load data from a text file (containing two columns x and y data). the data files have two columns containing x and y data separated by a space. When the toggle buttons are selected then the corresponding data would be plotted, the plot would be removed when the toggle button is deselected. I'm currently having trouble passing an

Holoviews tap stream of correlation heatmap and regression plot

蹲街弑〆低调 提交于 2020-01-30 08:52:04
问题 I want to make a correlation heatmap for a DataFrame and a regression plot for each pair of the variables. I have tried to read all the docs and am still having a very hard time to connect two plots so that when I tap the heatmap, the corresponding regression plot can show up. Here's some example code: import holoviews as hv from holoviews import opts import seaborn as sns import numpy as np import pandas as pd hv.extension('bokeh') df = sns.load_dataset('tips') df = df[['total_bill', 'tip',

text.on_change Not Responsive for Bokeh TextInput

我的未来我决定 提交于 2020-01-28 02:33:30
问题 I am a beginner to using Python's bokeh plotting tool and widgets. In my following code I am trying to have the title of the graph change to the value of the TextInput box. However, while the box appears upon entering in text and unfocusing, nothing changes. What could be causing this issue and what can I do to fix it? p=figure( height=400, x_axis_type='datetime', title=(company+' ('+tickerstring+') ') ) thedates = np.array(stockdates, dtype=np.datetime64) source = ColumnDataSource(data=dict(