displayModeBar config not working on choropleth_mapbox (python plotly express + plotly.js)

Hey all,

I’m working on a visualization using choropleth_mapbox and I wanted to have the modebar always visible. After some research I noticed I had to add a {displayModeBar: true} config to my plot. The way I’m working is: I generate the plot data on python and then I send it to javascript and plot it there. My simplified python code is:

def get_graph(gdf, gj, featureidkey, locations):
    fig = (
        px.choropleth_mapbox(
            gdf,
            geojson=gj,
            featureidkey=featureidkey,
            locations=locations,

        )

    ) 

    graphJSON = fig.to_json()

    return json.dumps(graphJSON)

And then this JSON is sent to javascript and plotted:

function drawGraph(graph) {

    var figure = JSON.parse(graph);
    console.log(figure);
    var config = {
                  displayModeBar: true}
    console.log(config)
    Plotly.newPlot('graph', figure, {}, config);
}

Using displayModeBar true or false, the plot keeps showing the modebar on hover only. Is this a bug or am I missing something?

Thanks!