Skip to content

Commit 8ae607b

Browse files
committed
Add breaking change warning for 'country names' locationmode option
1 parent bff29ea commit 8ae607b

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

src/traces/choropleth/plot.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,18 @@ var findExtremes = require('../../plots/cartesian/autorange').findExtremes;
99

1010
var style = require('./style').style;
1111

12+
const breakingChangeWarning = [
13+
'The library used by the *country names* `locationmode` option is changing in an upcoming version.',
14+
'Country names in existing plots may not work in the new version.'
15+
].join(' ');
16+
let firstPlot = true;
17+
1218
function plot(gd, geo, calcData) {
19+
if(firstPlot) {
20+
firstPlot = false;
21+
Lib.warn(breakingChangeWarning);
22+
}
23+
1324
var choroplethLayer = geo.layers.backplot.select('.choroplethlayer');
1425

1526
Lib.makeTraceGroups(choroplethLayer, calcData, 'trace choropleth').each(function(calcTrace) {

src/traces/scattergeo/attributes.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ var scatterMarkerAttrs = scatterAttrs.marker;
1515
var scatterLineAttrs = scatterAttrs.line;
1616
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
1717

18+
const breakingChangeWarning = [
19+
'The library used by the *country names* `locationmode` option is changing in an upcoming version.',
20+
'Country names in existing plots may not work in the new version.'
21+
].join(' ');
22+
1823
module.exports = overrideAll({
1924
lon: {
2025
valType: 'data_array',
@@ -38,6 +43,7 @@ module.exports = overrideAll({
3843
values: ['ISO-3', 'USA-states', 'country names', 'geojson-id'],
3944
dflt: 'ISO-3',
4045
description: [
46+
breakingChangeWarning,
4147
'Determines the set of locations used to match entries in `locations`',
4248
'to regions on the map.',
4349
'Values *ISO-3*, *USA-states*, *country names* correspond to features on',

src/traces/scattergeo/plot.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,18 @@ var calcMarkerSize = require('../scatter/calc').calcMarkerSize;
1313
var subTypes = require('../scatter/subtypes');
1414
var style = require('./style');
1515

16+
const breakingChangeWarning = [
17+
'The library used by the *country names* `locationmode` option is changing in an upcoming version.',
18+
'Country names in existing plots may not work in the new version.'
19+
].join(' ');
20+
let firstPlot = true;
21+
1622
function plot(gd, geo, calcData) {
23+
if(firstPlot) {
24+
firstPlot = false;
25+
Lib.warn(breakingChangeWarning);
26+
}
27+
1728
var scatterLayer = geo.layers.frontplot.select('.scatterlayer');
1829
var gTraces = Lib.makeTraceGroups(scatterLayer, calcData, 'trace scattergeo');
1930

0 commit comments

Comments
 (0)