Skip to content

Config modeBarButtonsToAdd 'zoom2d' throwing "Error loading dependencies" #282

@leejt489

Description

@leejt489

Trying to add zoom to the mode bar for a map, and I get "Error loading dependencies" in the browser. Looking in chrome debugger, the JavaScript error is:

Error: must provide button 'name' in button config
at plotly-1.35.2.min.js:7
at Array.forEach ()
at plotly-1.35.2.min.js:7
at Array.forEach ()
at cm.hm.updateButtons (plotly-1.35.2.min.js:7)
at cm.hm.update (plotly-1.35.2.min.js:7)
at new cm (plotly-1.35.2.min.js:7)
at fm (plotly-1.35.2.min.js:7)
at Object.pm.manage (plotly-1.35.2.min.js:7)
at Vm.lsInner (plotly-1.35.2.min.js:7)

My dash code is

                        dcc.Graph(
                            id='map',
                            #animate=True,
                            figure = {
                                'data': []#,
                                # 'layout': {
                                #     'mapbox': {
                                #         'layers': [],
                                #         'accesstoken': MAPBOX_TOKEN,
                                #         'center': {
                                #             'lat': 0,
                                #             'lon': 20,
                                #         },
                                #         'zoom': 2,
                                #         'pitch': 0
                                #     }
                                # }
                            },
                            config = {
                                'modeBarButtonsToAdd': ['zoom2d'],
                                'modeBarButtonsToRemove': ['toggleHover','sendDataToCloud']
                            }
                        )

I render the figure layout and data in a callback, and the layout is a mapbox map if that is relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions