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

Skip to content

Commit 4710fba

Browse files
committed
find and replace mapbox with mapnew
1 parent ee406f7 commit 4710fba

File tree

98 files changed

+952
-952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+952
-952
lines changed

.circleci/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +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"; \
98+
find $ROOT/test/image/mocks/mapnew* -type f -printf "%f\n"; \
9999
} | sed 's/\.json$//1' | circleci tests split)
100100
python3 test/image/make_baseline.py virtual-webgl $SUITE || EXIT_STATE=$?
101101
exit $EXIT_STATE

lib/choroplethmapbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
'use strict';
22

3-
module.exports = require('../src/traces/choroplethmapbox');
3+
module.exports = require('../src/traces/choroplethmapnew');

lib/densitymapbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
'use strict';
22

3-
module.exports = require('../src/traces/densitymapbox');
3+
module.exports = require('../src/traces/densitymapnew');

lib/index-mapbox.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ var Plotly = require('./core');
44

55
Plotly.register([
66
// traces
7-
require('./scattermapbox'),
8-
require('./choroplethmapbox'),
9-
require('./densitymapbox'),
7+
require('./scattermapnew'),
8+
require('./choroplethmapnew'),
9+
require('./densitymapnew'),
1010

1111
// transforms
1212
require('./aggregate'),

lib/index-strict.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +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'),
39+
require('./scattermapnew'),
40+
require('./choroplethmapnew'),
41+
require('./densitymapnew'),
4242
require('./sankey'),
4343
require('./indicator'),
4444
require('./table'),

lib/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ Plotly.register([
3636
require('./heatmapgl'),
3737
require('./parcoords'),
3838
require('./parcats'),
39-
require('./scattermapbox'),
40-
require('./choroplethmapbox'),
41-
require('./densitymapbox'),
39+
require('./scattermapnew'),
40+
require('./choroplethmapnew'),
41+
require('./densitymapnew'),
4242
require('./sankey'),
4343
require('./indicator'),
4444
require('./table'),

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.

lib/scattermapbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
'use strict';
22

3-
module.exports = require('../src/traces/scattermapbox');
3+
module.exports = require('../src/traces/scattermapnew');

src/components/fx/hover.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ 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 !== 'choroplethmapbox') {
1564+
if(d.trace.type !== 'choropleth' && d.trace.type !== 'choroplethmapnew') {
15651565
text += (text ? 'z: ' : '') + d.zLabel;
15661566
}
15671567
} 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 mapbox or geo subplots is present on graph,
22+
// if only 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 hasMapbox = layoutOut._has('mapbox');
25+
var hasMapnew = layoutOut._has('mapnew');
2626
var hasGeo = layoutOut._has('geo');
2727
var len = layoutOut._basePlotModules.length;
2828

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

src/components/legend/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,13 +541,13 @@ module.exports = function style(s, gd, legend) {
541541
useGradient = true;
542542
break;
543543
case 'choropleth' :
544-
case 'choroplethmapbox' :
544+
case 'choroplethmapnew' :
545545
ptsData = [
546546
['M-6,-6V6H6V-6Z']
547547
];
548548
useGradient = true;
549549
break;
550-
case 'densitymapbox' :
550+
case 'densitymapnew' :
551551
ptsData = [
552552
['M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0']
553553
];

src/components/modebar/buttons.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ modeBarButtons.resetViews = {
651651
handleCamera3d(gd, ev);
652652

653653
resetView(gd, 'geo');
654-
resetView(gd, 'mapbox');
654+
resetView(gd, 'mapnew');
655655
}
656656
};
657657

@@ -684,42 +684,42 @@ function setSpikelineVisibility(gd) {
684684
return aobj;
685685
}
686686

687-
modeBarButtons.resetViewMapbox = {
688-
name: 'resetViewMapbox',
687+
modeBarButtons.resetViewMapnew = {
688+
name: 'resetViewMapnew',
689689
_cat: 'resetView',
690690
title: function(gd) { return _(gd, 'Reset view'); },
691691
attr: 'reset',
692692
icon: Icons.home,
693693
click: function(gd) {
694-
resetView(gd, 'mapbox');
694+
resetView(gd, 'mapnew');
695695
}
696696
};
697697

698-
modeBarButtons.zoomInMapbox = {
699-
name: 'zoomInMapbox',
698+
modeBarButtons.zoomInMapnew = {
699+
name: 'zoomInMapnew',
700700
_cat: 'zoomin',
701701
title: function(gd) { return _(gd, 'Zoom in'); },
702702
attr: 'zoom',
703703
val: 'in',
704704
icon: Icons.zoom_plus,
705-
click: handleMapboxZoom
705+
click: handleMapnewZoom
706706
};
707707

708-
modeBarButtons.zoomOutMapbox = {
709-
name: 'zoomOutMapbox',
708+
modeBarButtons.zoomOutMapnew = {
709+
name: 'zoomOutMapnew',
710710
_cat: 'zoomout',
711711
title: function(gd) { return _(gd, 'Zoom out'); },
712712
attr: 'zoom',
713713
val: 'out',
714714
icon: Icons.zoom_minus,
715-
click: handleMapboxZoom
715+
click: handleMapnewZoom
716716
};
717717

718-
function handleMapboxZoom(gd, ev) {
718+
function handleMapnewZoom(gd, ev) {
719719
var button = ev.currentTarget;
720720
var val = button.getAttribute('data-val');
721721
var fullLayout = gd._fullLayout;
722-
var subplotIds = fullLayout._subplots.mapbox || [];
722+
var subplotIds = fullLayout._subplots.mapnew || [];
723723
var scalar = 1.05;
724724
var aObj = {};
725725

src/components/modebar/manage.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function getButtonGroups(gd) {
109109
var hasFunnelarea = fullLayout._has('funnelarea');
110110
var hasGL2D = fullLayout._has('gl2d');
111111
var hasTernary = fullLayout._has('ternary');
112-
var hasMapbox = fullLayout._has('mapbox');
112+
var hasMapnew = fullLayout._has('mapnew');
113113
var hasPolar = fullLayout._has('polar');
114114
var hasSmith = fullLayout._has('smith');
115115
var hasSankey = fullLayout._has('sankey');
@@ -154,7 +154,7 @@ function getButtonGroups(gd) {
154154
var resetGroup = [];
155155
var dragModeGroup = [];
156156

157-
if((hasCartesian || hasGL2D || hasPie || hasFunnelarea || hasTernary) + hasGeo + hasGL3D + hasMapbox + hasPolar + hasSmith > 1) {
157+
if((hasCartesian || hasGL2D || hasPie || hasFunnelarea || hasTernary) + hasGeo + hasGL3D + hasMapnew + hasPolar + hasSmith > 1) {
158158
// graphs with more than one plot types get 'union buttons'
159159
// which reset the view or toggle hover labels across all subplots.
160160
hoverGroup = ['toggleHover'];
@@ -166,10 +166,10 @@ function getButtonGroups(gd) {
166166
} else if(hasGL3D) {
167167
hoverGroup = ['hoverClosest3d'];
168168
resetGroup = ['resetCameraDefault3d', 'resetCameraLastSave3d'];
169-
} else if(hasMapbox) {
170-
zoomGroup = ['zoomInMapbox', 'zoomOutMapbox'];
169+
} else if(hasMapnew) {
170+
zoomGroup = ['zoomInMapnew', 'zoomOutMapnew'];
171171
hoverGroup = ['toggleHover'];
172-
resetGroup = ['resetViewMapbox'];
172+
resetGroup = ['resetViewMapnew'];
173173
} else if(hasGL2D) {
174174
hoverGroup = ['hoverClosestGl2d'];
175175
} else if(hasPie) {
@@ -200,7 +200,7 @@ function getButtonGroups(gd) {
200200
dragModeGroup = ['zoom3d', 'pan3d', 'orbitRotation', 'tableRotation'];
201201
} else if(((hasCartesian || hasGL2D) && !allAxesFixed) || hasTernary) {
202202
dragModeGroup = ['zoom2d', 'pan2d'];
203-
} else if(hasMapbox || hasGeo) {
203+
} else if(hasMapnew || hasGeo) {
204204
dragModeGroup = ['pan2d'];
205205
} else if(hasPolar) {
206206
dragModeGroup = ['zoom2d'];
@@ -228,7 +228,7 @@ function getButtonGroups(gd) {
228228
if(DRAW_MODES.indexOf(b) !== -1) {
229229
// accept pre-defined drag modes i.e. shape drawing features as string
230230
if(
231-
fullLayout._has('mapbox') || // draw shapes in paper coordinate (could be improved in future to support data coordinate, when there is no pitch)
231+
fullLayout._has('mapnew') || // draw shapes in paper coordinate (could be improved in future to support data coordinate, when there is no pitch)
232232
fullLayout._has('cartesian') // draw shapes in data coordinate
233233
) {
234234
dragModeGroup.push(b);

src/components/selections/select.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ function clearSelectionsCache(dragOptions, immediateSelect) {
752752
var selections;
753753
if(
754754
isSelectMode &&
755-
!hasSubplot(dragOptions) // only allow cartesian - no mapbox for now
755+
!hasSubplot(dragOptions) // only allow cartesian - no mapnew for now
756756
) {
757757
selections = newSelections(outlines, dragOptions);
758758
}
@@ -1549,7 +1549,7 @@ function getFillRangeItems(dragOptions) {
15491549
var plotinfo = dragOptions.plotinfo;
15501550

15511551
return (
1552-
plotinfo.fillRangeItems || // allow subplots (i.e. geo, mapbox, sankey) to override fillRangeItems routine
1552+
plotinfo.fillRangeItems || // allow subplots (i.e. geo, mapnew, sankey) to override fillRangeItems routine
15531553
makeFillRangeItems(dragOptions.xaxes.concat(dragOptions.yaxes))
15541554
);
15551555
}

src/plot_api/plot_api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ function setPlotContext(gd, config) {
517517
szOut.cartesian = 1;
518518
szOut.gl3d = 1;
519519
szOut.geo = 1;
520-
szOut.mapbox = 1;
520+
szOut.mapnew = 1;
521521
} else if(typeof szIn === 'string') {
522522
var parts = szIn.split('+');
523523
for(i = 0; i < parts.length; i++) {
@@ -526,7 +526,7 @@ function setPlotContext(gd, config) {
526526
} else if(szIn !== false) {
527527
szOut.gl3d = 1;
528528
szOut.geo = 1;
529-
szOut.mapbox = 1;
529+
szOut.mapnew = 1;
530530
}
531531
}
532532

@@ -2387,7 +2387,7 @@ var layoutUIControlPatterns = [
23872387
{pattern: /^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},
23882388
{pattern: /^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},
23892389
{pattern: /^(polar\d*\.angularaxis)\.rotation/},
2390-
{pattern: /^(mapbox\d*)\.(center|zoom|bearing|pitch)/},
2390+
{pattern: /^(mapnew\d*)\.(center|zoom|bearing|pitch)/},
23912391

23922392
{pattern: /^legend\.(x|y)$/, attr: 'editrevision'},
23932393
{pattern: /^(shapes|annotations)/, attr: 'editrevision'},

src/plot_api/plot_config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ var configAttributes = {
157157

158158
scrollZoom: {
159159
valType: 'flaglist',
160-
flags: ['cartesian', 'gl3d', 'geo', 'mapbox'],
160+
flags: ['cartesian', 'gl3d', 'geo', 'mapnew'],
161161
extras: [true, false],
162-
dflt: 'gl3d+geo+mapbox',
162+
dflt: 'gl3d+geo+mapnew',
163163
description: [
164164
'Determines whether mouse wheel or two-finger scroll zooms is enable.',
165-
'Turned on by default for gl3d, geo and mapbox subplots',
165+
'Turned on by default for gl3d, geo and mapnew subplots',
166166
'(as these subplot types do not have zoombox via pan),',
167167
'but turned off by default for cartesian subplots.',
168168
'Set `scrollZoom` to *false* to disable scrolling for all subplots.'
@@ -192,7 +192,7 @@ var configAttributes = {
192192
'This is the time interval (in ms) between first mousedown and',
193193
'2nd mouseup to constitute a double-click.',
194194
'This setting propagates to all on-subplot double clicks',
195-
'(except for geo and mapbox) and on-legend double clicks.'
195+
'(except for geo and mapnew) and on-legend double clicks.'
196196
].join(' ')
197197
},
198198

src/plots/geo/geo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ proto.updateFx = function(fullLayout, geoLayout) {
526526
}
527527

528528
if(clickMode.indexOf('event') > -1) {
529-
// TODO: like pie and mapbox, this doesn't support right-click
529+
// TODO: like pie and mapnew, this doesn't support right-click
530530
// actually this one is worse, as right-click starts a pan, or leaves
531531
// select in a weird state.
532532
// Also, only tangentially related, we should cancel hover during pan

src/plots/mapbox/constants.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ var arcgisSat = {
126126

127127
};
128128

129-
var stylesMapbox = {
129+
var stylesMapnew = {
130130
basic: cartoVoyager,
131131
streets: cartoVoyager,
132132
outdoors: cartoVoyager,
@@ -237,28 +237,28 @@ var stylesMapbox = {
237237
}
238238
};
239239

240-
var styleValuesMapbox = sortObjectKeys(stylesMapbox);
240+
var styleValuesMapnew = sortObjectKeys(stylesMapnew);
241241

242242
module.exports = {
243243
requiredVersion: requiredVersion,
244244

245245

246246
styleValueDflt: 'basic',
247-
stylesMapbox: stylesMapbox,
248-
styleValuesMapbox: styleValuesMapbox,
247+
stylesMapnew: stylesMapnew,
248+
styleValuesMapnew: styleValuesMapnew,
249249

250250
traceLayerPrefix: 'plotly-trace-layer-',
251251
layoutLayerPrefix: 'plotly-layout-layer-',
252252

253253

254254
missingStyleErrorMsg: [
255-
'No valid maplibre style found, please set `mapbox.style` to one of:',
256-
styleValuesMapbox.join(', '),
255+
'No valid maplibre style found, please set `mapnew.style` to one of:',
256+
styleValuesMapnew.join(', '),
257257
'or use a tile service.'
258258
].join('\n'),
259259

260260

261-
mapOnErrorMsg: 'Mapbox error.',
261+
mapOnErrorMsg: 'Mapnew error.',
262262

263263

264264
};

src/plots/mapbox/convert_text_opts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var Lib = require('../../lib');
44

55
/**
6-
* Convert plotly.js 'textposition' to mapbox-gl 'anchor' and 'offset'
6+
* Convert plotly.js 'textposition' to mapnew-gl 'anchor' and 'offset'
77
* (with the help of the icon size).
88
*
99
* @param {string} textpostion : plotly.js textposition value
@@ -48,7 +48,7 @@ module.exports = function convertTextOpts(textposition, iconSize) {
4848
break;
4949
}
5050

51-
// Mapbox text-anchor must be one of:
51+
// Mapnew text-anchor must be one of:
5252
// center, left, right, top, bottom,
5353
// top-left, top-right, bottom-left, bottom-right
5454

0 commit comments

Comments
 (0)