🚀 Gen 5 of the leading AI app deployment platform launches October 6. Click for the livestream.

Callback to edit graph config not working

My app consists of some tickboxes which modify a plot, followed by an option to modify the graph’s save button to output different image formats. Doing this manually in the code works by changing the config part of the dcc.Graph object as so

‘config’ : {
‘toImageButtonOptions’: {
‘format’: ‘svg’,
‘filename’: ‘Radial Distribution Functions’,
‘height’: 500,
‘width’: 500,
‘scale’: 1
}
}

To allow the user to decide the size of the image and its format I’ve written a callback that is fired by the user changing two input boxes (height, width) or a dropdown (format). The callback is fired successfully insofar that the boxes are read, but the function of the save button on the plot remains unchanged.

Is what I’m trying to do actually possible?

Fixed it. I was returning

{ ‘config’: {
‘toImageButtonOptions’: {
‘format’: PlotFormat,
‘filename’: ‘Radial Distribution Functions’,
‘height’: 500,
‘width’: 500,
‘scale’: 1
}
}}

when I should have been returning

{
‘toImageButtonOptions’: {
‘format’: PlotFormat,
‘filename’: ‘Radial Distribution Functions’,
‘height’: 500,
‘width’: 500,
‘scale’: 1
}
}