bokeh

Sending URL parameter from Flask to a Bokeh server

試著忘記壹切 提交于 2019-12-01 21:40:21
I'm trying to integrate a Bokeh "autoloaded" server into a Flask app where the set of data to load would be chosen by the user on another page. The ID of this set of data is in the URL (get parameter), and I'm not able to send it from the Flask app to the Bokeh server. Some example code: # flask_app.py import subprocess import atexit import subprocess, os from flask import render_template, render_template_string, Flask from bokeh.embed import autoload_server from bokeh.client import pull_session, push_session app_html = """ <!DOCTYPE html> <html lang="en"> <body> <div class="bk-root"> {{ bokeh

How to set the default style in Bokeh?

浪子不回头ぞ 提交于 2019-12-01 19:04:57
I'm writing a report whose plots are all rendered with Matplotlib . I've adjusted Matplotlib 's default to ensure that all plots have the same style. However, I need to use Bokeh since it provides support for rendering legends for Datashader - a library being developed by the folks at Bokeh . My issue is that the default Bokeh style is very different from my custom style. Rather than changing every single attribute in my Bokeh plot would it be possible to have Bokeh read from a style sheet in a similar way as Matplotlib does with plt.use.style(['ggplot']) ? As of Bokeh 0.12.4 there are still

can't perform this operation for unregistered loader type

左心房为你撑大大i 提交于 2019-12-01 18:48:57
I'm using bokeh for data visualization, and trying to make an executable but it shows an error message of "can't perform this operation for unregistered loader type" I have tried as a solution of init .py to the directory (+subdir) of my script.py, but it's not work. PS. Win10, Python 3.6.3, pyinstaller 3.4, bokeh 0.12.13 Code: from bokeh.plotting import figure, show p = figure(width=800, height=400, title="Money") p.title.text_color = "green" p.title.text_font_size = "18pt" p.xaxis.axis_label = "Time" p.xaxis.axis_label_text_color = "violet" p.yaxis.axis_label = "Money" p.yaxis.axis_label

Run Web app with Bokeh plots in an offline mode? Where to dl Required Bokeh files

送分小仙女□ 提交于 2019-12-01 16:30:01
问题 I have a web application with python controllers, where output plots are plotted by Bokeh. In my master template.html file I load bokeh-0.9.2.min.css and bokeh-0.9.2.min.js as shown below. My question is "If I run my web app as a browser app in offline mode, Is it possible to download these two files into my static/jss folder and run it offline?" <link rel="stylesheet" href="http://cdn.bokeh.org/bokeh/release/bokeh-0.9.2.min.css" type="text/css" /> <script type="text/javascript" src="http:/

Run Web app with Bokeh plots in an offline mode? Where to dl Required Bokeh files

一笑奈何 提交于 2019-12-01 16:29:32
I have a web application with python controllers, where output plots are plotted by Bokeh. In my master template.html file I load bokeh-0.9.2.min.css and bokeh-0.9.2.min.js as shown below. My question is "If I run my web app as a browser app in offline mode, Is it possible to download these two files into my static/jss folder and run it offline?" <link rel="stylesheet" href="http://cdn.pydata.org/bokeh/release/bokeh-0.9.2.min.css" type="text/css" /> <script type="text/javascript" src="http://cdn.pydata.org/bokeh/release/bokeh-0.9.2.min.js"></script> For anyone who stumbles upon this question,

Bokeh: Vbar cannot be shown for datetime xaxis

时间秒杀一切 提交于 2019-12-01 12:22:39
I prepared two ColumnDataSource which has different data set for y axis. plot.line('x', 'y', source=source, line_width=2) plot.circle('x', 'y', source=source, fill_color="blue", size=8) plot.vbar(x='x', top='y', source=source1, width=0.5, bottom=0, fill_color="red")#this part doesn't work. And line and circle does work but when I tried to show the vbar for another data, it doesn't show but seems like the range of the axis is changed by the vbar codes. I tried to show only the vbar graph on mini program. And vber is never shown for my dataframe. And I found out there's a problem with my

Bokeh hovertools which run arbitrary python code

若如初见. 提交于 2019-12-01 12:02:43
问题 I am using Bokeh to try and create a figure whose data points when 'hovered' over by the user will display another graph within the hover tool, showing additional information about that data point (i.e., in the main figure data points are the mean of a time-series over a set interval, I want the hover tool to show all the data in that interval). The user guide (full code copied in below) provides one solution: use a custom HTML tooltip to reference figures on file. This would, however,

Code 503 in Flask with Embedded Bokeh Server App fetching jsonified data through requests.get()

倾然丶 夕夏残阳落幕 提交于 2019-12-01 11:43:42
问题 I'm in the process of parameterizing my bokeh apps by having my Flask app expose model data via a route dedicated to jsonifying the requested data passed via query string arguments. I know the data sending route works since when I use it as a url to AjaxDataSource I get the expected data plotted. However when I attempt the equivalent operation using the requests.get api I get a 503 response code which makes me think I'm violating something fundamental here I can't quite grasp with my limited

Can I change tickers in a plot to custom text tickers?

六眼飞鱼酱① 提交于 2019-12-01 10:59:57
I'm trying to change the x-axis on a plot to get ordinal text values and I'm having a hard time trying to find a workaround. Here is my goal: I want to show the IRR of 2 proposed modifications of a government program for the retirees who had middle incomes of 20 000$ and 50 000$ in their whole life. So, I have 4 IRR: 2 for the ones with 20 000$, and 2 for the ones with 50 000$. What's tricky is that I don't have exact x-coordinates; instead, I used nominal x-coordinates to build my histogram bins (using .quad() method). Then, using the FixedTicker class, I got only 2 tickers to show: the ones

How to plot Horizontal Bar Chart in Bokeh (Python)

筅森魡賤 提交于 2019-12-01 10:29:23
I have this data: data = {'Cities': {'Des_Moines': 80.0, 'Lubbock': -300.0, 'Minneapolis': 85.7, 'Orange_County': 80.0, 'Salt_Lake_City': 81.8, 'San_Diego': 80.0, 'San_Francisco': -400.0, 'Troy': -400.0, 'Wilmington': -300.0}} I have plotted this using Seaborn and it looks great. df_data = pd.DataFrame(data).sort_values('Cities', ascending=False) sns.barplot(x='Cities', y=df_data.index, data=df_data, label='Cities', palette='Greens') However, I'll like to embed this is a Flask web app using Bokeh . I couldn't find an horizontal barplot in Bokeh . Even flipping the x and y axis do not seem to