Modebar interactions as a callback property

Hi,

Is there a way to get the mode bar interactions like reset axis, pan… etc as the trigger to a callback

Thanks in advance

1 Like

This is an interesting idea.

Interaction with the grid happens and relayout is called. You could add event listeners to when these buttons are pushed and use dash_clienstide.set_props to change any components props directly from there.

I believe that there may be a spot in the code where the mode of the cursor is changed which could be used for a prop. Things like the plotly link and image creation, I don’t think trigger this mode change. Would you also want to know when something is triggered for the link and image?

You could add an event listener to the whole div, as outlined here:

And use this to check which modebar button was pushed.

@jinnyzor
So, there is no direct way like relayout data for the modebar buttons.
and the work around is to have an event listerner.
Is there any sample code which I can go through to do this.
I just want to a function trigger on when reset axis is clicked in the Modebar

image

also is the event listener available in all versions of dash?