I’m getting started with Plotly Dash, and trying to use the trick of storing JSON-encoded data in a hidden div.
I have a couple of chained callbacks which update UI elements when the data changes. I need a callback further down the chain to be able to read the JSON-encoded data - but I don’t want the div to be an Input to that callback, as I don’t want the callback to trigger when it changes. The triggering should occur earlier in the chain.
I thought that I could achieve this by examining
app.layout['hidden_div'].children from within my callback. I realise I’m not supposed to directly modify the state of this variable as it’s outside the scope of my function, but I thought reading it would be ok. However it appears that even reading the variable is causing problems (if I am actually supposed to be able to read the variable, I’ll go into detail on the issues I seem to be getting).
Is reading a component directly, such as
app.layout['hidden_div'].children, supposed to be allowable from within a callback? If not, is there a correct way for a callback to read data from a component without triggering on it?
Thanks for any help!