Customize bokeh graph save button

Hi, I am creating a website using React, and I have embedded a bokeh graph on my website, the issue is that I hope to create a new button that can connect to the “Save button” that comes with the image (image below) , I am wondering how I can access this “Save button” in Javascript?

截屏2022-09-15 10.41.12

截屏2022-09-15 10.41.25

Also, when I click this button, the output image is always named"bokeh_plot.png", I am wondering if there is a way to customize this name

I am wondering if there is a way to customize this name

Using the save tool programmatically is not a use-case that has really been given any attention to date. Your best bet is probably just to do what the save tool does, yourself. It’s only a few lines of code:

https://github.com/bokeh/bokeh/blob/branch-2.4/bokehjs/src/lib/models/tools/actions/save_tool.ts#L9-L34

Not currently, but the next (3.0) release will have a filename property on SaveTool

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.