modeBarButtons creating error loading dependencies

Hi,
I am using a Mapbox graph and I want to remove some of the buttons, however when I use ‘modeBarButtons’ or ‘modeBarButtonsToRemove’ I get an error loading dependencies. When I remove this line of code everything works fine though. Am I doing something obviously wrong?

dcc.Graph(id='map', animate=True,
                  config={'displayModebar': 'hover',
                          'modeBarButtons': ['hoverClosestGeo', ' zoomOutGeo', 'resetGeo'],
                          'displaylogo': False,
                          },

                  style={'width': '100%',
                         'display': 'inline-block',
                         'height': '500px',
                         }
                  )

I also had an issue here. I think the modeBarButtons option is supposed to be used differently based on the docs (see below), but I’m not entirely sure. My workaround was to use modeBarButtonsToRemove to remove all the modebar buttons I didn’t want. I know it feels a bit verbose, but it works.

- modeBarButtons (boolean | number | string | dict | list; optional): fully custom mode bar buttons as nested array,
where the outer arrays represents button groups, and
the inner arrays have buttons config objects or names of default buttons

Hi,

Of the modeBar options(modeBarButtonsToRemove, ModeBarButtonsToAdd, and modeBarButtons), Only modeBarButtonsToRemove works. However there are options I want to add which im struggling with. By default Mapbox maps don’t have zoom in or zoom out. So I was trying to add it in with toAdd or modeBarButtons. Both of which give me “Error loading Layout”. I think those features may just be incompatible with mapBox though. Maybe there is a different way to do this within mapBox?

Thanks for you help.

Can you solve this? I have the same problem.

Thanks.

The following code adds the buttons, but it does not work:

map = dcc.Graph(id=“map”, figure=map_figure, clear_on_unhover=True,
config={“staticPlot”: False,
“displaylogo”: False,
“modeBarButtonsToRemove”: [“select2d”, “lasso2d”, “pan2d”, “pan3d”, “hoverClosestGl2d”,
“hoverClosestPie”, “toggleHover”, “hoverClosest3d”,
“hoverClosestGeo”],
“modeBarButtons”: [[“toImage”, “zoomInGeo”, “zoomOutGeo”, “zoom3d”, “resetViewMapbox”,
“resetGeo”]]
}
)