mapshaper 0.5.116 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mapshaper +1 -1
- package/bin/mapshaper-gui +1 -0
- package/mapshaper.js +1837 -136
- package/package.json +17 -12
- package/www/elements.css +2 -2
- package/www/images/close2.png +0 -0
- package/www/index.html +9 -6
- package/www/mapshaper-gui.js +9 -11
- package/www/mapshaper.js +1837 -136
- package/www/modules.js +688 -1836
- package/www/nacis/Makefile +22 -0
- package/www/nacis/Makefile.txt +22 -0
- package/www/nacis/images/close.png +0 -0
- package/www/nacis/images/eye.png +0 -0
- package/www/nacis/images/eye2.png +0 -0
- package/www/nacis/index.html +262 -0
- package/www/nacis/manifest.js +27 -0
- package/www/nacis/map.svg +12308 -0
- package/www/page.css +39 -15
- package/CHANGELOG.md +0 -1388
package/mapshaper.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function () {
|
|
2
2
|
|
|
3
|
-
var VERSION = "0.
|
|
3
|
+
var VERSION = "0.6.0";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var utils = /*#__PURE__*/Object.freeze({
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
get regexEscape () { return regexEscape; },
|
|
29
29
|
get htmlEscape () { return htmlEscape; },
|
|
30
30
|
get defaults () { return defaults; },
|
|
31
|
-
get extend () { return extend; },
|
|
31
|
+
get extend () { return extend$1; },
|
|
32
32
|
get inherit () { return inherit; },
|
|
33
33
|
get reduceAsync () { return reduceAsync; },
|
|
34
34
|
get merge () { return merge; },
|
|
@@ -132,7 +132,8 @@
|
|
|
132
132
|
clearStash: clearStash
|
|
133
133
|
});
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
// Fall back to browserify's Buffer polyfill
|
|
136
|
+
var B$3 = typeof Buffer != 'undefined' ? Buffer : require('buffer').Buffer;
|
|
136
137
|
|
|
137
138
|
var uniqCount = 0;
|
|
138
139
|
function getUniqueName(prefix) {
|
|
@@ -274,7 +275,7 @@
|
|
|
274
275
|
return dest;
|
|
275
276
|
}
|
|
276
277
|
|
|
277
|
-
function extend(o) {
|
|
278
|
+
function extend$1(o) {
|
|
278
279
|
var dest = o || {},
|
|
279
280
|
n = arguments.length,
|
|
280
281
|
key, i, src;
|
|
@@ -311,7 +312,7 @@
|
|
|
311
312
|
f.prototype = src.prototype || src; // added || src to allow inheriting from objects as well as functions
|
|
312
313
|
// Extend targ prototype instead of wiping it out --
|
|
313
314
|
// in case inherit() is called after targ.prototype = {stuff}; statement
|
|
314
|
-
targ.prototype = extend(new f(), targ.prototype); //
|
|
315
|
+
targ.prototype = extend$1(new f(), targ.prototype); //
|
|
315
316
|
targ.prototype.constructor = targ;
|
|
316
317
|
targ.prototype.__super__ = f;
|
|
317
318
|
}
|
|
@@ -1004,10 +1005,10 @@
|
|
|
1004
1005
|
|
|
1005
1006
|
function createBuffer(arg, arg2) {
|
|
1006
1007
|
if (isInteger(arg)) {
|
|
1007
|
-
return
|
|
1008
|
+
return B$3.allocUnsafe ? B$3.allocUnsafe(arg) : new B$3(arg);
|
|
1008
1009
|
} else {
|
|
1009
1010
|
// check allocUnsafe to make sure Buffer.from() will accept strings (it didn't before Node v5.10)
|
|
1010
|
-
return
|
|
1011
|
+
return B$3.from && B$3.allocUnsafe ? B$3.from(arg, arg2) : new B$3(arg, arg2);
|
|
1011
1012
|
}
|
|
1012
1013
|
}
|
|
1013
1014
|
|
|
@@ -3513,10 +3514,31 @@
|
|
|
3513
3514
|
findMaxPartCount: findMaxPartCount
|
|
3514
3515
|
});
|
|
3515
3516
|
|
|
3517
|
+
// Several dependencies are loaded via require() ... this module returns a
|
|
3518
|
+
// stub function when require() does not exist as a global function,
|
|
3519
|
+
// to avoid runtime errors (this should only happen in some tests when single
|
|
3520
|
+
// modules are imported)
|
|
3521
|
+
var f;
|
|
3522
|
+
if (typeof require == 'function') {
|
|
3523
|
+
f = require;
|
|
3524
|
+
} else {
|
|
3525
|
+
f = function(name) {
|
|
3526
|
+
// console.error('Unable to load module', name);
|
|
3527
|
+
};
|
|
3528
|
+
}
|
|
3529
|
+
var require$1 = f;
|
|
3530
|
+
|
|
3531
|
+
// import { createRequire } from "module";
|
|
3532
|
+
|
|
3533
|
+
var iconv = require$1('iconv-lite');
|
|
3534
|
+
|
|
3535
|
+
// import iconv from 'iconv-lite';
|
|
3536
|
+
// import * as iconv from 'iconv-lite';
|
|
3537
|
+
// import * as iconv from '../../node_modules/iconv-lite/lib/index.js';
|
|
3538
|
+
|
|
3516
3539
|
// List of encodings supported by iconv-lite:
|
|
3517
3540
|
// https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings
|
|
3518
3541
|
|
|
3519
|
-
var iconv = require('iconv-lite');
|
|
3520
3542
|
var toUtf8 = getNativeEncoder('utf8');
|
|
3521
3543
|
var fromUtf8 = getNativeDecoder('utf8');
|
|
3522
3544
|
|
|
@@ -3587,7 +3609,7 @@
|
|
|
3587
3609
|
}
|
|
3588
3610
|
return function(str) {
|
|
3589
3611
|
// Convert Uint8Array from encoder to Buffer (fix for issue #216)
|
|
3590
|
-
return encoder ?
|
|
3612
|
+
return encoder ? B$3.from(encoder.encode(str).buffer) : utils.createBuffer(str, enc);
|
|
3591
3613
|
};
|
|
3592
3614
|
}
|
|
3593
3615
|
|
|
@@ -4332,17 +4354,18 @@
|
|
|
4332
4354
|
this.ty -= cy * (sy - 1);
|
|
4333
4355
|
};
|
|
4334
4356
|
|
|
4357
|
+
var mproj$1 = require$1('mproj');
|
|
4358
|
+
|
|
4335
4359
|
// A compound projection, consisting of a default projection and one or more rectangular frames
|
|
4336
4360
|
// that are projected separately and affine transformed.
|
|
4337
4361
|
// @mainParams: parameters for main projection, including:
|
|
4338
4362
|
// proj: Proj string
|
|
4339
4363
|
// bbox: lat-lon bounding box
|
|
4340
4364
|
function MixedProjection(mainParams, options) {
|
|
4341
|
-
var mproj = require('mproj');
|
|
4342
4365
|
var mainFrame = initFrame(mainParams);
|
|
4343
4366
|
var mainP = mainFrame.crs;
|
|
4344
4367
|
var frames = [mainFrame];
|
|
4345
|
-
var mixedP = initMixedProjection(mproj);
|
|
4368
|
+
var mixedP = initMixedProjection(mproj$1);
|
|
4346
4369
|
|
|
4347
4370
|
// This CRS masquerades as the main projection... the version with
|
|
4348
4371
|
// custom insets is exposed to savvy users
|
|
@@ -4386,7 +4409,7 @@
|
|
|
4386
4409
|
function initFrame(params) {
|
|
4387
4410
|
return {
|
|
4388
4411
|
bounds: new Bounds(bboxToRadians(params.bbox)),
|
|
4389
|
-
crs: mproj.pj_init(params.proj)
|
|
4412
|
+
crs: mproj$1.pj_init(params.proj)
|
|
4390
4413
|
};
|
|
4391
4414
|
}
|
|
4392
4415
|
|
|
@@ -4398,7 +4421,7 @@
|
|
|
4398
4421
|
}
|
|
4399
4422
|
|
|
4400
4423
|
function projectFrameOrigin(origin, P) {
|
|
4401
|
-
var xy = mproj.pj_fwd_deg({lam: origin[0], phi: origin[1]}, P);
|
|
4424
|
+
var xy = mproj$1.pj_fwd_deg({lam: origin[0], phi: origin[1]}, P);
|
|
4402
4425
|
return [xy.x, xy.y];
|
|
4403
4426
|
}
|
|
4404
4427
|
|
|
@@ -4407,7 +4430,7 @@
|
|
|
4407
4430
|
for (var i=0, n=frames.length; i<n; i++) {
|
|
4408
4431
|
frame = frames[i];
|
|
4409
4432
|
if (frame.bounds.containsPoint(lp.lam, lp.phi)) {
|
|
4410
|
-
xy2 = mproj.pj_fwd(lp, frame.crs);
|
|
4433
|
+
xy2 = mproj$1.pj_fwd(lp, frame.crs);
|
|
4411
4434
|
if (frame.matrix) {
|
|
4412
4435
|
frame.matrix.transformXY(xy2.x, xy2.y, xy2);
|
|
4413
4436
|
}
|
|
@@ -4610,13 +4633,15 @@
|
|
|
4610
4633
|
getAntimeridian: getAntimeridian
|
|
4611
4634
|
});
|
|
4612
4635
|
|
|
4636
|
+
var mproj = require$1('mproj');
|
|
4637
|
+
|
|
4613
4638
|
var asyncLoader = null;
|
|
4614
4639
|
|
|
4615
4640
|
var projectionAliases = {
|
|
4616
4641
|
robinson: '+proj=robin +datum=WGS84',
|
|
4617
4642
|
webmercator: '+proj=merc +a=6378137 +b=6378137',
|
|
4618
4643
|
wgs84: '+proj=longlat +datum=WGS84',
|
|
4619
|
-
albersusa:
|
|
4644
|
+
albersusa: AlbersUSA
|
|
4620
4645
|
};
|
|
4621
4646
|
|
|
4622
4647
|
// This stub is replaced when loaded in GUI, which may need to load some files
|
|
@@ -4640,7 +4665,6 @@
|
|
|
4640
4665
|
// if the transformation fails
|
|
4641
4666
|
// src, dest: proj4 objects
|
|
4642
4667
|
function getProjTransform(src, dest) {
|
|
4643
|
-
var mproj = require('mproj');
|
|
4644
4668
|
var clampSrc = isLatLngCRS(src);
|
|
4645
4669
|
dest = dest.__mixed_crs || dest;
|
|
4646
4670
|
return function(x, y) {
|
|
@@ -4659,8 +4683,7 @@
|
|
|
4659
4683
|
// Same as getProjTransform(), but return null if projection fails
|
|
4660
4684
|
// (also faster)
|
|
4661
4685
|
function getProjTransform2(src, dest) {
|
|
4662
|
-
var
|
|
4663
|
-
xx = [0],
|
|
4686
|
+
var xx = [0],
|
|
4664
4687
|
yy = [0],
|
|
4665
4688
|
preK = src.is_latlong ? mproj.internal.DEG_TO_RAD : 1,
|
|
4666
4689
|
postK = dest.is_latlong ? mproj.internal.RAD_TO_DEG : 1,
|
|
@@ -4707,13 +4730,13 @@
|
|
|
4707
4730
|
}
|
|
4708
4731
|
|
|
4709
4732
|
function crsToProj4(P) {
|
|
4710
|
-
return
|
|
4733
|
+
return mproj.internal.get_proj_defn(P);
|
|
4711
4734
|
}
|
|
4712
4735
|
|
|
4713
4736
|
function crsToPrj(P) {
|
|
4714
4737
|
var wkt;
|
|
4715
4738
|
try {
|
|
4716
|
-
wkt =
|
|
4739
|
+
wkt = mproj.internal.wkt_from_proj4(P);
|
|
4717
4740
|
} catch(e) {
|
|
4718
4741
|
// console.log(e)
|
|
4719
4742
|
}
|
|
@@ -4725,8 +4748,11 @@
|
|
|
4725
4748
|
return !!str && str == crsToProj4(b);
|
|
4726
4749
|
}
|
|
4727
4750
|
|
|
4751
|
+
function isProjAlias(str) {
|
|
4752
|
+
return str in projectionAliases;
|
|
4753
|
+
}
|
|
4754
|
+
|
|
4728
4755
|
function getProjDefn(str) {
|
|
4729
|
-
var mproj = require('mproj');
|
|
4730
4756
|
var defn;
|
|
4731
4757
|
// prepend '+proj=' to bare proj names
|
|
4732
4758
|
str = str.replace(/(^| )([\w]+)($| )/, function(a, b, c, d) {
|
|
@@ -4737,8 +4763,11 @@
|
|
|
4737
4763
|
});
|
|
4738
4764
|
if (looksLikeProj4String(str)) {
|
|
4739
4765
|
defn = str;
|
|
4740
|
-
} else if (str
|
|
4741
|
-
defn = projectionAliases[str];
|
|
4766
|
+
} else if (isProjAlias(str)) {
|
|
4767
|
+
defn = projectionAliases[str];
|
|
4768
|
+
if (utils.isFunction(defn)) {
|
|
4769
|
+
defn = defn();
|
|
4770
|
+
}
|
|
4742
4771
|
} else if (looksLikeInitString(str)) {
|
|
4743
4772
|
defn = '+init=' + str.toLowerCase();
|
|
4744
4773
|
} else if (str in (getStashedVar('defs') || {})) {
|
|
@@ -4768,7 +4797,7 @@
|
|
|
4768
4797
|
P = defn;
|
|
4769
4798
|
} else {
|
|
4770
4799
|
try {
|
|
4771
|
-
P =
|
|
4800
|
+
P = mproj.pj_init(defn);
|
|
4772
4801
|
} catch(e) {
|
|
4773
4802
|
stop('Unable to use projection', defn, '(' + e.message + ')');
|
|
4774
4803
|
}
|
|
@@ -4822,10 +4851,9 @@
|
|
|
4822
4851
|
// x, y: a point location in projected coordinates
|
|
4823
4852
|
// Returns k, the ratio of coordinate distance to distance on the ground
|
|
4824
4853
|
function getScaleFactorAtXY(x, y, crs) {
|
|
4825
|
-
var proj = require('mproj');
|
|
4826
4854
|
var dist = 1;
|
|
4827
|
-
var lp =
|
|
4828
|
-
var lp2 =
|
|
4855
|
+
var lp = mproj.pj_inv_deg({x: x, y: y}, crs);
|
|
4856
|
+
var lp2 = mproj.pj_inv_deg({x: x + dist, y: y}, crs);
|
|
4829
4857
|
var k = dist / geom.greatCircleDistance(lp.lam, lp.phi, lp2.lam, lp2.phi);
|
|
4830
4858
|
return k;
|
|
4831
4859
|
}
|
|
@@ -4863,7 +4891,7 @@
|
|
|
4863
4891
|
}
|
|
4864
4892
|
|
|
4865
4893
|
function printProjections() {
|
|
4866
|
-
var index =
|
|
4894
|
+
var index = mproj.internal.pj_list;
|
|
4867
4895
|
var msg = 'Proj4 projections\n';
|
|
4868
4896
|
Object.keys(index).sort().forEach(function(id) {
|
|
4869
4897
|
msg += ' ' + utils.rpad(id, 7, ' ') + ' ' + index[id].name + '\n';
|
|
@@ -4878,7 +4906,7 @@
|
|
|
4878
4906
|
function translatePrj(str) {
|
|
4879
4907
|
var proj4;
|
|
4880
4908
|
try {
|
|
4881
|
-
proj4 =
|
|
4909
|
+
proj4 = mproj.internal.wkt_to_proj4(str);
|
|
4882
4910
|
} catch(e) {
|
|
4883
4911
|
stop('Unusable .prj file (' + e.message + ')');
|
|
4884
4912
|
}
|
|
@@ -4902,6 +4930,7 @@
|
|
|
4902
4930
|
crsToProj4: crsToProj4,
|
|
4903
4931
|
crsToPrj: crsToPrj,
|
|
4904
4932
|
crsAreEqual: crsAreEqual,
|
|
4933
|
+
isProjAlias: isProjAlias,
|
|
4905
4934
|
getProjDefn: getProjDefn,
|
|
4906
4935
|
looksLikeProj4String: looksLikeProj4String,
|
|
4907
4936
|
getCRS: getCRS,
|
|
@@ -7034,7 +7063,7 @@
|
|
|
7034
7063
|
return typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
7035
7064
|
}
|
|
7036
7065
|
|
|
7037
|
-
var
|
|
7066
|
+
var Env = /*#__PURE__*/Object.freeze({
|
|
7038
7067
|
__proto__: null,
|
|
7039
7068
|
runningInBrowser: runningInBrowser
|
|
7040
7069
|
});
|
|
@@ -7145,13 +7174,13 @@
|
|
|
7145
7174
|
content = cache[fname];
|
|
7146
7175
|
delete cache[fname];
|
|
7147
7176
|
} else if (fname == '/dev/stdin') {
|
|
7148
|
-
content = require('rw').readFileSync(fname);
|
|
7177
|
+
content = require$1('rw').readFileSync(fname);
|
|
7149
7178
|
} else {
|
|
7150
7179
|
// kludge to prevent overwriting of input files
|
|
7151
7180
|
(getStashedVar('input_files') || []).push(fname);
|
|
7152
|
-
content = require('fs').readFileSync(fname);
|
|
7181
|
+
content = require$1('fs').readFileSync(fname);
|
|
7153
7182
|
}
|
|
7154
|
-
if (encoding &&
|
|
7183
|
+
if (encoding && B$3.isBuffer(content)) {
|
|
7155
7184
|
content = trimBOM(decodeString(content, encoding));
|
|
7156
7185
|
}
|
|
7157
7186
|
return content;
|
|
@@ -7161,7 +7190,7 @@
|
|
|
7161
7190
|
var odir = parseLocalPath(fname).directory;
|
|
7162
7191
|
if (!odir || cli.isDirectory(odir) || fname == '/dev/stdout') return;
|
|
7163
7192
|
try {
|
|
7164
|
-
require('fs').mkdirSync(odir, {recursive: true});
|
|
7193
|
+
require$1('fs').mkdirSync(odir, {recursive: true});
|
|
7165
7194
|
message('Created output directory:', odir);
|
|
7166
7195
|
} catch(e) {
|
|
7167
7196
|
stop('Unable to create output directory:', odir);
|
|
@@ -7170,7 +7199,7 @@
|
|
|
7170
7199
|
|
|
7171
7200
|
// content: Buffer or string
|
|
7172
7201
|
cli.writeFile = function(fname, content, cb) {
|
|
7173
|
-
var fs = require('rw');
|
|
7202
|
+
var fs = require$1('rw');
|
|
7174
7203
|
cli.createDirIfNeeded(fname);
|
|
7175
7204
|
if (cb) {
|
|
7176
7205
|
fs.writeFile(fname, content, cb);
|
|
@@ -7198,8 +7227,8 @@
|
|
|
7198
7227
|
files = [];
|
|
7199
7228
|
|
|
7200
7229
|
try {
|
|
7201
|
-
require('fs').readdirSync(dir).forEach(function(item) {
|
|
7202
|
-
var path = require('path').join(dir, item);
|
|
7230
|
+
require$1('fs').readdirSync(dir).forEach(function(item) {
|
|
7231
|
+
var path = require$1('path').join(dir, item);
|
|
7203
7232
|
if (rxp.test(item) && cli.isFile(path)) {
|
|
7204
7233
|
files.push(path);
|
|
7205
7234
|
}
|
|
@@ -7241,7 +7270,7 @@
|
|
|
7241
7270
|
cli.statSync = function(fpath) {
|
|
7242
7271
|
var obj = null;
|
|
7243
7272
|
try {
|
|
7244
|
-
obj = require('fs').statSync(fpath);
|
|
7273
|
+
obj = require$1('fs').statSync(fpath);
|
|
7245
7274
|
} catch(e) {}
|
|
7246
7275
|
return obj;
|
|
7247
7276
|
};
|
|
@@ -7293,7 +7322,7 @@
|
|
|
7293
7322
|
var odir = opts.directory;
|
|
7294
7323
|
if (odir) {
|
|
7295
7324
|
files = files.map(function(file) {
|
|
7296
|
-
return require('path').join(odir, file);
|
|
7325
|
+
return require$1('path').join(odir, file);
|
|
7297
7326
|
});
|
|
7298
7327
|
}
|
|
7299
7328
|
return files;
|
|
@@ -7315,7 +7344,7 @@
|
|
|
7315
7344
|
// Unlike rbush, flatbush doesn't allow size 0 indexes; workaround
|
|
7316
7345
|
return function() {return [];};
|
|
7317
7346
|
}
|
|
7318
|
-
Flatbush = require('flatbush');
|
|
7347
|
+
Flatbush = require$1('flatbush');
|
|
7319
7348
|
index = new Flatbush(boxes.length);
|
|
7320
7349
|
boxes.forEach(function(ring) {
|
|
7321
7350
|
var b = ring.bounds;
|
|
@@ -8791,10 +8820,10 @@
|
|
|
8791
8820
|
|
|
8792
8821
|
// Returns undefined if not found
|
|
8793
8822
|
function lookupColorName(str) {
|
|
8794
|
-
return colors[str.toLowerCase().replace(/[ -]+/g, '')];
|
|
8823
|
+
return colors$1[str.toLowerCase().replace(/[ -]+/g, '')];
|
|
8795
8824
|
}
|
|
8796
8825
|
|
|
8797
|
-
var colors = {
|
|
8826
|
+
var colors$1 = {
|
|
8798
8827
|
aliceblue: '#f0f8ff',
|
|
8799
8828
|
antiquewhite: '#faebd7',
|
|
8800
8829
|
aqua: '#00ffff',
|
|
@@ -13376,7 +13405,7 @@
|
|
|
13376
13405
|
memo.push(buf);
|
|
13377
13406
|
return memo;
|
|
13378
13407
|
}, []);
|
|
13379
|
-
return
|
|
13408
|
+
return B$3.concat(parts);
|
|
13380
13409
|
};
|
|
13381
13410
|
|
|
13382
13411
|
// collection: an array of individual GeoJSON Features or geometries as strings or buffers
|
|
@@ -13398,7 +13427,7 @@
|
|
|
13398
13427
|
return memo;
|
|
13399
13428
|
}, [utils.createBuffer(head, 'utf8')]);
|
|
13400
13429
|
parts.push(utils.createBuffer(tail, 'utf8'));
|
|
13401
|
-
return
|
|
13430
|
+
return B$3.concat(parts);
|
|
13402
13431
|
};
|
|
13403
13432
|
|
|
13404
13433
|
// export GeoJSON or TopoJSON point geometry
|
|
@@ -15175,7 +15204,7 @@
|
|
|
15175
15204
|
var cache = {};
|
|
15176
15205
|
function fetchFileSync(url) {
|
|
15177
15206
|
if (url in cache) return cache[url];
|
|
15178
|
-
var res = require('sync-request')('GET', url, {timeout: 2000});
|
|
15207
|
+
var res = require$1('sync-request')('GET', url, {timeout: 2000});
|
|
15179
15208
|
var content = res.getBody().toString();
|
|
15180
15209
|
cache[url] = content;
|
|
15181
15210
|
return content;
|
|
@@ -15246,8 +15275,8 @@
|
|
|
15246
15275
|
var content;
|
|
15247
15276
|
if (href.indexOf('http') === 0) {
|
|
15248
15277
|
content = fetchFileSync(href);
|
|
15249
|
-
} else if (require('fs').existsSync(href)) {
|
|
15250
|
-
content = require('fs').readFileSync(href, 'utf8');
|
|
15278
|
+
} else if (require$1('fs').existsSync(href)) {
|
|
15279
|
+
content = require$1('fs').readFileSync(href, 'utf8');
|
|
15251
15280
|
} else {
|
|
15252
15281
|
stop("Invalid SVG location:", href);
|
|
15253
15282
|
}
|
|
@@ -15558,12 +15587,13 @@ ${svg}
|
|
|
15558
15587
|
function BinArray(buf, le) {
|
|
15559
15588
|
if (utils.isNumber(buf)) {
|
|
15560
15589
|
buf = new ArrayBuffer(buf);
|
|
15561
|
-
} else if (
|
|
15590
|
+
} else if (buf instanceof ArrayBuffer) {
|
|
15591
|
+
// we're good
|
|
15592
|
+
} else if (typeof B$3 == 'function' && buf instanceof B$3) {
|
|
15562
15593
|
// Since node 0.10, DataView constructor doesn't accept Buffers,
|
|
15563
15594
|
// so need to copy Buffer to ArrayBuffer
|
|
15564
15595
|
buf = BinArray.toArrayBuffer(buf);
|
|
15565
|
-
}
|
|
15566
|
-
if (buf instanceof ArrayBuffer == false) {
|
|
15596
|
+
} else {
|
|
15567
15597
|
error("BinArray constructor takes an integer, ArrayBuffer or Buffer argument");
|
|
15568
15598
|
}
|
|
15569
15599
|
this._buffer = buf;
|
|
@@ -16442,7 +16472,7 @@ ${svg}
|
|
|
16442
16472
|
buffers.push(encodeString(str, encoding));
|
|
16443
16473
|
}
|
|
16444
16474
|
}
|
|
16445
|
-
return
|
|
16475
|
+
return B$3.concat(buffers);
|
|
16446
16476
|
}
|
|
16447
16477
|
|
|
16448
16478
|
function formatHeader(fields, formatRow) {
|
|
@@ -17215,7 +17245,7 @@ ${svg}
|
|
|
17215
17245
|
function guessInputFileType(file) {
|
|
17216
17246
|
var ext = getFileExtension(file || '').toLowerCase(),
|
|
17217
17247
|
type = null;
|
|
17218
|
-
if (ext == 'dbf' || ext == 'shp' || ext == 'prj' || ext == 'shx' || ext == 'kml') {
|
|
17248
|
+
if (ext == 'dbf' || ext == 'shp' || ext == 'prj' || ext == 'shx' || ext == 'kml' || ext == 'cpg') {
|
|
17219
17249
|
type = ext;
|
|
17220
17250
|
} else if (/json$/.test(ext)) {
|
|
17221
17251
|
type = 'json';
|
|
@@ -17628,7 +17658,9 @@ ${svg}
|
|
|
17628
17658
|
binArr, buf;
|
|
17629
17659
|
|
|
17630
17660
|
this.readToBinArray = function(start, length) {
|
|
17631
|
-
if (bufSize < start + length)
|
|
17661
|
+
if (bufSize < start + length) {
|
|
17662
|
+
error("Out-of-range error");
|
|
17663
|
+
}
|
|
17632
17664
|
if (!binArr) binArr = new BinArray(src);
|
|
17633
17665
|
binArr.position(start);
|
|
17634
17666
|
return binArr;
|
|
@@ -17657,7 +17689,7 @@ ${svg}
|
|
|
17657
17689
|
}
|
|
17658
17690
|
|
|
17659
17691
|
function FileReader(path, opts) {
|
|
17660
|
-
var fs = require('fs'),
|
|
17692
|
+
var fs = require$1('fs'),
|
|
17661
17693
|
fileLen = fs.statSync(path).size,
|
|
17662
17694
|
DEFAULT_CACHE_LEN = opts && opts.cacheSize || 0x1000000, // 16MB
|
|
17663
17695
|
DEFAULT_BUFFER_LEN = opts && opts.bufferSize || 0x40000, // 256K
|
|
@@ -18171,7 +18203,7 @@ ${svg}
|
|
|
18171
18203
|
|
|
18172
18204
|
if (readFromFile) {
|
|
18173
18205
|
reader = new FileReader(data.filename);
|
|
18174
|
-
} else if (content instanceof ArrayBuffer || content instanceof
|
|
18206
|
+
} else if (content instanceof ArrayBuffer || content instanceof B$3) {
|
|
18175
18207
|
// Web API may import as ArrayBuffer, to support larger files
|
|
18176
18208
|
reader = new BufferReader(content);
|
|
18177
18209
|
content = null;
|
|
@@ -21086,6 +21118,10 @@ ${svg}
|
|
|
21086
21118
|
parser.command('colors')
|
|
21087
21119
|
.describe('print list of color scheme names');
|
|
21088
21120
|
|
|
21121
|
+
parser.command('comment')
|
|
21122
|
+
.describe('add a comment to the sequence of commands')
|
|
21123
|
+
.flag('multi_arg');
|
|
21124
|
+
|
|
21089
21125
|
parser.command('encodings')
|
|
21090
21126
|
.describe('print list of supported text encodings (for .dbf import)');
|
|
21091
21127
|
|
|
@@ -21137,6 +21173,9 @@ ${svg}
|
|
|
21137
21173
|
// http://www.digitalpreservation.gov/formats/fdd/fdd000325.shtml
|
|
21138
21174
|
// http://www.clicketyclick.dk/databases/xbase/format/index.html
|
|
21139
21175
|
// http://www.clicketyclick.dk/databases/xbase/format/data_types.html
|
|
21176
|
+
// esri docs:
|
|
21177
|
+
// https://support.esri.com/en/technical-article/000007920
|
|
21178
|
+
// https://desktop.arcgis.com/en/arcmap/latest/manage-data/shapefiles/geoprocessing-considerations-for-shapefile-output.htm
|
|
21140
21179
|
|
|
21141
21180
|
// source: http://webhelp.esri.com/arcpad/8.0/referenceguide/index.htm#locales/task_code.htm
|
|
21142
21181
|
var languageIds = [0x01,'437',0x02,'850',0x03,'1252',0x08,'865',0x09,'437',0x0A,'850',0x0B,'437',0x0D,'437',0x0E,'850',0x0F,'437',0x10,'850',0x11,'437',0x12,'850',0x13,'932',0x14,'850',0x15,'437',0x16,'850',0x17,'865',0x18,'437',0x19,'437',0x1A,'850',0x1B,'437',0x1C,'863',0x1D,'850',0x1F,'852',0x22,'852',0x23,'852',0x24,'860',0x25,'850',0x26,'866',0x37,'850',0x40,'852',0x4D,'936',0x4E,'949',0x4F,'950',0x50,'874',0x57,'1252',0x58,'1252',0x59,'1252',0x64,'852',0x65,'866',0x66,'865',0x67,'861',0x6A,'737',0x6B,'857',0x6C,'863',0x78,'950',0x79,'949',0x7A,'936',0x7B,'932',0x7C,'874',0x86,'737',0x87,'852',0x88,'857',0xC8,'1250',0xC9,'1251',0xCA,'1254',0xCB,'1253',0xCC,'1257'];
|
|
@@ -21273,11 +21312,12 @@ ${svg}
|
|
|
21273
21312
|
// @src is a Buffer or ArrayBuffer or filename
|
|
21274
21313
|
//
|
|
21275
21314
|
function DbfReader(src, encodingArg) {
|
|
21276
|
-
|
|
21277
|
-
|
|
21278
|
-
|
|
21279
|
-
|
|
21280
|
-
var
|
|
21315
|
+
var opts = {
|
|
21316
|
+
cacheSize: 0x2000000, // 32MB
|
|
21317
|
+
bufferSize: 0x400000 // 4MB
|
|
21318
|
+
};
|
|
21319
|
+
var dbfFile = utils.isString(src) ? new FileReader(src, opts) : new BufferReader(src);
|
|
21320
|
+
var header = readHeader(dbfFile);
|
|
21281
21321
|
|
|
21282
21322
|
// encoding and fields are set on first access
|
|
21283
21323
|
var fields;
|
|
@@ -21293,7 +21333,11 @@ ${svg}
|
|
|
21293
21333
|
|
|
21294
21334
|
this.getFields = getFieldNames;
|
|
21295
21335
|
|
|
21296
|
-
|
|
21336
|
+
// TODO: switch to streaming output under Node.js
|
|
21337
|
+
this.getBuffer = function() {
|
|
21338
|
+
return dbfFile.readSync(0, dbfFile.size());
|
|
21339
|
+
// return bin.buffer();
|
|
21340
|
+
};
|
|
21297
21341
|
|
|
21298
21342
|
this.deleteField = function(f) {
|
|
21299
21343
|
prepareToRead();
|
|
@@ -21334,7 +21378,10 @@ ${svg}
|
|
|
21334
21378
|
});
|
|
21335
21379
|
}
|
|
21336
21380
|
|
|
21337
|
-
function readHeader(
|
|
21381
|
+
function readHeader(reader) {
|
|
21382
|
+
// fetch enough bytes to accomodate any header
|
|
21383
|
+
var maxHeaderLen = 32 * 256 + 1; // 255 fields * fieldRecSize + headerRecSize + terminator
|
|
21384
|
+
var bin = reader.readToBinArray(0, Math.min(maxHeaderLen, reader.size()));
|
|
21338
21385
|
bin.position(0).littleEndian();
|
|
21339
21386
|
var header = {
|
|
21340
21387
|
version: bin.readInt8(),
|
|
@@ -21420,30 +21467,32 @@ ${svg}
|
|
|
21420
21467
|
return new Function('return {' + args.join(',') + '};');
|
|
21421
21468
|
}
|
|
21422
21469
|
|
|
21423
|
-
function findEofPos(bin) {
|
|
21424
|
-
|
|
21425
|
-
|
|
21426
|
-
|
|
21427
|
-
|
|
21428
|
-
|
|
21429
|
-
}
|
|
21470
|
+
// function findEofPos(bin) {
|
|
21471
|
+
// var pos = bin.size() - 1;
|
|
21472
|
+
// if (bin.peek(pos) != 0x1A) { // last byte may or may not be EOF
|
|
21473
|
+
// pos++;
|
|
21474
|
+
// }
|
|
21475
|
+
// return pos;
|
|
21476
|
+
// }
|
|
21430
21477
|
|
|
21431
21478
|
function getRecordReader() {
|
|
21432
21479
|
prepareToRead();
|
|
21433
21480
|
var readers = fields.map(getFieldReader),
|
|
21434
|
-
eofOffs = findEofPos(bin),
|
|
21435
21481
|
create = getRecordConstructor(),
|
|
21436
21482
|
values = [];
|
|
21437
21483
|
|
|
21438
21484
|
return function readRow(r) {
|
|
21439
|
-
var
|
|
21485
|
+
var bin = dbfFile.readToBinArray(getRowOffset(r), header.recordSize),
|
|
21486
|
+
rowOffs = bin.position(),
|
|
21440
21487
|
fieldOffs, field;
|
|
21488
|
+
if (bin.bytesLeft() < header.recordSize ||
|
|
21489
|
+
bin.bytesLeft() == header.recordSize && bin.peek(bin.size() - 1) == 0x1A) {
|
|
21490
|
+
// check for observed data error: last data byte contains EOF
|
|
21491
|
+
stop('Invalid DBF file: encountered end-of-file while reading data');
|
|
21492
|
+
}
|
|
21441
21493
|
for (var c=0, cols=fields.length; c<cols; c++) {
|
|
21442
21494
|
field = fields[c];
|
|
21443
|
-
fieldOffs =
|
|
21444
|
-
if (fieldOffs + field.size > eofOffs) {
|
|
21445
|
-
stop('Invalid DBF file: encountered end-of-file while reading data');
|
|
21446
|
-
}
|
|
21495
|
+
fieldOffs = rowOffs + field.columnOffset;
|
|
21447
21496
|
bin.position(fieldOffs);
|
|
21448
21497
|
values[c] = readers[c](bin, field.size);
|
|
21449
21498
|
}
|
|
@@ -21501,11 +21550,12 @@ ${svg}
|
|
|
21501
21550
|
|
|
21502
21551
|
// Show a sample of decoded text if non-ascii-range text has been found
|
|
21503
21552
|
if (encoding && samples.length > 0) {
|
|
21553
|
+
msg = "Detected DBF text encoding: " + encoding + (encoding in encodingNames ? " (" + encodingNames[encoding] + ")" : "");
|
|
21554
|
+
message(msg);
|
|
21504
21555
|
msg = decodeSamples(encoding, samples);
|
|
21505
21556
|
msg = formatStringsAsGrid(msg.split('\n'));
|
|
21506
21557
|
msg = "\nSample text containing non-ascii characters:" + (msg.length > 60 ? '\n' : '') + msg;
|
|
21507
|
-
msg
|
|
21508
|
-
message(msg);
|
|
21558
|
+
verbose(msg);
|
|
21509
21559
|
}
|
|
21510
21560
|
return encoding;
|
|
21511
21561
|
}
|
|
@@ -21533,14 +21583,17 @@ ${svg}
|
|
|
21533
21583
|
var maxSamples = 50;
|
|
21534
21584
|
var buf = utils.createBuffer(256);
|
|
21535
21585
|
var index = {};
|
|
21536
|
-
var f, chars, sample, hash;
|
|
21586
|
+
var f, chars, sample, hash, bin, rowOffs;
|
|
21537
21587
|
// include non-ascii field names, if any
|
|
21538
21588
|
samples = getNonAsciiHeaders();
|
|
21539
21589
|
for (var r=0; r<rows; r++) {
|
|
21590
|
+
bin = dbfFile.readToBinArray(getRowOffset(r), header.recordSize);
|
|
21591
|
+
rowOffs = bin.position();
|
|
21540
21592
|
for (var c=0; c<cols; c++) {
|
|
21541
21593
|
if (samples.length >= maxSamples) break;
|
|
21542
21594
|
f = stringFields[c];
|
|
21543
|
-
bin.position(getRowOffset(r) + f.columnOffset);
|
|
21595
|
+
// bin.position(getRowOffset(r) + f.columnOffset);
|
|
21596
|
+
bin.position(rowOffs + f.columnOffset);
|
|
21544
21597
|
chars = readStringBytes(bin, f.size, buf);
|
|
21545
21598
|
if (chars > 0 && bufferContainsHighBit(buf, chars)) {
|
|
21546
21599
|
sample = utils.createBuffer(buf.slice(0, chars)); //
|
|
@@ -21556,9 +21609,9 @@ ${svg}
|
|
|
21556
21609
|
}
|
|
21557
21610
|
}
|
|
21558
21611
|
|
|
21559
|
-
function importDbfTable(
|
|
21612
|
+
function importDbfTable(src, o) {
|
|
21560
21613
|
var opts = o || {};
|
|
21561
|
-
return new ShapefileTable(
|
|
21614
|
+
return new ShapefileTable(src, opts.encoding);
|
|
21562
21615
|
}
|
|
21563
21616
|
|
|
21564
21617
|
// Implements the DataTable api for DBF file data.
|
|
@@ -21567,8 +21620,8 @@ ${svg}
|
|
|
21567
21620
|
// just the shapes and exporting in Shapefile format.
|
|
21568
21621
|
// TODO: consider accepting just the filename, so buffer doesn't consume memory needlessly.
|
|
21569
21622
|
//
|
|
21570
|
-
function ShapefileTable(
|
|
21571
|
-
var reader = new DbfReader(
|
|
21623
|
+
function ShapefileTable(src, encoding) {
|
|
21624
|
+
var reader = new DbfReader(src, encoding),
|
|
21572
21625
|
altered = false,
|
|
21573
21626
|
table;
|
|
21574
21627
|
|
|
@@ -21577,15 +21630,23 @@ ${svg}
|
|
|
21577
21630
|
// export DBF records on first table access
|
|
21578
21631
|
table = new DataTable(reader.readRows());
|
|
21579
21632
|
reader = null;
|
|
21580
|
-
|
|
21633
|
+
src = null; // null out references to DBF data for g.c.
|
|
21581
21634
|
}
|
|
21582
21635
|
return table;
|
|
21583
21636
|
}
|
|
21584
21637
|
|
|
21585
21638
|
this.exportAsDbf = function(opts) {
|
|
21586
|
-
// export original dbf bytes if possible
|
|
21639
|
+
// export original dbf bytes if possible
|
|
21640
|
+
// (e.g. if the data attributes haven't changed)
|
|
21587
21641
|
var useOriginal = !!reader && !altered && !opts.field_order && !opts.encoding;
|
|
21588
|
-
if (useOriginal)
|
|
21642
|
+
if (useOriginal) {
|
|
21643
|
+
try {
|
|
21644
|
+
// Maximum Buffer in current Node.js is 2GB
|
|
21645
|
+
// We fall back to import-export if getBuffer() fails.
|
|
21646
|
+
// This may produce a buffer that does not exceed the maximum size.
|
|
21647
|
+
return reader.getBuffer();
|
|
21648
|
+
} catch(e) {}
|
|
21649
|
+
}
|
|
21589
21650
|
return Dbf.exportRecords(getTable().getRecords(), opts.encoding, opts.field_order);
|
|
21590
21651
|
};
|
|
21591
21652
|
|
|
@@ -23484,8 +23545,8 @@ ${svg}
|
|
|
23484
23545
|
});
|
|
23485
23546
|
|
|
23486
23547
|
function importKML(str, opts) {
|
|
23487
|
-
var togeojson = require("@tmcw/togeojson");
|
|
23488
|
-
var Parser = typeof DOMParser == 'undefined' ? require("@xmldom/xmldom").DOMParser : DOMParser;
|
|
23548
|
+
var togeojson = require$1("@tmcw/togeojson");
|
|
23549
|
+
var Parser = typeof DOMParser == 'undefined' ? require$1("@xmldom/xmldom").DOMParser : DOMParser;
|
|
23489
23550
|
var geojson = togeojson.kml(new Parser().parseFromString(str, "text/xml"));
|
|
23490
23551
|
return importGeoJSON(geojson, opts || {});
|
|
23491
23552
|
}
|
|
@@ -23586,6 +23647,10 @@ ${svg}
|
|
|
23586
23647
|
if (obj.prj) {
|
|
23587
23648
|
dataset.info.prj = obj.prj.content;
|
|
23588
23649
|
}
|
|
23650
|
+
if (obj.cpg) {
|
|
23651
|
+
// TODO: consider using the input encoding as the default output encoding
|
|
23652
|
+
dataset.info.cpg = obj.cpg.content;
|
|
23653
|
+
}
|
|
23589
23654
|
return dataset;
|
|
23590
23655
|
}
|
|
23591
23656
|
|
|
@@ -23595,7 +23660,7 @@ ${svg}
|
|
|
23595
23660
|
if (input.cpg && !opts.encoding) {
|
|
23596
23661
|
opts.encoding = input.cpg.content;
|
|
23597
23662
|
}
|
|
23598
|
-
table = importDbfTable(input.dbf.content, opts);
|
|
23663
|
+
table = importDbfTable(input.dbf.content || input.dbf.filename, opts);
|
|
23599
23664
|
return {
|
|
23600
23665
|
info: {},
|
|
23601
23666
|
layers: [{data: table}]
|
|
@@ -23693,18 +23758,10 @@ ${svg}
|
|
|
23693
23758
|
content;
|
|
23694
23759
|
|
|
23695
23760
|
cli.checkFileExists(path, cache);
|
|
23696
|
-
if (fileType == 'shp' && !cached) {
|
|
23697
|
-
//
|
|
23698
|
-
content = null;
|
|
23699
|
-
|
|
23700
|
-
} else if (fileType == 'json' && !cached) {
|
|
23701
|
-
// postpone reading of JSON files, to support incremental parsing
|
|
23761
|
+
if ((fileType == 'shp' || fileType == 'json' || fileType == 'text' || fileType == 'dbf') && !cached) {
|
|
23762
|
+
// these file types are read incrementally
|
|
23702
23763
|
content = null;
|
|
23703
23764
|
|
|
23704
|
-
} else if (fileType == 'text' && !cached) {
|
|
23705
|
-
// content = cli.readFile(path); // read from buffer
|
|
23706
|
-
content = null; // read from file, to support largest files (see mapshaper-delim-import.js)
|
|
23707
|
-
|
|
23708
23765
|
} else if (fileType && isSupportedBinaryInputType(path)) {
|
|
23709
23766
|
content = cli.readFile(path, null, cache);
|
|
23710
23767
|
if (utils.isString(content)) {
|
|
@@ -23761,7 +23818,11 @@ ${svg}
|
|
|
23761
23818
|
obj.shx = {filename: shxPath, content: cli.readFile(shxPath, null, cache)};
|
|
23762
23819
|
}
|
|
23763
23820
|
if (!obj.dbf && cli.isFile(dbfPath, cache)) {
|
|
23764
|
-
obj.dbf = {filename: dbfPath, content: cli.readFile(dbfPath, null, cache)};
|
|
23821
|
+
// obj.dbf = {filename: dbfPath, content: cli.readFile(dbfPath, null, cache)};
|
|
23822
|
+
obj.dbf = {
|
|
23823
|
+
filename: dbfPath,
|
|
23824
|
+
content: (cache && (dbfPath in cache)) ? cli.readFile(dbfPath, null, cache) : null
|
|
23825
|
+
};
|
|
23765
23826
|
}
|
|
23766
23827
|
if (obj.dbf && cli.isFile(cpgPath, cache)) {
|
|
23767
23828
|
obj.cpg = {filename: cpgPath, content: cli.readFile(cpgPath, 'utf-8', cache).trim()};
|
|
@@ -24039,6 +24100,7 @@ ${svg}
|
|
|
24039
24100
|
clearStash(); // prevent errors from overwriting stash
|
|
24040
24101
|
stashVar('current_command', cmd.name);
|
|
24041
24102
|
stashVar('DEBUG', job.settings.DEBUG || cmd.debug);
|
|
24103
|
+
stashVar('VERBOSE', job.settings.VERBOSE || cmd.verbose);
|
|
24042
24104
|
stashVar('QUIET', job.settings.QUIET || cmd.quiet);
|
|
24043
24105
|
stashVar('defs', job.defs);
|
|
24044
24106
|
stashVar('input_files', job.input_files);
|
|
@@ -24187,10 +24249,10 @@ ${svg}
|
|
|
24187
24249
|
const ccwerrboundB = (2 + 12 * epsilon) * epsilon;
|
|
24188
24250
|
const ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;
|
|
24189
24251
|
|
|
24190
|
-
const B$
|
|
24252
|
+
const B$2 = vec(4);
|
|
24191
24253
|
const C1 = vec(8);
|
|
24192
24254
|
const C2 = vec(12);
|
|
24193
|
-
const D = vec(16);
|
|
24255
|
+
const D$1 = vec(16);
|
|
24194
24256
|
const u$2 = vec(4);
|
|
24195
24257
|
|
|
24196
24258
|
function orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {
|
|
@@ -24220,19 +24282,19 @@ ${svg}
|
|
|
24220
24282
|
t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
24221
24283
|
_i = s0 - t0;
|
|
24222
24284
|
bvirt = s0 - _i;
|
|
24223
|
-
B$
|
|
24285
|
+
B$2[0] = s0 - (_i + bvirt) + (bvirt - t0);
|
|
24224
24286
|
_j = s1 + _i;
|
|
24225
24287
|
bvirt = _j - s1;
|
|
24226
24288
|
_0 = s1 - (_j - bvirt) + (_i - bvirt);
|
|
24227
24289
|
_i = _0 - t1;
|
|
24228
24290
|
bvirt = _0 - _i;
|
|
24229
|
-
B$
|
|
24291
|
+
B$2[1] = _0 - (_i + bvirt) + (bvirt - t1);
|
|
24230
24292
|
u3 = _j + _i;
|
|
24231
24293
|
bvirt = u3 - _j;
|
|
24232
|
-
B$
|
|
24233
|
-
B$
|
|
24294
|
+
B$2[2] = _j - (u3 - bvirt) + (_i - bvirt);
|
|
24295
|
+
B$2[3] = u3;
|
|
24234
24296
|
|
|
24235
|
-
let det = estimate(4, B$
|
|
24297
|
+
let det = estimate(4, B$2);
|
|
24236
24298
|
let errbound = ccwerrboundB * detsum;
|
|
24237
24299
|
if (det >= errbound || -det >= errbound) {
|
|
24238
24300
|
return det;
|
|
@@ -24284,7 +24346,7 @@ ${svg}
|
|
|
24284
24346
|
bvirt = u3 - _j;
|
|
24285
24347
|
u$2[2] = _j - (u3 - bvirt) + (_i - bvirt);
|
|
24286
24348
|
u$2[3] = u3;
|
|
24287
|
-
const C1len = sum(4, B$
|
|
24349
|
+
const C1len = sum(4, B$2, 4, u$2, C1);
|
|
24288
24350
|
|
|
24289
24351
|
s1 = acx * bcytail;
|
|
24290
24352
|
c = splitter * acx;
|
|
@@ -24346,9 +24408,9 @@ ${svg}
|
|
|
24346
24408
|
bvirt = u3 - _j;
|
|
24347
24409
|
u$2[2] = _j - (u3 - bvirt) + (_i - bvirt);
|
|
24348
24410
|
u$2[3] = u3;
|
|
24349
|
-
const Dlen = sum(C2len, C2, 4, u$2, D);
|
|
24411
|
+
const Dlen = sum(C2len, C2, 4, u$2, D$1);
|
|
24350
24412
|
|
|
24351
|
-
return D[Dlen - 1];
|
|
24413
|
+
return D$1[Dlen - 1];
|
|
24352
24414
|
}
|
|
24353
24415
|
|
|
24354
24416
|
function orient2d(ax, ay, bx, by, cx, cy) {
|
|
@@ -27611,7 +27673,7 @@ ${svg}
|
|
|
27611
27673
|
function getGeodesic(P) {
|
|
27612
27674
|
if (!isLatLngCRS(P)) error('Expected an unprojected CRS');
|
|
27613
27675
|
var f = P.es / (1 + Math.sqrt(P.one_es));
|
|
27614
|
-
var GeographicLib = require('mproj').internal.GeographicLib;
|
|
27676
|
+
var GeographicLib = require$1('mproj').internal.GeographicLib;
|
|
27615
27677
|
return new GeographicLib.Geodesic.Geodesic(P.a, f);
|
|
27616
27678
|
}
|
|
27617
27679
|
|
|
@@ -27740,7 +27802,7 @@ ${svg}
|
|
|
27740
27802
|
var e = 1e-10;
|
|
27741
27803
|
var T = 90 - e;
|
|
27742
27804
|
var L = -180 + e;
|
|
27743
|
-
var B = -90 + e;
|
|
27805
|
+
var B$1 = -90 + e;
|
|
27744
27806
|
var R = 180 - e;
|
|
27745
27807
|
|
|
27746
27808
|
function lastEl(arr) {
|
|
@@ -27768,12 +27830,12 @@ ${svg}
|
|
|
27768
27830
|
function snapToEdge(p) {
|
|
27769
27831
|
if (p[0] <= L) p[0] = -180;
|
|
27770
27832
|
if (p[0] >= R) p[0] = 180;
|
|
27771
|
-
if (p[1] <= B) p[1] = -90;
|
|
27833
|
+
if (p[1] <= B$1) p[1] = -90;
|
|
27772
27834
|
if (p[1] >= T) p[1] = 90;
|
|
27773
27835
|
}
|
|
27774
27836
|
|
|
27775
27837
|
function onPole(p) {
|
|
27776
|
-
return p[1] >= T || p[1] <= B;
|
|
27838
|
+
return p[1] >= T || p[1] <= B$1;
|
|
27777
27839
|
}
|
|
27778
27840
|
|
|
27779
27841
|
function isWholeWorld(coords) {
|
|
@@ -27799,7 +27861,7 @@ ${svg}
|
|
|
27799
27861
|
}
|
|
27800
27862
|
|
|
27801
27863
|
function isEdgePoint(p) {
|
|
27802
|
-
return p[1] <= B || p[1] >= T || p[0] <= L || p[0] >= R;
|
|
27864
|
+
return p[1] <= B$1 || p[1] >= T || p[0] <= L || p[0] >= R;
|
|
27803
27865
|
}
|
|
27804
27866
|
|
|
27805
27867
|
// Remove segments that belong solely to cut points
|
|
@@ -28340,6 +28402,1120 @@ ${svg}
|
|
|
28340
28402
|
return s;
|
|
28341
28403
|
}
|
|
28342
28404
|
|
|
28405
|
+
function define(constructor, factory, prototype) {
|
|
28406
|
+
constructor.prototype = factory.prototype = prototype;
|
|
28407
|
+
prototype.constructor = constructor;
|
|
28408
|
+
}
|
|
28409
|
+
|
|
28410
|
+
function extend(parent, definition) {
|
|
28411
|
+
var prototype = Object.create(parent.prototype);
|
|
28412
|
+
for (var key in definition) prototype[key] = definition[key];
|
|
28413
|
+
return prototype;
|
|
28414
|
+
}
|
|
28415
|
+
|
|
28416
|
+
function Color() {}
|
|
28417
|
+
|
|
28418
|
+
var darker = 0.7;
|
|
28419
|
+
var brighter = 1 / darker;
|
|
28420
|
+
|
|
28421
|
+
var reI = "\\s*([+-]?\\d+)\\s*",
|
|
28422
|
+
reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
28423
|
+
reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
|
28424
|
+
reHex = /^#([0-9a-f]{3,8})$/,
|
|
28425
|
+
reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"),
|
|
28426
|
+
reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"),
|
|
28427
|
+
reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"),
|
|
28428
|
+
reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"),
|
|
28429
|
+
reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"),
|
|
28430
|
+
reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
|
|
28431
|
+
|
|
28432
|
+
var named = {
|
|
28433
|
+
aliceblue: 0xf0f8ff,
|
|
28434
|
+
antiquewhite: 0xfaebd7,
|
|
28435
|
+
aqua: 0x00ffff,
|
|
28436
|
+
aquamarine: 0x7fffd4,
|
|
28437
|
+
azure: 0xf0ffff,
|
|
28438
|
+
beige: 0xf5f5dc,
|
|
28439
|
+
bisque: 0xffe4c4,
|
|
28440
|
+
black: 0x000000,
|
|
28441
|
+
blanchedalmond: 0xffebcd,
|
|
28442
|
+
blue: 0x0000ff,
|
|
28443
|
+
blueviolet: 0x8a2be2,
|
|
28444
|
+
brown: 0xa52a2a,
|
|
28445
|
+
burlywood: 0xdeb887,
|
|
28446
|
+
cadetblue: 0x5f9ea0,
|
|
28447
|
+
chartreuse: 0x7fff00,
|
|
28448
|
+
chocolate: 0xd2691e,
|
|
28449
|
+
coral: 0xff7f50,
|
|
28450
|
+
cornflowerblue: 0x6495ed,
|
|
28451
|
+
cornsilk: 0xfff8dc,
|
|
28452
|
+
crimson: 0xdc143c,
|
|
28453
|
+
cyan: 0x00ffff,
|
|
28454
|
+
darkblue: 0x00008b,
|
|
28455
|
+
darkcyan: 0x008b8b,
|
|
28456
|
+
darkgoldenrod: 0xb8860b,
|
|
28457
|
+
darkgray: 0xa9a9a9,
|
|
28458
|
+
darkgreen: 0x006400,
|
|
28459
|
+
darkgrey: 0xa9a9a9,
|
|
28460
|
+
darkkhaki: 0xbdb76b,
|
|
28461
|
+
darkmagenta: 0x8b008b,
|
|
28462
|
+
darkolivegreen: 0x556b2f,
|
|
28463
|
+
darkorange: 0xff8c00,
|
|
28464
|
+
darkorchid: 0x9932cc,
|
|
28465
|
+
darkred: 0x8b0000,
|
|
28466
|
+
darksalmon: 0xe9967a,
|
|
28467
|
+
darkseagreen: 0x8fbc8f,
|
|
28468
|
+
darkslateblue: 0x483d8b,
|
|
28469
|
+
darkslategray: 0x2f4f4f,
|
|
28470
|
+
darkslategrey: 0x2f4f4f,
|
|
28471
|
+
darkturquoise: 0x00ced1,
|
|
28472
|
+
darkviolet: 0x9400d3,
|
|
28473
|
+
deeppink: 0xff1493,
|
|
28474
|
+
deepskyblue: 0x00bfff,
|
|
28475
|
+
dimgray: 0x696969,
|
|
28476
|
+
dimgrey: 0x696969,
|
|
28477
|
+
dodgerblue: 0x1e90ff,
|
|
28478
|
+
firebrick: 0xb22222,
|
|
28479
|
+
floralwhite: 0xfffaf0,
|
|
28480
|
+
forestgreen: 0x228b22,
|
|
28481
|
+
fuchsia: 0xff00ff,
|
|
28482
|
+
gainsboro: 0xdcdcdc,
|
|
28483
|
+
ghostwhite: 0xf8f8ff,
|
|
28484
|
+
gold: 0xffd700,
|
|
28485
|
+
goldenrod: 0xdaa520,
|
|
28486
|
+
gray: 0x808080,
|
|
28487
|
+
green: 0x008000,
|
|
28488
|
+
greenyellow: 0xadff2f,
|
|
28489
|
+
grey: 0x808080,
|
|
28490
|
+
honeydew: 0xf0fff0,
|
|
28491
|
+
hotpink: 0xff69b4,
|
|
28492
|
+
indianred: 0xcd5c5c,
|
|
28493
|
+
indigo: 0x4b0082,
|
|
28494
|
+
ivory: 0xfffff0,
|
|
28495
|
+
khaki: 0xf0e68c,
|
|
28496
|
+
lavender: 0xe6e6fa,
|
|
28497
|
+
lavenderblush: 0xfff0f5,
|
|
28498
|
+
lawngreen: 0x7cfc00,
|
|
28499
|
+
lemonchiffon: 0xfffacd,
|
|
28500
|
+
lightblue: 0xadd8e6,
|
|
28501
|
+
lightcoral: 0xf08080,
|
|
28502
|
+
lightcyan: 0xe0ffff,
|
|
28503
|
+
lightgoldenrodyellow: 0xfafad2,
|
|
28504
|
+
lightgray: 0xd3d3d3,
|
|
28505
|
+
lightgreen: 0x90ee90,
|
|
28506
|
+
lightgrey: 0xd3d3d3,
|
|
28507
|
+
lightpink: 0xffb6c1,
|
|
28508
|
+
lightsalmon: 0xffa07a,
|
|
28509
|
+
lightseagreen: 0x20b2aa,
|
|
28510
|
+
lightskyblue: 0x87cefa,
|
|
28511
|
+
lightslategray: 0x778899,
|
|
28512
|
+
lightslategrey: 0x778899,
|
|
28513
|
+
lightsteelblue: 0xb0c4de,
|
|
28514
|
+
lightyellow: 0xffffe0,
|
|
28515
|
+
lime: 0x00ff00,
|
|
28516
|
+
limegreen: 0x32cd32,
|
|
28517
|
+
linen: 0xfaf0e6,
|
|
28518
|
+
magenta: 0xff00ff,
|
|
28519
|
+
maroon: 0x800000,
|
|
28520
|
+
mediumaquamarine: 0x66cdaa,
|
|
28521
|
+
mediumblue: 0x0000cd,
|
|
28522
|
+
mediumorchid: 0xba55d3,
|
|
28523
|
+
mediumpurple: 0x9370db,
|
|
28524
|
+
mediumseagreen: 0x3cb371,
|
|
28525
|
+
mediumslateblue: 0x7b68ee,
|
|
28526
|
+
mediumspringgreen: 0x00fa9a,
|
|
28527
|
+
mediumturquoise: 0x48d1cc,
|
|
28528
|
+
mediumvioletred: 0xc71585,
|
|
28529
|
+
midnightblue: 0x191970,
|
|
28530
|
+
mintcream: 0xf5fffa,
|
|
28531
|
+
mistyrose: 0xffe4e1,
|
|
28532
|
+
moccasin: 0xffe4b5,
|
|
28533
|
+
navajowhite: 0xffdead,
|
|
28534
|
+
navy: 0x000080,
|
|
28535
|
+
oldlace: 0xfdf5e6,
|
|
28536
|
+
olive: 0x808000,
|
|
28537
|
+
olivedrab: 0x6b8e23,
|
|
28538
|
+
orange: 0xffa500,
|
|
28539
|
+
orangered: 0xff4500,
|
|
28540
|
+
orchid: 0xda70d6,
|
|
28541
|
+
palegoldenrod: 0xeee8aa,
|
|
28542
|
+
palegreen: 0x98fb98,
|
|
28543
|
+
paleturquoise: 0xafeeee,
|
|
28544
|
+
palevioletred: 0xdb7093,
|
|
28545
|
+
papayawhip: 0xffefd5,
|
|
28546
|
+
peachpuff: 0xffdab9,
|
|
28547
|
+
peru: 0xcd853f,
|
|
28548
|
+
pink: 0xffc0cb,
|
|
28549
|
+
plum: 0xdda0dd,
|
|
28550
|
+
powderblue: 0xb0e0e6,
|
|
28551
|
+
purple: 0x800080,
|
|
28552
|
+
rebeccapurple: 0x663399,
|
|
28553
|
+
red: 0xff0000,
|
|
28554
|
+
rosybrown: 0xbc8f8f,
|
|
28555
|
+
royalblue: 0x4169e1,
|
|
28556
|
+
saddlebrown: 0x8b4513,
|
|
28557
|
+
salmon: 0xfa8072,
|
|
28558
|
+
sandybrown: 0xf4a460,
|
|
28559
|
+
seagreen: 0x2e8b57,
|
|
28560
|
+
seashell: 0xfff5ee,
|
|
28561
|
+
sienna: 0xa0522d,
|
|
28562
|
+
silver: 0xc0c0c0,
|
|
28563
|
+
skyblue: 0x87ceeb,
|
|
28564
|
+
slateblue: 0x6a5acd,
|
|
28565
|
+
slategray: 0x708090,
|
|
28566
|
+
slategrey: 0x708090,
|
|
28567
|
+
snow: 0xfffafa,
|
|
28568
|
+
springgreen: 0x00ff7f,
|
|
28569
|
+
steelblue: 0x4682b4,
|
|
28570
|
+
tan: 0xd2b48c,
|
|
28571
|
+
teal: 0x008080,
|
|
28572
|
+
thistle: 0xd8bfd8,
|
|
28573
|
+
tomato: 0xff6347,
|
|
28574
|
+
turquoise: 0x40e0d0,
|
|
28575
|
+
violet: 0xee82ee,
|
|
28576
|
+
wheat: 0xf5deb3,
|
|
28577
|
+
white: 0xffffff,
|
|
28578
|
+
whitesmoke: 0xf5f5f5,
|
|
28579
|
+
yellow: 0xffff00,
|
|
28580
|
+
yellowgreen: 0x9acd32
|
|
28581
|
+
};
|
|
28582
|
+
|
|
28583
|
+
define(Color, color, {
|
|
28584
|
+
copy: function(channels) {
|
|
28585
|
+
return Object.assign(new this.constructor, this, channels);
|
|
28586
|
+
},
|
|
28587
|
+
displayable: function() {
|
|
28588
|
+
return this.rgb().displayable();
|
|
28589
|
+
},
|
|
28590
|
+
hex: color_formatHex, // Deprecated! Use color.formatHex.
|
|
28591
|
+
formatHex: color_formatHex,
|
|
28592
|
+
formatHsl: color_formatHsl,
|
|
28593
|
+
formatRgb: color_formatRgb,
|
|
28594
|
+
toString: color_formatRgb
|
|
28595
|
+
});
|
|
28596
|
+
|
|
28597
|
+
function color_formatHex() {
|
|
28598
|
+
return this.rgb().formatHex();
|
|
28599
|
+
}
|
|
28600
|
+
|
|
28601
|
+
function color_formatHsl() {
|
|
28602
|
+
return hslConvert(this).formatHsl();
|
|
28603
|
+
}
|
|
28604
|
+
|
|
28605
|
+
function color_formatRgb() {
|
|
28606
|
+
return this.rgb().formatRgb();
|
|
28607
|
+
}
|
|
28608
|
+
|
|
28609
|
+
function color(format) {
|
|
28610
|
+
var m, l;
|
|
28611
|
+
format = (format + "").trim().toLowerCase();
|
|
28612
|
+
return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
|
|
28613
|
+
: l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
|
|
28614
|
+
: l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
|
|
28615
|
+
: l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
|
|
28616
|
+
: null) // invalid hex
|
|
28617
|
+
: (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
|
|
28618
|
+
: (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
|
|
28619
|
+
: (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
|
|
28620
|
+
: (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
|
|
28621
|
+
: (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
|
|
28622
|
+
: (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
|
|
28623
|
+
: named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
|
|
28624
|
+
: format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
|
|
28625
|
+
: null;
|
|
28626
|
+
}
|
|
28627
|
+
|
|
28628
|
+
function rgbn(n) {
|
|
28629
|
+
return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
|
|
28630
|
+
}
|
|
28631
|
+
|
|
28632
|
+
function rgba(r, g, b, a) {
|
|
28633
|
+
if (a <= 0) r = g = b = NaN;
|
|
28634
|
+
return new Rgb(r, g, b, a);
|
|
28635
|
+
}
|
|
28636
|
+
|
|
28637
|
+
function rgbConvert(o) {
|
|
28638
|
+
if (!(o instanceof Color)) o = color(o);
|
|
28639
|
+
if (!o) return new Rgb;
|
|
28640
|
+
o = o.rgb();
|
|
28641
|
+
return new Rgb(o.r, o.g, o.b, o.opacity);
|
|
28642
|
+
}
|
|
28643
|
+
|
|
28644
|
+
function rgb$1(r, g, b, opacity) {
|
|
28645
|
+
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
|
28646
|
+
}
|
|
28647
|
+
|
|
28648
|
+
function Rgb(r, g, b, opacity) {
|
|
28649
|
+
this.r = +r;
|
|
28650
|
+
this.g = +g;
|
|
28651
|
+
this.b = +b;
|
|
28652
|
+
this.opacity = +opacity;
|
|
28653
|
+
}
|
|
28654
|
+
|
|
28655
|
+
define(Rgb, rgb$1, extend(Color, {
|
|
28656
|
+
brighter: function(k) {
|
|
28657
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
28658
|
+
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
28659
|
+
},
|
|
28660
|
+
darker: function(k) {
|
|
28661
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
28662
|
+
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
28663
|
+
},
|
|
28664
|
+
rgb: function() {
|
|
28665
|
+
return this;
|
|
28666
|
+
},
|
|
28667
|
+
displayable: function() {
|
|
28668
|
+
return (-0.5 <= this.r && this.r < 255.5)
|
|
28669
|
+
&& (-0.5 <= this.g && this.g < 255.5)
|
|
28670
|
+
&& (-0.5 <= this.b && this.b < 255.5)
|
|
28671
|
+
&& (0 <= this.opacity && this.opacity <= 1);
|
|
28672
|
+
},
|
|
28673
|
+
hex: rgb_formatHex, // Deprecated! Use color.formatHex.
|
|
28674
|
+
formatHex: rgb_formatHex,
|
|
28675
|
+
formatRgb: rgb_formatRgb,
|
|
28676
|
+
toString: rgb_formatRgb
|
|
28677
|
+
}));
|
|
28678
|
+
|
|
28679
|
+
function rgb_formatHex() {
|
|
28680
|
+
return "#" + hex(this.r) + hex(this.g) + hex(this.b);
|
|
28681
|
+
}
|
|
28682
|
+
|
|
28683
|
+
function rgb_formatRgb() {
|
|
28684
|
+
var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
|
|
28685
|
+
return (a === 1 ? "rgb(" : "rgba(")
|
|
28686
|
+
+ Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", "
|
|
28687
|
+
+ Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", "
|
|
28688
|
+
+ Math.max(0, Math.min(255, Math.round(this.b) || 0))
|
|
28689
|
+
+ (a === 1 ? ")" : ", " + a + ")");
|
|
28690
|
+
}
|
|
28691
|
+
|
|
28692
|
+
function hex(value) {
|
|
28693
|
+
value = Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
28694
|
+
return (value < 16 ? "0" : "") + value.toString(16);
|
|
28695
|
+
}
|
|
28696
|
+
|
|
28697
|
+
function hsla(h, s, l, a) {
|
|
28698
|
+
if (a <= 0) h = s = l = NaN;
|
|
28699
|
+
else if (l <= 0 || l >= 1) h = s = NaN;
|
|
28700
|
+
else if (s <= 0) h = NaN;
|
|
28701
|
+
return new Hsl(h, s, l, a);
|
|
28702
|
+
}
|
|
28703
|
+
|
|
28704
|
+
function hslConvert(o) {
|
|
28705
|
+
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
28706
|
+
if (!(o instanceof Color)) o = color(o);
|
|
28707
|
+
if (!o) return new Hsl;
|
|
28708
|
+
if (o instanceof Hsl) return o;
|
|
28709
|
+
o = o.rgb();
|
|
28710
|
+
var r = o.r / 255,
|
|
28711
|
+
g = o.g / 255,
|
|
28712
|
+
b = o.b / 255,
|
|
28713
|
+
min = Math.min(r, g, b),
|
|
28714
|
+
max = Math.max(r, g, b),
|
|
28715
|
+
h = NaN,
|
|
28716
|
+
s = max - min,
|
|
28717
|
+
l = (max + min) / 2;
|
|
28718
|
+
if (s) {
|
|
28719
|
+
if (r === max) h = (g - b) / s + (g < b) * 6;
|
|
28720
|
+
else if (g === max) h = (b - r) / s + 2;
|
|
28721
|
+
else h = (r - g) / s + 4;
|
|
28722
|
+
s /= l < 0.5 ? max + min : 2 - max - min;
|
|
28723
|
+
h *= 60;
|
|
28724
|
+
} else {
|
|
28725
|
+
s = l > 0 && l < 1 ? 0 : h;
|
|
28726
|
+
}
|
|
28727
|
+
return new Hsl(h, s, l, o.opacity);
|
|
28728
|
+
}
|
|
28729
|
+
|
|
28730
|
+
function hsl$2(h, s, l, opacity) {
|
|
28731
|
+
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
|
|
28732
|
+
}
|
|
28733
|
+
|
|
28734
|
+
function Hsl(h, s, l, opacity) {
|
|
28735
|
+
this.h = +h;
|
|
28736
|
+
this.s = +s;
|
|
28737
|
+
this.l = +l;
|
|
28738
|
+
this.opacity = +opacity;
|
|
28739
|
+
}
|
|
28740
|
+
|
|
28741
|
+
define(Hsl, hsl$2, extend(Color, {
|
|
28742
|
+
brighter: function(k) {
|
|
28743
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
28744
|
+
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
28745
|
+
},
|
|
28746
|
+
darker: function(k) {
|
|
28747
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
28748
|
+
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
28749
|
+
},
|
|
28750
|
+
rgb: function() {
|
|
28751
|
+
var h = this.h % 360 + (this.h < 0) * 360,
|
|
28752
|
+
s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
|
|
28753
|
+
l = this.l,
|
|
28754
|
+
m2 = l + (l < 0.5 ? l : 1 - l) * s,
|
|
28755
|
+
m1 = 2 * l - m2;
|
|
28756
|
+
return new Rgb(
|
|
28757
|
+
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
28758
|
+
hsl2rgb(h, m1, m2),
|
|
28759
|
+
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
|
|
28760
|
+
this.opacity
|
|
28761
|
+
);
|
|
28762
|
+
},
|
|
28763
|
+
displayable: function() {
|
|
28764
|
+
return (0 <= this.s && this.s <= 1 || isNaN(this.s))
|
|
28765
|
+
&& (0 <= this.l && this.l <= 1)
|
|
28766
|
+
&& (0 <= this.opacity && this.opacity <= 1);
|
|
28767
|
+
},
|
|
28768
|
+
formatHsl: function() {
|
|
28769
|
+
var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
|
|
28770
|
+
return (a === 1 ? "hsl(" : "hsla(")
|
|
28771
|
+
+ (this.h || 0) + ", "
|
|
28772
|
+
+ (this.s || 0) * 100 + "%, "
|
|
28773
|
+
+ (this.l || 0) * 100 + "%"
|
|
28774
|
+
+ (a === 1 ? ")" : ", " + a + ")");
|
|
28775
|
+
}
|
|
28776
|
+
}));
|
|
28777
|
+
|
|
28778
|
+
/* From FvD 13.37, CSS Color Module Level 3 */
|
|
28779
|
+
function hsl2rgb(h, m1, m2) {
|
|
28780
|
+
return (h < 60 ? m1 + (m2 - m1) * h / 60
|
|
28781
|
+
: h < 180 ? m2
|
|
28782
|
+
: h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
|
|
28783
|
+
: m1) * 255;
|
|
28784
|
+
}
|
|
28785
|
+
|
|
28786
|
+
const radians = Math.PI / 180;
|
|
28787
|
+
const degrees$1 = 180 / Math.PI;
|
|
28788
|
+
|
|
28789
|
+
// https://observablehq.com/@mbostock/lab-and-rgb
|
|
28790
|
+
const K = 18,
|
|
28791
|
+
Xn = 0.96422,
|
|
28792
|
+
Yn = 1,
|
|
28793
|
+
Zn = 0.82521,
|
|
28794
|
+
t0 = 4 / 29,
|
|
28795
|
+
t1 = 6 / 29,
|
|
28796
|
+
t2 = 3 * t1 * t1,
|
|
28797
|
+
t3 = t1 * t1 * t1;
|
|
28798
|
+
|
|
28799
|
+
function labConvert(o) {
|
|
28800
|
+
if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
|
|
28801
|
+
if (o instanceof Hcl) return hcl2lab(o);
|
|
28802
|
+
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
28803
|
+
var r = rgb2lrgb(o.r),
|
|
28804
|
+
g = rgb2lrgb(o.g),
|
|
28805
|
+
b = rgb2lrgb(o.b),
|
|
28806
|
+
y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;
|
|
28807
|
+
if (r === g && g === b) x = z = y; else {
|
|
28808
|
+
x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
|
|
28809
|
+
z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
|
|
28810
|
+
}
|
|
28811
|
+
return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
|
|
28812
|
+
}
|
|
28813
|
+
|
|
28814
|
+
function gray(l, opacity) {
|
|
28815
|
+
return new Lab(l, 0, 0, opacity == null ? 1 : opacity);
|
|
28816
|
+
}
|
|
28817
|
+
|
|
28818
|
+
function lab$1(l, a, b, opacity) {
|
|
28819
|
+
return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
|
|
28820
|
+
}
|
|
28821
|
+
|
|
28822
|
+
function Lab(l, a, b, opacity) {
|
|
28823
|
+
this.l = +l;
|
|
28824
|
+
this.a = +a;
|
|
28825
|
+
this.b = +b;
|
|
28826
|
+
this.opacity = +opacity;
|
|
28827
|
+
}
|
|
28828
|
+
|
|
28829
|
+
define(Lab, lab$1, extend(Color, {
|
|
28830
|
+
brighter: function(k) {
|
|
28831
|
+
return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
28832
|
+
},
|
|
28833
|
+
darker: function(k) {
|
|
28834
|
+
return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
28835
|
+
},
|
|
28836
|
+
rgb: function() {
|
|
28837
|
+
var y = (this.l + 16) / 116,
|
|
28838
|
+
x = isNaN(this.a) ? y : y + this.a / 500,
|
|
28839
|
+
z = isNaN(this.b) ? y : y - this.b / 200;
|
|
28840
|
+
x = Xn * lab2xyz(x);
|
|
28841
|
+
y = Yn * lab2xyz(y);
|
|
28842
|
+
z = Zn * lab2xyz(z);
|
|
28843
|
+
return new Rgb(
|
|
28844
|
+
lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),
|
|
28845
|
+
lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),
|
|
28846
|
+
lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),
|
|
28847
|
+
this.opacity
|
|
28848
|
+
);
|
|
28849
|
+
}
|
|
28850
|
+
}));
|
|
28851
|
+
|
|
28852
|
+
function xyz2lab(t) {
|
|
28853
|
+
return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;
|
|
28854
|
+
}
|
|
28855
|
+
|
|
28856
|
+
function lab2xyz(t) {
|
|
28857
|
+
return t > t1 ? t * t * t : t2 * (t - t0);
|
|
28858
|
+
}
|
|
28859
|
+
|
|
28860
|
+
function lrgb2rgb(x) {
|
|
28861
|
+
return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
|
|
28862
|
+
}
|
|
28863
|
+
|
|
28864
|
+
function rgb2lrgb(x) {
|
|
28865
|
+
return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
|
|
28866
|
+
}
|
|
28867
|
+
|
|
28868
|
+
function hclConvert(o) {
|
|
28869
|
+
if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
|
|
28870
|
+
if (!(o instanceof Lab)) o = labConvert(o);
|
|
28871
|
+
if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
|
|
28872
|
+
var h = Math.atan2(o.b, o.a) * degrees$1;
|
|
28873
|
+
return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
|
|
28874
|
+
}
|
|
28875
|
+
|
|
28876
|
+
function lch(l, c, h, opacity) {
|
|
28877
|
+
return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
|
|
28878
|
+
}
|
|
28879
|
+
|
|
28880
|
+
function hcl$2(h, c, l, opacity) {
|
|
28881
|
+
return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
|
|
28882
|
+
}
|
|
28883
|
+
|
|
28884
|
+
function Hcl(h, c, l, opacity) {
|
|
28885
|
+
this.h = +h;
|
|
28886
|
+
this.c = +c;
|
|
28887
|
+
this.l = +l;
|
|
28888
|
+
this.opacity = +opacity;
|
|
28889
|
+
}
|
|
28890
|
+
|
|
28891
|
+
function hcl2lab(o) {
|
|
28892
|
+
if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
|
|
28893
|
+
var h = o.h * radians;
|
|
28894
|
+
return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
|
|
28895
|
+
}
|
|
28896
|
+
|
|
28897
|
+
define(Hcl, hcl$2, extend(Color, {
|
|
28898
|
+
brighter: function(k) {
|
|
28899
|
+
return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
|
|
28900
|
+
},
|
|
28901
|
+
darker: function(k) {
|
|
28902
|
+
return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
|
|
28903
|
+
},
|
|
28904
|
+
rgb: function() {
|
|
28905
|
+
return hcl2lab(this).rgb();
|
|
28906
|
+
}
|
|
28907
|
+
}));
|
|
28908
|
+
|
|
28909
|
+
var A = -0.14861,
|
|
28910
|
+
B = +1.78277,
|
|
28911
|
+
C = -0.29227,
|
|
28912
|
+
D = -0.90649,
|
|
28913
|
+
E = +1.97294,
|
|
28914
|
+
ED = E * D,
|
|
28915
|
+
EB = E * B,
|
|
28916
|
+
BC_DA = B * C - D * A;
|
|
28917
|
+
|
|
28918
|
+
function cubehelixConvert(o) {
|
|
28919
|
+
if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
|
|
28920
|
+
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
28921
|
+
var r = o.r / 255,
|
|
28922
|
+
g = o.g / 255,
|
|
28923
|
+
b = o.b / 255,
|
|
28924
|
+
l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
|
|
28925
|
+
bl = b - l,
|
|
28926
|
+
k = (E * (g - l) - C * bl) / D,
|
|
28927
|
+
s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1
|
|
28928
|
+
h = s ? Math.atan2(k, bl) * degrees$1 - 120 : NaN;
|
|
28929
|
+
return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
|
|
28930
|
+
}
|
|
28931
|
+
|
|
28932
|
+
function cubehelix$3(h, s, l, opacity) {
|
|
28933
|
+
return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
|
|
28934
|
+
}
|
|
28935
|
+
|
|
28936
|
+
function Cubehelix(h, s, l, opacity) {
|
|
28937
|
+
this.h = +h;
|
|
28938
|
+
this.s = +s;
|
|
28939
|
+
this.l = +l;
|
|
28940
|
+
this.opacity = +opacity;
|
|
28941
|
+
}
|
|
28942
|
+
|
|
28943
|
+
define(Cubehelix, cubehelix$3, extend(Color, {
|
|
28944
|
+
brighter: function(k) {
|
|
28945
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
28946
|
+
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
28947
|
+
},
|
|
28948
|
+
darker: function(k) {
|
|
28949
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
28950
|
+
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
28951
|
+
},
|
|
28952
|
+
rgb: function() {
|
|
28953
|
+
var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,
|
|
28954
|
+
l = +this.l,
|
|
28955
|
+
a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
|
|
28956
|
+
cosh = Math.cos(h),
|
|
28957
|
+
sinh = Math.sin(h);
|
|
28958
|
+
return new Rgb(
|
|
28959
|
+
255 * (l + a * (A * cosh + B * sinh)),
|
|
28960
|
+
255 * (l + a * (C * cosh + D * sinh)),
|
|
28961
|
+
255 * (l + a * (E * cosh)),
|
|
28962
|
+
this.opacity
|
|
28963
|
+
);
|
|
28964
|
+
}
|
|
28965
|
+
}));
|
|
28966
|
+
|
|
28967
|
+
function basis(t1, v0, v1, v2, v3) {
|
|
28968
|
+
var t2 = t1 * t1, t3 = t2 * t1;
|
|
28969
|
+
return ((1 - 3 * t1 + 3 * t2 - t3) * v0
|
|
28970
|
+
+ (4 - 6 * t2 + 3 * t3) * v1
|
|
28971
|
+
+ (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2
|
|
28972
|
+
+ t3 * v3) / 6;
|
|
28973
|
+
}
|
|
28974
|
+
|
|
28975
|
+
function basis$1(values) {
|
|
28976
|
+
var n = values.length - 1;
|
|
28977
|
+
return function(t) {
|
|
28978
|
+
var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
|
|
28979
|
+
v1 = values[i],
|
|
28980
|
+
v2 = values[i + 1],
|
|
28981
|
+
v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
|
|
28982
|
+
v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
|
|
28983
|
+
return basis((t - i / n) * n, v0, v1, v2, v3);
|
|
28984
|
+
};
|
|
28985
|
+
}
|
|
28986
|
+
|
|
28987
|
+
function basisClosed(values) {
|
|
28988
|
+
var n = values.length;
|
|
28989
|
+
return function(t) {
|
|
28990
|
+
var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
|
|
28991
|
+
v0 = values[(i + n - 1) % n],
|
|
28992
|
+
v1 = values[i % n],
|
|
28993
|
+
v2 = values[(i + 1) % n],
|
|
28994
|
+
v3 = values[(i + 2) % n];
|
|
28995
|
+
return basis((t - i / n) * n, v0, v1, v2, v3);
|
|
28996
|
+
};
|
|
28997
|
+
}
|
|
28998
|
+
|
|
28999
|
+
var constant = x => () => x;
|
|
29000
|
+
|
|
29001
|
+
function linear(a, d) {
|
|
29002
|
+
return function(t) {
|
|
29003
|
+
return a + t * d;
|
|
29004
|
+
};
|
|
29005
|
+
}
|
|
29006
|
+
|
|
29007
|
+
function exponential(a, b, y) {
|
|
29008
|
+
return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
|
|
29009
|
+
return Math.pow(a + t * b, y);
|
|
29010
|
+
};
|
|
29011
|
+
}
|
|
29012
|
+
|
|
29013
|
+
function hue$1(a, b) {
|
|
29014
|
+
var d = b - a;
|
|
29015
|
+
return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);
|
|
29016
|
+
}
|
|
29017
|
+
|
|
29018
|
+
function gamma(y) {
|
|
29019
|
+
return (y = +y) === 1 ? nogamma : function(a, b) {
|
|
29020
|
+
return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
|
|
29021
|
+
};
|
|
29022
|
+
}
|
|
29023
|
+
|
|
29024
|
+
function nogamma(a, b) {
|
|
29025
|
+
var d = b - a;
|
|
29026
|
+
return d ? linear(a, d) : constant(isNaN(a) ? b : a);
|
|
29027
|
+
}
|
|
29028
|
+
|
|
29029
|
+
var rgb = (function rgbGamma(y) {
|
|
29030
|
+
var color = gamma(y);
|
|
29031
|
+
|
|
29032
|
+
function rgb(start, end) {
|
|
29033
|
+
var r = color((start = rgb$1(start)).r, (end = rgb$1(end)).r),
|
|
29034
|
+
g = color(start.g, end.g),
|
|
29035
|
+
b = color(start.b, end.b),
|
|
29036
|
+
opacity = nogamma(start.opacity, end.opacity);
|
|
29037
|
+
return function(t) {
|
|
29038
|
+
start.r = r(t);
|
|
29039
|
+
start.g = g(t);
|
|
29040
|
+
start.b = b(t);
|
|
29041
|
+
start.opacity = opacity(t);
|
|
29042
|
+
return start + "";
|
|
29043
|
+
};
|
|
29044
|
+
}
|
|
29045
|
+
|
|
29046
|
+
rgb.gamma = rgbGamma;
|
|
29047
|
+
|
|
29048
|
+
return rgb;
|
|
29049
|
+
})(1);
|
|
29050
|
+
|
|
29051
|
+
function rgbSpline(spline) {
|
|
29052
|
+
return function(colors) {
|
|
29053
|
+
var n = colors.length,
|
|
29054
|
+
r = new Array(n),
|
|
29055
|
+
g = new Array(n),
|
|
29056
|
+
b = new Array(n),
|
|
29057
|
+
i, color;
|
|
29058
|
+
for (i = 0; i < n; ++i) {
|
|
29059
|
+
color = rgb$1(colors[i]);
|
|
29060
|
+
r[i] = color.r || 0;
|
|
29061
|
+
g[i] = color.g || 0;
|
|
29062
|
+
b[i] = color.b || 0;
|
|
29063
|
+
}
|
|
29064
|
+
r = spline(r);
|
|
29065
|
+
g = spline(g);
|
|
29066
|
+
b = spline(b);
|
|
29067
|
+
color.opacity = 1;
|
|
29068
|
+
return function(t) {
|
|
29069
|
+
color.r = r(t);
|
|
29070
|
+
color.g = g(t);
|
|
29071
|
+
color.b = b(t);
|
|
29072
|
+
return color + "";
|
|
29073
|
+
};
|
|
29074
|
+
};
|
|
29075
|
+
}
|
|
29076
|
+
|
|
29077
|
+
var rgbBasis = rgbSpline(basis$1);
|
|
29078
|
+
var rgbBasisClosed = rgbSpline(basisClosed);
|
|
29079
|
+
|
|
29080
|
+
function numberArray(a, b) {
|
|
29081
|
+
if (!b) b = [];
|
|
29082
|
+
var n = a ? Math.min(b.length, a.length) : 0,
|
|
29083
|
+
c = b.slice(),
|
|
29084
|
+
i;
|
|
29085
|
+
return function(t) {
|
|
29086
|
+
for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
|
|
29087
|
+
return c;
|
|
29088
|
+
};
|
|
29089
|
+
}
|
|
29090
|
+
|
|
29091
|
+
function isNumberArray(x) {
|
|
29092
|
+
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
29093
|
+
}
|
|
29094
|
+
|
|
29095
|
+
function array(a, b) {
|
|
29096
|
+
return (isNumberArray(b) ? numberArray : genericArray)(a, b);
|
|
29097
|
+
}
|
|
29098
|
+
|
|
29099
|
+
function genericArray(a, b) {
|
|
29100
|
+
var nb = b ? b.length : 0,
|
|
29101
|
+
na = a ? Math.min(nb, a.length) : 0,
|
|
29102
|
+
x = new Array(na),
|
|
29103
|
+
c = new Array(nb),
|
|
29104
|
+
i;
|
|
29105
|
+
|
|
29106
|
+
for (i = 0; i < na; ++i) x[i] = d3_interpolate(a[i], b[i]);
|
|
29107
|
+
for (; i < nb; ++i) c[i] = b[i];
|
|
29108
|
+
|
|
29109
|
+
return function(t) {
|
|
29110
|
+
for (i = 0; i < na; ++i) c[i] = x[i](t);
|
|
29111
|
+
return c;
|
|
29112
|
+
};
|
|
29113
|
+
}
|
|
29114
|
+
|
|
29115
|
+
function date(a, b) {
|
|
29116
|
+
var d = new Date;
|
|
29117
|
+
return a = +a, b = +b, function(t) {
|
|
29118
|
+
return d.setTime(a * (1 - t) + b * t), d;
|
|
29119
|
+
};
|
|
29120
|
+
}
|
|
29121
|
+
|
|
29122
|
+
function number(a, b) {
|
|
29123
|
+
return a = +a, b = +b, function(t) {
|
|
29124
|
+
return a * (1 - t) + b * t;
|
|
29125
|
+
};
|
|
29126
|
+
}
|
|
29127
|
+
|
|
29128
|
+
function object(a, b) {
|
|
29129
|
+
var i = {},
|
|
29130
|
+
c = {},
|
|
29131
|
+
k;
|
|
29132
|
+
|
|
29133
|
+
if (a === null || typeof a !== "object") a = {};
|
|
29134
|
+
if (b === null || typeof b !== "object") b = {};
|
|
29135
|
+
|
|
29136
|
+
for (k in b) {
|
|
29137
|
+
if (k in a) {
|
|
29138
|
+
i[k] = d3_interpolate(a[k], b[k]);
|
|
29139
|
+
} else {
|
|
29140
|
+
c[k] = b[k];
|
|
29141
|
+
}
|
|
29142
|
+
}
|
|
29143
|
+
|
|
29144
|
+
return function(t) {
|
|
29145
|
+
for (k in i) c[k] = i[k](t);
|
|
29146
|
+
return c;
|
|
29147
|
+
};
|
|
29148
|
+
}
|
|
29149
|
+
|
|
29150
|
+
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
|
|
29151
|
+
reB = new RegExp(reA.source, "g");
|
|
29152
|
+
|
|
29153
|
+
function zero(b) {
|
|
29154
|
+
return function() {
|
|
29155
|
+
return b;
|
|
29156
|
+
};
|
|
29157
|
+
}
|
|
29158
|
+
|
|
29159
|
+
function one(b) {
|
|
29160
|
+
return function(t) {
|
|
29161
|
+
return b(t) + "";
|
|
29162
|
+
};
|
|
29163
|
+
}
|
|
29164
|
+
|
|
29165
|
+
function string(a, b) {
|
|
29166
|
+
var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
|
|
29167
|
+
am, // current match in a
|
|
29168
|
+
bm, // current match in b
|
|
29169
|
+
bs, // string preceding current number in b, if any
|
|
29170
|
+
i = -1, // index in s
|
|
29171
|
+
s = [], // string constants and placeholders
|
|
29172
|
+
q = []; // number interpolators
|
|
29173
|
+
|
|
29174
|
+
// Coerce inputs to strings.
|
|
29175
|
+
a = a + "", b = b + "";
|
|
29176
|
+
|
|
29177
|
+
// Interpolate pairs of numbers in a & b.
|
|
29178
|
+
while ((am = reA.exec(a))
|
|
29179
|
+
&& (bm = reB.exec(b))) {
|
|
29180
|
+
if ((bs = bm.index) > bi) { // a string precedes the next number in b
|
|
29181
|
+
bs = b.slice(bi, bs);
|
|
29182
|
+
if (s[i]) s[i] += bs; // coalesce with previous string
|
|
29183
|
+
else s[++i] = bs;
|
|
29184
|
+
}
|
|
29185
|
+
if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
|
|
29186
|
+
if (s[i]) s[i] += bm; // coalesce with previous string
|
|
29187
|
+
else s[++i] = bm;
|
|
29188
|
+
} else { // interpolate non-matching numbers
|
|
29189
|
+
s[++i] = null;
|
|
29190
|
+
q.push({i: i, x: number(am, bm)});
|
|
29191
|
+
}
|
|
29192
|
+
bi = reB.lastIndex;
|
|
29193
|
+
}
|
|
29194
|
+
|
|
29195
|
+
// Add remains of b.
|
|
29196
|
+
if (bi < b.length) {
|
|
29197
|
+
bs = b.slice(bi);
|
|
29198
|
+
if (s[i]) s[i] += bs; // coalesce with previous string
|
|
29199
|
+
else s[++i] = bs;
|
|
29200
|
+
}
|
|
29201
|
+
|
|
29202
|
+
// Special optimization for only a single match.
|
|
29203
|
+
// Otherwise, interpolate each of the numbers and rejoin the string.
|
|
29204
|
+
return s.length < 2 ? (q[0]
|
|
29205
|
+
? one(q[0].x)
|
|
29206
|
+
: zero(b))
|
|
29207
|
+
: (b = q.length, function(t) {
|
|
29208
|
+
for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
|
|
29209
|
+
return s.join("");
|
|
29210
|
+
});
|
|
29211
|
+
}
|
|
29212
|
+
|
|
29213
|
+
function d3_interpolate(a, b) {
|
|
29214
|
+
var t = typeof b, c;
|
|
29215
|
+
return b == null || t === "boolean" ? constant(b)
|
|
29216
|
+
: (t === "number" ? number
|
|
29217
|
+
: t === "string" ? ((c = color(b)) ? (b = c, rgb) : string)
|
|
29218
|
+
: b instanceof color ? rgb
|
|
29219
|
+
: b instanceof Date ? date
|
|
29220
|
+
: isNumberArray(b) ? numberArray
|
|
29221
|
+
: Array.isArray(b) ? genericArray
|
|
29222
|
+
: typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
|
|
29223
|
+
: number)(a, b);
|
|
29224
|
+
}
|
|
29225
|
+
|
|
29226
|
+
function discrete(range) {
|
|
29227
|
+
var n = range.length;
|
|
29228
|
+
return function(t) {
|
|
29229
|
+
return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];
|
|
29230
|
+
};
|
|
29231
|
+
}
|
|
29232
|
+
|
|
29233
|
+
function hue(a, b) {
|
|
29234
|
+
var i = hue$1(+a, +b);
|
|
29235
|
+
return function(t) {
|
|
29236
|
+
var x = i(t);
|
|
29237
|
+
return x - 360 * Math.floor(x / 360);
|
|
29238
|
+
};
|
|
29239
|
+
}
|
|
29240
|
+
|
|
29241
|
+
function round(a, b) {
|
|
29242
|
+
return a = +a, b = +b, function(t) {
|
|
29243
|
+
return Math.round(a * (1 - t) + b * t);
|
|
29244
|
+
};
|
|
29245
|
+
}
|
|
29246
|
+
|
|
29247
|
+
var degrees = 180 / Math.PI;
|
|
29248
|
+
|
|
29249
|
+
var identity = {
|
|
29250
|
+
translateX: 0,
|
|
29251
|
+
translateY: 0,
|
|
29252
|
+
rotate: 0,
|
|
29253
|
+
skewX: 0,
|
|
29254
|
+
scaleX: 1,
|
|
29255
|
+
scaleY: 1
|
|
29256
|
+
};
|
|
29257
|
+
|
|
29258
|
+
function decompose(a, b, c, d, e, f) {
|
|
29259
|
+
var scaleX, scaleY, skewX;
|
|
29260
|
+
if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
|
|
29261
|
+
if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
|
|
29262
|
+
if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
|
|
29263
|
+
if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
|
|
29264
|
+
return {
|
|
29265
|
+
translateX: e,
|
|
29266
|
+
translateY: f,
|
|
29267
|
+
rotate: Math.atan2(b, a) * degrees,
|
|
29268
|
+
skewX: Math.atan(skewX) * degrees,
|
|
29269
|
+
scaleX: scaleX,
|
|
29270
|
+
scaleY: scaleY
|
|
29271
|
+
};
|
|
29272
|
+
}
|
|
29273
|
+
|
|
29274
|
+
var svgNode;
|
|
29275
|
+
|
|
29276
|
+
/* eslint-disable no-undef */
|
|
29277
|
+
function parseCss(value) {
|
|
29278
|
+
const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
|
|
29279
|
+
return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
|
|
29280
|
+
}
|
|
29281
|
+
|
|
29282
|
+
function parseSvg(value) {
|
|
29283
|
+
if (value == null) return identity;
|
|
29284
|
+
if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
29285
|
+
svgNode.setAttribute("transform", value);
|
|
29286
|
+
if (!(value = svgNode.transform.baseVal.consolidate())) return identity;
|
|
29287
|
+
value = value.matrix;
|
|
29288
|
+
return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
|
|
29289
|
+
}
|
|
29290
|
+
|
|
29291
|
+
function interpolateTransform(parse, pxComma, pxParen, degParen) {
|
|
29292
|
+
|
|
29293
|
+
function pop(s) {
|
|
29294
|
+
return s.length ? s.pop() + " " : "";
|
|
29295
|
+
}
|
|
29296
|
+
|
|
29297
|
+
function translate(xa, ya, xb, yb, s, q) {
|
|
29298
|
+
if (xa !== xb || ya !== yb) {
|
|
29299
|
+
var i = s.push("translate(", null, pxComma, null, pxParen);
|
|
29300
|
+
q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});
|
|
29301
|
+
} else if (xb || yb) {
|
|
29302
|
+
s.push("translate(" + xb + pxComma + yb + pxParen);
|
|
29303
|
+
}
|
|
29304
|
+
}
|
|
29305
|
+
|
|
29306
|
+
function rotate(a, b, s, q) {
|
|
29307
|
+
if (a !== b) {
|
|
29308
|
+
if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path
|
|
29309
|
+
q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)});
|
|
29310
|
+
} else if (b) {
|
|
29311
|
+
s.push(pop(s) + "rotate(" + b + degParen);
|
|
29312
|
+
}
|
|
29313
|
+
}
|
|
29314
|
+
|
|
29315
|
+
function skewX(a, b, s, q) {
|
|
29316
|
+
if (a !== b) {
|
|
29317
|
+
q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)});
|
|
29318
|
+
} else if (b) {
|
|
29319
|
+
s.push(pop(s) + "skewX(" + b + degParen);
|
|
29320
|
+
}
|
|
29321
|
+
}
|
|
29322
|
+
|
|
29323
|
+
function scale(xa, ya, xb, yb, s, q) {
|
|
29324
|
+
if (xa !== xb || ya !== yb) {
|
|
29325
|
+
var i = s.push(pop(s) + "scale(", null, ",", null, ")");
|
|
29326
|
+
q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});
|
|
29327
|
+
} else if (xb !== 1 || yb !== 1) {
|
|
29328
|
+
s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
|
29329
|
+
}
|
|
29330
|
+
}
|
|
29331
|
+
|
|
29332
|
+
return function(a, b) {
|
|
29333
|
+
var s = [], // string constants and placeholders
|
|
29334
|
+
q = []; // number interpolators
|
|
29335
|
+
a = parse(a), b = parse(b);
|
|
29336
|
+
translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
|
|
29337
|
+
rotate(a.rotate, b.rotate, s, q);
|
|
29338
|
+
skewX(a.skewX, b.skewX, s, q);
|
|
29339
|
+
scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
|
|
29340
|
+
a = b = null; // gc
|
|
29341
|
+
return function(t) {
|
|
29342
|
+
var i = -1, n = q.length, o;
|
|
29343
|
+
while (++i < n) s[(o = q[i]).i] = o.x(t);
|
|
29344
|
+
return s.join("");
|
|
29345
|
+
};
|
|
29346
|
+
};
|
|
29347
|
+
}
|
|
29348
|
+
|
|
29349
|
+
var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
|
|
29350
|
+
var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
|
|
29351
|
+
|
|
29352
|
+
var epsilon2 = 1e-12;
|
|
29353
|
+
|
|
29354
|
+
function cosh(x) {
|
|
29355
|
+
return ((x = Math.exp(x)) + 1 / x) / 2;
|
|
29356
|
+
}
|
|
29357
|
+
|
|
29358
|
+
function sinh(x) {
|
|
29359
|
+
return ((x = Math.exp(x)) - 1 / x) / 2;
|
|
29360
|
+
}
|
|
29361
|
+
|
|
29362
|
+
function tanh(x) {
|
|
29363
|
+
return ((x = Math.exp(2 * x)) - 1) / (x + 1);
|
|
29364
|
+
}
|
|
29365
|
+
|
|
29366
|
+
var zoom = (function zoomRho(rho, rho2, rho4) {
|
|
29367
|
+
|
|
29368
|
+
// p0 = [ux0, uy0, w0]
|
|
29369
|
+
// p1 = [ux1, uy1, w1]
|
|
29370
|
+
function zoom(p0, p1) {
|
|
29371
|
+
var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],
|
|
29372
|
+
ux1 = p1[0], uy1 = p1[1], w1 = p1[2],
|
|
29373
|
+
dx = ux1 - ux0,
|
|
29374
|
+
dy = uy1 - uy0,
|
|
29375
|
+
d2 = dx * dx + dy * dy,
|
|
29376
|
+
i,
|
|
29377
|
+
S;
|
|
29378
|
+
|
|
29379
|
+
// Special case for u0 ≅ u1.
|
|
29380
|
+
if (d2 < epsilon2) {
|
|
29381
|
+
S = Math.log(w1 / w0) / rho;
|
|
29382
|
+
i = function(t) {
|
|
29383
|
+
return [
|
|
29384
|
+
ux0 + t * dx,
|
|
29385
|
+
uy0 + t * dy,
|
|
29386
|
+
w0 * Math.exp(rho * t * S)
|
|
29387
|
+
];
|
|
29388
|
+
};
|
|
29389
|
+
}
|
|
29390
|
+
|
|
29391
|
+
// General case.
|
|
29392
|
+
else {
|
|
29393
|
+
var d1 = Math.sqrt(d2),
|
|
29394
|
+
b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
|
|
29395
|
+
b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
|
|
29396
|
+
r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
|
|
29397
|
+
r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
|
29398
|
+
S = (r1 - r0) / rho;
|
|
29399
|
+
i = function(t) {
|
|
29400
|
+
var s = t * S,
|
|
29401
|
+
coshr0 = cosh(r0),
|
|
29402
|
+
u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
|
29403
|
+
return [
|
|
29404
|
+
ux0 + u * dx,
|
|
29405
|
+
uy0 + u * dy,
|
|
29406
|
+
w0 * coshr0 / cosh(rho * s + r0)
|
|
29407
|
+
];
|
|
29408
|
+
};
|
|
29409
|
+
}
|
|
29410
|
+
|
|
29411
|
+
i.duration = S * 1000 * rho / Math.SQRT2;
|
|
29412
|
+
|
|
29413
|
+
return i;
|
|
29414
|
+
}
|
|
29415
|
+
|
|
29416
|
+
zoom.rho = function(_) {
|
|
29417
|
+
var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;
|
|
29418
|
+
return zoomRho(_1, _2, _4);
|
|
29419
|
+
};
|
|
29420
|
+
|
|
29421
|
+
return zoom;
|
|
29422
|
+
})(Math.SQRT2, 2, 4);
|
|
29423
|
+
|
|
29424
|
+
function hsl(hue) {
|
|
29425
|
+
return function(start, end) {
|
|
29426
|
+
var h = hue((start = hsl$2(start)).h, (end = hsl$2(end)).h),
|
|
29427
|
+
s = nogamma(start.s, end.s),
|
|
29428
|
+
l = nogamma(start.l, end.l),
|
|
29429
|
+
opacity = nogamma(start.opacity, end.opacity);
|
|
29430
|
+
return function(t) {
|
|
29431
|
+
start.h = h(t);
|
|
29432
|
+
start.s = s(t);
|
|
29433
|
+
start.l = l(t);
|
|
29434
|
+
start.opacity = opacity(t);
|
|
29435
|
+
return start + "";
|
|
29436
|
+
};
|
|
29437
|
+
}
|
|
29438
|
+
}
|
|
29439
|
+
|
|
29440
|
+
var hsl$1 = hsl(hue$1);
|
|
29441
|
+
var hslLong = hsl(nogamma);
|
|
29442
|
+
|
|
29443
|
+
function lab(start, end) {
|
|
29444
|
+
var l = nogamma((start = lab$1(start)).l, (end = lab$1(end)).l),
|
|
29445
|
+
a = nogamma(start.a, end.a),
|
|
29446
|
+
b = nogamma(start.b, end.b),
|
|
29447
|
+
opacity = nogamma(start.opacity, end.opacity);
|
|
29448
|
+
return function(t) {
|
|
29449
|
+
start.l = l(t);
|
|
29450
|
+
start.a = a(t);
|
|
29451
|
+
start.b = b(t);
|
|
29452
|
+
start.opacity = opacity(t);
|
|
29453
|
+
return start + "";
|
|
29454
|
+
};
|
|
29455
|
+
}
|
|
29456
|
+
|
|
29457
|
+
function hcl(hue) {
|
|
29458
|
+
return function(start, end) {
|
|
29459
|
+
var h = hue((start = hcl$2(start)).h, (end = hcl$2(end)).h),
|
|
29460
|
+
c = nogamma(start.c, end.c),
|
|
29461
|
+
l = nogamma(start.l, end.l),
|
|
29462
|
+
opacity = nogamma(start.opacity, end.opacity);
|
|
29463
|
+
return function(t) {
|
|
29464
|
+
start.h = h(t);
|
|
29465
|
+
start.c = c(t);
|
|
29466
|
+
start.l = l(t);
|
|
29467
|
+
start.opacity = opacity(t);
|
|
29468
|
+
return start + "";
|
|
29469
|
+
};
|
|
29470
|
+
}
|
|
29471
|
+
}
|
|
29472
|
+
|
|
29473
|
+
var hcl$1 = hcl(hue$1);
|
|
29474
|
+
var hclLong = hcl(nogamma);
|
|
29475
|
+
|
|
29476
|
+
function cubehelix$1(hue) {
|
|
29477
|
+
return (function cubehelixGamma(y) {
|
|
29478
|
+
y = +y;
|
|
29479
|
+
|
|
29480
|
+
function cubehelix(start, end) {
|
|
29481
|
+
var h = hue((start = cubehelix$3(start)).h, (end = cubehelix$3(end)).h),
|
|
29482
|
+
s = nogamma(start.s, end.s),
|
|
29483
|
+
l = nogamma(start.l, end.l),
|
|
29484
|
+
opacity = nogamma(start.opacity, end.opacity);
|
|
29485
|
+
return function(t) {
|
|
29486
|
+
start.h = h(t);
|
|
29487
|
+
start.s = s(t);
|
|
29488
|
+
start.l = l(Math.pow(t, y));
|
|
29489
|
+
start.opacity = opacity(t);
|
|
29490
|
+
return start + "";
|
|
29491
|
+
};
|
|
29492
|
+
}
|
|
29493
|
+
|
|
29494
|
+
cubehelix.gamma = cubehelixGamma;
|
|
29495
|
+
|
|
29496
|
+
return cubehelix;
|
|
29497
|
+
})(1);
|
|
29498
|
+
}
|
|
29499
|
+
|
|
29500
|
+
var cubehelix$2 = cubehelix$1(hue$1);
|
|
29501
|
+
var cubehelixLong = cubehelix$1(nogamma);
|
|
29502
|
+
|
|
29503
|
+
function piecewise(interpolate, values) {
|
|
29504
|
+
if (values === undefined) values = interpolate, interpolate = d3_interpolate;
|
|
29505
|
+
var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);
|
|
29506
|
+
while (i < n) I[i] = interpolate(v, v = values[++i]);
|
|
29507
|
+
return function(t) {
|
|
29508
|
+
var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));
|
|
29509
|
+
return I[i](t - i);
|
|
29510
|
+
};
|
|
29511
|
+
}
|
|
29512
|
+
|
|
29513
|
+
function quantize(interpolator, n) {
|
|
29514
|
+
var samples = new Array(n);
|
|
29515
|
+
for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));
|
|
29516
|
+
return samples;
|
|
29517
|
+
}
|
|
29518
|
+
|
|
28343
29519
|
// TODO: support three or more stops
|
|
28344
29520
|
function getGradientFunction(stops) {
|
|
28345
29521
|
var min = stops[0] / 100,
|
|
@@ -28371,11 +29547,10 @@ ${svg}
|
|
|
28371
29547
|
|
|
28372
29548
|
// convert a continuous index ([0, n-1], -1) to a corresponding interpolated value
|
|
28373
29549
|
function getInterpolatedValueGetter(values, nullValue) {
|
|
28374
|
-
var d3 = require('d3-interpolate');
|
|
28375
29550
|
var interpolators = [];
|
|
28376
29551
|
var tmax = values.length - 1;
|
|
28377
29552
|
for (var i=1; i<values.length; i++) {
|
|
28378
|
-
interpolators.push(
|
|
29553
|
+
interpolators.push(d3_interpolate(values[i-1], values[i]));
|
|
28379
29554
|
}
|
|
28380
29555
|
return function(t) {
|
|
28381
29556
|
if (t == -1) return nullValue;
|
|
@@ -28393,7 +29568,6 @@ ${svg}
|
|
|
28393
29568
|
// (colors and numbers should work)
|
|
28394
29569
|
function interpolateValuesToClasses(values, n, stops) {
|
|
28395
29570
|
if (values.length == n && !stops) return values;
|
|
28396
|
-
var d3 = require('d3-interpolate');
|
|
28397
29571
|
var numPairs = values.length - 1;
|
|
28398
29572
|
var output = [values[0]];
|
|
28399
29573
|
var k, j, t, intVal;
|
|
@@ -28402,7 +29576,7 @@ ${svg}
|
|
|
28402
29576
|
j = Math.floor(k);
|
|
28403
29577
|
t = k - j;
|
|
28404
29578
|
// if (convert) t = convert(t);
|
|
28405
|
-
intVal =
|
|
29579
|
+
intVal = d3_interpolate(values[j], values[j+1])(t);
|
|
28406
29580
|
output.push(intVal);
|
|
28407
29581
|
}
|
|
28408
29582
|
output.push(values[values.length - 1]);
|
|
@@ -29343,6 +30517,518 @@ ${svg}
|
|
|
29343
30517
|
return maxId + 1;
|
|
29344
30518
|
}
|
|
29345
30519
|
|
|
30520
|
+
function colors(specifier) {
|
|
30521
|
+
var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;
|
|
30522
|
+
while (i < n) colors[i] = "#" + specifier.slice(i * 6, ++i * 6);
|
|
30523
|
+
return colors;
|
|
30524
|
+
}
|
|
30525
|
+
|
|
30526
|
+
var category10 = colors("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");
|
|
30527
|
+
|
|
30528
|
+
var Accent = colors("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");
|
|
30529
|
+
|
|
30530
|
+
var Dark2 = colors("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");
|
|
30531
|
+
|
|
30532
|
+
var Paired = colors("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");
|
|
30533
|
+
|
|
30534
|
+
var Pastel1 = colors("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");
|
|
30535
|
+
|
|
30536
|
+
var Pastel2 = colors("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");
|
|
30537
|
+
|
|
30538
|
+
var Set1 = colors("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");
|
|
30539
|
+
|
|
30540
|
+
var Set2 = colors("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");
|
|
30541
|
+
|
|
30542
|
+
var Set3 = colors("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");
|
|
30543
|
+
|
|
30544
|
+
var Tableau10 = colors("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
|
|
30545
|
+
|
|
30546
|
+
var ramp$1 = scheme => rgbBasis(scheme[scheme.length - 1]);
|
|
30547
|
+
|
|
30548
|
+
var scheme$q = new Array(3).concat(
|
|
30549
|
+
"d8b365f5f5f55ab4ac",
|
|
30550
|
+
"a6611adfc27d80cdc1018571",
|
|
30551
|
+
"a6611adfc27df5f5f580cdc1018571",
|
|
30552
|
+
"8c510ad8b365f6e8c3c7eae55ab4ac01665e",
|
|
30553
|
+
"8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e",
|
|
30554
|
+
"8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e",
|
|
30555
|
+
"8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e",
|
|
30556
|
+
"5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30",
|
|
30557
|
+
"5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30"
|
|
30558
|
+
).map(colors);
|
|
30559
|
+
|
|
30560
|
+
var BrBG = ramp$1(scheme$q);
|
|
30561
|
+
|
|
30562
|
+
var scheme$p = new Array(3).concat(
|
|
30563
|
+
"af8dc3f7f7f77fbf7b",
|
|
30564
|
+
"7b3294c2a5cfa6dba0008837",
|
|
30565
|
+
"7b3294c2a5cff7f7f7a6dba0008837",
|
|
30566
|
+
"762a83af8dc3e7d4e8d9f0d37fbf7b1b7837",
|
|
30567
|
+
"762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837",
|
|
30568
|
+
"762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837",
|
|
30569
|
+
"762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837",
|
|
30570
|
+
"40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b",
|
|
30571
|
+
"40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b"
|
|
30572
|
+
).map(colors);
|
|
30573
|
+
|
|
30574
|
+
var PRGn = ramp$1(scheme$p);
|
|
30575
|
+
|
|
30576
|
+
var scheme$o = new Array(3).concat(
|
|
30577
|
+
"e9a3c9f7f7f7a1d76a",
|
|
30578
|
+
"d01c8bf1b6dab8e1864dac26",
|
|
30579
|
+
"d01c8bf1b6daf7f7f7b8e1864dac26",
|
|
30580
|
+
"c51b7de9a3c9fde0efe6f5d0a1d76a4d9221",
|
|
30581
|
+
"c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221",
|
|
30582
|
+
"c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221",
|
|
30583
|
+
"c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221",
|
|
30584
|
+
"8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419",
|
|
30585
|
+
"8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419"
|
|
30586
|
+
).map(colors);
|
|
30587
|
+
|
|
30588
|
+
var PiYG = ramp$1(scheme$o);
|
|
30589
|
+
|
|
30590
|
+
var scheme$n = new Array(3).concat(
|
|
30591
|
+
"998ec3f7f7f7f1a340",
|
|
30592
|
+
"5e3c99b2abd2fdb863e66101",
|
|
30593
|
+
"5e3c99b2abd2f7f7f7fdb863e66101",
|
|
30594
|
+
"542788998ec3d8daebfee0b6f1a340b35806",
|
|
30595
|
+
"542788998ec3d8daebf7f7f7fee0b6f1a340b35806",
|
|
30596
|
+
"5427888073acb2abd2d8daebfee0b6fdb863e08214b35806",
|
|
30597
|
+
"5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806",
|
|
30598
|
+
"2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08",
|
|
30599
|
+
"2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08"
|
|
30600
|
+
).map(colors);
|
|
30601
|
+
|
|
30602
|
+
var PuOr = ramp$1(scheme$n);
|
|
30603
|
+
|
|
30604
|
+
var scheme$m = new Array(3).concat(
|
|
30605
|
+
"ef8a62f7f7f767a9cf",
|
|
30606
|
+
"ca0020f4a58292c5de0571b0",
|
|
30607
|
+
"ca0020f4a582f7f7f792c5de0571b0",
|
|
30608
|
+
"b2182bef8a62fddbc7d1e5f067a9cf2166ac",
|
|
30609
|
+
"b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac",
|
|
30610
|
+
"b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac",
|
|
30611
|
+
"b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac",
|
|
30612
|
+
"67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061",
|
|
30613
|
+
"67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061"
|
|
30614
|
+
).map(colors);
|
|
30615
|
+
|
|
30616
|
+
var RdBu = ramp$1(scheme$m);
|
|
30617
|
+
|
|
30618
|
+
var scheme$l = new Array(3).concat(
|
|
30619
|
+
"ef8a62ffffff999999",
|
|
30620
|
+
"ca0020f4a582bababa404040",
|
|
30621
|
+
"ca0020f4a582ffffffbababa404040",
|
|
30622
|
+
"b2182bef8a62fddbc7e0e0e09999994d4d4d",
|
|
30623
|
+
"b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d",
|
|
30624
|
+
"b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d",
|
|
30625
|
+
"b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d",
|
|
30626
|
+
"67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a",
|
|
30627
|
+
"67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a"
|
|
30628
|
+
).map(colors);
|
|
30629
|
+
|
|
30630
|
+
var RdGy = ramp$1(scheme$l);
|
|
30631
|
+
|
|
30632
|
+
var scheme$k = new Array(3).concat(
|
|
30633
|
+
"fc8d59ffffbf91bfdb",
|
|
30634
|
+
"d7191cfdae61abd9e92c7bb6",
|
|
30635
|
+
"d7191cfdae61ffffbfabd9e92c7bb6",
|
|
30636
|
+
"d73027fc8d59fee090e0f3f891bfdb4575b4",
|
|
30637
|
+
"d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4",
|
|
30638
|
+
"d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4",
|
|
30639
|
+
"d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4",
|
|
30640
|
+
"a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695",
|
|
30641
|
+
"a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695"
|
|
30642
|
+
).map(colors);
|
|
30643
|
+
|
|
30644
|
+
var RdYlBu = ramp$1(scheme$k);
|
|
30645
|
+
|
|
30646
|
+
var scheme$j = new Array(3).concat(
|
|
30647
|
+
"fc8d59ffffbf91cf60",
|
|
30648
|
+
"d7191cfdae61a6d96a1a9641",
|
|
30649
|
+
"d7191cfdae61ffffbfa6d96a1a9641",
|
|
30650
|
+
"d73027fc8d59fee08bd9ef8b91cf601a9850",
|
|
30651
|
+
"d73027fc8d59fee08bffffbfd9ef8b91cf601a9850",
|
|
30652
|
+
"d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850",
|
|
30653
|
+
"d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850",
|
|
30654
|
+
"a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837",
|
|
30655
|
+
"a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837"
|
|
30656
|
+
).map(colors);
|
|
30657
|
+
|
|
30658
|
+
var RdYlGn = ramp$1(scheme$j);
|
|
30659
|
+
|
|
30660
|
+
var scheme$i = new Array(3).concat(
|
|
30661
|
+
"fc8d59ffffbf99d594",
|
|
30662
|
+
"d7191cfdae61abdda42b83ba",
|
|
30663
|
+
"d7191cfdae61ffffbfabdda42b83ba",
|
|
30664
|
+
"d53e4ffc8d59fee08be6f59899d5943288bd",
|
|
30665
|
+
"d53e4ffc8d59fee08bffffbfe6f59899d5943288bd",
|
|
30666
|
+
"d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd",
|
|
30667
|
+
"d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd",
|
|
30668
|
+
"9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2",
|
|
30669
|
+
"9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2"
|
|
30670
|
+
).map(colors);
|
|
30671
|
+
|
|
30672
|
+
var Spectral = ramp$1(scheme$i);
|
|
30673
|
+
|
|
30674
|
+
var scheme$h = new Array(3).concat(
|
|
30675
|
+
"e5f5f999d8c92ca25f",
|
|
30676
|
+
"edf8fbb2e2e266c2a4238b45",
|
|
30677
|
+
"edf8fbb2e2e266c2a42ca25f006d2c",
|
|
30678
|
+
"edf8fbccece699d8c966c2a42ca25f006d2c",
|
|
30679
|
+
"edf8fbccece699d8c966c2a441ae76238b45005824",
|
|
30680
|
+
"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824",
|
|
30681
|
+
"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b"
|
|
30682
|
+
).map(colors);
|
|
30683
|
+
|
|
30684
|
+
var BuGn = ramp$1(scheme$h);
|
|
30685
|
+
|
|
30686
|
+
var scheme$g = new Array(3).concat(
|
|
30687
|
+
"e0ecf49ebcda8856a7",
|
|
30688
|
+
"edf8fbb3cde38c96c688419d",
|
|
30689
|
+
"edf8fbb3cde38c96c68856a7810f7c",
|
|
30690
|
+
"edf8fbbfd3e69ebcda8c96c68856a7810f7c",
|
|
30691
|
+
"edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b",
|
|
30692
|
+
"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b",
|
|
30693
|
+
"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b"
|
|
30694
|
+
).map(colors);
|
|
30695
|
+
|
|
30696
|
+
var BuPu = ramp$1(scheme$g);
|
|
30697
|
+
|
|
30698
|
+
var scheme$f = new Array(3).concat(
|
|
30699
|
+
"e0f3dba8ddb543a2ca",
|
|
30700
|
+
"f0f9e8bae4bc7bccc42b8cbe",
|
|
30701
|
+
"f0f9e8bae4bc7bccc443a2ca0868ac",
|
|
30702
|
+
"f0f9e8ccebc5a8ddb57bccc443a2ca0868ac",
|
|
30703
|
+
"f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e",
|
|
30704
|
+
"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e",
|
|
30705
|
+
"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081"
|
|
30706
|
+
).map(colors);
|
|
30707
|
+
|
|
30708
|
+
var GnBu = ramp$1(scheme$f);
|
|
30709
|
+
|
|
30710
|
+
var scheme$e = new Array(3).concat(
|
|
30711
|
+
"fee8c8fdbb84e34a33",
|
|
30712
|
+
"fef0d9fdcc8afc8d59d7301f",
|
|
30713
|
+
"fef0d9fdcc8afc8d59e34a33b30000",
|
|
30714
|
+
"fef0d9fdd49efdbb84fc8d59e34a33b30000",
|
|
30715
|
+
"fef0d9fdd49efdbb84fc8d59ef6548d7301f990000",
|
|
30716
|
+
"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000",
|
|
30717
|
+
"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000"
|
|
30718
|
+
).map(colors);
|
|
30719
|
+
|
|
30720
|
+
var OrRd = ramp$1(scheme$e);
|
|
30721
|
+
|
|
30722
|
+
var scheme$d = new Array(3).concat(
|
|
30723
|
+
"ece2f0a6bddb1c9099",
|
|
30724
|
+
"f6eff7bdc9e167a9cf02818a",
|
|
30725
|
+
"f6eff7bdc9e167a9cf1c9099016c59",
|
|
30726
|
+
"f6eff7d0d1e6a6bddb67a9cf1c9099016c59",
|
|
30727
|
+
"f6eff7d0d1e6a6bddb67a9cf3690c002818a016450",
|
|
30728
|
+
"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450",
|
|
30729
|
+
"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636"
|
|
30730
|
+
).map(colors);
|
|
30731
|
+
|
|
30732
|
+
var PuBuGn = ramp$1(scheme$d);
|
|
30733
|
+
|
|
30734
|
+
var scheme$c = new Array(3).concat(
|
|
30735
|
+
"ece7f2a6bddb2b8cbe",
|
|
30736
|
+
"f1eef6bdc9e174a9cf0570b0",
|
|
30737
|
+
"f1eef6bdc9e174a9cf2b8cbe045a8d",
|
|
30738
|
+
"f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d",
|
|
30739
|
+
"f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b",
|
|
30740
|
+
"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b",
|
|
30741
|
+
"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858"
|
|
30742
|
+
).map(colors);
|
|
30743
|
+
|
|
30744
|
+
var PuBu = ramp$1(scheme$c);
|
|
30745
|
+
|
|
30746
|
+
var scheme$b = new Array(3).concat(
|
|
30747
|
+
"e7e1efc994c7dd1c77",
|
|
30748
|
+
"f1eef6d7b5d8df65b0ce1256",
|
|
30749
|
+
"f1eef6d7b5d8df65b0dd1c77980043",
|
|
30750
|
+
"f1eef6d4b9dac994c7df65b0dd1c77980043",
|
|
30751
|
+
"f1eef6d4b9dac994c7df65b0e7298ace125691003f",
|
|
30752
|
+
"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f",
|
|
30753
|
+
"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f"
|
|
30754
|
+
).map(colors);
|
|
30755
|
+
|
|
30756
|
+
var PuRd = ramp$1(scheme$b);
|
|
30757
|
+
|
|
30758
|
+
var scheme$a = new Array(3).concat(
|
|
30759
|
+
"fde0ddfa9fb5c51b8a",
|
|
30760
|
+
"feebe2fbb4b9f768a1ae017e",
|
|
30761
|
+
"feebe2fbb4b9f768a1c51b8a7a0177",
|
|
30762
|
+
"feebe2fcc5c0fa9fb5f768a1c51b8a7a0177",
|
|
30763
|
+
"feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177",
|
|
30764
|
+
"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177",
|
|
30765
|
+
"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a"
|
|
30766
|
+
).map(colors);
|
|
30767
|
+
|
|
30768
|
+
var RdPu = ramp$1(scheme$a);
|
|
30769
|
+
|
|
30770
|
+
var scheme$9 = new Array(3).concat(
|
|
30771
|
+
"edf8b17fcdbb2c7fb8",
|
|
30772
|
+
"ffffcca1dab441b6c4225ea8",
|
|
30773
|
+
"ffffcca1dab441b6c42c7fb8253494",
|
|
30774
|
+
"ffffccc7e9b47fcdbb41b6c42c7fb8253494",
|
|
30775
|
+
"ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84",
|
|
30776
|
+
"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84",
|
|
30777
|
+
"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58"
|
|
30778
|
+
).map(colors);
|
|
30779
|
+
|
|
30780
|
+
var YlGnBu = ramp$1(scheme$9);
|
|
30781
|
+
|
|
30782
|
+
var scheme$8 = new Array(3).concat(
|
|
30783
|
+
"f7fcb9addd8e31a354",
|
|
30784
|
+
"ffffccc2e69978c679238443",
|
|
30785
|
+
"ffffccc2e69978c67931a354006837",
|
|
30786
|
+
"ffffccd9f0a3addd8e78c67931a354006837",
|
|
30787
|
+
"ffffccd9f0a3addd8e78c67941ab5d238443005a32",
|
|
30788
|
+
"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32",
|
|
30789
|
+
"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529"
|
|
30790
|
+
).map(colors);
|
|
30791
|
+
|
|
30792
|
+
var YlGn = ramp$1(scheme$8);
|
|
30793
|
+
|
|
30794
|
+
var scheme$7 = new Array(3).concat(
|
|
30795
|
+
"fff7bcfec44fd95f0e",
|
|
30796
|
+
"ffffd4fed98efe9929cc4c02",
|
|
30797
|
+
"ffffd4fed98efe9929d95f0e993404",
|
|
30798
|
+
"ffffd4fee391fec44ffe9929d95f0e993404",
|
|
30799
|
+
"ffffd4fee391fec44ffe9929ec7014cc4c028c2d04",
|
|
30800
|
+
"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04",
|
|
30801
|
+
"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506"
|
|
30802
|
+
).map(colors);
|
|
30803
|
+
|
|
30804
|
+
var YlOrBr = ramp$1(scheme$7);
|
|
30805
|
+
|
|
30806
|
+
var scheme$6 = new Array(3).concat(
|
|
30807
|
+
"ffeda0feb24cf03b20",
|
|
30808
|
+
"ffffb2fecc5cfd8d3ce31a1c",
|
|
30809
|
+
"ffffb2fecc5cfd8d3cf03b20bd0026",
|
|
30810
|
+
"ffffb2fed976feb24cfd8d3cf03b20bd0026",
|
|
30811
|
+
"ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026",
|
|
30812
|
+
"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026",
|
|
30813
|
+
"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026"
|
|
30814
|
+
).map(colors);
|
|
30815
|
+
|
|
30816
|
+
var YlOrRd = ramp$1(scheme$6);
|
|
30817
|
+
|
|
30818
|
+
var scheme$5 = new Array(3).concat(
|
|
30819
|
+
"deebf79ecae13182bd",
|
|
30820
|
+
"eff3ffbdd7e76baed62171b5",
|
|
30821
|
+
"eff3ffbdd7e76baed63182bd08519c",
|
|
30822
|
+
"eff3ffc6dbef9ecae16baed63182bd08519c",
|
|
30823
|
+
"eff3ffc6dbef9ecae16baed64292c62171b5084594",
|
|
30824
|
+
"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594",
|
|
30825
|
+
"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b"
|
|
30826
|
+
).map(colors);
|
|
30827
|
+
|
|
30828
|
+
var Blues = ramp$1(scheme$5);
|
|
30829
|
+
|
|
30830
|
+
var scheme$4 = new Array(3).concat(
|
|
30831
|
+
"e5f5e0a1d99b31a354",
|
|
30832
|
+
"edf8e9bae4b374c476238b45",
|
|
30833
|
+
"edf8e9bae4b374c47631a354006d2c",
|
|
30834
|
+
"edf8e9c7e9c0a1d99b74c47631a354006d2c",
|
|
30835
|
+
"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32",
|
|
30836
|
+
"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32",
|
|
30837
|
+
"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b"
|
|
30838
|
+
).map(colors);
|
|
30839
|
+
|
|
30840
|
+
var Greens = ramp$1(scheme$4);
|
|
30841
|
+
|
|
30842
|
+
var scheme$3 = new Array(3).concat(
|
|
30843
|
+
"f0f0f0bdbdbd636363",
|
|
30844
|
+
"f7f7f7cccccc969696525252",
|
|
30845
|
+
"f7f7f7cccccc969696636363252525",
|
|
30846
|
+
"f7f7f7d9d9d9bdbdbd969696636363252525",
|
|
30847
|
+
"f7f7f7d9d9d9bdbdbd969696737373525252252525",
|
|
30848
|
+
"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525",
|
|
30849
|
+
"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000"
|
|
30850
|
+
).map(colors);
|
|
30851
|
+
|
|
30852
|
+
var Greys = ramp$1(scheme$3);
|
|
30853
|
+
|
|
30854
|
+
var scheme$2 = new Array(3).concat(
|
|
30855
|
+
"efedf5bcbddc756bb1",
|
|
30856
|
+
"f2f0f7cbc9e29e9ac86a51a3",
|
|
30857
|
+
"f2f0f7cbc9e29e9ac8756bb154278f",
|
|
30858
|
+
"f2f0f7dadaebbcbddc9e9ac8756bb154278f",
|
|
30859
|
+
"f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486",
|
|
30860
|
+
"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486",
|
|
30861
|
+
"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d"
|
|
30862
|
+
).map(colors);
|
|
30863
|
+
|
|
30864
|
+
var Purples = ramp$1(scheme$2);
|
|
30865
|
+
|
|
30866
|
+
var scheme$1 = new Array(3).concat(
|
|
30867
|
+
"fee0d2fc9272de2d26",
|
|
30868
|
+
"fee5d9fcae91fb6a4acb181d",
|
|
30869
|
+
"fee5d9fcae91fb6a4ade2d26a50f15",
|
|
30870
|
+
"fee5d9fcbba1fc9272fb6a4ade2d26a50f15",
|
|
30871
|
+
"fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d",
|
|
30872
|
+
"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d",
|
|
30873
|
+
"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d"
|
|
30874
|
+
).map(colors);
|
|
30875
|
+
|
|
30876
|
+
var Reds = ramp$1(scheme$1);
|
|
30877
|
+
|
|
30878
|
+
var scheme = new Array(3).concat(
|
|
30879
|
+
"fee6cefdae6be6550d",
|
|
30880
|
+
"feeddefdbe85fd8d3cd94701",
|
|
30881
|
+
"feeddefdbe85fd8d3ce6550da63603",
|
|
30882
|
+
"feeddefdd0a2fdae6bfd8d3ce6550da63603",
|
|
30883
|
+
"feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04",
|
|
30884
|
+
"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04",
|
|
30885
|
+
"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704"
|
|
30886
|
+
).map(colors);
|
|
30887
|
+
|
|
30888
|
+
var Oranges = ramp$1(scheme);
|
|
30889
|
+
|
|
30890
|
+
function cividis(t) {
|
|
30891
|
+
t = Math.max(0, Math.min(1, t));
|
|
30892
|
+
return "rgb("
|
|
30893
|
+
+ Math.max(0, Math.min(255, Math.round(-4.54 - t * (35.34 - t * (2381.73 - t * (6402.7 - t * (7024.72 - t * 2710.57))))))) + ", "
|
|
30894
|
+
+ Math.max(0, Math.min(255, Math.round(32.49 + t * (170.73 + t * (52.82 - t * (131.46 - t * (176.58 - t * 67.37))))))) + ", "
|
|
30895
|
+
+ Math.max(0, Math.min(255, Math.round(81.24 + t * (442.36 - t * (2482.43 - t * (6167.24 - t * (6614.94 - t * 2475.67)))))))
|
|
30896
|
+
+ ")";
|
|
30897
|
+
}
|
|
30898
|
+
|
|
30899
|
+
var cubehelix = cubehelixLong(cubehelix$3(300, 0.5, 0.0), cubehelix$3(-240, 0.5, 1.0));
|
|
30900
|
+
|
|
30901
|
+
var warm = cubehelixLong(cubehelix$3(-100, 0.75, 0.35), cubehelix$3(80, 1.50, 0.8));
|
|
30902
|
+
|
|
30903
|
+
var cool = cubehelixLong(cubehelix$3(260, 0.75, 0.35), cubehelix$3(80, 1.50, 0.8));
|
|
30904
|
+
|
|
30905
|
+
var c$1 = cubehelix$3();
|
|
30906
|
+
|
|
30907
|
+
function rainbow(t) {
|
|
30908
|
+
if (t < 0 || t > 1) t -= Math.floor(t);
|
|
30909
|
+
var ts = Math.abs(t - 0.5);
|
|
30910
|
+
c$1.h = 360 * t - 100;
|
|
30911
|
+
c$1.s = 1.5 - 1.5 * ts;
|
|
30912
|
+
c$1.l = 0.8 - 0.9 * ts;
|
|
30913
|
+
return c$1 + "";
|
|
30914
|
+
}
|
|
30915
|
+
|
|
30916
|
+
var c = rgb$1(),
|
|
30917
|
+
pi_1_3 = Math.PI / 3,
|
|
30918
|
+
pi_2_3 = Math.PI * 2 / 3;
|
|
30919
|
+
|
|
30920
|
+
function sinebow(t) {
|
|
30921
|
+
var x;
|
|
30922
|
+
t = (0.5 - t) * Math.PI;
|
|
30923
|
+
c.r = 255 * (x = Math.sin(t)) * x;
|
|
30924
|
+
c.g = 255 * (x = Math.sin(t + pi_1_3)) * x;
|
|
30925
|
+
c.b = 255 * (x = Math.sin(t + pi_2_3)) * x;
|
|
30926
|
+
return c + "";
|
|
30927
|
+
}
|
|
30928
|
+
|
|
30929
|
+
function turbo(t) {
|
|
30930
|
+
t = Math.max(0, Math.min(1, t));
|
|
30931
|
+
return "rgb("
|
|
30932
|
+
+ Math.max(0, Math.min(255, Math.round(34.61 + t * (1172.33 - t * (10793.56 - t * (33300.12 - t * (38394.49 - t * 14825.05))))))) + ", "
|
|
30933
|
+
+ Math.max(0, Math.min(255, Math.round(23.31 + t * (557.33 + t * (1225.33 - t * (3574.96 - t * (1073.77 + t * 707.56))))))) + ", "
|
|
30934
|
+
+ Math.max(0, Math.min(255, Math.round(27.2 + t * (3211.1 - t * (15327.97 - t * (27814 - t * (22569.18 - t * 6838.66)))))))
|
|
30935
|
+
+ ")";
|
|
30936
|
+
}
|
|
30937
|
+
|
|
30938
|
+
function ramp(range) {
|
|
30939
|
+
var n = range.length;
|
|
30940
|
+
return function(t) {
|
|
30941
|
+
return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];
|
|
30942
|
+
};
|
|
30943
|
+
}
|
|
30944
|
+
|
|
30945
|
+
var viridis = ramp(colors("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));
|
|
30946
|
+
|
|
30947
|
+
var magma = ramp(colors("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));
|
|
30948
|
+
|
|
30949
|
+
var inferno = ramp(colors("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));
|
|
30950
|
+
|
|
30951
|
+
var plasma = ramp(colors("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));
|
|
30952
|
+
|
|
30953
|
+
var lib = /*#__PURE__*/Object.freeze({
|
|
30954
|
+
__proto__: null,
|
|
30955
|
+
schemeCategory10: category10,
|
|
30956
|
+
schemeAccent: Accent,
|
|
30957
|
+
schemeDark2: Dark2,
|
|
30958
|
+
schemePaired: Paired,
|
|
30959
|
+
schemePastel1: Pastel1,
|
|
30960
|
+
schemePastel2: Pastel2,
|
|
30961
|
+
schemeSet1: Set1,
|
|
30962
|
+
schemeSet2: Set2,
|
|
30963
|
+
schemeSet3: Set3,
|
|
30964
|
+
schemeTableau10: Tableau10,
|
|
30965
|
+
interpolateBrBG: BrBG,
|
|
30966
|
+
schemeBrBG: scheme$q,
|
|
30967
|
+
interpolatePRGn: PRGn,
|
|
30968
|
+
schemePRGn: scheme$p,
|
|
30969
|
+
interpolatePiYG: PiYG,
|
|
30970
|
+
schemePiYG: scheme$o,
|
|
30971
|
+
interpolatePuOr: PuOr,
|
|
30972
|
+
schemePuOr: scheme$n,
|
|
30973
|
+
interpolateRdBu: RdBu,
|
|
30974
|
+
schemeRdBu: scheme$m,
|
|
30975
|
+
interpolateRdGy: RdGy,
|
|
30976
|
+
schemeRdGy: scheme$l,
|
|
30977
|
+
interpolateRdYlBu: RdYlBu,
|
|
30978
|
+
schemeRdYlBu: scheme$k,
|
|
30979
|
+
interpolateRdYlGn: RdYlGn,
|
|
30980
|
+
schemeRdYlGn: scheme$j,
|
|
30981
|
+
interpolateSpectral: Spectral,
|
|
30982
|
+
schemeSpectral: scheme$i,
|
|
30983
|
+
interpolateBuGn: BuGn,
|
|
30984
|
+
schemeBuGn: scheme$h,
|
|
30985
|
+
interpolateBuPu: BuPu,
|
|
30986
|
+
schemeBuPu: scheme$g,
|
|
30987
|
+
interpolateGnBu: GnBu,
|
|
30988
|
+
schemeGnBu: scheme$f,
|
|
30989
|
+
interpolateOrRd: OrRd,
|
|
30990
|
+
schemeOrRd: scheme$e,
|
|
30991
|
+
interpolatePuBuGn: PuBuGn,
|
|
30992
|
+
schemePuBuGn: scheme$d,
|
|
30993
|
+
interpolatePuBu: PuBu,
|
|
30994
|
+
schemePuBu: scheme$c,
|
|
30995
|
+
interpolatePuRd: PuRd,
|
|
30996
|
+
schemePuRd: scheme$b,
|
|
30997
|
+
interpolateRdPu: RdPu,
|
|
30998
|
+
schemeRdPu: scheme$a,
|
|
30999
|
+
interpolateYlGnBu: YlGnBu,
|
|
31000
|
+
schemeYlGnBu: scheme$9,
|
|
31001
|
+
interpolateYlGn: YlGn,
|
|
31002
|
+
schemeYlGn: scheme$8,
|
|
31003
|
+
interpolateYlOrBr: YlOrBr,
|
|
31004
|
+
schemeYlOrBr: scheme$7,
|
|
31005
|
+
interpolateYlOrRd: YlOrRd,
|
|
31006
|
+
schemeYlOrRd: scheme$6,
|
|
31007
|
+
interpolateBlues: Blues,
|
|
31008
|
+
schemeBlues: scheme$5,
|
|
31009
|
+
interpolateGreens: Greens,
|
|
31010
|
+
schemeGreens: scheme$4,
|
|
31011
|
+
interpolateGreys: Greys,
|
|
31012
|
+
schemeGreys: scheme$3,
|
|
31013
|
+
interpolatePurples: Purples,
|
|
31014
|
+
schemePurples: scheme$2,
|
|
31015
|
+
interpolateReds: Reds,
|
|
31016
|
+
schemeReds: scheme$1,
|
|
31017
|
+
interpolateOranges: Oranges,
|
|
31018
|
+
schemeOranges: scheme,
|
|
31019
|
+
interpolateCividis: cividis,
|
|
31020
|
+
interpolateCubehelixDefault: cubehelix,
|
|
31021
|
+
interpolateRainbow: rainbow,
|
|
31022
|
+
interpolateWarm: warm,
|
|
31023
|
+
interpolateCool: cool,
|
|
31024
|
+
interpolateSinebow: sinebow,
|
|
31025
|
+
interpolateTurbo: turbo,
|
|
31026
|
+
interpolateViridis: viridis,
|
|
31027
|
+
interpolateMagma: magma,
|
|
31028
|
+
interpolateInferno: inferno,
|
|
31029
|
+
interpolatePlasma: plasma
|
|
31030
|
+
});
|
|
31031
|
+
|
|
29346
31032
|
var index = {
|
|
29347
31033
|
categorical: [],
|
|
29348
31034
|
sequential: [],
|
|
@@ -29492,7 +31178,7 @@ ${svg}
|
|
|
29492
31178
|
function getColorRamp(name, n, stops) {
|
|
29493
31179
|
initSchemes();
|
|
29494
31180
|
name = standardName(name);
|
|
29495
|
-
var lib = require('d3-scale-chromatic');
|
|
31181
|
+
// var lib = require('d3-scale-chromatic');
|
|
29496
31182
|
var ramps = lib['scheme' + name];
|
|
29497
31183
|
var interpolate = lib['interpolate' + name];
|
|
29498
31184
|
var ramp;
|
|
@@ -29801,9 +31487,8 @@ ${svg}
|
|
|
29801
31487
|
}
|
|
29802
31488
|
|
|
29803
31489
|
function formatColorsAsHex(colors) {
|
|
29804
|
-
var d3 = require('d3-color');
|
|
29805
31490
|
return colors.map(function(col) {
|
|
29806
|
-
var o =
|
|
31491
|
+
var o = color(col);
|
|
29807
31492
|
if (!o) stop('Unable to parse color:', col);
|
|
29808
31493
|
return o.formatHex();
|
|
29809
31494
|
});
|
|
@@ -30465,6 +32150,9 @@ ${svg}
|
|
|
30465
32150
|
targetDataset.arcs = mergedDataset.arcs;
|
|
30466
32151
|
// dissolve clip layer shapes (to remove overlaps and other topological issues
|
|
30467
32152
|
// that might confuse the clipping function)
|
|
32153
|
+
// use a data-free copy of the clip lyr, so data records are not dissolved
|
|
32154
|
+
// (this avoids triggering an unnecessary and expensive DBF read operation in some cases).
|
|
32155
|
+
clipLyr = utils.defaults({data: null}, clipLyr);
|
|
30468
32156
|
clipLyr = dissolvePolygonLayer2(clipLyr, mergedDataset, {quiet: true, silent: true});
|
|
30469
32157
|
|
|
30470
32158
|
} else {
|
|
@@ -30866,6 +32554,8 @@ ${svg}
|
|
|
30866
32554
|
getColorizerFunction: getColorizerFunction
|
|
30867
32555
|
});
|
|
30868
32556
|
|
|
32557
|
+
cmd.comment = function() {}; // no-op, so -comment doesn't trigger a parsing error
|
|
32558
|
+
|
|
30869
32559
|
function expressionUsesGeoJSON(exp) {
|
|
30870
32560
|
return exp.includes('this.geojson');
|
|
30871
32561
|
}
|
|
@@ -32612,10 +34302,10 @@ ${svg}
|
|
|
32612
34302
|
moduleName = opts.module;
|
|
32613
34303
|
}
|
|
32614
34304
|
if (moduleFile) {
|
|
32615
|
-
moduleFile = require('path').join(process.cwd(), moduleFile);
|
|
34305
|
+
moduleFile = require$1('path').join(process.cwd(), moduleFile);
|
|
32616
34306
|
}
|
|
32617
34307
|
try {
|
|
32618
|
-
_module = require(moduleFile || moduleName);
|
|
34308
|
+
_module = require$1(moduleFile || moduleName);
|
|
32619
34309
|
_module(coreAPI);
|
|
32620
34310
|
} catch(e) {
|
|
32621
34311
|
// stop(e);
|
|
@@ -34662,7 +36352,7 @@ ${svg}
|
|
|
34662
36352
|
// TODO: add more projections
|
|
34663
36353
|
//
|
|
34664
36354
|
function expandProjDefn(str, dataset) {
|
|
34665
|
-
var mproj = require('mproj');
|
|
36355
|
+
var mproj = require$1('mproj');
|
|
34666
36356
|
var proj4, params, bbox, isConic2SP, isCentered, decimals;
|
|
34667
36357
|
if (str in mproj.internal.pj_list === false) {
|
|
34668
36358
|
// not a bare projection code -- assume valid projection string in other format
|
|
@@ -34704,6 +36394,13 @@ ${svg}
|
|
|
34704
36394
|
return `+lon_0=${ cx.toFixed(decimals) } +lat_0=${ cy.toFixed(decimals) }`;
|
|
34705
36395
|
}
|
|
34706
36396
|
|
|
36397
|
+
var ProjectionParams = /*#__PURE__*/Object.freeze({
|
|
36398
|
+
__proto__: null,
|
|
36399
|
+
expandProjDefn: expandProjDefn,
|
|
36400
|
+
getConicParams: getConicParams,
|
|
36401
|
+
getCenterParams: getCenterParams
|
|
36402
|
+
});
|
|
36403
|
+
|
|
34707
36404
|
cmd.proj = function(dataset, catalog, opts) {
|
|
34708
36405
|
var srcInfo, destInfo, destStr;
|
|
34709
36406
|
if (opts.init) {
|
|
@@ -36538,7 +38235,7 @@ ${svg}
|
|
|
36538
38235
|
requireSinglePointLayer(srcLyr);
|
|
36539
38236
|
var points = getPointsInLayer(srcLyr);
|
|
36540
38237
|
var maxDist = opts.max_distance ? convertDistanceParam(opts.max_distance, crs) : 1e-3;
|
|
36541
|
-
var kdbush = require('kdbush');
|
|
38238
|
+
var kdbush = require$1('kdbush');
|
|
36542
38239
|
var index = new kdbush(points);
|
|
36543
38240
|
var lookup = getLookupFunction(index, crs, maxDist);
|
|
36544
38241
|
var uniqIndex = new IdTestIndex(points.length);
|
|
@@ -37201,7 +38898,7 @@ ${svg}
|
|
|
37201
38898
|
}
|
|
37202
38899
|
|
|
37203
38900
|
function getPointIndex(points, grid, radius) {
|
|
37204
|
-
var Flatbush = require('flatbush');
|
|
38901
|
+
var Flatbush = require$1('flatbush');
|
|
37205
38902
|
var gridIndex = new IdTestIndex(grid.cells());
|
|
37206
38903
|
var bboxIndex = new Flatbush(points.length);
|
|
37207
38904
|
var empty = [];
|
|
@@ -37622,10 +39319,10 @@ ${svg}
|
|
|
37622
39319
|
moduleName = opts.module;
|
|
37623
39320
|
}
|
|
37624
39321
|
if (moduleFile) {
|
|
37625
|
-
moduleFile = require('path').join(process.cwd(), moduleFile);
|
|
39322
|
+
moduleFile = require$1('path').join(process.cwd(), moduleFile);
|
|
37626
39323
|
}
|
|
37627
39324
|
try {
|
|
37628
|
-
mod = require(moduleFile || moduleName);
|
|
39325
|
+
mod = require$1(moduleFile || moduleName);
|
|
37629
39326
|
} catch(e) {
|
|
37630
39327
|
stop(e);
|
|
37631
39328
|
}
|
|
@@ -39780,7 +41477,7 @@ ${svg}
|
|
|
39780
41477
|
function commandAcceptsEmptyTarget(name) {
|
|
39781
41478
|
return name == 'graticule' || name == 'i' || name == 'help' ||
|
|
39782
41479
|
name == 'point-grid' || name == 'shape' || name == 'rectangle' ||
|
|
39783
|
-
name == 'include' || name == 'print' || name == 'if' || name == 'elif' ||
|
|
41480
|
+
name == 'include' || name == 'print' || name == 'comment' || name == 'if' || name == 'elif' ||
|
|
39784
41481
|
name == 'else' || name == 'endif';
|
|
39785
41482
|
}
|
|
39786
41483
|
|
|
@@ -39888,6 +41585,9 @@ ${svg}
|
|
|
39888
41585
|
} else if (name == 'colorizer') {
|
|
39889
41586
|
outputLayers = cmd.colorizer(opts);
|
|
39890
41587
|
|
|
41588
|
+
} else if (name == 'comment') {
|
|
41589
|
+
// no-op
|
|
41590
|
+
|
|
39891
41591
|
} else if (name == 'dashlines') {
|
|
39892
41592
|
applyCommandToEachLayer(cmd.dashlines, targetLayers, targetDataset, opts);
|
|
39893
41593
|
|
|
@@ -40266,7 +41966,7 @@ ${svg}
|
|
|
40266
41966
|
//
|
|
40267
41967
|
function runCommandsXL(argv) {
|
|
40268
41968
|
var opts = importRunArgs.apply(null, arguments);
|
|
40269
|
-
var mapshaperScript = require('path').join(__dirname, 'bin/mapshaper');
|
|
41969
|
+
var mapshaperScript = require$1('path').join(__dirname, 'bin/mapshaper');
|
|
40270
41970
|
var gb = parseFloat(opts.options.xl) || 8;
|
|
40271
41971
|
var err;
|
|
40272
41972
|
if (gb < 1 || gb > 64) {
|
|
@@ -40278,7 +41978,7 @@ ${svg}
|
|
|
40278
41978
|
if (!loggingEnabled()) argv += ' -quiet'; // kludge to pass logging setting to subprocess
|
|
40279
41979
|
var mb = Math.round(gb * 1000);
|
|
40280
41980
|
var command = [process.execPath, '--max-old-space-size=' + mb, mapshaperScript, argv].join(' ');
|
|
40281
|
-
var child = require('child_process').exec(command, {}, function(err, stdout, stderr) {
|
|
41981
|
+
var child = require$1('child_process').exec(command, {}, function(err, stdout, stderr) {
|
|
40282
41982
|
opts.callback(err);
|
|
40283
41983
|
});
|
|
40284
41984
|
child.stdout.pipe(process.stdout);
|
|
@@ -40989,6 +42689,7 @@ ${svg}
|
|
|
40989
42689
|
PostSimplifyRepair,
|
|
40990
42690
|
Proj,
|
|
40991
42691
|
Projections,
|
|
42692
|
+
ProjectionParams,
|
|
40992
42693
|
Rectangle,
|
|
40993
42694
|
Rounding,
|
|
40994
42695
|
RunCommands,
|
|
@@ -41006,7 +42707,7 @@ ${svg}
|
|
|
41006
42707
|
Snapping,
|
|
41007
42708
|
SourceUtils,
|
|
41008
42709
|
Split,
|
|
41009
|
-
|
|
42710
|
+
Env,
|
|
41010
42711
|
Stash,
|
|
41011
42712
|
Stringify,
|
|
41012
42713
|
Svg,
|
|
@@ -41022,10 +42723,10 @@ ${svg}
|
|
|
41022
42723
|
);
|
|
41023
42724
|
|
|
41024
42725
|
// The entry point for the core mapshaper module
|
|
42726
|
+
|
|
41025
42727
|
var moduleAPI = Object.assign({
|
|
41026
|
-
cli, geom, utils, internal,
|
|
41027
|
-
|
|
41028
|
-
}, cmd, coreAPI); // Adding command functions to the top-level module API, for test compatibility
|
|
42728
|
+
cli, cmd, geom, utils, internal,
|
|
42729
|
+
}, coreAPI);
|
|
41029
42730
|
|
|
41030
42731
|
if (typeof module === "object" && module.exports) {
|
|
41031
42732
|
module.exports = moduleAPI;
|