Skip to content

Commit 0efeb15

Browse files
committed
bring back mapbox in various places
1 parent 047ed33 commit 0efeb15

File tree

30 files changed

+34674
-29500
lines changed

30 files changed

+34674
-29500
lines changed

.circleci/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ case $1 in
9595
make-baselines-virtual-webgl)
9696
SUITE=$({\
9797
find $ROOT/test/image/mocks/gl* -type f -printf "%f\n"; \
98+
find $ROOT/test/image/mocks/mapbox* -type f -printf "%f\n"; \
9899
find $ROOT/test/image/mocks/mapnew* -type f -printf "%f\n"; \
99100
} | sed 's/\.json$//1' | circleci tests split)
100101
python3 test/image/make_baseline.py virtual-webgl $SUITE || EXIT_STATE=$?

devtools/test_dashboard/devtools.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
var Fuse = require('fuse.js/dist/fuse.common.js');
66
var mocks = require('../../build/test_dashboard_mocks.json');
7+
var credentials = require('../../build/credentials.json');
78
var Lib = require('../../src/lib');
89

910
require('./perf');
@@ -18,6 +19,10 @@ var Tabs = {
1819
// use local topojson files
1920
topojsonURL: '../../node_modules/sane-topojson/dist/',
2021

22+
// register mapbox access token
23+
// run `npm run preset` if you haven't yet
24+
mapboxAccessToken: credentials.MAPBOX_ACCESS_TOKEN,
25+
2126
// show all logs in console
2227
logging: 2
2328
});

draftlogs/7015_change.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/index-strict.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ Plotly.register([
3636
require('./heatmapgl'),
3737
require('../src/traces/parcoords/strict'),
3838
require('./parcats'),
39+
require('./scattermapbox'),
40+
require('./choroplethmapbox'),
41+
require('./densitymapbox'),
3942
require('./scattermapnew'),
4043
require('./choroplethmapnew'),
4144
require('./densitymapnew'),

lib/locales/si.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 303 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"@plotly/d3": "3.8.2",
7575
"@plotly/d3-sankey": "0.7.2",
7676
"@plotly/d3-sankey-circular": "0.33.1",
77+
"@plotly/mapbox-gl": "1.13.4",
7778
"@turf/area": "^6.4.0",
7879
"@turf/bbox": "^6.4.0",
7980
"@turf/centroid": "^6.0.2",

src/components/fx/hover.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,11 @@ function getHoverLabelText(d, showCommonLabel, hovermode, fullLayout, t0, g) {
15611561
if(d.zLabel !== undefined) {
15621562
if(d.xLabel !== undefined) text += 'x: ' + d.xLabel + '<br>';
15631563
if(d.yLabel !== undefined) text += 'y: ' + d.yLabel + '<br>';
1564-
if(d.trace.type !== 'choropleth' && d.trace.type !== 'choroplethmapnew') {
1564+
if(
1565+
d.trace.type !== 'choropleth' &&
1566+
d.trace.type !== 'choroplethmapbox' &&
1567+
d.trace.type !== 'choroplethmapnew'
1568+
) {
15651569
text += (text ? 'z: ' : '') + d.zLabel;
15661570
}
15671571
} else if(showCommonLabel && d[h0 + 'Label'] === t0) {

src/components/fx/layout_defaults.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {
1919
var dragMode = coerce('dragmode');
2020
if(dragMode === 'select') coerce('selectdirection');
2121

22-
// if only mapnew or geo subplots is present on graph,
22+
// if only mapbox, mapnew or geo subplots is present on graph,
2323
// reset 'zoom' dragmode to 'pan' until 'zoom' is implemented,
2424
// so that the correct modebar button is active
25-
var hasMapnew = layoutOut._has('mapnew');
25+
var hasMap = layoutOut._has('mapbox') || layoutOut._has('mapnew');
2626
var hasGeo = layoutOut._has('geo');
2727
var len = layoutOut._basePlotModules.length;
2828

2929
if(layoutOut.dragmode === 'zoom' && (
30-
((hasMapnew || hasGeo) && len === 1) ||
31-
(hasMapnew && hasGeo && len === 2)
30+
((hasMap || hasGeo) && len === 1) ||
31+
(hasMap && hasGeo && len === 2)
3232
)) {
3333
layoutOut.dragmode = 'pan';
3434
}

src/components/legend/style.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,12 +541,14 @@ module.exports = function style(s, gd, legend) {
541541
useGradient = true;
542542
break;
543543
case 'choropleth' :
544+
case 'choroplethmapbox' :
544545
case 'choroplethmapnew' :
545546
ptsData = [
546547
['M-6,-6V6H6V-6Z']
547548
];
548549
useGradient = true;
549550
break;
551+
case 'densitymapbox' :
550552
case 'densitymapnew' :
551553
ptsData = [
552554
['M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0']

0 commit comments

Comments
 (0)