Hi,
I’m create a graphing web app. Development is just on my computer with 1 .js, 1 .html file.
I’m trying to print out web page (which includes the graph + other stuff). I would like to be able to format the printing so it prints the same every time.
I’ve tried a few random js libraries that allow printing of DOM/HTML elements.
printjs can print the div the Plot is in, but will not print the plot itself, which I guess makes sense.
So that approach failed, and I’m now trying to use export_png()
But this doesnt seem to exist in BokehJS??? There is a save button on the plot toolbar so surely it is possible to export the plot with code instead of the button?
If it does exist, how would I call it? I’ve been trying
Bokeh.io.export_png(plot, filename = "bokeh_plot.png");
I also tried other variations of calling it, Bokeh.IO, Bokeh.Io,…
This gives
Uncaught TypeError: Bokeh.io is undefined
I tried looking in the source code on GitHub but I couldn’t find the export_png() for JavaScript.
So, my overall question is: Can I use export_png() in BokehJS, if so how? If not, are there alternatives?
Thanks