I am using Bokeh to produce HTML code including figures with show
method This method ends on opening default browser with HTML opened in it.
I want to save the HTML code, without showing it. How can I do that ?
Bokeh creates the HTML file when you call the show() function. This function also automatically opens a web browser to display the HTML file. If you want Bokeh to only generate the file but not open it in a web browser, use the save() function instead.
Exporting PNG images Bokeh can generate RGBA-format Portable Network Graphics (PNG) images from layouts using the export_png() function. This functionality renders the layout in memory and then captures a screenshot. The output image will have the same dimensions as the source layout.
You can achieve this with the server_document() function. This function accepts the URL to a Bokeh server application and returns a script that embeds a new session from that server every time the script executes. You can add this tag to an HTML page to include the Bokeh application at that point.
Solution is to replace calls to show
by calls to save
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With