Moving fig between callbacks with px only

In one callback I create a px.line figure and display it in some Div.

Then I create a button to open that figure in another browser’s tab.

In callback for that button I have inputs as

  • ‘n_clicks’ for the button and
  • ‘figure’ to grab figure from the first Div

I use to open new tab.

Now, as a result of ‘figure’ input I get not a fig object but plain dictionary.
I can convert this dict to fig object with plotly.go but can’t figure out how to do it with px (so I don’t have to import the whole nine yards of plotly just for this conversion)?

Can I ask for some help?