plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Default mapbox style missing

Open ndrezn opened this issue 1 year ago • 2 comments

For Mapbox traces, it looks like either the default style is missing or is an undocumented (required) parameter.

If my memory serves me correctly, it wasn't required to specify a style, but now if a style isn't specified we see in the console:

Error: No valid mapbox style found, please set `mapbox.style` to one of:
carto-darkmatter, carto-positron, open-street-map, stamen-terrain, stamen-toner, stamen-watercolor, white-bg
or register a Mapbox access token to use a Mapbox-served style.

This isn't related to Maplibre, I can reproduce in 2.34.0. Maybe Mapbox dropped style we set as default? Setting the styles in JS works fine.

// Define the layout
const layout = {
    mapbox: {
        // style: 'carto-darkmatter', // Equivalent to mapbox_style="carto-darkmatter"
        zoom: 10,
        center: {
            lat: 45.5, // Center latitude
            lon: -73.5 // Center longitude
        }
    },
    margin: { t: 0, b: 0, l: 0, r: 0 }
};

Here's an example: https://codepen.io/ndrezn/pen/KwPKVpY

This is a bigger issue in Python where the error is only visible in the JS console and isn't shown a Python error, so it's quite confusing to debug.

This isn't an issue in the new trace types where style has a valid default.

ndrezn avatar Nov 26 '24 16:11 ndrezn

@archmoj is this something we need to fix in this release? if so, please bump to P1 and tag me - thanks.

gvwilson avatar Nov 26 '24 17:11 gvwilson

IMO we don't need to fix this in this release and we could leave as nofix as these traces are deprecated.

ndrezn avatar Nov 26 '24 17:11 ndrezn