Trying to autoscale the yaxis when using the range selector but seems to not be getting called at all? Trying to adapt solution found here to work with rangeselector. I currently have
def zoom(layout, x_range): print('yaxis updated') in_view = df.loc[figure.layout.xaxis.range:figure.layout.xaxis.range] figure.layout.yaxis.range = [in_view.High.min() - 10, in_view.High.max() + 10] def build_plot(): . . . figure=go.FigureWidget(data=data, layout=layout) figure.layout.on_change(zoom, 'xaxis.range')
Right now I’m not even seeing the print statement in the console. Is this only possible with range slider or am I simply making some other mistake as only the xaxis is changing? Also, I’m rendering directly in html (flask render_template) not using juypter; originally I was just using go.Figure but I went to go.FigureWidget so I could use the on_change callback. Not certain where I should go at this point so any feedback is welcome.