Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection broken after reacting add another trace on top of choroplethmapbox #6346

Closed
archmoj opened this issue Oct 20, 2022 · 0 comments · Fixed by #6345
Closed

Selection broken after reacting add another trace on top of choroplethmapbox #6346

archmoj opened this issue Oct 20, 2022 · 0 comments · Fixed by #6345
Labels
bug something broken

Comments

@archmoj
Copy link
Contributor

archmoj commented Oct 20, 2022

As discovered in plotly/dash#1097, selecting after react cause errors:

var layout = {
    "mapbox": {
        "center": {
            "lon": -74.22,
            "lat": 42.35
        },
        "zoom": 3.5
    },
    "title": {
        "text": "choroplethmapbox with legends"
    },
    "width": 500,
    "height": 250,
    "margin": {
        "t": 50,
        "b": 0,
        "l": 0,
        "r": 0
    }
};

var choroplethmapbox = {
    "type": "choroplethmapbox",
    "name": "NY",
    "locations": ["NY"],
    "z": [1],
    "colorscale": [[0, "blue"], [1, "blue"]],
    "showlegend": true,
    "showscale": false,
    "geojson": "https://raw.githubusercontent.com/python-visualization/folium/master/examples/data/us-states.json"
};

var scattermapbox = {
    "type": "scattermapbox",
    "marker": {
        "size": 40
    },
    "lon": [-70],
    "lat": [40]
};


Plotly.newPlot(gd, {
    "data": [
        choroplethmapbox
    ],
    "layout": layout
}).then(function () {
    Plotly.react(gd, {
        "data": [
            choroplethmapbox,
            scattermapbox
        ],
        "layout": layout
    });
});
@archmoj archmoj added the bug something broken label Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant