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:

bokeh/save_tool.ts at branch-2.4 · bokeh/bokeh · GitHub

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