bokeh

How to enable SSL/HTTPS on bokeh 0.12.5?

那年仲夏 提交于 2019-12-24 01:53:37
问题 I have created a simple Bokeh app that runs successfully via bokeh serve. I was then asked whether it could be re-deployed using HTTPS instead. The client already has an SSL certificate, and the app is only accessed within their intranet. Most search results are for deployments behind a proxy server like Apache or Nginx. Are those required for us to setup SSL? Can it be done on Bokeh natively? 回答1: Bokeh Server does not have any SSL capability built in. If you want that, you will need to

Python Bokeh add a play button to a slider

百般思念 提交于 2019-12-24 00:58:53
问题 my following visualization needs a play button to automatically go through the values on the slider and loop when reaches the end. Is there a way to achieve that? Thanks. The expacted outcome is like the graph on this link: https://demo.bokeh.org/gapminder # Bokeh Visualisation (0.12.7) from bokeh.charts import Scatter, output_file, show from bokeh.plotting import figure, output_file, show, ColumnDataSource from bokeh.io import output_file, show from bokeh.layouts import layout, widgetbox,

Pass file information from html file selector input to python and bokeh

左心房为你撑大大i 提交于 2019-12-24 00:47:06
问题 I'm trying to create a simple bokeh server application that allows a user to load a file from a <input type="file"> file selection button. The app will then plot the data from the file that the user selected. The code below is very simplistic, and I simply don't know how to pass the file information from the file selector to python. I need to use python to handle the file I/O and not html or javascript. I can get it to work just fine when I run bokeh serve --show example.py path/to/input_file

Pass file information from html file selector input to python and bokeh

空扰寡人 提交于 2019-12-24 00:42:29
问题 I'm trying to create a simple bokeh server application that allows a user to load a file from a <input type="file"> file selection button. The app will then plot the data from the file that the user selected. The code below is very simplistic, and I simply don't know how to pass the file information from the file selector to python. I need to use python to handle the file I/O and not html or javascript. I can get it to work just fine when I run bokeh serve --show example.py path/to/input_file

Center embedded Bokeh plot

无人久伴 提交于 2019-12-24 00:37:56
问题 How can I center an embedded Bokeh plot? My css seems to have no effect on Bokeh's <div class="plotdiv"> . In the minimal example below, I want the plot to be at the center of the yellow container. from jinja2 import Template from bokeh.embed import components from bokeh.models import Range1d from bokeh.plotting import figure from bokeh.resources import INLINE from bokeh.util.browser import view x1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] y1 = [0, 8, 2, 4, 6, 9, 5, 6, 25, 28, 4, 7] p1 = figure

Display height in bokeh vbar tooltip

与世无争的帅哥 提交于 2019-12-23 20:33:07
问题 I want to make a bar chart of some simple data, e.g. a pandas dataframe like this. Cats 4 Dogs 3 Mice 27 I would like a tooltip which displays something like this when hovering over a bar: Name: Cats Count: 4 With a bar chart, this worked with hover.tooltips = [ ('Name', ' $x'), ('Count', ' @height'), ] I since switched to vbars. What would be the corresponding keyword for @height? Or does it generally not work this way with vbars/hbars? 回答1: I figured it out. I could make an extra

Bokeh: Using Checkbox widget to hide and show plots

无人久伴 提交于 2019-12-23 17:33:28
问题 I have some difficulties to use the Widget callback with Bokeh. With the help of a checkbox widget, I would like to show/hide the corresponding plots. The difference with this question, is that I would like a plot for each glyph(and not all the glyphs on one same plot). For example, if I tick/untick "b" I would like to see a new plot of the glyph. Edit: New version of my code from bokeh.io import output_file, show from bokeh.layouts import column, widgetbox, row from bokeh.models import

Bokeh glyph coordinates with x_axis_type 'datetime'

核能气质少年 提交于 2019-12-23 17:16:33
问题 I am attempting to add a simple text string (glyph) to a Bokeh plot which uses x_axis_type='datetime' My code (stripped to its essentials ) is as follows: p = figure(plot_width=900, plot_height=380, x_axis_type='datetime') dt = date(2003, 3, 15) p.line(xvals, yvals) txt = Text( # x=some_formatting_function(dt), x=1057005600000, y=0.1, text=["happy day!"], text_align="left", text_baseline="middle", text_font_size="11pt", text_font_style="italic", ) p.add_glyph(txt) show(p) The x-axis range

Can the line dash of a segment plot be defined by source data?

蓝咒 提交于 2019-12-23 17:08:13
问题 Can the line_dash parameter of a segment plot depend on the source data? data = {} data["dash"] = ["dashed","dashed","solid"] data["x0"] = [0,1,2] data["x1"] = [5,6,8] data["y0"] = [1,1,1] data["y1"] = [2,1,2] source = bokeh.models.ColumnDataSource(data) plot.segment(x0="x0", y0="y0", x1="x1", y1="y1", line_dash="dash", source=source) Returns ValueError: expected an element of either Enum('solid', 'dashed', 'dotted', 'dotdash', 'dashdot'), Regex('^(\d+(\s+\d+)*)?$') or Seq(Int), got 'dash'

How to display static images in Bokeh using Div

ⅰ亾dé卋堺 提交于 2019-12-23 09:25:44
问题 In my Bokeh server based project I have to use/add a few images that are within the Bokeh project folder. I created a static folder called "static/" within the project folder and basically my code looks like this: div_img_html = "<img src='static/image.png'>" div_img = Div(text = div_img_html) however when running the server I get: 404 GET /static/image.png (::1) 2.00ms Obviously Bokeh gets the Div command however server doesn't know how to retrieve the actual file.... The actual file