Skip to content

Replace json assets by js files #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 20, 2016
268 changes: 268 additions & 0 deletions src/constants/country-name_to_iso3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
/**
* Copyright 2012-2016, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/


'use strict';

module.exports = {
DZA: 'algeria',
AGO: 'angola',
EGY: 'egypt',
BGD: 'bangladesh|^(?=.*east).*paki?stan',
NER: '\\bniger(?!ia)',
LIE: 'liechtenstein',
NAM: 'namibia',
BGR: 'bulgaria',
BOL: 'bolivia',
GHA: 'ghana|gold.?coast',
CCK: '\\bcocos|keeling',
PAK: '^(?!.*east).*paki?stan',
CPV: 'verde',
JOR: 'jordan',
LBR: 'liberia',
LBY: 'libya',
MYS: 'malaysia',
IOT: 'british.?indian.?ocean',
PRI: 'puerto.?rico',
MYT: 'mayotte',
PRK: '^(?=.*democrat).*\\bkorea|^(?=.*people).*\\bkorea|^(?=.*north).*\\bkorea|\\bd\\.?p\\.?r\\.?k',
PSE: 'palestin|\\bgaza|west.?bank',
TZA: 'tanzania',
BWA: 'botswana|bechuana',
KHM: 'cambodia|kampuchea|khmer|^p\\.?r\\.?k\\.?$',
UMI: 'minor.?outlying.?is',
TTO: 'trinidad|tobago',
PRY: 'paraguay',
HKG: 'hong.?kong',
SAU: '\\bsa\\w*.?arabia',
LBN: 'lebanon',
SVN: 'slovenia',
BFA: 'burkina|\\bfaso|upper.?volta',
SVK: '^(?!.*cze).*slovak',
MRT: 'mauritania',
HRV: 'croatia',
CHL: '\\bchile',
CHN: '^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai).*china|^p\\.?r\\.?c\\.?$',
KNA: 'kitts|\\bnevis',
JAM: 'jamaica',
SMR: 'san.?marino',
GIB: 'gibraltar',
DJI: 'djibouti',
GIN: '^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea',
FIN: 'finland',
URY: 'uruguay',
VAT: 'holy.?see|vatican|papal.?st',
STP: '\\bs(a|ã)o.?tom(e|é)',
SYC: 'seychell',
NPL: 'nepal',
CXR: 'christmas',
LAO: '\\blaos?\\b',
YEM: '^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen',
BVT: 'bouvet',
ZAF: '\\bs\\w*.?africa',
KIR: 'kiribati',
PHL: 'philippines',
SXM: '^(?!.*martin)(?!.*saba).*maarten',
ROU: 'r(o|u|ou)mania',
VIR: '^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin',
SYR: 'syria',
MAC: 'maca(o|u)',
NFK: 'norfolk',
NIC: 'nicaragua',
MLT: '\\bmalta',
KAZ: 'kazak',
TCA: 'turks',
PYF: 'french.?polynesia|tahiti',
NIU: 'niue',
DMA: 'dominica(?!n)',
GBR: 'united.?kingdom|britain|^u\\.?k\\.?$',
BEN: 'benin|dahome',
GUF: '^(?=.*french).*guiana',
BEL: '^(?!.*luxem).*belgium',
MSR: 'montserrat',
TGO: 'togo',
DEU: '^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german',
GUM: '\\bguam',
LKA: 'sri.?lanka|ceylon',
SSD: '\\bs\\w*.?sudan',
FLK: 'falkland|malvinas',
PCN: 'pitcairn',
BES: '^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands',
GUY: 'guyana|british.?guiana',
CRI: 'costa.?rica',
COK: '\\bcook',
MAR: 'morocco|\\bmaroc',
MNP: 'mariana',
LSO: 'lesotho|basuto',
HUN: '^(?!.*austr).*hungary',
TKM: 'turkmen',
SUR: 'surinam|dutch.?guiana',
NLD: '^(?!.*\\bant)(?!.*\\bcarib).*netherlands',
BMU: 'bermuda',
HMD: 'heard.*mcdonald',
TCD: '\\bchad',
GEO: '^(?!.*south).*georgia',
MNE: '^(?!.*serbia).*montenegro',
MNG: 'mongolia',
MHL: 'marshall',
MTQ: 'martinique',
CSK: 'czechoslovakia',
BLZ: 'belize|^(?=.*british).*honduras',
DDR: 'german.?democratic.?republic|^(d|g)\\.?d\\.?r\\.?$|^(?=.*east).*germany',
MMR: 'myanmar|burma',
AFG: 'afghan',
BDI: 'burundi',
VGB: '^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin',
BLR: 'belarus|byelo',
BLM: 'barth(e|é)lemy',
GRD: 'grenada',
TKL: 'tokelau',
GRC: 'greece|hellenic|hellas',
GRL: 'greenland',
SHN: 'helena',
AND: 'andorra',
MOZ: 'mozambique',
TJK: 'tajik',
THA: 'thailand|\\bsiam',
HTI: 'haiti',
MEX: '\\bmexic',
ANT: '^(?=.*\\bant).*(nether|dutch)',
ZWE: 'zimbabwe|^(?!.*northern).*rhodesia',
LCA: '\\blucia',
IND: 'india(?!.*ocea)',
LVA: 'latvia',
BTN: 'bhutan',
VCT: 'vincent',
VNM: '^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam',
NOR: 'norway',
CZE: '^(?=.*rep).*czech|czechia|bohemia',
ATF: 'french.?southern|\\bfr.*\\bso.*\\ban.*\\b\\bt',
ATG: 'antigua',
FJI: 'fiji',
HND: '^(?!.*brit).*honduras',
MUS: 'mauritius',
DOM: 'dominican',
LUX: '^(?!.*belg).*luxem',
ISR: 'israel',
YUG: 'yugoslavia',
FSM: 'micronesia',
PER: 'peru',
REU: 'r(e|é)union',
IDN: 'indonesia',
VUT: 'vanuatu|new.?hebrides',
MKD: 'macedonia|^f\\.?y\\.?r\\.?o\\.?m\\.?$',
COD: '\\bdem.*congo|congo.*\\bdem|congo.*\\bdr|\\bdr.*congo|\\bd\\.?r\\.?c|\\bd\\.?r\\.?o\\.?c|\\br\\.?d\\.?c|belgian.?congo|congo.?free.?state|kinshasa|zaire|l\\w{1,2}opoldville',
COG: '^(?!.*\\bdem)(?!.*\\bdr)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l\\w{1,2}opoldville)(?!.*free).*\\bcongo',
ISL: 'iceland',
GLP: 'guadeloupe',
ETH: 'ethiopia|abyssinia',
COM: 'comoro',
COL: 'colombia',
NGA: 'nigeria',
TLS: '^(?=.*leste).*timor|^(?=.*east).*timor',
TWN: 'taiwan|taipei|formosa',
PRT: 'portugal',
MDA: 'moldov|b(a|e)ssarabia',
GGY: 'guernsey',
MDG: 'madagascar|malagasy',
ATA: 'antarctica',
ECU: 'ecuador',
SEN: 'senegal',
ESH: 'sahara',
MDV: 'maldive',
ASM: '^(?=.*americ).*samoa',
SPM: 'miquelon',
CUW: '^(?!.*bonaire).*\\bcura(c|ç)ao',
FRA: '^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul',
LTU: 'lithuania',
RWA: 'rwanda',
ZMB: 'zambia|northern.?rhodesia',
GMB: 'gambia',
WLF: 'futuna|wallis',
JEY: 'jersey',
FRO: 'faroe|faeroe',
GTM: 'guatemala',
DNK: 'denmark',
IMN: '^(?=.*isle).*\\bman',
MAF: '^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)',
AUS: 'australia',
AUT: '^(?!.*hungary).*austria|\\baust.*\\bemp',
SJM: 'svalbard',
VEN: 'venezuela',
PLW: 'palau',
KEN: 'kenya|british.?east.?africa|east.?africa.?prot',
TUR: 'turkey',
ALB: 'albania',
OMN: '\\boman|trucial',
TUV: 'tuvalu',
ALA: '\\b(a|å)land',
BRN: 'brunei',
TUN: 'tunisia',
RUS: '\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics',
BRB: 'barbados',
BRA: 'brazil',
CIV: 'ivoire|ivory',
SRB: '^(?!.*monte).*serbia',
GNQ: 'guine.*eq|eq.*guine|^(?=.*span).*guinea',
USA: '^(?!.*islands).*united.?states|^u\\.?s\\.?a\\.?$|^u\\.?s\\.?$',
QAT: 'qatar',
WSM: '^(?!.*amer).*samoa',
AZE: 'azerbaijan',
GNB: 'bissau|^(?=.*portu).*guinea',
SWZ: 'swaziland',
TON: 'tonga',
CAN: 'canada',
UKR: 'ukrain',
KOR: '^(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea|\\br\\.?o\\.?k\\b',
AIA: 'anguill?a',
CAF: '\\bcen.*\\baf|^c\\.?a\\.?r\\.?$',
CHE: 'switz|swiss',
CYP: 'cyprus',
BIH: 'herzegovina|bosnia',
SGP: 'singapore',
SGS: 'south.?georgia|sandwich',
SOM: 'somali',
UZB: 'uzbek',
CMR: 'cameroon',
POL: 'poland',
EAZ: 'zanz',
KWT: 'kuwait',
ERI: 'eritrea',
GAB: 'gabon',
CYM: 'cayman',
ARE: 'emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em',
EST: 'estonia',
MWI: 'malawi|nyasa',
ESP: 'spain',
IRQ: '\\biraq|mesopotamia',
SLV: 'el.?salvador',
MLI: '\\bmali\\b',
YMD: '^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen',
IRL: 'ireland',
IRN: '\\biran|persia',
ABW: '^(?!.*bonaire).*\\baruba',
SLE: 'sierra',
PAN: 'panama',
SDN: '^(?!.*\\bs(?!u)).*sudan',
SLB: 'solomon',
NZL: 'new.?zealand',
MCO: 'monaco',
ITA: 'italy',
JPN: 'japan',
KGZ: 'kyrgyz|kirghiz',
UGA: 'uganda',
NCL: 'new.?caledonia',
PNG: 'papua|\\bp.*\\bn.*\\bguin.*|^p\\.?n\\.?g\\.?$|new.?guinea',
ARG: 'argentin',
SWE: 'sweden',
BHS: 'bahamas',
BHR: 'bahrain',
ARM: 'armenia',
NRU: 'nauru',
CUB: '\\bcuba'
};
1 change: 0 additions & 1 deletion src/constants/country-name_to_iso3.json

This file was deleted.

19 changes: 19 additions & 0 deletions src/constants/gl2d_dashes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright 2012-2016, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/


'use strict';

module.exports = {
solid: [1],
dot: [1, 1],
dash: [4, 1],
longdash: [8, 1],
dashdot: [4, 1, 1, 1],
longdashdot: [8, 1, 1, 1]
};
8 changes: 0 additions & 8 deletions src/constants/gl2d_dashes.json

This file was deleted.

19 changes: 19 additions & 0 deletions src/constants/gl3d_dashes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright 2012-2016, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/


'use strict';

module.exports = {
solid: [[], 0],
dot: [[0.5, 1], 200],
dash: [[0.5, 1], 50],
longdash: [[0.5, 1], 10],
dashdot: [[0.5, 0.625, 0.875, 1], 50],
longdashdot: [[0.5, 0.7, 0.8, 1], 10]
};
8 changes: 0 additions & 8 deletions src/constants/gl3d_dashes.json

This file was deleted.

21 changes: 21 additions & 0 deletions src/constants/gl_markers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright 2012-2016, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/


'use strict';

module.exports = {
circle: '●',
'circle-open': '○',
square: '■',
'square-open': '□',
diamond: '◆',
'diamond-open': '◇',
cross: '+',
x: '❌'
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐄, but I guess it's unavoidable here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 changes: 0 additions & 10 deletions src/constants/gl_markers.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib/geo_location_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var locationUtils = module.exports = {};
var Plotly = require('../plotly');

// an hash object iso3 to regex string
var countryNameData = require('../constants/country-name_to_iso3.json');
var countryNameData = require('../constants/country-name_to_iso3');

// make list of all country iso3 ids from at runtime
var countryIds = Object.keys(countryNameData);
Expand Down
2 changes: 1 addition & 1 deletion src/traces/scatter3d/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'use strict';

var scatterAttrs = require('../scatter/attributes');
var MARKER_SYMBOLS = require('../../constants/gl_markers.json');
var MARKER_SYMBOLS = require('../../constants/gl_markers');
var extendFlat = require('../../lib/extend').extendFlat;

var scatterLineAttrs = scatterAttrs.line,
Expand Down
4 changes: 2 additions & 2 deletions src/traces/scatter3d/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var triangulate = require('delaunay-triangulate');
var str2RgbaArray = require('../../lib/str2rgbarray');
var formatColor = require('../../lib/gl_format_color');

var DASH_PATTERNS = require('../../constants/gl3d_dashes.json');
var MARKER_SYMBOLS = require('../../constants/gl_markers.json');
var DASH_PATTERNS = require('../../constants/gl3d_dashes');
var MARKER_SYMBOLS = require('../../constants/gl_markers');

var calculateError = require('./calc_errors');

Expand Down
Loading