@hpcc-js/common 2.71.4 → 2.71.6
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/dist/index.es6.js +792 -213
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +799 -220
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +3 -3
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
})(this, (function (exports, util) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var PKG_NAME = "@hpcc-js/common";
|
|
8
|
-
var PKG_VERSION = "2.71.
|
|
9
|
-
var BUILD_VERSION = "2.104.
|
|
8
|
+
var PKG_VERSION = "2.71.6";
|
|
9
|
+
var BUILD_VERSION = "2.104.13";
|
|
10
10
|
|
|
11
11
|
/******************************************************************************
|
|
12
12
|
Copyright (c) Microsoft Corporation.
|
|
@@ -1415,34 +1415,34 @@
|
|
|
1415
1415
|
});
|
|
1416
1416
|
}
|
|
1417
1417
|
|
|
1418
|
-
function define(constructor, factory, prototype) {
|
|
1418
|
+
function define$1(constructor, factory, prototype) {
|
|
1419
1419
|
constructor.prototype = factory.prototype = prototype;
|
|
1420
1420
|
prototype.constructor = constructor;
|
|
1421
1421
|
}
|
|
1422
1422
|
|
|
1423
|
-
function extend(parent, definition) {
|
|
1423
|
+
function extend$1(parent, definition) {
|
|
1424
1424
|
var prototype = Object.create(parent.prototype);
|
|
1425
1425
|
for (var key in definition) prototype[key] = definition[key];
|
|
1426
1426
|
return prototype;
|
|
1427
1427
|
}
|
|
1428
1428
|
|
|
1429
|
-
function Color() {}
|
|
1429
|
+
function Color$1() {}
|
|
1430
1430
|
|
|
1431
|
-
var darker = 0.7;
|
|
1432
|
-
var brighter = 1 / darker;
|
|
1431
|
+
var darker$1 = 0.7;
|
|
1432
|
+
var brighter$1 = 1 / darker$1;
|
|
1433
1433
|
|
|
1434
|
-
var reI = "\\s*([+-]?\\d+)\\s*",
|
|
1435
|
-
reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
1436
|
-
reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
|
1437
|
-
reHex = /^#([0-9a-f]{3,8})$/,
|
|
1438
|
-
reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"),
|
|
1439
|
-
reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"),
|
|
1440
|
-
reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"),
|
|
1441
|
-
reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"),
|
|
1442
|
-
reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"),
|
|
1443
|
-
reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
|
|
1434
|
+
var reI$1 = "\\s*([+-]?\\d+)\\s*",
|
|
1435
|
+
reN$1 = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
1436
|
+
reP$1 = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
|
1437
|
+
reHex$1 = /^#([0-9a-f]{3,8})$/,
|
|
1438
|
+
reRgbInteger$1 = new RegExp("^rgb\\(" + [reI$1, reI$1, reI$1] + "\\)$"),
|
|
1439
|
+
reRgbPercent$1 = new RegExp("^rgb\\(" + [reP$1, reP$1, reP$1] + "\\)$"),
|
|
1440
|
+
reRgbaInteger$1 = new RegExp("^rgba\\(" + [reI$1, reI$1, reI$1, reN$1] + "\\)$"),
|
|
1441
|
+
reRgbaPercent$1 = new RegExp("^rgba\\(" + [reP$1, reP$1, reP$1, reN$1] + "\\)$"),
|
|
1442
|
+
reHslPercent$1 = new RegExp("^hsl\\(" + [reN$1, reP$1, reP$1] + "\\)$"),
|
|
1443
|
+
reHslaPercent$1 = new RegExp("^hsla\\(" + [reN$1, reP$1, reP$1, reN$1] + "\\)$");
|
|
1444
1444
|
|
|
1445
|
-
var named = {
|
|
1445
|
+
var named$1 = {
|
|
1446
1446
|
aliceblue: 0xf0f8ff,
|
|
1447
1447
|
antiquewhite: 0xfaebd7,
|
|
1448
1448
|
aqua: 0x00ffff,
|
|
@@ -1593,86 +1593,86 @@
|
|
|
1593
1593
|
yellowgreen: 0x9acd32
|
|
1594
1594
|
};
|
|
1595
1595
|
|
|
1596
|
-
define(Color, color, {
|
|
1596
|
+
define$1(Color$1, color$1, {
|
|
1597
1597
|
copy: function(channels) {
|
|
1598
1598
|
return Object.assign(new this.constructor, this, channels);
|
|
1599
1599
|
},
|
|
1600
1600
|
displayable: function() {
|
|
1601
1601
|
return this.rgb().displayable();
|
|
1602
1602
|
},
|
|
1603
|
-
hex: color_formatHex, // Deprecated! Use color.formatHex.
|
|
1604
|
-
formatHex: color_formatHex,
|
|
1605
|
-
formatHsl: color_formatHsl,
|
|
1606
|
-
formatRgb: color_formatRgb,
|
|
1607
|
-
toString: color_formatRgb
|
|
1603
|
+
hex: color_formatHex$1, // Deprecated! Use color.formatHex.
|
|
1604
|
+
formatHex: color_formatHex$1,
|
|
1605
|
+
formatHsl: color_formatHsl$1,
|
|
1606
|
+
formatRgb: color_formatRgb$1,
|
|
1607
|
+
toString: color_formatRgb$1
|
|
1608
1608
|
});
|
|
1609
1609
|
|
|
1610
|
-
function color_formatHex() {
|
|
1610
|
+
function color_formatHex$1() {
|
|
1611
1611
|
return this.rgb().formatHex();
|
|
1612
1612
|
}
|
|
1613
1613
|
|
|
1614
|
-
function color_formatHsl() {
|
|
1615
|
-
return hslConvert(this).formatHsl();
|
|
1614
|
+
function color_formatHsl$1() {
|
|
1615
|
+
return hslConvert$1(this).formatHsl();
|
|
1616
1616
|
}
|
|
1617
1617
|
|
|
1618
|
-
function color_formatRgb() {
|
|
1618
|
+
function color_formatRgb$1() {
|
|
1619
1619
|
return this.rgb().formatRgb();
|
|
1620
1620
|
}
|
|
1621
1621
|
|
|
1622
|
-
function color(format) {
|
|
1622
|
+
function color$1(format) {
|
|
1623
1623
|
var m, l;
|
|
1624
1624
|
format = (format + "").trim().toLowerCase();
|
|
1625
|
-
return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
|
|
1626
|
-
: l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
|
|
1627
|
-
: l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
|
|
1628
|
-
: 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
|
|
1625
|
+
return (m = reHex$1.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn$1(m) // #ff0000
|
|
1626
|
+
: l === 3 ? new Rgb$1((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
|
|
1627
|
+
: l === 8 ? rgba$1(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
|
|
1628
|
+
: l === 4 ? rgba$1((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
|
|
1629
1629
|
: null) // invalid hex
|
|
1630
|
-
: (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
|
|
1631
|
-
: (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
|
|
1632
|
-
: (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
|
|
1633
|
-
: (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
|
|
1634
|
-
: (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
|
|
1635
|
-
: (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
|
|
1636
|
-
: named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
|
|
1637
|
-
: format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
|
|
1630
|
+
: (m = reRgbInteger$1.exec(format)) ? new Rgb$1(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
|
|
1631
|
+
: (m = reRgbPercent$1.exec(format)) ? new Rgb$1(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
|
|
1632
|
+
: (m = reRgbaInteger$1.exec(format)) ? rgba$1(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
|
|
1633
|
+
: (m = reRgbaPercent$1.exec(format)) ? rgba$1(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
|
|
1634
|
+
: (m = reHslPercent$1.exec(format)) ? hsla$1(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
|
|
1635
|
+
: (m = reHslaPercent$1.exec(format)) ? hsla$1(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
|
|
1636
|
+
: named$1.hasOwnProperty(format) ? rgbn$1(named$1[format]) // eslint-disable-line no-prototype-builtins
|
|
1637
|
+
: format === "transparent" ? new Rgb$1(NaN, NaN, NaN, 0)
|
|
1638
1638
|
: null;
|
|
1639
1639
|
}
|
|
1640
1640
|
|
|
1641
|
-
function rgbn(n) {
|
|
1642
|
-
return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
|
|
1641
|
+
function rgbn$1(n) {
|
|
1642
|
+
return new Rgb$1(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
|
|
1643
1643
|
}
|
|
1644
1644
|
|
|
1645
|
-
function rgba(r, g, b, a) {
|
|
1645
|
+
function rgba$1(r, g, b, a) {
|
|
1646
1646
|
if (a <= 0) r = g = b = NaN;
|
|
1647
|
-
return new Rgb(r, g, b, a);
|
|
1647
|
+
return new Rgb$1(r, g, b, a);
|
|
1648
1648
|
}
|
|
1649
1649
|
|
|
1650
|
-
function rgbConvert(o) {
|
|
1651
|
-
if (!(o instanceof Color)) o = color(o);
|
|
1652
|
-
if (!o) return new Rgb;
|
|
1650
|
+
function rgbConvert$1(o) {
|
|
1651
|
+
if (!(o instanceof Color$1)) o = color$1(o);
|
|
1652
|
+
if (!o) return new Rgb$1;
|
|
1653
1653
|
o = o.rgb();
|
|
1654
|
-
return new Rgb(o.r, o.g, o.b, o.opacity);
|
|
1654
|
+
return new Rgb$1(o.r, o.g, o.b, o.opacity);
|
|
1655
1655
|
}
|
|
1656
1656
|
|
|
1657
|
-
function rgb(r, g, b, opacity) {
|
|
1658
|
-
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
|
1657
|
+
function rgb$1(r, g, b, opacity) {
|
|
1658
|
+
return arguments.length === 1 ? rgbConvert$1(r) : new Rgb$1(r, g, b, opacity == null ? 1 : opacity);
|
|
1659
1659
|
}
|
|
1660
1660
|
|
|
1661
|
-
function Rgb(r, g, b, opacity) {
|
|
1661
|
+
function Rgb$1(r, g, b, opacity) {
|
|
1662
1662
|
this.r = +r;
|
|
1663
1663
|
this.g = +g;
|
|
1664
1664
|
this.b = +b;
|
|
1665
1665
|
this.opacity = +opacity;
|
|
1666
1666
|
}
|
|
1667
1667
|
|
|
1668
|
-
define(Rgb, rgb, extend(Color, {
|
|
1668
|
+
define$1(Rgb$1, rgb$1, extend$1(Color$1, {
|
|
1669
1669
|
brighter: function(k) {
|
|
1670
|
-
k = k == null ? brighter : Math.pow(brighter, k);
|
|
1671
|
-
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
1670
|
+
k = k == null ? brighter$1 : Math.pow(brighter$1, k);
|
|
1671
|
+
return new Rgb$1(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
1672
1672
|
},
|
|
1673
1673
|
darker: function(k) {
|
|
1674
|
-
k = k == null ? darker : Math.pow(darker, k);
|
|
1675
|
-
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
1674
|
+
k = k == null ? darker$1 : Math.pow(darker$1, k);
|
|
1675
|
+
return new Rgb$1(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
1676
1676
|
},
|
|
1677
1677
|
rgb: function() {
|
|
1678
1678
|
return this;
|
|
@@ -1683,17 +1683,17 @@
|
|
|
1683
1683
|
&& (-0.5 <= this.b && this.b < 255.5)
|
|
1684
1684
|
&& (0 <= this.opacity && this.opacity <= 1);
|
|
1685
1685
|
},
|
|
1686
|
-
hex: rgb_formatHex, // Deprecated! Use color.formatHex.
|
|
1687
|
-
formatHex: rgb_formatHex,
|
|
1688
|
-
formatRgb: rgb_formatRgb,
|
|
1689
|
-
toString: rgb_formatRgb
|
|
1686
|
+
hex: rgb_formatHex$1, // Deprecated! Use color.formatHex.
|
|
1687
|
+
formatHex: rgb_formatHex$1,
|
|
1688
|
+
formatRgb: rgb_formatRgb$1,
|
|
1689
|
+
toString: rgb_formatRgb$1
|
|
1690
1690
|
}));
|
|
1691
1691
|
|
|
1692
|
-
function rgb_formatHex() {
|
|
1693
|
-
return "#" + hex(this.r) + hex(this.g) + hex(this.b);
|
|
1692
|
+
function rgb_formatHex$1() {
|
|
1693
|
+
return "#" + hex$1(this.r) + hex$1(this.g) + hex$1(this.b);
|
|
1694
1694
|
}
|
|
1695
1695
|
|
|
1696
|
-
function rgb_formatRgb() {
|
|
1696
|
+
function rgb_formatRgb$1() {
|
|
1697
1697
|
var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
|
|
1698
1698
|
return (a === 1 ? "rgb(" : "rgba(")
|
|
1699
1699
|
+ Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", "
|
|
@@ -1702,23 +1702,23 @@
|
|
|
1702
1702
|
+ (a === 1 ? ")" : ", " + a + ")");
|
|
1703
1703
|
}
|
|
1704
1704
|
|
|
1705
|
-
function hex(value) {
|
|
1705
|
+
function hex$1(value) {
|
|
1706
1706
|
value = Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
1707
1707
|
return (value < 16 ? "0" : "") + value.toString(16);
|
|
1708
1708
|
}
|
|
1709
1709
|
|
|
1710
|
-
function hsla(h, s, l, a) {
|
|
1710
|
+
function hsla$1(h, s, l, a) {
|
|
1711
1711
|
if (a <= 0) h = s = l = NaN;
|
|
1712
1712
|
else if (l <= 0 || l >= 1) h = s = NaN;
|
|
1713
1713
|
else if (s <= 0) h = NaN;
|
|
1714
|
-
return new Hsl(h, s, l, a);
|
|
1714
|
+
return new Hsl$1(h, s, l, a);
|
|
1715
1715
|
}
|
|
1716
1716
|
|
|
1717
|
-
function hslConvert(o) {
|
|
1718
|
-
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
1719
|
-
if (!(o instanceof Color)) o = color(o);
|
|
1720
|
-
if (!o) return new Hsl;
|
|
1721
|
-
if (o instanceof Hsl) return o;
|
|
1717
|
+
function hslConvert$1(o) {
|
|
1718
|
+
if (o instanceof Hsl$1) return new Hsl$1(o.h, o.s, o.l, o.opacity);
|
|
1719
|
+
if (!(o instanceof Color$1)) o = color$1(o);
|
|
1720
|
+
if (!o) return new Hsl$1;
|
|
1721
|
+
if (o instanceof Hsl$1) return o;
|
|
1722
1722
|
o = o.rgb();
|
|
1723
1723
|
var r = o.r / 255,
|
|
1724
1724
|
g = o.g / 255,
|
|
@@ -1737,28 +1737,28 @@
|
|
|
1737
1737
|
} else {
|
|
1738
1738
|
s = l > 0 && l < 1 ? 0 : h;
|
|
1739
1739
|
}
|
|
1740
|
-
return new Hsl(h, s, l, o.opacity);
|
|
1740
|
+
return new Hsl$1(h, s, l, o.opacity);
|
|
1741
1741
|
}
|
|
1742
1742
|
|
|
1743
|
-
function hsl$
|
|
1744
|
-
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
|
|
1743
|
+
function hsl$3(h, s, l, opacity) {
|
|
1744
|
+
return arguments.length === 1 ? hslConvert$1(h) : new Hsl$1(h, s, l, opacity == null ? 1 : opacity);
|
|
1745
1745
|
}
|
|
1746
1746
|
|
|
1747
|
-
function Hsl(h, s, l, opacity) {
|
|
1747
|
+
function Hsl$1(h, s, l, opacity) {
|
|
1748
1748
|
this.h = +h;
|
|
1749
1749
|
this.s = +s;
|
|
1750
1750
|
this.l = +l;
|
|
1751
1751
|
this.opacity = +opacity;
|
|
1752
1752
|
}
|
|
1753
1753
|
|
|
1754
|
-
define(Hsl, hsl$
|
|
1754
|
+
define$1(Hsl$1, hsl$3, extend$1(Color$1, {
|
|
1755
1755
|
brighter: function(k) {
|
|
1756
|
-
k = k == null ? brighter : Math.pow(brighter, k);
|
|
1757
|
-
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
1756
|
+
k = k == null ? brighter$1 : Math.pow(brighter$1, k);
|
|
1757
|
+
return new Hsl$1(this.h, this.s, this.l * k, this.opacity);
|
|
1758
1758
|
},
|
|
1759
1759
|
darker: function(k) {
|
|
1760
|
-
k = k == null ? darker : Math.pow(darker, k);
|
|
1761
|
-
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
1760
|
+
k = k == null ? darker$1 : Math.pow(darker$1, k);
|
|
1761
|
+
return new Hsl$1(this.h, this.s, this.l * k, this.opacity);
|
|
1762
1762
|
},
|
|
1763
1763
|
rgb: function() {
|
|
1764
1764
|
var h = this.h % 360 + (this.h < 0) * 360,
|
|
@@ -1766,10 +1766,10 @@
|
|
|
1766
1766
|
l = this.l,
|
|
1767
1767
|
m2 = l + (l < 0.5 ? l : 1 - l) * s,
|
|
1768
1768
|
m1 = 2 * l - m2;
|
|
1769
|
-
return new Rgb(
|
|
1770
|
-
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
1771
|
-
hsl2rgb(h, m1, m2),
|
|
1772
|
-
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
|
|
1769
|
+
return new Rgb$1(
|
|
1770
|
+
hsl2rgb$1(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
1771
|
+
hsl2rgb$1(h, m1, m2),
|
|
1772
|
+
hsl2rgb$1(h < 120 ? h + 240 : h - 120, m1, m2),
|
|
1773
1773
|
this.opacity
|
|
1774
1774
|
);
|
|
1775
1775
|
},
|
|
@@ -1789,7 +1789,7 @@
|
|
|
1789
1789
|
}));
|
|
1790
1790
|
|
|
1791
1791
|
/* From FvD 13.37, CSS Color Module Level 3 */
|
|
1792
|
-
function hsl2rgb(h, m1, m2) {
|
|
1792
|
+
function hsl2rgb$1(h, m1, m2) {
|
|
1793
1793
|
return (h < 60 ? m1 + (m2 - m1) * h / 60
|
|
1794
1794
|
: h < 180 ? m2
|
|
1795
1795
|
: h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
|
|
@@ -1800,167 +1800,159 @@
|
|
|
1800
1800
|
var rad2deg = 180 / Math.PI;
|
|
1801
1801
|
|
|
1802
1802
|
// https://observablehq.com/@mbostock/lab-and-rgb
|
|
1803
|
-
var K = 18,
|
|
1804
|
-
Xn = 0.96422,
|
|
1805
|
-
Yn = 1,
|
|
1806
|
-
Zn = 0.82521,
|
|
1807
|
-
t0$
|
|
1808
|
-
t1$
|
|
1809
|
-
t2 = 3 * t1$
|
|
1810
|
-
t3 = t1$
|
|
1811
|
-
|
|
1812
|
-
function labConvert(o) {
|
|
1813
|
-
if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
|
|
1814
|
-
if (o instanceof Hcl) return hcl2lab(o);
|
|
1815
|
-
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
1816
|
-
var r = rgb2lrgb(o.r),
|
|
1817
|
-
g = rgb2lrgb(o.g),
|
|
1818
|
-
b = rgb2lrgb(o.b),
|
|
1819
|
-
y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;
|
|
1803
|
+
var K$1 = 18,
|
|
1804
|
+
Xn$1 = 0.96422,
|
|
1805
|
+
Yn$1 = 1,
|
|
1806
|
+
Zn$1 = 0.82521,
|
|
1807
|
+
t0$2 = 4 / 29,
|
|
1808
|
+
t1$2 = 6 / 29,
|
|
1809
|
+
t2$1 = 3 * t1$2 * t1$2,
|
|
1810
|
+
t3$1 = t1$2 * t1$2 * t1$2;
|
|
1811
|
+
|
|
1812
|
+
function labConvert$1(o) {
|
|
1813
|
+
if (o instanceof Lab$1) return new Lab$1(o.l, o.a, o.b, o.opacity);
|
|
1814
|
+
if (o instanceof Hcl$1) return hcl2lab$1(o);
|
|
1815
|
+
if (!(o instanceof Rgb$1)) o = rgbConvert$1(o);
|
|
1816
|
+
var r = rgb2lrgb$1(o.r),
|
|
1817
|
+
g = rgb2lrgb$1(o.g),
|
|
1818
|
+
b = rgb2lrgb$1(o.b),
|
|
1819
|
+
y = xyz2lab$1((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn$1), x, z;
|
|
1820
1820
|
if (r === g && g === b) x = z = y; else {
|
|
1821
|
-
x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
|
|
1822
|
-
z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
|
|
1821
|
+
x = xyz2lab$1((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn$1);
|
|
1822
|
+
z = xyz2lab$1((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn$1);
|
|
1823
1823
|
}
|
|
1824
|
-
return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
|
|
1824
|
+
return new Lab$1(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
|
|
1825
1825
|
}
|
|
1826
1826
|
|
|
1827
|
-
function
|
|
1828
|
-
return new Lab(l,
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1831
|
-
function lab$1(l, a, b, opacity) {
|
|
1832
|
-
return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
|
|
1827
|
+
function lab$2(l, a, b, opacity) {
|
|
1828
|
+
return arguments.length === 1 ? labConvert$1(l) : new Lab$1(l, a, b, opacity == null ? 1 : opacity);
|
|
1833
1829
|
}
|
|
1834
1830
|
|
|
1835
|
-
function Lab(l, a, b, opacity) {
|
|
1831
|
+
function Lab$1(l, a, b, opacity) {
|
|
1836
1832
|
this.l = +l;
|
|
1837
1833
|
this.a = +a;
|
|
1838
1834
|
this.b = +b;
|
|
1839
1835
|
this.opacity = +opacity;
|
|
1840
1836
|
}
|
|
1841
1837
|
|
|
1842
|
-
define(Lab, lab$
|
|
1838
|
+
define$1(Lab$1, lab$2, extend$1(Color$1, {
|
|
1843
1839
|
brighter: function(k) {
|
|
1844
|
-
return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
1840
|
+
return new Lab$1(this.l + K$1 * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
1845
1841
|
},
|
|
1846
1842
|
darker: function(k) {
|
|
1847
|
-
return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
1843
|
+
return new Lab$1(this.l - K$1 * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
1848
1844
|
},
|
|
1849
1845
|
rgb: function() {
|
|
1850
1846
|
var y = (this.l + 16) / 116,
|
|
1851
1847
|
x = isNaN(this.a) ? y : y + this.a / 500,
|
|
1852
1848
|
z = isNaN(this.b) ? y : y - this.b / 200;
|
|
1853
|
-
x = Xn * lab2xyz(x);
|
|
1854
|
-
y = Yn * lab2xyz(y);
|
|
1855
|
-
z = Zn * lab2xyz(z);
|
|
1856
|
-
return new Rgb(
|
|
1857
|
-
lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),
|
|
1858
|
-
lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),
|
|
1859
|
-
lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),
|
|
1849
|
+
x = Xn$1 * lab2xyz$1(x);
|
|
1850
|
+
y = Yn$1 * lab2xyz$1(y);
|
|
1851
|
+
z = Zn$1 * lab2xyz$1(z);
|
|
1852
|
+
return new Rgb$1(
|
|
1853
|
+
lrgb2rgb$1( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),
|
|
1854
|
+
lrgb2rgb$1(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),
|
|
1855
|
+
lrgb2rgb$1( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),
|
|
1860
1856
|
this.opacity
|
|
1861
1857
|
);
|
|
1862
1858
|
}
|
|
1863
1859
|
}));
|
|
1864
1860
|
|
|
1865
|
-
function xyz2lab(t) {
|
|
1866
|
-
return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0$
|
|
1861
|
+
function xyz2lab$1(t) {
|
|
1862
|
+
return t > t3$1 ? Math.pow(t, 1 / 3) : t / t2$1 + t0$2;
|
|
1867
1863
|
}
|
|
1868
1864
|
|
|
1869
|
-
function lab2xyz(t) {
|
|
1870
|
-
return t > t1$
|
|
1865
|
+
function lab2xyz$1(t) {
|
|
1866
|
+
return t > t1$2 ? t * t * t : t2$1 * (t - t0$2);
|
|
1871
1867
|
}
|
|
1872
1868
|
|
|
1873
|
-
function lrgb2rgb(x) {
|
|
1869
|
+
function lrgb2rgb$1(x) {
|
|
1874
1870
|
return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
|
|
1875
1871
|
}
|
|
1876
1872
|
|
|
1877
|
-
function rgb2lrgb(x) {
|
|
1873
|
+
function rgb2lrgb$1(x) {
|
|
1878
1874
|
return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
|
|
1879
1875
|
}
|
|
1880
1876
|
|
|
1881
|
-
function hclConvert(o) {
|
|
1882
|
-
if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
|
|
1883
|
-
if (!(o instanceof Lab)) o = labConvert(o);
|
|
1884
|
-
if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
|
|
1877
|
+
function hclConvert$1(o) {
|
|
1878
|
+
if (o instanceof Hcl$1) return new Hcl$1(o.h, o.c, o.l, o.opacity);
|
|
1879
|
+
if (!(o instanceof Lab$1)) o = labConvert$1(o);
|
|
1880
|
+
if (o.a === 0 && o.b === 0) return new Hcl$1(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
|
|
1885
1881
|
var h = Math.atan2(o.b, o.a) * rad2deg;
|
|
1886
|
-
return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
|
|
1882
|
+
return new Hcl$1(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
|
|
1887
1883
|
}
|
|
1888
1884
|
|
|
1889
|
-
function
|
|
1890
|
-
return arguments.length === 1 ? hclConvert(
|
|
1891
|
-
}
|
|
1892
|
-
|
|
1893
|
-
function hcl$2(h, c, l, opacity) {
|
|
1894
|
-
return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
|
|
1885
|
+
function hcl$3(h, c, l, opacity) {
|
|
1886
|
+
return arguments.length === 1 ? hclConvert$1(h) : new Hcl$1(h, c, l, opacity == null ? 1 : opacity);
|
|
1895
1887
|
}
|
|
1896
1888
|
|
|
1897
|
-
function Hcl(h, c, l, opacity) {
|
|
1889
|
+
function Hcl$1(h, c, l, opacity) {
|
|
1898
1890
|
this.h = +h;
|
|
1899
1891
|
this.c = +c;
|
|
1900
1892
|
this.l = +l;
|
|
1901
1893
|
this.opacity = +opacity;
|
|
1902
1894
|
}
|
|
1903
1895
|
|
|
1904
|
-
function hcl2lab(o) {
|
|
1905
|
-
if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
|
|
1896
|
+
function hcl2lab$1(o) {
|
|
1897
|
+
if (isNaN(o.h)) return new Lab$1(o.l, 0, 0, o.opacity);
|
|
1906
1898
|
var h = o.h * deg2rad;
|
|
1907
|
-
return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
|
|
1899
|
+
return new Lab$1(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
|
|
1908
1900
|
}
|
|
1909
1901
|
|
|
1910
|
-
define(Hcl, hcl$
|
|
1902
|
+
define$1(Hcl$1, hcl$3, extend$1(Color$1, {
|
|
1911
1903
|
brighter: function(k) {
|
|
1912
|
-
return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
|
|
1904
|
+
return new Hcl$1(this.h, this.c, this.l + K$1 * (k == null ? 1 : k), this.opacity);
|
|
1913
1905
|
},
|
|
1914
1906
|
darker: function(k) {
|
|
1915
|
-
return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
|
|
1907
|
+
return new Hcl$1(this.h, this.c, this.l - K$1 * (k == null ? 1 : k), this.opacity);
|
|
1916
1908
|
},
|
|
1917
1909
|
rgb: function() {
|
|
1918
|
-
return hcl2lab(this).rgb();
|
|
1910
|
+
return hcl2lab$1(this).rgb();
|
|
1919
1911
|
}
|
|
1920
1912
|
}));
|
|
1921
1913
|
|
|
1922
|
-
var A = -0.14861,
|
|
1923
|
-
B = +1.78277,
|
|
1924
|
-
C = -0.29227,
|
|
1925
|
-
D = -0.90649,
|
|
1926
|
-
E = +1.97294,
|
|
1927
|
-
ED = E * D,
|
|
1928
|
-
EB = E * B,
|
|
1929
|
-
BC_DA = B * C - D * A;
|
|
1930
|
-
|
|
1931
|
-
function cubehelixConvert(o) {
|
|
1932
|
-
if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
|
|
1933
|
-
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
1914
|
+
var A$1 = -0.14861,
|
|
1915
|
+
B$1 = +1.78277,
|
|
1916
|
+
C$1 = -0.29227,
|
|
1917
|
+
D$1 = -0.90649,
|
|
1918
|
+
E$1 = +1.97294,
|
|
1919
|
+
ED$1 = E$1 * D$1,
|
|
1920
|
+
EB$1 = E$1 * B$1,
|
|
1921
|
+
BC_DA$1 = B$1 * C$1 - D$1 * A$1;
|
|
1922
|
+
|
|
1923
|
+
function cubehelixConvert$1(o) {
|
|
1924
|
+
if (o instanceof Cubehelix$1) return new Cubehelix$1(o.h, o.s, o.l, o.opacity);
|
|
1925
|
+
if (!(o instanceof Rgb$1)) o = rgbConvert$1(o);
|
|
1934
1926
|
var r = o.r / 255,
|
|
1935
1927
|
g = o.g / 255,
|
|
1936
1928
|
b = o.b / 255,
|
|
1937
|
-
l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
|
|
1929
|
+
l = (BC_DA$1 * b + ED$1 * r - EB$1 * g) / (BC_DA$1 + ED$1 - EB$1),
|
|
1938
1930
|
bl = b - l,
|
|
1939
|
-
k = (E * (g - l) - C * bl) / D,
|
|
1940
|
-
s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1
|
|
1931
|
+
k = (E$1 * (g - l) - C$1 * bl) / D$1,
|
|
1932
|
+
s = Math.sqrt(k * k + bl * bl) / (E$1 * l * (1 - l)), // NaN if l=0 or l=1
|
|
1941
1933
|
h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN;
|
|
1942
|
-
return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
|
|
1934
|
+
return new Cubehelix$1(h < 0 ? h + 360 : h, s, l, o.opacity);
|
|
1943
1935
|
}
|
|
1944
1936
|
|
|
1945
|
-
function cubehelix$
|
|
1946
|
-
return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
|
|
1937
|
+
function cubehelix$4(h, s, l, opacity) {
|
|
1938
|
+
return arguments.length === 1 ? cubehelixConvert$1(h) : new Cubehelix$1(h, s, l, opacity == null ? 1 : opacity);
|
|
1947
1939
|
}
|
|
1948
1940
|
|
|
1949
|
-
function Cubehelix(h, s, l, opacity) {
|
|
1941
|
+
function Cubehelix$1(h, s, l, opacity) {
|
|
1950
1942
|
this.h = +h;
|
|
1951
1943
|
this.s = +s;
|
|
1952
1944
|
this.l = +l;
|
|
1953
1945
|
this.opacity = +opacity;
|
|
1954
1946
|
}
|
|
1955
1947
|
|
|
1956
|
-
define(Cubehelix, cubehelix$
|
|
1948
|
+
define$1(Cubehelix$1, cubehelix$4, extend$1(Color$1, {
|
|
1957
1949
|
brighter: function(k) {
|
|
1958
|
-
k = k == null ? brighter : Math.pow(brighter, k);
|
|
1959
|
-
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
1950
|
+
k = k == null ? brighter$1 : Math.pow(brighter$1, k);
|
|
1951
|
+
return new Cubehelix$1(this.h, this.s, this.l * k, this.opacity);
|
|
1960
1952
|
},
|
|
1961
1953
|
darker: function(k) {
|
|
1962
|
-
k = k == null ? darker : Math.pow(darker, k);
|
|
1963
|
-
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
1954
|
+
k = k == null ? darker$1 : Math.pow(darker$1, k);
|
|
1955
|
+
return new Cubehelix$1(this.h, this.s, this.l * k, this.opacity);
|
|
1964
1956
|
},
|
|
1965
1957
|
rgb: function() {
|
|
1966
1958
|
var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad,
|
|
@@ -1968,10 +1960,10 @@
|
|
|
1968
1960
|
a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
|
|
1969
1961
|
cosh = Math.cos(h),
|
|
1970
1962
|
sinh = Math.sin(h);
|
|
1971
|
-
return new Rgb(
|
|
1972
|
-
255 * (l + a * (A * cosh + B * sinh)),
|
|
1973
|
-
255 * (l + a * (C * cosh + D * sinh)),
|
|
1974
|
-
255 * (l + a * (E * cosh)),
|
|
1963
|
+
return new Rgb$1(
|
|
1964
|
+
255 * (l + a * (A$1 * cosh + B$1 * sinh)),
|
|
1965
|
+
255 * (l + a * (C$1 * cosh + D$1 * sinh)),
|
|
1966
|
+
255 * (l + a * (E$1 * cosh)),
|
|
1975
1967
|
this.opacity
|
|
1976
1968
|
);
|
|
1977
1969
|
}
|
|
@@ -2046,8 +2038,8 @@
|
|
|
2046
2038
|
var interpolateRgb = (function rgbGamma(y) {
|
|
2047
2039
|
var color = gamma(y);
|
|
2048
2040
|
|
|
2049
|
-
function rgb
|
|
2050
|
-
var r = color((start = rgb(start)).r, (end = rgb(end)).r),
|
|
2041
|
+
function rgb(start, end) {
|
|
2042
|
+
var r = color((start = rgb$1(start)).r, (end = rgb$1(end)).r),
|
|
2051
2043
|
g = color(start.g, end.g),
|
|
2052
2044
|
b = color(start.b, end.b),
|
|
2053
2045
|
opacity = nogamma(start.opacity, end.opacity);
|
|
@@ -2060,9 +2052,9 @@
|
|
|
2060
2052
|
};
|
|
2061
2053
|
}
|
|
2062
2054
|
|
|
2063
|
-
rgb
|
|
2055
|
+
rgb.gamma = rgbGamma;
|
|
2064
2056
|
|
|
2065
|
-
return rgb
|
|
2057
|
+
return rgb;
|
|
2066
2058
|
})(1);
|
|
2067
2059
|
|
|
2068
2060
|
function rgbSpline(spline) {
|
|
@@ -2073,7 +2065,7 @@
|
|
|
2073
2065
|
b = new Array(n),
|
|
2074
2066
|
i, color;
|
|
2075
2067
|
for (i = 0; i < n; ++i) {
|
|
2076
|
-
color = rgb(colors[i]);
|
|
2068
|
+
color = rgb$1(colors[i]);
|
|
2077
2069
|
r[i] = color.r || 0;
|
|
2078
2070
|
g[i] = color.g || 0;
|
|
2079
2071
|
b[i] = color.b || 0;
|
|
@@ -2231,8 +2223,8 @@
|
|
|
2231
2223
|
var t = typeof b, c;
|
|
2232
2224
|
return b == null || t === "boolean" ? constant$5(b)
|
|
2233
2225
|
: (t === "number" ? reinterpolate$1
|
|
2234
|
-
: t === "string" ? ((c = color(b)) ? (b = c, interpolateRgb) : interpolateString)
|
|
2235
|
-
: b instanceof color ? interpolateRgb
|
|
2226
|
+
: t === "string" ? ((c = color$1(b)) ? (b = c, interpolateRgb) : interpolateString)
|
|
2227
|
+
: b instanceof color$1 ? interpolateRgb
|
|
2236
2228
|
: b instanceof Date ? date$1
|
|
2237
2229
|
: isNumberArray(b) ? numberArray
|
|
2238
2230
|
: Array.isArray(b) ? genericArray
|
|
@@ -2261,7 +2253,7 @@
|
|
|
2261
2253
|
};
|
|
2262
2254
|
}
|
|
2263
2255
|
|
|
2264
|
-
var degrees = 180 / Math.PI;
|
|
2256
|
+
var degrees$1 = 180 / Math.PI;
|
|
2265
2257
|
|
|
2266
2258
|
var identity$4 = {
|
|
2267
2259
|
translateX: 0,
|
|
@@ -2281,8 +2273,8 @@
|
|
|
2281
2273
|
return {
|
|
2282
2274
|
translateX: e,
|
|
2283
2275
|
translateY: f,
|
|
2284
|
-
rotate: Math.atan2(b, a) * degrees,
|
|
2285
|
-
skewX: Math.atan(skewX) * degrees,
|
|
2276
|
+
rotate: Math.atan2(b, a) * degrees$1,
|
|
2277
|
+
skewX: Math.atan(skewX) * degrees$1,
|
|
2286
2278
|
scaleX: scaleX,
|
|
2287
2279
|
scaleY: scaleY
|
|
2288
2280
|
};
|
|
@@ -2438,9 +2430,9 @@
|
|
|
2438
2430
|
return i;
|
|
2439
2431
|
}
|
|
2440
2432
|
|
|
2441
|
-
function hsl(hue) {
|
|
2433
|
+
function hsl$1(hue) {
|
|
2442
2434
|
return function(start, end) {
|
|
2443
|
-
var h = hue((start = hsl$
|
|
2435
|
+
var h = hue((start = hsl$3(start)).h, (end = hsl$3(end)).h),
|
|
2444
2436
|
s = nogamma(start.s, end.s),
|
|
2445
2437
|
l = nogamma(start.l, end.l),
|
|
2446
2438
|
opacity = nogamma(start.opacity, end.opacity);
|
|
@@ -2454,11 +2446,11 @@
|
|
|
2454
2446
|
}
|
|
2455
2447
|
}
|
|
2456
2448
|
|
|
2457
|
-
var hsl$
|
|
2458
|
-
var hslLong = hsl(nogamma);
|
|
2449
|
+
var hsl$2 = hsl$1(hue$1);
|
|
2450
|
+
var hslLong = hsl$1(nogamma);
|
|
2459
2451
|
|
|
2460
|
-
function lab(start, end) {
|
|
2461
|
-
var l = nogamma((start = lab$
|
|
2452
|
+
function lab$1(start, end) {
|
|
2453
|
+
var l = nogamma((start = lab$2(start)).l, (end = lab$2(end)).l),
|
|
2462
2454
|
a = nogamma(start.a, end.a),
|
|
2463
2455
|
b = nogamma(start.b, end.b),
|
|
2464
2456
|
opacity = nogamma(start.opacity, end.opacity);
|
|
@@ -2471,9 +2463,9 @@
|
|
|
2471
2463
|
};
|
|
2472
2464
|
}
|
|
2473
2465
|
|
|
2474
|
-
function hcl(hue) {
|
|
2466
|
+
function hcl$1(hue) {
|
|
2475
2467
|
return function(start, end) {
|
|
2476
|
-
var h = hue((start = hcl$
|
|
2468
|
+
var h = hue((start = hcl$3(start)).h, (end = hcl$3(end)).h),
|
|
2477
2469
|
c = nogamma(start.c, end.c),
|
|
2478
2470
|
l = nogamma(start.l, end.l),
|
|
2479
2471
|
opacity = nogamma(start.opacity, end.opacity);
|
|
@@ -2487,15 +2479,15 @@
|
|
|
2487
2479
|
}
|
|
2488
2480
|
}
|
|
2489
2481
|
|
|
2490
|
-
var hcl$
|
|
2491
|
-
var hclLong = hcl(nogamma);
|
|
2482
|
+
var hcl$2 = hcl$1(hue$1);
|
|
2483
|
+
var hclLong = hcl$1(nogamma);
|
|
2492
2484
|
|
|
2493
|
-
function cubehelix$
|
|
2485
|
+
function cubehelix$2(hue) {
|
|
2494
2486
|
return (function cubehelixGamma(y) {
|
|
2495
2487
|
y = +y;
|
|
2496
2488
|
|
|
2497
2489
|
function cubehelix(start, end) {
|
|
2498
|
-
var h = hue((start = cubehelix$
|
|
2490
|
+
var h = hue((start = cubehelix$4(start)).h, (end = cubehelix$4(end)).h),
|
|
2499
2491
|
s = nogamma(start.s, end.s),
|
|
2500
2492
|
l = nogamma(start.l, end.l),
|
|
2501
2493
|
opacity = nogamma(start.opacity, end.opacity);
|
|
@@ -2514,8 +2506,8 @@
|
|
|
2514
2506
|
})(1);
|
|
2515
2507
|
}
|
|
2516
2508
|
|
|
2517
|
-
var cubehelix$
|
|
2518
|
-
var cubehelixLong = cubehelix$
|
|
2509
|
+
var cubehelix$3 = cubehelix$2(hue$1);
|
|
2510
|
+
var cubehelixLong = cubehelix$2(nogamma);
|
|
2519
2511
|
|
|
2520
2512
|
function piecewise(interpolate, values) {
|
|
2521
2513
|
var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);
|
|
@@ -2615,8 +2607,8 @@
|
|
|
2615
2607
|
function interpolate(a, b) {
|
|
2616
2608
|
var c;
|
|
2617
2609
|
return (typeof b === "number" ? reinterpolate$1
|
|
2618
|
-
: b instanceof color ? interpolateRgb
|
|
2619
|
-
: (c = color(b)) ? (b = c, interpolateRgb)
|
|
2610
|
+
: b instanceof color$1 ? interpolateRgb
|
|
2611
|
+
: (c = color$1(b)) ? (b = c, interpolateRgb)
|
|
2620
2612
|
: interpolateString)(a, b);
|
|
2621
2613
|
}
|
|
2622
2614
|
|
|
@@ -4717,8 +4709,8 @@
|
|
|
4717
4709
|
return Math.max(0, exponent(max) - exponent(step)) + 1;
|
|
4718
4710
|
}
|
|
4719
4711
|
|
|
4720
|
-
var t0 = new Date,
|
|
4721
|
-
t1 = new Date;
|
|
4712
|
+
var t0$1 = new Date,
|
|
4713
|
+
t1$1 = new Date;
|
|
4722
4714
|
|
|
4723
4715
|
function newInterval(floori, offseti, count, field) {
|
|
4724
4716
|
|
|
@@ -4770,9 +4762,9 @@
|
|
|
4770
4762
|
|
|
4771
4763
|
if (count) {
|
|
4772
4764
|
interval.count = function(start, end) {
|
|
4773
|
-
t0.setTime(+start), t1.setTime(+end);
|
|
4774
|
-
floori(t0), floori(t1);
|
|
4775
|
-
return Math.floor(count(t0, t1));
|
|
4765
|
+
t0$1.setTime(+start), t1$1.setTime(+end);
|
|
4766
|
+
floori(t0$1), floori(t1$1);
|
|
4767
|
+
return Math.floor(count(t0$1, t1$1));
|
|
4776
4768
|
};
|
|
4777
4769
|
|
|
4778
4770
|
interval.every = function(step) {
|
|
@@ -8960,6 +8952,593 @@
|
|
|
8960
8952
|
}(HTMLWidget));
|
|
8961
8953
|
CanvasWidget.prototype._class += " common_CanvasWidget";
|
|
8962
8954
|
|
|
8955
|
+
function define(constructor, factory, prototype) {
|
|
8956
|
+
constructor.prototype = factory.prototype = prototype;
|
|
8957
|
+
prototype.constructor = constructor;
|
|
8958
|
+
}
|
|
8959
|
+
|
|
8960
|
+
function extend(parent, definition) {
|
|
8961
|
+
var prototype = Object.create(parent.prototype);
|
|
8962
|
+
for (var key in definition) prototype[key] = definition[key];
|
|
8963
|
+
return prototype;
|
|
8964
|
+
}
|
|
8965
|
+
|
|
8966
|
+
function Color() {}
|
|
8967
|
+
|
|
8968
|
+
var darker = 0.7;
|
|
8969
|
+
var brighter = 1 / darker;
|
|
8970
|
+
|
|
8971
|
+
var reI = "\\s*([+-]?\\d+)\\s*",
|
|
8972
|
+
reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
8973
|
+
reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
|
8974
|
+
reHex = /^#([0-9a-f]{3,8})$/,
|
|
8975
|
+
reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`),
|
|
8976
|
+
reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`),
|
|
8977
|
+
reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`),
|
|
8978
|
+
reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`),
|
|
8979
|
+
reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`),
|
|
8980
|
+
reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
|
|
8981
|
+
|
|
8982
|
+
var named = {
|
|
8983
|
+
aliceblue: 0xf0f8ff,
|
|
8984
|
+
antiquewhite: 0xfaebd7,
|
|
8985
|
+
aqua: 0x00ffff,
|
|
8986
|
+
aquamarine: 0x7fffd4,
|
|
8987
|
+
azure: 0xf0ffff,
|
|
8988
|
+
beige: 0xf5f5dc,
|
|
8989
|
+
bisque: 0xffe4c4,
|
|
8990
|
+
black: 0x000000,
|
|
8991
|
+
blanchedalmond: 0xffebcd,
|
|
8992
|
+
blue: 0x0000ff,
|
|
8993
|
+
blueviolet: 0x8a2be2,
|
|
8994
|
+
brown: 0xa52a2a,
|
|
8995
|
+
burlywood: 0xdeb887,
|
|
8996
|
+
cadetblue: 0x5f9ea0,
|
|
8997
|
+
chartreuse: 0x7fff00,
|
|
8998
|
+
chocolate: 0xd2691e,
|
|
8999
|
+
coral: 0xff7f50,
|
|
9000
|
+
cornflowerblue: 0x6495ed,
|
|
9001
|
+
cornsilk: 0xfff8dc,
|
|
9002
|
+
crimson: 0xdc143c,
|
|
9003
|
+
cyan: 0x00ffff,
|
|
9004
|
+
darkblue: 0x00008b,
|
|
9005
|
+
darkcyan: 0x008b8b,
|
|
9006
|
+
darkgoldenrod: 0xb8860b,
|
|
9007
|
+
darkgray: 0xa9a9a9,
|
|
9008
|
+
darkgreen: 0x006400,
|
|
9009
|
+
darkgrey: 0xa9a9a9,
|
|
9010
|
+
darkkhaki: 0xbdb76b,
|
|
9011
|
+
darkmagenta: 0x8b008b,
|
|
9012
|
+
darkolivegreen: 0x556b2f,
|
|
9013
|
+
darkorange: 0xff8c00,
|
|
9014
|
+
darkorchid: 0x9932cc,
|
|
9015
|
+
darkred: 0x8b0000,
|
|
9016
|
+
darksalmon: 0xe9967a,
|
|
9017
|
+
darkseagreen: 0x8fbc8f,
|
|
9018
|
+
darkslateblue: 0x483d8b,
|
|
9019
|
+
darkslategray: 0x2f4f4f,
|
|
9020
|
+
darkslategrey: 0x2f4f4f,
|
|
9021
|
+
darkturquoise: 0x00ced1,
|
|
9022
|
+
darkviolet: 0x9400d3,
|
|
9023
|
+
deeppink: 0xff1493,
|
|
9024
|
+
deepskyblue: 0x00bfff,
|
|
9025
|
+
dimgray: 0x696969,
|
|
9026
|
+
dimgrey: 0x696969,
|
|
9027
|
+
dodgerblue: 0x1e90ff,
|
|
9028
|
+
firebrick: 0xb22222,
|
|
9029
|
+
floralwhite: 0xfffaf0,
|
|
9030
|
+
forestgreen: 0x228b22,
|
|
9031
|
+
fuchsia: 0xff00ff,
|
|
9032
|
+
gainsboro: 0xdcdcdc,
|
|
9033
|
+
ghostwhite: 0xf8f8ff,
|
|
9034
|
+
gold: 0xffd700,
|
|
9035
|
+
goldenrod: 0xdaa520,
|
|
9036
|
+
gray: 0x808080,
|
|
9037
|
+
green: 0x008000,
|
|
9038
|
+
greenyellow: 0xadff2f,
|
|
9039
|
+
grey: 0x808080,
|
|
9040
|
+
honeydew: 0xf0fff0,
|
|
9041
|
+
hotpink: 0xff69b4,
|
|
9042
|
+
indianred: 0xcd5c5c,
|
|
9043
|
+
indigo: 0x4b0082,
|
|
9044
|
+
ivory: 0xfffff0,
|
|
9045
|
+
khaki: 0xf0e68c,
|
|
9046
|
+
lavender: 0xe6e6fa,
|
|
9047
|
+
lavenderblush: 0xfff0f5,
|
|
9048
|
+
lawngreen: 0x7cfc00,
|
|
9049
|
+
lemonchiffon: 0xfffacd,
|
|
9050
|
+
lightblue: 0xadd8e6,
|
|
9051
|
+
lightcoral: 0xf08080,
|
|
9052
|
+
lightcyan: 0xe0ffff,
|
|
9053
|
+
lightgoldenrodyellow: 0xfafad2,
|
|
9054
|
+
lightgray: 0xd3d3d3,
|
|
9055
|
+
lightgreen: 0x90ee90,
|
|
9056
|
+
lightgrey: 0xd3d3d3,
|
|
9057
|
+
lightpink: 0xffb6c1,
|
|
9058
|
+
lightsalmon: 0xffa07a,
|
|
9059
|
+
lightseagreen: 0x20b2aa,
|
|
9060
|
+
lightskyblue: 0x87cefa,
|
|
9061
|
+
lightslategray: 0x778899,
|
|
9062
|
+
lightslategrey: 0x778899,
|
|
9063
|
+
lightsteelblue: 0xb0c4de,
|
|
9064
|
+
lightyellow: 0xffffe0,
|
|
9065
|
+
lime: 0x00ff00,
|
|
9066
|
+
limegreen: 0x32cd32,
|
|
9067
|
+
linen: 0xfaf0e6,
|
|
9068
|
+
magenta: 0xff00ff,
|
|
9069
|
+
maroon: 0x800000,
|
|
9070
|
+
mediumaquamarine: 0x66cdaa,
|
|
9071
|
+
mediumblue: 0x0000cd,
|
|
9072
|
+
mediumorchid: 0xba55d3,
|
|
9073
|
+
mediumpurple: 0x9370db,
|
|
9074
|
+
mediumseagreen: 0x3cb371,
|
|
9075
|
+
mediumslateblue: 0x7b68ee,
|
|
9076
|
+
mediumspringgreen: 0x00fa9a,
|
|
9077
|
+
mediumturquoise: 0x48d1cc,
|
|
9078
|
+
mediumvioletred: 0xc71585,
|
|
9079
|
+
midnightblue: 0x191970,
|
|
9080
|
+
mintcream: 0xf5fffa,
|
|
9081
|
+
mistyrose: 0xffe4e1,
|
|
9082
|
+
moccasin: 0xffe4b5,
|
|
9083
|
+
navajowhite: 0xffdead,
|
|
9084
|
+
navy: 0x000080,
|
|
9085
|
+
oldlace: 0xfdf5e6,
|
|
9086
|
+
olive: 0x808000,
|
|
9087
|
+
olivedrab: 0x6b8e23,
|
|
9088
|
+
orange: 0xffa500,
|
|
9089
|
+
orangered: 0xff4500,
|
|
9090
|
+
orchid: 0xda70d6,
|
|
9091
|
+
palegoldenrod: 0xeee8aa,
|
|
9092
|
+
palegreen: 0x98fb98,
|
|
9093
|
+
paleturquoise: 0xafeeee,
|
|
9094
|
+
palevioletred: 0xdb7093,
|
|
9095
|
+
papayawhip: 0xffefd5,
|
|
9096
|
+
peachpuff: 0xffdab9,
|
|
9097
|
+
peru: 0xcd853f,
|
|
9098
|
+
pink: 0xffc0cb,
|
|
9099
|
+
plum: 0xdda0dd,
|
|
9100
|
+
powderblue: 0xb0e0e6,
|
|
9101
|
+
purple: 0x800080,
|
|
9102
|
+
rebeccapurple: 0x663399,
|
|
9103
|
+
red: 0xff0000,
|
|
9104
|
+
rosybrown: 0xbc8f8f,
|
|
9105
|
+
royalblue: 0x4169e1,
|
|
9106
|
+
saddlebrown: 0x8b4513,
|
|
9107
|
+
salmon: 0xfa8072,
|
|
9108
|
+
sandybrown: 0xf4a460,
|
|
9109
|
+
seagreen: 0x2e8b57,
|
|
9110
|
+
seashell: 0xfff5ee,
|
|
9111
|
+
sienna: 0xa0522d,
|
|
9112
|
+
silver: 0xc0c0c0,
|
|
9113
|
+
skyblue: 0x87ceeb,
|
|
9114
|
+
slateblue: 0x6a5acd,
|
|
9115
|
+
slategray: 0x708090,
|
|
9116
|
+
slategrey: 0x708090,
|
|
9117
|
+
snow: 0xfffafa,
|
|
9118
|
+
springgreen: 0x00ff7f,
|
|
9119
|
+
steelblue: 0x4682b4,
|
|
9120
|
+
tan: 0xd2b48c,
|
|
9121
|
+
teal: 0x008080,
|
|
9122
|
+
thistle: 0xd8bfd8,
|
|
9123
|
+
tomato: 0xff6347,
|
|
9124
|
+
turquoise: 0x40e0d0,
|
|
9125
|
+
violet: 0xee82ee,
|
|
9126
|
+
wheat: 0xf5deb3,
|
|
9127
|
+
white: 0xffffff,
|
|
9128
|
+
whitesmoke: 0xf5f5f5,
|
|
9129
|
+
yellow: 0xffff00,
|
|
9130
|
+
yellowgreen: 0x9acd32
|
|
9131
|
+
};
|
|
9132
|
+
|
|
9133
|
+
define(Color, color, {
|
|
9134
|
+
copy(channels) {
|
|
9135
|
+
return Object.assign(new this.constructor, this, channels);
|
|
9136
|
+
},
|
|
9137
|
+
displayable() {
|
|
9138
|
+
return this.rgb().displayable();
|
|
9139
|
+
},
|
|
9140
|
+
hex: color_formatHex, // Deprecated! Use color.formatHex.
|
|
9141
|
+
formatHex: color_formatHex,
|
|
9142
|
+
formatHex8: color_formatHex8,
|
|
9143
|
+
formatHsl: color_formatHsl,
|
|
9144
|
+
formatRgb: color_formatRgb,
|
|
9145
|
+
toString: color_formatRgb
|
|
9146
|
+
});
|
|
9147
|
+
|
|
9148
|
+
function color_formatHex() {
|
|
9149
|
+
return this.rgb().formatHex();
|
|
9150
|
+
}
|
|
9151
|
+
|
|
9152
|
+
function color_formatHex8() {
|
|
9153
|
+
return this.rgb().formatHex8();
|
|
9154
|
+
}
|
|
9155
|
+
|
|
9156
|
+
function color_formatHsl() {
|
|
9157
|
+
return hslConvert(this).formatHsl();
|
|
9158
|
+
}
|
|
9159
|
+
|
|
9160
|
+
function color_formatRgb() {
|
|
9161
|
+
return this.rgb().formatRgb();
|
|
9162
|
+
}
|
|
9163
|
+
|
|
9164
|
+
function color(format) {
|
|
9165
|
+
var m, l;
|
|
9166
|
+
format = (format + "").trim().toLowerCase();
|
|
9167
|
+
return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
|
|
9168
|
+
: l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
|
|
9169
|
+
: l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
|
|
9170
|
+
: 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
|
|
9171
|
+
: null) // invalid hex
|
|
9172
|
+
: (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
|
|
9173
|
+
: (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
|
|
9174
|
+
: (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
|
|
9175
|
+
: (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
|
|
9176
|
+
: (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
|
|
9177
|
+
: (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
|
|
9178
|
+
: named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
|
|
9179
|
+
: format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
|
|
9180
|
+
: null;
|
|
9181
|
+
}
|
|
9182
|
+
|
|
9183
|
+
function rgbn(n) {
|
|
9184
|
+
return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
|
|
9185
|
+
}
|
|
9186
|
+
|
|
9187
|
+
function rgba(r, g, b, a) {
|
|
9188
|
+
if (a <= 0) r = g = b = NaN;
|
|
9189
|
+
return new Rgb(r, g, b, a);
|
|
9190
|
+
}
|
|
9191
|
+
|
|
9192
|
+
function rgbConvert(o) {
|
|
9193
|
+
if (!(o instanceof Color)) o = color(o);
|
|
9194
|
+
if (!o) return new Rgb;
|
|
9195
|
+
o = o.rgb();
|
|
9196
|
+
return new Rgb(o.r, o.g, o.b, o.opacity);
|
|
9197
|
+
}
|
|
9198
|
+
|
|
9199
|
+
function rgb(r, g, b, opacity) {
|
|
9200
|
+
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
|
9201
|
+
}
|
|
9202
|
+
|
|
9203
|
+
function Rgb(r, g, b, opacity) {
|
|
9204
|
+
this.r = +r;
|
|
9205
|
+
this.g = +g;
|
|
9206
|
+
this.b = +b;
|
|
9207
|
+
this.opacity = +opacity;
|
|
9208
|
+
}
|
|
9209
|
+
|
|
9210
|
+
define(Rgb, rgb, extend(Color, {
|
|
9211
|
+
brighter(k) {
|
|
9212
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
9213
|
+
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
9214
|
+
},
|
|
9215
|
+
darker(k) {
|
|
9216
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
9217
|
+
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
9218
|
+
},
|
|
9219
|
+
rgb() {
|
|
9220
|
+
return this;
|
|
9221
|
+
},
|
|
9222
|
+
clamp() {
|
|
9223
|
+
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
|
9224
|
+
},
|
|
9225
|
+
displayable() {
|
|
9226
|
+
return (-0.5 <= this.r && this.r < 255.5)
|
|
9227
|
+
&& (-0.5 <= this.g && this.g < 255.5)
|
|
9228
|
+
&& (-0.5 <= this.b && this.b < 255.5)
|
|
9229
|
+
&& (0 <= this.opacity && this.opacity <= 1);
|
|
9230
|
+
},
|
|
9231
|
+
hex: rgb_formatHex, // Deprecated! Use color.formatHex.
|
|
9232
|
+
formatHex: rgb_formatHex,
|
|
9233
|
+
formatHex8: rgb_formatHex8,
|
|
9234
|
+
formatRgb: rgb_formatRgb,
|
|
9235
|
+
toString: rgb_formatRgb
|
|
9236
|
+
}));
|
|
9237
|
+
|
|
9238
|
+
function rgb_formatHex() {
|
|
9239
|
+
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
|
|
9240
|
+
}
|
|
9241
|
+
|
|
9242
|
+
function rgb_formatHex8() {
|
|
9243
|
+
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
9244
|
+
}
|
|
9245
|
+
|
|
9246
|
+
function rgb_formatRgb() {
|
|
9247
|
+
const a = clampa(this.opacity);
|
|
9248
|
+
return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
|
|
9249
|
+
}
|
|
9250
|
+
|
|
9251
|
+
function clampa(opacity) {
|
|
9252
|
+
return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
|
|
9253
|
+
}
|
|
9254
|
+
|
|
9255
|
+
function clampi(value) {
|
|
9256
|
+
return Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
9257
|
+
}
|
|
9258
|
+
|
|
9259
|
+
function hex(value) {
|
|
9260
|
+
value = clampi(value);
|
|
9261
|
+
return (value < 16 ? "0" : "") + value.toString(16);
|
|
9262
|
+
}
|
|
9263
|
+
|
|
9264
|
+
function hsla(h, s, l, a) {
|
|
9265
|
+
if (a <= 0) h = s = l = NaN;
|
|
9266
|
+
else if (l <= 0 || l >= 1) h = s = NaN;
|
|
9267
|
+
else if (s <= 0) h = NaN;
|
|
9268
|
+
return new Hsl(h, s, l, a);
|
|
9269
|
+
}
|
|
9270
|
+
|
|
9271
|
+
function hslConvert(o) {
|
|
9272
|
+
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
9273
|
+
if (!(o instanceof Color)) o = color(o);
|
|
9274
|
+
if (!o) return new Hsl;
|
|
9275
|
+
if (o instanceof Hsl) return o;
|
|
9276
|
+
o = o.rgb();
|
|
9277
|
+
var r = o.r / 255,
|
|
9278
|
+
g = o.g / 255,
|
|
9279
|
+
b = o.b / 255,
|
|
9280
|
+
min = Math.min(r, g, b),
|
|
9281
|
+
max = Math.max(r, g, b),
|
|
9282
|
+
h = NaN,
|
|
9283
|
+
s = max - min,
|
|
9284
|
+
l = (max + min) / 2;
|
|
9285
|
+
if (s) {
|
|
9286
|
+
if (r === max) h = (g - b) / s + (g < b) * 6;
|
|
9287
|
+
else if (g === max) h = (b - r) / s + 2;
|
|
9288
|
+
else h = (r - g) / s + 4;
|
|
9289
|
+
s /= l < 0.5 ? max + min : 2 - max - min;
|
|
9290
|
+
h *= 60;
|
|
9291
|
+
} else {
|
|
9292
|
+
s = l > 0 && l < 1 ? 0 : h;
|
|
9293
|
+
}
|
|
9294
|
+
return new Hsl(h, s, l, o.opacity);
|
|
9295
|
+
}
|
|
9296
|
+
|
|
9297
|
+
function hsl(h, s, l, opacity) {
|
|
9298
|
+
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
|
|
9299
|
+
}
|
|
9300
|
+
|
|
9301
|
+
function Hsl(h, s, l, opacity) {
|
|
9302
|
+
this.h = +h;
|
|
9303
|
+
this.s = +s;
|
|
9304
|
+
this.l = +l;
|
|
9305
|
+
this.opacity = +opacity;
|
|
9306
|
+
}
|
|
9307
|
+
|
|
9308
|
+
define(Hsl, hsl, extend(Color, {
|
|
9309
|
+
brighter(k) {
|
|
9310
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
9311
|
+
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
9312
|
+
},
|
|
9313
|
+
darker(k) {
|
|
9314
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
9315
|
+
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
9316
|
+
},
|
|
9317
|
+
rgb() {
|
|
9318
|
+
var h = this.h % 360 + (this.h < 0) * 360,
|
|
9319
|
+
s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
|
|
9320
|
+
l = this.l,
|
|
9321
|
+
m2 = l + (l < 0.5 ? l : 1 - l) * s,
|
|
9322
|
+
m1 = 2 * l - m2;
|
|
9323
|
+
return new Rgb(
|
|
9324
|
+
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
9325
|
+
hsl2rgb(h, m1, m2),
|
|
9326
|
+
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
|
|
9327
|
+
this.opacity
|
|
9328
|
+
);
|
|
9329
|
+
},
|
|
9330
|
+
clamp() {
|
|
9331
|
+
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
|
9332
|
+
},
|
|
9333
|
+
displayable() {
|
|
9334
|
+
return (0 <= this.s && this.s <= 1 || isNaN(this.s))
|
|
9335
|
+
&& (0 <= this.l && this.l <= 1)
|
|
9336
|
+
&& (0 <= this.opacity && this.opacity <= 1);
|
|
9337
|
+
},
|
|
9338
|
+
formatHsl() {
|
|
9339
|
+
const a = clampa(this.opacity);
|
|
9340
|
+
return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
|
|
9341
|
+
}
|
|
9342
|
+
}));
|
|
9343
|
+
|
|
9344
|
+
function clamph(value) {
|
|
9345
|
+
value = (value || 0) % 360;
|
|
9346
|
+
return value < 0 ? value + 360 : value;
|
|
9347
|
+
}
|
|
9348
|
+
|
|
9349
|
+
function clampt(value) {
|
|
9350
|
+
return Math.max(0, Math.min(1, value || 0));
|
|
9351
|
+
}
|
|
9352
|
+
|
|
9353
|
+
/* From FvD 13.37, CSS Color Module Level 3 */
|
|
9354
|
+
function hsl2rgb(h, m1, m2) {
|
|
9355
|
+
return (h < 60 ? m1 + (m2 - m1) * h / 60
|
|
9356
|
+
: h < 180 ? m2
|
|
9357
|
+
: h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
|
|
9358
|
+
: m1) * 255;
|
|
9359
|
+
}
|
|
9360
|
+
|
|
9361
|
+
const radians = Math.PI / 180;
|
|
9362
|
+
const degrees = 180 / Math.PI;
|
|
9363
|
+
|
|
9364
|
+
// https://observablehq.com/@mbostock/lab-and-rgb
|
|
9365
|
+
const K = 18,
|
|
9366
|
+
Xn = 0.96422,
|
|
9367
|
+
Yn = 1,
|
|
9368
|
+
Zn = 0.82521,
|
|
9369
|
+
t0 = 4 / 29,
|
|
9370
|
+
t1 = 6 / 29,
|
|
9371
|
+
t2 = 3 * t1 * t1,
|
|
9372
|
+
t3 = t1 * t1 * t1;
|
|
9373
|
+
|
|
9374
|
+
function labConvert(o) {
|
|
9375
|
+
if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
|
|
9376
|
+
if (o instanceof Hcl) return hcl2lab(o);
|
|
9377
|
+
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
9378
|
+
var r = rgb2lrgb(o.r),
|
|
9379
|
+
g = rgb2lrgb(o.g),
|
|
9380
|
+
b = rgb2lrgb(o.b),
|
|
9381
|
+
y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;
|
|
9382
|
+
if (r === g && g === b) x = z = y; else {
|
|
9383
|
+
x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
|
|
9384
|
+
z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
|
|
9385
|
+
}
|
|
9386
|
+
return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
|
|
9387
|
+
}
|
|
9388
|
+
|
|
9389
|
+
function gray(l, opacity) {
|
|
9390
|
+
return new Lab(l, 0, 0, opacity == null ? 1 : opacity);
|
|
9391
|
+
}
|
|
9392
|
+
|
|
9393
|
+
function lab(l, a, b, opacity) {
|
|
9394
|
+
return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
|
|
9395
|
+
}
|
|
9396
|
+
|
|
9397
|
+
function Lab(l, a, b, opacity) {
|
|
9398
|
+
this.l = +l;
|
|
9399
|
+
this.a = +a;
|
|
9400
|
+
this.b = +b;
|
|
9401
|
+
this.opacity = +opacity;
|
|
9402
|
+
}
|
|
9403
|
+
|
|
9404
|
+
define(Lab, lab, extend(Color, {
|
|
9405
|
+
brighter(k) {
|
|
9406
|
+
return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
9407
|
+
},
|
|
9408
|
+
darker(k) {
|
|
9409
|
+
return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
9410
|
+
},
|
|
9411
|
+
rgb() {
|
|
9412
|
+
var y = (this.l + 16) / 116,
|
|
9413
|
+
x = isNaN(this.a) ? y : y + this.a / 500,
|
|
9414
|
+
z = isNaN(this.b) ? y : y - this.b / 200;
|
|
9415
|
+
x = Xn * lab2xyz(x);
|
|
9416
|
+
y = Yn * lab2xyz(y);
|
|
9417
|
+
z = Zn * lab2xyz(z);
|
|
9418
|
+
return new Rgb(
|
|
9419
|
+
lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),
|
|
9420
|
+
lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),
|
|
9421
|
+
lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),
|
|
9422
|
+
this.opacity
|
|
9423
|
+
);
|
|
9424
|
+
}
|
|
9425
|
+
}));
|
|
9426
|
+
|
|
9427
|
+
function xyz2lab(t) {
|
|
9428
|
+
return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;
|
|
9429
|
+
}
|
|
9430
|
+
|
|
9431
|
+
function lab2xyz(t) {
|
|
9432
|
+
return t > t1 ? t * t * t : t2 * (t - t0);
|
|
9433
|
+
}
|
|
9434
|
+
|
|
9435
|
+
function lrgb2rgb(x) {
|
|
9436
|
+
return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
|
|
9437
|
+
}
|
|
9438
|
+
|
|
9439
|
+
function rgb2lrgb(x) {
|
|
9440
|
+
return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
|
|
9441
|
+
}
|
|
9442
|
+
|
|
9443
|
+
function hclConvert(o) {
|
|
9444
|
+
if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
|
|
9445
|
+
if (!(o instanceof Lab)) o = labConvert(o);
|
|
9446
|
+
if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
|
|
9447
|
+
var h = Math.atan2(o.b, o.a) * degrees;
|
|
9448
|
+
return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
|
|
9449
|
+
}
|
|
9450
|
+
|
|
9451
|
+
function lch(l, c, h, opacity) {
|
|
9452
|
+
return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
|
|
9453
|
+
}
|
|
9454
|
+
|
|
9455
|
+
function hcl(h, c, l, opacity) {
|
|
9456
|
+
return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
|
|
9457
|
+
}
|
|
9458
|
+
|
|
9459
|
+
function Hcl(h, c, l, opacity) {
|
|
9460
|
+
this.h = +h;
|
|
9461
|
+
this.c = +c;
|
|
9462
|
+
this.l = +l;
|
|
9463
|
+
this.opacity = +opacity;
|
|
9464
|
+
}
|
|
9465
|
+
|
|
9466
|
+
function hcl2lab(o) {
|
|
9467
|
+
if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
|
|
9468
|
+
var h = o.h * radians;
|
|
9469
|
+
return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
|
|
9470
|
+
}
|
|
9471
|
+
|
|
9472
|
+
define(Hcl, hcl, extend(Color, {
|
|
9473
|
+
brighter(k) {
|
|
9474
|
+
return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
|
|
9475
|
+
},
|
|
9476
|
+
darker(k) {
|
|
9477
|
+
return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
|
|
9478
|
+
},
|
|
9479
|
+
rgb() {
|
|
9480
|
+
return hcl2lab(this).rgb();
|
|
9481
|
+
}
|
|
9482
|
+
}));
|
|
9483
|
+
|
|
9484
|
+
var A = -0.14861,
|
|
9485
|
+
B = +1.78277,
|
|
9486
|
+
C = -0.29227,
|
|
9487
|
+
D = -0.90649,
|
|
9488
|
+
E = +1.97294,
|
|
9489
|
+
ED = E * D,
|
|
9490
|
+
EB = E * B,
|
|
9491
|
+
BC_DA = B * C - D * A;
|
|
9492
|
+
|
|
9493
|
+
function cubehelixConvert(o) {
|
|
9494
|
+
if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
|
|
9495
|
+
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
9496
|
+
var r = o.r / 255,
|
|
9497
|
+
g = o.g / 255,
|
|
9498
|
+
b = o.b / 255,
|
|
9499
|
+
l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
|
|
9500
|
+
bl = b - l,
|
|
9501
|
+
k = (E * (g - l) - C * bl) / D,
|
|
9502
|
+
s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1
|
|
9503
|
+
h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;
|
|
9504
|
+
return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
|
|
9505
|
+
}
|
|
9506
|
+
|
|
9507
|
+
function cubehelix$1(h, s, l, opacity) {
|
|
9508
|
+
return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
|
|
9509
|
+
}
|
|
9510
|
+
|
|
9511
|
+
function Cubehelix(h, s, l, opacity) {
|
|
9512
|
+
this.h = +h;
|
|
9513
|
+
this.s = +s;
|
|
9514
|
+
this.l = +l;
|
|
9515
|
+
this.opacity = +opacity;
|
|
9516
|
+
}
|
|
9517
|
+
|
|
9518
|
+
define(Cubehelix, cubehelix$1, extend(Color, {
|
|
9519
|
+
brighter(k) {
|
|
9520
|
+
k = k == null ? brighter : Math.pow(brighter, k);
|
|
9521
|
+
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
9522
|
+
},
|
|
9523
|
+
darker(k) {
|
|
9524
|
+
k = k == null ? darker : Math.pow(darker, k);
|
|
9525
|
+
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
9526
|
+
},
|
|
9527
|
+
rgb() {
|
|
9528
|
+
var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,
|
|
9529
|
+
l = +this.l,
|
|
9530
|
+
a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
|
|
9531
|
+
cosh = Math.cos(h),
|
|
9532
|
+
sinh = Math.sin(h);
|
|
9533
|
+
return new Rgb(
|
|
9534
|
+
255 * (l + a * (A * cosh + B * sinh)),
|
|
9535
|
+
255 * (l + a * (C * cosh + D * sinh)),
|
|
9536
|
+
255 * (l + a * (E * cosh)),
|
|
9537
|
+
this.opacity
|
|
9538
|
+
);
|
|
9539
|
+
}
|
|
9540
|
+
}));
|
|
9541
|
+
|
|
8963
9542
|
var _version = "1.14.2-dev";
|
|
8964
9543
|
function version() {
|
|
8965
9544
|
return _version;
|
|
@@ -10910,13 +11489,13 @@
|
|
|
10910
11489
|
|
|
10911
11490
|
var d3SchemeCategory20 = colors("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5");
|
|
10912
11491
|
|
|
10913
|
-
var cubehelix = cubehelixLong(cubehelix$
|
|
11492
|
+
var cubehelix = cubehelixLong(cubehelix$4(300, 0.5, 0.0), cubehelix$4(-240, 0.5, 1.0));
|
|
10914
11493
|
|
|
10915
|
-
var warm = cubehelixLong(cubehelix$
|
|
11494
|
+
var warm = cubehelixLong(cubehelix$4(-100, 0.75, 0.35), cubehelix$4(80, 1.50, 0.8));
|
|
10916
11495
|
|
|
10917
|
-
var cool = cubehelixLong(cubehelix$
|
|
11496
|
+
var cool = cubehelixLong(cubehelix$4(260, 0.75, 0.35), cubehelix$4(80, 1.50, 0.8));
|
|
10918
11497
|
|
|
10919
|
-
var rainbow$1 = cubehelix$
|
|
11498
|
+
var rainbow$1 = cubehelix$4();
|
|
10920
11499
|
|
|
10921
11500
|
function rainbow$2(t) {
|
|
10922
11501
|
if (t < 0 || t > 1) t -= Math.floor(t);
|
|
@@ -11139,7 +11718,7 @@
|
|
|
11139
11718
|
var scale_1 = linear()
|
|
11140
11719
|
.domain([0, subPaletteSize])
|
|
11141
11720
|
.range([prevColor, color])
|
|
11142
|
-
.interpolate(lab);
|
|
11721
|
+
.interpolate(lab$1);
|
|
11143
11722
|
for (var i = 0; i < subPaletteSize; ++i) {
|
|
11144
11723
|
range.push(scale_1(i));
|
|
11145
11724
|
}
|
|
@@ -15125,7 +15704,7 @@
|
|
|
15125
15704
|
exports.csvFormatValue = csvFormatValue;
|
|
15126
15705
|
exports.csvParse = csvParse;
|
|
15127
15706
|
exports.csvParseRows = csvParseRows;
|
|
15128
|
-
exports.cubehelix = cubehelix$
|
|
15707
|
+
exports.cubehelix = cubehelix$1;
|
|
15129
15708
|
exports.customEvent = customEvent;
|
|
15130
15709
|
exports.d3Event = d3Event;
|
|
15131
15710
|
exports.descending = d3Descending;
|
|
@@ -15179,26 +15758,26 @@
|
|
|
15179
15758
|
exports.formatLocale = formatLocale$1;
|
|
15180
15759
|
exports.formatSpecifier = formatSpecifier;
|
|
15181
15760
|
exports.gray = gray;
|
|
15182
|
-
exports.hcl = hcl
|
|
15761
|
+
exports.hcl = hcl;
|
|
15183
15762
|
exports.histogram = histogram;
|
|
15184
|
-
exports.hsl = hsl
|
|
15763
|
+
exports.hsl = hsl;
|
|
15185
15764
|
exports.interpolate = interpolate$1;
|
|
15186
15765
|
exports.interpolateArray = array$2;
|
|
15187
15766
|
exports.interpolateBasis = basis$1;
|
|
15188
15767
|
exports.interpolateBasisClosed = basisClosed;
|
|
15189
15768
|
exports.interpolateCool = cool;
|
|
15190
|
-
exports.interpolateCubehelix = cubehelix$
|
|
15769
|
+
exports.interpolateCubehelix = cubehelix$3;
|
|
15191
15770
|
exports.interpolateCubehelixDefault = cubehelix;
|
|
15192
15771
|
exports.interpolateCubehelixLong = cubehelixLong;
|
|
15193
15772
|
exports.interpolateDate = date$1;
|
|
15194
15773
|
exports.interpolateDiscrete = discrete;
|
|
15195
|
-
exports.interpolateHcl = hcl$
|
|
15774
|
+
exports.interpolateHcl = hcl$2;
|
|
15196
15775
|
exports.interpolateHclLong = hclLong;
|
|
15197
|
-
exports.interpolateHsl = hsl$
|
|
15776
|
+
exports.interpolateHsl = hsl$2;
|
|
15198
15777
|
exports.interpolateHslLong = hslLong;
|
|
15199
15778
|
exports.interpolateHue = hue;
|
|
15200
15779
|
exports.interpolateInferno = inferno;
|
|
15201
|
-
exports.interpolateLab = lab;
|
|
15780
|
+
exports.interpolateLab = lab$1;
|
|
15202
15781
|
exports.interpolateMagma = magma;
|
|
15203
15782
|
exports.interpolateNumber = reinterpolate$1;
|
|
15204
15783
|
exports.interpolateNumberArray = numberArray;
|
|
@@ -15219,7 +15798,7 @@
|
|
|
15219
15798
|
exports.isoFormat = formatIso$1;
|
|
15220
15799
|
exports.isoParse = parseIso$1;
|
|
15221
15800
|
exports.keys = keys;
|
|
15222
|
-
exports.lab = lab
|
|
15801
|
+
exports.lab = lab;
|
|
15223
15802
|
exports.lch = lch;
|
|
15224
15803
|
exports.local = local$1;
|
|
15225
15804
|
exports.map = map$2;
|