Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Update range when rangeselector/rangeslider was changed

Hello, guys! Is there any way to update the range of the y axis when I’m using rangeselector buttons or rangeslider? I’m trying to draw a very volatile price, so when I am updating rangeselector, the axis with the price (the y axis) didn’t scale. Can I get access to the event of rangeselector, or is there any other way to do that?

You might be able to listen to the relayoutData property of the figure, like:

@app.callback(Output('my-figure', 'figure'), [Input('my-figure', 'relayoutData')])
def update_figure(relayoutData):
    ...

But I haven’t tried this myself yet.