Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e40d208

Browse files
committed
add test
1 parent faf590e commit e40d208

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

test/jasmine/tests/scattermapbox_test.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,3 +1253,47 @@ describe('Test plotly events on a scattermapbox plot when css transform is prese
12531253
});
12541254
});
12551255
});
1256+
1257+
describe('scattermapbox restyle', function() {
1258+
var gd;
1259+
1260+
beforeAll(function() {
1261+
Plotly.setPlotConfig({
1262+
mapboxAccessToken: require('../../../build/credentials.json').MAPBOX_ACCESS_TOKEN
1263+
});
1264+
1265+
gd = createGraphDiv();
1266+
});
1267+
1268+
afterAll(function() {
1269+
Plotly.purge(gd);
1270+
destroyGraphDiv();
1271+
});
1272+
1273+
it('@gl should be able to update legendonly to visible', function(done) {
1274+
Plotly.newPlot(gd, {
1275+
data: [{
1276+
lat: [0, 2], lon: [0, 2],
1277+
type: 'scattermapbox',
1278+
mode: 'lines',
1279+
visible: 'legendonly'
1280+
},
1281+
{
1282+
lat: [0, 2], lon: [2, 0],
1283+
type: 'scattermapbox',
1284+
mode: 'lines',
1285+
visible: true
1286+
}
1287+
], layout: {
1288+
mapbox: {
1289+
style: 'open-street-map',
1290+
zoom: 6,
1291+
center: { lat: 1, lon: 1 }
1292+
},
1293+
showlegend: true
1294+
}
1295+
}).then(function() {
1296+
return Plotly.restyle(gd, 'visible', true);
1297+
}).then(done, done.fail);
1298+
});
1299+
});

0 commit comments

Comments
 (0)