sorry to dig up this older message, but did somebody found a workaround? Executing this script works via compiling to .html with show() but not when using the bokeh server. I need this to work via bokeh server…
from bokeh.io import curdoc
from bokeh.models import ColumnDataSource,TapTool,CustomJS
from bokeh.plotting import figure
source = ColumnDataSource(data=dict(x=[1, 2, 3],y=[2, 5, 8]))
taptool = plot.select(type=TapTool)
#code=""“window.open(‘E:\test.html’);”""#doesn’t work via bokeh serve, otherwise it does. The http like below always works.
taptool.callback = CustomJS(args=dict(source=source), code=""“window.open(‘http://google.com’);”"")
On Sunday, June 14, 2015 at 1:55:42 AM UTC+2, joe gi wrote:
Ok, it does not work in the notebook but it works ok if you save the file to html
I tried something like this:
url = “file:///Users/joegi/Desktop/opt/camilo_dakota/c1/links/f1.png”
taptool = p1.select(type=TapTool)
From: Bryan Van de Ven [email protected]
To: [email protected]
Sent: Friday, June 12, 2015 1:18 AM
Subject: Re: [bokeh] open local file using taptool
window.open(). Presumabely if you don’t specify a protocol it defaults to “http” and whatever host the current document is on. So it might work if you give it “file” specifically:
I’ve not had a chance to test this. If it works for you, a PR that adds a note to the docstring or User’s Guide (or both) explaining this would be very appreciated.
On Jun 11, 2015, at 4:29 PM, ‘joe gi’ via Bokeh Discussion - Public [email protected] wrote:
I wonder if it is possible to open a local file using taptool
I am trying something like this:
but it doesn’t work.
It seems that it is trying to open: http://localhost:8888/Users/joegi/Desktop/inter.html