Black Lives Matter. Please consider donating to Black Girls Code today.

Graph-Buttons - how can I have not all the traces show at once at page-load?

I have 4 ‘update’ buttons within my graph. Clicking each of the individual buttons, brings a new ‘trace’ view on the graph.

The buttons are respectively:

  • Default view
  • Poisson View
  • Context view
  • Both (Poisson and Context) View.

My problem: the traces for all 4 views are shown per default on page load. Only when I click on ‘Default View’ I get to see only the traces for that button.

Question: how can I have not all the traces show at once at page-load?

My code for the buttons:

################################################
                    #--------------- Graph Buttons ----------------#
                    ################################################
                    buttons=list(
                        [
                            #defaultView Button
                            dict(
                                label="Default View",
                                method="update",
                                args=[{"visible": [True, False, False, False, True, True]},
                                {"title": "Red View",
                                "annotations": []}]),

                            #redView Poisson Button
                            dict(
                                label="Poisson View",
                                method="update",
                                args=[{"visible": [False, True, False, False, True, True]},
                                ]),

                            #redView Camps Button
                            dict(
                                label="Context View",
                                method="update",
                                args=[{"visible": [False, False, True, False, True, True]},
                                ]),

                            #redView Both Button
                            dict(
                                label="Poisson+Context View",
                                method="update",
                                args=[{"visible": [False, False, False, True, True, True]},
                                ]),

                        ]
                    )