samuelcolvin / Bokeh.jl

Bokeh Bindings for Julia
Other
46 stars 14 forks source link

imbedding components #23

Closed wadehenning closed 9 years ago

wadehenning commented 9 years ago

Thank you for working on a Bokeh binding for Julia. What would this python code look like in Julia?

from bokeh.plotting import figure
from bokeh.resources import CDN
from bokeh.embed import file_html

plot = figure()
plot.circle([1,2], [3,4])

html = file_html(plot, CDN, "my plot")
samuelcolvin commented 9 years ago

(small note: having code as code in github is really helpful).

sorry not to reply easlier, I either didn't notice this or noticed on my phone and never got round to remembering it.

I'm guessing the above code using the pydata CDN to loads the js and css files? There's currently no way of doing that with with Bokeh.jl, you can see from here we we always use a relative path to the file. However if you wanted this feature it should be pretty easy to implement.

Why do you want to use a CDN? If it's just to avoid reliance on files in relative directories you can use

using Bokeh
Bokeh.includejs(true)

To include the js and css files in the generated html file. This is how the docs work, see here.

wadehenning commented 9 years ago

Thank you for the reply, Samuel.  I don't necessarily need to use CDN, I am just trying to follow some Bokeh examples.  I am a statistician who has never written stand-alone applications.  Julia is fun to write computational models in and Bokeh is very interesting.  

 On Tuesday, August 4, 2015 2:15 PM, Samuel Colvin <notifications@github.com> wrote:

(small note: having code as code in github is really helpful).sorry not to reply easlier, I either didn't notice this or noticed on my phone and never got round to remembering it.I'm guessing the above code using the pydata CDN to loads the js and css files? There's currently no way of doing that with with Bokeh.jl, you can see from here we we always use a relative path to the file. However if you wanted this feature it should be pretty easy to implement.Why do you want to use a CDN? If it's just to avoid reliance on files in relative directories you can useusing Bokeh Bokeh.includejs(true)To include the js and css files in the generated html file. This is how the docs work, see here.— Reply to this email directly or view it on GitHub.

samuelcolvin commented 9 years ago

Really glad to hear the library is useful.

Feel free to keep asking questions as and when they occur to you, I'll do my best to reply.