Cannot find active updatemenu button

Hi, I am currently writing a code to depict some signal values from the graphs. The graphs could toggle between the values Sig1 and Sig2 and hence plot different points.

Since I am using these plots as images in another part of the code, I need to figure out which button is currently active.

(Additional information - I am using plotly via shiny, just in case if there’s an alternative on which I can work upon)

Here’s the snippet of the updatemenu buttons code and a screenshot of how the buttons and graph look like:

fig.update_layout(
    updatemenus = [
        dict(
            type = "buttons",
            direction = 'left',
            active = 0,
            buttons = [
                dict(
                    args=[{'visible': sig1_vis},
                        {'xaxis.title.text' : 'rpm',
                         'yaxis.title.text': 'Current'}
                    ],
                    label = 'Sig1',
                    method = 'update'
                    ),
                
                dict(
                    args=[{'visible': sig2_vis},
                        {'xaxis.title.text' : 'rpm',
                         'yaxis.title.text': 'Current'}
                    ],
                    label = 'Sig2',
                    method = 'update'
                )
            ],
            showactive = True,
            
        )
    ]
    )