Access figure relayout data in notebook

Is there a way to access a figure relayout data in a notebook?

What I mean is the following:

import plotly.graph_objects as go

# Define the figure
fig = (go.Figure(
        y=[-1, 1, -2, 2]

# Show the figure
# Now do some drawing in the figure here! 

# Next cell I would like to access the shapes

I know this is possible using dash callbacks as in here.