In a Dash callback to get relayoutData drawrect annotations I want to limit the rectangle to one, the most recent one.
Updating shape array from relayoutData has no effect and I have no access to Graph figure from callback. Passing figure in State did not hello.
What is the solution?
Thank you in advance
Solved: added figure as State and Output
shape = shapes[-1] # Get the latest shape
relayoutData[‘shapes’]=[shape]
fig[‘layout’][‘shapes’]=relayoutData[‘shapes’] # update figure