Closed
Description
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
});
});