diff --git a/node_modules/d3-geo-projection/src/vanDerGrinten3.js b/node_modules/d3-geo-projection/src/vanDerGrinten3.js
new file mode 100644
index 0000000000000000000000000000000000000000..439d33b0c358a05d490b7cb6f8860cb82a107f9e
--- /dev/null
+++ b/node_modules/d3-geo-projection/src/vanDerGrinten3.js
@@ -0,0 +1,30 @@
+import {geoProjection as projection} from "d3-geo";
+import {abs, asin, atan, cos, epsilon, halfPi, pi, sign, sin, sqrt, tan} from "./math.js";
+
+export function vanDerGrinten3Raw(lambda, phi) {
+ if (abs(phi) < epsilon) return [lambda, 0];
+ var sinTheta = phi / halfPi,
+ theta = asin(sinTheta);
+ if (abs(lambda) < epsilon || abs(abs(phi) - halfPi) < epsilon) return [0, pi * tan(theta / 2)];
+ var A = (pi / lambda - lambda / pi) / 2,
+ y1 = sinTheta / (1 + cos(theta));
+ return [
+ pi * (sign(lambda) * sqrt(A * A + 1 - y1 * y1) - A),
+ pi * y1
+ ];
+}
+
+vanDerGrinten3Raw.invert = function(x, y) {
+ if (!y) return [x, 0];
+ var y1 = y / pi,
+ A = (pi * pi * (1 - y1 * y1) - x * x) / (2 * pi * x);
+ return [
+ x ? pi * (sign(x) * sqrt(A * A + 1) - A) : 0,
+ halfPi * sin(2 * atan(y1))
+ ];
+};
+
+export default function() {
+ return projection(vanDerGrinten3Raw)
+ .scale(79.4183);
+}
diff --git a/node_modules/d3-geo-projection/src/vanDerGrinten4.js b/node_modules/d3-geo-projection/src/vanDerGrinten4.js
new file mode 100644
index 0000000000000000000000000000000000000000..8eb14f2cd2f758dba985edac70f2ae4819abe1b3
--- /dev/null
+++ b/node_modules/d3-geo-projection/src/vanDerGrinten4.js
@@ -0,0 +1,61 @@
+import {geoProjection as projection} from "d3-geo";
+import {abs, epsilon, halfPi, pi, sign, sqrt} from "./math.js";
+
+export function vanDerGrinten4Raw(lambda, phi) {
+ if (!phi) return [lambda, 0];
+ var phi0 = abs(phi);
+ if (!lambda || phi0 === halfPi) return [0, phi];
+ var B = phi0 / halfPi,
+ B2 = B * B,
+ C = (8 * B - B2 * (B2 + 2) - 5) / (2 * B2 * (B - 1)),
+ C2 = C * C,
+ BC = B * C,
+ B_C2 = B2 + C2 + 2 * BC,
+ B_3C = B + 3 * C,
+ lambda0 = lambda / halfPi,
+ lambda1 = lambda0 + 1 / lambda0,
+ D = sign(abs(lambda) - halfPi) * sqrt(lambda1 * lambda1 - 4),
+ D2 = D * D,
+ F = B_C2 * (B2 + C2 * D2 - 1) + (1 - B2) * (B2 * (B_3C * B_3C + 4 * C2) + 12 * BC * C2 + 4 * C2 * C2),
+ x1 = (D * (B_C2 + C2 - 1) + 2 * sqrt(F)) / (4 * B_C2 + D2);
+ return [
+ sign(lambda) * halfPi * x1,
+ sign(phi) * halfPi * sqrt(1 + D * abs(x1) - x1 * x1)
+ ];
+}
+
+vanDerGrinten4Raw.invert = function(x, y) {
+ var delta;
+ if (!x || !y) return [x, y];
+ y /= pi;
+ var x1 = sign(x) * x / halfPi,
+ D = (x1 * x1 - 1 + 4 * y * y) / abs(x1),
+ D2 = D * D,
+ B = 2 * y,
+ i = 50;
+ do {
+ var B2 = B * B,
+ C = (8 * B - B2 * (B2 + 2) - 5) / (2 * B2 * (B - 1)),
+ C_ = (3 * B - B2 * B - 10) / (2 * B2 * B),
+ C2 = C * C,
+ BC = B * C,
+ B_C = B + C,
+ B_C2 = B_C * B_C,
+ B_3C = B + 3 * C,
+ F = B_C2 * (B2 + C2 * D2 - 1) + (1 - B2) * (B2 * (B_3C * B_3C + 4 * C2) + C2 * (12 * BC + 4 * C2)),
+ F_ = -2 * B_C * (4 * BC * C2 + (1 - 4 * B2 + 3 * B2 * B2) * (1 + C_) + C2 * (-6 + 14 * B2 - D2 + (-8 + 8 * B2 - 2 * D2) * C_) + BC * (-8 + 12 * B2 + (-10 + 10 * B2 - D2) * C_)),
+ sqrtF = sqrt(F),
+ f = D * (B_C2 + C2 - 1) + 2 * sqrtF - x1 * (4 * B_C2 + D2),
+ f_ = D * (2 * C * C_ + 2 * B_C * (1 + C_)) + F_ / sqrtF - 8 * B_C * (D * (-1 + C2 + B_C2) + 2 * sqrtF) * (1 + C_) / (D2 + 4 * B_C2);
+ B -= delta = f / f_;
+ } while (delta > epsilon && --i > 0);
+ return [
+ sign(x) * (sqrt(D * D + 4) + D) * pi / 4,
+ halfPi * B
+ ];
+};
+
+export default function() {
+ return projection(vanDerGrinten4Raw)
+ .scale(127.16);
+}
diff --git a/node_modules/d3-geo-projection/src/wagner.js b/node_modules/d3-geo-projection/src/wagner.js
new file mode 100644
index 0000000000000000000000000000000000000000..df8cc676a934ec869734ed3312105dac38559a23
--- /dev/null
+++ b/node_modules/d3-geo-projection/src/wagner.js
@@ -0,0 +1,98 @@
+import {geoProjectionMutator as projectionMutator} from "d3-geo";
+import {acos, asin, atan2, cos, degrees, epsilon, halfPi, max, min, pi, radians, sin, sqrt, tan} from "./math.js";
+
+function wagnerFormula(cx, cy, m1, m2, n) {
+ function forward(lambda, phi) {
+ var s = m1 * sin(m2 * phi),
+ c0 = sqrt(1 - s * s),
+ c1 = sqrt(2 / (1 + c0 * cos(lambda *= n)));
+ return [
+ cx * c0 * c1 * sin(lambda),
+ cy * s * c1
+ ];
+ }
+
+ forward.invert = function(x, y) {
+ var t1 = x / cx,
+ t2 = y / cy,
+ p = sqrt(t1 * t1 + t2 * t2),
+ c = 2 * asin(p / 2);
+ return [
+ atan2(x * tan(c), cx * p) / n,
+ p && asin(y * sin(c) / (cy * m1 * p)) / m2
+ ];
+ };
+
+ return forward;
+}
+
+export function wagnerRaw(poleline, parallels, inflation, ratio) {
+ // 60 is always used as reference parallel
+ var phi1 = pi / 3;
+
+ // sanitizing the input values
+ // poleline and parallels may approximate but never equal 0
+ poleline = max(poleline, epsilon);
+ parallels = max(parallels, epsilon);
+ // poleline must be <= 90; parallels may approximate but never equal 180
+ poleline = min(poleline, halfPi);
+ parallels = min(parallels, pi - epsilon);
+ // 0 <= inflation <= 99.999
+ inflation = max(inflation, 0);
+ inflation = min(inflation, 100 - epsilon);
+ // ratio > 0.
+ // sensible values, i.e. something that renders a map which still can be
+ // recognized as world map, are e.g. 20 <= ratio <= 1000.
+ ratio = max(ratio, epsilon);
+
+ // convert values from boehm notation
+ // areal inflation e.g. from 0 to 1 or 20 to 1.2:
+ var vinflation = inflation/100 + 1;
+ // axial ratio e.g. from 200 to 2:
+ var vratio = ratio / 100;
+ // the other ones are a bit more complicated...
+ var m2 = acos(vinflation * cos(phi1)) / phi1,
+ m1 = sin(poleline) / sin(m2 * halfPi),
+ n = parallels / pi,
+ k = sqrt(vratio * sin(poleline / 2) / sin(parallels / 2)),
+ cx = k / sqrt(n * m1 * m2),
+ cy = 1 / (k * sqrt(n * m1 * m2));
+
+ return wagnerFormula(cx, cy, m1, m2, n);
+}
+
+export default function wagner() {
+ // default values generate wagner8
+ var poleline = 65 * radians,
+ parallels = 60 * radians,
+ inflation = 20,
+ ratio = 200,
+ mutate = projectionMutator(wagnerRaw),
+ projection = mutate(poleline, parallels, inflation, ratio);
+
+ projection.poleline = function(_) {
+ return arguments.length ? mutate(poleline = +_ * radians, parallels, inflation, ratio) : poleline * degrees;
+ };
+
+ projection.parallels = function(_) {
+ return arguments.length ? mutate(poleline, parallels = +_ * radians, inflation, ratio) : parallels * degrees;
+ };
+ projection.inflation = function(_) {
+ return arguments.length ? mutate(poleline, parallels, inflation = +_, ratio) : inflation;
+ };
+ projection.ratio = function(_) {
+ return arguments.length ? mutate(poleline, parallels, inflation, ratio = +_) : ratio;
+ };
+
+ return projection
+ .scale(163.775);
+}
+
+export function wagner7() {
+ return wagner()
+ .poleline(65)
+ .parallels(60)
+ .inflation(0)
+ .ratio(200)
+ .scale(172.633);
+}
diff --git a/node_modules/d3-geo-projection/src/wagner4.js b/node_modules/d3-geo-projection/src/wagner4.js
new file mode 100644
index 0000000000000000000000000000000000000000..798a194218dad7faed00bc6c779d134ab96c088f
--- /dev/null
+++ b/node_modules/d3-geo-projection/src/wagner4.js
@@ -0,0 +1,13 @@
+import {geoProjection as projection} from "d3-geo";
+import {sqrt, pi} from "./math.js";
+import {mollweideBromleyRaw} from "./mollweide.js";
+
+var A = 4 * pi + 3 * sqrt(3),
+ B = 2 * sqrt(2 * pi * sqrt(3) / A);
+
+export var wagner4Raw = mollweideBromleyRaw(B * sqrt(3) / pi, B, A / 6);
+
+export default function() {
+ return projection(wagner4Raw)
+ .scale(176.84);
+}
diff --git a/node_modules/d3-geo-projection/src/wagner6.js b/node_modules/d3-geo-projection/src/wagner6.js
new file mode 100644
index 0000000000000000000000000000000000000000..2ae27550260fb0b2802b3247d0d563e331d4901a
--- /dev/null
+++ b/node_modules/d3-geo-projection/src/wagner6.js
@@ -0,0 +1,15 @@
+import {geoProjection as projection} from "d3-geo";
+import {pi, sqrt} from "./math.js";
+
+export function wagner6Raw(lambda, phi) {
+ return [lambda * sqrt(1 - 3 * phi * phi / (pi * pi)), phi];
+}
+
+wagner6Raw.invert = function(x, y) {
+ return [x / sqrt(1 - 3 * y * y / (pi * pi)), y];
+};
+
+export default function() {
+ return projection(wagner6Raw)
+ .scale(152.63);
+}
diff --git a/node_modules/d3-geo-projection/src/wagner7.js b/node_modules/d3-geo-projection/src/wagner7.js
new file mode 100644
index 0000000000000000000000000000000000000000..a7366ee189b1feef142b44239e83636c4894f765
--- /dev/null
+++ b/node_modules/d3-geo-projection/src/wagner7.js
@@ -0,0 +1,28 @@
+import {geoProjection as projection} from "d3-geo";
+import {asin, atan2, cos, sin, sqrt, tan} from "./math.js";
+
+export function wagner7Raw(lambda, phi) {
+ var s = 0.90631 * sin(phi),
+ c0 = sqrt(1 - s * s),
+ c1 = sqrt(2 / (1 + c0 * cos(lambda /= 3)));
+ return [
+ 2.66723 * c0 * c1 * sin(lambda),
+ 1.24104 * s * c1
+ ];
+}
+
+wagner7Raw.invert = function(x, y) {
+ var t1 = x / 2.66723,
+ t2 = y / 1.24104,
+ p = sqrt(t1 * t1 + t2 * t2),
+ c = 2 * asin(p / 2);
+ return [
+ 3 * atan2(x * tan(c), 2.66723 * p),
+ p && asin(y * sin(c) / (1.24104 * 0.90631 * p))
+ ];
+};
+
+export default function() {
+ return projection(wagner7Raw)
+ .scale(172.632);
+}
diff --git a/node_modules/d3-geo-projection/src/wiechel.js b/node_modules/d3-geo-projection/src/wiechel.js
new file mode 100644
index 0000000000000000000000000000000000000000..bd3b430b148083dc7ce84529f7224a59a0f53666
--- /dev/null
+++ b/node_modules/d3-geo-projection/src/wiechel.js
@@ -0,0 +1,34 @@
+import {geoProjection as projection} from "d3-geo";
+import {asin, atan2, cos, sin, sqrt} from "./math.js";
+
+export function wiechelRaw(lambda, phi) {
+ var cosPhi = cos(phi),
+ sinPhi = cos(lambda) * cosPhi,
+ sin1_Phi = 1 - sinPhi,
+ cosLambda = cos(lambda = atan2(sin(lambda) * cosPhi, -sin(phi))),
+ sinLambda = sin(lambda);
+ cosPhi = sqrt(1 - sinPhi * sinPhi);
+ return [
+ sinLambda * cosPhi - cosLambda * sin1_Phi,
+ -cosLambda * cosPhi - sinLambda * sin1_Phi
+ ];
+}
+
+wiechelRaw.invert = function(x, y) {
+ var w = (x * x + y * y) / -2,
+ k = sqrt(-w * (2 + w)),
+ b = y * w + x * k,
+ a = x * w - y * k,
+ D = sqrt(a * a + b * b);
+ return [
+ atan2(k * b, D * (1 + w)),
+ D ? -asin(k * a / D) : 0
+ ];
+};
+
+export default function() {
+ return projection(wiechelRaw)
+ .rotate([0, -90, 45])
+ .scale(124.75)
+ .clipAngle(180 - 1e-3);
+}
diff --git a/node_modules/d3-geo-projection/src/winkel3.js b/node_modules/d3-geo-projection/src/winkel3.js
new file mode 100644
index 0000000000000000000000000000000000000000..437f153af73ec9025d21813d85a39798e9deaa71
--- /dev/null
+++ b/node_modules/d3-geo-projection/src/winkel3.js
@@ -0,0 +1,45 @@
+import {geoProjection as projection} from "d3-geo";
+import {aitoffRaw} from "./aitoff.js";
+import {halfPi, epsilon, sin, cos, sqrt, abs, acos} from "./math.js";
+
+export function winkel3Raw(lambda, phi) {
+ var coordinates = aitoffRaw(lambda, phi);
+ return [
+ (coordinates[0] + lambda / halfPi) / 2,
+ (coordinates[1] + phi) / 2
+ ];
+}
+
+winkel3Raw.invert = function(x, y) {
+ var lambda = x, phi = y, i = 25;
+ do {
+ var cosphi = cos(phi),
+ sinphi = sin(phi),
+ sin_2phi = sin(2 * phi),
+ sin2phi = sinphi * sinphi,
+ cos2phi = cosphi * cosphi,
+ sinlambda = sin(lambda),
+ coslambda_2 = cos(lambda / 2),
+ sinlambda_2 = sin(lambda / 2),
+ sin2lambda_2 = sinlambda_2 * sinlambda_2,
+ C = 1 - cos2phi * coslambda_2 * coslambda_2,
+ E = C ? acos(cosphi * coslambda_2) * sqrt(F = 1 / C) : F = 0,
+ F,
+ fx = 0.5 * (2 * E * cosphi * sinlambda_2 + lambda / halfPi) - x,
+ fy = 0.5 * (E * sinphi + phi) - y,
+ dxdlambda = 0.5 * F * (cos2phi * sin2lambda_2 + E * cosphi * coslambda_2 * sin2phi) + 0.5 / halfPi,
+ dxdphi = F * (sinlambda * sin_2phi / 4 - E * sinphi * sinlambda_2),
+ dydlambda = 0.125 * F * (sin_2phi * sinlambda_2 - E * sinphi * cos2phi * sinlambda),
+ dydphi = 0.5 * F * (sin2phi * coslambda_2 + E * sin2lambda_2 * cosphi) + 0.5,
+ denominator = dxdphi * dydlambda - dydphi * dxdlambda,
+ dlambda = (fy * dxdphi - fx * dydphi) / denominator,
+ dphi = (fx * dydlambda - fy * dxdlambda) / denominator;
+ lambda -= dlambda, phi -= dphi;
+ } while ((abs(dlambda) > epsilon || abs(dphi) > epsilon) && --i > 0);
+ return [lambda, phi];
+};
+
+export default function() {
+ return projection(winkel3Raw)
+ .scale(158.837);
+}
diff --git a/node_modules/d3-hierarchy/LICENSE b/node_modules/d3-hierarchy/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..721bd22ece6587a9408eda1b6a3949c425b5624a
--- /dev/null
+++ b/node_modules/d3-hierarchy/LICENSE
@@ -0,0 +1,27 @@
+Copyright 2010-2016 Mike Bostock
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of the author nor the names of contributors may be used to
+ endorse or promote products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/d3-hierarchy/README.md b/node_modules/d3-hierarchy/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..07ce2b108743a8acfa3d74d490203935faabb4c4
--- /dev/null
+++ b/node_modules/d3-hierarchy/README.md
@@ -0,0 +1,548 @@
+# d3-hierarchy
+
+Many datasets are intrinsically hierarchical. Consider [geographic entities](https://www.census.gov/geo/reference/hierarchy.html), such as census blocks, census tracts, counties and states; the command structure of businesses and governments; file systems and software packages. And even non-hierarchical data may be arranged empirically into a hierarchy, as with [*k*-means clustering](https://en.wikipedia.org/wiki/K-means_clustering) or [phylogenetic trees](https://observablehq.com/@mbostock/tree-of-life).
+
+This module implements several popular techniques for visualizing hierarchical data:
+
+**Node-link diagrams** show topology using discrete marks for nodes and links, such as a circle for each node and a line connecting each parent and child. The [“tidy” tree](#tree) is delightfully compact, while the [dendrogram](#cluster) places leaves at the same level. (These have both polar and Cartesian forms.) [Indented trees](https://bl.ocks.org/mbostock/1093025) are useful for interactive browsing.
+
+**Adjacency diagrams** show topology through the relative placement of nodes. They may also encode a quantitative dimension in the area of each node, for example to show revenue or file size. The [“icicle” diagram](#partition) uses rectangles, while the “sunburst” uses annular segments.
+
+**Enclosure diagrams** also use an area encoding, but show topology through containment. A [treemap](#treemap) recursively subdivides area into rectangles. [Circle-packing](#pack) tightly nests circles; this is not as space-efficient as a treemap, but perhaps more readily shows topology.
+
+A good hierarchical visualization facilitates rapid multiscale inference: micro-observations of individual elements and macro-observations of large groups.
+
+## Installing
+
+If you use NPM, `npm install d3-hierarchy`. Otherwise, download the [latest release](https://github.com/d3/d3-hierarchy/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-hierarchy.v1.min.js) or as part of [D3](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
+
+```html
+
+
+```
+
+## API Reference
+
+* [Hierarchy](#hierarchy) ([Stratify](#stratify))
+* [Cluster](#cluster)
+* [Tree](#tree)
+* [Treemap](#treemap) ([Treemap Tiling](#treemap-tiling))
+* [Partition](#partition)
+* [Pack](#pack)
+
+### Hierarchy
+
+Before you can compute a hierarchical layout, you need a root node. If your data is already in a hierarchical format, such as JSON, you can pass it directly to [d3.hierarchy](#hierarchy); otherwise, you can rearrange tabular data, such as comma-separated values (CSV), into a hierarchy using [d3.stratify](#stratify).
+
+# d3.hierarchy(data[, children]) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/index.js), [Examples](https://observablehq.com/@d3/d3-hierarchy)
+
+Constructs a root node from the specified hierarchical *data*. The specified *data* must be an object representing the root node. For example:
+
+```json
+{
+ "name": "Eve",
+ "children": [
+ {
+ "name": "Cain"
+ },
+ {
+ "name": "Seth",
+ "children": [
+ {
+ "name": "Enos"
+ },
+ {
+ "name": "Noam"
+ }
+ ]
+ },
+ {
+ "name": "Abel"
+ },
+ {
+ "name": "Awan",
+ "children": [
+ {
+ "name": "Enoch"
+ }
+ ]
+ },
+ {
+ "name": "Azura"
+ }
+ ]
+}
+```
+
+The specified *children* accessor function is invoked for each datum, starting with the root *data*, and must return an array of data representing the children, or null if the current datum has no children. If *children* is not specified, it defaults to:
+
+```js
+function children(d) {
+ return d.children;
+}
+```
+
+The returned node and each descendant has the following properties:
+
+* *node*.data - the associated data, as specified to the [constructor](#hierarchy).
+* *node*.depth - zero for the root node, and increasing by one for each descendant generation.
+* *node*.height - zero for leaf nodes, and the greatest distance from any descendant leaf for internal nodes.
+* *node*.parent - the parent node, or null for the root node.
+* *node*.children - an array of child nodes, if any; undefined for leaf nodes.
+* *node*.value - the summed value of the node and its [descendants](#node_descendants); optional, see [*node*.sum](#node_sum) and [*node*.count](#node_count).
+
+This method can also be used to test if a node is an `instanceof d3.hierarchy` and to extend the node prototype.
+
+#node.ancestors() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/ancestors.js), [Examples](https://observablehq.com/@d3/d3-hierarchy)
+
+Returns the array of ancestors nodes, starting with this node, then followed by each parent up to the root.
+
+#node.descendants() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/descendants.js), [Examples](https://observablehq.com/@d3/d3-hierarchy)
+
+Returns the array of descendant nodes, starting with this node, then followed by each child in topological order.
+
+#node.leaves() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/leaves.js), [Examples](https://observablehq.com/@d3/d3-hierarchy)
+
+Returns the array of leaf nodes in traversal order; leaves are nodes with no children.
+
+#node.path(target) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/path.js), [Examples](https://observablehq.com/@d3/d3-hierarchy)
+
+Returns the shortest path through the hierarchy from this *node* to the specified *target* node. The path starts at this *node*, ascends to the least common ancestor of this *node* and the *target* node, and then descends to the *target* node. This is particularly useful for [hierarchical edge bundling](https://observablehq.com/@d3/hierarchical-edge-bundling).
+
+#node.links() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/links.js), [Examples](https://observablehq.com/@d3/d3-hierarchy)
+
+Returns an array of links for this *node*, where each *link* is an object that defines source and target properties. The source of each link is the parent node, and the target is a child node.
+
+#node.sum(value) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/sum.js), [Examples](https://observablehq.com/@d3/visiting-a-d3-hierarchy)
+
+Evaluates the specified *value* function for this *node* and each descendant in [post-order traversal](#node_eachAfter), and returns this *node*. The *node*.value property of each node is set to the numeric value returned by the specified function plus the combined value of all children. The function is passed the node’s data, and must return a non-negative number. The *value* accessor is evaluated for *node* and every descendant, including internal nodes; if you only want leaf nodes to have internal value, then return zero for any node with children. [For example](https://observablehq.com/@d3/treemap-by-count), as an alternative to [*node*.count](#node_count):
+
+```js
+root.sum(function(d) { return d.value ? 1 : 0; });
+```
+
+You must call *node*.sum or [*node*.count](#node_count) before invoking a hierarchical layout that requires *node*.value, such as [d3.treemap](#treemap). Since the API supports [method chaining](https://en.wikipedia.org/wiki/Method_chaining), you can invoke *node*.sum and [*node*.sort](#node_sort) before computing the layout, and then subsequently generate an array of all [descendant nodes](#node_descendants) like so:
+
+```js
+var treemap = d3.treemap()
+ .size([width, height])
+ .padding(2);
+
+var nodes = treemap(root
+ .sum(function(d) { return d.value; })
+ .sort(function(a, b) { return b.height - a.height || b.value - a.value; }))
+ .descendants();
+```
+
+This example assumes that the node data has a value field.
+
+#node.count() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/count.js), [Examples](https://observablehq.com/@d3/visiting-a-d3-hierarchy)
+
+Computes the number of leaves under this *node* and assigns it to *node*.value, and similarly for every descendant of *node*. If this *node* is a leaf, its count is one. Returns this *node*. See also [*node*.sum](#node_sum).
+
+#node.sort(compare) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/sort.js), [Examples](https://observablehq.com/@d3/visiting-a-d3-hierarchy)
+
+Sorts the children of this *node*, if any, and each of this *node*’s descendants’ children, in [pre-order traversal](#node_eachBefore) using the specified *compare* function, and returns this *node*. The specified function is passed two nodes *a* and *b* to compare. If *a* should be before *b*, the function must return a value less than zero; if *b* should be before *a*, the function must return a value greater than zero; otherwise, the relative order of *a* and *b* are not specified. See [*array*.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) for more.
+
+Unlike [*node*.sum](#node_sum), the *compare* function is passed two [nodes](#hierarchy) rather than two nodes’ data. For example, if the data has a value property, this sorts nodes by the descending aggregate value of the node and all its descendants, as is recommended for [circle-packing](#pack):
+
+```js
+root
+ .sum(function(d) { return d.value; })
+ .sort(function(a, b) { return b.value - a.value; });
+``````
+
+Similarly, to sort nodes by descending height (greatest distance from any descendant leaf) and then descending value, as is recommended for [treemaps](#treemap) and [icicles](#partition):
+
+```js
+root
+ .sum(function(d) { return d.value; })
+ .sort(function(a, b) { return b.height - a.height || b.value - a.value; });
+```
+
+To sort nodes by descending height and then ascending id, as is recommended for [trees](#tree) and [dendrograms](#cluster):
+
+```js
+root
+ .sum(function(d) { return d.value; })
+ .sort(function(a, b) { return b.height - a.height || a.id.localeCompare(b.id); });
+```
+
+You must call *node*.sort before invoking a hierarchical layout if you want the new sort order to affect the layout; see [*node*.sum](#node_sum) for an example.
+
+#node.each(function) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/each.js), [Examples](https://observablehq.com/@d3/visiting-a-d3-hierarchy)
+
+Invokes the specified *function* for *node* and each descendant in [breadth-first order](https://en.wikipedia.org/wiki/Breadth-first_search), such that a given *node* is only visited if all nodes of lesser depth have already been visited, as well as all preceding nodes of the same depth. The specified function is passed the current *node*.
+
+#node.eachAfter(function) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/eachAfter.js), [Examples](https://observablehq.com/@d3/visiting-a-d3-hierarchy)
+
+Invokes the specified *function* for *node* and each descendant in [post-order traversal](https://en.wikipedia.org/wiki/Tree_traversal#Post-order), such that a given *node* is only visited after all of its descendants have already been visited. The specified function is passed the current *node*.
+
+#node.eachBefore(function) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/eachBefore.js), [Examples](https://observablehq.com/@d3/visiting-a-d3-hierarchy)
+
+Invokes the specified *function* for *node* and each descendant in [pre-order traversal](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order), such that a given *node* is only visited after all of its ancestors have already been visited. The specified function is passed the current *node*.
+
+#node.copy() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/hierarchy/index.js), [Examples](https://observablehq.com/@d3/d3-hierarchy)
+
+Return a deep copy of the subtree starting at this *node*. (The returned deep copy shares the same data, however.) The returned node is the root of a new tree; the returned node’s parent is always null and its depth is always zero.
+
+#### Stratify
+
+Consider the following table of relationships:
+
+Name | Parent
+------|--------
+Eve |
+Cain | Eve
+Seth | Eve
+Enos | Seth
+Noam | Seth
+Abel | Eve
+Awan | Eve
+Enoch | Awan
+Azura | Eve
+
+These names are conveniently unique, so we can unambiguously represent the hierarchy as a CSV file:
+
+```
+name,parent
+Eve,
+Cain,Eve
+Seth,Eve
+Enos,Seth
+Noam,Seth
+Abel,Eve
+Awan,Eve
+Enoch,Awan
+Azura,Eve
+```
+
+To parse the CSV using [d3.csvParse](https://github.com/d3/d3-dsv#csvParse):
+
+```js
+var table = d3.csvParse(text);
+```
+
+This returns:
+
+```json
+[
+ {"name": "Eve", "parent": ""},
+ {"name": "Cain", "parent": "Eve"},
+ {"name": "Seth", "parent": "Eve"},
+ {"name": "Enos", "parent": "Seth"},
+ {"name": "Noam", "parent": "Seth"},
+ {"name": "Abel", "parent": "Eve"},
+ {"name": "Awan", "parent": "Eve"},
+ {"name": "Enoch", "parent": "Awan"},
+ {"name": "Azura", "parent": "Eve"}
+]
+```
+
+To convert to a hierarchy:
+
+```js
+var root = d3.stratify()
+ .id(function(d) { return d.name; })
+ .parentId(function(d) { return d.parent; })
+ (table);
+```
+
+This returns:
+
+[](https://runkit.com/mbostock/56fed33d8630b01300f72daa)
+
+This hierarchy can now be passed to a hierarchical layout, such as [d3.tree](#_tree), for visualization.
+
+# d3.stratify() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/stratify.js), [Examples](https://observablehq.com/@d3/d3-stratify)
+
+Constructs a new stratify operator with the default settings.
+
+#stratify(data) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/stratify.js), [Examples](https://observablehq.com/@d3/d3-stratify)
+
+Generates a new hierarchy from the specified tabular *data*.
+
+#stratify.id([id]) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/stratify.js), [Examples](https://observablehq.com/@d3/d3-stratify)
+
+If *id* is specified, sets the id accessor to the given function and returns this stratify operator. Otherwise, returns the current id accessor, which defaults to:
+
+```js
+function id(d) {
+ return d.id;
+}
+```
+
+The id accessor is invoked for each element in the input data passed to the [stratify operator](#_stratify), being passed the current datum (*d*) and the current index (*i*). The returned string is then used to identify the node’s relationships in conjunction with the [parent id](#stratify_parentId). For leaf nodes, the id may be undefined; otherwise, the id must be unique. (Null and the empty string are equivalent to undefined.)
+
+#stratify.parentId([parentId]) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/stratify.js), [Examples](https://observablehq.com/@d3/d3-stratify)
+
+If *parentId* is specified, sets the parent id accessor to the given function and returns this stratify operator. Otherwise, returns the current parent id accessor, which defaults to:
+
+```js
+function parentId(d) {
+ return d.parentId;
+}
+```
+
+The parent id accessor is invoked for each element in the input data passed to the [stratify operator](#_stratify), being passed the current datum (*d*) and the current index (*i*). The returned string is then used to identify the node’s relationships in conjunction with the [id](#stratify_id). For the root node, the parent id should be undefined. (Null and the empty string are equivalent to undefined.) There must be exactly one root node in the input data, and no circular relationships.
+
+### Cluster
+
+[](https://observablehq.com/@d3/cluster-dendrogram)
+
+The **cluster layout** produces [dendrograms](http://en.wikipedia.org/wiki/Dendrogram): node-link diagrams that place leaf nodes of the tree at the same depth. Dendrograms are typically less compact than [tidy trees](#tree), but are useful when all the leaves should be at the same level, such as for hierarchical clustering or [phylogenetic tree diagrams](https://observablehq.com/@mbostock/tree-of-life).
+
+# d3.cluster() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/cluster.js), [Examples](https://observablehq.com/@d3/cluster-dendrogram)
+
+Creates a new cluster layout with default settings.
+
+#cluster(root)
+
+Lays out the specified *root* [hierarchy](#hierarchy), assigning the following properties on *root* and its descendants:
+
+* *node*.x - the *x*-coordinate of the node
+* *node*.y - the *y*-coordinate of the node
+
+The coordinates *x* and *y* represent an arbitrary coordinate system; for example, you can treat *x* as an angle and *y* as a radius to produce a [radial layout](https://observablehq.com/@d3/radial-dendrogram). You may want to call [*root*.sort](#node_sort) before passing the hierarchy to the cluster layout.
+
+#cluster.size([size])
+
+If *size* is specified, sets this cluster layout’s size to the specified two-element array of numbers [*width*, *height*] and returns this cluster layout. If *size* is not specified, returns the current layout size, which defaults to [1, 1]. A layout size of null indicates that a [node size](#cluster_nodeSize) will be used instead. The coordinates *x* and *y* represent an arbitrary coordinate system; for example, to produce a [radial layout](https://observablehq.com/@d3/radial-dendrogram), a size of [360, *radius*] corresponds to a breadth of 360° and a depth of *radius*.
+
+#cluster.nodeSize([size])
+
+If *size* is specified, sets this cluster layout’s node size to the specified two-element array of numbers [*width*, *height*] and returns this cluster layout. If *size* is not specified, returns the current node size, which defaults to null. A node size of null indicates that a [layout size](#cluster_size) will be used instead. When a node size is specified, the root node is always positioned at ⟨0, 0⟩.
+
+#cluster.separation([separation])
+
+If *separation* is specified, sets the separation accessor to the specified function and returns this cluster layout. If *separation* is not specified, returns the current separation accessor, which defaults to:
+
+```js
+function separation(a, b) {
+ return a.parent == b.parent ? 1 : 2;
+}
+```
+
+The separation accessor is used to separate neighboring leaves. The separation function is passed two leaves *a* and *b*, and must return the desired separation. The nodes are typically siblings, though the nodes may be more distantly related if the layout decides to place such nodes adjacent.
+
+### Tree
+
+[](https://observablehq.com/@d3/tidy-tree)
+
+The **tree** layout produces tidy node-link diagrams of trees using the [Reingold–Tilford “tidy” algorithm](http://reingold.co/tidier-drawings.pdf), improved to run in linear time by [Buchheim *et al.*](http://dirk.jivas.de/papers/buchheim02improving.pdf) Tidy trees are typically more compact than [dendrograms](#cluster).
+
+# d3.tree() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/tree.js), [Examples](https://observablehq.com/@d3/tidy-tree)
+
+Creates a new tree layout with default settings.
+
+#tree(root)
+
+Lays out the specified *root* [hierarchy](#hierarchy), assigning the following properties on *root* and its descendants:
+
+* *node*.x - the *x*-coordinate of the node
+* *node*.y - the *y*-coordinate of the node
+
+The coordinates *x* and *y* represent an arbitrary coordinate system; for example, you can treat *x* as an angle and *y* as a radius to produce a [radial layout](https://observablehq.com/@d3/radial-tidy-tree). You may want to call [*root*.sort](#node_sort) before passing the hierarchy to the tree layout.
+
+#tree.size([size])
+
+If *size* is specified, sets this tree layout’s size to the specified two-element array of numbers [*width*, *height*] and returns this tree layout. If *size* is not specified, returns the current layout size, which defaults to [1, 1]. A layout size of null indicates that a [node size](#tree_nodeSize) will be used instead. The coordinates *x* and *y* represent an arbitrary coordinate system; for example, to produce a [radial layout](https://observablehq.com/@d3/radial-tidy-tree), a size of [360, *radius*] corresponds to a breadth of 360° and a depth of *radius*.
+
+#tree.nodeSize([size])
+
+If *size* is specified, sets this tree layout’s node size to the specified two-element array of numbers [*width*, *height*] and returns this tree layout. If *size* is not specified, returns the current node size, which defaults to null. A node size of null indicates that a [layout size](#tree_size) will be used instead. When a node size is specified, the root node is always positioned at ⟨0, 0⟩.
+
+#tree.separation([separation])
+
+If *separation* is specified, sets the separation accessor to the specified function and returns this tree layout. If *separation* is not specified, returns the current separation accessor, which defaults to:
+
+```js
+function separation(a, b) {
+ return a.parent == b.parent ? 1 : 2;
+}
+```
+
+A variation that is more appropriate for radial layouts reduces the separation gap proportionally to the radius:
+
+```js
+function separation(a, b) {
+ return (a.parent == b.parent ? 1 : 2) / a.depth;
+}
+```
+
+The separation accessor is used to separate neighboring nodes. The separation function is passed two nodes *a* and *b*, and must return the desired separation. The nodes are typically siblings, though the nodes may be more distantly related if the layout decides to place such nodes adjacent.
+
+### Treemap
+
+[](https://observablehq.com/@d3/treemap)
+
+Introduced by [Ben Shneiderman](http://www.cs.umd.edu/hcil/treemap-history/) in 1991, a **treemap** recursively subdivides area into rectangles according to each node’s associated value. D3’s treemap implementation supports an extensible [tiling method](#treemap_tile): the default [squarified](#treemapSquarify) method seeks to generate rectangles with a [golden](https://en.wikipedia.org/wiki/Golden_ratio) aspect ratio; this offers better readability and size estimation than [slice-and-dice](#treemapSliceDice), which simply alternates between horizontal and vertical subdivision by depth.
+
+# d3.treemap() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/treemap/index.js), [Examples](https://observablehq.com/@d3/treemap)
+
+Creates a new treemap layout with default settings.
+
+#treemap(root)
+
+Lays out the specified *root* [hierarchy](#hierarchy), assigning the following properties on *root* and its descendants:
+
+* *node*.x0 - the left edge of the rectangle
+* *node*.y0 - the top edge of the rectangle
+* *node*.x1 - the right edge of the rectangle
+* *node*.y1 - the bottom edge of the rectangle
+
+You must call [*root*.sum](#node_sum) before passing the hierarchy to the treemap layout. You probably also want to call [*root*.sort](#node_sort) to order the hierarchy before computing the layout.
+
+#treemap.tile([tile])
+
+If *tile* is specified, sets the [tiling method](#treemap-tiling) to the specified function and returns this treemap layout. If *tile* is not specified, returns the current tiling method, which defaults to [d3.treemapSquarify](#treemapSquarify) with the golden ratio.
+
+#treemap.size([size])
+
+If *size* is specified, sets this treemap layout’s size to the specified two-element array of numbers [*width*, *height*] and returns this treemap layout. If *size* is not specified, returns the current size, which defaults to [1, 1].
+
+#treemap.round([round])
+
+If *round* is specified, enables or disables rounding according to the given boolean and returns this treemap layout. If *round* is not specified, returns the current rounding state, which defaults to false.
+
+#treemap.padding([padding])
+
+If *padding* is specified, sets the [inner](#treemap_paddingInner) and [outer](#treemap_paddingOuter) padding to the specified number or function and returns this treemap layout. If *padding* is not specified, returns the current inner padding function.
+
+#treemap.paddingInner([padding])
+
+If *padding* is specified, sets the inner padding to the specified number or function and returns this treemap layout. If *padding* is not specified, returns the current inner padding function, which defaults to the constant zero. If *padding* is a function, it is invoked for each node with children, being passed the current node. The inner padding is used to separate a node’s adjacent children.
+
+#treemap.paddingOuter([padding])
+
+If *padding* is specified, sets the [top](#treemap_paddingTop), [right](#treemap_paddingRight), [bottom](#treemap_paddingBottom) and [left](#treemap_paddingLeft) padding to the specified number or function and returns this treemap layout. If *padding* is not specified, returns the current top padding function.
+
+#treemap.paddingTop([padding])
+
+If *padding* is specified, sets the top padding to the specified number or function and returns this treemap layout. If *padding* is not specified, returns the current top padding function, which defaults to the constant zero. If *padding* is a function, it is invoked for each node with children, being passed the current node. The top padding is used to separate the top edge of a node from its children.
+
+#treemap.paddingRight([padding])
+
+If *padding* is specified, sets the right padding to the specified number or function and returns this treemap layout. If *padding* is not specified, returns the current right padding function, which defaults to the constant zero. If *padding* is a function, it is invoked for each node with children, being passed the current node. The right padding is used to separate the right edge of a node from its children.
+
+#treemap.paddingBottom([padding])
+
+If *padding* is specified, sets the bottom padding to the specified number or function and returns this treemap layout. If *padding* is not specified, returns the current bottom padding function, which defaults to the constant zero. If *padding* is a function, it is invoked for each node with children, being passed the current node. The bottom padding is used to separate the bottom edge of a node from its children.
+
+#treemap.paddingLeft([padding])
+
+If *padding* is specified, sets the left padding to the specified number or function and returns this treemap layout. If *padding* is not specified, returns the current left padding function, which defaults to the constant zero. If *padding* is a function, it is invoked for each node with children, being passed the current node. The left padding is used to separate the left edge of a node from its children.
+
+#### Treemap Tiling
+
+Several built-in tiling methods are provided for use with [*treemap*.tile](#treemap_tile).
+
+# d3.treemapBinary(node, x0, y0, x1, y1) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/treemap/binary.js), [Examples](https://observablehq.com/@d3/treemap)
+
+Recursively partitions the specified *nodes* into an approximately-balanced binary tree, choosing horizontal partitioning for wide rectangles and vertical partitioning for tall rectangles.
+
+# d3.treemapDice(node, x0, y0, x1, y1) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/treemap/dice.js), [Examples](https://observablehq.com/@d3/treemap)
+
+Divides the rectangular area specified by *x0*, *y0*, *x1*, *y1* horizontally according the value of each of the specified *node*’s children. The children are positioned in order, starting with the left edge (*x0*) of the given rectangle. If the sum of the children’s values is less than the specified *node*’s value (*i.e.*, if the specified *node* has a non-zero internal value), the remaining empty space will be positioned on the right edge (*x1*) of the given rectangle.
+
+# d3.treemapSlice(node, x0, y0, x1, y1) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/treemap/slice.js), [Examples](https://observablehq.com/@d3/treemap)
+
+Divides the rectangular area specified by *x0*, *y0*, *x1*, *y1* vertically according the value of each of the specified *node*’s children. The children are positioned in order, starting with the top edge (*y0*) of the given rectangle. If the sum of the children’s values is less than the specified *node*’s value (*i.e.*, if the specified *node* has a non-zero internal value), the remaining empty space will be positioned on the bottom edge (*y1*) of the given rectangle.
+
+# d3.treemapSliceDice(node, x0, y0, x1, y1) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/treemap/sliceDice.js), [Examples](https://observablehq.com/@d3/treemap)
+
+If the specified *node* has odd depth, delegates to [treemapSlice](#treemapSlice); otherwise delegates to [treemapDice](#treemapDice).
+
+# d3.treemapSquarify(node, x0, y0, x1, y1) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/treemap/squarify.js), [Examples](https://observablehq.com/@d3/treemap)
+
+Implements the [squarified treemap](https://www.win.tue.nl/~vanwijk/stm.pdf) algorithm by Bruls *et al.*, which seeks to produce rectangles of a given [aspect ratio](#squarify_ratio).
+
+# d3.treemapResquarify(node, x0, y0, x1, y1) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/treemap/resquarify.js), [Examples](https://observablehq.com/@d3/animated-treemap)
+
+Like [d3.treemapSquarify](#treemapSquarify), except preserves the topology (node adjacencies) of the previous layout computed by d3.treemapResquarify, if there is one and it used the same [target aspect ratio](#squarify_ratio). This tiling method is good for animating changes to treemaps because it only changes node sizes and not their relative positions, thus avoiding distracting shuffling and occlusion. The downside of a stable update, however, is a suboptimal layout for subsequent updates: only the first layout uses the Bruls *et al.* squarified algorithm.
+
+#squarify.ratio(ratio) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/treemap/squarify.js), [Examples](https://observablehq.com/@d3/treemap)
+
+Specifies the desired aspect ratio of the generated rectangles. The *ratio* must be specified as a number greater than or equal to one. Note that the orientation of the generated rectangles (tall or wide) is not implied by the ratio; for example, a ratio of two will attempt to produce a mixture of rectangles whose *width*:*height* ratio is either 2:1 or 1:2. (However, you can approximately achieve this result by generating a square treemap at different dimensions, and then [stretching the treemap](https://observablehq.com/@d3/stretched-treemap) to the desired aspect ratio.) Furthermore, the specified *ratio* is merely a hint to the tiling algorithm; the rectangles are not guaranteed to have the specified aspect ratio. If not specified, the aspect ratio defaults to the golden ratio, φ = (1 + sqrt(5)) / 2, per [Kong *et al.*](http://vis.stanford.edu/papers/perception-treemaps)
+
+### Partition
+
+[](https://observablehq.com/@d3/icicle)
+
+The **partition layout** produces adjacency diagrams: a space-filling variant of a node-link tree diagram. Rather than drawing a link between parent and child in the hierarchy, nodes are drawn as solid areas (either arcs or rectangles), and their placement relative to other nodes reveals their position in the hierarchy. The size of the nodes encodes a quantitative dimension that would be difficult to show in a node-link diagram.
+
+# d3.partition() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/partition.js), [Examples](https://observablehq.com/@d3/icicle)
+
+Creates a new partition layout with the default settings.
+
+#partition(root)
+
+Lays out the specified *root* [hierarchy](#hierarchy), assigning the following properties on *root* and its descendants:
+
+* *node*.x0 - the left edge of the rectangle
+* *node*.y0 - the top edge of the rectangle
+* *node*.x1 - the right edge of the rectangle
+* *node*.y1 - the bottom edge of the rectangle
+
+You must call [*root*.sum](#node_sum) before passing the hierarchy to the partition layout. You probably also want to call [*root*.sort](#node_sort) to order the hierarchy before computing the layout.
+
+#partition.size([size])
+
+If *size* is specified, sets this partition layout’s size to the specified two-element array of numbers [*width*, *height*] and returns this partition layout. If *size* is not specified, returns the current size, which defaults to [1, 1].
+
+#partition.round([round])
+
+If *round* is specified, enables or disables rounding according to the given boolean and returns this partition layout. If *round* is not specified, returns the current rounding state, which defaults to false.
+
+#partition.padding([padding])
+
+If *padding* is specified, sets the padding to the specified number and returns this partition layout. If *padding* is not specified, returns the current padding, which defaults to zero. The padding is used to separate a node’s adjacent children.
+
+### Pack
+
+[](https://observablehq.com/@d3/circle-packing)
+
+Enclosure diagrams use containment (nesting) to represent a hierarchy. The size of the leaf circles encodes a quantitative dimension of the data. The enclosing circles show the approximate cumulative size of each subtree, but due to wasted space there is some distortion; only the leaf nodes can be compared accurately. Although [circle packing](http://en.wikipedia.org/wiki/Circle_packing) does not use space as efficiently as a [treemap](#treemap), the “wasted” space more prominently reveals the hierarchical structure.
+
+# d3.pack() · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/pack/index.js), [Examples](https://observablehq.com/@d3/circle-packing)
+
+Creates a new pack layout with the default settings.
+
+#pack(root)
+
+Lays out the specified *root* [hierarchy](#hierarchy), assigning the following properties on *root* and its descendants:
+
+* *node*.x - the *x*-coordinate of the circle’s center
+* *node*.y - the *y*-coordinate of the circle’s center
+* *node*.r - the radius of the circle
+
+You must call [*root*.sum](#node_sum) before passing the hierarchy to the pack layout. You probably also want to call [*root*.sort](#node_sort) to order the hierarchy before computing the layout.
+
+#pack.radius([radius])
+
+If *radius* is specified, sets the pack layout’s radius accessor to the specified function and returns this pack layout. If *radius* is not specified, returns the current radius accessor, which defaults to null. If the radius accessor is null, the radius of each leaf circle is derived from the leaf *node*.value (computed by [*node*.sum](#node_sum)); the radii are then scaled proportionally to fit the [layout size](#pack_size). If the radius accessor is not null, the radius of each leaf circle is specified exactly by the function.
+
+#pack.size([size])
+
+If *size* is specified, sets this pack layout’s size to the specified two-element array of numbers [*width*, *height*] and returns this pack layout. If *size* is not specified, returns the current size, which defaults to [1, 1].
+
+#pack.padding([padding])
+
+If *padding* is specified, sets this pack layout’s padding accessor to the specified number or function and returns this pack layout. If *padding* is not specified, returns the current padding accessor, which defaults to the constant zero. When siblings are packed, tangent siblings will be separated by approximately the specified padding; the enclosing parent circle will also be separated from its children by approximately the specified padding. If an [explicit radius](#pack_radius) is not specified, the padding is approximate because a two-pass algorithm is needed to fit within the [layout size](#pack_size): the circles are first packed without padding; a scaling factor is computed and applied to the specified padding; and lastly the circles are re-packed with padding.
+
+# d3.packSiblings(circles) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/pack/siblings.js)
+
+Packs the specified array of *circles*, each of which must have a *circle*.r property specifying the circle’s radius. Assigns the following properties to each circle:
+
+* *circle*.x - the *x*-coordinate of the circle’s center
+* *circle*.y - the *y*-coordinate of the circle’s center
+
+The circles are positioned according to the front-chain packing algorithm by [Wang *et al.*](https://dl.acm.org/citation.cfm?id=1124851)
+
+# d3.packEnclose(circles) · [Source](https://github.com/d3/d3-hierarchy/blob/master/src/pack/enclose.js), [Examples](https://observablehq.com/@d3/d3-packenclose)
+
+Computes the [smallest circle](https://en.wikipedia.org/wiki/Smallest-circle_problem) that encloses the specified array of *circles*, each of which must have a *circle*.r property specifying the circle’s radius, and *circle*.x and *circle*.y properties specifying the circle’s center. The enclosing circle is computed using the [Matoušek-Sharir-Welzl algorithm](http://www.inf.ethz.ch/personal/emo/PublFiles/SubexLinProg_ALG16_96.pdf). (See also [Apollonius’ Problem](https://bl.ocks.org/mbostock/751fdd637f4bc2e3f08b).)
diff --git a/node_modules/d3-hierarchy/dist/d3-hierarchy.js b/node_modules/d3-hierarchy/dist/d3-hierarchy.js
new file mode 100644
index 0000000000000000000000000000000000000000..85e185f17a5cefe5efc9d23fcd86ca6136a40388
--- /dev/null
+++ b/node_modules/d3-hierarchy/dist/d3-hierarchy.js
@@ -0,0 +1,1290 @@
+// https://d3js.org/d3-hierarchy/ v1.1.9 Copyright 2019 Mike Bostock
+(function (global, factory) {
+typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+typeof define === 'function' && define.amd ? define(['exports'], factory) :
+(global = global || self, factory(global.d3 = global.d3 || {}));
+}(this, function (exports) { 'use strict';
+
+function defaultSeparation(a, b) {
+ return a.parent === b.parent ? 1 : 2;
+}
+
+function meanX(children) {
+ return children.reduce(meanXReduce, 0) / children.length;
+}
+
+function meanXReduce(x, c) {
+ return x + c.x;
+}
+
+function maxY(children) {
+ return 1 + children.reduce(maxYReduce, 0);
+}
+
+function maxYReduce(y, c) {
+ return Math.max(y, c.y);
+}
+
+function leafLeft(node) {
+ var children;
+ while (children = node.children) node = children[0];
+ return node;
+}
+
+function leafRight(node) {
+ var children;
+ while (children = node.children) node = children[children.length - 1];
+ return node;
+}
+
+function cluster() {
+ var separation = defaultSeparation,
+ dx = 1,
+ dy = 1,
+ nodeSize = false;
+
+ function cluster(root) {
+ var previousNode,
+ x = 0;
+
+ // First walk, computing the initial x & y values.
+ root.eachAfter(function(node) {
+ var children = node.children;
+ if (children) {
+ node.x = meanX(children);
+ node.y = maxY(children);
+ } else {
+ node.x = previousNode ? x += separation(node, previousNode) : 0;
+ node.y = 0;
+ previousNode = node;
+ }
+ });
+
+ var left = leafLeft(root),
+ right = leafRight(root),
+ x0 = left.x - separation(left, right) / 2,
+ x1 = right.x + separation(right, left) / 2;
+
+ // Second walk, normalizing x & y to the desired size.
+ return root.eachAfter(nodeSize ? function(node) {
+ node.x = (node.x - root.x) * dx;
+ node.y = (root.y - node.y) * dy;
+ } : function(node) {
+ node.x = (node.x - x0) / (x1 - x0) * dx;
+ node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;
+ });
+ }
+
+ cluster.separation = function(x) {
+ return arguments.length ? (separation = x, cluster) : separation;
+ };
+
+ cluster.size = function(x) {
+ return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);
+ };
+
+ cluster.nodeSize = function(x) {
+ return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);
+ };
+
+ return cluster;
+}
+
+function count(node) {
+ var sum = 0,
+ children = node.children,
+ i = children && children.length;
+ if (!i) sum = 1;
+ else while (--i >= 0) sum += children[i].value;
+ node.value = sum;
+}
+
+function node_count() {
+ return this.eachAfter(count);
+}
+
+function node_each(callback) {
+ var node = this, current, next = [node], children, i, n;
+ do {
+ current = next.reverse(), next = [];
+ while (node = current.pop()) {
+ callback(node), children = node.children;
+ if (children) for (i = 0, n = children.length; i < n; ++i) {
+ next.push(children[i]);
+ }
+ }
+ } while (next.length);
+ return this;
+}
+
+function node_eachBefore(callback) {
+ var node = this, nodes = [node], children, i;
+ while (node = nodes.pop()) {
+ callback(node), children = node.children;
+ if (children) for (i = children.length - 1; i >= 0; --i) {
+ nodes.push(children[i]);
+ }
+ }
+ return this;
+}
+
+function node_eachAfter(callback) {
+ var node = this, nodes = [node], next = [], children, i, n;
+ while (node = nodes.pop()) {
+ next.push(node), children = node.children;
+ if (children) for (i = 0, n = children.length; i < n; ++i) {
+ nodes.push(children[i]);
+ }
+ }
+ while (node = next.pop()) {
+ callback(node);
+ }
+ return this;
+}
+
+function node_sum(value) {
+ return this.eachAfter(function(node) {
+ var sum = +value(node.data) || 0,
+ children = node.children,
+ i = children && children.length;
+ while (--i >= 0) sum += children[i].value;
+ node.value = sum;
+ });
+}
+
+function node_sort(compare) {
+ return this.eachBefore(function(node) {
+ if (node.children) {
+ node.children.sort(compare);
+ }
+ });
+}
+
+function node_path(end) {
+ var start = this,
+ ancestor = leastCommonAncestor(start, end),
+ nodes = [start];
+ while (start !== ancestor) {
+ start = start.parent;
+ nodes.push(start);
+ }
+ var k = nodes.length;
+ while (end !== ancestor) {
+ nodes.splice(k, 0, end);
+ end = end.parent;
+ }
+ return nodes;
+}
+
+function leastCommonAncestor(a, b) {
+ if (a === b) return a;
+ var aNodes = a.ancestors(),
+ bNodes = b.ancestors(),
+ c = null;
+ a = aNodes.pop();
+ b = bNodes.pop();
+ while (a === b) {
+ c = a;
+ a = aNodes.pop();
+ b = bNodes.pop();
+ }
+ return c;
+}
+
+function node_ancestors() {
+ var node = this, nodes = [node];
+ while (node = node.parent) {
+ nodes.push(node);
+ }
+ return nodes;
+}
+
+function node_descendants() {
+ var nodes = [];
+ this.each(function(node) {
+ nodes.push(node);
+ });
+ return nodes;
+}
+
+function node_leaves() {
+ var leaves = [];
+ this.eachBefore(function(node) {
+ if (!node.children) {
+ leaves.push(node);
+ }
+ });
+ return leaves;
+}
+
+function node_links() {
+ var root = this, links = [];
+ root.each(function(node) {
+ if (node !== root) { // Don’t include the root’s parent, if any.
+ links.push({source: node.parent, target: node});
+ }
+ });
+ return links;
+}
+
+function hierarchy(data, children) {
+ var root = new Node(data),
+ valued = +data.value && (root.value = data.value),
+ node,
+ nodes = [root],
+ child,
+ childs,
+ i,
+ n;
+
+ if (children == null) children = defaultChildren;
+
+ while (node = nodes.pop()) {
+ if (valued) node.value = +node.data.value;
+ if ((childs = children(node.data)) && (n = childs.length)) {
+ node.children = new Array(n);
+ for (i = n - 1; i >= 0; --i) {
+ nodes.push(child = node.children[i] = new Node(childs[i]));
+ child.parent = node;
+ child.depth = node.depth + 1;
+ }
+ }
+ }
+
+ return root.eachBefore(computeHeight);
+}
+
+function node_copy() {
+ return hierarchy(this).eachBefore(copyData);
+}
+
+function defaultChildren(d) {
+ return d.children;
+}
+
+function copyData(node) {
+ node.data = node.data.data;
+}
+
+function computeHeight(node) {
+ var height = 0;
+ do node.height = height;
+ while ((node = node.parent) && (node.height < ++height));
+}
+
+function Node(data) {
+ this.data = data;
+ this.depth =
+ this.height = 0;
+ this.parent = null;
+}
+
+Node.prototype = hierarchy.prototype = {
+ constructor: Node,
+ count: node_count,
+ each: node_each,
+ eachAfter: node_eachAfter,
+ eachBefore: node_eachBefore,
+ sum: node_sum,
+ sort: node_sort,
+ path: node_path,
+ ancestors: node_ancestors,
+ descendants: node_descendants,
+ leaves: node_leaves,
+ links: node_links,
+ copy: node_copy
+};
+
+var slice = Array.prototype.slice;
+
+function shuffle(array) {
+ var m = array.length,
+ t,
+ i;
+
+ while (m) {
+ i = Math.random() * m-- | 0;
+ t = array[m];
+ array[m] = array[i];
+ array[i] = t;
+ }
+
+ return array;
+}
+
+function enclose(circles) {
+ var i = 0, n = (circles = shuffle(slice.call(circles))).length, B = [], p, e;
+
+ while (i < n) {
+ p = circles[i];
+ if (e && enclosesWeak(e, p)) ++i;
+ else e = encloseBasis(B = extendBasis(B, p)), i = 0;
+ }
+
+ return e;
+}
+
+function extendBasis(B, p) {
+ var i, j;
+
+ if (enclosesWeakAll(p, B)) return [p];
+
+ // If we get here then B must have at least one element.
+ for (i = 0; i < B.length; ++i) {
+ if (enclosesNot(p, B[i])
+ && enclosesWeakAll(encloseBasis2(B[i], p), B)) {
+ return [B[i], p];
+ }
+ }
+
+ // If we get here then B must have at least two elements.
+ for (i = 0; i < B.length - 1; ++i) {
+ for (j = i + 1; j < B.length; ++j) {
+ if (enclosesNot(encloseBasis2(B[i], B[j]), p)
+ && enclosesNot(encloseBasis2(B[i], p), B[j])
+ && enclosesNot(encloseBasis2(B[j], p), B[i])
+ && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {
+ return [B[i], B[j], p];
+ }
+ }
+ }
+
+ // If we get here then something is very wrong.
+ throw new Error;
+}
+
+function enclosesNot(a, b) {
+ var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;
+ return dr < 0 || dr * dr < dx * dx + dy * dy;
+}
+
+function enclosesWeak(a, b) {
+ var dr = a.r - b.r + 1e-6, dx = b.x - a.x, dy = b.y - a.y;
+ return dr > 0 && dr * dr > dx * dx + dy * dy;
+}
+
+function enclosesWeakAll(a, B) {
+ for (var i = 0; i < B.length; ++i) {
+ if (!enclosesWeak(a, B[i])) {
+ return false;
+ }
+ }
+ return true;
+}
+
+function encloseBasis(B) {
+ switch (B.length) {
+ case 1: return encloseBasis1(B[0]);
+ case 2: return encloseBasis2(B[0], B[1]);
+ case 3: return encloseBasis3(B[0], B[1], B[2]);
+ }
+}
+
+function encloseBasis1(a) {
+ return {
+ x: a.x,
+ y: a.y,
+ r: a.r
+ };
+}
+
+function encloseBasis2(a, b) {
+ var x1 = a.x, y1 = a.y, r1 = a.r,
+ x2 = b.x, y2 = b.y, r2 = b.r,
+ x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,
+ l = Math.sqrt(x21 * x21 + y21 * y21);
+ return {
+ x: (x1 + x2 + x21 / l * r21) / 2,
+ y: (y1 + y2 + y21 / l * r21) / 2,
+ r: (l + r1 + r2) / 2
+ };
+}
+
+function encloseBasis3(a, b, c) {
+ var x1 = a.x, y1 = a.y, r1 = a.r,
+ x2 = b.x, y2 = b.y, r2 = b.r,
+ x3 = c.x, y3 = c.y, r3 = c.r,
+ a2 = x1 - x2,
+ a3 = x1 - x3,
+ b2 = y1 - y2,
+ b3 = y1 - y3,
+ c2 = r2 - r1,
+ c3 = r3 - r1,
+ d1 = x1 * x1 + y1 * y1 - r1 * r1,
+ d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,
+ d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,
+ ab = a3 * b2 - a2 * b3,
+ xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,
+ xb = (b3 * c2 - b2 * c3) / ab,
+ ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,
+ yb = (a2 * c3 - a3 * c2) / ab,
+ A = xb * xb + yb * yb - 1,
+ B = 2 * (r1 + xa * xb + ya * yb),
+ C = xa * xa + ya * ya - r1 * r1,
+ r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);
+ return {
+ x: x1 + xa + xb * r,
+ y: y1 + ya + yb * r,
+ r: r
+ };
+}
+
+function place(b, a, c) {
+ var dx = b.x - a.x, x, a2,
+ dy = b.y - a.y, y, b2,
+ d2 = dx * dx + dy * dy;
+ if (d2) {
+ a2 = a.r + c.r, a2 *= a2;
+ b2 = b.r + c.r, b2 *= b2;
+ if (a2 > b2) {
+ x = (d2 + b2 - a2) / (2 * d2);
+ y = Math.sqrt(Math.max(0, b2 / d2 - x * x));
+ c.x = b.x - x * dx - y * dy;
+ c.y = b.y - x * dy + y * dx;
+ } else {
+ x = (d2 + a2 - b2) / (2 * d2);
+ y = Math.sqrt(Math.max(0, a2 / d2 - x * x));
+ c.x = a.x + x * dx - y * dy;
+ c.y = a.y + x * dy + y * dx;
+ }
+ } else {
+ c.x = a.x + c.r;
+ c.y = a.y;
+ }
+}
+
+function intersects(a, b) {
+ var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;
+ return dr > 0 && dr * dr > dx * dx + dy * dy;
+}
+
+function score(node) {
+ var a = node._,
+ b = node.next._,
+ ab = a.r + b.r,
+ dx = (a.x * b.r + b.x * a.r) / ab,
+ dy = (a.y * b.r + b.y * a.r) / ab;
+ return dx * dx + dy * dy;
+}
+
+function Node$1(circle) {
+ this._ = circle;
+ this.next = null;
+ this.previous = null;
+}
+
+function packEnclose(circles) {
+ if (!(n = circles.length)) return 0;
+
+ var a, b, c, n, aa, ca, i, j, k, sj, sk;
+
+ // Place the first circle.
+ a = circles[0], a.x = 0, a.y = 0;
+ if (!(n > 1)) return a.r;
+
+ // Place the second circle.
+ b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;
+ if (!(n > 2)) return a.r + b.r;
+
+ // Place the third circle.
+ place(b, a, c = circles[2]);
+
+ // Initialize the front-chain using the first three circles a, b and c.
+ a = new Node$1(a), b = new Node$1(b), c = new Node$1(c);
+ a.next = c.previous = b;
+ b.next = a.previous = c;
+ c.next = b.previous = a;
+
+ // Attempt to place each remaining circle…
+ pack: for (i = 3; i < n; ++i) {
+ place(a._, b._, c = circles[i]), c = new Node$1(c);
+
+ // Find the closest intersecting circle on the front-chain, if any.
+ // “Closeness” is determined by linear distance along the front-chain.
+ // “Ahead” or “behind” is likewise determined by linear distance.
+ j = b.next, k = a.previous, sj = b._.r, sk = a._.r;
+ do {
+ if (sj <= sk) {
+ if (intersects(j._, c._)) {
+ b = j, a.next = b, b.previous = a, --i;
+ continue pack;
+ }
+ sj += j._.r, j = j.next;
+ } else {
+ if (intersects(k._, c._)) {
+ a = k, a.next = b, b.previous = a, --i;
+ continue pack;
+ }
+ sk += k._.r, k = k.previous;
+ }
+ } while (j !== k.next);
+
+ // Success! Insert the new circle c between a and b.
+ c.previous = a, c.next = b, a.next = b.previous = b = c;
+
+ // Compute the new closest circle pair to the centroid.
+ aa = score(a);
+ while ((c = c.next) !== b) {
+ if ((ca = score(c)) < aa) {
+ a = c, aa = ca;
+ }
+ }
+ b = a.next;
+ }
+
+ // Compute the enclosing circle of the front chain.
+ a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = enclose(a);
+
+ // Translate the circles to put the enclosing circle around the origin.
+ for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;
+
+ return c.r;
+}
+
+function siblings(circles) {
+ packEnclose(circles);
+ return circles;
+}
+
+function optional(f) {
+ return f == null ? null : required(f);
+}
+
+function required(f) {
+ if (typeof f !== "function") throw new Error;
+ return f;
+}
+
+function constantZero() {
+ return 0;
+}
+
+function constant(x) {
+ return function() {
+ return x;
+ };
+}
+
+function defaultRadius(d) {
+ return Math.sqrt(d.value);
+}
+
+function index() {
+ var radius = null,
+ dx = 1,
+ dy = 1,
+ padding = constantZero;
+
+ function pack(root) {
+ root.x = dx / 2, root.y = dy / 2;
+ if (radius) {
+ root.eachBefore(radiusLeaf(radius))
+ .eachAfter(packChildren(padding, 0.5))
+ .eachBefore(translateChild(1));
+ } else {
+ root.eachBefore(radiusLeaf(defaultRadius))
+ .eachAfter(packChildren(constantZero, 1))
+ .eachAfter(packChildren(padding, root.r / Math.min(dx, dy)))
+ .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));
+ }
+ return root;
+ }
+
+ pack.radius = function(x) {
+ return arguments.length ? (radius = optional(x), pack) : radius;
+ };
+
+ pack.size = function(x) {
+ return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];
+ };
+
+ pack.padding = function(x) {
+ return arguments.length ? (padding = typeof x === "function" ? x : constant(+x), pack) : padding;
+ };
+
+ return pack;
+}
+
+function radiusLeaf(radius) {
+ return function(node) {
+ if (!node.children) {
+ node.r = Math.max(0, +radius(node) || 0);
+ }
+ };
+}
+
+function packChildren(padding, k) {
+ return function(node) {
+ if (children = node.children) {
+ var children,
+ i,
+ n = children.length,
+ r = padding(node) * k || 0,
+ e;
+
+ if (r) for (i = 0; i < n; ++i) children[i].r += r;
+ e = packEnclose(children);
+ if (r) for (i = 0; i < n; ++i) children[i].r -= r;
+ node.r = e + r;
+ }
+ };
+}
+
+function translateChild(k) {
+ return function(node) {
+ var parent = node.parent;
+ node.r *= k;
+ if (parent) {
+ node.x = parent.x + k * node.x;
+ node.y = parent.y + k * node.y;
+ }
+ };
+}
+
+function roundNode(node) {
+ node.x0 = Math.round(node.x0);
+ node.y0 = Math.round(node.y0);
+ node.x1 = Math.round(node.x1);
+ node.y1 = Math.round(node.y1);
+}
+
+function treemapDice(parent, x0, y0, x1, y1) {
+ var nodes = parent.children,
+ node,
+ i = -1,
+ n = nodes.length,
+ k = parent.value && (x1 - x0) / parent.value;
+
+ while (++i < n) {
+ node = nodes[i], node.y0 = y0, node.y1 = y1;
+ node.x0 = x0, node.x1 = x0 += node.value * k;
+ }
+}
+
+function partition() {
+ var dx = 1,
+ dy = 1,
+ padding = 0,
+ round = false;
+
+ function partition(root) {
+ var n = root.height + 1;
+ root.x0 =
+ root.y0 = padding;
+ root.x1 = dx;
+ root.y1 = dy / n;
+ root.eachBefore(positionNode(dy, n));
+ if (round) root.eachBefore(roundNode);
+ return root;
+ }
+
+ function positionNode(dy, n) {
+ return function(node) {
+ if (node.children) {
+ treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);
+ }
+ var x0 = node.x0,
+ y0 = node.y0,
+ x1 = node.x1 - padding,
+ y1 = node.y1 - padding;
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
+ node.x0 = x0;
+ node.y0 = y0;
+ node.x1 = x1;
+ node.y1 = y1;
+ };
+ }
+
+ partition.round = function(x) {
+ return arguments.length ? (round = !!x, partition) : round;
+ };
+
+ partition.size = function(x) {
+ return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];
+ };
+
+ partition.padding = function(x) {
+ return arguments.length ? (padding = +x, partition) : padding;
+ };
+
+ return partition;
+}
+
+var keyPrefix = "$", // Protect against keys like “__proto__”.
+ preroot = {depth: -1},
+ ambiguous = {};
+
+function defaultId(d) {
+ return d.id;
+}
+
+function defaultParentId(d) {
+ return d.parentId;
+}
+
+function stratify() {
+ var id = defaultId,
+ parentId = defaultParentId;
+
+ function stratify(data) {
+ var d,
+ i,
+ n = data.length,
+ root,
+ parent,
+ node,
+ nodes = new Array(n),
+ nodeId,
+ nodeKey,
+ nodeByKey = {};
+
+ for (i = 0; i < n; ++i) {
+ d = data[i], node = nodes[i] = new Node(d);
+ if ((nodeId = id(d, i, data)) != null && (nodeId += "")) {
+ nodeKey = keyPrefix + (node.id = nodeId);
+ nodeByKey[nodeKey] = nodeKey in nodeByKey ? ambiguous : node;
+ }
+ }
+
+ for (i = 0; i < n; ++i) {
+ node = nodes[i], nodeId = parentId(data[i], i, data);
+ if (nodeId == null || !(nodeId += "")) {
+ if (root) throw new Error("multiple roots");
+ root = node;
+ } else {
+ parent = nodeByKey[keyPrefix + nodeId];
+ if (!parent) throw new Error("missing: " + nodeId);
+ if (parent === ambiguous) throw new Error("ambiguous: " + nodeId);
+ if (parent.children) parent.children.push(node);
+ else parent.children = [node];
+ node.parent = parent;
+ }
+ }
+
+ if (!root) throw new Error("no root");
+ root.parent = preroot;
+ root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight);
+ root.parent = null;
+ if (n > 0) throw new Error("cycle");
+
+ return root;
+ }
+
+ stratify.id = function(x) {
+ return arguments.length ? (id = required(x), stratify) : id;
+ };
+
+ stratify.parentId = function(x) {
+ return arguments.length ? (parentId = required(x), stratify) : parentId;
+ };
+
+ return stratify;
+}
+
+function defaultSeparation$1(a, b) {
+ return a.parent === b.parent ? 1 : 2;
+}
+
+// function radialSeparation(a, b) {
+// return (a.parent === b.parent ? 1 : 2) / a.depth;
+// }
+
+// This function is used to traverse the left contour of a subtree (or
+// subforest). It returns the successor of v on this contour. This successor is
+// either given by the leftmost child of v or by the thread of v. The function
+// returns null if and only if v is on the highest level of its subtree.
+function nextLeft(v) {
+ var children = v.children;
+ return children ? children[0] : v.t;
+}
+
+// This function works analogously to nextLeft.
+function nextRight(v) {
+ var children = v.children;
+ return children ? children[children.length - 1] : v.t;
+}
+
+// Shifts the current subtree rooted at w+. This is done by increasing
+// prelim(w+) and mod(w+) by shift.
+function moveSubtree(wm, wp, shift) {
+ var change = shift / (wp.i - wm.i);
+ wp.c -= change;
+ wp.s += shift;
+ wm.c += change;
+ wp.z += shift;
+ wp.m += shift;
+}
+
+// All other shifts, applied to the smaller subtrees between w- and w+, are
+// performed by this function. To prepare the shifts, we have to adjust
+// change(w+), shift(w+), and change(w-).
+function executeShifts(v) {
+ var shift = 0,
+ change = 0,
+ children = v.children,
+ i = children.length,
+ w;
+ while (--i >= 0) {
+ w = children[i];
+ w.z += shift;
+ w.m += shift;
+ shift += w.s + (change += w.c);
+ }
+}
+
+// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,
+// returns the specified (default) ancestor.
+function nextAncestor(vim, v, ancestor) {
+ return vim.a.parent === v.parent ? vim.a : ancestor;
+}
+
+function TreeNode(node, i) {
+ this._ = node;
+ this.parent = null;
+ this.children = null;
+ this.A = null; // default ancestor
+ this.a = this; // ancestor
+ this.z = 0; // prelim
+ this.m = 0; // mod
+ this.c = 0; // change
+ this.s = 0; // shift
+ this.t = null; // thread
+ this.i = i; // number
+}
+
+TreeNode.prototype = Object.create(Node.prototype);
+
+function treeRoot(root) {
+ var tree = new TreeNode(root, 0),
+ node,
+ nodes = [tree],
+ child,
+ children,
+ i,
+ n;
+
+ while (node = nodes.pop()) {
+ if (children = node._.children) {
+ node.children = new Array(n = children.length);
+ for (i = n - 1; i >= 0; --i) {
+ nodes.push(child = node.children[i] = new TreeNode(children[i], i));
+ child.parent = node;
+ }
+ }
+ }
+
+ (tree.parent = new TreeNode(null, 0)).children = [tree];
+ return tree;
+}
+
+// Node-link tree diagram using the Reingold-Tilford "tidy" algorithm
+function tree() {
+ var separation = defaultSeparation$1,
+ dx = 1,
+ dy = 1,
+ nodeSize = null;
+
+ function tree(root) {
+ var t = treeRoot(root);
+
+ // Compute the layout using Buchheim et al.’s algorithm.
+ t.eachAfter(firstWalk), t.parent.m = -t.z;
+ t.eachBefore(secondWalk);
+
+ // If a fixed node size is specified, scale x and y.
+ if (nodeSize) root.eachBefore(sizeNode);
+
+ // If a fixed tree size is specified, scale x and y based on the extent.
+ // Compute the left-most, right-most, and depth-most nodes for extents.
+ else {
+ var left = root,
+ right = root,
+ bottom = root;
+ root.eachBefore(function(node) {
+ if (node.x < left.x) left = node;
+ if (node.x > right.x) right = node;
+ if (node.depth > bottom.depth) bottom = node;
+ });
+ var s = left === right ? 1 : separation(left, right) / 2,
+ tx = s - left.x,
+ kx = dx / (right.x + s + tx),
+ ky = dy / (bottom.depth || 1);
+ root.eachBefore(function(node) {
+ node.x = (node.x + tx) * kx;
+ node.y = node.depth * ky;
+ });
+ }
+
+ return root;
+ }
+
+ // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is
+ // applied recursively to the children of v, as well as the function
+ // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the
+ // node v is placed to the midpoint of its outermost children.
+ function firstWalk(v) {
+ var children = v.children,
+ siblings = v.parent.children,
+ w = v.i ? siblings[v.i - 1] : null;
+ if (children) {
+ executeShifts(v);
+ var midpoint = (children[0].z + children[children.length - 1].z) / 2;
+ if (w) {
+ v.z = w.z + separation(v._, w._);
+ v.m = v.z - midpoint;
+ } else {
+ v.z = midpoint;
+ }
+ } else if (w) {
+ v.z = w.z + separation(v._, w._);
+ }
+ v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
+ }
+
+ // Computes all real x-coordinates by summing up the modifiers recursively.
+ function secondWalk(v) {
+ v._.x = v.z + v.parent.m;
+ v.m += v.parent.m;
+ }
+
+ // The core of the algorithm. Here, a new subtree is combined with the
+ // previous subtrees. Threads are used to traverse the inside and outside
+ // contours of the left and right subtree up to the highest common level. The
+ // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the
+ // superscript o means outside and i means inside, the subscript - means left
+ // subtree and + means right subtree. For summing up the modifiers along the
+ // contour, we use respective variables si+, si-, so-, and so+. Whenever two
+ // nodes of the inside contours conflict, we compute the left one of the
+ // greatest uncommon ancestors using the function ANCESTOR and call MOVE
+ // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.
+ // Finally, we add a new thread (if necessary).
+ function apportion(v, w, ancestor) {
+ if (w) {
+ var vip = v,
+ vop = v,
+ vim = w,
+ vom = vip.parent.children[0],
+ sip = vip.m,
+ sop = vop.m,
+ sim = vim.m,
+ som = vom.m,
+ shift;
+ while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {
+ vom = nextLeft(vom);
+ vop = nextRight(vop);
+ vop.a = v;
+ shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
+ if (shift > 0) {
+ moveSubtree(nextAncestor(vim, v, ancestor), v, shift);
+ sip += shift;
+ sop += shift;
+ }
+ sim += vim.m;
+ sip += vip.m;
+ som += vom.m;
+ sop += vop.m;
+ }
+ if (vim && !nextRight(vop)) {
+ vop.t = vim;
+ vop.m += sim - sop;
+ }
+ if (vip && !nextLeft(vom)) {
+ vom.t = vip;
+ vom.m += sip - som;
+ ancestor = v;
+ }
+ }
+ return ancestor;
+ }
+
+ function sizeNode(node) {
+ node.x *= dx;
+ node.y = node.depth * dy;
+ }
+
+ tree.separation = function(x) {
+ return arguments.length ? (separation = x, tree) : separation;
+ };
+
+ tree.size = function(x) {
+ return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);
+ };
+
+ tree.nodeSize = function(x) {
+ return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);
+ };
+
+ return tree;
+}
+
+function treemapSlice(parent, x0, y0, x1, y1) {
+ var nodes = parent.children,
+ node,
+ i = -1,
+ n = nodes.length,
+ k = parent.value && (y1 - y0) / parent.value;
+
+ while (++i < n) {
+ node = nodes[i], node.x0 = x0, node.x1 = x1;
+ node.y0 = y0, node.y1 = y0 += node.value * k;
+ }
+}
+
+var phi = (1 + Math.sqrt(5)) / 2;
+
+function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
+ var rows = [],
+ nodes = parent.children,
+ row,
+ nodeValue,
+ i0 = 0,
+ i1 = 0,
+ n = nodes.length,
+ dx, dy,
+ value = parent.value,
+ sumValue,
+ minValue,
+ maxValue,
+ newRatio,
+ minRatio,
+ alpha,
+ beta;
+
+ while (i0 < n) {
+ dx = x1 - x0, dy = y1 - y0;
+
+ // Find the next non-empty node.
+ do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);
+ minValue = maxValue = sumValue;
+ alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
+ beta = sumValue * sumValue * alpha;
+ minRatio = Math.max(maxValue / beta, beta / minValue);
+
+ // Keep adding nodes while the aspect ratio maintains or improves.
+ for (; i1 < n; ++i1) {
+ sumValue += nodeValue = nodes[i1].value;
+ if (nodeValue < minValue) minValue = nodeValue;
+ if (nodeValue > maxValue) maxValue = nodeValue;
+ beta = sumValue * sumValue * alpha;
+ newRatio = Math.max(maxValue / beta, beta / minValue);
+ if (newRatio > minRatio) { sumValue -= nodeValue; break; }
+ minRatio = newRatio;
+ }
+
+ // Position and record the row orientation.
+ rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});
+ if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
+ else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
+ value -= sumValue, i0 = i1;
+ }
+
+ return rows;
+}
+
+var squarify = (function custom(ratio) {
+
+ function squarify(parent, x0, y0, x1, y1) {
+ squarifyRatio(ratio, parent, x0, y0, x1, y1);
+ }
+
+ squarify.ratio = function(x) {
+ return custom((x = +x) > 1 ? x : 1);
+ };
+
+ return squarify;
+})(phi);
+
+function index$1() {
+ var tile = squarify,
+ round = false,
+ dx = 1,
+ dy = 1,
+ paddingStack = [0],
+ paddingInner = constantZero,
+ paddingTop = constantZero,
+ paddingRight = constantZero,
+ paddingBottom = constantZero,
+ paddingLeft = constantZero;
+
+ function treemap(root) {
+ root.x0 =
+ root.y0 = 0;
+ root.x1 = dx;
+ root.y1 = dy;
+ root.eachBefore(positionNode);
+ paddingStack = [0];
+ if (round) root.eachBefore(roundNode);
+ return root;
+ }
+
+ function positionNode(node) {
+ var p = paddingStack[node.depth],
+ x0 = node.x0 + p,
+ y0 = node.y0 + p,
+ x1 = node.x1 - p,
+ y1 = node.y1 - p;
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
+ node.x0 = x0;
+ node.y0 = y0;
+ node.x1 = x1;
+ node.y1 = y1;
+ if (node.children) {
+ p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
+ x0 += paddingLeft(node) - p;
+ y0 += paddingTop(node) - p;
+ x1 -= paddingRight(node) - p;
+ y1 -= paddingBottom(node) - p;
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
+ tile(node, x0, y0, x1, y1);
+ }
+ }
+
+ treemap.round = function(x) {
+ return arguments.length ? (round = !!x, treemap) : round;
+ };
+
+ treemap.size = function(x) {
+ return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
+ };
+
+ treemap.tile = function(x) {
+ return arguments.length ? (tile = required(x), treemap) : tile;
+ };
+
+ treemap.padding = function(x) {
+ return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
+ };
+
+ treemap.paddingInner = function(x) {
+ return arguments.length ? (paddingInner = typeof x === "function" ? x : constant(+x), treemap) : paddingInner;
+ };
+
+ treemap.paddingOuter = function(x) {
+ return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
+ };
+
+ treemap.paddingTop = function(x) {
+ return arguments.length ? (paddingTop = typeof x === "function" ? x : constant(+x), treemap) : paddingTop;
+ };
+
+ treemap.paddingRight = function(x) {
+ return arguments.length ? (paddingRight = typeof x === "function" ? x : constant(+x), treemap) : paddingRight;
+ };
+
+ treemap.paddingBottom = function(x) {
+ return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant(+x), treemap) : paddingBottom;
+ };
+
+ treemap.paddingLeft = function(x) {
+ return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant(+x), treemap) : paddingLeft;
+ };
+
+ return treemap;
+}
+
+function binary(parent, x0, y0, x1, y1) {
+ var nodes = parent.children,
+ i, n = nodes.length,
+ sum, sums = new Array(n + 1);
+
+ for (sums[0] = sum = i = 0; i < n; ++i) {
+ sums[i + 1] = sum += nodes[i].value;
+ }
+
+ partition(0, n, parent.value, x0, y0, x1, y1);
+
+ function partition(i, j, value, x0, y0, x1, y1) {
+ if (i >= j - 1) {
+ var node = nodes[i];
+ node.x0 = x0, node.y0 = y0;
+ node.x1 = x1, node.y1 = y1;
+ return;
+ }
+
+ var valueOffset = sums[i],
+ valueTarget = (value / 2) + valueOffset,
+ k = i + 1,
+ hi = j - 1;
+
+ while (k < hi) {
+ var mid = k + hi >>> 1;
+ if (sums[mid] < valueTarget) k = mid + 1;
+ else hi = mid;
+ }
+
+ if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;
+
+ var valueLeft = sums[k] - valueOffset,
+ valueRight = value - valueLeft;
+
+ if ((x1 - x0) > (y1 - y0)) {
+ var xk = (x0 * valueRight + x1 * valueLeft) / value;
+ partition(i, k, valueLeft, x0, y0, xk, y1);
+ partition(k, j, valueRight, xk, y0, x1, y1);
+ } else {
+ var yk = (y0 * valueRight + y1 * valueLeft) / value;
+ partition(i, k, valueLeft, x0, y0, x1, yk);
+ partition(k, j, valueRight, x0, yk, x1, y1);
+ }
+ }
+}
+
+function sliceDice(parent, x0, y0, x1, y1) {
+ (parent.depth & 1 ? treemapSlice : treemapDice)(parent, x0, y0, x1, y1);
+}
+
+var resquarify = (function custom(ratio) {
+
+ function resquarify(parent, x0, y0, x1, y1) {
+ if ((rows = parent._squarify) && (rows.ratio === ratio)) {
+ var rows,
+ row,
+ nodes,
+ i,
+ j = -1,
+ n,
+ m = rows.length,
+ value = parent.value;
+
+ while (++j < m) {
+ row = rows[j], nodes = row.children;
+ for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;
+ if (row.dice) treemapDice(row, x0, y0, x1, y0 += (y1 - y0) * row.value / value);
+ else treemapSlice(row, x0, y0, x0 += (x1 - x0) * row.value / value, y1);
+ value -= row.value;
+ }
+ } else {
+ parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);
+ rows.ratio = ratio;
+ }
+ }
+
+ resquarify.ratio = function(x) {
+ return custom((x = +x) > 1 ? x : 1);
+ };
+
+ return resquarify;
+})(phi);
+
+exports.cluster = cluster;
+exports.hierarchy = hierarchy;
+exports.pack = index;
+exports.packEnclose = enclose;
+exports.packSiblings = siblings;
+exports.partition = partition;
+exports.stratify = stratify;
+exports.tree = tree;
+exports.treemap = index$1;
+exports.treemapBinary = binary;
+exports.treemapDice = treemapDice;
+exports.treemapResquarify = resquarify;
+exports.treemapSlice = treemapSlice;
+exports.treemapSliceDice = sliceDice;
+exports.treemapSquarify = squarify;
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+}));
diff --git a/node_modules/d3-hierarchy/dist/d3-hierarchy.min.js b/node_modules/d3-hierarchy/dist/d3-hierarchy.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..e6cec6ecd58e13a444fcf993c9defe276da7c97d
--- /dev/null
+++ b/node_modules/d3-hierarchy/dist/d3-hierarchy.min.js
@@ -0,0 +1,2 @@
+// https://d3js.org/d3-hierarchy/ v1.1.9 Copyright 2019 Mike Bostock
+!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((n=n||self).d3=n.d3||{})}(this,function(n){"use strict";function r(n,r){return n.parent===r.parent?1:2}function e(n,r){return n+r.x}function t(n,r){return Math.max(n,r.y)}function u(n){var r=0,e=n.children,t=e&&e.length;if(t)for(;--t>=0;)r+=e[t].value;else r=1;n.value=r}function i(n,r){var e,t,u,i,a,h=new c(n),l=+n.value&&(h.value=n.value),p=[h];for(null==r&&(r=o);e=p.pop();)if(l&&(e.value=+e.data.value),(u=r(e.data))&&(a=u.length))for(e.children=new Array(a),i=a-1;i>=0;--i)p.push(t=e.children[i]=new c(u[i])),t.parent=e,t.depth=e.depth+1;return h.eachBefore(f)}function o(n){return n.children}function a(n){n.data=n.data.data}function f(n){var r=0;do{n.height=r}while((n=n.parent)&&n.height<++r)}function c(n){this.data=n,this.depth=this.height=0,this.parent=null}c.prototype=i.prototype={constructor:c,count:function(){return this.eachAfter(u)},each:function(n){var r,e,t,u,i=this,o=[i];do{for(r=o.reverse(),o=[];i=r.pop();)if(n(i),e=i.children)for(t=0,u=e.length;t=0;--e)u.push(r[e]);return this},sum:function(n){return this.eachAfter(function(r){for(var e=+n(r.data)||0,t=r.children,u=t&&t.length;--u>=0;)e+=t[u].value;r.value=e})},sort:function(n){return this.eachBefore(function(r){r.children&&r.children.sort(n)})},path:function(n){for(var r=this,e=function(n,r){if(n===r)return n;var e=n.ancestors(),t=r.ancestors(),u=null;for(n=e.pop(),r=t.pop();n===r;)u=n,n=e.pop(),r=t.pop();return u}(r,n),t=[r];r!==e;)r=r.parent,t.push(r);for(var u=t.length;n!==e;)t.splice(u,0,n),n=n.parent;return t},ancestors:function(){for(var n=this,r=[n];n=n.parent;)r.push(n);return r},descendants:function(){var n=[];return this.each(function(r){n.push(r)}),n},leaves:function(){var n=[];return this.eachBefore(function(r){r.children||n.push(r)}),n},links:function(){var n=this,r=[];return n.each(function(e){e!==n&&r.push({source:e.parent,target:e})}),r},copy:function(){return i(this).eachBefore(a)}};var h=Array.prototype.slice;function l(n){for(var r,e,t=0,u=(n=function(n){for(var r,e,t=n.length;t;)e=Math.random()*t--|0,r=n[t],n[t]=n[e],n[e]=r;return n}(h.call(n))).length,i=[];t0&&e*e>t*t+u*u}function v(n,r){for(var e=0;e(o*=o)?(t=(c+o-u)/(2*c),i=Math.sqrt(Math.max(0,o/c-t*t)),e.x=n.x-t*a-i*f,e.y=n.y-t*f+i*a):(t=(c+u-o)/(2*c),i=Math.sqrt(Math.max(0,u/c-t*t)),e.x=r.x+t*a-i*f,e.y=r.y+t*f+i*a)):(e.x=r.x+e.r,e.y=r.y)}function w(n,r){var e=n.r+r.r-1e-6,t=r.x-n.x,u=r.y-n.y;return e>0&&e*e>t*t+u*u}function _(n){var r=n._,e=n.next._,t=r.r+e.r,u=(r.x*e.r+e.x*r.r)/t,i=(r.y*e.r+e.y*r.r)/t;return u*u+i*i}function z(n){this._=n,this.next=null,this.previous=null}function B(n){if(!(u=n.length))return 0;var r,e,t,u,i,o,a,f,c,h,p;if((r=n[0]).x=0,r.y=0,!(u>1))return r.r;if(e=n[1],r.x=-e.r,e.x=r.r,e.y=0,!(u>2))return r.r+e.r;m(e,r,t=n[2]),r=new z(r),e=new z(e),t=new z(t),r.next=t.previous=e,e.next=r.previous=t,t.next=e.previous=r;n:for(a=3;ap&&(p=a),x=h*h*v,(d=Math.max(p/x,x/l))>s){h-=a;break}s=d}y.push(o={value:h,dice:f1?r:1)},e}(N);var V=function n(r){function e(n,e,t,u,i){if((o=n._squarify)&&o.ratio===r)for(var o,a,f,c,h,l=-1,p=o.length,d=n.value;++l
f-i){var g=(u*y+o*x)/t;n(r,d,x,u,i,g,f),n(d,e,y,g,i,o,f)}else{var m=(i*y+f*x)/t;n(r,d,x,u,i,o,m),n(d,e,y,u,m,o,f)}}(0,f,n.value,r,e,t,u)},n.treemapDice=j,n.treemapResquarify=V,n.treemapSlice=K,n.treemapSliceDice=function(n,r,e,t,u){(1&n.depth?K:j)(n,r,e,t,u)},n.treemapSquarify=U,Object.defineProperty(n,"__esModule",{value:!0})});
diff --git a/node_modules/d3-hierarchy/package.json b/node_modules/d3-hierarchy/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..de61fe2148be7c77b904c71aab6644f4ec56a3e6
--- /dev/null
+++ b/node_modules/d3-hierarchy/package.json
@@ -0,0 +1,50 @@
+{
+ "name": "d3-hierarchy",
+ "version": "1.1.9",
+ "description": "Layout algorithms for visualizing hierarchical data.",
+ "keywords": [
+ "d3",
+ "d3-module",
+ "layout",
+ "tree",
+ "treemap",
+ "hierarchy",
+ "infovis"
+ ],
+ "homepage": "https://d3js.org/d3-hierarchy/",
+ "license": "BSD-3-Clause",
+ "author": {
+ "name": "Mike Bostock",
+ "url": "http://bost.ocks.org/mike"
+ },
+ "main": "dist/d3-hierarchy.js",
+ "unpkg": "dist/d3-hierarchy.min.js",
+ "jsdelivr": "dist/d3-hierarchy.min.js",
+ "module": "src/index.js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/d3/d3-hierarchy.git"
+ },
+ "files": [
+ "dist/**/*.js",
+ "src/**/*.js"
+ ],
+ "scripts": {
+ "pretest": "rollup -c",
+ "test": "tape 'test/**/*-test.js' && eslint src test",
+ "prepublishOnly": "rm -rf dist && yarn test",
+ "postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"
+ },
+ "sideEffects": false,
+ "devDependencies": {
+ "benchmark": "^2.1.4",
+ "d3-array": "1.2.0 - 2",
+ "d3-dsv": "1",
+ "d3-queue": "3",
+ "d3-random": "1.1.0 - 2",
+ "eslint": "6",
+ "rollup": "1",
+ "rollup-plugin-terser": "5",
+ "tape": "4"
+ }
+}
diff --git a/node_modules/d3-hierarchy/src/accessors.js b/node_modules/d3-hierarchy/src/accessors.js
new file mode 100644
index 0000000000000000000000000000000000000000..369c414577d3d71337e8da94f27ed3711172b8f7
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/accessors.js
@@ -0,0 +1,8 @@
+export function optional(f) {
+ return f == null ? null : required(f);
+}
+
+export function required(f) {
+ if (typeof f !== "function") throw new Error;
+ return f;
+}
diff --git a/node_modules/d3-hierarchy/src/array.js b/node_modules/d3-hierarchy/src/array.js
new file mode 100644
index 0000000000000000000000000000000000000000..c015cc9ff62ec51377e14b1f09b963744ffb76f6
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/array.js
@@ -0,0 +1,16 @@
+export var slice = Array.prototype.slice;
+
+export function shuffle(array) {
+ var m = array.length,
+ t,
+ i;
+
+ while (m) {
+ i = Math.random() * m-- | 0;
+ t = array[m];
+ array[m] = array[i];
+ array[i] = t;
+ }
+
+ return array;
+}
diff --git a/node_modules/d3-hierarchy/src/cluster.js b/node_modules/d3-hierarchy/src/cluster.js
new file mode 100644
index 0000000000000000000000000000000000000000..f5a280e20542197dd052dad83c0ba021b16fb0bc
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/cluster.js
@@ -0,0 +1,84 @@
+function defaultSeparation(a, b) {
+ return a.parent === b.parent ? 1 : 2;
+}
+
+function meanX(children) {
+ return children.reduce(meanXReduce, 0) / children.length;
+}
+
+function meanXReduce(x, c) {
+ return x + c.x;
+}
+
+function maxY(children) {
+ return 1 + children.reduce(maxYReduce, 0);
+}
+
+function maxYReduce(y, c) {
+ return Math.max(y, c.y);
+}
+
+function leafLeft(node) {
+ var children;
+ while (children = node.children) node = children[0];
+ return node;
+}
+
+function leafRight(node) {
+ var children;
+ while (children = node.children) node = children[children.length - 1];
+ return node;
+}
+
+export default function() {
+ var separation = defaultSeparation,
+ dx = 1,
+ dy = 1,
+ nodeSize = false;
+
+ function cluster(root) {
+ var previousNode,
+ x = 0;
+
+ // First walk, computing the initial x & y values.
+ root.eachAfter(function(node) {
+ var children = node.children;
+ if (children) {
+ node.x = meanX(children);
+ node.y = maxY(children);
+ } else {
+ node.x = previousNode ? x += separation(node, previousNode) : 0;
+ node.y = 0;
+ previousNode = node;
+ }
+ });
+
+ var left = leafLeft(root),
+ right = leafRight(root),
+ x0 = left.x - separation(left, right) / 2,
+ x1 = right.x + separation(right, left) / 2;
+
+ // Second walk, normalizing x & y to the desired size.
+ return root.eachAfter(nodeSize ? function(node) {
+ node.x = (node.x - root.x) * dx;
+ node.y = (root.y - node.y) * dy;
+ } : function(node) {
+ node.x = (node.x - x0) / (x1 - x0) * dx;
+ node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;
+ });
+ }
+
+ cluster.separation = function(x) {
+ return arguments.length ? (separation = x, cluster) : separation;
+ };
+
+ cluster.size = function(x) {
+ return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);
+ };
+
+ cluster.nodeSize = function(x) {
+ return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);
+ };
+
+ return cluster;
+}
diff --git a/node_modules/d3-hierarchy/src/constant.js b/node_modules/d3-hierarchy/src/constant.js
new file mode 100644
index 0000000000000000000000000000000000000000..1d947c4f323e431d97da423e4f2fb831f1c184a8
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/constant.js
@@ -0,0 +1,9 @@
+export function constantZero() {
+ return 0;
+}
+
+export default function(x) {
+ return function() {
+ return x;
+ };
+}
diff --git a/node_modules/d3-hierarchy/src/hierarchy/ancestors.js b/node_modules/d3-hierarchy/src/hierarchy/ancestors.js
new file mode 100644
index 0000000000000000000000000000000000000000..f70c7264fef91462f98e9dc3ea0e4c2117aa2f2a
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/ancestors.js
@@ -0,0 +1,7 @@
+export default function() {
+ var node = this, nodes = [node];
+ while (node = node.parent) {
+ nodes.push(node);
+ }
+ return nodes;
+}
diff --git a/node_modules/d3-hierarchy/src/hierarchy/count.js b/node_modules/d3-hierarchy/src/hierarchy/count.js
new file mode 100644
index 0000000000000000000000000000000000000000..0b90f1bd9d334901a335aa40eacf7fe3164f208a
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/count.js
@@ -0,0 +1,12 @@
+function count(node) {
+ var sum = 0,
+ children = node.children,
+ i = children && children.length;
+ if (!i) sum = 1;
+ else while (--i >= 0) sum += children[i].value;
+ node.value = sum;
+}
+
+export default function() {
+ return this.eachAfter(count);
+}
diff --git a/node_modules/d3-hierarchy/src/hierarchy/descendants.js b/node_modules/d3-hierarchy/src/hierarchy/descendants.js
new file mode 100644
index 0000000000000000000000000000000000000000..1e3b5e6b43227f294bffd64928ba6ba138a3e1e0
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/descendants.js
@@ -0,0 +1,7 @@
+export default function() {
+ var nodes = [];
+ this.each(function(node) {
+ nodes.push(node);
+ });
+ return nodes;
+}
diff --git a/node_modules/d3-hierarchy/src/hierarchy/each.js b/node_modules/d3-hierarchy/src/hierarchy/each.js
new file mode 100644
index 0000000000000000000000000000000000000000..767e2da1c161f709b9d751ba91c15af43fa3fa12
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/each.js
@@ -0,0 +1,13 @@
+export default function(callback) {
+ var node = this, current, next = [node], children, i, n;
+ do {
+ current = next.reverse(), next = [];
+ while (node = current.pop()) {
+ callback(node), children = node.children;
+ if (children) for (i = 0, n = children.length; i < n; ++i) {
+ next.push(children[i]);
+ }
+ }
+ } while (next.length);
+ return this;
+}
diff --git a/node_modules/d3-hierarchy/src/hierarchy/eachAfter.js b/node_modules/d3-hierarchy/src/hierarchy/eachAfter.js
new file mode 100644
index 0000000000000000000000000000000000000000..4ad4f15cf1bed5d9c9fc0d750cb876d627fdad92
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/eachAfter.js
@@ -0,0 +1,13 @@
+export default function(callback) {
+ var node = this, nodes = [node], next = [], children, i, n;
+ while (node = nodes.pop()) {
+ next.push(node), children = node.children;
+ if (children) for (i = 0, n = children.length; i < n; ++i) {
+ nodes.push(children[i]);
+ }
+ }
+ while (node = next.pop()) {
+ callback(node);
+ }
+ return this;
+}
diff --git a/node_modules/d3-hierarchy/src/hierarchy/eachBefore.js b/node_modules/d3-hierarchy/src/hierarchy/eachBefore.js
new file mode 100644
index 0000000000000000000000000000000000000000..23c5ccd27c0fcc614d19a6cf091f08d8ea4f5b93
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/eachBefore.js
@@ -0,0 +1,10 @@
+export default function(callback) {
+ var node = this, nodes = [node], children, i;
+ while (node = nodes.pop()) {
+ callback(node), children = node.children;
+ if (children) for (i = children.length - 1; i >= 0; --i) {
+ nodes.push(children[i]);
+ }
+ }
+ return this;
+}
diff --git a/node_modules/d3-hierarchy/src/hierarchy/index.js b/node_modules/d3-hierarchy/src/hierarchy/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..e0ac026d4157f30e3f1cf2f6d77f0864cc5f6761
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/index.js
@@ -0,0 +1,79 @@
+import node_count from "./count.js";
+import node_each from "./each.js";
+import node_eachBefore from "./eachBefore.js";
+import node_eachAfter from "./eachAfter.js";
+import node_sum from "./sum.js";
+import node_sort from "./sort.js";
+import node_path from "./path.js";
+import node_ancestors from "./ancestors.js";
+import node_descendants from "./descendants.js";
+import node_leaves from "./leaves.js";
+import node_links from "./links.js";
+
+export default function hierarchy(data, children) {
+ var root = new Node(data),
+ valued = +data.value && (root.value = data.value),
+ node,
+ nodes = [root],
+ child,
+ childs,
+ i,
+ n;
+
+ if (children == null) children = defaultChildren;
+
+ while (node = nodes.pop()) {
+ if (valued) node.value = +node.data.value;
+ if ((childs = children(node.data)) && (n = childs.length)) {
+ node.children = new Array(n);
+ for (i = n - 1; i >= 0; --i) {
+ nodes.push(child = node.children[i] = new Node(childs[i]));
+ child.parent = node;
+ child.depth = node.depth + 1;
+ }
+ }
+ }
+
+ return root.eachBefore(computeHeight);
+}
+
+function node_copy() {
+ return hierarchy(this).eachBefore(copyData);
+}
+
+function defaultChildren(d) {
+ return d.children;
+}
+
+function copyData(node) {
+ node.data = node.data.data;
+}
+
+export function computeHeight(node) {
+ var height = 0;
+ do node.height = height;
+ while ((node = node.parent) && (node.height < ++height));
+}
+
+export function Node(data) {
+ this.data = data;
+ this.depth =
+ this.height = 0;
+ this.parent = null;
+}
+
+Node.prototype = hierarchy.prototype = {
+ constructor: Node,
+ count: node_count,
+ each: node_each,
+ eachAfter: node_eachAfter,
+ eachBefore: node_eachBefore,
+ sum: node_sum,
+ sort: node_sort,
+ path: node_path,
+ ancestors: node_ancestors,
+ descendants: node_descendants,
+ leaves: node_leaves,
+ links: node_links,
+ copy: node_copy
+};
diff --git a/node_modules/d3-hierarchy/src/hierarchy/leaves.js b/node_modules/d3-hierarchy/src/hierarchy/leaves.js
new file mode 100644
index 0000000000000000000000000000000000000000..401c5b537ca72ed3f54f9ddb8a14dbdf1e69cd4e
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/leaves.js
@@ -0,0 +1,9 @@
+export default function() {
+ var leaves = [];
+ this.eachBefore(function(node) {
+ if (!node.children) {
+ leaves.push(node);
+ }
+ });
+ return leaves;
+}
diff --git a/node_modules/d3-hierarchy/src/hierarchy/links.js b/node_modules/d3-hierarchy/src/hierarchy/links.js
new file mode 100644
index 0000000000000000000000000000000000000000..6fcb82fa63ffe0afad42f7fe644faa478206376a
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/links.js
@@ -0,0 +1,9 @@
+export default function() {
+ var root = this, links = [];
+ root.each(function(node) {
+ if (node !== root) { // Don’t include the root’s parent, if any.
+ links.push({source: node.parent, target: node});
+ }
+ });
+ return links;
+}
diff --git a/node_modules/d3-hierarchy/src/hierarchy/path.js b/node_modules/d3-hierarchy/src/hierarchy/path.js
new file mode 100644
index 0000000000000000000000000000000000000000..995891380a0ed3a60bbbd3b68363437170a5121b
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/path.js
@@ -0,0 +1,30 @@
+export default function(end) {
+ var start = this,
+ ancestor = leastCommonAncestor(start, end),
+ nodes = [start];
+ while (start !== ancestor) {
+ start = start.parent;
+ nodes.push(start);
+ }
+ var k = nodes.length;
+ while (end !== ancestor) {
+ nodes.splice(k, 0, end);
+ end = end.parent;
+ }
+ return nodes;
+}
+
+function leastCommonAncestor(a, b) {
+ if (a === b) return a;
+ var aNodes = a.ancestors(),
+ bNodes = b.ancestors(),
+ c = null;
+ a = aNodes.pop();
+ b = bNodes.pop();
+ while (a === b) {
+ c = a;
+ a = aNodes.pop();
+ b = bNodes.pop();
+ }
+ return c;
+}
diff --git a/node_modules/d3-hierarchy/src/hierarchy/sort.js b/node_modules/d3-hierarchy/src/hierarchy/sort.js
new file mode 100644
index 0000000000000000000000000000000000000000..5d0426d54943f7cde02d64b8ab9b6b7f92703142
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/sort.js
@@ -0,0 +1,7 @@
+export default function(compare) {
+ return this.eachBefore(function(node) {
+ if (node.children) {
+ node.children.sort(compare);
+ }
+ });
+}
diff --git a/node_modules/d3-hierarchy/src/hierarchy/sum.js b/node_modules/d3-hierarchy/src/hierarchy/sum.js
new file mode 100644
index 0000000000000000000000000000000000000000..350a965e6020d898f13bf9973de7e08445bbc067
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/hierarchy/sum.js
@@ -0,0 +1,9 @@
+export default function(value) {
+ return this.eachAfter(function(node) {
+ var sum = +value(node.data) || 0,
+ children = node.children,
+ i = children && children.length;
+ while (--i >= 0) sum += children[i].value;
+ node.value = sum;
+ });
+}
diff --git a/node_modules/d3-hierarchy/src/index.js b/node_modules/d3-hierarchy/src/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..cd4cca39e637eeda2b35986beae0546c42ed2b9f
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/index.js
@@ -0,0 +1,15 @@
+export {default as cluster} from "./cluster.js";
+export {default as hierarchy} from "./hierarchy/index.js";
+export {default as pack} from "./pack/index.js";
+export {default as packSiblings} from "./pack/siblings.js";
+export {default as packEnclose} from "./pack/enclose.js";
+export {default as partition} from "./partition.js";
+export {default as stratify} from "./stratify.js";
+export {default as tree} from "./tree.js";
+export {default as treemap} from "./treemap/index.js";
+export {default as treemapBinary} from "./treemap/binary.js";
+export {default as treemapDice} from "./treemap/dice.js";
+export {default as treemapSlice} from "./treemap/slice.js";
+export {default as treemapSliceDice} from "./treemap/sliceDice.js";
+export {default as treemapSquarify} from "./treemap/squarify.js";
+export {default as treemapResquarify} from "./treemap/resquarify.js";
diff --git a/node_modules/d3-hierarchy/src/pack/enclose.js b/node_modules/d3-hierarchy/src/pack/enclose.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8dbd2a6f9508aa056a6730ecfd45a87cffbbd04
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/pack/enclose.js
@@ -0,0 +1,118 @@
+import {shuffle, slice} from "../array.js";
+
+export default function(circles) {
+ var i = 0, n = (circles = shuffle(slice.call(circles))).length, B = [], p, e;
+
+ while (i < n) {
+ p = circles[i];
+ if (e && enclosesWeak(e, p)) ++i;
+ else e = encloseBasis(B = extendBasis(B, p)), i = 0;
+ }
+
+ return e;
+}
+
+function extendBasis(B, p) {
+ var i, j;
+
+ if (enclosesWeakAll(p, B)) return [p];
+
+ // If we get here then B must have at least one element.
+ for (i = 0; i < B.length; ++i) {
+ if (enclosesNot(p, B[i])
+ && enclosesWeakAll(encloseBasis2(B[i], p), B)) {
+ return [B[i], p];
+ }
+ }
+
+ // If we get here then B must have at least two elements.
+ for (i = 0; i < B.length - 1; ++i) {
+ for (j = i + 1; j < B.length; ++j) {
+ if (enclosesNot(encloseBasis2(B[i], B[j]), p)
+ && enclosesNot(encloseBasis2(B[i], p), B[j])
+ && enclosesNot(encloseBasis2(B[j], p), B[i])
+ && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {
+ return [B[i], B[j], p];
+ }
+ }
+ }
+
+ // If we get here then something is very wrong.
+ throw new Error;
+}
+
+function enclosesNot(a, b) {
+ var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;
+ return dr < 0 || dr * dr < dx * dx + dy * dy;
+}
+
+function enclosesWeak(a, b) {
+ var dr = a.r - b.r + 1e-6, dx = b.x - a.x, dy = b.y - a.y;
+ return dr > 0 && dr * dr > dx * dx + dy * dy;
+}
+
+function enclosesWeakAll(a, B) {
+ for (var i = 0; i < B.length; ++i) {
+ if (!enclosesWeak(a, B[i])) {
+ return false;
+ }
+ }
+ return true;
+}
+
+function encloseBasis(B) {
+ switch (B.length) {
+ case 1: return encloseBasis1(B[0]);
+ case 2: return encloseBasis2(B[0], B[1]);
+ case 3: return encloseBasis3(B[0], B[1], B[2]);
+ }
+}
+
+function encloseBasis1(a) {
+ return {
+ x: a.x,
+ y: a.y,
+ r: a.r
+ };
+}
+
+function encloseBasis2(a, b) {
+ var x1 = a.x, y1 = a.y, r1 = a.r,
+ x2 = b.x, y2 = b.y, r2 = b.r,
+ x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,
+ l = Math.sqrt(x21 * x21 + y21 * y21);
+ return {
+ x: (x1 + x2 + x21 / l * r21) / 2,
+ y: (y1 + y2 + y21 / l * r21) / 2,
+ r: (l + r1 + r2) / 2
+ };
+}
+
+function encloseBasis3(a, b, c) {
+ var x1 = a.x, y1 = a.y, r1 = a.r,
+ x2 = b.x, y2 = b.y, r2 = b.r,
+ x3 = c.x, y3 = c.y, r3 = c.r,
+ a2 = x1 - x2,
+ a3 = x1 - x3,
+ b2 = y1 - y2,
+ b3 = y1 - y3,
+ c2 = r2 - r1,
+ c3 = r3 - r1,
+ d1 = x1 * x1 + y1 * y1 - r1 * r1,
+ d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,
+ d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,
+ ab = a3 * b2 - a2 * b3,
+ xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,
+ xb = (b3 * c2 - b2 * c3) / ab,
+ ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,
+ yb = (a2 * c3 - a3 * c2) / ab,
+ A = xb * xb + yb * yb - 1,
+ B = 2 * (r1 + xa * xb + ya * yb),
+ C = xa * xa + ya * ya - r1 * r1,
+ r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);
+ return {
+ x: x1 + xa + xb * r,
+ y: y1 + ya + yb * r,
+ r: r
+ };
+}
diff --git a/node_modules/d3-hierarchy/src/pack/index.js b/node_modules/d3-hierarchy/src/pack/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..6ef2d7c99735d15982428abdca9951557b1d87f9
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/pack/index.js
@@ -0,0 +1,79 @@
+import {packEnclose} from "./siblings.js";
+import {optional} from "../accessors.js";
+import constant, {constantZero} from "../constant.js";
+
+function defaultRadius(d) {
+ return Math.sqrt(d.value);
+}
+
+export default function() {
+ var radius = null,
+ dx = 1,
+ dy = 1,
+ padding = constantZero;
+
+ function pack(root) {
+ root.x = dx / 2, root.y = dy / 2;
+ if (radius) {
+ root.eachBefore(radiusLeaf(radius))
+ .eachAfter(packChildren(padding, 0.5))
+ .eachBefore(translateChild(1));
+ } else {
+ root.eachBefore(radiusLeaf(defaultRadius))
+ .eachAfter(packChildren(constantZero, 1))
+ .eachAfter(packChildren(padding, root.r / Math.min(dx, dy)))
+ .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));
+ }
+ return root;
+ }
+
+ pack.radius = function(x) {
+ return arguments.length ? (radius = optional(x), pack) : radius;
+ };
+
+ pack.size = function(x) {
+ return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];
+ };
+
+ pack.padding = function(x) {
+ return arguments.length ? (padding = typeof x === "function" ? x : constant(+x), pack) : padding;
+ };
+
+ return pack;
+}
+
+function radiusLeaf(radius) {
+ return function(node) {
+ if (!node.children) {
+ node.r = Math.max(0, +radius(node) || 0);
+ }
+ };
+}
+
+function packChildren(padding, k) {
+ return function(node) {
+ if (children = node.children) {
+ var children,
+ i,
+ n = children.length,
+ r = padding(node) * k || 0,
+ e;
+
+ if (r) for (i = 0; i < n; ++i) children[i].r += r;
+ e = packEnclose(children);
+ if (r) for (i = 0; i < n; ++i) children[i].r -= r;
+ node.r = e + r;
+ }
+ };
+}
+
+function translateChild(k) {
+ return function(node) {
+ var parent = node.parent;
+ node.r *= k;
+ if (parent) {
+ node.x = parent.x + k * node.x;
+ node.y = parent.y + k * node.y;
+ }
+ };
+}
diff --git a/node_modules/d3-hierarchy/src/pack/siblings.js b/node_modules/d3-hierarchy/src/pack/siblings.js
new file mode 100644
index 0000000000000000000000000000000000000000..4488126d6c0b3fbb8c67a9f740d754c99d7ab8cd
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/pack/siblings.js
@@ -0,0 +1,118 @@
+import enclose from "./enclose.js";
+
+function place(b, a, c) {
+ var dx = b.x - a.x, x, a2,
+ dy = b.y - a.y, y, b2,
+ d2 = dx * dx + dy * dy;
+ if (d2) {
+ a2 = a.r + c.r, a2 *= a2;
+ b2 = b.r + c.r, b2 *= b2;
+ if (a2 > b2) {
+ x = (d2 + b2 - a2) / (2 * d2);
+ y = Math.sqrt(Math.max(0, b2 / d2 - x * x));
+ c.x = b.x - x * dx - y * dy;
+ c.y = b.y - x * dy + y * dx;
+ } else {
+ x = (d2 + a2 - b2) / (2 * d2);
+ y = Math.sqrt(Math.max(0, a2 / d2 - x * x));
+ c.x = a.x + x * dx - y * dy;
+ c.y = a.y + x * dy + y * dx;
+ }
+ } else {
+ c.x = a.x + c.r;
+ c.y = a.y;
+ }
+}
+
+function intersects(a, b) {
+ var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;
+ return dr > 0 && dr * dr > dx * dx + dy * dy;
+}
+
+function score(node) {
+ var a = node._,
+ b = node.next._,
+ ab = a.r + b.r,
+ dx = (a.x * b.r + b.x * a.r) / ab,
+ dy = (a.y * b.r + b.y * a.r) / ab;
+ return dx * dx + dy * dy;
+}
+
+function Node(circle) {
+ this._ = circle;
+ this.next = null;
+ this.previous = null;
+}
+
+export function packEnclose(circles) {
+ if (!(n = circles.length)) return 0;
+
+ var a, b, c, n, aa, ca, i, j, k, sj, sk;
+
+ // Place the first circle.
+ a = circles[0], a.x = 0, a.y = 0;
+ if (!(n > 1)) return a.r;
+
+ // Place the second circle.
+ b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;
+ if (!(n > 2)) return a.r + b.r;
+
+ // Place the third circle.
+ place(b, a, c = circles[2]);
+
+ // Initialize the front-chain using the first three circles a, b and c.
+ a = new Node(a), b = new Node(b), c = new Node(c);
+ a.next = c.previous = b;
+ b.next = a.previous = c;
+ c.next = b.previous = a;
+
+ // Attempt to place each remaining circle…
+ pack: for (i = 3; i < n; ++i) {
+ place(a._, b._, c = circles[i]), c = new Node(c);
+
+ // Find the closest intersecting circle on the front-chain, if any.
+ // “Closeness” is determined by linear distance along the front-chain.
+ // “Ahead” or “behind” is likewise determined by linear distance.
+ j = b.next, k = a.previous, sj = b._.r, sk = a._.r;
+ do {
+ if (sj <= sk) {
+ if (intersects(j._, c._)) {
+ b = j, a.next = b, b.previous = a, --i;
+ continue pack;
+ }
+ sj += j._.r, j = j.next;
+ } else {
+ if (intersects(k._, c._)) {
+ a = k, a.next = b, b.previous = a, --i;
+ continue pack;
+ }
+ sk += k._.r, k = k.previous;
+ }
+ } while (j !== k.next);
+
+ // Success! Insert the new circle c between a and b.
+ c.previous = a, c.next = b, a.next = b.previous = b = c;
+
+ // Compute the new closest circle pair to the centroid.
+ aa = score(a);
+ while ((c = c.next) !== b) {
+ if ((ca = score(c)) < aa) {
+ a = c, aa = ca;
+ }
+ }
+ b = a.next;
+ }
+
+ // Compute the enclosing circle of the front chain.
+ a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = enclose(a);
+
+ // Translate the circles to put the enclosing circle around the origin.
+ for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;
+
+ return c.r;
+}
+
+export default function(circles) {
+ packEnclose(circles);
+ return circles;
+}
diff --git a/node_modules/d3-hierarchy/src/partition.js b/node_modules/d3-hierarchy/src/partition.js
new file mode 100644
index 0000000000000000000000000000000000000000..0165ef73d7e8428e6cd3658419e280d6a70b9ba9
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/partition.js
@@ -0,0 +1,52 @@
+import roundNode from "./treemap/round.js";
+import treemapDice from "./treemap/dice.js";
+
+export default function() {
+ var dx = 1,
+ dy = 1,
+ padding = 0,
+ round = false;
+
+ function partition(root) {
+ var n = root.height + 1;
+ root.x0 =
+ root.y0 = padding;
+ root.x1 = dx;
+ root.y1 = dy / n;
+ root.eachBefore(positionNode(dy, n));
+ if (round) root.eachBefore(roundNode);
+ return root;
+ }
+
+ function positionNode(dy, n) {
+ return function(node) {
+ if (node.children) {
+ treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);
+ }
+ var x0 = node.x0,
+ y0 = node.y0,
+ x1 = node.x1 - padding,
+ y1 = node.y1 - padding;
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
+ node.x0 = x0;
+ node.y0 = y0;
+ node.x1 = x1;
+ node.y1 = y1;
+ };
+ }
+
+ partition.round = function(x) {
+ return arguments.length ? (round = !!x, partition) : round;
+ };
+
+ partition.size = function(x) {
+ return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];
+ };
+
+ partition.padding = function(x) {
+ return arguments.length ? (padding = +x, partition) : padding;
+ };
+
+ return partition;
+}
diff --git a/node_modules/d3-hierarchy/src/stratify.js b/node_modules/d3-hierarchy/src/stratify.js
new file mode 100644
index 0000000000000000000000000000000000000000..9bd691a3bedb8fea01a6b96b3187ea90875b0b1c
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/stratify.js
@@ -0,0 +1,73 @@
+import {required} from "./accessors.js";
+import {Node, computeHeight} from "./hierarchy/index.js";
+
+var keyPrefix = "$", // Protect against keys like “__proto__”.
+ preroot = {depth: -1},
+ ambiguous = {};
+
+function defaultId(d) {
+ return d.id;
+}
+
+function defaultParentId(d) {
+ return d.parentId;
+}
+
+export default function() {
+ var id = defaultId,
+ parentId = defaultParentId;
+
+ function stratify(data) {
+ var d,
+ i,
+ n = data.length,
+ root,
+ parent,
+ node,
+ nodes = new Array(n),
+ nodeId,
+ nodeKey,
+ nodeByKey = {};
+
+ for (i = 0; i < n; ++i) {
+ d = data[i], node = nodes[i] = new Node(d);
+ if ((nodeId = id(d, i, data)) != null && (nodeId += "")) {
+ nodeKey = keyPrefix + (node.id = nodeId);
+ nodeByKey[nodeKey] = nodeKey in nodeByKey ? ambiguous : node;
+ }
+ }
+
+ for (i = 0; i < n; ++i) {
+ node = nodes[i], nodeId = parentId(data[i], i, data);
+ if (nodeId == null || !(nodeId += "")) {
+ if (root) throw new Error("multiple roots");
+ root = node;
+ } else {
+ parent = nodeByKey[keyPrefix + nodeId];
+ if (!parent) throw new Error("missing: " + nodeId);
+ if (parent === ambiguous) throw new Error("ambiguous: " + nodeId);
+ if (parent.children) parent.children.push(node);
+ else parent.children = [node];
+ node.parent = parent;
+ }
+ }
+
+ if (!root) throw new Error("no root");
+ root.parent = preroot;
+ root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight);
+ root.parent = null;
+ if (n > 0) throw new Error("cycle");
+
+ return root;
+ }
+
+ stratify.id = function(x) {
+ return arguments.length ? (id = required(x), stratify) : id;
+ };
+
+ stratify.parentId = function(x) {
+ return arguments.length ? (parentId = required(x), stratify) : parentId;
+ };
+
+ return stratify;
+}
diff --git a/node_modules/d3-hierarchy/src/tree.js b/node_modules/d3-hierarchy/src/tree.js
new file mode 100644
index 0000000000000000000000000000000000000000..dc4275e4bee72abecea4dc3856eeb0d2a8f9faf3
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/tree.js
@@ -0,0 +1,237 @@
+import {Node} from "./hierarchy/index.js";
+
+function defaultSeparation(a, b) {
+ return a.parent === b.parent ? 1 : 2;
+}
+
+// function radialSeparation(a, b) {
+// return (a.parent === b.parent ? 1 : 2) / a.depth;
+// }
+
+// This function is used to traverse the left contour of a subtree (or
+// subforest). It returns the successor of v on this contour. This successor is
+// either given by the leftmost child of v or by the thread of v. The function
+// returns null if and only if v is on the highest level of its subtree.
+function nextLeft(v) {
+ var children = v.children;
+ return children ? children[0] : v.t;
+}
+
+// This function works analogously to nextLeft.
+function nextRight(v) {
+ var children = v.children;
+ return children ? children[children.length - 1] : v.t;
+}
+
+// Shifts the current subtree rooted at w+. This is done by increasing
+// prelim(w+) and mod(w+) by shift.
+function moveSubtree(wm, wp, shift) {
+ var change = shift / (wp.i - wm.i);
+ wp.c -= change;
+ wp.s += shift;
+ wm.c += change;
+ wp.z += shift;
+ wp.m += shift;
+}
+
+// All other shifts, applied to the smaller subtrees between w- and w+, are
+// performed by this function. To prepare the shifts, we have to adjust
+// change(w+), shift(w+), and change(w-).
+function executeShifts(v) {
+ var shift = 0,
+ change = 0,
+ children = v.children,
+ i = children.length,
+ w;
+ while (--i >= 0) {
+ w = children[i];
+ w.z += shift;
+ w.m += shift;
+ shift += w.s + (change += w.c);
+ }
+}
+
+// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,
+// returns the specified (default) ancestor.
+function nextAncestor(vim, v, ancestor) {
+ return vim.a.parent === v.parent ? vim.a : ancestor;
+}
+
+function TreeNode(node, i) {
+ this._ = node;
+ this.parent = null;
+ this.children = null;
+ this.A = null; // default ancestor
+ this.a = this; // ancestor
+ this.z = 0; // prelim
+ this.m = 0; // mod
+ this.c = 0; // change
+ this.s = 0; // shift
+ this.t = null; // thread
+ this.i = i; // number
+}
+
+TreeNode.prototype = Object.create(Node.prototype);
+
+function treeRoot(root) {
+ var tree = new TreeNode(root, 0),
+ node,
+ nodes = [tree],
+ child,
+ children,
+ i,
+ n;
+
+ while (node = nodes.pop()) {
+ if (children = node._.children) {
+ node.children = new Array(n = children.length);
+ for (i = n - 1; i >= 0; --i) {
+ nodes.push(child = node.children[i] = new TreeNode(children[i], i));
+ child.parent = node;
+ }
+ }
+ }
+
+ (tree.parent = new TreeNode(null, 0)).children = [tree];
+ return tree;
+}
+
+// Node-link tree diagram using the Reingold-Tilford "tidy" algorithm
+export default function() {
+ var separation = defaultSeparation,
+ dx = 1,
+ dy = 1,
+ nodeSize = null;
+
+ function tree(root) {
+ var t = treeRoot(root);
+
+ // Compute the layout using Buchheim et al.’s algorithm.
+ t.eachAfter(firstWalk), t.parent.m = -t.z;
+ t.eachBefore(secondWalk);
+
+ // If a fixed node size is specified, scale x and y.
+ if (nodeSize) root.eachBefore(sizeNode);
+
+ // If a fixed tree size is specified, scale x and y based on the extent.
+ // Compute the left-most, right-most, and depth-most nodes for extents.
+ else {
+ var left = root,
+ right = root,
+ bottom = root;
+ root.eachBefore(function(node) {
+ if (node.x < left.x) left = node;
+ if (node.x > right.x) right = node;
+ if (node.depth > bottom.depth) bottom = node;
+ });
+ var s = left === right ? 1 : separation(left, right) / 2,
+ tx = s - left.x,
+ kx = dx / (right.x + s + tx),
+ ky = dy / (bottom.depth || 1);
+ root.eachBefore(function(node) {
+ node.x = (node.x + tx) * kx;
+ node.y = node.depth * ky;
+ });
+ }
+
+ return root;
+ }
+
+ // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is
+ // applied recursively to the children of v, as well as the function
+ // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the
+ // node v is placed to the midpoint of its outermost children.
+ function firstWalk(v) {
+ var children = v.children,
+ siblings = v.parent.children,
+ w = v.i ? siblings[v.i - 1] : null;
+ if (children) {
+ executeShifts(v);
+ var midpoint = (children[0].z + children[children.length - 1].z) / 2;
+ if (w) {
+ v.z = w.z + separation(v._, w._);
+ v.m = v.z - midpoint;
+ } else {
+ v.z = midpoint;
+ }
+ } else if (w) {
+ v.z = w.z + separation(v._, w._);
+ }
+ v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
+ }
+
+ // Computes all real x-coordinates by summing up the modifiers recursively.
+ function secondWalk(v) {
+ v._.x = v.z + v.parent.m;
+ v.m += v.parent.m;
+ }
+
+ // The core of the algorithm. Here, a new subtree is combined with the
+ // previous subtrees. Threads are used to traverse the inside and outside
+ // contours of the left and right subtree up to the highest common level. The
+ // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the
+ // superscript o means outside and i means inside, the subscript - means left
+ // subtree and + means right subtree. For summing up the modifiers along the
+ // contour, we use respective variables si+, si-, so-, and so+. Whenever two
+ // nodes of the inside contours conflict, we compute the left one of the
+ // greatest uncommon ancestors using the function ANCESTOR and call MOVE
+ // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.
+ // Finally, we add a new thread (if necessary).
+ function apportion(v, w, ancestor) {
+ if (w) {
+ var vip = v,
+ vop = v,
+ vim = w,
+ vom = vip.parent.children[0],
+ sip = vip.m,
+ sop = vop.m,
+ sim = vim.m,
+ som = vom.m,
+ shift;
+ while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {
+ vom = nextLeft(vom);
+ vop = nextRight(vop);
+ vop.a = v;
+ shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
+ if (shift > 0) {
+ moveSubtree(nextAncestor(vim, v, ancestor), v, shift);
+ sip += shift;
+ sop += shift;
+ }
+ sim += vim.m;
+ sip += vip.m;
+ som += vom.m;
+ sop += vop.m;
+ }
+ if (vim && !nextRight(vop)) {
+ vop.t = vim;
+ vop.m += sim - sop;
+ }
+ if (vip && !nextLeft(vom)) {
+ vom.t = vip;
+ vom.m += sip - som;
+ ancestor = v;
+ }
+ }
+ return ancestor;
+ }
+
+ function sizeNode(node) {
+ node.x *= dx;
+ node.y = node.depth * dy;
+ }
+
+ tree.separation = function(x) {
+ return arguments.length ? (separation = x, tree) : separation;
+ };
+
+ tree.size = function(x) {
+ return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);
+ };
+
+ tree.nodeSize = function(x) {
+ return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);
+ };
+
+ return tree;
+}
diff --git a/node_modules/d3-hierarchy/src/treemap/binary.js b/node_modules/d3-hierarchy/src/treemap/binary.js
new file mode 100644
index 0000000000000000000000000000000000000000..a24aaf02288b9f75d9a13d6dd874f8f0530e06bb
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/treemap/binary.js
@@ -0,0 +1,46 @@
+export default function(parent, x0, y0, x1, y1) {
+ var nodes = parent.children,
+ i, n = nodes.length,
+ sum, sums = new Array(n + 1);
+
+ for (sums[0] = sum = i = 0; i < n; ++i) {
+ sums[i + 1] = sum += nodes[i].value;
+ }
+
+ partition(0, n, parent.value, x0, y0, x1, y1);
+
+ function partition(i, j, value, x0, y0, x1, y1) {
+ if (i >= j - 1) {
+ var node = nodes[i];
+ node.x0 = x0, node.y0 = y0;
+ node.x1 = x1, node.y1 = y1;
+ return;
+ }
+
+ var valueOffset = sums[i],
+ valueTarget = (value / 2) + valueOffset,
+ k = i + 1,
+ hi = j - 1;
+
+ while (k < hi) {
+ var mid = k + hi >>> 1;
+ if (sums[mid] < valueTarget) k = mid + 1;
+ else hi = mid;
+ }
+
+ if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;
+
+ var valueLeft = sums[k] - valueOffset,
+ valueRight = value - valueLeft;
+
+ if ((x1 - x0) > (y1 - y0)) {
+ var xk = (x0 * valueRight + x1 * valueLeft) / value;
+ partition(i, k, valueLeft, x0, y0, xk, y1);
+ partition(k, j, valueRight, xk, y0, x1, y1);
+ } else {
+ var yk = (y0 * valueRight + y1 * valueLeft) / value;
+ partition(i, k, valueLeft, x0, y0, x1, yk);
+ partition(k, j, valueRight, x0, yk, x1, y1);
+ }
+ }
+}
diff --git a/node_modules/d3-hierarchy/src/treemap/dice.js b/node_modules/d3-hierarchy/src/treemap/dice.js
new file mode 100644
index 0000000000000000000000000000000000000000..605c1f66b837a44cc6f425e1fade2ef2a1872dc3
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/treemap/dice.js
@@ -0,0 +1,12 @@
+export default function(parent, x0, y0, x1, y1) {
+ var nodes = parent.children,
+ node,
+ i = -1,
+ n = nodes.length,
+ k = parent.value && (x1 - x0) / parent.value;
+
+ while (++i < n) {
+ node = nodes[i], node.y0 = y0, node.y1 = y1;
+ node.x0 = x0, node.x1 = x0 += node.value * k;
+ }
+}
diff --git a/node_modules/d3-hierarchy/src/treemap/index.js b/node_modules/d3-hierarchy/src/treemap/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..ccc42c9db4588b832008a0f13a3bd3b3567dd765
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/treemap/index.js
@@ -0,0 +1,94 @@
+import roundNode from "./round.js";
+import squarify from "./squarify.js";
+import {required} from "../accessors.js";
+import constant, {constantZero} from "../constant.js";
+
+export default function() {
+ var tile = squarify,
+ round = false,
+ dx = 1,
+ dy = 1,
+ paddingStack = [0],
+ paddingInner = constantZero,
+ paddingTop = constantZero,
+ paddingRight = constantZero,
+ paddingBottom = constantZero,
+ paddingLeft = constantZero;
+
+ function treemap(root) {
+ root.x0 =
+ root.y0 = 0;
+ root.x1 = dx;
+ root.y1 = dy;
+ root.eachBefore(positionNode);
+ paddingStack = [0];
+ if (round) root.eachBefore(roundNode);
+ return root;
+ }
+
+ function positionNode(node) {
+ var p = paddingStack[node.depth],
+ x0 = node.x0 + p,
+ y0 = node.y0 + p,
+ x1 = node.x1 - p,
+ y1 = node.y1 - p;
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
+ node.x0 = x0;
+ node.y0 = y0;
+ node.x1 = x1;
+ node.y1 = y1;
+ if (node.children) {
+ p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
+ x0 += paddingLeft(node) - p;
+ y0 += paddingTop(node) - p;
+ x1 -= paddingRight(node) - p;
+ y1 -= paddingBottom(node) - p;
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
+ tile(node, x0, y0, x1, y1);
+ }
+ }
+
+ treemap.round = function(x) {
+ return arguments.length ? (round = !!x, treemap) : round;
+ };
+
+ treemap.size = function(x) {
+ return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
+ };
+
+ treemap.tile = function(x) {
+ return arguments.length ? (tile = required(x), treemap) : tile;
+ };
+
+ treemap.padding = function(x) {
+ return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
+ };
+
+ treemap.paddingInner = function(x) {
+ return arguments.length ? (paddingInner = typeof x === "function" ? x : constant(+x), treemap) : paddingInner;
+ };
+
+ treemap.paddingOuter = function(x) {
+ return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
+ };
+
+ treemap.paddingTop = function(x) {
+ return arguments.length ? (paddingTop = typeof x === "function" ? x : constant(+x), treemap) : paddingTop;
+ };
+
+ treemap.paddingRight = function(x) {
+ return arguments.length ? (paddingRight = typeof x === "function" ? x : constant(+x), treemap) : paddingRight;
+ };
+
+ treemap.paddingBottom = function(x) {
+ return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant(+x), treemap) : paddingBottom;
+ };
+
+ treemap.paddingLeft = function(x) {
+ return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant(+x), treemap) : paddingLeft;
+ };
+
+ return treemap;
+}
diff --git a/node_modules/d3-hierarchy/src/treemap/resquarify.js b/node_modules/d3-hierarchy/src/treemap/resquarify.js
new file mode 100644
index 0000000000000000000000000000000000000000..e75a2050080eab6d39edccfd39f5f39bc4452f4f
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/treemap/resquarify.js
@@ -0,0 +1,36 @@
+import treemapDice from "./dice.js";
+import treemapSlice from "./slice.js";
+import {phi, squarifyRatio} from "./squarify.js";
+
+export default (function custom(ratio) {
+
+ function resquarify(parent, x0, y0, x1, y1) {
+ if ((rows = parent._squarify) && (rows.ratio === ratio)) {
+ var rows,
+ row,
+ nodes,
+ i,
+ j = -1,
+ n,
+ m = rows.length,
+ value = parent.value;
+
+ while (++j < m) {
+ row = rows[j], nodes = row.children;
+ for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;
+ if (row.dice) treemapDice(row, x0, y0, x1, y0 += (y1 - y0) * row.value / value);
+ else treemapSlice(row, x0, y0, x0 += (x1 - x0) * row.value / value, y1);
+ value -= row.value;
+ }
+ } else {
+ parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);
+ rows.ratio = ratio;
+ }
+ }
+
+ resquarify.ratio = function(x) {
+ return custom((x = +x) > 1 ? x : 1);
+ };
+
+ return resquarify;
+})(phi);
diff --git a/node_modules/d3-hierarchy/src/treemap/round.js b/node_modules/d3-hierarchy/src/treemap/round.js
new file mode 100644
index 0000000000000000000000000000000000000000..7ac45ec299da531fdf83548932c34b52b76f83a1
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/treemap/round.js
@@ -0,0 +1,6 @@
+export default function(node) {
+ node.x0 = Math.round(node.x0);
+ node.y0 = Math.round(node.y0);
+ node.x1 = Math.round(node.x1);
+ node.y1 = Math.round(node.y1);
+}
diff --git a/node_modules/d3-hierarchy/src/treemap/slice.js b/node_modules/d3-hierarchy/src/treemap/slice.js
new file mode 100644
index 0000000000000000000000000000000000000000..1022bfad29d2ca4fc8717d1030c84baed4c8a13d
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/treemap/slice.js
@@ -0,0 +1,12 @@
+export default function(parent, x0, y0, x1, y1) {
+ var nodes = parent.children,
+ node,
+ i = -1,
+ n = nodes.length,
+ k = parent.value && (y1 - y0) / parent.value;
+
+ while (++i < n) {
+ node = nodes[i], node.x0 = x0, node.x1 = x1;
+ node.y0 = y0, node.y1 = y0 += node.value * k;
+ }
+}
diff --git a/node_modules/d3-hierarchy/src/treemap/sliceDice.js b/node_modules/d3-hierarchy/src/treemap/sliceDice.js
new file mode 100644
index 0000000000000000000000000000000000000000..545ad42b1d99ecdaca06960c191a2e3b756e8459
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/treemap/sliceDice.js
@@ -0,0 +1,6 @@
+import dice from "./dice.js";
+import slice from "./slice.js";
+
+export default function(parent, x0, y0, x1, y1) {
+ (parent.depth & 1 ? slice : dice)(parent, x0, y0, x1, y1);
+}
diff --git a/node_modules/d3-hierarchy/src/treemap/squarify.js b/node_modules/d3-hierarchy/src/treemap/squarify.js
new file mode 100644
index 0000000000000000000000000000000000000000..f8010703099abb59ed7761c13e34665a8108937b
--- /dev/null
+++ b/node_modules/d3-hierarchy/src/treemap/squarify.js
@@ -0,0 +1,66 @@
+import treemapDice from "./dice.js";
+import treemapSlice from "./slice.js";
+
+export var phi = (1 + Math.sqrt(5)) / 2;
+
+export function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
+ var rows = [],
+ nodes = parent.children,
+ row,
+ nodeValue,
+ i0 = 0,
+ i1 = 0,
+ n = nodes.length,
+ dx, dy,
+ value = parent.value,
+ sumValue,
+ minValue,
+ maxValue,
+ newRatio,
+ minRatio,
+ alpha,
+ beta;
+
+ while (i0 < n) {
+ dx = x1 - x0, dy = y1 - y0;
+
+ // Find the next non-empty node.
+ do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);
+ minValue = maxValue = sumValue;
+ alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
+ beta = sumValue * sumValue * alpha;
+ minRatio = Math.max(maxValue / beta, beta / minValue);
+
+ // Keep adding nodes while the aspect ratio maintains or improves.
+ for (; i1 < n; ++i1) {
+ sumValue += nodeValue = nodes[i1].value;
+ if (nodeValue < minValue) minValue = nodeValue;
+ if (nodeValue > maxValue) maxValue = nodeValue;
+ beta = sumValue * sumValue * alpha;
+ newRatio = Math.max(maxValue / beta, beta / minValue);
+ if (newRatio > minRatio) { sumValue -= nodeValue; break; }
+ minRatio = newRatio;
+ }
+
+ // Position and record the row orientation.
+ rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});
+ if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
+ else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
+ value -= sumValue, i0 = i1;
+ }
+
+ return rows;
+}
+
+export default (function custom(ratio) {
+
+ function squarify(parent, x0, y0, x1, y1) {
+ squarifyRatio(ratio, parent, x0, y0, x1, y1);
+ }
+
+ squarify.ratio = function(x) {
+ return custom((x = +x) > 1 ? x : 1);
+ };
+
+ return squarify;
+})(phi);
diff --git a/node_modules/d3-interpolate/LICENSE b/node_modules/d3-interpolate/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..b0145150fd35f3e325d7ddec6ed3be68c457975e
--- /dev/null
+++ b/node_modules/d3-interpolate/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2010-2021 Mike Bostock
+
+Permission to use, copy, modify, and/or distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright notice
+and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
diff --git a/node_modules/d3-interpolate/README.md b/node_modules/d3-interpolate/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..f5d82e78cc35dfb2916329524a32d0ea39f8aea3
--- /dev/null
+++ b/node_modules/d3-interpolate/README.md
@@ -0,0 +1,268 @@
+# d3-interpolate
+
+This module provides a variety of interpolation methods for blending between two values. Values may be numbers, colors, strings, arrays, or even deeply-nested objects. For example:
+
+```js
+const i = d3.interpolateNumber(10, 20);
+i(0.0); // 10
+i(0.2); // 12
+i(0.5); // 15
+i(1.0); // 20
+```
+
+The returned function `i` is called an *interpolator*. Given a starting value *a* and an ending value *b*, it takes a parameter *t* in the domain [0, 1] and returns the corresponding interpolated value between *a* and *b*. An interpolator typically returns a value equivalent to *a* at *t* = 0 and a value equivalent to *b* at *t* = 1.
+
+You can interpolate more than just numbers. To find the perceptual midpoint between steelblue and brown:
+
+```js
+d3.interpolateLab("steelblue", "brown")(0.5); // "rgb(142, 92, 109)"
+```
+
+Here’s a more elaborate example demonstrating type inference used by [interpolate](#interpolate):
+
+```js
+const i = d3.interpolate({colors: ["red", "blue"]}, {colors: ["white", "black"]});
+i(0.0); // {colors: ["rgb(255, 0, 0)", "rgb(0, 0, 255)"]}
+i(0.5); // {colors: ["rgb(255, 128, 128)", "rgb(0, 0, 128)"]}
+i(1.0); // {colors: ["rgb(255, 255, 255)", "rgb(0, 0, 0)"]}
+```
+
+Note that the generic value interpolator detects not only nested objects and arrays, but also color strings and numbers embedded in strings!
+
+## Installing
+
+If you use npm, `npm install d3-interpolate`. You can also download the [latest release on GitHub](https://github.com/d3/d3-interpolate/releases/latest). For vanilla HTML in modern browsers, import d3-interpolate from Skypack:
+
+```html
+
+```
+
+For legacy environments, you can load d3-interpolate’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported. (If using [color interpolation](#color-spaces), also load [d3-color](https://github.com/d3/d3-color).)
+
+```html
+
+
+
+```
+
+## API Reference
+
+# d3.interpolate(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/value.js), [Examples](https://observablehq.com/@d3/d3-interpolate)
+
+Returns an interpolator between the two arbitrary values *a* and *b*. The interpolator implementation is based on the type of the end value *b*, using the following algorithm:
+
+1. If *b* is null, undefined or a boolean, use the constant *b*.
+2. If *b* is a number, use [interpolateNumber](#interpolateNumber).
+3. If *b* is a [color](https://github.com/d3/d3-color/blob/master/README.md#color) or a string coercible to a color, use [interpolateRgb](#interpolateRgb).
+4. If *b* is a [date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), use [interpolateDate](#interpolateDate).
+5. If *b* is a string, use [interpolateString](#interpolateString).
+6. If *b* is a [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) of numbers, use [interpolateNumberArray](#interpolateNumberArray).
+7. If *b* is a generic [array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray), use [interpolateArray](#interpolateArray).
+8. If *b* is coercible to a number, use [interpolateNumber](#interpolateNumber).
+9. Use [interpolateObject](#interpolateObject).
+
+Based on the chosen interpolator, *a* is coerced to the suitable corresponding type.
+
+# d3.interpolateNumber(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/number.js), [Examples](https://observablehq.com/@d3/d3-interpolatenumber)
+
+Returns an interpolator between the two numbers *a* and *b*. The returned interpolator is equivalent to:
+
+```js
+function interpolator(t) {
+ return a * (1 - t) + b * t;
+}
+```
+
+Caution: avoid interpolating to or from the number zero when the interpolator is used to generate a string. When very small values are stringified, they may be converted to scientific notation, which is an invalid attribute or style property value in older browsers. For example, the number `0.0000001` is converted to the string `"1e-7"`. This is particularly noticeable with interpolating opacity. To avoid scientific notation, start or end the transition at 1e-6: the smallest value that is not stringified in scientific notation.
+
+# d3.interpolateRound(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/round.js), [Examples](https://observablehq.com/@d3/d3-interpolatenumber)
+
+Returns an interpolator between the two numbers *a* and *b*; the interpolator is similar to [interpolateNumber](#interpolateNumber), except it will round the resulting value to the nearest integer.
+
+# d3.interpolateString(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/string.js), [Examples](https://observablehq.com/@d3/d3-interpolatestring)
+
+Returns an interpolator between the two strings *a* and *b*. The string interpolator finds numbers embedded in *a* and *b*, where each number is of the form understood by JavaScript. A few examples of numbers that will be detected within a string: `-1`, `42`, `3.14159`, and `6.0221413e+23`.
+
+For each number embedded in *b*, the interpolator will attempt to find a corresponding number in *a*. If a corresponding number is found, a numeric interpolator is created using [interpolateNumber](#interpolateNumber). The remaining parts of the string *b* are used as a template: the static parts of the string *b* remain constant for the interpolation, with the interpolated numeric values embedded in the template.
+
+For example, if *a* is `"300 12px sans-serif"`, and *b* is `"500 36px Comic-Sans"`, two embedded numbers are found. The remaining static parts (of string *b*) are a space between the two numbers (`" "`), and the suffix (`"px Comic-Sans"`). The result of the interpolator at *t* = 0.5 is `"400 24px Comic-Sans"`.
+
+# d3.interpolateDate(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/date.js), [Examples](https://observablehq.com/@d3/d3-interpolatedate)
+
+Returns an interpolator between the two [dates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) *a* and *b*.
+
+Note: **no defensive copy** of the returned date is created; the same Date instance is returned for every evaluation of the interpolator. No copy is made for performance reasons; interpolators are often part of the inner loop of [animated transitions](https://github.com/d3/d3-transition).
+
+# d3.interpolateArray(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/array.js), [Examples](https://observablehq.com/@d3/d3-interpolateobject)
+
+Returns an interpolator between the two arrays *a* and *b*. If *b* is a typed array (e.g., Float64Array), [interpolateNumberArray](#interpolateNumberArray) is called instead.
+
+Internally, an array template is created that is the same length as *b*. For each element in *b*, if there exists a corresponding element in *a*, a generic interpolator is created for the two elements using [interpolate](#interpolate). If there is no such element, the static value from *b* is used in the template. Then, for the given parameter *t*, the template’s embedded interpolators are evaluated. The updated array template is then returned.
+
+For example, if *a* is the array `[0, 1]` and *b* is the array `[1, 10, 100]`, then the result of the interpolator for *t* = 0.5 is the array `[0.5, 5.5, 100]`.
+
+Note: **no defensive copy** of the template array is created; modifications of the returned array may adversely affect subsequent evaluation of the interpolator. No copy is made for performance reasons; interpolators are often part of the inner loop of [animated transitions](https://github.com/d3/d3-transition).
+
+# d3.interpolateNumberArray(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/numberArray.js), [Examples](https://observablehq.com/@d3/d3-interpolatenumberarray)
+
+Returns an interpolator between the two arrays of numbers *a* and *b*. Internally, an array template is created that is the same type and length as *b*. For each element in *b*, if there exists a corresponding element in *a*, the values are directly interpolated in the array template. If there is no such element, the static value from *b* is copied. The updated array template is then returned.
+
+Note: For performance reasons, **no defensive copy** is made of the template array and the arguments *a* and *b*; modifications of these arrays may affect subsequent evaluation of the interpolator.
+
+# d3.interpolateObject(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/object.js), [Examples](https://observablehq.com/@d3/d3-interpolateobject)
+
+Returns an interpolator between the two objects *a* and *b*. Internally, an object template is created that has the same properties as *b*. For each property in *b*, if there exists a corresponding property in *a*, a generic interpolator is created for the two elements using [interpolate](#interpolate). If there is no such property, the static value from *b* is used in the template. Then, for the given parameter *t*, the template's embedded interpolators are evaluated and the updated object template is then returned.
+
+For example, if *a* is the object `{x: 0, y: 1}` and *b* is the object `{x: 1, y: 10, z: 100}`, the result of the interpolator for *t* = 0.5 is the object `{x: 0.5, y: 5.5, z: 100}`.
+
+Object interpolation is particularly useful for *dataspace interpolation*, where data is interpolated rather than attribute values. For example, you can interpolate an object which describes an arc in a pie chart, and then use [d3.arc](https://github.com/d3/d3-shape/blob/master/README.md#arc) to compute the new SVG path data.
+
+Note: **no defensive copy** of the template object is created; modifications of the returned object may adversely affect subsequent evaluation of the interpolator. No copy is made for performance reasons; interpolators are often part of the inner loop of [animated transitions](https://github.com/d3/d3-transition).
+
+# d3.interpolateTransformCss(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/transform/index.js#L62), [Examples](https://observablehq.com/@d3/d3-interpolatetransformcss)
+
+Returns an interpolator between the two 2D CSS transforms represented by *a* and *b*. Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated. This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition).
+
+# d3.interpolateTransformSvg(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/transform/index.js#L63), [Examples](https://observablehq.com/@d3/d3-interpolatetransformcss)
+
+Returns an interpolator between the two 2D SVG transforms represented by *a* and *b*. Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated. This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition).
+
+# d3.interpolateZoom(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/zoom.js), [Examples](https://observablehq.com/@d3/d3-interpolatezoom)
+
+Returns an interpolator between the two views *a* and *b* of a two-dimensional plane, based on [“Smooth and efficient zooming and panning”](http://www.win.tue.nl/~vanwijk/zoompan.pdf) by Jarke J. van Wijk and Wim A.A. Nuij. Each view is defined as an array of three numbers: *cx*, *cy* and *width*. The first two coordinates *cx*, *cy* represent the center of the viewport; the last coordinate *width* represents the size of the viewport.
+
+The returned interpolator exposes a *duration* property which encodes the recommended transition duration in milliseconds. This duration is based on the path length of the curved trajectory through *x,y* space. If you want a slower or faster transition, multiply this by an arbitrary scale factor (V as described in the original paper).
+
+# *interpolateZoom*.rho(rho) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/zoom.js)
+
+Given a [zoom interpolator](#interpolateZoom), returns a new zoom interpolator using the specified curvature *rho*. When *rho* is close to 0, the interpolator is almost linear. The default curvature is sqrt(2).
+
+# d3.interpolateDiscrete(values) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/discrete.js), [Examples](https://observablehq.com/@d3/d3-interpolatediscrete)
+
+Returns a discrete interpolator for the given array of *values*. The returned interpolator maps *t* in [0, 1 / *n*) to *values*[0], *t* in [1 / *n*, 2 / *n*) to *values*[1], and so on, where *n* = *values*.length. In effect, this is a lightweight [quantize scale](https://github.com/d3/d3-scale/blob/master/README.md#quantize-scales) with a fixed domain of [0, 1].
+
+### Sampling
+
+# d3.quantize(interpolator, n) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/quantize.js), [Examples](https://observablehq.com/@d3/d3-quantize)
+
+Returns *n* uniformly-spaced samples from the specified *interpolator*, where *n* is an integer greater than one. The first sample is always at *t* = 0, and the last sample is always at *t* = 1. This can be useful in generating a fixed number of samples from a given interpolator, such as to derive the range of a [quantize scale](https://github.com/d3/d3-scale/blob/master/README.md#quantize-scales) from a [continuous interpolator](https://github.com/d3/d3-scale-chromatic/blob/master/README.md#interpolateWarm).
+
+Caution: this method will not work with interpolators that do not return defensive copies of their output, such as [d3.interpolateArray](#interpolateArray), [d3.interpolateDate](#interpolateDate) and [d3.interpolateObject](#interpolateObject). For those interpolators, you must wrap the interpolator and create a copy for each returned value.
+
+### Color Spaces
+
+# d3.interpolateRgb(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/rgb.js), [Examples](https://observablehq.com/@d3/working-with-color)
+
+
+
+Or, with a corrected [gamma](#interpolate_gamma) of 2.2:
+
+
+
+Returns an RGB color space interpolator between the two colors *a* and *b* with a configurable [gamma](#interpolate_gamma). If the gamma is not specified, it defaults to 1.0. The colors *a* and *b* need not be in RGB; they will be converted to RGB using [d3.rgb](https://github.com/d3/d3-color/blob/master/README.md#rgb). The return value of the interpolator is an RGB string.
+
+# d3.interpolateRgbBasis(colors) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/rgb.js#L54), [Examples](https://observablehq.com/@d3/working-with-color)
+
+Returns a uniform nonrational B-spline interpolator through the specified array of *colors*, which are converted to [RGB color space](https://github.com/d3/d3-color/blob/master/README.md#rgb). Implicit control points are generated such that the interpolator returns *colors*[0] at *t* = 0 and *colors*[*colors*.length - 1] at *t* = 1. Opacity interpolation is not currently supported. See also [d3.interpolateBasis](#interpolateBasis), and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples.
+
+# d3.interpolateRgbBasisClosed(colors) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/rgb.js#L55), [Examples](https://observablehq.com/@d3/working-with-color)
+
+Returns a uniform nonrational B-spline interpolator through the specified array of *colors*, which are converted to [RGB color space](https://github.com/d3/d3-color/blob/master/README.md#rgb). The control points are implicitly repeated such that the resulting spline has cyclical C² continuity when repeated around *t* in [0,1]; this is useful, for example, to create cyclical color scales. Opacity interpolation is not currently supported. See also [d3.interpolateBasisClosed](#interpolateBasisClosed), and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples.
+
+# d3.interpolateHsl(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/hsl.js), [Examples](https://observablehq.com/@d3/working-with-color)
+
+
+
+Returns an HSL color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in HSL; they will be converted to HSL using [d3.hsl](https://github.com/d3/d3-color/blob/master/README.md#hsl). If either color’s hue or saturation is NaN, the opposing color’s channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string.
+
+# d3.interpolateHslLong(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/hsl.js#L21), [Examples](https://observablehq.com/@d3/working-with-color)
+
+
+
+Like [interpolateHsl](#interpolateHsl), but does not use the shortest path between hues.
+
+# d3.interpolateLab(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/lab.js), [Examples](https://observablehq.com/@d3/working-with-color)
+
+
+
+Returns a [CIELAB color space](https://en.wikipedia.org/wiki/Lab_color_space#CIELAB) interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in CIELAB; they will be converted to CIELAB using [d3.lab](https://github.com/d3/d3-color/blob/master/README.md#lab). The return value of the interpolator is an RGB string.
+
+# d3.interpolateHcl(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/hcl.js), [Examples](https://observablehq.com/@d3/working-with-color)
+
+
+
+Returns a [CIELChab color space](https://en.wikipedia.org/wiki/CIELAB_color_space#Cylindrical_representation:_CIELCh_or_CIEHLC) interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in CIELChab; they will be converted to CIELChab using [d3.hcl](https://github.com/d3/d3-color/blob/master/README.md#hcl). If either color’s hue or chroma is NaN, the opposing color’s channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string.
+
+# d3.interpolateHclLong(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/hcl.js#L21), [Examples](https://observablehq.com/@d3/working-with-color)
+
+
+
+Like [interpolateHcl](#interpolateHcl), but does not use the shortest path between hues.
+
+# d3.interpolateCubehelix(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/cubehelix.js), [Examples](https://observablehq.com/@d3/working-with-color)
+
+
+
+Or, with a [gamma](#interpolate_gamma) of 3.0 to emphasize high-intensity values:
+
+
+
+Returns a Cubehelix color space interpolator between the two colors *a* and *b* using a configurable [gamma](#interpolate_gamma). If the gamma is not specified, it defaults to 1.0. The colors *a* and *b* need not be in Cubehelix; they will be converted to Cubehelix using [d3.cubehelix](https://github.com/d3/d3-color/blob/master/README.md#cubehelix). If either color’s hue or saturation is NaN, the opposing color’s channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string.
+
+# d3.interpolateCubehelixLong(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/cubehelix.js#L29), [Examples](https://observablehq.com/@d3/working-with-color)
+
+
+
+Or, with a [gamma](#interpolate_gamma) of 3.0 to emphasize high-intensity values:
+
+
+
+Like [interpolateCubehelix](#interpolateCubehelix), but does not use the shortest path between hues.
+
+#interpolate.gamma(gamma)
+
+Given that *interpolate* is one of [interpolateRgb](#interpolateRgb), [interpolateCubehelix](#interpolateCubehelix) or [interpolateCubehelixLong](#interpolateCubehelixLong), returns a new interpolator factory of the same type using the specified *gamma*. For example, to interpolate from purple to orange with a gamma of 2.2 in RGB space:
+
+```js
+const interpolator = d3.interpolateRgb.gamma(2.2)("purple", "orange");
+```
+
+See Eric Brasseur’s article, [Gamma error in picture scaling](http://www.ericbrasseur.org/gamma.html), for more on gamma correction.
+
+# d3.interpolateHue(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/hue.js), [Examples](https://observablehq.com/@d3/working-with-color)
+
+Returns an interpolator between the two hue angles *a* and *b*. If either hue is NaN, the opposing value is used. The shortest path between hues is used. The return value of the interpolator is a number in [0, 360).
+
+### Splines
+
+Whereas standard interpolators blend from a starting value *a* at *t* = 0 to an ending value *b* at *t* = 1, spline interpolators smoothly blend multiple input values for *t* in [0,1] using piecewise polynomial functions. Only cubic uniform nonrational [B-splines](https://en.wikipedia.org/wiki/B-spline) are currently supported, also known as basis splines.
+
+# d3.interpolateBasis(values) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/basis.js), [Examples](https://observablehq.com/@d3/d3-interpolatebasis)
+
+Returns a uniform nonrational B-spline interpolator through the specified array of *values*, which must be numbers. Implicit control points are generated such that the interpolator returns *values*[0] at *t* = 0 and *values*[*values*.length - 1] at *t* = 1. See also [d3.curveBasis](https://github.com/d3/d3-shape/blob/master/README.md#curveBasis).
+
+# d3.interpolateBasisClosed(values) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/basisClosed.js), [Examples](https://observablehq.com/@d3/d3-interpolatebasis)
+
+Returns a uniform nonrational B-spline interpolator through the specified array of *values*, which must be numbers. The control points are implicitly repeated such that the resulting one-dimensional spline has cyclical C² continuity when repeated around *t* in [0,1]. See also [d3.curveBasisClosed](https://github.com/d3/d3-shape/blob/master/README.md#curveBasisClosed).
+
+### Piecewise
+
+# d3.piecewise([interpolate, ]values) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/piecewise.js), [Examples](https://observablehq.com/@d3/d3-piecewise)
+
+Returns a piecewise interpolator, composing interpolators for each adjacent pair of *values*. The returned interpolator maps *t* in [0, 1 / (*n* - 1)] to *interpolate*(*values*[0], *values*[1]), *t* in [1 / (*n* - 1), 2 / (*n* - 1)] to *interpolate*(*values*[1], *values*[2]), and so on, where *n* = *values*.length. In effect, this is a lightweight [linear scale](https://github.com/d3/d3-scale/blob/master/README.md#linear-scales). For example, to blend through red, green and blue:
+
+```js
+const interpolate = d3.piecewise(d3.interpolateRgb.gamma(2.2), ["red", "green", "blue"]);
+```
+
+If *interpolate* is not specified, defaults to [d3.interpolate](#interpolate).
diff --git a/node_modules/d3-interpolate/dist/d3-interpolate.js b/node_modules/d3-interpolate/dist/d3-interpolate.js
new file mode 100644
index 0000000000000000000000000000000000000000..a374eedfbf87490ab9616f917ae430de1520d676
--- /dev/null
+++ b/node_modules/d3-interpolate/dist/d3-interpolate.js
@@ -0,0 +1,590 @@
+// https://d3js.org/d3-interpolate/ v3.0.1 Copyright 2010-2021 Mike Bostock
+(function (global, factory) {
+typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-color')) :
+typeof define === 'function' && define.amd ? define(['exports', 'd3-color'], factory) :
+(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3));
+}(this, (function (exports, d3Color) { 'use strict';
+
+function basis(t1, v0, v1, v2, v3) {
+ var t2 = t1 * t1, t3 = t2 * t1;
+ return ((1 - 3 * t1 + 3 * t2 - t3) * v0
+ + (4 - 6 * t2 + 3 * t3) * v1
+ + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2
+ + t3 * v3) / 6;
+}
+
+function basis$1(values) {
+ var n = values.length - 1;
+ return function(t) {
+ var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
+ v1 = values[i],
+ v2 = values[i + 1],
+ v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
+ v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
+ return basis((t - i / n) * n, v0, v1, v2, v3);
+ };
+}
+
+function basisClosed(values) {
+ var n = values.length;
+ return function(t) {
+ var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
+ v0 = values[(i + n - 1) % n],
+ v1 = values[i % n],
+ v2 = values[(i + 1) % n],
+ v3 = values[(i + 2) % n];
+ return basis((t - i / n) * n, v0, v1, v2, v3);
+ };
+}
+
+var constant = x => () => x;
+
+function linear(a, d) {
+ return function(t) {
+ return a + t * d;
+ };
+}
+
+function exponential(a, b, y) {
+ return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
+ return Math.pow(a + t * b, y);
+ };
+}
+
+function hue$1(a, b) {
+ var d = b - a;
+ return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);
+}
+
+function gamma(y) {
+ return (y = +y) === 1 ? nogamma : function(a, b) {
+ return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
+ };
+}
+
+function nogamma(a, b) {
+ var d = b - a;
+ return d ? linear(a, d) : constant(isNaN(a) ? b : a);
+}
+
+var rgb = (function rgbGamma(y) {
+ var color = gamma(y);
+
+ function rgb(start, end) {
+ var r = color((start = d3Color.rgb(start)).r, (end = d3Color.rgb(end)).r),
+ g = color(start.g, end.g),
+ b = color(start.b, end.b),
+ opacity = nogamma(start.opacity, end.opacity);
+ return function(t) {
+ start.r = r(t);
+ start.g = g(t);
+ start.b = b(t);
+ start.opacity = opacity(t);
+ return start + "";
+ };
+ }
+
+ rgb.gamma = rgbGamma;
+
+ return rgb;
+})(1);
+
+function rgbSpline(spline) {
+ return function(colors) {
+ var n = colors.length,
+ r = new Array(n),
+ g = new Array(n),
+ b = new Array(n),
+ i, color;
+ for (i = 0; i < n; ++i) {
+ color = d3Color.rgb(colors[i]);
+ r[i] = color.r || 0;
+ g[i] = color.g || 0;
+ b[i] = color.b || 0;
+ }
+ r = spline(r);
+ g = spline(g);
+ b = spline(b);
+ color.opacity = 1;
+ return function(t) {
+ color.r = r(t);
+ color.g = g(t);
+ color.b = b(t);
+ return color + "";
+ };
+ };
+}
+
+var rgbBasis = rgbSpline(basis$1);
+var rgbBasisClosed = rgbSpline(basisClosed);
+
+function numberArray(a, b) {
+ if (!b) b = [];
+ var n = a ? Math.min(b.length, a.length) : 0,
+ c = b.slice(),
+ i;
+ return function(t) {
+ for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
+ return c;
+ };
+}
+
+function isNumberArray(x) {
+ return ArrayBuffer.isView(x) && !(x instanceof DataView);
+}
+
+function array(a, b) {
+ return (isNumberArray(b) ? numberArray : genericArray)(a, b);
+}
+
+function genericArray(a, b) {
+ var nb = b ? b.length : 0,
+ na = a ? Math.min(nb, a.length) : 0,
+ x = new Array(na),
+ c = new Array(nb),
+ i;
+
+ for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);
+ for (; i < nb; ++i) c[i] = b[i];
+
+ return function(t) {
+ for (i = 0; i < na; ++i) c[i] = x[i](t);
+ return c;
+ };
+}
+
+function date(a, b) {
+ var d = new Date;
+ return a = +a, b = +b, function(t) {
+ return d.setTime(a * (1 - t) + b * t), d;
+ };
+}
+
+function number(a, b) {
+ return a = +a, b = +b, function(t) {
+ return a * (1 - t) + b * t;
+ };
+}
+
+function object(a, b) {
+ var i = {},
+ c = {},
+ k;
+
+ if (a === null || typeof a !== "object") a = {};
+ if (b === null || typeof b !== "object") b = {};
+
+ for (k in b) {
+ if (k in a) {
+ i[k] = value(a[k], b[k]);
+ } else {
+ c[k] = b[k];
+ }
+ }
+
+ return function(t) {
+ for (k in i) c[k] = i[k](t);
+ return c;
+ };
+}
+
+var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
+ reB = new RegExp(reA.source, "g");
+
+function zero(b) {
+ return function() {
+ return b;
+ };
+}
+
+function one(b) {
+ return function(t) {
+ return b(t) + "";
+ };
+}
+
+function string(a, b) {
+ var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
+ am, // current match in a
+ bm, // current match in b
+ bs, // string preceding current number in b, if any
+ i = -1, // index in s
+ s = [], // string constants and placeholders
+ q = []; // number interpolators
+
+ // Coerce inputs to strings.
+ a = a + "", b = b + "";
+
+ // Interpolate pairs of numbers in a & b.
+ while ((am = reA.exec(a))
+ && (bm = reB.exec(b))) {
+ if ((bs = bm.index) > bi) { // a string precedes the next number in b
+ bs = b.slice(bi, bs);
+ if (s[i]) s[i] += bs; // coalesce with previous string
+ else s[++i] = bs;
+ }
+ if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
+ if (s[i]) s[i] += bm; // coalesce with previous string
+ else s[++i] = bm;
+ } else { // interpolate non-matching numbers
+ s[++i] = null;
+ q.push({i: i, x: number(am, bm)});
+ }
+ bi = reB.lastIndex;
+ }
+
+ // Add remains of b.
+ if (bi < b.length) {
+ bs = b.slice(bi);
+ if (s[i]) s[i] += bs; // coalesce with previous string
+ else s[++i] = bs;
+ }
+
+ // Special optimization for only a single match.
+ // Otherwise, interpolate each of the numbers and rejoin the string.
+ return s.length < 2 ? (q[0]
+ ? one(q[0].x)
+ : zero(b))
+ : (b = q.length, function(t) {
+ for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
+ return s.join("");
+ });
+}
+
+function value(a, b) {
+ var t = typeof b, c;
+ return b == null || t === "boolean" ? constant(b)
+ : (t === "number" ? number
+ : t === "string" ? ((c = d3Color.color(b)) ? (b = c, rgb) : string)
+ : b instanceof d3Color.color ? rgb
+ : b instanceof Date ? date
+ : isNumberArray(b) ? numberArray
+ : Array.isArray(b) ? genericArray
+ : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
+ : number)(a, b);
+}
+
+function discrete(range) {
+ var n = range.length;
+ return function(t) {
+ return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];
+ };
+}
+
+function hue(a, b) {
+ var i = hue$1(+a, +b);
+ return function(t) {
+ var x = i(t);
+ return x - 360 * Math.floor(x / 360);
+ };
+}
+
+function round(a, b) {
+ return a = +a, b = +b, function(t) {
+ return Math.round(a * (1 - t) + b * t);
+ };
+}
+
+var degrees = 180 / Math.PI;
+
+var identity = {
+ translateX: 0,
+ translateY: 0,
+ rotate: 0,
+ skewX: 0,
+ scaleX: 1,
+ scaleY: 1
+};
+
+function decompose(a, b, c, d, e, f) {
+ var scaleX, scaleY, skewX;
+ if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
+ if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
+ if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
+ if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
+ return {
+ translateX: e,
+ translateY: f,
+ rotate: Math.atan2(b, a) * degrees,
+ skewX: Math.atan(skewX) * degrees,
+ scaleX: scaleX,
+ scaleY: scaleY
+ };
+}
+
+var svgNode;
+
+/* eslint-disable no-undef */
+function parseCss(value) {
+ const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
+ return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
+}
+
+function parseSvg(value) {
+ if (value == null) return identity;
+ if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
+ svgNode.setAttribute("transform", value);
+ if (!(value = svgNode.transform.baseVal.consolidate())) return identity;
+ value = value.matrix;
+ return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
+}
+
+function interpolateTransform(parse, pxComma, pxParen, degParen) {
+
+ function pop(s) {
+ return s.length ? s.pop() + " " : "";
+ }
+
+ function translate(xa, ya, xb, yb, s, q) {
+ if (xa !== xb || ya !== yb) {
+ var i = s.push("translate(", null, pxComma, null, pxParen);
+ q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});
+ } else if (xb || yb) {
+ s.push("translate(" + xb + pxComma + yb + pxParen);
+ }
+ }
+
+ function rotate(a, b, s, q) {
+ if (a !== b) {
+ if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path
+ q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)});
+ } else if (b) {
+ s.push(pop(s) + "rotate(" + b + degParen);
+ }
+ }
+
+ function skewX(a, b, s, q) {
+ if (a !== b) {
+ q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)});
+ } else if (b) {
+ s.push(pop(s) + "skewX(" + b + degParen);
+ }
+ }
+
+ function scale(xa, ya, xb, yb, s, q) {
+ if (xa !== xb || ya !== yb) {
+ var i = s.push(pop(s) + "scale(", null, ",", null, ")");
+ q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});
+ } else if (xb !== 1 || yb !== 1) {
+ s.push(pop(s) + "scale(" + xb + "," + yb + ")");
+ }
+ }
+
+ return function(a, b) {
+ var s = [], // string constants and placeholders
+ q = []; // number interpolators
+ a = parse(a), b = parse(b);
+ translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
+ rotate(a.rotate, b.rotate, s, q);
+ skewX(a.skewX, b.skewX, s, q);
+ scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
+ a = b = null; // gc
+ return function(t) {
+ var i = -1, n = q.length, o;
+ while (++i < n) s[(o = q[i]).i] = o.x(t);
+ return s.join("");
+ };
+ };
+}
+
+var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
+var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
+
+var epsilon2 = 1e-12;
+
+function cosh(x) {
+ return ((x = Math.exp(x)) + 1 / x) / 2;
+}
+
+function sinh(x) {
+ return ((x = Math.exp(x)) - 1 / x) / 2;
+}
+
+function tanh(x) {
+ return ((x = Math.exp(2 * x)) - 1) / (x + 1);
+}
+
+var zoom = (function zoomRho(rho, rho2, rho4) {
+
+ // p0 = [ux0, uy0, w0]
+ // p1 = [ux1, uy1, w1]
+ function zoom(p0, p1) {
+ var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],
+ ux1 = p1[0], uy1 = p1[1], w1 = p1[2],
+ dx = ux1 - ux0,
+ dy = uy1 - uy0,
+ d2 = dx * dx + dy * dy,
+ i,
+ S;
+
+ // Special case for u0 ≅ u1.
+ if (d2 < epsilon2) {
+ S = Math.log(w1 / w0) / rho;
+ i = function(t) {
+ return [
+ ux0 + t * dx,
+ uy0 + t * dy,
+ w0 * Math.exp(rho * t * S)
+ ];
+ };
+ }
+
+ // General case.
+ else {
+ var d1 = Math.sqrt(d2),
+ b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
+ b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
+ r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
+ r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
+ S = (r1 - r0) / rho;
+ i = function(t) {
+ var s = t * S,
+ coshr0 = cosh(r0),
+ u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
+ return [
+ ux0 + u * dx,
+ uy0 + u * dy,
+ w0 * coshr0 / cosh(rho * s + r0)
+ ];
+ };
+ }
+
+ i.duration = S * 1000 * rho / Math.SQRT2;
+
+ return i;
+ }
+
+ zoom.rho = function(_) {
+ var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;
+ return zoomRho(_1, _2, _4);
+ };
+
+ return zoom;
+})(Math.SQRT2, 2, 4);
+
+function hsl(hue) {
+ return function(start, end) {
+ var h = hue((start = d3Color.hsl(start)).h, (end = d3Color.hsl(end)).h),
+ s = nogamma(start.s, end.s),
+ l = nogamma(start.l, end.l),
+ opacity = nogamma(start.opacity, end.opacity);
+ return function(t) {
+ start.h = h(t);
+ start.s = s(t);
+ start.l = l(t);
+ start.opacity = opacity(t);
+ return start + "";
+ };
+ }
+}
+
+var hsl$1 = hsl(hue$1);
+var hslLong = hsl(nogamma);
+
+function lab(start, end) {
+ var l = nogamma((start = d3Color.lab(start)).l, (end = d3Color.lab(end)).l),
+ a = nogamma(start.a, end.a),
+ b = nogamma(start.b, end.b),
+ opacity = nogamma(start.opacity, end.opacity);
+ return function(t) {
+ start.l = l(t);
+ start.a = a(t);
+ start.b = b(t);
+ start.opacity = opacity(t);
+ return start + "";
+ };
+}
+
+function hcl(hue) {
+ return function(start, end) {
+ var h = hue((start = d3Color.hcl(start)).h, (end = d3Color.hcl(end)).h),
+ c = nogamma(start.c, end.c),
+ l = nogamma(start.l, end.l),
+ opacity = nogamma(start.opacity, end.opacity);
+ return function(t) {
+ start.h = h(t);
+ start.c = c(t);
+ start.l = l(t);
+ start.opacity = opacity(t);
+ return start + "";
+ };
+ }
+}
+
+var hcl$1 = hcl(hue$1);
+var hclLong = hcl(nogamma);
+
+function cubehelix(hue) {
+ return (function cubehelixGamma(y) {
+ y = +y;
+
+ function cubehelix(start, end) {
+ var h = hue((start = d3Color.cubehelix(start)).h, (end = d3Color.cubehelix(end)).h),
+ s = nogamma(start.s, end.s),
+ l = nogamma(start.l, end.l),
+ opacity = nogamma(start.opacity, end.opacity);
+ return function(t) {
+ start.h = h(t);
+ start.s = s(t);
+ start.l = l(Math.pow(t, y));
+ start.opacity = opacity(t);
+ return start + "";
+ };
+ }
+
+ cubehelix.gamma = cubehelixGamma;
+
+ return cubehelix;
+ })(1);
+}
+
+var cubehelix$1 = cubehelix(hue$1);
+var cubehelixLong = cubehelix(nogamma);
+
+function piecewise(interpolate, values) {
+ if (values === undefined) values = interpolate, interpolate = value;
+ var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);
+ while (i < n) I[i] = interpolate(v, v = values[++i]);
+ return function(t) {
+ var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));
+ return I[i](t - i);
+ };
+}
+
+function quantize(interpolator, n) {
+ var samples = new Array(n);
+ for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));
+ return samples;
+}
+
+exports.interpolate = value;
+exports.interpolateArray = array;
+exports.interpolateBasis = basis$1;
+exports.interpolateBasisClosed = basisClosed;
+exports.interpolateCubehelix = cubehelix$1;
+exports.interpolateCubehelixLong = cubehelixLong;
+exports.interpolateDate = date;
+exports.interpolateDiscrete = discrete;
+exports.interpolateHcl = hcl$1;
+exports.interpolateHclLong = hclLong;
+exports.interpolateHsl = hsl$1;
+exports.interpolateHslLong = hslLong;
+exports.interpolateHue = hue;
+exports.interpolateLab = lab;
+exports.interpolateNumber = number;
+exports.interpolateNumberArray = numberArray;
+exports.interpolateObject = object;
+exports.interpolateRgb = rgb;
+exports.interpolateRgbBasis = rgbBasis;
+exports.interpolateRgbBasisClosed = rgbBasisClosed;
+exports.interpolateRound = round;
+exports.interpolateString = string;
+exports.interpolateTransformCss = interpolateTransformCss;
+exports.interpolateTransformSvg = interpolateTransformSvg;
+exports.interpolateZoom = zoom;
+exports.piecewise = piecewise;
+exports.quantize = quantize;
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+})));
diff --git a/node_modules/d3-interpolate/dist/d3-interpolate.min.js b/node_modules/d3-interpolate/dist/d3-interpolate.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..d1b626367009128c02c3918b1785110df28ec120
--- /dev/null
+++ b/node_modules/d3-interpolate/dist/d3-interpolate.min.js
@@ -0,0 +1,2 @@
+// https://d3js.org/d3-interpolate/ v3.0.1 Copyright 2010-2021 Mike Bostock
+!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-color"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{},t.d3)}(this,(function(t,n){"use strict";function r(t,n,r,e,a){var o=t*t,u=o*t;return((1-3*t+3*o-u)*n+(4-6*o+3*u)*r+(1+3*t+3*o-3*u)*e+u*a)/6}function e(t){var n=t.length-1;return function(e){var a=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),o=t[a],u=t[a+1],i=a>0?t[a-1]:2*o-u,c=a()=>t;function u(t,n){return function(r){return t+r*n}}function i(t,n){var r=n-t;return r?u(t,r>180||r<-180?r-360*Math.round(r/360):r):o(isNaN(t)?n:t)}function c(t){return 1==(t=+t)?l:function(n,r){return r-n?function(t,n,r){return t=Math.pow(t,r),n=Math.pow(n,r)-t,r=1/r,function(e){return Math.pow(t+e*n,r)}}(n,r,t):o(isNaN(n)?r:n)}}function l(t,n){var r=n-t;return r?u(t,r):o(isNaN(t)?n:t)}var f=function t(r){var e=c(r);function a(t,r){var a=e((t=n.rgb(t)).r,(r=n.rgb(r)).r),o=e(t.g,r.g),u=e(t.b,r.b),i=l(t.opacity,r.opacity);return function(n){return t.r=a(n),t.g=o(n),t.b=u(n),t.opacity=i(n),t+""}}return a.gamma=t,a}(1);function s(t){return function(r){var e,a,o=r.length,u=new Array(o),i=new Array(o),c=new Array(o);for(e=0;eo&&(a=n.slice(o,a),i[u]?i[u]+=a:i[++u]=a),(r=r[0])===(e=e[0])?i[u]?i[u]+=e:i[++u]=e:(i[++u]=null,c.push({i:u,x:b(r,e)})),o=w.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:r.push(a(r)+"rotate(",null,e)-2,x:b(t,n)})):n&&r.push(a(r)+"rotate("+n+e)}(o.rotate,u.rotate,i,c),function(t,n,r,o){t!==n?o.push({i:r.push(a(r)+"skewX(",null,e)-2,x:b(t,n)}):n&&r.push(a(r)+"skewX("+n+e)}(o.skewX,u.skewX,i,c),function(t,n,r,e,o,u){if(t!==r||n!==e){var i=o.push(a(o)+"scale(",null,",",null,")");u.push({i:i-4,x:b(t,r)},{i:i-2,x:b(n,e)})}else 1===r&&1===e||o.push(a(o)+"scale("+r+","+e+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,i,c),o=u=null,function(t){for(var n,r=-1,e=c.length;++r=12"
+ }
+}
diff --git a/node_modules/d3-interpolate/src/array.js b/node_modules/d3-interpolate/src/array.js
new file mode 100644
index 0000000000000000000000000000000000000000..89f77225ad11dbd6cf1d8ddf327205a6c63653da
--- /dev/null
+++ b/node_modules/d3-interpolate/src/array.js
@@ -0,0 +1,22 @@
+import value from "./value.js";
+import numberArray, {isNumberArray} from "./numberArray.js";
+
+export default function(a, b) {
+ return (isNumberArray(b) ? numberArray : genericArray)(a, b);
+}
+
+export function genericArray(a, b) {
+ var nb = b ? b.length : 0,
+ na = a ? Math.min(nb, a.length) : 0,
+ x = new Array(na),
+ c = new Array(nb),
+ i;
+
+ for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);
+ for (; i < nb; ++i) c[i] = b[i];
+
+ return function(t) {
+ for (i = 0; i < na; ++i) c[i] = x[i](t);
+ return c;
+ };
+}
diff --git a/node_modules/d3-interpolate/src/basis.js b/node_modules/d3-interpolate/src/basis.js
new file mode 100644
index 0000000000000000000000000000000000000000..0d853f05d32f5f468944d56095d7f6af2e67ed2e
--- /dev/null
+++ b/node_modules/d3-interpolate/src/basis.js
@@ -0,0 +1,19 @@
+export function basis(t1, v0, v1, v2, v3) {
+ var t2 = t1 * t1, t3 = t2 * t1;
+ return ((1 - 3 * t1 + 3 * t2 - t3) * v0
+ + (4 - 6 * t2 + 3 * t3) * v1
+ + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2
+ + t3 * v3) / 6;
+}
+
+export default function(values) {
+ var n = values.length - 1;
+ return function(t) {
+ var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
+ v1 = values[i],
+ v2 = values[i + 1],
+ v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
+ v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
+ return basis((t - i / n) * n, v0, v1, v2, v3);
+ };
+}
diff --git a/node_modules/d3-interpolate/src/basisClosed.js b/node_modules/d3-interpolate/src/basisClosed.js
new file mode 100644
index 0000000000000000000000000000000000000000..2639d92803dd9b4a8ac48e72e720909ae10d0daf
--- /dev/null
+++ b/node_modules/d3-interpolate/src/basisClosed.js
@@ -0,0 +1,13 @@
+import {basis} from "./basis.js";
+
+export default function(values) {
+ var n = values.length;
+ return function(t) {
+ var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
+ v0 = values[(i + n - 1) % n],
+ v1 = values[i % n],
+ v2 = values[(i + 1) % n],
+ v3 = values[(i + 2) % n];
+ return basis((t - i / n) * n, v0, v1, v2, v3);
+ };
+}
diff --git a/node_modules/d3-interpolate/src/color.js b/node_modules/d3-interpolate/src/color.js
new file mode 100644
index 0000000000000000000000000000000000000000..4630fb2f949717225d8402e2a1bbdeb2ddfdd271
--- /dev/null
+++ b/node_modules/d3-interpolate/src/color.js
@@ -0,0 +1,29 @@
+import constant from "./constant.js";
+
+function linear(a, d) {
+ return function(t) {
+ return a + t * d;
+ };
+}
+
+function exponential(a, b, y) {
+ return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
+ return Math.pow(a + t * b, y);
+ };
+}
+
+export function hue(a, b) {
+ var d = b - a;
+ return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);
+}
+
+export function gamma(y) {
+ return (y = +y) === 1 ? nogamma : function(a, b) {
+ return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
+ };
+}
+
+export default function nogamma(a, b) {
+ var d = b - a;
+ return d ? linear(a, d) : constant(isNaN(a) ? b : a);
+}
diff --git a/node_modules/d3-interpolate/src/constant.js b/node_modules/d3-interpolate/src/constant.js
new file mode 100644
index 0000000000000000000000000000000000000000..3487c0ddfaabca50218341abd733df08493b568c
--- /dev/null
+++ b/node_modules/d3-interpolate/src/constant.js
@@ -0,0 +1 @@
+export default x => () => x;
diff --git a/node_modules/d3-interpolate/src/cubehelix.js b/node_modules/d3-interpolate/src/cubehelix.js
new file mode 100644
index 0000000000000000000000000000000000000000..2c4f64bd3f3307d99fec9c9bdceea3f1533487b9
--- /dev/null
+++ b/node_modules/d3-interpolate/src/cubehelix.js
@@ -0,0 +1,29 @@
+import {cubehelix as colorCubehelix} from "d3-color";
+import color, {hue} from "./color.js";
+
+function cubehelix(hue) {
+ return (function cubehelixGamma(y) {
+ y = +y;
+
+ function cubehelix(start, end) {
+ var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),
+ s = color(start.s, end.s),
+ l = color(start.l, end.l),
+ opacity = color(start.opacity, end.opacity);
+ return function(t) {
+ start.h = h(t);
+ start.s = s(t);
+ start.l = l(Math.pow(t, y));
+ start.opacity = opacity(t);
+ return start + "";
+ };
+ }
+
+ cubehelix.gamma = cubehelixGamma;
+
+ return cubehelix;
+ })(1);
+}
+
+export default cubehelix(hue);
+export var cubehelixLong = cubehelix(color);
diff --git a/node_modules/d3-interpolate/src/date.js b/node_modules/d3-interpolate/src/date.js
new file mode 100644
index 0000000000000000000000000000000000000000..cdfbea79c15d332f1d95b133a04dabea51d9af4a
--- /dev/null
+++ b/node_modules/d3-interpolate/src/date.js
@@ -0,0 +1,6 @@
+export default function(a, b) {
+ var d = new Date;
+ return a = +a, b = +b, function(t) {
+ return d.setTime(a * (1 - t) + b * t), d;
+ };
+}
diff --git a/node_modules/d3-interpolate/src/discrete.js b/node_modules/d3-interpolate/src/discrete.js
new file mode 100644
index 0000000000000000000000000000000000000000..b3d1e3b66fc73107bcc75038df508eefa3dafd2c
--- /dev/null
+++ b/node_modules/d3-interpolate/src/discrete.js
@@ -0,0 +1,6 @@
+export default function(range) {
+ var n = range.length;
+ return function(t) {
+ return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];
+ };
+}
diff --git a/node_modules/d3-interpolate/src/hcl.js b/node_modules/d3-interpolate/src/hcl.js
new file mode 100644
index 0000000000000000000000000000000000000000..03125802e868f55a3f5b12177805c4fc0bb838e9
--- /dev/null
+++ b/node_modules/d3-interpolate/src/hcl.js
@@ -0,0 +1,21 @@
+import {hcl as colorHcl} from "d3-color";
+import color, {hue} from "./color.js";
+
+function hcl(hue) {
+ return function(start, end) {
+ var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),
+ c = color(start.c, end.c),
+ l = color(start.l, end.l),
+ opacity = color(start.opacity, end.opacity);
+ return function(t) {
+ start.h = h(t);
+ start.c = c(t);
+ start.l = l(t);
+ start.opacity = opacity(t);
+ return start + "";
+ };
+ }
+}
+
+export default hcl(hue);
+export var hclLong = hcl(color);
diff --git a/node_modules/d3-interpolate/src/hsl.js b/node_modules/d3-interpolate/src/hsl.js
new file mode 100644
index 0000000000000000000000000000000000000000..2f78a9017cdcc342ee1428e3da60ec69d8610c1c
--- /dev/null
+++ b/node_modules/d3-interpolate/src/hsl.js
@@ -0,0 +1,21 @@
+import {hsl as colorHsl} from "d3-color";
+import color, {hue} from "./color.js";
+
+function hsl(hue) {
+ return function(start, end) {
+ var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),
+ s = color(start.s, end.s),
+ l = color(start.l, end.l),
+ opacity = color(start.opacity, end.opacity);
+ return function(t) {
+ start.h = h(t);
+ start.s = s(t);
+ start.l = l(t);
+ start.opacity = opacity(t);
+ return start + "";
+ };
+ }
+}
+
+export default hsl(hue);
+export var hslLong = hsl(color);
diff --git a/node_modules/d3-interpolate/src/hue.js b/node_modules/d3-interpolate/src/hue.js
new file mode 100644
index 0000000000000000000000000000000000000000..5d8d4b9cf38e57e06648d9906d23f1a01292dff7
--- /dev/null
+++ b/node_modules/d3-interpolate/src/hue.js
@@ -0,0 +1,9 @@
+import {hue} from "./color.js";
+
+export default function(a, b) {
+ var i = hue(+a, +b);
+ return function(t) {
+ var x = i(t);
+ return x - 360 * Math.floor(x / 360);
+ };
+}
diff --git a/node_modules/d3-interpolate/src/index.js b/node_modules/d3-interpolate/src/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..b4dce7d5acd085c177d47839f08fdb75203cd8c0
--- /dev/null
+++ b/node_modules/d3-interpolate/src/index.js
@@ -0,0 +1,21 @@
+export {default as interpolate} from "./value.js";
+export {default as interpolateArray} from "./array.js";
+export {default as interpolateBasis} from "./basis.js";
+export {default as interpolateBasisClosed} from "./basisClosed.js";
+export {default as interpolateDate} from "./date.js";
+export {default as interpolateDiscrete} from "./discrete.js";
+export {default as interpolateHue} from "./hue.js";
+export {default as interpolateNumber} from "./number.js";
+export {default as interpolateNumberArray} from "./numberArray.js";
+export {default as interpolateObject} from "./object.js";
+export {default as interpolateRound} from "./round.js";
+export {default as interpolateString} from "./string.js";
+export {interpolateTransformCss, interpolateTransformSvg} from "./transform/index.js";
+export {default as interpolateZoom} from "./zoom.js";
+export {default as interpolateRgb, rgbBasis as interpolateRgbBasis, rgbBasisClosed as interpolateRgbBasisClosed} from "./rgb.js";
+export {default as interpolateHsl, hslLong as interpolateHslLong} from "./hsl.js";
+export {default as interpolateLab} from "./lab.js";
+export {default as interpolateHcl, hclLong as interpolateHclLong} from "./hcl.js";
+export {default as interpolateCubehelix, cubehelixLong as interpolateCubehelixLong} from "./cubehelix.js";
+export {default as piecewise} from "./piecewise.js";
+export {default as quantize} from "./quantize.js";
diff --git a/node_modules/d3-interpolate/src/lab.js b/node_modules/d3-interpolate/src/lab.js
new file mode 100644
index 0000000000000000000000000000000000000000..8fbf7f35cccb9309647a70f82bf2abc0417436fa
--- /dev/null
+++ b/node_modules/d3-interpolate/src/lab.js
@@ -0,0 +1,16 @@
+import {lab as colorLab} from "d3-color";
+import color from "./color.js";
+
+export default function lab(start, end) {
+ var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),
+ a = color(start.a, end.a),
+ b = color(start.b, end.b),
+ opacity = color(start.opacity, end.opacity);
+ return function(t) {
+ start.l = l(t);
+ start.a = a(t);
+ start.b = b(t);
+ start.opacity = opacity(t);
+ return start + "";
+ };
+}
diff --git a/node_modules/d3-interpolate/src/number.js b/node_modules/d3-interpolate/src/number.js
new file mode 100644
index 0000000000000000000000000000000000000000..837b13db1af21cf58ae619176ead47509a59d143
--- /dev/null
+++ b/node_modules/d3-interpolate/src/number.js
@@ -0,0 +1,5 @@
+export default function(a, b) {
+ return a = +a, b = +b, function(t) {
+ return a * (1 - t) + b * t;
+ };
+}
diff --git a/node_modules/d3-interpolate/src/numberArray.js b/node_modules/d3-interpolate/src/numberArray.js
new file mode 100644
index 0000000000000000000000000000000000000000..4081086c6fbdfea0a8c42063e7cc1e8a6d26ec9e
--- /dev/null
+++ b/node_modules/d3-interpolate/src/numberArray.js
@@ -0,0 +1,14 @@
+export default function(a, b) {
+ if (!b) b = [];
+ var n = a ? Math.min(b.length, a.length) : 0,
+ c = b.slice(),
+ i;
+ return function(t) {
+ for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
+ return c;
+ };
+}
+
+export function isNumberArray(x) {
+ return ArrayBuffer.isView(x) && !(x instanceof DataView);
+}
diff --git a/node_modules/d3-interpolate/src/object.js b/node_modules/d3-interpolate/src/object.js
new file mode 100644
index 0000000000000000000000000000000000000000..b521c3371a2e6a451f5cbfadbf36c164a84c32a2
--- /dev/null
+++ b/node_modules/d3-interpolate/src/object.js
@@ -0,0 +1,23 @@
+import value from "./value.js";
+
+export default function(a, b) {
+ var i = {},
+ c = {},
+ k;
+
+ if (a === null || typeof a !== "object") a = {};
+ if (b === null || typeof b !== "object") b = {};
+
+ for (k in b) {
+ if (k in a) {
+ i[k] = value(a[k], b[k]);
+ } else {
+ c[k] = b[k];
+ }
+ }
+
+ return function(t) {
+ for (k in i) c[k] = i[k](t);
+ return c;
+ };
+}
diff --git a/node_modules/d3-interpolate/src/piecewise.js b/node_modules/d3-interpolate/src/piecewise.js
new file mode 100644
index 0000000000000000000000000000000000000000..8b568c5f929d4be8eb0d74f55d6e78351f488832
--- /dev/null
+++ b/node_modules/d3-interpolate/src/piecewise.js
@@ -0,0 +1,11 @@
+import {default as value} from "./value.js";
+
+export default function piecewise(interpolate, values) {
+ if (values === undefined) values = interpolate, interpolate = value;
+ var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);
+ while (i < n) I[i] = interpolate(v, v = values[++i]);
+ return function(t) {
+ var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));
+ return I[i](t - i);
+ };
+}
diff --git a/node_modules/d3-interpolate/src/quantize.js b/node_modules/d3-interpolate/src/quantize.js
new file mode 100644
index 0000000000000000000000000000000000000000..d7c23e69d438888df28cb6d2dbde79600c59cedb
--- /dev/null
+++ b/node_modules/d3-interpolate/src/quantize.js
@@ -0,0 +1,5 @@
+export default function(interpolator, n) {
+ var samples = new Array(n);
+ for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));
+ return samples;
+}
diff --git a/node_modules/d3-interpolate/src/rgb.js b/node_modules/d3-interpolate/src/rgb.js
new file mode 100644
index 0000000000000000000000000000000000000000..495c1f8c5ae4be2b04d2e68a3cd964cbd7f82ea1
--- /dev/null
+++ b/node_modules/d3-interpolate/src/rgb.js
@@ -0,0 +1,55 @@
+import {rgb as colorRgb} from "d3-color";
+import basis from "./basis.js";
+import basisClosed from "./basisClosed.js";
+import nogamma, {gamma} from "./color.js";
+
+export default (function rgbGamma(y) {
+ var color = gamma(y);
+
+ function rgb(start, end) {
+ var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),
+ g = color(start.g, end.g),
+ b = color(start.b, end.b),
+ opacity = nogamma(start.opacity, end.opacity);
+ return function(t) {
+ start.r = r(t);
+ start.g = g(t);
+ start.b = b(t);
+ start.opacity = opacity(t);
+ return start + "";
+ };
+ }
+
+ rgb.gamma = rgbGamma;
+
+ return rgb;
+})(1);
+
+function rgbSpline(spline) {
+ return function(colors) {
+ var n = colors.length,
+ r = new Array(n),
+ g = new Array(n),
+ b = new Array(n),
+ i, color;
+ for (i = 0; i < n; ++i) {
+ color = colorRgb(colors[i]);
+ r[i] = color.r || 0;
+ g[i] = color.g || 0;
+ b[i] = color.b || 0;
+ }
+ r = spline(r);
+ g = spline(g);
+ b = spline(b);
+ color.opacity = 1;
+ return function(t) {
+ color.r = r(t);
+ color.g = g(t);
+ color.b = b(t);
+ return color + "";
+ };
+ };
+}
+
+export var rgbBasis = rgbSpline(basis);
+export var rgbBasisClosed = rgbSpline(basisClosed);
diff --git a/node_modules/d3-interpolate/src/round.js b/node_modules/d3-interpolate/src/round.js
new file mode 100644
index 0000000000000000000000000000000000000000..2635d28c132b72bc31a56f018001a766c48d7ab6
--- /dev/null
+++ b/node_modules/d3-interpolate/src/round.js
@@ -0,0 +1,5 @@
+export default function(a, b) {
+ return a = +a, b = +b, function(t) {
+ return Math.round(a * (1 - t) + b * t);
+ };
+}
diff --git a/node_modules/d3-interpolate/src/string.js b/node_modules/d3-interpolate/src/string.js
new file mode 100644
index 0000000000000000000000000000000000000000..7f04d2d052bbd0029e8e65672dfbf1f9fe68dd8b
--- /dev/null
+++ b/node_modules/d3-interpolate/src/string.js
@@ -0,0 +1,64 @@
+import number from "./number.js";
+
+var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
+ reB = new RegExp(reA.source, "g");
+
+function zero(b) {
+ return function() {
+ return b;
+ };
+}
+
+function one(b) {
+ return function(t) {
+ return b(t) + "";
+ };
+}
+
+export default function(a, b) {
+ var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
+ am, // current match in a
+ bm, // current match in b
+ bs, // string preceding current number in b, if any
+ i = -1, // index in s
+ s = [], // string constants and placeholders
+ q = []; // number interpolators
+
+ // Coerce inputs to strings.
+ a = a + "", b = b + "";
+
+ // Interpolate pairs of numbers in a & b.
+ while ((am = reA.exec(a))
+ && (bm = reB.exec(b))) {
+ if ((bs = bm.index) > bi) { // a string precedes the next number in b
+ bs = b.slice(bi, bs);
+ if (s[i]) s[i] += bs; // coalesce with previous string
+ else s[++i] = bs;
+ }
+ if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
+ if (s[i]) s[i] += bm; // coalesce with previous string
+ else s[++i] = bm;
+ } else { // interpolate non-matching numbers
+ s[++i] = null;
+ q.push({i: i, x: number(am, bm)});
+ }
+ bi = reB.lastIndex;
+ }
+
+ // Add remains of b.
+ if (bi < b.length) {
+ bs = b.slice(bi);
+ if (s[i]) s[i] += bs; // coalesce with previous string
+ else s[++i] = bs;
+ }
+
+ // Special optimization for only a single match.
+ // Otherwise, interpolate each of the numbers and rejoin the string.
+ return s.length < 2 ? (q[0]
+ ? one(q[0].x)
+ : zero(b))
+ : (b = q.length, function(t) {
+ for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
+ return s.join("");
+ });
+}
diff --git a/node_modules/d3-interpolate/src/transform/decompose.js b/node_modules/d3-interpolate/src/transform/decompose.js
new file mode 100644
index 0000000000000000000000000000000000000000..3535f231ef03fcd4f609282ad9186b975ca0abbf
--- /dev/null
+++ b/node_modules/d3-interpolate/src/transform/decompose.js
@@ -0,0 +1,26 @@
+var degrees = 180 / Math.PI;
+
+export var identity = {
+ translateX: 0,
+ translateY: 0,
+ rotate: 0,
+ skewX: 0,
+ scaleX: 1,
+ scaleY: 1
+};
+
+export default function(a, b, c, d, e, f) {
+ var scaleX, scaleY, skewX;
+ if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
+ if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
+ if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
+ if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
+ return {
+ translateX: e,
+ translateY: f,
+ rotate: Math.atan2(b, a) * degrees,
+ skewX: Math.atan(skewX) * degrees,
+ scaleX: scaleX,
+ scaleY: scaleY
+ };
+}
diff --git a/node_modules/d3-interpolate/src/transform/index.js b/node_modules/d3-interpolate/src/transform/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..5383d5f83e7049dfca73ae0424833d06cdf6c450
--- /dev/null
+++ b/node_modules/d3-interpolate/src/transform/index.js
@@ -0,0 +1,63 @@
+import number from "../number.js";
+import {parseCss, parseSvg} from "./parse.js";
+
+function interpolateTransform(parse, pxComma, pxParen, degParen) {
+
+ function pop(s) {
+ return s.length ? s.pop() + " " : "";
+ }
+
+ function translate(xa, ya, xb, yb, s, q) {
+ if (xa !== xb || ya !== yb) {
+ var i = s.push("translate(", null, pxComma, null, pxParen);
+ q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});
+ } else if (xb || yb) {
+ s.push("translate(" + xb + pxComma + yb + pxParen);
+ }
+ }
+
+ function rotate(a, b, s, q) {
+ if (a !== b) {
+ if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path
+ q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)});
+ } else if (b) {
+ s.push(pop(s) + "rotate(" + b + degParen);
+ }
+ }
+
+ function skewX(a, b, s, q) {
+ if (a !== b) {
+ q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)});
+ } else if (b) {
+ s.push(pop(s) + "skewX(" + b + degParen);
+ }
+ }
+
+ function scale(xa, ya, xb, yb, s, q) {
+ if (xa !== xb || ya !== yb) {
+ var i = s.push(pop(s) + "scale(", null, ",", null, ")");
+ q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});
+ } else if (xb !== 1 || yb !== 1) {
+ s.push(pop(s) + "scale(" + xb + "," + yb + ")");
+ }
+ }
+
+ return function(a, b) {
+ var s = [], // string constants and placeholders
+ q = []; // number interpolators
+ a = parse(a), b = parse(b);
+ translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
+ rotate(a.rotate, b.rotate, s, q);
+ skewX(a.skewX, b.skewX, s, q);
+ scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
+ a = b = null; // gc
+ return function(t) {
+ var i = -1, n = q.length, o;
+ while (++i < n) s[(o = q[i]).i] = o.x(t);
+ return s.join("");
+ };
+ };
+}
+
+export var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
+export var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
diff --git a/node_modules/d3-interpolate/src/transform/parse.js b/node_modules/d3-interpolate/src/transform/parse.js
new file mode 100644
index 0000000000000000000000000000000000000000..c62088e055a3657e249b5b804f55e81de7510fe0
--- /dev/null
+++ b/node_modules/d3-interpolate/src/transform/parse.js
@@ -0,0 +1,18 @@
+import decompose, {identity} from "./decompose.js";
+
+var svgNode;
+
+/* eslint-disable no-undef */
+export function parseCss(value) {
+ const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
+ return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
+}
+
+export function parseSvg(value) {
+ if (value == null) return identity;
+ if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
+ svgNode.setAttribute("transform", value);
+ if (!(value = svgNode.transform.baseVal.consolidate())) return identity;
+ value = value.matrix;
+ return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
+}
diff --git a/node_modules/d3-interpolate/src/value.js b/node_modules/d3-interpolate/src/value.js
new file mode 100644
index 0000000000000000000000000000000000000000..6a67ac4aa8897cc7cd23968bdbb827349eba6054
--- /dev/null
+++ b/node_modules/d3-interpolate/src/value.js
@@ -0,0 +1,22 @@
+import {color} from "d3-color";
+import rgb from "./rgb.js";
+import {genericArray} from "./array.js";
+import date from "./date.js";
+import number from "./number.js";
+import object from "./object.js";
+import string from "./string.js";
+import constant from "./constant.js";
+import numberArray, {isNumberArray} from "./numberArray.js";
+
+export default function(a, b) {
+ var t = typeof b, c;
+ return b == null || t === "boolean" ? constant(b)
+ : (t === "number" ? number
+ : t === "string" ? ((c = color(b)) ? (b = c, rgb) : string)
+ : b instanceof color ? rgb
+ : b instanceof Date ? date
+ : isNumberArray(b) ? numberArray
+ : Array.isArray(b) ? genericArray
+ : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
+ : number)(a, b);
+}
diff --git a/node_modules/d3-interpolate/src/zoom.js b/node_modules/d3-interpolate/src/zoom.js
new file mode 100644
index 0000000000000000000000000000000000000000..f2756026894fa24463c1505794f1c61c5e7ca1e8
--- /dev/null
+++ b/node_modules/d3-interpolate/src/zoom.js
@@ -0,0 +1,71 @@
+var epsilon2 = 1e-12;
+
+function cosh(x) {
+ return ((x = Math.exp(x)) + 1 / x) / 2;
+}
+
+function sinh(x) {
+ return ((x = Math.exp(x)) - 1 / x) / 2;
+}
+
+function tanh(x) {
+ return ((x = Math.exp(2 * x)) - 1) / (x + 1);
+}
+
+export default (function zoomRho(rho, rho2, rho4) {
+
+ // p0 = [ux0, uy0, w0]
+ // p1 = [ux1, uy1, w1]
+ function zoom(p0, p1) {
+ var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],
+ ux1 = p1[0], uy1 = p1[1], w1 = p1[2],
+ dx = ux1 - ux0,
+ dy = uy1 - uy0,
+ d2 = dx * dx + dy * dy,
+ i,
+ S;
+
+ // Special case for u0 ≅ u1.
+ if (d2 < epsilon2) {
+ S = Math.log(w1 / w0) / rho;
+ i = function(t) {
+ return [
+ ux0 + t * dx,
+ uy0 + t * dy,
+ w0 * Math.exp(rho * t * S)
+ ];
+ }
+ }
+
+ // General case.
+ else {
+ var d1 = Math.sqrt(d2),
+ b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
+ b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
+ r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
+ r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
+ S = (r1 - r0) / rho;
+ i = function(t) {
+ var s = t * S,
+ coshr0 = cosh(r0),
+ u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
+ return [
+ ux0 + u * dx,
+ uy0 + u * dy,
+ w0 * coshr0 / cosh(rho * s + r0)
+ ];
+ }
+ }
+
+ i.duration = S * 1000 * rho / Math.SQRT2;
+
+ return i;
+ }
+
+ zoom.rho = function(_) {
+ var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;
+ return zoomRho(_1, _2, _4);
+ };
+
+ return zoom;
+})(Math.SQRT2, 2, 4);
diff --git a/node_modules/d3-path/LICENSE b/node_modules/d3-path/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..576b910b2775b47c0f591ff8746844ccfb4f852b
--- /dev/null
+++ b/node_modules/d3-path/LICENSE
@@ -0,0 +1,27 @@
+Copyright 2015-2016 Mike Bostock
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of the author nor the names of contributors may be used to
+ endorse or promote products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/d3-path/README.md b/node_modules/d3-path/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..b3f86414c059c6293ae0ce08ad55bb9424237648
--- /dev/null
+++ b/node_modules/d3-path/README.md
@@ -0,0 +1,78 @@
+# d3-path
+
+Say you have some code that draws to a 2D canvas:
+
+```js
+function drawCircle(context, radius) {
+ context.moveTo(radius, 0);
+ context.arc(0, 0, radius, 0, 2 * Math.PI);
+}
+```
+
+The d3-path module lets you take this exact code and additionally render to [SVG](http://www.w3.org/TR/SVG/paths.html). It works by [serializing](#path_toString) [CanvasPathMethods](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls to [SVG path data](http://www.w3.org/TR/SVG/paths.html#PathData). For example:
+
+```js
+var context = d3.path();
+drawCircle(context, 40);
+pathElement.setAttribute("d", context.toString());
+```
+
+Now code you write once can be used with both Canvas (for performance) and SVG (for convenience). For a practical example, see [d3-shape](https://github.com/d3/d3-shape).
+
+## Installing
+
+If you use NPM, `npm install d3-path`. Otherwise, download the [latest release](https://github.com/d3/d3-path/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-path.v1.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
+
+```html
+
+
+```
+
+## API Reference
+
+# d3.path() · [Source](https://github.com/d3/d3-path/blob/master/src/path.js), [Examples](https://observablehq.com/@d3/d3-path)
+
+Constructs a new path serializer that implements [CanvasPathMethods](http://www.w3.org/TR/2dcontext/#canvaspathmethods).
+
+#path.moveTo(x, y)
+
+Move to the specified point ⟨*x*, *y*⟩. Equivalent to [*context*.moveTo](http://www.w3.org/TR/2dcontext/#dom-context-2d-moveto) and SVG’s [“moveto” command](http://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands).
+
+#path.closePath()
+
+Ends the current subpath and causes an automatic straight line to be drawn from the current point to the initial point of the current subpath. Equivalent to [*context*.closePath](http://www.w3.org/TR/2dcontext/#dom-context-2d-closepath) and SVG’s [“closepath” command](http://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand).
+
+#path.lineTo(x, y)
+
+Draws a straight line from the current point to the specified point ⟨*x*, *y*⟩. Equivalent to [*context*.lineTo](http://www.w3.org/TR/2dcontext/#dom-context-2d-lineto) and SVG’s [“lineto” command](http://www.w3.org/TR/SVG/paths.html#PathDataLinetoCommands).
+
+#path.quadraticCurveTo(cpx, cpy, x, y)
+
+Draws a quadratic Bézier segment from the current point to the specified point ⟨*x*, *y*⟩, with the specified control point ⟨*cpx*, *cpy*⟩. Equivalent to [*context*.quadraticCurveTo](http://www.w3.org/TR/2dcontext/#dom-context-2d-quadraticcurveto) and SVG’s [quadratic Bézier curve commands](http://www.w3.org/TR/SVG/paths.html#PathDataQuadraticBezierCommands).
+
+#path.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x, y)
+
+Draws a cubic Bézier segment from the current point to the specified point ⟨*x*, *y*⟩, with the specified control points ⟨*cpx1*, *cpy1*⟩ and ⟨*cpx2*, *cpy2*⟩. Equivalent to [*context*.bezierCurveTo](http://www.w3.org/TR/2dcontext/#dom-context-2d-beziercurveto) and SVG’s [cubic Bézier curve commands](http://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands).
+
+#path.arcTo(x1, y1, x2, y2, radius)
+
+Draws a circular arc segment with the specified *radius* that starts tangent to the line between the current point and the specified point ⟨*x1*, *y1*⟩ and ends tangent to the line between the specified points ⟨*x1*, *y1*⟩ and ⟨*x2*, *y2*⟩. If the first tangent point is not equal to the current point, a straight line is drawn between the current point and the first tangent point. Equivalent to [*context*.arcTo](http://www.w3.org/TR/2dcontext/#dom-context-2d-arcto) and uses SVG’s [elliptical arc curve commands](http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands).
+
+#path.arc(x, y, radius, startAngle, endAngle[, anticlockwise])
+
+Draws a circular arc segment with the specified center ⟨*x*, *y*⟩, *radius*, *startAngle* and *endAngle*. If *anticlockwise* is true, the arc is drawn in the anticlockwise direction; otherwise, it is drawn in the clockwise direction. If the current point is not equal to the starting point of the arc, a straight line is drawn from the current point to the start of the arc. Equivalent to [*context*.arc](http://www.w3.org/TR/2dcontext/#dom-context-2d-arc) and uses SVG’s [elliptical arc curve commands](http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands).
+
+#path.rect(x, y, w, h)
+
+Creates a new subpath containing just the four points ⟨*x*, *y*⟩, ⟨*x* + *w*, *y*⟩, ⟨*x* + *w*, *y* + *h*⟩, ⟨*x*, *y* + *h*⟩, with those four points connected by straight lines, and then marks the subpath as closed. Equivalent to [*context*.rect](http://www.w3.org/TR/2dcontext/#dom-context-2d-rect) and uses SVG’s [“lineto” commands](http://www.w3.org/TR/SVG/paths.html#PathDataLinetoCommands).
+
+#path.toString()
+
+Returns the string representation of this *path* according to SVG’s [path data specification](http://www.w3.org/TR/SVG/paths.html#PathData).
diff --git a/node_modules/d3-path/dist/d3-path.js b/node_modules/d3-path/dist/d3-path.js
new file mode 100644
index 0000000000000000000000000000000000000000..05ac8352e8e62b1d66934b333e30504f4f137112
--- /dev/null
+++ b/node_modules/d3-path/dist/d3-path.js
@@ -0,0 +1,141 @@
+// https://d3js.org/d3-path/ v1.0.9 Copyright 2019 Mike Bostock
+(function (global, factory) {
+typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+typeof define === 'function' && define.amd ? define(['exports'], factory) :
+(global = global || self, factory(global.d3 = global.d3 || {}));
+}(this, function (exports) { 'use strict';
+
+var pi = Math.PI,
+ tau = 2 * pi,
+ epsilon = 1e-6,
+ tauEpsilon = tau - epsilon;
+
+function Path() {
+ this._x0 = this._y0 = // start of current subpath
+ this._x1 = this._y1 = null; // end of current subpath
+ this._ = "";
+}
+
+function path() {
+ return new Path;
+}
+
+Path.prototype = path.prototype = {
+ constructor: Path,
+ moveTo: function(x, y) {
+ this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);
+ },
+ closePath: function() {
+ if (this._x1 !== null) {
+ this._x1 = this._x0, this._y1 = this._y0;
+ this._ += "Z";
+ }
+ },
+ lineTo: function(x, y) {
+ this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);
+ },
+ quadraticCurveTo: function(x1, y1, x, y) {
+ this._ += "Q" + (+x1) + "," + (+y1) + "," + (this._x1 = +x) + "," + (this._y1 = +y);
+ },
+ bezierCurveTo: function(x1, y1, x2, y2, x, y) {
+ this._ += "C" + (+x1) + "," + (+y1) + "," + (+x2) + "," + (+y2) + "," + (this._x1 = +x) + "," + (this._y1 = +y);
+ },
+ arcTo: function(x1, y1, x2, y2, r) {
+ x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
+ var x0 = this._x1,
+ y0 = this._y1,
+ x21 = x2 - x1,
+ y21 = y2 - y1,
+ x01 = x0 - x1,
+ y01 = y0 - y1,
+ l01_2 = x01 * x01 + y01 * y01;
+
+ // Is the radius negative? Error.
+ if (r < 0) throw new Error("negative radius: " + r);
+
+ // Is this path empty? Move to (x1,y1).
+ if (this._x1 === null) {
+ this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
+ }
+
+ // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.
+ else if (!(l01_2 > epsilon));
+
+ // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?
+ // Equivalently, is (x1,y1) coincident with (x2,y2)?
+ // Or, is the radius zero? Line to (x1,y1).
+ else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {
+ this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
+ }
+
+ // Otherwise, draw an arc!
+ else {
+ var x20 = x2 - x0,
+ y20 = y2 - y0,
+ l21_2 = x21 * x21 + y21 * y21,
+ l20_2 = x20 * x20 + y20 * y20,
+ l21 = Math.sqrt(l21_2),
+ l01 = Math.sqrt(l01_2),
+ l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),
+ t01 = l / l01,
+ t21 = l / l21;
+
+ // If the start tangent is not coincident with (x0,y0), line to.
+ if (Math.abs(t01 - 1) > epsilon) {
+ this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
+ }
+
+ this._ += "A" + r + "," + r + ",0,0," + (+(y01 * x20 > x01 * y20)) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
+ }
+ },
+ arc: function(x, y, r, a0, a1, ccw) {
+ x = +x, y = +y, r = +r, ccw = !!ccw;
+ var dx = r * Math.cos(a0),
+ dy = r * Math.sin(a0),
+ x0 = x + dx,
+ y0 = y + dy,
+ cw = 1 ^ ccw,
+ da = ccw ? a0 - a1 : a1 - a0;
+
+ // Is the radius negative? Error.
+ if (r < 0) throw new Error("negative radius: " + r);
+
+ // Is this path empty? Move to (x0,y0).
+ if (this._x1 === null) {
+ this._ += "M" + x0 + "," + y0;
+ }
+
+ // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).
+ else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {
+ this._ += "L" + x0 + "," + y0;
+ }
+
+ // Is this arc empty? We’re done.
+ if (!r) return;
+
+ // Does the angle go the wrong way? Flip the direction.
+ if (da < 0) da = da % tau + tau;
+
+ // Is this a complete circle? Draw two arcs to complete the circle.
+ if (da > tauEpsilon) {
+ this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
+ }
+
+ // Is this arc non-empty? Draw an arc!
+ else if (da > epsilon) {
+ this._ += "A" + r + "," + r + ",0," + (+(da >= pi)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
+ }
+ },
+ rect: function(x, y, w, h) {
+ this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + (+w) + "v" + (+h) + "h" + (-w) + "Z";
+ },
+ toString: function() {
+ return this._;
+ }
+};
+
+exports.path = path;
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+}));
diff --git a/node_modules/d3-path/dist/d3-path.min.js b/node_modules/d3-path/dist/d3-path.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..6292a7b99d3340fddbc0a5c94c6b792a75c84466
--- /dev/null
+++ b/node_modules/d3-path/dist/d3-path.min.js
@@ -0,0 +1,2 @@
+// https://d3js.org/d3-path/ v1.0.9 Copyright 2019 Mike Bostock
+!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,function(t){"use strict";var i=Math.PI,s=2*i,h=s-1e-6;function e(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function _(){return new e}e.prototype=_.prototype={constructor:e,moveTo:function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},quadraticCurveTo:function(t,i,s,h){this._+="Q"+ +t+","+ +i+","+(this._x1=+s)+","+(this._y1=+h)},bezierCurveTo:function(t,i,s,h,e,_){this._+="C"+ +t+","+ +i+","+ +s+","+ +h+","+(this._x1=+e)+","+(this._y1=+_)},arcTo:function(t,s,h,e,_){t=+t,s=+s,h=+h,e=+e,_=+_;var n=this._x1,o=this._y1,r=h-t,a=e-s,u=n-t,f=o-s,c=u*u+f*f;if(_<0)throw new Error("negative radius: "+_);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=s);else if(c>1e-6)if(Math.abs(f*r-a*u)>1e-6&&_){var x=h-n,y=e-o,M=r*r+a*a,l=x*x+y*y,d=Math.sqrt(M),p=Math.sqrt(c),v=_*Math.tan((i-Math.acos((M+c-l)/(2*d*p)))/2),b=v/p,w=v/d;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*u)+","+(s+b*f)),this._+="A"+_+","+_+",0,0,"+ +(f*x>u*y)+","+(this._x1=t+w*r)+","+(this._y1=s+w*a)}else this._+="L"+(this._x1=t)+","+(this._y1=s);else;},arc:function(t,e,_,n,o,r){t=+t,e=+e,r=!!r;var a=(_=+_)*Math.cos(n),u=_*Math.sin(n),f=t+a,c=e+u,x=1^r,y=r?n-o:o-n;if(_<0)throw new Error("negative radius: "+_);null===this._x1?this._+="M"+f+","+c:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+f+","+c),_&&(y<0&&(y=y%s+s),y>h?this._+="A"+_+","+_+",0,1,"+x+","+(t-a)+","+(e-u)+"A"+_+","+_+",0,1,"+x+","+(this._x1=f)+","+(this._y1=c):y>1e-6&&(this._+="A"+_+","+_+",0,"+ +(y>=i)+","+x+","+(this._x1=t+_*Math.cos(o))+","+(this._y1=e+_*Math.sin(o))))},rect:function(t,i,s,h){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +s+"v"+ +h+"h"+-s+"Z"},toString:function(){return this._}},t.path=_,Object.defineProperty(t,"__esModule",{value:!0})});
diff --git a/node_modules/d3-path/package.json b/node_modules/d3-path/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..d7dacfa1cd324688a35e011e86ddaef84fc39bad
--- /dev/null
+++ b/node_modules/d3-path/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "d3-path",
+ "version": "1.0.9",
+ "description": "Serialize Canvas path commands to SVG.",
+ "keywords": [
+ "d3",
+ "d3-module",
+ "canvas",
+ "path",
+ "svg",
+ "graphics",
+ "CanvasRenderingContext2D",
+ "CanvasPathMethods",
+ "Path2D"
+ ],
+ "homepage": "https://d3js.org/d3-path/",
+ "license": "BSD-3-Clause",
+ "author": {
+ "name": "Mike Bostock",
+ "url": "http://bost.ocks.org/mike"
+ },
+ "main": "dist/d3-path.js",
+ "unpkg": "dist/d3-path.min.js",
+ "jsdelivr": "dist/d3-path.min.js",
+ "module": "src/index.js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/d3/d3-path.git"
+ },
+ "files": [
+ "dist/**/*.js",
+ "src/**/*.js"
+ ],
+ "scripts": {
+ "pretest": "rollup -c",
+ "test": "tape 'test/**/*-test.js' && eslint src test",
+ "prepublishOnly": "rm -rf dist && yarn test",
+ "postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"
+ },
+ "sideEffects": false,
+ "devDependencies": {
+ "eslint": "6",
+ "rollup": "1",
+ "rollup-plugin-terser": "5",
+ "tape": "4"
+ }
+}
diff --git a/node_modules/d3-path/src/index.js b/node_modules/d3-path/src/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..968e6e581f086ebc03e7c37a4d7a55feae82b0bd
--- /dev/null
+++ b/node_modules/d3-path/src/index.js
@@ -0,0 +1 @@
+export {default as path} from "./path.js";
diff --git a/node_modules/d3-path/src/path.js b/node_modules/d3-path/src/path.js
new file mode 100644
index 0000000000000000000000000000000000000000..b10ba9e513aaf3d4127908b525d4703e352959fc
--- /dev/null
+++ b/node_modules/d3-path/src/path.js
@@ -0,0 +1,130 @@
+var pi = Math.PI,
+ tau = 2 * pi,
+ epsilon = 1e-6,
+ tauEpsilon = tau - epsilon;
+
+function Path() {
+ this._x0 = this._y0 = // start of current subpath
+ this._x1 = this._y1 = null; // end of current subpath
+ this._ = "";
+}
+
+function path() {
+ return new Path;
+}
+
+Path.prototype = path.prototype = {
+ constructor: Path,
+ moveTo: function(x, y) {
+ this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);
+ },
+ closePath: function() {
+ if (this._x1 !== null) {
+ this._x1 = this._x0, this._y1 = this._y0;
+ this._ += "Z";
+ }
+ },
+ lineTo: function(x, y) {
+ this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);
+ },
+ quadraticCurveTo: function(x1, y1, x, y) {
+ this._ += "Q" + (+x1) + "," + (+y1) + "," + (this._x1 = +x) + "," + (this._y1 = +y);
+ },
+ bezierCurveTo: function(x1, y1, x2, y2, x, y) {
+ this._ += "C" + (+x1) + "," + (+y1) + "," + (+x2) + "," + (+y2) + "," + (this._x1 = +x) + "," + (this._y1 = +y);
+ },
+ arcTo: function(x1, y1, x2, y2, r) {
+ x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
+ var x0 = this._x1,
+ y0 = this._y1,
+ x21 = x2 - x1,
+ y21 = y2 - y1,
+ x01 = x0 - x1,
+ y01 = y0 - y1,
+ l01_2 = x01 * x01 + y01 * y01;
+
+ // Is the radius negative? Error.
+ if (r < 0) throw new Error("negative radius: " + r);
+
+ // Is this path empty? Move to (x1,y1).
+ if (this._x1 === null) {
+ this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
+ }
+
+ // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.
+ else if (!(l01_2 > epsilon));
+
+ // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?
+ // Equivalently, is (x1,y1) coincident with (x2,y2)?
+ // Or, is the radius zero? Line to (x1,y1).
+ else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {
+ this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
+ }
+
+ // Otherwise, draw an arc!
+ else {
+ var x20 = x2 - x0,
+ y20 = y2 - y0,
+ l21_2 = x21 * x21 + y21 * y21,
+ l20_2 = x20 * x20 + y20 * y20,
+ l21 = Math.sqrt(l21_2),
+ l01 = Math.sqrt(l01_2),
+ l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),
+ t01 = l / l01,
+ t21 = l / l21;
+
+ // If the start tangent is not coincident with (x0,y0), line to.
+ if (Math.abs(t01 - 1) > epsilon) {
+ this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
+ }
+
+ this._ += "A" + r + "," + r + ",0,0," + (+(y01 * x20 > x01 * y20)) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
+ }
+ },
+ arc: function(x, y, r, a0, a1, ccw) {
+ x = +x, y = +y, r = +r, ccw = !!ccw;
+ var dx = r * Math.cos(a0),
+ dy = r * Math.sin(a0),
+ x0 = x + dx,
+ y0 = y + dy,
+ cw = 1 ^ ccw,
+ da = ccw ? a0 - a1 : a1 - a0;
+
+ // Is the radius negative? Error.
+ if (r < 0) throw new Error("negative radius: " + r);
+
+ // Is this path empty? Move to (x0,y0).
+ if (this._x1 === null) {
+ this._ += "M" + x0 + "," + y0;
+ }
+
+ // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).
+ else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {
+ this._ += "L" + x0 + "," + y0;
+ }
+
+ // Is this arc empty? We’re done.
+ if (!r) return;
+
+ // Does the angle go the wrong way? Flip the direction.
+ if (da < 0) da = da % tau + tau;
+
+ // Is this a complete circle? Draw two arcs to complete the circle.
+ if (da > tauEpsilon) {
+ this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
+ }
+
+ // Is this arc non-empty? Draw an arc!
+ else if (da > epsilon) {
+ this._ += "A" + r + "," + r + ",0," + (+(da >= pi)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
+ }
+ },
+ rect: function(x, y, w, h) {
+ this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + (+w) + "v" + (+h) + "h" + (-w) + "Z";
+ },
+ toString: function() {
+ return this._;
+ }
+};
+
+export default path;
diff --git a/node_modules/d3-quadtree/LICENSE b/node_modules/d3-quadtree/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..721bd22ece6587a9408eda1b6a3949c425b5624a
--- /dev/null
+++ b/node_modules/d3-quadtree/LICENSE
@@ -0,0 +1,27 @@
+Copyright 2010-2016 Mike Bostock
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of the author nor the names of contributors may be used to
+ endorse or promote products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/d3-quadtree/README.md b/node_modules/d3-quadtree/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..05692ffef7455c55f034c5b1d05486dbef4cdf3b
--- /dev/null
+++ b/node_modules/d3-quadtree/README.md
@@ -0,0 +1,163 @@
+# d3-quadtree
+
+A [quadtree](https://en.wikipedia.org/wiki/Quadtree) recursively partitions two-dimensional space into squares, dividing each square into four equally-sized squares. Each distinct point exists in a unique leaf [node](#nodes); coincident points are represented by a linked list. Quadtrees can accelerate various spatial operations, such as the [Barnes–Hut approximation](https://en.wikipedia.org/wiki/Barnes–Hut_simulation) for computing many-body forces, collision detection, and searching for nearby points.
+
+
+
+
+## Installing
+
+If you use NPM, `npm install d3-quadtree`. Otherwise, download the [latest release](https://github.com/d3/d3-quadtree/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-quadtree.v1.min.js) or as part of [D3](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
+
+```html
+
+
+```
+
+## API Reference
+
+# d3.quadtree([data[, x, y]])
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/quadtree.js "Source")
+
+Creates a new, empty quadtree with an empty [extent](#quadtree_extent) and the default [*x*-](#quadtree_x) and [*y*-](#quadtree_y)accessors. If *data* is specified, [adds](#quadtree_addAll) the specified array of data to the quadtree. This is equivalent to:
+
+```js
+var tree = d3.quadtree()
+ .addAll(data);
+```
+
+If *x* and *y* are also specified, sets the [*x*-](#quadtree_x) and [*y*-](#quadtree_y) accessors to the specified functions before adding the specified array of data to the quadtree, equivalent to:
+
+```js
+var tree = d3.quadtree()
+ .x(x)
+ .y(y)
+ .addAll(data);
+```
+
+#quadtree.x([x]) [<>](https://github.com/d3/d3-quadtree/blob/master/src/x.js "Source")
+
+If *x* is specified, sets the current *x*-coordinate accessor and returns the quadtree. If *x* is not specified, returns the current *x*-accessor, which defaults to:
+
+```js
+function x(d) {
+ return d[0];
+}
+```
+
+The *x*-acccessor is used to derive the *x*-coordinate of data when [adding](#quadtree_add) to and [removing](#quadtree_remove) from the tree. It is also used when [finding](#quadtree_find) to re-access the coordinates of data previously added to the tree; therefore, the *x*- and *y*-accessors must be consistent, returning the same value given the same input.
+
+#quadtree.y([y])
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/y.js "Source")
+
+If *y* is specified, sets the current *y*-coordinate accessor and returns the quadtree. If *y* is not specified, returns the current *y*-accessor, which defaults to:
+
+```js
+function y(d) {
+ return d[1];
+}
+```
+
+The *y*-acccessor is used to derive the *y*-coordinate of data when [adding](#quadtree_add) to and [removing](#quadtree_remove) from the tree. It is also used when [finding](#quadtree_find) to re-access the coordinates of data previously added to the tree; therefore, the *x*- and *y*-accessors must be consistent, returning the same value given the same input.
+
+#quadtree.extent([*extent*])
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/extent.js "Source")
+
+If *extent* is specified, expands the quadtree to [cover](#quadtree_cover) the specified points [[*x0*, *y0*], [*x1*, *y1*]] and returns the quadtree. If *extent* is not specified, returns the quadtree’s current extent [[*x0*, *y0*], [*x1*, *y1*]], where *x0* and *y0* are the inclusive lower bounds and *x1* and *y1* are the inclusive upper bounds, or undefined if the quadtree has no extent. The extent may also be expanded by calling [*quadtree*.cover](#quadtree_cover) or [*quadtree*.add](#quadtree_add).
+
+#quadtree.cover(x, y)
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/cover.js "Source")
+
+Expands the quadtree to cover the specified point ⟨*x*,*y*⟩, and returns the quadtree. If the quadtree’s extent already covers the specified point, this method does nothing. If the quadtree has an extent, the extent is repeatedly doubled to cover the specified point, wrapping the [root](#quadtree_root) [node](#nodes) as necessary; if the quadtree is empty, the extent is initialized to the extent [[⌊*x*⌋, ⌊*y*⌋], [⌈*x*⌉, ⌈*y*⌉]]. (Rounding is necessary such that if the extent is later doubled, the boundaries of existing quadrants do not change due to floating point error.)
+
+#quadtree.add(datum)
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/add.js "Source")
+
+Adds the specified *datum* to the quadtree, deriving its coordinates ⟨*x*,*y*⟩ using the current [*x*-](#quadtree_x) and [*y*-](#quadtree_y)accessors, and returns the quadtree. If the new point is outside the current [extent](#quadtree_extent) of the quadtree, the quadtree is automatically expanded to [cover](#quadtree_cover) the new point.
+
+#quadtree.addAll(data)
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/add.js "Source")
+
+Adds the specified array of *data* to the quadtree, deriving each element’s coordinates ⟨*x*,*y*⟩ using the current [*x*-](#quadtree_x) and [*y*-](#quadtree_y)accessors, and return this quadtree. This is approximately equivalent to calling [*quadtree*.add](#quadtree_add) repeatedly:
+
+```js
+for (var i = 0, n = data.length; i < n; ++i) {
+ quadtree.add(data[i]);
+}
+```
+
+However, this method results in a more compact quadtree because the extent of the *data* is computed first before adding the data.
+
+#quadtree.remove(datum)
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/remove.js "Source")
+
+Removes the specified *datum* from the quadtree, deriving its coordinates ⟨*x*,*y*⟩ using the current [*x*-](#quadtree_x) and [*y*-](#quadtree_y)accessors, and returns the quadtree. If the specified *datum* does not exist in this quadtree, this method does nothing.
+
+#quadtree.removeAll(data)
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/remove.js "Source")
+
+Removes the specified *data* from the quadtree, deriving their coordinates ⟨*x*,*y*⟩ using the current [*x*-](#quadtree_x) and [*y*-](#quadtree_y)accessors, and returns the quadtree. If a specified datum does not exist in this quadtree, it is ignored.
+
+#quadtree.copy()
+
+Returns a copy of the quadtree. All [nodes](#nodes) in the returned quadtree are identical copies of the corresponding node in the quadtree; however, any data in the quadtree is shared by reference and not copied.
+
+#quadtree.root()
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/root.js "Source")
+
+Returns the root [node](#nodes) of the quadtree.
+
+#quadtree.data()
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/data.js "Source")
+
+Returns an array of all data in the quadtree.
+
+#quadtree.size()
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/size.js "Source")
+
+Returns the total number of data in the quadtree.
+
+#quadtree.find(x, y[, radius])
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/find.js "Source")
+
+Returns the datum closest to the position ⟨*x*,*y*⟩ with the given search *radius*. If *radius* is not specified, it defaults to infinity. If there is no datum within the search area, returns undefined.
+
+#quadtree.visit(callback)
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/visit.js "Source")
+
+Visits each [node](#nodes) in the quadtree in pre-order traversal, invoking the specified *callback* with arguments *node*, *x0*, *y0*, *x1*, *y1* for each node, where *node* is the node being visited, ⟨*x0*, *y0*⟩ are the lower bounds of the node, and ⟨*x1*, *y1*⟩ are the upper bounds, and returns the quadtree. (Assuming that positive *x* is right and positive *y* is down, as is typically the case in Canvas and SVG, ⟨*x0*, *y0*⟩ is the top-left corner and ⟨*x1*, *y1*⟩ is the lower-right corner; however, the coordinate system is arbitrary, so more formally *x0* <= *x1* and *y0* <= *y1*.)
+
+If the *callback* returns true for a given node, then the children of that node are not visited; otherwise, all child nodes are visited. This can be used to quickly visit only parts of the tree, for example when using the [Barnes–Hut approximation](https://en.wikipedia.org/wiki/Barnes–Hut_simulation). Note, however, that child quadrants are always visited in sibling order: top-left, top-right, bottom-left, bottom-right. In cases such as [search](#quadtree_find), visiting siblings in a specific order may be faster.
+
+#quadtree.visitAfter(callback)
+ [<>](https://github.com/d3/d3-quadtree/blob/master/src/visitAfter.js "Source")
+
+Visits each [node](#nodes) in the quadtree in post-order traversal, invoking the specified *callback* with arguments *node*, *x0*, *y0*, *x1*, *y1* for each node, where *node* is the node being visited, ⟨*x0*, *y0*⟩ are the lower bounds of the node, and ⟨*x1*, *y1*⟩ are the upper bounds, and returns the quadtree. (Assuming that positive *x* is right and positive *y* is down, as is typically the case in Canvas and SVG, ⟨*x0*, *y0*⟩ is the top-left corner and ⟨*x1*, *y1*⟩ is the lower-right corner; however, the coordinate system is arbitrary, so more formally *x0* <= *x1* and *y0* <= *y1*.) Returns *root*.
+
+### Nodes
+
+Internal nodes of the quadtree are represented as four-element arrays in left-to-right, top-to-bottom order:
+
+* `0` - the top-left quadrant, if any.
+* `1` - the top-right quadrant, if any.
+* `2` - the bottom-left quadrant, if any.
+* `3` - the bottom-right quadrant, if any.
+
+A child quadrant may be undefined if it is empty.
+
+Leaf nodes are represented as objects with the following properties:
+
+* `data` - the data associated with this point, as passed to [*quadtree*.add](#quadtree_add).
+* `next` - the next datum in this leaf, if any.
+
+The `length` property may be used to distinguish leaf nodes from internal nodes: it is undefined for leaf nodes, and 4 for internal nodes. For example, to iterate over all data in a leaf node:
+
+```js
+if (!node.length) do console.log(node.data); while (node = node.next);
+```
+
+The point’s *x*- and *y*-coordinates **must not be modified** while the point is in the quadtree. To update a point’s position, [remove](#quadtree_remove) the point and then re-[add](#quadtree_add) it to the quadtree at the new position. Alternatively, you may discard the existing quadtree entirely and create a new one from scratch; this may be more efficient if many of the points have moved.
diff --git a/node_modules/d3-quadtree/dist/d3-quadtree.js b/node_modules/d3-quadtree/dist/d3-quadtree.js
new file mode 100644
index 0000000000000000000000000000000000000000..02b9a00eaba20127bdf940805ff6fe71aaf42d25
--- /dev/null
+++ b/node_modules/d3-quadtree/dist/d3-quadtree.js
@@ -0,0 +1,419 @@
+// https://d3js.org/d3-quadtree/ v1.0.7 Copyright 2019 Mike Bostock
+(function (global, factory) {
+typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+typeof define === 'function' && define.amd ? define(['exports'], factory) :
+(global = global || self, factory(global.d3 = global.d3 || {}));
+}(this, function (exports) { 'use strict';
+
+function tree_add(d) {
+ var x = +this._x.call(null, d),
+ y = +this._y.call(null, d);
+ return add(this.cover(x, y), x, y, d);
+}
+
+function add(tree, x, y, d) {
+ if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points
+
+ var parent,
+ node = tree._root,
+ leaf = {data: d},
+ x0 = tree._x0,
+ y0 = tree._y0,
+ x1 = tree._x1,
+ y1 = tree._y1,
+ xm,
+ ym,
+ xp,
+ yp,
+ right,
+ bottom,
+ i,
+ j;
+
+ // If the tree is empty, initialize the root as a leaf.
+ if (!node) return tree._root = leaf, tree;
+
+ // Find the existing leaf for the new point, or add it.
+ while (node.length) {
+ if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
+ if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
+ if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;
+ }
+
+ // Is the new point is exactly coincident with the existing point?
+ xp = +tree._x.call(null, node.data);
+ yp = +tree._y.call(null, node.data);
+ if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;
+
+ // Otherwise, split the leaf node until the old and new point are separated.
+ do {
+ parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);
+ if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
+ if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
+ } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));
+ return parent[j] = node, parent[i] = leaf, tree;
+}
+
+function addAll(data) {
+ var d, i, n = data.length,
+ x,
+ y,
+ xz = new Array(n),
+ yz = new Array(n),
+ x0 = Infinity,
+ y0 = Infinity,
+ x1 = -Infinity,
+ y1 = -Infinity;
+
+ // Compute the points and their extent.
+ for (i = 0; i < n; ++i) {
+ if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;
+ xz[i] = x;
+ yz[i] = y;
+ if (x < x0) x0 = x;
+ if (x > x1) x1 = x;
+ if (y < y0) y0 = y;
+ if (y > y1) y1 = y;
+ }
+
+ // If there were no (valid) points, abort.
+ if (x0 > x1 || y0 > y1) return this;
+
+ // Expand the tree to cover the new points.
+ this.cover(x0, y0).cover(x1, y1);
+
+ // Add the new points.
+ for (i = 0; i < n; ++i) {
+ add(this, xz[i], yz[i], data[i]);
+ }
+
+ return this;
+}
+
+function tree_cover(x, y) {
+ if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points
+
+ var x0 = this._x0,
+ y0 = this._y0,
+ x1 = this._x1,
+ y1 = this._y1;
+
+ // If the quadtree has no extent, initialize them.
+ // Integer extent are necessary so that if we later double the extent,
+ // the existing quadrant boundaries don’t change due to floating point error!
+ if (isNaN(x0)) {
+ x1 = (x0 = Math.floor(x)) + 1;
+ y1 = (y0 = Math.floor(y)) + 1;
+ }
+
+ // Otherwise, double repeatedly to cover.
+ else {
+ var z = x1 - x0,
+ node = this._root,
+ parent,
+ i;
+
+ while (x0 > x || x >= x1 || y0 > y || y >= y1) {
+ i = (y < y0) << 1 | (x < x0);
+ parent = new Array(4), parent[i] = node, node = parent, z *= 2;
+ switch (i) {
+ case 0: x1 = x0 + z, y1 = y0 + z; break;
+ case 1: x0 = x1 - z, y1 = y0 + z; break;
+ case 2: x1 = x0 + z, y0 = y1 - z; break;
+ case 3: x0 = x1 - z, y0 = y1 - z; break;
+ }
+ }
+
+ if (this._root && this._root.length) this._root = node;
+ }
+
+ this._x0 = x0;
+ this._y0 = y0;
+ this._x1 = x1;
+ this._y1 = y1;
+ return this;
+}
+
+function tree_data() {
+ var data = [];
+ this.visit(function(node) {
+ if (!node.length) do data.push(node.data); while (node = node.next)
+ });
+ return data;
+}
+
+function tree_extent(_) {
+ return arguments.length
+ ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])
+ : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];
+}
+
+function Quad(node, x0, y0, x1, y1) {
+ this.node = node;
+ this.x0 = x0;
+ this.y0 = y0;
+ this.x1 = x1;
+ this.y1 = y1;
+}
+
+function tree_find(x, y, radius) {
+ var data,
+ x0 = this._x0,
+ y0 = this._y0,
+ x1,
+ y1,
+ x2,
+ y2,
+ x3 = this._x1,
+ y3 = this._y1,
+ quads = [],
+ node = this._root,
+ q,
+ i;
+
+ if (node) quads.push(new Quad(node, x0, y0, x3, y3));
+ if (radius == null) radius = Infinity;
+ else {
+ x0 = x - radius, y0 = y - radius;
+ x3 = x + radius, y3 = y + radius;
+ radius *= radius;
+ }
+
+ while (q = quads.pop()) {
+
+ // Stop searching if this quadrant can’t contain a closer node.
+ if (!(node = q.node)
+ || (x1 = q.x0) > x3
+ || (y1 = q.y0) > y3
+ || (x2 = q.x1) < x0
+ || (y2 = q.y1) < y0) continue;
+
+ // Bisect the current quadrant.
+ if (node.length) {
+ var xm = (x1 + x2) / 2,
+ ym = (y1 + y2) / 2;
+
+ quads.push(
+ new Quad(node[3], xm, ym, x2, y2),
+ new Quad(node[2], x1, ym, xm, y2),
+ new Quad(node[1], xm, y1, x2, ym),
+ new Quad(node[0], x1, y1, xm, ym)
+ );
+
+ // Visit the closest quadrant first.
+ if (i = (y >= ym) << 1 | (x >= xm)) {
+ q = quads[quads.length - 1];
+ quads[quads.length - 1] = quads[quads.length - 1 - i];
+ quads[quads.length - 1 - i] = q;
+ }
+ }
+
+ // Visit this point. (Visiting coincident points isn’t necessary!)
+ else {
+ var dx = x - +this._x.call(null, node.data),
+ dy = y - +this._y.call(null, node.data),
+ d2 = dx * dx + dy * dy;
+ if (d2 < radius) {
+ var d = Math.sqrt(radius = d2);
+ x0 = x - d, y0 = y - d;
+ x3 = x + d, y3 = y + d;
+ data = node.data;
+ }
+ }
+ }
+
+ return data;
+}
+
+function tree_remove(d) {
+ if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points
+
+ var parent,
+ node = this._root,
+ retainer,
+ previous,
+ next,
+ x0 = this._x0,
+ y0 = this._y0,
+ x1 = this._x1,
+ y1 = this._y1,
+ x,
+ y,
+ xm,
+ ym,
+ right,
+ bottom,
+ i,
+ j;
+
+ // If the tree is empty, initialize the root as a leaf.
+ if (!node) return this;
+
+ // Find the leaf node for the point.
+ // While descending, also retain the deepest parent with a non-removed sibling.
+ if (node.length) while (true) {
+ if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
+ if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
+ if (!(parent = node, node = node[i = bottom << 1 | right])) return this;
+ if (!node.length) break;
+ if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;
+ }
+
+ // Find the point to remove.
+ while (node.data !== d) if (!(previous = node, node = node.next)) return this;
+ if (next = node.next) delete node.next;
+
+ // If there are multiple coincident points, remove just the point.
+ if (previous) return (next ? previous.next = next : delete previous.next), this;
+
+ // If this is the root point, remove it.
+ if (!parent) return this._root = next, this;
+
+ // Remove this leaf.
+ next ? parent[i] = next : delete parent[i];
+
+ // If the parent now contains exactly one leaf, collapse superfluous parents.
+ if ((node = parent[0] || parent[1] || parent[2] || parent[3])
+ && node === (parent[3] || parent[2] || parent[1] || parent[0])
+ && !node.length) {
+ if (retainer) retainer[j] = node;
+ else this._root = node;
+ }
+
+ return this;
+}
+
+function removeAll(data) {
+ for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);
+ return this;
+}
+
+function tree_root() {
+ return this._root;
+}
+
+function tree_size() {
+ var size = 0;
+ this.visit(function(node) {
+ if (!node.length) do ++size; while (node = node.next)
+ });
+ return size;
+}
+
+function tree_visit(callback) {
+ var quads = [], q, node = this._root, child, x0, y0, x1, y1;
+ if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));
+ while (q = quads.pop()) {
+ if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {
+ var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
+ if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));
+ if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));
+ if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));
+ if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));
+ }
+ }
+ return this;
+}
+
+function tree_visitAfter(callback) {
+ var quads = [], next = [], q;
+ if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));
+ while (q = quads.pop()) {
+ var node = q.node;
+ if (node.length) {
+ var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
+ if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));
+ if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));
+ if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));
+ if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));
+ }
+ next.push(q);
+ }
+ while (q = next.pop()) {
+ callback(q.node, q.x0, q.y0, q.x1, q.y1);
+ }
+ return this;
+}
+
+function defaultX(d) {
+ return d[0];
+}
+
+function tree_x(_) {
+ return arguments.length ? (this._x = _, this) : this._x;
+}
+
+function defaultY(d) {
+ return d[1];
+}
+
+function tree_y(_) {
+ return arguments.length ? (this._y = _, this) : this._y;
+}
+
+function quadtree(nodes, x, y) {
+ var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);
+ return nodes == null ? tree : tree.addAll(nodes);
+}
+
+function Quadtree(x, y, x0, y0, x1, y1) {
+ this._x = x;
+ this._y = y;
+ this._x0 = x0;
+ this._y0 = y0;
+ this._x1 = x1;
+ this._y1 = y1;
+ this._root = undefined;
+}
+
+function leaf_copy(leaf) {
+ var copy = {data: leaf.data}, next = copy;
+ while (leaf = leaf.next) next = next.next = {data: leaf.data};
+ return copy;
+}
+
+var treeProto = quadtree.prototype = Quadtree.prototype;
+
+treeProto.copy = function() {
+ var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),
+ node = this._root,
+ nodes,
+ child;
+
+ if (!node) return copy;
+
+ if (!node.length) return copy._root = leaf_copy(node), copy;
+
+ nodes = [{source: node, target: copy._root = new Array(4)}];
+ while (node = nodes.pop()) {
+ for (var i = 0; i < 4; ++i) {
+ if (child = node.source[i]) {
+ if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});
+ else node.target[i] = leaf_copy(child);
+ }
+ }
+ }
+
+ return copy;
+};
+
+treeProto.add = tree_add;
+treeProto.addAll = addAll;
+treeProto.cover = tree_cover;
+treeProto.data = tree_data;
+treeProto.extent = tree_extent;
+treeProto.find = tree_find;
+treeProto.remove = tree_remove;
+treeProto.removeAll = removeAll;
+treeProto.root = tree_root;
+treeProto.size = tree_size;
+treeProto.visit = tree_visit;
+treeProto.visitAfter = tree_visitAfter;
+treeProto.x = tree_x;
+treeProto.y = tree_y;
+
+exports.quadtree = quadtree;
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+}));
diff --git a/node_modules/d3-quadtree/dist/d3-quadtree.min.js b/node_modules/d3-quadtree/dist/d3-quadtree.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..dae056b55c5a675223378573c4d724eab68c92f6
--- /dev/null
+++ b/node_modules/d3-quadtree/dist/d3-quadtree.min.js
@@ -0,0 +1,2 @@
+// https://d3js.org/d3-quadtree/ v1.0.7 Copyright 2019 Mike Bostock
+!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,function(t){"use strict";function i(t,i,r,e){if(isNaN(i)||isNaN(r))return t;var n,s,h,o,a,u,l,_,f,c=t._root,x={data:e},y=t._x0,d=t._y0,v=t._x1,p=t._y1;if(!c)return t._root=x,t;for(;c.length;)if((u=i>=(s=(y+v)/2))?y=s:v=s,(l=r>=(h=(d+p)/2))?d=h:p=h,n=c,!(c=c[_=l<<1|u]))return n[_]=x,t;if(o=+t._x.call(null,c.data),a=+t._y.call(null,c.data),i===o&&r===a)return x.next=c,n?n[_]=x:t._root=x,t;do{n=n?n[_]=new Array(4):t._root=new Array(4),(u=i>=(s=(y+v)/2))?y=s:v=s,(l=r>=(h=(d+p)/2))?d=h:p=h}while((_=l<<1|u)==(f=(a>=h)<<1|o>=s));return n[f]=c,n[_]=x,t}function r(t,i,r,e,n){this.node=t,this.x0=i,this.y0=r,this.x1=e,this.y1=n}function e(t){return t[0]}function n(t){return t[1]}function s(t,i,r){var s=new h(null==i?e:i,null==r?n:r,NaN,NaN,NaN,NaN);return null==t?s:s.addAll(t)}function h(t,i,r,e,n,s){this._x=t,this._y=i,this._x0=r,this._y0=e,this._x1=n,this._y1=s,this._root=void 0}function o(t){for(var i={data:t.data},r=i;t=t.next;)r=r.next={data:t.data};return i}var a=s.prototype=h.prototype;a.copy=function(){var t,i,r=new h(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root;if(!e)return r;if(!e.length)return r._root=o(e),r;for(t=[{source:e,target:r._root=new Array(4)}];e=t.pop();)for(var n=0;n<4;++n)(i=e.source[n])&&(i.length?t.push({source:i,target:e.target[n]=new Array(4)}):e.target[n]=o(i));return r},a.add=function(t){var r=+this._x.call(null,t),e=+this._y.call(null,t);return i(this.cover(r,e),r,e,t)},a.addAll=function(t){var r,e,n,s,h=t.length,o=new Array(h),a=new Array(h),u=1/0,l=1/0,_=-1/0,f=-1/0;for(e=0;e_&&(_=n),sf&&(f=s));if(u>_||l>f)return this;for(this.cover(u,l).cover(_,f),e=0;et||t>=n||e>i||i>=s;)switch(o=(ic||(h=u.y0)>x||(o=u.x1)<_||(a=u.y1)=p)<<1|t>=v)&&(u=y[y.length-1],y[y.length-1]=y[y.length-1-l],y[y.length-1-l]=u)}else{var w=t-+this._x.call(null,d.data),N=i-+this._y.call(null,d.data),g=w*w+N*N;if(g=(o=(x+d)/2))?x=o:d=o,(l=h>=(a=(y+v)/2))?y=a:v=a,i=c,!(c=c[_=l<<1|u]))return this;if(!c.length)break;(i[_+1&3]||i[_+2&3]||i[_+3&3])&&(r=i,f=_)}for(;c.data!==t;)if(e=c,!(c=c.next))return this;return(n=c.next)&&delete c.next,e?(n?e.next=n:delete e.next,this):i?(n?i[_]=n:delete i[_],(c=i[0]||i[1]||i[2]||i[3])&&c===(i[3]||i[2]||i[1]||i[0])&&!c.length&&(r?r[f]=c:this._root=c),this):(this._root=n,this)},a.removeAll=function(t){for(var i=0,r=t.length;i= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
+ if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
+ if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;
+ }
+
+ // Is the new point is exactly coincident with the existing point?
+ xp = +tree._x.call(null, node.data);
+ yp = +tree._y.call(null, node.data);
+ if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;
+
+ // Otherwise, split the leaf node until the old and new point are separated.
+ do {
+ parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);
+ if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
+ if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
+ } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));
+ return parent[j] = node, parent[i] = leaf, tree;
+}
+
+export function addAll(data) {
+ var d, i, n = data.length,
+ x,
+ y,
+ xz = new Array(n),
+ yz = new Array(n),
+ x0 = Infinity,
+ y0 = Infinity,
+ x1 = -Infinity,
+ y1 = -Infinity;
+
+ // Compute the points and their extent.
+ for (i = 0; i < n; ++i) {
+ if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;
+ xz[i] = x;
+ yz[i] = y;
+ if (x < x0) x0 = x;
+ if (x > x1) x1 = x;
+ if (y < y0) y0 = y;
+ if (y > y1) y1 = y;
+ }
+
+ // If there were no (valid) points, abort.
+ if (x0 > x1 || y0 > y1) return this;
+
+ // Expand the tree to cover the new points.
+ this.cover(x0, y0).cover(x1, y1);
+
+ // Add the new points.
+ for (i = 0; i < n; ++i) {
+ add(this, xz[i], yz[i], data[i]);
+ }
+
+ return this;
+}
diff --git a/node_modules/d3-quadtree/src/cover.js b/node_modules/d3-quadtree/src/cover.js
new file mode 100644
index 0000000000000000000000000000000000000000..a981a3d26554efedb1a51beb95d30ad63b3b5175
--- /dev/null
+++ b/node_modules/d3-quadtree/src/cover.js
@@ -0,0 +1,43 @@
+export default function(x, y) {
+ if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points
+
+ var x0 = this._x0,
+ y0 = this._y0,
+ x1 = this._x1,
+ y1 = this._y1;
+
+ // If the quadtree has no extent, initialize them.
+ // Integer extent are necessary so that if we later double the extent,
+ // the existing quadrant boundaries don’t change due to floating point error!
+ if (isNaN(x0)) {
+ x1 = (x0 = Math.floor(x)) + 1;
+ y1 = (y0 = Math.floor(y)) + 1;
+ }
+
+ // Otherwise, double repeatedly to cover.
+ else {
+ var z = x1 - x0,
+ node = this._root,
+ parent,
+ i;
+
+ while (x0 > x || x >= x1 || y0 > y || y >= y1) {
+ i = (y < y0) << 1 | (x < x0);
+ parent = new Array(4), parent[i] = node, node = parent, z *= 2;
+ switch (i) {
+ case 0: x1 = x0 + z, y1 = y0 + z; break;
+ case 1: x0 = x1 - z, y1 = y0 + z; break;
+ case 2: x1 = x0 + z, y0 = y1 - z; break;
+ case 3: x0 = x1 - z, y0 = y1 - z; break;
+ }
+ }
+
+ if (this._root && this._root.length) this._root = node;
+ }
+
+ this._x0 = x0;
+ this._y0 = y0;
+ this._x1 = x1;
+ this._y1 = y1;
+ return this;
+}
diff --git a/node_modules/d3-quadtree/src/data.js b/node_modules/d3-quadtree/src/data.js
new file mode 100644
index 0000000000000000000000000000000000000000..e934fa9d84f3ba2b8059e52a8c6667265afa9278
--- /dev/null
+++ b/node_modules/d3-quadtree/src/data.js
@@ -0,0 +1,7 @@
+export default function() {
+ var data = [];
+ this.visit(function(node) {
+ if (!node.length) do data.push(node.data); while (node = node.next)
+ });
+ return data;
+}
diff --git a/node_modules/d3-quadtree/src/extent.js b/node_modules/d3-quadtree/src/extent.js
new file mode 100644
index 0000000000000000000000000000000000000000..9e65a90aa42740c94e911893289d589162a3ceb8
--- /dev/null
+++ b/node_modules/d3-quadtree/src/extent.js
@@ -0,0 +1,5 @@
+export default function(_) {
+ return arguments.length
+ ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])
+ : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];
+}
diff --git a/node_modules/d3-quadtree/src/find.js b/node_modules/d3-quadtree/src/find.js
new file mode 100644
index 0000000000000000000000000000000000000000..e9db6c414e887c58d051d2ec55f0f3cf6f94dae0
--- /dev/null
+++ b/node_modules/d3-quadtree/src/find.js
@@ -0,0 +1,70 @@
+import Quad from "./quad.js";
+
+export default function(x, y, radius) {
+ var data,
+ x0 = this._x0,
+ y0 = this._y0,
+ x1,
+ y1,
+ x2,
+ y2,
+ x3 = this._x1,
+ y3 = this._y1,
+ quads = [],
+ node = this._root,
+ q,
+ i;
+
+ if (node) quads.push(new Quad(node, x0, y0, x3, y3));
+ if (radius == null) radius = Infinity;
+ else {
+ x0 = x - radius, y0 = y - radius;
+ x3 = x + radius, y3 = y + radius;
+ radius *= radius;
+ }
+
+ while (q = quads.pop()) {
+
+ // Stop searching if this quadrant can’t contain a closer node.
+ if (!(node = q.node)
+ || (x1 = q.x0) > x3
+ || (y1 = q.y0) > y3
+ || (x2 = q.x1) < x0
+ || (y2 = q.y1) < y0) continue;
+
+ // Bisect the current quadrant.
+ if (node.length) {
+ var xm = (x1 + x2) / 2,
+ ym = (y1 + y2) / 2;
+
+ quads.push(
+ new Quad(node[3], xm, ym, x2, y2),
+ new Quad(node[2], x1, ym, xm, y2),
+ new Quad(node[1], xm, y1, x2, ym),
+ new Quad(node[0], x1, y1, xm, ym)
+ );
+
+ // Visit the closest quadrant first.
+ if (i = (y >= ym) << 1 | (x >= xm)) {
+ q = quads[quads.length - 1];
+ quads[quads.length - 1] = quads[quads.length - 1 - i];
+ quads[quads.length - 1 - i] = q;
+ }
+ }
+
+ // Visit this point. (Visiting coincident points isn’t necessary!)
+ else {
+ var dx = x - +this._x.call(null, node.data),
+ dy = y - +this._y.call(null, node.data),
+ d2 = dx * dx + dy * dy;
+ if (d2 < radius) {
+ var d = Math.sqrt(radius = d2);
+ x0 = x - d, y0 = y - d;
+ x3 = x + d, y3 = y + d;
+ data = node.data;
+ }
+ }
+ }
+
+ return data;
+}
diff --git a/node_modules/d3-quadtree/src/index.js b/node_modules/d3-quadtree/src/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..e2b2c313d06395bbf3fb04187afb0e932c1daf5d
--- /dev/null
+++ b/node_modules/d3-quadtree/src/index.js
@@ -0,0 +1 @@
+export {default as quadtree} from "./quadtree.js";
diff --git a/node_modules/d3-quadtree/src/quad.js b/node_modules/d3-quadtree/src/quad.js
new file mode 100644
index 0000000000000000000000000000000000000000..6f714dbb3527e8ea193681380929f0abb4eec2a5
--- /dev/null
+++ b/node_modules/d3-quadtree/src/quad.js
@@ -0,0 +1,7 @@
+export default function(node, x0, y0, x1, y1) {
+ this.node = node;
+ this.x0 = x0;
+ this.y0 = y0;
+ this.x1 = x1;
+ this.y1 = y1;
+}
diff --git a/node_modules/d3-quadtree/src/quadtree.js b/node_modules/d3-quadtree/src/quadtree.js
new file mode 100644
index 0000000000000000000000000000000000000000..5d585938c71cb2cd4082610fb60faafb79828229
--- /dev/null
+++ b/node_modules/d3-quadtree/src/quadtree.js
@@ -0,0 +1,73 @@
+import tree_add, {addAll as tree_addAll} from "./add.js";
+import tree_cover from "./cover.js";
+import tree_data from "./data.js";
+import tree_extent from "./extent.js";
+import tree_find from "./find.js";
+import tree_remove, {removeAll as tree_removeAll} from "./remove.js";
+import tree_root from "./root.js";
+import tree_size from "./size.js";
+import tree_visit from "./visit.js";
+import tree_visitAfter from "./visitAfter.js";
+import tree_x, {defaultX} from "./x.js";
+import tree_y, {defaultY} from "./y.js";
+
+export default function quadtree(nodes, x, y) {
+ var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);
+ return nodes == null ? tree : tree.addAll(nodes);
+}
+
+function Quadtree(x, y, x0, y0, x1, y1) {
+ this._x = x;
+ this._y = y;
+ this._x0 = x0;
+ this._y0 = y0;
+ this._x1 = x1;
+ this._y1 = y1;
+ this._root = undefined;
+}
+
+function leaf_copy(leaf) {
+ var copy = {data: leaf.data}, next = copy;
+ while (leaf = leaf.next) next = next.next = {data: leaf.data};
+ return copy;
+}
+
+var treeProto = quadtree.prototype = Quadtree.prototype;
+
+treeProto.copy = function() {
+ var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),
+ node = this._root,
+ nodes,
+ child;
+
+ if (!node) return copy;
+
+ if (!node.length) return copy._root = leaf_copy(node), copy;
+
+ nodes = [{source: node, target: copy._root = new Array(4)}];
+ while (node = nodes.pop()) {
+ for (var i = 0; i < 4; ++i) {
+ if (child = node.source[i]) {
+ if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});
+ else node.target[i] = leaf_copy(child);
+ }
+ }
+ }
+
+ return copy;
+};
+
+treeProto.add = tree_add;
+treeProto.addAll = tree_addAll;
+treeProto.cover = tree_cover;
+treeProto.data = tree_data;
+treeProto.extent = tree_extent;
+treeProto.find = tree_find;
+treeProto.remove = tree_remove;
+treeProto.removeAll = tree_removeAll;
+treeProto.root = tree_root;
+treeProto.size = tree_size;
+treeProto.visit = tree_visit;
+treeProto.visitAfter = tree_visitAfter;
+treeProto.x = tree_x;
+treeProto.y = tree_y;
diff --git a/node_modules/d3-quadtree/src/remove.js b/node_modules/d3-quadtree/src/remove.js
new file mode 100644
index 0000000000000000000000000000000000000000..0ba27abe77d6b1b07970072f849bb9f641084ba4
--- /dev/null
+++ b/node_modules/d3-quadtree/src/remove.js
@@ -0,0 +1,62 @@
+export default function(d) {
+ if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points
+
+ var parent,
+ node = this._root,
+ retainer,
+ previous,
+ next,
+ x0 = this._x0,
+ y0 = this._y0,
+ x1 = this._x1,
+ y1 = this._y1,
+ x,
+ y,
+ xm,
+ ym,
+ right,
+ bottom,
+ i,
+ j;
+
+ // If the tree is empty, initialize the root as a leaf.
+ if (!node) return this;
+
+ // Find the leaf node for the point.
+ // While descending, also retain the deepest parent with a non-removed sibling.
+ if (node.length) while (true) {
+ if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
+ if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
+ if (!(parent = node, node = node[i = bottom << 1 | right])) return this;
+ if (!node.length) break;
+ if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;
+ }
+
+ // Find the point to remove.
+ while (node.data !== d) if (!(previous = node, node = node.next)) return this;
+ if (next = node.next) delete node.next;
+
+ // If there are multiple coincident points, remove just the point.
+ if (previous) return (next ? previous.next = next : delete previous.next), this;
+
+ // If this is the root point, remove it.
+ if (!parent) return this._root = next, this;
+
+ // Remove this leaf.
+ next ? parent[i] = next : delete parent[i];
+
+ // If the parent now contains exactly one leaf, collapse superfluous parents.
+ if ((node = parent[0] || parent[1] || parent[2] || parent[3])
+ && node === (parent[3] || parent[2] || parent[1] || parent[0])
+ && !node.length) {
+ if (retainer) retainer[j] = node;
+ else this._root = node;
+ }
+
+ return this;
+}
+
+export function removeAll(data) {
+ for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);
+ return this;
+}
diff --git a/node_modules/d3-quadtree/src/root.js b/node_modules/d3-quadtree/src/root.js
new file mode 100644
index 0000000000000000000000000000000000000000..c32889f7fca3c5345152547b39860ca96701792a
--- /dev/null
+++ b/node_modules/d3-quadtree/src/root.js
@@ -0,0 +1,3 @@
+export default function() {
+ return this._root;
+}
diff --git a/node_modules/d3-quadtree/src/size.js b/node_modules/d3-quadtree/src/size.js
new file mode 100644
index 0000000000000000000000000000000000000000..d2d5ab6147acf7e622d221bbb588ebce19e6dcca
--- /dev/null
+++ b/node_modules/d3-quadtree/src/size.js
@@ -0,0 +1,7 @@
+export default function() {
+ var size = 0;
+ this.visit(function(node) {
+ if (!node.length) do ++size; while (node = node.next)
+ });
+ return size;
+}
diff --git a/node_modules/d3-quadtree/src/visit.js b/node_modules/d3-quadtree/src/visit.js
new file mode 100644
index 0000000000000000000000000000000000000000..941ab884afe7255ce4a837be8747b6f5f56b95ba
--- /dev/null
+++ b/node_modules/d3-quadtree/src/visit.js
@@ -0,0 +1,16 @@
+import Quad from "./quad.js";
+
+export default function(callback) {
+ var quads = [], q, node = this._root, child, x0, y0, x1, y1;
+ if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));
+ while (q = quads.pop()) {
+ if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {
+ var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
+ if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));
+ if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));
+ if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));
+ if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));
+ }
+ }
+ return this;
+}
diff --git a/node_modules/d3-quadtree/src/visitAfter.js b/node_modules/d3-quadtree/src/visitAfter.js
new file mode 100644
index 0000000000000000000000000000000000000000..20966553737be5bc770c87f7b6b4d754ccbc65df
--- /dev/null
+++ b/node_modules/d3-quadtree/src/visitAfter.js
@@ -0,0 +1,21 @@
+import Quad from "./quad.js";
+
+export default function(callback) {
+ var quads = [], next = [], q;
+ if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));
+ while (q = quads.pop()) {
+ var node = q.node;
+ if (node.length) {
+ var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
+ if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));
+ if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));
+ if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));
+ if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));
+ }
+ next.push(q);
+ }
+ while (q = next.pop()) {
+ callback(q.node, q.x0, q.y0, q.x1, q.y1);
+ }
+ return this;
+}
diff --git a/node_modules/d3-quadtree/src/x.js b/node_modules/d3-quadtree/src/x.js
new file mode 100644
index 0000000000000000000000000000000000000000..ffea5075fbcdf12f11df8bdf0ea61ee4883be2fb
--- /dev/null
+++ b/node_modules/d3-quadtree/src/x.js
@@ -0,0 +1,7 @@
+export function defaultX(d) {
+ return d[0];
+}
+
+export default function(_) {
+ return arguments.length ? (this._x = _, this) : this._x;
+}
diff --git a/node_modules/d3-quadtree/src/y.js b/node_modules/d3-quadtree/src/y.js
new file mode 100644
index 0000000000000000000000000000000000000000..d2d29cb79786b3c94e60a43024e35269bd1dad0f
--- /dev/null
+++ b/node_modules/d3-quadtree/src/y.js
@@ -0,0 +1,7 @@
+export function defaultY(d) {
+ return d[1];
+}
+
+export default function(_) {
+ return arguments.length ? (this._y = _, this) : this._y;
+}
diff --git a/node_modules/d3-scale/LICENSE b/node_modules/d3-scale/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..b0145150fd35f3e325d7ddec6ed3be68c457975e
--- /dev/null
+++ b/node_modules/d3-scale/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2010-2021 Mike Bostock
+
+Permission to use, copy, modify, and/or distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright notice
+and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
diff --git a/node_modules/d3-scale/README.md b/node_modules/d3-scale/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..9024eaf9b95038266b0e1d758ad23fe41b5c37af
--- /dev/null
+++ b/node_modules/d3-scale/README.md
@@ -0,0 +1,1003 @@
+# d3-scale
+
+Scales are a convenient abstraction for a fundamental task in visualization: mapping a dimension of abstract data to a visual representation. Although most often used for position-encoding quantitative data, such as mapping a measurement in meters to a position in pixels for dots in a scatterplot, scales can represent virtually any visual encoding, such as diverging colors, stroke widths, or symbol size. Scales can also be used with virtually any type of data, such as named categorical data or discrete data that requires sensible breaks.
+
+For [continuous](#continuous-scales) quantitative data, you typically want a [linear scale](#linear-scales). (For time series data, a [time scale](#time-scales).) If the distribution calls for it, consider transforming data using a [power](#power-scales) or [log](#log-scales) scale. A [quantize scale](#quantize-scales) may aid differentiation by rounding continuous data to a fixed set of discrete values; similarly, a [quantile scale](#quantile-scales) computes quantiles from a sample population, and a [threshold scale](#threshold-scales) allows you to specify arbitrary breaks in continuous data.
+
+For discrete ordinal (ordered) or categorical (unordered) data, an [ordinal scale](#ordinal-scales) specifies an explicit mapping from a set of data values to a corresponding set of visual attributes (such as colors). The related [band](#band-scales) and [point](#point-scales) scales are useful for position-encoding ordinal data, such as bars in a bar chart or dots in an categorical scatterplot.
+
+This repository does not provide color schemes; see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for color schemes designed to work with d3-scale.
+
+Scales have no intrinsic visual representation. However, most scales can [generate](#continuous_ticks) and [format](#continuous_tickFormat) ticks for reference marks to aid in the construction of axes.
+
+For a longer introduction, see these recommended tutorials:
+
+* [Introducing d3-scale](https://medium.com/@mbostock/introducing-d3-scale-61980c51545f) by Mike Bostock
+
+* Chapter 7. Scales of [*Interactive Data Visualization for the Web*](http://alignedleft.com/work/d3-book) by Scott Murray
+
+* [d3: scales, and color.](https://jckr.github.io/blog/2011/08/11/d3-scales-and-color/) by Jérôme Cukier
+
+## Installing
+
+If you use npm, `npm install d3-scale`. You can also download the [latest release on GitHub](https://github.com/d3/d3-scale/releases/latest). For vanilla HTML in modern browsers, import d3-scale from Skypack:
+
+```html
+
+```
+
+For legacy environments, you can load d3-scale’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported:
+
+```html
+
+
+
+
+
+
+
+
+```
+
+(You can omit d3-time and d3-time-format if you’re not using [d3.scaleTime](#scaleTime) or [d3.scaleUtc](#scaleUtc).)
+
+## API Reference
+
+* [Continuous](#continuous-scales) ([Linear](#linear-scales), [Power](#power-scales), [Log](#log-scales), [Identity](#identity-scales), [Time](#time-scales), [Radial](#radial-scales))
+* [Sequential](#sequential-scales)
+* [Diverging](#diverging-scales)
+* [Quantize](#quantize-scales)
+* [Quantile](#quantile-scales)
+* [Threshold](#threshold-scales)
+* [Ordinal](#ordinal-scales) ([Band](#band-scales), [Point](#point-scales))
+
+### Continuous Scales
+
+Continuous scales map a continuous, quantitative input [domain](#continuous_domain) to a continuous output [range](#continuous_range). If the range is also numeric, the mapping may be [inverted](#continuous_invert). A continuous scale is not constructed directly; instead, try a [linear](#linear-scales), [power](#power-scales), [log](#log-scales), [identity](#identity-scales), [radial](#radial-scales), [time](#time-scales) or [sequential color](#sequential-scales) scale.
+
+#continuous(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/continuous.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+Given a *value* from the [domain](#continuous_domain), returns the corresponding value from the [range](#continuous_range). If the given *value* is outside the domain, and [clamping](#continuous_clamp) is not enabled, the mapping may be extrapolated such that the returned value is outside the range. For example, to apply a position encoding:
+
+```js
+var x = d3.scaleLinear()
+ .domain([10, 130])
+ .range([0, 960]);
+
+x(20); // 80
+x(50); // 320
+```
+
+Or to apply a color encoding:
+
+```js
+var color = d3.scaleLinear()
+ .domain([10, 100])
+ .range(["brown", "steelblue"]);
+
+color(20); // "#9a3439"
+color(50); // "#7b5167"
+```
+
+Or, in shorthand:
+
+```js
+var x = d3.scaleLinear([10, 130], [0, 960]);
+var color = d3.scaleLinear([10, 100], ["brown", "steelblue"]);
+```
+
+#continuous.invert(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/continuous.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+Given a *value* from the [range](#continuous_range), returns the corresponding value from the [domain](#continuous_domain). Inversion is useful for interaction, say to determine the data value corresponding to the position of the mouse. For example, to invert a position encoding:
+
+```js
+var x = d3.scaleLinear()
+ .domain([10, 130])
+ .range([0, 960]);
+
+x.invert(80); // 20
+x.invert(320); // 50
+```
+
+If the given *value* is outside the range, and [clamping](#continuous_clamp) is not enabled, the mapping may be extrapolated such that the returned value is outside the domain. This method is only supported if the range is numeric. If the range is not numeric, returns NaN.
+
+For a valid value *y* in the range, continuous(continuous.invert(y)) approximately equals *y*; similarly, for a valid value *x* in the domain, continuous.invert(continuous(x)) approximately equals *x*. The scale and its inverse may not be exact due to the limitations of floating point precision.
+
+#continuous.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/continuous.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+If *domain* is specified, sets the scale’s domain to the specified array of numbers. The array must contain two or more elements. If the elements in the given array are not numbers, they will be coerced to numbers. If *domain* is not specified, returns a copy of the scale’s current domain.
+
+Although continuous scales typically have two values each in their domain and range, specifying more than two values produces a piecewise scale. For example, to create a [diverging color scale](#diverging-scales) that interpolates between white and red for negative values, and white and green for positive values, say:
+
+```js
+var color = d3.scaleLinear()
+ .domain([-1, 0, 1])
+ .range(["red", "white", "green"]);
+
+color(-0.5); // "rgb(255, 128, 128)"
+color(+0.5); // "rgb(128, 192, 128)"
+```
+
+Internally, a piecewise scale performs a [binary search](https://github.com/d3/d3-array/blob/master/README.md#bisect) for the range interpolator corresponding to the given domain value. Thus, the domain must be in ascending or descending order. If the domain and range have different lengths *N* and *M*, only the first *min(N,M)* elements in each are observed.
+
+#continuous.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/continuous.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+If *range* is specified, sets the scale’s range to the specified array of values. The array must contain two or more elements. Unlike the [domain](#continuous_domain), elements in the given array need not be numbers; any value that is supported by the underlying [interpolator](#continuous_interpolate) will work, though note that numeric ranges are required for [invert](#continuous_invert). If *range* is not specified, returns a copy of the scale’s current range. See [*continuous*.interpolate](#continuous_interpolate) for more examples.
+
+#continuous.rangeRound([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/continuous.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+Sets the scale’s [*range*](#continuous_range) to the specified array of values while also setting the scale’s [interpolator](#continuous_interpolate) to [interpolateRound](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateRound). This is a convenience method equivalent to:
+
+```js
+continuous
+ .range(range)
+ .interpolate(d3.interpolateRound);
+```
+
+The rounding interpolator is sometimes useful for avoiding antialiasing artifacts, though also consider the [shape-rendering](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering) “crispEdges” styles. Note that this interpolator can only be used with numeric ranges.
+
+#continuous.clamp(clamp) · [Source](https://github.com/d3/d3-scale/blob/master/src/continuous.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+If *clamp* is specified, enables or disables clamping accordingly. If clamping is disabled and the scale is passed a value outside the [domain](#continuous_domain), the scale may return a value outside the [range](#continuous_range) through extrapolation. If clamping is enabled, the return value of the scale is always within the scale’s range. Clamping similarly applies to [*continuous*.invert](#continuous_invert). For example:
+
+```js
+var x = d3.scaleLinear()
+ .domain([10, 130])
+ .range([0, 960]);
+
+x(-10); // -160, outside range
+x.invert(-160); // -10, outside domain
+
+x.clamp(true);
+x(-10); // 0, clamped to range
+x.invert(-160); // 10, clamped to domain
+```
+
+If *clamp* is not specified, returns whether or not the scale currently clamps values to within the range.
+
+#continuous.unknown([value]) · [Source](https://github.com/d3/d3-scale/blob/master/src/continuous.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+If *value* is specified, sets the output value of the scale for undefined (or NaN) input values and returns this scale. If *value* is not specified, returns the current unknown value, which defaults to undefined.
+
+#continuous.interpolate(interpolate) · [Source](https://github.com/d3/d3-scale/blob/master/src/continuous.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+If *interpolate* is specified, sets the scale’s [range](#continuous_range) interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; these interpolators then map a normalized domain parameter *t* in [0, 1] to the corresponding value in the range. If *factory* is not specified, returns the scale’s current interpolator factory, which defaults to [d3.interpolate](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate). See [d3-interpolate](https://github.com/d3/d3-interpolate) for more interpolators.
+
+For example, consider a diverging color scale with three colors in the range:
+
+```js
+var color = d3.scaleLinear()
+ .domain([-100, 0, +100])
+ .range(["red", "white", "green"]);
+```
+
+Two interpolators are created internally by the scale, equivalent to:
+
+```js
+var i0 = d3.interpolate("red", "white"),
+ i1 = d3.interpolate("white", "green");
+```
+
+A common reason to specify a custom interpolator is to change the color space of interpolation. For example, to use [HCL](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateHcl):
+
+```js
+var color = d3.scaleLinear()
+ .domain([10, 100])
+ .range(["brown", "steelblue"])
+ .interpolate(d3.interpolateHcl);
+```
+
+Or for [Cubehelix](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateCubehelix) with a custom gamma:
+
+```js
+var color = d3.scaleLinear()
+ .domain([10, 100])
+ .range(["brown", "steelblue"])
+ .interpolate(d3.interpolateCubehelix.gamma(3));
+```
+
+Note: the [default interpolator](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate) **may reuse return values**. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate.
+
+#continuous.ticks([count])
+
+Returns approximately *count* representative values from the scale’s [domain](#continuous_domain). If *count* is not specified, it defaults to 10. The returned tick values are uniformly spaced, have human-readable values (such as multiples of powers of 10), and are guaranteed to be within the extent of the domain. Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. The specified *count* is only a hint; the scale may return more or fewer values depending on the domain. See also d3-array’s [ticks](https://github.com/d3/d3-array/blob/master/README.md#ticks).
+
+#continuous.tickFormat([count[, specifier]]) · [Source](https://github.com/d3/d3-scale/blob/master/src/tickFormat.js), [Examples](https://observablehq.com/@d3/scale-ticks)
+
+Returns a [number format](https://github.com/d3/d3-format) function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values. The specified *count* should have the same value as the count that is used to generate the [tick values](#continuous_ticks).
+
+An optional *specifier* allows a [custom format](https://github.com/d3/d3-format/blob/master/README.md#locale_format) where the precision of the format is automatically set by the scale as appropriate for the tick interval. For example, to format percentage change, you might say:
+
+```js
+var x = d3.scaleLinear()
+ .domain([-1, 1])
+ .range([0, 960]);
+
+var ticks = x.ticks(5),
+ tickFormat = x.tickFormat(5, "+%");
+
+ticks.map(tickFormat); // ["-100%", "-50%", "+0%", "+50%", "+100%"]
+```
+
+If *specifier* uses the format type `s`, the scale will return a [SI-prefix format](https://github.com/d3/d3-format/blob/master/README.md#locale_formatPrefix) based on the largest value in the domain. If the *specifier* already specifies a precision, this method is equivalent to [*locale*.format](https://github.com/d3/d3-format/blob/master/README.md#locale_format).
+
+See also [d3.tickFormat](#tickFormat).
+
+#continuous.nice([count]) · [Source](https://github.com/d3/d3-scale/blob/master/src/nice.js), [Examples](https://observablehq.com/@d3/d3-scalelinear)
+
+Extends the [domain](#continuous_domain) so that it starts and ends on nice round values. This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. An optional tick *count* argument allows greater control over the step size used to extend the bounds, guaranteeing that the returned [ticks](#continuous_ticks) will exactly cover the domain. Nicing is useful if the domain is computed from data, say using [extent](https://github.com/d3/d3-array/blob/master/README.md#extent), and may be irregular. For example, for a domain of [0.201479…, 0.996679…], a nice domain might be [0.2, 1.0]. If the domain has more than two values, nicing the domain only affects the first and last value. See also d3-array’s [tickStep](https://github.com/d3/d3-array/blob/master/README.md#tickStep).
+
+Nicing a scale only modifies the current domain; it does not automatically nice domains that are subsequently set using [*continuous*.domain](#continuous_domain). You must re-nice the scale after setting the new domain, if desired.
+
+#continuous.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/continuous.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa.
+
+# d3.tickFormat(start, stop, count[, specifier]) · [Source](https://github.com/d3/d3-scale/blob/master/src/tickFormat.js), [Examples](https://observablehq.com/@d3/scale-ticks)
+
+Returns a [number format](https://github.com/d3/d3-format) function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values, as determined by [d3.tickStep](https://github.com/d3/d3-array/blob/master/README.md#tickStep).
+
+An optional *specifier* allows a [custom format](https://github.com/d3/d3-format/blob/master/README.md#locale_format) where the precision of the format is automatically set by the scale as appropriate for the tick interval. For example, to format percentage change, you might say:
+
+```js
+var tickFormat = d3.tickFormat(-1, 1, 5, "+%");
+
+tickFormat(-0.5); // "-50%"
+```
+
+If *specifier* uses the format type `s`, the scale will return a [SI-prefix format](https://github.com/d3/d3-format/blob/master/README.md#locale_formatPrefix) based on the larger absolute value of *start* and *stop*. If the *specifier* already specifies a precision, this method is equivalent to [*locale*.format](https://github.com/d3/d3-format/blob/master/README.md#locale_format).
+
+#### Linear Scales
+
+# d3.scaleLinear([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/linear.js), [Examples](https://observablehq.com/@d3/d3-scalelinear)
+
+Constructs a new [continuous scale](#continuous-scales) with the specified [domain](#continuous_domain) and [range](#continuous_range), the [default](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate) [interpolator](#continuous_interpolate) and [clamping](#continuous_clamp) disabled. If either *domain* or *range* are not specified, each defaults to [0, 1]. Linear scales are a good default choice for continuous quantitative data because they preserve proportional differences. Each range value *y* can be expressed as a function of the domain value *x*: *y* = *mx* + *b*.
+
+#### Power Scales
+
+Power scales are similar to [linear scales](#linear-scales), except an exponential transform is applied to the input domain value before the output range value is computed. Each range value *y* can be expressed as a function of the domain value *x*: *y* = *mx^k* + *b*, where *k* is the [exponent](#pow_exponent) value. Power scales also support negative domain values, in which case the input value and the resulting output value are multiplied by -1.
+
+# d3.scalePow([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+Constructs a new [continuous scale](#continuous-scales) with the specified [domain](#continuous_domain) and [range](#continuous_range), the [exponent](#pow_exponent) 1, the [default](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate) [interpolator](#continuous_interpolate) and [clamping](#continuous_clamp) disabled. If either *domain* or *range* are not specified, each defaults to [0, 1]. (Note that this is effectively a [linear](#linear-scales) scale until you set a different exponent.)
+
+#pow(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*](#_continuous).
+
+#pow.invert(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.invert](#continuous_invert).
+
+#pow.exponent([exponent]) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+If *exponent* is specified, sets the current exponent to the given numeric value. If *exponent* is not specified, returns the current exponent, which defaults to 1. (Note that this is effectively a [linear](#linear-scales) scale until you set a different exponent.)
+
+#pow.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.domain](#continuous_domain).
+
+#pow.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.range](#continuous_range).
+
+#pow.rangeRound([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.rangeRound](#continuous_rangeRound).
+
+#pow.clamp(clamp) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.clamp](#continuous_clamp).
+
+#pow.interpolate(interpolate) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.interpolate](#continuous_interpolate).
+
+#pow.ticks([count]) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/scale-ticks)
+
+See [*continuous*.ticks](#continuous_ticks).
+
+#pow.tickFormat([count[, specifier]]) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/scale-ticks)
+
+See [*continuous*.tickFormat](#continuous_tickFormat).
+
+#pow.nice([count]) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.nice](#continuous_nice).
+
+#pow.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.copy](#continuous_copy).
+
+# d3.scaleSqrt([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/pow.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+Constructs a new [continuous](#continuous-scales) [power scale](#power-scales) with the specified [domain](#continuous_domain) and [range](#continuous_range), the [exponent](#pow_exponent) 0.5, the [default](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate) [interpolator](#continuous_interpolate) and [clamping](#continuous_clamp) disabled. If either *domain* or *range* are not specified, each defaults to [0, 1]. This is a convenience method equivalent to `d3.scalePow(…).exponent(0.5)`.
+
+#### Log Scales
+
+Log scales are similar to [linear scales](#linear-scales), except a logarithmic transform is applied to the input domain value before the output range value is computed. The mapping to the range value *y* can be expressed as a function of the domain value *x*: *y* = *m* log(x) + *b*.
+
+As log(0) = -∞, a log scale domain must be **strictly-positive or strictly-negative**; the domain must not include or cross zero. A log scale with a positive domain has a well-defined behavior for positive values, and a log scale with a negative domain has a well-defined behavior for negative values. (For a negative domain, input and output values are implicitly multiplied by -1.) The behavior of the scale is undefined if you pass a negative value to a log scale with a positive domain or vice versa.
+
+# d3.scaleLog([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+Constructs a new [continuous scale](#continuous-scales) with the specified [domain](#log_domain) and [range](#log_range), the [base](#log_base) 10, the [default](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate) [interpolator](#log_interpolate) and [clamping](#log_clamp) disabled. If *domain* is not specified, it defaults to [1, 10]. If *range* is not specified, it defaults to [0, 1].
+
+#log(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*](#_continuous).
+
+#log.invert(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.invert](#continuous_invert).
+
+#log.base([base]) · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+If *base* is specified, sets the base for this logarithmic scale to the specified value. If *base* is not specified, returns the current base, which defaults to 10.
+
+#log.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.domain](#continuous_domain).
+
+#log.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/continuous.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.range](#continuous_range).
+
+#log.rangeRound([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.rangeRound](#continuous_rangeRound).
+
+#log.clamp(clamp) · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.clamp](#continuous_clamp).
+
+#log.interpolate(interpolate) · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.interpolate](#continuous_interpolate).
+
+#log.ticks([count]) · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/scale-ticks)
+
+Like [*continuous*.ticks](#continuous_ticks), but customized for a log scale. If the [base](#log_base) is an integer, the returned ticks are uniformly spaced within each integer power of base; otherwise, one tick per power of base is returned. The returned ticks are guaranteed to be within the extent of the domain. If the orders of magnitude in the [domain](#log_domain) is greater than *count*, then at most one tick per power is returned. Otherwise, the tick values are unfiltered, but note that you can use [*log*.tickFormat](#log_tickFormat) to filter the display of tick labels. If *count* is not specified, it defaults to 10.
+
+#log.tickFormat([count[, specifier]]) · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/scale-ticks)
+
+Like [*continuous*.tickFormat](#continuous_tickFormat), but customized for a log scale. The specified *count* typically has the same value as the count that is used to generate the [tick values](#continuous_ticks). If there are too many ticks, the formatter may return the empty string for some of the tick labels; however, note that the ticks are still shown. To disable filtering, specify a *count* of Infinity. When specifying a count, you may also provide a format *specifier* or format function. For example, to get a tick formatter that will display 20 ticks of a currency, say `log.tickFormat(20, "$,f")`. If the specifier does not have a defined precision, the precision will be set automatically by the scale, returning the appropriate format. This provides a convenient way of specifying a format whose precision will be automatically set by the scale.
+
+#log.nice() · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/d3-scalelinear)
+
+Like [*continuous*.nice](#continuous_nice), except extends the domain to integer powers of [base](#log_base). For example, for a domain of [0.201479…, 0.996679…], and base 10, the nice domain is [0.1, 1]. If the domain has more than two values, nicing the domain only affects the first and last value.
+
+#log.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/log.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+See [*continuous*.copy](#continuous_copy).
+
+#### Symlog Scales
+
+See [A bi-symmetric log transformation for wide-range data](https://www.researchgate.net/profile/John_Webber4/publication/233967063_A_bi-symmetric_log_transformation_for_wide-range_data/links/0fcfd50d791c85082e000000.pdf) by Webber for more.
+
+# d3.scaleSymlog([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/symlog.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+Constructs a new [continuous scale](#continuous-scales) with the specified [domain](#continuous_domain) and [range](#continuous_range), the [constant](#symlog_constant) 1, the [default](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate) [interpolator](#continuous_interpolate) and [clamping](#continuous_clamp) disabled. If *domain* is not specified, it defaults to [0, 1]. If *range* is not specified, it defaults to [0, 1].
+
+#symlog.constant([constant]) · [Source](https://github.com/d3/d3-scale/blob/master/src/symlog.js), [Examples](https://observablehq.com/@d3/continuous-scales)
+
+If *constant* is specified, sets the symlog constant to the specified number and returns this scale; otherwise returns the current value of the symlog constant, which defaults to 1. See “A bi-symmetric log transformation for wide-range data” by Webber for more.
+
+#### Identity Scales
+
+Identity scales are a special case of [linear scales](#linear-scales) where the domain and range are identical; the scale and its invert method are thus the identity function. These scales are occasionally useful when working with pixel coordinates, say in conjunction with an axis. Identity scales do not support [rangeRound](#continuous_rangeRound), [clamp](#continuous_clamp) or [interpolate](#continuous_interpolate).
+
+# d3.scaleIdentity([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/identity.js), [Examples](https://observablehq.com/@d3/d3-scalelinear)
+
+Constructs a new identity scale with the specified [domain](#continuous_domain) and [range](#continuous_range). If *range* is not specified, it defaults to [0, 1].
+
+#### Radial Scales
+
+Radial scales are a variant of [linear scales](#linear-scales) where the range is internally squared so that an input value corresponds linearly to the squared output value. These scales are useful when you want the input value to correspond to the area of a graphical mark and the mark is specified by radius, as in a radial bar chart. Radial scales do not support [interpolate](#continuous_interpolate).
+
+# d3.scaleRadial([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/radial.js), [Examples](https://observablehq.com/@d3/radial-stacked-bar-chart)
+
+Constructs a new radial scale with the specified [domain](#continuous_domain) and [range](#continuous_range). If *domain* or *range* is not specified, each defaults to [0, 1].
+
+#### Time Scales
+
+Time scales are a variant of [linear scales](#linear-scales) that have a temporal domain: domain values are coerced to [dates](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date) rather than numbers, and [invert](#continuous_invert) likewise returns a date. Time scales implement [ticks](#time_ticks) based on [calendar intervals](https://github.com/d3/d3-time), taking the pain out of generating axes for temporal domains.
+
+For example, to create a position encoding:
+
+```js
+var x = d3.scaleTime()
+ .domain([new Date(2000, 0, 1), new Date(2000, 0, 2)])
+ .range([0, 960]);
+
+x(new Date(2000, 0, 1, 5)); // 200
+x(new Date(2000, 0, 1, 16)); // 640
+x.invert(200); // Sat Jan 01 2000 05:00:00 GMT-0800 (PST)
+x.invert(640); // Sat Jan 01 2000 16:00:00 GMT-0800 (PST)
+```
+
+For a valid value *y* in the range, time(time.invert(y)) equals *y*; similarly, for a valid value *x* in the domain, time.invert(time(x)) equals *x*. The invert method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse.
+
+# d3.scaleTime([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+
+Constructs a new time scale with the specified [domain](#time_domain) and [range](#time_range), the [default](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate) [interpolator](#time_interpolate) and [clamping](#time_clamp) disabled. If *domain* is not specified, it defaults to [2000-01-01, 2000-01-02]. If *range* is not specified, it defaults to [0, 1].
+
+#time(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+
+See [*continuous*](#_continuous).
+
+#time.invert(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+
+See [*continuous*.invert](#continuous_invert).
+
+#time.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+
+See [*continuous*.domain](#continuous_domain).
+
+#time.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+
+See [*continuous*.range](#continuous_range).
+
+#time.rangeRound([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+
+See [*continuous*.rangeRound](#continuous_rangeRound).
+
+#time.clamp(clamp) · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+
+See [*continuous*.clamp](#continuous_clamp).
+
+#time.interpolate(interpolate) · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+
+See [*continuous*.interpolate](#continuous_interpolate).
+
+#time.ticks([count]) · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+ #time.ticks([interval])
+
+Returns representative dates from the scale’s [domain](#time_domain). The returned tick values are uniformly-spaced (mostly), have sensible values (such as every day at midnight), and are guaranteed to be within the extent of the domain. Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data.
+
+An optional *count* may be specified to affect how many ticks are generated. If *count* is not specified, it defaults to 10. The specified *count* is only a hint; the scale may return more or fewer values depending on the domain. For example, to create ten default ticks, say:
+
+```js
+var x = d3.scaleTime();
+
+x.ticks(10);
+// [Sat Jan 01 2000 00:00:00 GMT-0800 (PST),
+// Sat Jan 01 2000 03:00:00 GMT-0800 (PST),
+// Sat Jan 01 2000 06:00:00 GMT-0800 (PST),
+// Sat Jan 01 2000 09:00:00 GMT-0800 (PST),
+// Sat Jan 01 2000 12:00:00 GMT-0800 (PST),
+// Sat Jan 01 2000 15:00:00 GMT-0800 (PST),
+// Sat Jan 01 2000 18:00:00 GMT-0800 (PST),
+// Sat Jan 01 2000 21:00:00 GMT-0800 (PST),
+// Sun Jan 02 2000 00:00:00 GMT-0800 (PST)]
+```
+
+The following time intervals are considered for automatic ticks:
+
+* 1-, 5-, 15- and 30-second.
+* 1-, 5-, 15- and 30-minute.
+* 1-, 3-, 6- and 12-hour.
+* 1- and 2-day.
+* 1-week.
+* 1- and 3-month.
+* 1-year.
+
+In lieu of a *count*, a [time *interval*](https://github.com/d3/d3-time/blob/master/README.md#intervals) may be explicitly specified. To prune the generated ticks for a given time *interval*, use [*interval*.every](https://github.com/d3/d3-time/blob/master/README.md#interval_every). For example, to generate ticks at 15-[minute](https://github.com/d3/d3-time/blob/master/README.md#minute) intervals:
+
+```js
+var x = d3.scaleTime()
+ .domain([new Date(2000, 0, 1, 0), new Date(2000, 0, 1, 2)]);
+
+x.ticks(d3.timeMinute.every(15));
+// [Sat Jan 01 2000 00:00:00 GMT-0800 (PST),
+// Sat Jan 01 2000 00:15:00 GMT-0800 (PST),
+// Sat Jan 01 2000 00:30:00 GMT-0800 (PST),
+// Sat Jan 01 2000 00:45:00 GMT-0800 (PST),
+// Sat Jan 01 2000 01:00:00 GMT-0800 (PST),
+// Sat Jan 01 2000 01:15:00 GMT-0800 (PST),
+// Sat Jan 01 2000 01:30:00 GMT-0800 (PST),
+// Sat Jan 01 2000 01:45:00 GMT-0800 (PST),
+// Sat Jan 01 2000 02:00:00 GMT-0800 (PST)]
+```
+
+Alternatively, pass a test function to [*interval*.filter](https://github.com/d3/d3-time/blob/master/README.md#interval_filter):
+
+```js
+x.ticks(d3.timeMinute.filter(function(d) {
+ return d.getMinutes() % 15 === 0;
+}));
+```
+
+Note: in some cases, such as with day ticks, specifying a *step* can result in irregular spacing of ticks because time intervals have varying length.
+
+#time.tickFormat([count[, specifier]]) · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/scale-ticks)
+ #time.tickFormat([interval[, specifier]])
+
+Returns a time format function suitable for displaying [tick](#time_ticks) values. The specified *count* or *interval* is currently ignored, but is accepted for consistency with other scales such as [*continuous*.tickFormat](#continuous_tickFormat). If a format *specifier* is specified, this method is equivalent to [format](https://github.com/d3/d3-time-format/blob/master/README.md#format). If *specifier* is not specified, the default time format is returned. The default multi-scale time format chooses a human-readable representation based on the specified date as follows:
+
+* `%Y` - for year boundaries, such as `2011`.
+* `%B` - for month boundaries, such as `February`.
+* `%b %d` - for week boundaries, such as `Feb 06`.
+* `%a %d` - for day boundaries, such as `Mon 07`.
+* `%I %p` - for hour boundaries, such as `01 AM`.
+* `%I:%M` - for minute boundaries, such as `01:23`.
+* `:%S` - for second boundaries, such as `:45`.
+* `.%L` - milliseconds for all other times, such as `.012`.
+
+Although somewhat unusual, this default behavior has the benefit of providing both local and global context: for example, formatting a sequence of ticks as [11 PM, Mon 07, 01 AM] reveals information about hours, dates, and day simultaneously, rather than just the hours [11 PM, 12 AM, 01 AM]. See [d3-time-format](https://github.com/d3/d3-time-format) if you’d like to roll your own conditional time format.
+
+#time.nice([count]) · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+ #time.nice([interval])
+
+Extends the [domain](#time_domain) so that it starts and ends on nice round values. This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. See [*continuous*.nice](#continuous_nice) for more.
+
+An optional tick *count* argument allows greater control over the step size used to extend the bounds, guaranteeing that the returned [ticks](#time_ticks) will exactly cover the domain. Alternatively, a [time *interval*](https://github.com/d3/d3-time/blob/master/README.md#intervals) may be specified to explicitly set the ticks. If an *interval* is specified, an optional *step* may also be specified to skip some ticks. For example, `time.nice(d3.timeSecond.every(10))` will extend the domain to an even ten seconds (0, 10, 20, etc.). See [*time*.ticks](#time_ticks) and [*interval*.every](https://github.com/d3/d3-time/blob/master/README.md#interval_every) for further detail.
+
+Nicing is useful if the domain is computed from data, say using [extent](https://github.com/d3/d3-array/blob/master/README.md#extent), and may be irregular. For example, for a domain of [2009-07-13T00:02, 2009-07-13T23:48], the nice domain is [2009-07-13, 2009-07-14]. If the domain has more than two values, nicing the domain only affects the first and last value.
+
+#time.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/time.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+
+See [*continuous*.copy](#continuous_copy).
+
+# d3.scaleUtc([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/utcTime.js), [Examples](https://observablehq.com/@d3/d3-scaletime)
+
+Equivalent to [scaleTime](#scaleTime), but the returned time scale operates in [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) rather than local time.
+
+### Sequential Scales
+
+Sequential scales, like [diverging scales](#diverging-scales), are similar to [continuous scales](#continuous-scales) in that they map a continuous, numeric input domain to a continuous output range. However, unlike continuous scales, the input domain and output range of a sequential scale always has exactly two elements, and the output range is typically specified as an interpolator rather than an array of values. These scales do not expose [invert](#continuous_invert) and [interpolate](#continuous_interpolate) methods.
+
+# d3.scaleSequential([[domain, ]interpolator]) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+Constructs a new sequential scale with the specified [*domain*](#sequential_domain) and [*interpolator*](#sequential_interpolator) function or array. If *domain* is not specified, it defaults to [0, 1]. If *interpolator* is not specified, it defaults to the identity function. When the scale is [applied](#_sequential), the interpolator will be invoked with a value typically in the range [0, 1], where 0 represents the minimum value and 1 represents the maximum value. For example, to implement the ill-advised [HSL](https://github.com/d3/d3-color/blob/master/README.md#hsl) rainbow scale:
+
+```js
+var rainbow = d3.scaleSequential(function(t) {
+ return d3.hsl(t * 360, 1, 0.5) + "";
+});
+```
+
+A more aesthetically-pleasing and perceptually-effective cyclical hue encoding is to use [d3.interpolateRainbow](https://github.com/d3/d3-scale-chromatic/blob/master/README.md#interpolateRainbow):
+
+```js
+var rainbow = d3.scaleSequential(d3.interpolateRainbow);
+```
+
+If *interpolator* is an array, it represents the scale’s two-element output range and is converted to an interpolator function using [d3.interpolate](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate).
+
+#sequential(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+See [*continuous*](#_continuous).
+
+#sequential.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+See [*continuous*.domain](#continuous_domain). Note that a sequential scale’s domain must be numeric and must contain exactly two values.
+
+#sequential.clamp([clamp]) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+See [*continuous*.clamp](#continuous_clamp).
+
+#sequential.interpolator([interpolator]) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+If *interpolator* is specified, sets the scale’s interpolator to the specified function. If *interpolator* is not specified, returns the scale’s current interpolator.
+
+#sequential.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+See [*continuous*.range](#continuous_range). If *range* is specified, the given two-element array is converted to an interpolator function using [d3.interpolate](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate).
+
+#sequential.rangeRound([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+See [*continuous*.rangeRound](#continuous_rangeRound). If *range* is specified, implicitly uses [d3.interpolateRound](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateRound) as the interpolator.
+
+#sequential.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+See [*continuous*.copy](#continuous_copy).
+
+# d3.scaleSequentialLog([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+A [sequential scale](#sequential-scales) with a logarithmic transform, analogous to a [log scale](#log-scales).
+
+# d3.scaleSequentialPow([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+A [sequential scale](#sequential-scales) with an exponential transform, analogous to a [power scale](#pow-scales).
+
+# d3.scaleSequentialSqrt([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+A [sequential scale](#sequential-scales) with a square-root transform, analogous to a [d3.scaleSqrt](#scaleSqrt).
+
+# d3.scaleSequentialSymlog([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequential.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+A [sequential scale](#sequential-scales) with a symmetric logarithmic transform, analogous to a [symlog scale](#symlog-scales).
+
+# d3.scaleSequentialQuantile([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequentialQuantile.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+A [sequential scale](#sequential-scales) using a *p*-quantile transform, analogous to a [quantile scale](#quantile-scales).
+
+#sequentialQuantile.quantiles(n) · [Source](https://github.com/d3/d3-scale/blob/master/src/sequentialQuantile.js), [Examples](https://observablehq.com/@d3/sequential-scales)
+
+Returns an array of *n* + 1 quantiles. For example, if *n* = 4, returns an array of five numbers: the minimum value, the first quartile, the median, the third quartile, and the maximum.
+
+### Diverging Scales
+
+Diverging scales, like [sequential scales](#sequential-scales), are similar to [continuous scales](#continuous-scales) in that they map a continuous, numeric input domain to a continuous output range. However, unlike continuous scales, the input domain and output range of a diverging scale always has exactly three elements, and the output range is typically specified as an interpolator rather than an array of values. These scales do not expose [invert](#continuous_invert) and [interpolate](#continuous_interpolate) methods.
+
+# d3.scaleDiverging([[domain, ]interpolator]) · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+Constructs a new diverging scale with the specified [*domain*](#diverging_domain) and [*interpolator*](#diverging_interpolator) function or array. If *domain* is not specified, it defaults to [0, 0.5, 1]. If *interpolator* is not specified, it defaults to the identity function. When the scale is [applied](#_diverging), the interpolator will be invoked with a value typically in the range [0, 1], where 0 represents the extreme negative value, 0.5 represents the neutral value, and 1 represents the extreme positive value. For example, using [d3.interpolateSpectral](https://github.com/d3/d3-scale-chromatic/blob/master/README.md#interpolateSpectral):
+
+```js
+var spectral = d3.scaleDiverging(d3.interpolateSpectral);
+```
+
+If *interpolator* is an array, it represents the scale’s three-element output range and is converted to an interpolator function using [d3.interpolate](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate) and [d3.piecewise](https://github.com/d3/d3-interpolate/blob/master/README.md#piecewise).
+
+#diverging(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+See [*continuous*](#_continuous).
+
+#diverging.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+See [*continuous*.domain](#continuous_domain). Note that a diverging scale’s domain must be numeric and must contain exactly three values. The default domain is [0, 0.5, 1].
+
+#diverging.clamp([clamp]) · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+See [*continuous*.clamp](#continuous_clamp).
+
+#diverging.interpolator([interpolator]) · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+If *interpolator* is specified, sets the scale’s interpolator to the specified function. If *interpolator* is not specified, returns the scale’s current interpolator.
+
+#diverging.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+See [*continuous*.range](#continuous_range). If *range* is specified, the given three-element array is converted to an interpolator function using [d3.interpolate](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate) and [d3.piecewise](https://github.com/d3/d3-interpolate/blob/master/README.md#piecewise).
+
+#diverging.rangeRound([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+See [*continuous*.range](#continuous_rangeRound). If *range* is specified, implicitly uses [d3.interpolateRound](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateRound) as the interpolator.
+
+#diverging.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+See [*continuous*.copy](#continuous_copy).
+
+#diverging.unknown() · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+See [*continuous*.unknown](#continuous_unknown).
+
+# d3.scaleDivergingLog([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+A [diverging scale](#diverging-scales) with a logarithmic transform, analogous to a [log scale](#log-scales).
+
+# d3.scaleDivergingPow([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+A [diverging scale](#diverging-scales) with an exponential transform, analogous to a [power scale](#pow-scales).
+
+# d3.scaleDivergingSqrt([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+A [diverging scale](#diverging-scales) with a square-root transform, analogous to a [d3.scaleSqrt](#scaleSqrt).
+
+# d3.scaleDivergingSymlog([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/diverging.js), [Examples](https://observablehq.com/@d3/diverging-scales)
+
+A [diverging scale](#diverging-scales) with a symmetric logarithmic transform, analogous to a [symlog scale](#symlog-scales).
+
+### Quantize Scales
+
+Quantize scales are similar to [linear scales](#linear-scales), except they use a discrete rather than continuous range. The continuous input domain is divided into uniform segments based on the number of values in (*i.e.*, the cardinality of) the output range. Each range value *y* can be expressed as a quantized linear function of the domain value *x*: *y* = *m round(x)* + *b*. See [this choropleth](https://observablehq.com/@d3/choropleth) for an example.
+
+# d3.scaleQuantize([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/quantize.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Constructs a new quantize scale with the specified [*domain*](#quantize_domain) and [*range*](#quantize_range). If either *domain* or *range* is not specified, each defaults to [0, 1]. Thus, the default quantize scale is equivalent to the [Math.round](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Math/round) function.
+
+#quantize(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/quantize.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Given a *value* in the input [domain](#quantize_domain), returns the corresponding value in the output [range](#quantize_range). For example, to apply a color encoding:
+
+```js
+var color = d3.scaleQuantize()
+ .domain([0, 1])
+ .range(["brown", "steelblue"]);
+
+color(0.49); // "brown"
+color(0.51); // "steelblue"
+```
+
+Or dividing the domain into three equally-sized parts with different range values to compute an appropriate stroke width:
+
+```js
+var width = d3.scaleQuantize()
+ .domain([10, 100])
+ .range([1, 2, 4]);
+
+width(20); // 1
+width(50); // 2
+width(80); // 4
+```
+
+#quantize.invertExtent(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/quantize.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Returns the extent of values in the [domain](#quantize_domain) [x0, x1] for the corresponding *value* in the [range](#quantize_range): the inverse of [*quantize*](#_quantize). This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse.
+
+```js
+var width = d3.scaleQuantize()
+ .domain([10, 100])
+ .range([1, 2, 4]);
+
+width.invertExtent(2); // [40, 70]
+```
+
+#quantize.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/quantize.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+If *domain* is specified, sets the scale’s domain to the specified two-element array of numbers. If the elements in the given array are not numbers, they will be coerced to numbers. The numbers must be in ascending order or the behavior of the scale is undefined. If *domain* is not specified, returns the scale’s current domain.
+
+#quantize.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/quantize.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+If *range* is specified, sets the scale’s range to the specified array of values. The array may contain any number of discrete values. The elements in the given array need not be numbers; any value or type will work. If *range* is not specified, returns the scale’s current range.
+
+#quantize.ticks([count]) · [Source](https://github.com/d3/d3-scale/blob/master/src/quantize.js), [Examples](https://observablehq.com/@d3/scale-ticks)
+
+Equivalent to [*continuous*.ticks](#continuous_ticks).
+
+#quantize.tickFormat([count[, specifier]]) · [Source](https://github.com/d3/d3-scale/blob/master/src/linear.js), [Examples](https://observablehq.com/@d3/scale-ticks)
+
+Equivalent to [*continuous*.tickFormat](#continuous_tickFormat).
+
+#quantize.nice() · [Source](https://github.com/d3/d3-scale/blob/master/src/quantize.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Equivalent to [*continuous*.nice](#continuous_nice).
+
+#quantize.thresholds() · [Source](https://github.com/d3/d3-scale/blob/master/src/quantize.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Returns the array of computed thresholds within the [domain](#quantize_domain).
+
+#quantize.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/quantize.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa.
+
+### Quantile Scales
+
+Quantile scales map a sampled input domain to a discrete range. The domain is considered continuous and thus the scale will accept any reasonable input value; however, the domain is specified as a discrete set of sample values. The number of values in (the cardinality of) the output range determines the number of quantiles that will be computed from the domain. To compute the quantiles, the domain is sorted, and treated as a [population of discrete values](https://en.wikipedia.org/wiki/Quantile#Quantiles_of_a_population); see d3-array’s [quantile](https://github.com/d3/d3-array/blob/master/README.md#quantile). See [this quantile choropleth](https://observablehq.com/@d3/quantile-choropleth) for an example.
+
+# d3.scaleQuantile([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/quantile.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Constructs a new quantile scale with the specified [*domain*](#quantile_domain) and [*range*](#quantile_range). If either *domain* or *range* is not specified, each defaults to the empty array. The quantile scale is invalid until both a domain and range are specified.
+
+#quantile(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/quantile.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Given a *value* in the input [domain](#quantile_domain), returns the corresponding value in the output [range](#quantile_range).
+
+#quantile.invertExtent(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/quantile.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Returns the extent of values in the [domain](#quantile_domain) [x0, x1] for the corresponding *value* in the [range](#quantile_range): the inverse of [*quantile*](#_quantile). This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse.
+
+#quantile.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/quantile.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+If *domain* is specified, sets the domain of the quantile scale to the specified set of discrete numeric values. The array must not be empty, and must contain at least one numeric value; NaN, null and undefined values are ignored and not considered part of the sample population. If the elements in the given array are not numbers, they will be coerced to numbers. A copy of the input array is sorted and stored internally. If *domain* is not specified, returns the scale’s current domain.
+
+#quantile.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/quantile.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+If *range* is specified, sets the discrete values in the range. The array must not be empty, and may contain any type of value. The number of values in (the cardinality, or length, of) the *range* array determines the number of quantiles that are computed. For example, to compute quartiles, *range* must be an array of four elements such as [0, 1, 2, 3]. If *range* is not specified, returns the current range.
+
+#quantile.quantiles() · [Source](https://github.com/d3/d3-scale/blob/master/src/quantile.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Returns the quantile thresholds. If the [range](#quantile_range) contains *n* discrete values, the returned array will contain *n* - 1 thresholds. Values less than the first threshold are considered in the first quantile; values greater than or equal to the first threshold but less than the second threshold are in the second quantile, and so on. Internally, the thresholds array is used with [bisect](https://github.com/d3/d3-array/blob/master/README.md#bisect) to find the output quantile associated with the given input value.
+
+#quantile.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/quantile.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa.
+
+### Threshold Scales
+
+Threshold scales are similar to [quantize scales](#quantize-scales), except they allow you to map arbitrary subsets of the domain to discrete values in the range. The input domain is still continuous, and divided into slices based on a set of threshold values. See [this choropleth](https://observablehq.com/@d3/threshold-choropleth) for an example.
+
+# d3.scaleThreshold([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/threshold.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Constructs a new threshold scale with the specified [*domain*](#threshold_domain) and [*range*](#threshold_range). If *domain* is not specified, it defaults to [0.5]. If *range* is not specified, it defaults to [0, 1]. Thus, the default threshold scale is equivalent to the [Math.round](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Math/round) function for numbers; for example threshold(0.49) returns 0, and threshold(0.51) returns 1.
+
+#threshold(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/threshold.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Given a *value* in the input [domain](#threshold_domain), returns the corresponding value in the output [range](#threshold_range). For example:
+
+```js
+var color = d3.scaleThreshold()
+ .domain([0, 1])
+ .range(["red", "white", "green"]);
+
+color(-1); // "red"
+color(0); // "white"
+color(0.5); // "white"
+color(1); // "green"
+color(1000); // "green"
+```
+
+#threshold.invertExtent(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/threshold.js), [Examples](https://observablehq.com/@d3/choropleth)
+
+Returns the extent of values in the [domain](#threshold_domain) [x0, x1] for the corresponding *value* in the [range](#threshold_range), representing the inverse mapping from range to domain. This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse. For example:
+
+```js
+var color = d3.scaleThreshold()
+ .domain([0, 1])
+ .range(["red", "white", "green"]);
+
+color.invertExtent("red"); // [undefined, 0]
+color.invertExtent("white"); // [0, 1]
+color.invertExtent("green"); // [1, undefined]
+```
+
+#threshold.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/threshold.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+If *domain* is specified, sets the scale’s domain to the specified array of values. The values must be in ascending order or the behavior of the scale is undefined. The values are typically numbers, but any naturally ordered values (such as strings) will work; a threshold scale can be used to encode any type that is ordered. If the number of values in the scale’s range is N+1, the number of values in the scale’s domain must be N. If there are fewer than N elements in the domain, the additional values in the range are ignored. If there are more than N elements in the domain, the scale may return undefined for some inputs. If *domain* is not specified, returns the scale’s current domain.
+
+#threshold.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/threshold.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+If *range* is specified, sets the scale’s range to the specified array of values. If the number of values in the scale’s domain is N, the number of values in the scale’s range must be N+1. If there are fewer than N+1 elements in the range, the scale may return undefined for some inputs. If there are more than N+1 elements in the range, the additional values are ignored. The elements in the given array need not be numbers; any value or type will work. If *range* is not specified, returns the scale’s current range.
+
+#threshold.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/threshold.js), [Examples](https://observablehq.com/@d3/quantile-quantize-and-threshold-scales)
+
+Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa.
+
+### Ordinal Scales
+
+Unlike [continuous scales](#continuous-scales), ordinal scales have a discrete domain and range. For example, an ordinal scale might map a set of named categories to a set of colors, or determine the horizontal positions of columns in a column chart.
+
+# d3.scaleOrdinal([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/ordinal.js), [Examples](https://observablehq.com/@d3/d3-scaleordinal)
+
+Constructs a new ordinal scale with the specified [*domain*](#ordinal_domain) and [*range*](#ordinal_range). If *domain* is not specified, it defaults to the empty array. If *range* is not specified, it defaults to the empty array; an ordinal scale always returns undefined until a non-empty range is defined.
+
+#ordinal(value) · [Source](https://github.com/d3/d3-scale/blob/master/src/ordinal.js), [Examples](https://observablehq.com/@d3/d3-scaleordinal)
+
+Given a *value* in the input [domain](#ordinal_domain), returns the corresponding value in the output [range](#ordinal_range). If the given *value* is not in the scale’s [domain](#ordinal_domain), returns the [unknown](#ordinal_unknown); or, if the unknown value is [implicit](#scaleImplicit) (the default), then the *value* is implicitly added to the domain and the next-available value in the range is assigned to *value*, such that this and subsequent invocations of the scale given the same input *value* return the same output value.
+
+#ordinal.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/ordinal.js), [Examples](https://observablehq.com/@d3/d3-scaleordinal)
+
+If *domain* is specified, sets the domain to the specified array of values. The first element in *domain* will be mapped to the first element in the range, the second domain value to the second range value, and so on. Domain values are stored internally in an [InternMap](https://github.com/mbostock/internmap) from primitive value to index; the resulting index is then used to retrieve a value from the range. Thus, an ordinal scale’s values must be coercible to a primitive value, and the primitive domain value uniquely identifies the corresponding range value. If *domain* is not specified, this method returns the current domain.
+
+Setting the domain on an ordinal scale is optional if the [unknown value](#ordinal_unknown) is [implicit](#scaleImplicit) (the default). In this case, the domain will be inferred implicitly from usage by assigning each unique value passed to the scale a new value from the range. Note that an explicit domain is recommended to ensure deterministic behavior, as inferring the domain from usage will be dependent on ordering.
+
+#ordinal.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/ordinal.js), [Examples](https://observablehq.com/@d3/d3-scaleordinal)
+
+If *range* is specified, sets the range of the ordinal scale to the specified array of values. The first element in the domain will be mapped to the first element in *range*, the second domain value to the second range value, and so on. If there are fewer elements in the range than in the domain, the scale will reuse values from the start of the range. If *range* is not specified, this method returns the current range.
+
+#ordinal.unknown([value]) · [Source](https://github.com/d3/d3-scale/blob/master/src/ordinal.js), [Examples](https://observablehq.com/@d3/d3-scaleordinal)
+
+If *value* is specified, sets the output value of the scale for unknown input values and returns this scale. If *value* is not specified, returns the current unknown value, which defaults to [implicit](#scaleImplicit). The implicit value enables implicit domain construction; see [*ordinal*.domain](#ordinal_domain).
+
+#ordinal.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/ordinal.js), [Examples](https://observablehq.com/@d3/d3-scaleordinal)
+
+Returns an exact copy of this ordinal scale. Changes to this scale will not affect the returned scale, and vice versa.
+
+# d3.scaleImplicit · [Source](https://github.com/d3/d3-scale/blob/master/src/ordinal.js), [Examples](https://observablehq.com/@d3/d3-scaleordinal)
+
+A special value for [*ordinal*.unknown](#ordinal_unknown) that enables implicit domain construction: unknown values are implicitly added to the domain.
+
+#### Band Scales
+
+Band scales are like [ordinal scales](#ordinal-scales) except the output range is continuous and numeric. Discrete output values are automatically computed by the scale by dividing the continuous range into uniform bands. Band scales are typically used for bar charts with an ordinal or categorical dimension. The [unknown value](#ordinal_unknown) of a band scale is effectively undefined: they do not allow implicit domain construction.
+
+
+
+# d3.scaleBand([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+Constructs a new band scale with the specified [*domain*](#band_domain) and [*range*](#band_range), no [padding](#band_padding), no [rounding](#band_round) and center [alignment](#band_align). If *domain* is not specified, it defaults to the empty domain. If *range* is not specified, it defaults to the unit range [0, 1].
+
+#band(*value*) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+Given a *value* in the input [domain](#band_domain), returns the start of the corresponding band derived from the output [range](#band_range). If the given *value* is not in the scale’s domain, returns undefined.
+
+#band.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+If *domain* is specified, sets the domain to the specified array of values. The first element in *domain* will be mapped to the first band, the second domain value to the second band, and so on. Domain values are stored internally in an [InternMap](https://github.com/mbostock/internmap) from primitive value to index; the resulting index is then used to determine the band. Thus, a band scale’s values must be coercible to a primitive value, and the primitive domain value uniquely identifies the corresponding band. If *domain* is not specified, this method returns the current domain.
+
+#band.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+If *range* is specified, sets the scale’s range to the specified two-element array of numbers. If the elements in the given array are not numbers, they will be coerced to numbers. If *range* is not specified, returns the scale’s current range, which defaults to [0, 1].
+
+#band.rangeRound([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+Sets the scale’s [*range*](#band_range) to the specified two-element array of numbers while also enabling [rounding](#band_round). This is a convenience method equivalent to:
+
+```js
+band
+ .range(range)
+ .round(true);
+```
+
+Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the [shape-rendering](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering) “crispEdges” styles.
+
+#band.round([round]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+If *round* is specified, enables or disables rounding accordingly. If rounding is enabled, the start and stop of each band will be integers. Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the [shape-rendering](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering) “crispEdges” styles. Note that if the width of the domain is not a multiple of the cardinality of the range, there may be leftover unused space, even without padding! Use [*band*.align](#band_align) to specify how the leftover space is distributed.
+
+#band.paddingInner([padding]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+If *padding* is specified, sets the inner padding to the specified number which must be less than or equal to 1. If *padding* is not specified, returns the current inner padding which defaults to 0. The inner padding specifies the proportion of the range that is reserved for blank space between bands; a value of 0 means no blank space between bands, and a value of 1 means a [bandwidth](#band_bandwidth) of zero.
+
+#band.paddingOuter([padding]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+If *padding* is specified, sets the outer padding to the specified number which is typically in the range [0, 1]. If *padding* is not specified, returns the current outer padding which defaults to 0. The outer padding specifies the amount of blank space, in terms of multiples of the [step](#band_step), to reserve before the first band and after the last band.
+
+#band.padding([padding]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+A convenience method for setting the [inner](#band_paddingInner) and [outer](#band_paddingOuter) padding to the same *padding* value. If *padding* is not specified, returns the inner padding.
+
+#band.align([align]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+If *align* is specified, sets the alignment to the specified value which must be in the range [0, 1]. If *align* is not specified, returns the current alignment which defaults to 0.5. The alignment specifies how outer padding is distributed in the range. A value of 0.5 indicates that the outer padding should be equally distributed before the first band and after the last band; *i.e.*, the bands should be centered within the range. A value of 0 or 1 may be used to shift the bands to one side, say to position them adjacent to an axis. For more, [see this explainer](https://observablehq.com/@d3/band-align).
+
+#band.bandwidth() · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+Returns the width of each band.
+
+#band.step() · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+Returns the distance between the starts of adjacent bands.
+
+#band.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scaleband)
+
+Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa.
+
+#### Point Scales
+
+Point scales are a variant of [band scales](#band-scales) with the bandwidth fixed to zero. Point scales are typically used for scatterplots with an ordinal or categorical dimension. The [unknown value](#ordinal_unknown) of a point scale is always undefined: they do not allow implicit domain construction.
+
+
+
+# d3.scalePoint([[domain, ]range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scalepoint)
+
+Constructs a new point scale with the specified [*domain*](#point_domain) and [*range*](#point_range), no [padding](#point_padding), no [rounding](#point_round) and center [alignment](#point_align). If *domain* is not specified, it defaults to the empty domain. If *range* is not specified, it defaults to the unit range [0, 1].
+
+#point(*value*) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scalepoint)
+
+Given a *value* in the input [domain](#point_domain), returns the corresponding point derived from the output [range](#point_range). If the given *value* is not in the scale’s domain, returns undefined.
+
+#point.domain([domain]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scalepoint)
+
+If *domain* is specified, sets the domain to the specified array of values. The first element in *domain* will be mapped to the first point, the second domain value to the second point, and so on. Domain values are stored internally in an [InternMap](https://github.com/mbostock/internmap) from primitive value to index; the resulting index is then used to determine the point. Thus, a point scale’s values must be coercible to a primitive value, and the primitive domain value uniquely identifies the corresponding point. If *domain* is not specified, this method returns the current domain.
+
+#point.range([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scalepoint)
+
+If *range* is specified, sets the scale’s range to the specified two-element array of numbers. If the elements in the given array are not numbers, they will be coerced to numbers. If *range* is not specified, returns the scale’s current range, which defaults to [0, 1].
+
+#point.rangeRound([range]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scalepoint)
+
+Sets the scale’s [*range*](#point_range) to the specified two-element array of numbers while also enabling [rounding](#point_round). This is a convenience method equivalent to:
+
+```js
+point
+ .range(range)
+ .round(true);
+```
+
+Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the [shape-rendering](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering) “crispEdges” styles.
+
+#point.round([round]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scalepoint)
+
+If *round* is specified, enables or disables rounding accordingly. If rounding is enabled, the position of each point will be integers. Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the [shape-rendering](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering) “crispEdges” styles. Note that if the width of the domain is not a multiple of the cardinality of the range, there may be leftover unused space, even without padding! Use [*point*.align](#point_align) to specify how the leftover space is distributed.
+
+#point.padding([padding]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scalepoint)
+
+If *padding* is specified, sets the outer padding to the specified number which is typically in the range [0, 1]. If *padding* is not specified, returns the current outer padding which defaults to 0. The outer padding specifies the amount of blank space, in terms of multiples of the [step](#band_step), to reserve before the first point and after the last point. Equivalent to [*band*.paddingOuter](#band_paddingOuter).
+
+#point.align([align]) · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scalepoint)
+
+If *align* is specified, sets the alignment to the specified value which must be in the range [0, 1]. If *align* is not specified, returns the current alignment which defaults to 0.5. The alignment specifies how any leftover unused space in the range is distributed. A value of 0.5 indicates that the leftover space should be equally distributed before the first point and after the last point; *i.e.*, the points should be centered within the range. A value of 0 or 1 may be used to shift the points to one side, say to position them adjacent to an axis.
+
+#point.bandwidth() · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scalepoint)
+
+Returns zero.
+
+#point.step() · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scalepoint)
+
+Returns the distance between the starts of adjacent points.
+
+#point.copy() · [Source](https://github.com/d3/d3-scale/blob/master/src/band.js), [Examples](https://observablehq.com/@d3/d3-scalepoint)
+
+Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa.
diff --git a/node_modules/d3-scale/dist/d3-scale.js b/node_modules/d3-scale/dist/d3-scale.js
new file mode 100644
index 0000000000000000000000000000000000000000..408d9271cd0b4f197b6e17fc5decb9ccb0f658bb
--- /dev/null
+++ b/node_modules/d3-scale/dist/d3-scale.js
@@ -0,0 +1,1196 @@
+// https://d3js.org/d3-scale/ v4.0.2 Copyright 2010-2021 Mike Bostock
+(function (global, factory) {
+typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array'), require('d3-interpolate'), require('d3-format'), require('d3-time'), require('d3-time-format')) :
+typeof define === 'function' && define.amd ? define(['exports', 'd3-array', 'd3-interpolate', 'd3-format', 'd3-time', 'd3-time-format'], factory) :
+(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3, global.d3, global.d3, global.d3, global.d3));
+})(this, (function (exports, d3Array, d3Interpolate, d3Format, d3Time, d3TimeFormat) { 'use strict';
+
+function initRange(domain, range) {
+ switch (arguments.length) {
+ case 0: break;
+ case 1: this.range(domain); break;
+ default: this.range(range).domain(domain); break;
+ }
+ return this;
+}
+
+function initInterpolator(domain, interpolator) {
+ switch (arguments.length) {
+ case 0: break;
+ case 1: {
+ if (typeof domain === "function") this.interpolator(domain);
+ else this.range(domain);
+ break;
+ }
+ default: {
+ this.domain(domain);
+ if (typeof interpolator === "function") this.interpolator(interpolator);
+ else this.range(interpolator);
+ break;
+ }
+ }
+ return this;
+}
+
+const implicit = Symbol("implicit");
+
+function ordinal() {
+ var index = new d3Array.InternMap(),
+ domain = [],
+ range = [],
+ unknown = implicit;
+
+ function scale(d) {
+ let i = index.get(d);
+ if (i === undefined) {
+ if (unknown !== implicit) return unknown;
+ index.set(d, i = domain.push(d) - 1);
+ }
+ return range[i % range.length];
+ }
+
+ scale.domain = function(_) {
+ if (!arguments.length) return domain.slice();
+ domain = [], index = new d3Array.InternMap();
+ for (const value of _) {
+ if (index.has(value)) continue;
+ index.set(value, domain.push(value) - 1);
+ }
+ return scale;
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = Array.from(_), scale) : range.slice();
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.copy = function() {
+ return ordinal(domain, range).unknown(unknown);
+ };
+
+ initRange.apply(scale, arguments);
+
+ return scale;
+}
+
+function band() {
+ var scale = ordinal().unknown(undefined),
+ domain = scale.domain,
+ ordinalRange = scale.range,
+ r0 = 0,
+ r1 = 1,
+ step,
+ bandwidth,
+ round = false,
+ paddingInner = 0,
+ paddingOuter = 0,
+ align = 0.5;
+
+ delete scale.unknown;
+
+ function rescale() {
+ var n = domain().length,
+ reverse = r1 < r0,
+ start = reverse ? r1 : r0,
+ stop = reverse ? r0 : r1;
+ step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
+ if (round) step = Math.floor(step);
+ start += (stop - start - step * (n - paddingInner)) * align;
+ bandwidth = step * (1 - paddingInner);
+ if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
+ var values = d3Array.range(n).map(function(i) { return start + step * i; });
+ return ordinalRange(reverse ? values.reverse() : values);
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain(_), rescale()) : domain();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
+ };
+
+ scale.rangeRound = function(_) {
+ return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
+ };
+
+ scale.bandwidth = function() {
+ return bandwidth;
+ };
+
+ scale.step = function() {
+ return step;
+ };
+
+ scale.round = function(_) {
+ return arguments.length ? (round = !!_, rescale()) : round;
+ };
+
+ scale.padding = function(_) {
+ return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
+ };
+
+ scale.paddingInner = function(_) {
+ return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
+ };
+
+ scale.paddingOuter = function(_) {
+ return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
+ };
+
+ scale.align = function(_) {
+ return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
+ };
+
+ scale.copy = function() {
+ return band(domain(), [r0, r1])
+ .round(round)
+ .paddingInner(paddingInner)
+ .paddingOuter(paddingOuter)
+ .align(align);
+ };
+
+ return initRange.apply(rescale(), arguments);
+}
+
+function pointish(scale) {
+ var copy = scale.copy;
+
+ scale.padding = scale.paddingOuter;
+ delete scale.paddingInner;
+ delete scale.paddingOuter;
+
+ scale.copy = function() {
+ return pointish(copy());
+ };
+
+ return scale;
+}
+
+function point() {
+ return pointish(band.apply(null, arguments).paddingInner(1));
+}
+
+function constants(x) {
+ return function() {
+ return x;
+ };
+}
+
+function number$1(x) {
+ return +x;
+}
+
+var unit = [0, 1];
+
+function identity$1(x) {
+ return x;
+}
+
+function normalize(a, b) {
+ return (b -= (a = +a))
+ ? function(x) { return (x - a) / b; }
+ : constants(isNaN(b) ? NaN : 0.5);
+}
+
+function clamper(a, b) {
+ var t;
+ if (a > b) t = a, a = b, b = t;
+ return function(x) { return Math.max(a, Math.min(b, x)); };
+}
+
+// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
+// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
+function bimap(domain, range, interpolate) {
+ var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
+ if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
+ else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
+ return function(x) { return r0(d0(x)); };
+}
+
+function polymap(domain, range, interpolate) {
+ var j = Math.min(domain.length, range.length) - 1,
+ d = new Array(j),
+ r = new Array(j),
+ i = -1;
+
+ // Reverse descending domains.
+ if (domain[j] < domain[0]) {
+ domain = domain.slice().reverse();
+ range = range.slice().reverse();
+ }
+
+ while (++i < j) {
+ d[i] = normalize(domain[i], domain[i + 1]);
+ r[i] = interpolate(range[i], range[i + 1]);
+ }
+
+ return function(x) {
+ var i = d3Array.bisect(domain, x, 1, j) - 1;
+ return r[i](d[i](x));
+ };
+}
+
+function copy$1(source, target) {
+ return target
+ .domain(source.domain())
+ .range(source.range())
+ .interpolate(source.interpolate())
+ .clamp(source.clamp())
+ .unknown(source.unknown());
+}
+
+function transformer$2() {
+ var domain = unit,
+ range = unit,
+ interpolate = d3Interpolate.interpolate,
+ transform,
+ untransform,
+ unknown,
+ clamp = identity$1,
+ piecewise,
+ output,
+ input;
+
+ function rescale() {
+ var n = Math.min(domain.length, range.length);
+ if (clamp !== identity$1) clamp = clamper(domain[0], domain[n - 1]);
+ piecewise = n > 2 ? polymap : bimap;
+ output = input = null;
+ return scale;
+ }
+
+ function scale(x) {
+ return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));
+ }
+
+ scale.invert = function(y) {
+ return clamp(untransform((input || (input = piecewise(range, domain.map(transform), d3Interpolate.interpolateNumber)))(y)));
+ };
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain = Array.from(_, number$1), rescale()) : domain.slice();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
+ };
+
+ scale.rangeRound = function(_) {
+ return range = Array.from(_), interpolate = d3Interpolate.interpolateRound, rescale();
+ };
+
+ scale.clamp = function(_) {
+ return arguments.length ? (clamp = _ ? true : identity$1, rescale()) : clamp !== identity$1;
+ };
+
+ scale.interpolate = function(_) {
+ return arguments.length ? (interpolate = _, rescale()) : interpolate;
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ return function(t, u) {
+ transform = t, untransform = u;
+ return rescale();
+ };
+}
+
+function continuous() {
+ return transformer$2()(identity$1, identity$1);
+}
+
+function tickFormat(start, stop, count, specifier) {
+ var step = d3Array.tickStep(start, stop, count),
+ precision;
+ specifier = d3Format.formatSpecifier(specifier == null ? ",f" : specifier);
+ switch (specifier.type) {
+ case "s": {
+ var value = Math.max(Math.abs(start), Math.abs(stop));
+ if (specifier.precision == null && !isNaN(precision = d3Format.precisionPrefix(step, value))) specifier.precision = precision;
+ return d3Format.formatPrefix(specifier, value);
+ }
+ case "":
+ case "e":
+ case "g":
+ case "p":
+ case "r": {
+ if (specifier.precision == null && !isNaN(precision = d3Format.precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
+ break;
+ }
+ case "f":
+ case "%": {
+ if (specifier.precision == null && !isNaN(precision = d3Format.precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
+ break;
+ }
+ }
+ return d3Format.format(specifier);
+}
+
+function linearish(scale) {
+ var domain = scale.domain;
+
+ scale.ticks = function(count) {
+ var d = domain();
+ return d3Array.ticks(d[0], d[d.length - 1], count == null ? 10 : count);
+ };
+
+ scale.tickFormat = function(count, specifier) {
+ var d = domain();
+ return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
+ };
+
+ scale.nice = function(count) {
+ if (count == null) count = 10;
+
+ var d = domain();
+ var i0 = 0;
+ var i1 = d.length - 1;
+ var start = d[i0];
+ var stop = d[i1];
+ var prestep;
+ var step;
+ var maxIter = 10;
+
+ if (stop < start) {
+ step = start, start = stop, stop = step;
+ step = i0, i0 = i1, i1 = step;
+ }
+
+ while (maxIter-- > 0) {
+ step = d3Array.tickIncrement(start, stop, count);
+ if (step === prestep) {
+ d[i0] = start;
+ d[i1] = stop;
+ return domain(d);
+ } else if (step > 0) {
+ start = Math.floor(start / step) * step;
+ stop = Math.ceil(stop / step) * step;
+ } else if (step < 0) {
+ start = Math.ceil(start * step) / step;
+ stop = Math.floor(stop * step) / step;
+ } else {
+ break;
+ }
+ prestep = step;
+ }
+
+ return scale;
+ };
+
+ return scale;
+}
+
+function linear() {
+ var scale = continuous();
+
+ scale.copy = function() {
+ return copy$1(scale, linear());
+ };
+
+ initRange.apply(scale, arguments);
+
+ return linearish(scale);
+}
+
+function identity(domain) {
+ var unknown;
+
+ function scale(x) {
+ return x == null || isNaN(x = +x) ? unknown : x;
+ }
+
+ scale.invert = scale;
+
+ scale.domain = scale.range = function(_) {
+ return arguments.length ? (domain = Array.from(_, number$1), scale) : domain.slice();
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.copy = function() {
+ return identity(domain).unknown(unknown);
+ };
+
+ domain = arguments.length ? Array.from(domain, number$1) : [0, 1];
+
+ return linearish(scale);
+}
+
+function nice(domain, interval) {
+ domain = domain.slice();
+
+ var i0 = 0,
+ i1 = domain.length - 1,
+ x0 = domain[i0],
+ x1 = domain[i1],
+ t;
+
+ if (x1 < x0) {
+ t = i0, i0 = i1, i1 = t;
+ t = x0, x0 = x1, x1 = t;
+ }
+
+ domain[i0] = interval.floor(x0);
+ domain[i1] = interval.ceil(x1);
+ return domain;
+}
+
+function transformLog(x) {
+ return Math.log(x);
+}
+
+function transformExp(x) {
+ return Math.exp(x);
+}
+
+function transformLogn(x) {
+ return -Math.log(-x);
+}
+
+function transformExpn(x) {
+ return -Math.exp(-x);
+}
+
+function pow10(x) {
+ return isFinite(x) ? +("1e" + x) : x < 0 ? 0 : x;
+}
+
+function powp(base) {
+ return base === 10 ? pow10
+ : base === Math.E ? Math.exp
+ : x => Math.pow(base, x);
+}
+
+function logp(base) {
+ return base === Math.E ? Math.log
+ : base === 10 && Math.log10
+ || base === 2 && Math.log2
+ || (base = Math.log(base), x => Math.log(x) / base);
+}
+
+function reflect(f) {
+ return (x, k) => -f(-x, k);
+}
+
+function loggish(transform) {
+ const scale = transform(transformLog, transformExp);
+ const domain = scale.domain;
+ let base = 10;
+ let logs;
+ let pows;
+
+ function rescale() {
+ logs = logp(base), pows = powp(base);
+ if (domain()[0] < 0) {
+ logs = reflect(logs), pows = reflect(pows);
+ transform(transformLogn, transformExpn);
+ } else {
+ transform(transformLog, transformExp);
+ }
+ return scale;
+ }
+
+ scale.base = function(_) {
+ return arguments.length ? (base = +_, rescale()) : base;
+ };
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain(_), rescale()) : domain();
+ };
+
+ scale.ticks = count => {
+ const d = domain();
+ let u = d[0];
+ let v = d[d.length - 1];
+ const r = v < u;
+
+ if (r) ([u, v] = [v, u]);
+
+ let i = logs(u);
+ let j = logs(v);
+ let k;
+ let t;
+ const n = count == null ? 10 : +count;
+ let z = [];
+
+ if (!(base % 1) && j - i < n) {
+ i = Math.floor(i), j = Math.ceil(j);
+ if (u > 0) for (; i <= j; ++i) {
+ for (k = 1; k < base; ++k) {
+ t = i < 0 ? k / pows(-i) : k * pows(i);
+ if (t < u) continue;
+ if (t > v) break;
+ z.push(t);
+ }
+ } else for (; i <= j; ++i) {
+ for (k = base - 1; k >= 1; --k) {
+ t = i > 0 ? k / pows(-i) : k * pows(i);
+ if (t < u) continue;
+ if (t > v) break;
+ z.push(t);
+ }
+ }
+ if (z.length * 2 < n) z = d3Array.ticks(u, v, n);
+ } else {
+ z = d3Array.ticks(i, j, Math.min(j - i, n)).map(pows);
+ }
+ return r ? z.reverse() : z;
+ };
+
+ scale.tickFormat = (count, specifier) => {
+ if (count == null) count = 10;
+ if (specifier == null) specifier = base === 10 ? "s" : ",";
+ if (typeof specifier !== "function") {
+ if (!(base % 1) && (specifier = d3Format.formatSpecifier(specifier)).precision == null) specifier.trim = true;
+ specifier = d3Format.format(specifier);
+ }
+ if (count === Infinity) return specifier;
+ const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?
+ return d => {
+ let i = d / pows(Math.round(logs(d)));
+ if (i * base < base - 0.5) i *= base;
+ return i <= k ? specifier(d) : "";
+ };
+ };
+
+ scale.nice = () => {
+ return domain(nice(domain(), {
+ floor: x => pows(Math.floor(logs(x))),
+ ceil: x => pows(Math.ceil(logs(x)))
+ }));
+ };
+
+ return scale;
+}
+
+function log() {
+ const scale = loggish(transformer$2()).domain([1, 10]);
+ scale.copy = () => copy$1(scale, log()).base(scale.base());
+ initRange.apply(scale, arguments);
+ return scale;
+}
+
+function transformSymlog(c) {
+ return function(x) {
+ return Math.sign(x) * Math.log1p(Math.abs(x / c));
+ };
+}
+
+function transformSymexp(c) {
+ return function(x) {
+ return Math.sign(x) * Math.expm1(Math.abs(x)) * c;
+ };
+}
+
+function symlogish(transform) {
+ var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));
+
+ scale.constant = function(_) {
+ return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;
+ };
+
+ return linearish(scale);
+}
+
+function symlog() {
+ var scale = symlogish(transformer$2());
+
+ scale.copy = function() {
+ return copy$1(scale, symlog()).constant(scale.constant());
+ };
+
+ return initRange.apply(scale, arguments);
+}
+
+function transformPow(exponent) {
+ return function(x) {
+ return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
+ };
+}
+
+function transformSqrt(x) {
+ return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);
+}
+
+function transformSquare(x) {
+ return x < 0 ? -x * x : x * x;
+}
+
+function powish(transform) {
+ var scale = transform(identity$1, identity$1),
+ exponent = 1;
+
+ function rescale() {
+ return exponent === 1 ? transform(identity$1, identity$1)
+ : exponent === 0.5 ? transform(transformSqrt, transformSquare)
+ : transform(transformPow(exponent), transformPow(1 / exponent));
+ }
+
+ scale.exponent = function(_) {
+ return arguments.length ? (exponent = +_, rescale()) : exponent;
+ };
+
+ return linearish(scale);
+}
+
+function pow() {
+ var scale = powish(transformer$2());
+
+ scale.copy = function() {
+ return copy$1(scale, pow()).exponent(scale.exponent());
+ };
+
+ initRange.apply(scale, arguments);
+
+ return scale;
+}
+
+function sqrt() {
+ return pow.apply(null, arguments).exponent(0.5);
+}
+
+function square(x) {
+ return Math.sign(x) * x * x;
+}
+
+function unsquare(x) {
+ return Math.sign(x) * Math.sqrt(Math.abs(x));
+}
+
+function radial() {
+ var squared = continuous(),
+ range = [0, 1],
+ round = false,
+ unknown;
+
+ function scale(x) {
+ var y = unsquare(squared(x));
+ return isNaN(y) ? unknown : round ? Math.round(y) : y;
+ }
+
+ scale.invert = function(y) {
+ return squared.invert(square(y));
+ };
+
+ scale.domain = function(_) {
+ return arguments.length ? (squared.domain(_), scale) : squared.domain();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (squared.range((range = Array.from(_, number$1)).map(square)), scale) : range.slice();
+ };
+
+ scale.rangeRound = function(_) {
+ return scale.range(_).round(true);
+ };
+
+ scale.round = function(_) {
+ return arguments.length ? (round = !!_, scale) : round;
+ };
+
+ scale.clamp = function(_) {
+ return arguments.length ? (squared.clamp(_), scale) : squared.clamp();
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.copy = function() {
+ return radial(squared.domain(), range)
+ .round(round)
+ .clamp(squared.clamp())
+ .unknown(unknown);
+ };
+
+ initRange.apply(scale, arguments);
+
+ return linearish(scale);
+}
+
+function quantile() {
+ var domain = [],
+ range = [],
+ thresholds = [],
+ unknown;
+
+ function rescale() {
+ var i = 0, n = Math.max(1, range.length);
+ thresholds = new Array(n - 1);
+ while (++i < n) thresholds[i - 1] = d3Array.quantileSorted(domain, i / n);
+ return scale;
+ }
+
+ function scale(x) {
+ return x == null || isNaN(x = +x) ? unknown : range[d3Array.bisect(thresholds, x)];
+ }
+
+ scale.invertExtent = function(y) {
+ var i = range.indexOf(y);
+ return i < 0 ? [NaN, NaN] : [
+ i > 0 ? thresholds[i - 1] : domain[0],
+ i < thresholds.length ? thresholds[i] : domain[domain.length - 1]
+ ];
+ };
+
+ scale.domain = function(_) {
+ if (!arguments.length) return domain.slice();
+ domain = [];
+ for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);
+ domain.sort(d3Array.ascending);
+ return rescale();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.quantiles = function() {
+ return thresholds.slice();
+ };
+
+ scale.copy = function() {
+ return quantile()
+ .domain(domain)
+ .range(range)
+ .unknown(unknown);
+ };
+
+ return initRange.apply(scale, arguments);
+}
+
+function quantize() {
+ var x0 = 0,
+ x1 = 1,
+ n = 1,
+ domain = [0.5],
+ range = [0, 1],
+ unknown;
+
+ function scale(x) {
+ return x != null && x <= x ? range[d3Array.bisect(domain, x, 0, n)] : unknown;
+ }
+
+ function rescale() {
+ var i = -1;
+ domain = new Array(n);
+ while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);
+ return scale;
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();
+ };
+
+ scale.invertExtent = function(y) {
+ var i = range.indexOf(y);
+ return i < 0 ? [NaN, NaN]
+ : i < 1 ? [x0, domain[0]]
+ : i >= n ? [domain[n - 1], x1]
+ : [domain[i - 1], domain[i]];
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : scale;
+ };
+
+ scale.thresholds = function() {
+ return domain.slice();
+ };
+
+ scale.copy = function() {
+ return quantize()
+ .domain([x0, x1])
+ .range(range)
+ .unknown(unknown);
+ };
+
+ return initRange.apply(linearish(scale), arguments);
+}
+
+function threshold() {
+ var domain = [0.5],
+ range = [0, 1],
+ unknown,
+ n = 1;
+
+ function scale(x) {
+ return x != null && x <= x ? range[d3Array.bisect(domain, x, 0, n)] : unknown;
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();
+ };
+
+ scale.invertExtent = function(y) {
+ var i = range.indexOf(y);
+ return [domain[i - 1], domain[i]];
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.copy = function() {
+ return threshold()
+ .domain(domain)
+ .range(range)
+ .unknown(unknown);
+ };
+
+ return initRange.apply(scale, arguments);
+}
+
+function date(t) {
+ return new Date(t);
+}
+
+function number(t) {
+ return t instanceof Date ? +t : +new Date(+t);
+}
+
+function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {
+ var scale = continuous(),
+ invert = scale.invert,
+ domain = scale.domain;
+
+ var formatMillisecond = format(".%L"),
+ formatSecond = format(":%S"),
+ formatMinute = format("%I:%M"),
+ formatHour = format("%I %p"),
+ formatDay = format("%a %d"),
+ formatWeek = format("%b %d"),
+ formatMonth = format("%B"),
+ formatYear = format("%Y");
+
+ function tickFormat(date) {
+ return (second(date) < date ? formatMillisecond
+ : minute(date) < date ? formatSecond
+ : hour(date) < date ? formatMinute
+ : day(date) < date ? formatHour
+ : month(date) < date ? (week(date) < date ? formatDay : formatWeek)
+ : year(date) < date ? formatMonth
+ : formatYear)(date);
+ }
+
+ scale.invert = function(y) {
+ return new Date(invert(y));
+ };
+
+ scale.domain = function(_) {
+ return arguments.length ? domain(Array.from(_, number)) : domain().map(date);
+ };
+
+ scale.ticks = function(interval) {
+ var d = domain();
+ return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);
+ };
+
+ scale.tickFormat = function(count, specifier) {
+ return specifier == null ? tickFormat : format(specifier);
+ };
+
+ scale.nice = function(interval) {
+ var d = domain();
+ if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);
+ return interval ? domain(nice(d, interval)) : scale;
+ };
+
+ scale.copy = function() {
+ return copy$1(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));
+ };
+
+ return scale;
+}
+
+function time() {
+ return initRange.apply(calendar(d3Time.timeTicks, d3Time.timeTickInterval, d3Time.timeYear, d3Time.timeMonth, d3Time.timeWeek, d3Time.timeDay, d3Time.timeHour, d3Time.timeMinute, d3Time.timeSecond, d3TimeFormat.timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);
+}
+
+function utcTime() {
+ return initRange.apply(calendar(d3Time.utcTicks, d3Time.utcTickInterval, d3Time.utcYear, d3Time.utcMonth, d3Time.utcWeek, d3Time.utcDay, d3Time.utcHour, d3Time.utcMinute, d3Time.utcSecond, d3TimeFormat.utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);
+}
+
+function transformer$1() {
+ var x0 = 0,
+ x1 = 1,
+ t0,
+ t1,
+ k10,
+ transform,
+ interpolator = identity$1,
+ clamp = false,
+ unknown;
+
+ function scale(x) {
+ return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];
+ };
+
+ scale.clamp = function(_) {
+ return arguments.length ? (clamp = !!_, scale) : clamp;
+ };
+
+ scale.interpolator = function(_) {
+ return arguments.length ? (interpolator = _, scale) : interpolator;
+ };
+
+ function range(interpolate) {
+ return function(_) {
+ var r0, r1;
+ return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];
+ };
+ }
+
+ scale.range = range(d3Interpolate.interpolate);
+
+ scale.rangeRound = range(d3Interpolate.interpolateRound);
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ return function(t) {
+ transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);
+ return scale;
+ };
+}
+
+function copy(source, target) {
+ return target
+ .domain(source.domain())
+ .interpolator(source.interpolator())
+ .clamp(source.clamp())
+ .unknown(source.unknown());
+}
+
+function sequential() {
+ var scale = linearish(transformer$1()(identity$1));
+
+ scale.copy = function() {
+ return copy(scale, sequential());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function sequentialLog() {
+ var scale = loggish(transformer$1()).domain([1, 10]);
+
+ scale.copy = function() {
+ return copy(scale, sequentialLog()).base(scale.base());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function sequentialSymlog() {
+ var scale = symlogish(transformer$1());
+
+ scale.copy = function() {
+ return copy(scale, sequentialSymlog()).constant(scale.constant());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function sequentialPow() {
+ var scale = powish(transformer$1());
+
+ scale.copy = function() {
+ return copy(scale, sequentialPow()).exponent(scale.exponent());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function sequentialSqrt() {
+ return sequentialPow.apply(null, arguments).exponent(0.5);
+}
+
+function sequentialQuantile() {
+ var domain = [],
+ interpolator = identity$1;
+
+ function scale(x) {
+ if (x != null && !isNaN(x = +x)) return interpolator((d3Array.bisect(domain, x, 1) - 1) / (domain.length - 1));
+ }
+
+ scale.domain = function(_) {
+ if (!arguments.length) return domain.slice();
+ domain = [];
+ for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);
+ domain.sort(d3Array.ascending);
+ return scale;
+ };
+
+ scale.interpolator = function(_) {
+ return arguments.length ? (interpolator = _, scale) : interpolator;
+ };
+
+ scale.range = function() {
+ return domain.map((d, i) => interpolator(i / (domain.length - 1)));
+ };
+
+ scale.quantiles = function(n) {
+ return Array.from({length: n + 1}, (_, i) => d3Array.quantile(domain, i / n));
+ };
+
+ scale.copy = function() {
+ return sequentialQuantile(interpolator).domain(domain);
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function transformer() {
+ var x0 = 0,
+ x1 = 0.5,
+ x2 = 1,
+ s = 1,
+ t0,
+ t1,
+ t2,
+ k10,
+ k21,
+ interpolator = identity$1,
+ transform,
+ clamp = false,
+ unknown;
+
+ function scale(x) {
+ return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];
+ };
+
+ scale.clamp = function(_) {
+ return arguments.length ? (clamp = !!_, scale) : clamp;
+ };
+
+ scale.interpolator = function(_) {
+ return arguments.length ? (interpolator = _, scale) : interpolator;
+ };
+
+ function range(interpolate) {
+ return function(_) {
+ var r0, r1, r2;
+ return arguments.length ? ([r0, r1, r2] = _, interpolator = d3Interpolate.piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];
+ };
+ }
+
+ scale.range = range(d3Interpolate.interpolate);
+
+ scale.rangeRound = range(d3Interpolate.interpolateRound);
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ return function(t) {
+ transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;
+ return scale;
+ };
+}
+
+function diverging() {
+ var scale = linearish(transformer()(identity$1));
+
+ scale.copy = function() {
+ return copy(scale, diverging());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function divergingLog() {
+ var scale = loggish(transformer()).domain([0.1, 1, 10]);
+
+ scale.copy = function() {
+ return copy(scale, divergingLog()).base(scale.base());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function divergingSymlog() {
+ var scale = symlogish(transformer());
+
+ scale.copy = function() {
+ return copy(scale, divergingSymlog()).constant(scale.constant());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function divergingPow() {
+ var scale = powish(transformer());
+
+ scale.copy = function() {
+ return copy(scale, divergingPow()).exponent(scale.exponent());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function divergingSqrt() {
+ return divergingPow.apply(null, arguments).exponent(0.5);
+}
+
+exports.scaleBand = band;
+exports.scaleDiverging = diverging;
+exports.scaleDivergingLog = divergingLog;
+exports.scaleDivergingPow = divergingPow;
+exports.scaleDivergingSqrt = divergingSqrt;
+exports.scaleDivergingSymlog = divergingSymlog;
+exports.scaleIdentity = identity;
+exports.scaleImplicit = implicit;
+exports.scaleLinear = linear;
+exports.scaleLog = log;
+exports.scaleOrdinal = ordinal;
+exports.scalePoint = point;
+exports.scalePow = pow;
+exports.scaleQuantile = quantile;
+exports.scaleQuantize = quantize;
+exports.scaleRadial = radial;
+exports.scaleSequential = sequential;
+exports.scaleSequentialLog = sequentialLog;
+exports.scaleSequentialPow = sequentialPow;
+exports.scaleSequentialQuantile = sequentialQuantile;
+exports.scaleSequentialSqrt = sequentialSqrt;
+exports.scaleSequentialSymlog = sequentialSymlog;
+exports.scaleSqrt = sqrt;
+exports.scaleSymlog = symlog;
+exports.scaleThreshold = threshold;
+exports.scaleTime = time;
+exports.scaleUtc = utcTime;
+exports.tickFormat = tickFormat;
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+}));
diff --git a/node_modules/d3-scale/dist/d3-scale.min.js b/node_modules/d3-scale/dist/d3-scale.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..1612ea9f7e4e5b96b134093520cb7903073c71f1
--- /dev/null
+++ b/node_modules/d3-scale/dist/d3-scale.min.js
@@ -0,0 +1,2 @@
+// https://d3js.org/d3-scale/ v4.0.2 Copyright 2010-2021 Mike Bostock
+!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-array"),require("d3-interpolate"),require("d3-format"),require("d3-time"),require("d3-time-format")):"function"==typeof define&&define.amd?define(["exports","d3-array","d3-interpolate","d3-format","d3-time","d3-time-format"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).d3=n.d3||{},n.d3,n.d3,n.d3,n.d3,n.d3)}(this,(function(n,t,r,e,u,i){"use strict";function o(n,t){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(t).domain(n)}return this}function a(n,t){switch(arguments.length){case 0:break;case 1:"function"==typeof n?this.interpolator(n):this.range(n);break;default:this.domain(n),"function"==typeof t?this.interpolator(t):this.range(t)}return this}const c=Symbol("implicit");function l(){var n=new t.InternMap,r=[],e=[],u=c;function i(t){let i=n.get(t);if(void 0===i){if(u!==c)return u;n.set(t,i=r.push(t)-1)}return e[i%e.length]}return i.domain=function(e){if(!arguments.length)return r.slice();r=[],n=new t.InternMap;for(const t of e)n.has(t)||n.set(t,r.push(t)-1);return i},i.range=function(n){return arguments.length?(e=Array.from(n),i):e.slice()},i.unknown=function(n){return arguments.length?(u=n,i):u},i.copy=function(){return l(r,e).unknown(u)},o.apply(i,arguments),i}function f(){var n,r,e=l().unknown(void 0),u=e.domain,i=e.range,a=0,c=1,s=!1,p=0,h=0,g=.5;function m(){var e=u().length,o=ct&&(r=n,n=t,t=r),f=function(r){return Math.max(n,Math.min(t,r))}),u=e>2?y:d,i=o=null,m}function m(t){return null==t||isNaN(t=+t)?e:(i||(i=u(a.map(n),c,l)))(n(f(t)))}return m.invert=function(e){return f(t((o||(o=u(c,a.map(n),r.interpolateNumber)))(e)))},m.domain=function(n){return arguments.length?(a=Array.from(n,p),s()):a.slice()},m.range=function(n){return arguments.length?(c=Array.from(n),s()):c.slice()},m.rangeRound=function(n){return c=Array.from(n),l=r.interpolateRound,s()},m.clamp=function(n){return arguments.length?(f=!!n||g,s()):f!==g},m.interpolate=function(n){return arguments.length?(l=n,s()):l},m.unknown=function(n){return arguments.length?(e=n,m):e},function(r,e){return n=r,t=e,s()}}function k(){return M()(g,g)}function w(n,r,u,i){var o,a=t.tickStep(n,r,u);switch((i=e.formatSpecifier(null==i?",f":i)).type){case"s":var c=Math.max(Math.abs(n),Math.abs(r));return null!=i.precision||isNaN(o=e.precisionPrefix(a,c))||(i.precision=o),e.formatPrefix(i,c);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=e.precisionRound(a,Math.max(Math.abs(n),Math.abs(r))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=e.precisionFixed(a))||(i.precision=o-2*("%"===i.type))}return e.format(i)}function N(n){var r=n.domain;return n.ticks=function(n){var e=r();return t.ticks(e[0],e[e.length-1],null==n?10:n)},n.tickFormat=function(n,t){var e=r();return w(e[0],e[e.length-1],null==n?10:n,t)},n.nice=function(e){null==e&&(e=10);var u,i,o=r(),a=0,c=o.length-1,l=o[a],f=o[c],s=10;for(f0;){if((i=t.tickIncrement(l,f,e))===u)return o[a]=l,o[c]=f,r(o);if(i>0)l=Math.floor(l/i)*i,f=Math.ceil(f/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,f=Math.floor(f*i)/i}u=i}return n},n}function b(n,t){var r,e=0,u=(n=n.slice()).length-1,i=n[e],o=n[u];return o-n(-t,r)}function R(n){const r=n(x,q),u=r.domain;let i,o,a=10;function c(){return i=function(n){return n===Math.E?Math.log:10===n&&Math.log10||2===n&&Math.log2||(n=Math.log(n),t=>Math.log(t)/n)}(a),o=function(n){return 10===n?D:n===Math.E?Math.exp:t=>Math.pow(n,t)}(a),u()[0]<0?(i=I(i),o=I(o),n(S,A)):n(x,q),r}return r.base=function(n){return arguments.length?(a=+n,c()):a},r.domain=function(n){return arguments.length?(u(n),c()):u()},r.ticks=n=>{const r=u();let e=r[0],c=r[r.length-1];const l=c0){for(;p<=h;++p)for(f=1;fc)break;m.push(s)}}else for(;p<=h;++p)for(f=a-1;f>=1;--f)if(s=p>0?f/o(-p):f*o(p),!(sc)break;m.push(s)}2*m.length{if(null==n&&(n=10),null==t&&(t=10===a?"s":","),"function"!=typeof t&&(a%1||null!=(t=e.formatSpecifier(t)).precision||(t.trim=!0),t=e.format(t)),n===1/0)return t;const u=Math.max(1,a*n/r.ticks().length);return n=>{let r=n/o(Math.round(i(n)));return r*au(b(u(),{floor:n=>o(Math.floor(i(n))),ceil:n=>o(Math.ceil(i(n)))})),r}function T(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function O(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function F(n){var t=1,r=n(T(t),O(t));return r.constant=function(r){return arguments.length?n(T(t=+r),O(t)):t},N(r)}function P(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function E(n){return n<0?-Math.sqrt(-n):Math.sqrt(n)}function L(n){return n<0?-n*n:n*n}function Q(n){var t=n(g,g),r=1;function e(){return 1===r?n(g,g):.5===r?n(E,L):n(P(r),P(1/r))}return t.exponent=function(n){return arguments.length?(r=+n,e()):r},N(t)}function U(){var n=Q(M());return n.copy=function(){return v(n,U()).exponent(n.exponent())},o.apply(n,arguments),n}function Y(n){return Math.sign(n)*n*n}function j(n){return Math.sign(n)*Math.sqrt(Math.abs(n))}function B(n){return new Date(n)}function C(n){return n instanceof Date?+n:+new Date(+n)}function H(n,t,r,e,u,i,o,a,c,l){var f=k(),s=f.invert,p=f.domain,h=l(".%L"),g=l(":%S"),m=l("%I:%M"),d=l("%I %p"),y=l("%a %d"),M=l("%b %d"),w=l("%B"),N=l("%Y");function x(n){return(c(n)v(t,n()).base(t.base()),o.apply(t,arguments),t},n.scaleOrdinal=l,n.scalePoint=function(){return s(f.apply(null,arguments).paddingInner(1))},n.scalePow=U,n.scaleQuantile=function n(){var r,e=[],u=[],i=[];function a(){var n=0,r=Math.max(1,u.length);for(i=new Array(r-1);++n0?i[t-1]:e[0],t=i?[a[i-1],u]:[a[t-1],a[t]]},l.unknown=function(n){return arguments.length?(r=n,l):l},l.thresholds=function(){return a.slice()},l.copy=function(){return n().domain([e,u]).range(c).unknown(r)},o.apply(N(l),arguments)},n.scaleRadial=function n(){var t,r=k(),e=[0,1],u=!1;function i(n){var e=j(r(n));return isNaN(e)?t:u?Math.round(e):e}return i.invert=function(n){return r.invert(Y(n))},i.domain=function(n){return arguments.length?(r.domain(n),i):r.domain()},i.range=function(n){return arguments.length?(r.range((e=Array.from(n,p)).map(Y)),i):e.slice()},i.rangeRound=function(n){return i.range(n).round(!0)},i.round=function(n){return arguments.length?(u=!!n,i):u},i.clamp=function(n){return arguments.length?(r.clamp(n),i):r.clamp()},i.unknown=function(n){return arguments.length?(t=n,i):t},i.copy=function(){return n(r.domain(),e).round(u).clamp(r.clamp()).unknown(t)},o.apply(i,arguments),N(i)},n.scaleSequential=function n(){var t=N(W()(g));return t.copy=function(){return _(t,n())},a.apply(t,arguments)},n.scaleSequentialLog=function n(){var t=R(W()).domain([1,10]);return t.copy=function(){return _(t,n()).base(t.base())},a.apply(t,arguments)},n.scaleSequentialPow=z,n.scaleSequentialQuantile=function n(){var r=[],e=g;function u(n){if(null!=n&&!isNaN(n=+n))return e((t.bisect(r,n,1)-1)/(r.length-1))}return u.domain=function(n){if(!arguments.length)return r.slice();r=[];for(let t of n)null==t||isNaN(t=+t)||r.push(t);return r.sort(t.ascending),u},u.interpolator=function(n){return arguments.length?(e=n,u):e},u.range=function(){return r.map(((n,t)=>e(t/(r.length-1))))},u.quantiles=function(n){return Array.from({length:n+1},((e,u)=>t.quantile(r,u/n)))},u.copy=function(){return n(e).domain(r)},a.apply(u,arguments)},n.scaleSequentialSqrt=function(){return z.apply(null,arguments).exponent(.5)},n.scaleSequentialSymlog=function n(){var t=F(W());return t.copy=function(){return _(t,n()).constant(t.constant())},a.apply(t,arguments)},n.scaleSqrt=function(){return U.apply(null,arguments).exponent(.5)},n.scaleSymlog=function n(){var t=F(M());return t.copy=function(){return v(t,n()).constant(t.constant())},o.apply(t,arguments)},n.scaleThreshold=function n(){var r,e=[.5],u=[0,1],i=1;function a(n){return null!=n&&n<=n?u[t.bisect(e,n,0,i)]:r}return a.domain=function(n){return arguments.length?(e=Array.from(n),i=Math.min(e.length,u.length-1),a):e.slice()},a.range=function(n){return arguments.length?(u=Array.from(n),i=Math.min(e.length,u.length-1),a):u.slice()},a.invertExtent=function(n){var t=u.indexOf(n);return[e[t-1],e[t]]},a.unknown=function(n){return arguments.length?(r=n,a):r},a.copy=function(){return n().domain(e).range(u).unknown(r)},o.apply(a,arguments)},n.scaleTime=function(){return o.apply(H(u.timeTicks,u.timeTickInterval,u.timeYear,u.timeMonth,u.timeWeek,u.timeDay,u.timeHour,u.timeMinute,u.timeSecond,i.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},n.scaleUtc=function(){return o.apply(H(u.utcTicks,u.utcTickInterval,u.utcYear,u.utcMonth,u.utcWeek,u.utcDay,u.utcHour,u.utcMinute,u.utcSecond,i.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},n.tickFormat=w,Object.defineProperty(n,"__esModule",{value:!0})}));
diff --git a/node_modules/d3-scale/node_modules/d3-array/LICENSE b/node_modules/d3-scale/node_modules/d3-array/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..3594fffaf63c7a0dddc35ff82b781e224230bea1
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2010-2023 Mike Bostock
+
+Permission to use, copy, modify, and/or distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright notice
+and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
diff --git a/node_modules/d3-scale/node_modules/d3-array/README.md b/node_modules/d3-scale/node_modules/d3-array/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..84fb28f3b75dca5f099445d4891729f58cc8c180
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/README.md
@@ -0,0 +1,954 @@
+# d3-array
+
+Data in JavaScript is often represented by an iterable (such as an [array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array), [set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set) or [generator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator)), and so iterable manipulation is a common task when analyzing or visualizing data. For example, you might take a contiguous slice (subset) of an array, filter an array using a predicate function, or map an array to a parallel set of values using a transform function. Before looking at the methods that d3-array provides, familiarize yourself with the powerful [array methods built-in to JavaScript](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array).
+
+JavaScript includes **mutation methods** that modify the array:
+
+* [*array*.pop](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) - Remove the last element from the array.
+* [*array*.push](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/push) - Add one or more elements to the end of the array.
+* [*array*.reverse](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) - Reverse the order of the elements of the array.
+* [*array*.shift](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) - Remove the first element from the array.
+* [*array*.sort](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) - Sort the elements of the array.
+* [*array*.splice](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) - Add or remove elements from the array.
+* [*array*.unshift](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) - Add one or more elements to the front of the array.
+
+There are also **access methods** that return some representation of the array:
+
+* [*array*.concat](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) - Join the array with other array(s) or value(s).
+* [*array*.join](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/join) - Join all elements of the array into a string.
+* [*array*.slice](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) - Extract a section of the array.
+* [*array*.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) - Find the first occurrence of a value within the array.
+* [*array*.lastIndexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) - Find the last occurrence of a value within the array.
+
+And finally **iteration methods** that apply functions to elements in the array:
+
+* [*array*.filter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) - Create a new array with only the elements for which a predicate is true.
+* [*array*.forEach](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) - Call a function for each element in the array.
+* [*array*.every](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/every) - See if every element in the array satisfies a predicate.
+* [*array*.map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/map) - Create a new array with the result of calling a function on every element in the array.
+* [*array*.some](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/some) - See if at least one element in the array satisfies a predicate.
+* [*array*.reduce](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) - Apply a function to reduce the array to a single value (from left-to-right).
+* [*array*.reduceRight](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight) - Apply a function to reduce the array to a single value (from right-to-left).
+
+## Installing
+
+If you use npm, `npm install d3-array`. You can also download the [latest release on GitHub](https://github.com/d3/d3-array/releases/latest). For vanilla HTML in modern browsers, import d3-array from jsDelivr:
+
+```html
+
+```
+
+For legacy environments, you can load d3-array’s UMD bundle; a `d3` global is exported:
+
+```html
+
+
+```
+
+## API Reference
+
+* [Statistics](#statistics)
+* [Search](#search)
+* [Transformations](#transformations)
+* [Iterables](#iterables)
+* [Sets](#sets)
+* [Bins](#bins)
+* [Interning](#interning)
+
+### Statistics
+
+Methods for computing basic summary statistics.
+
+# d3.min(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/min.js), [Examples](https://observablehq.com/@d3/d3-extent)
+
+Returns the minimum value in the given *iterable* using natural order. If the iterable contains no comparable values, returns undefined. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the minimum value.
+
+Unlike the built-in [Math.min](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math/min), this method ignores undefined, null and NaN values; this is useful for ignoring missing data. In addition, elements are compared using natural order rather than numeric order. For example, the minimum of the strings [“20”, “3”] is “20”, while the minimum of the numbers [20, 3] is 3.
+
+See also [extent](#extent).
+
+# d3.minIndex(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/minIndex.js), [Examples](https://observablehq.com/@d3/d3-extent)
+
+Returns the index of the minimum value in the given *iterable* using natural order. If the iterable contains no comparable values, returns -1. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the minimum value.
+
+Unlike the built-in [Math.min](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math/min), this method ignores undefined, null and NaN values; this is useful for ignoring missing data. In addition, elements are compared using natural order rather than numeric order. For example, the minimum of the strings [“20”, “3”] is “20”, while the minimum of the numbers [20, 3] is 3.
+
+# d3.max(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/max.js), [Examples](https://observablehq.com/@d3/d3-extent)
+
+Returns the maximum value in the given *iterable* using natural order. If the iterable contains no comparable values, returns undefined. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the maximum value.
+
+Unlike the built-in [Math.max](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math/max), this method ignores undefined values; this is useful for ignoring missing data. In addition, elements are compared using natural order rather than numeric order. For example, the maximum of the strings [“20”, “3”] is “3”, while the maximum of the numbers [20, 3] is 20.
+
+See also [extent](#extent).
+
+# d3.maxIndex(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/maxIndex.js), [Examples](https://observablehq.com/@d3/d3-extent)
+
+Returns the index of the maximum value in the given *iterable* using natural order. If the iterable contains no comparable values, returns -1. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the maximum value.
+
+Unlike the built-in [Math.max](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math/max), this method ignores undefined values; this is useful for ignoring missing data. In addition, elements are compared using natural order rather than numeric order. For example, the maximum of the strings [“20”, “3”] is “3”, while the maximum of the numbers [20, 3] is 20.
+
+# d3.extent(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/extent.js), [Examples](https://observablehq.com/@d3/d3-extent)
+
+Returns the [minimum](#min) and [maximum](#max) value in the given *iterable* using natural order. If the iterable contains no comparable values, returns [undefined, undefined]. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the extent.
+
+# d3.mode(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/mode.js), [Examples](https://observablehq.com/@d3/d3-mode)
+
+Returns the mode of the given *iterable*, *i.e.* the value which appears the most often. In case of equality, returns the first of the relevant values. If the iterable contains no comparable values, returns undefined. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the mode. This method ignores undefined, null and NaN values; this is useful for ignoring missing data.
+
+# d3.sum(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/sum.js), [Examples](https://observablehq.com/@d3/d3-sum)
+
+Returns the sum of the given *iterable* of numbers. If the iterable contains no numbers, returns 0. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the sum. This method ignores undefined and NaN values; this is useful for ignoring missing data.
+
+# d3.mean(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/mean.js), [Examples](https://observablehq.com/@d3/d3-mean-d3-median-and-friends)
+
+Returns the mean of the given *iterable* of numbers. If the iterable contains no numbers, returns undefined. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the mean. This method ignores undefined and NaN values; this is useful for ignoring missing data.
+
+# d3.median(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/median.js), [Examples](https://observablehq.com/@d3/d3-mean-d3-median-and-friends)
+
+Returns the median of the given *iterable* of numbers using the [R-7 method](https://en.wikipedia.org/wiki/Quantile#Estimating_quantiles_from_a_sample). If the iterable contains no numbers, returns undefined. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the median. This method ignores undefined and NaN values; this is useful for ignoring missing data.
+
+# d3.medianIndex(array[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/median.js)
+
+Similar to *median*, but returns the index of the element to the left of the median.
+
+# d3.cumsum(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/cumsum.js), [Examples](https://observablehq.com/@d3/d3-cumsum)
+
+Returns the cumulative sum of the given *iterable* of numbers, as a Float64Array of the same length. If the iterable contains no numbers, returns zeros. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the cumulative sum. This method ignores undefined and NaN values; this is useful for ignoring missing data.
+
+# d3.quantile(iterable, p[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/quantile.js), [Examples](https://observablehq.com/@d3/d3-mean-d3-median-and-friends)
+
+Returns the *p*-quantile of the given *iterable* of numbers, where *p* is a number in the range [0, 1]. For example, the median can be computed using *p* = 0.5, the first quartile at *p* = 0.25, and the third quartile at *p* = 0.75. This particular implementation uses the [R-7 method](http://en.wikipedia.org/wiki/Quantile#Quantiles_of_a_population), which is the default for the R programming language and Excel. For example:
+
+```js
+var a = [0, 10, 30];
+d3.quantile(a, 0); // 0
+d3.quantile(a, 0.5); // 10
+d3.quantile(a, 1); // 30
+d3.quantile(a, 0.25); // 5
+d3.quantile(a, 0.75); // 20
+d3.quantile(a, 0.1); // 2
+```
+
+An optional *accessor* function may be specified, which is equivalent to calling *array*.map(*accessor*) before computing the quantile.
+
+# d3.quantileIndex(array, p[, accessor]) [Source](https://github.com/d3/d3-array/blob/main/src/quantile.js "Source")
+
+Similar to *quantile*, but returns the index to the left of *p*.
+
+# d3.quantileSorted(array, p[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/quantile.js), [Examples](https://observablehq.com/@d3/d3-mean-d3-median-and-friends)
+
+Similar to *quantile*, but expects the input to be a **sorted** *array* of values. In contrast with *quantile*, the accessor is only called on the elements needed to compute the quantile.
+
+# d3.rank(iterable[, comparator]) · [Source](https://github.com/d3/d3-array/blob/main/src/rank.js), [Examples](https://observablehq.com/@d3/rank)
+ # d3.rank(iterable[, accessor])
+
+Returns an array with the rank of each value in the *iterable*, *i.e.* the zero-based index of the value when the iterable is sorted. Nullish values are sorted to the end and ranked NaN. An optional *comparator* or *accessor* function may be specified; the latter is equivalent to calling *array*.map(*accessor*) before computing the ranks. If *comparator* is not specified, it defaults to [ascending](#ascending). Ties (equivalent values) all get the same rank, defined as the first time the value is found.
+
+```js
+d3.rank([{x: 1}, {}, {x: 2}, {x: 0}], d => d.x); // [1, NaN, 2, 0]
+d3.rank(["b", "c", "b", "a"]); // [1, 3, 1, 0]
+d3.rank([1, 2, 3], d3.descending); // [2, 1, 0]
+```
+
+# d3.variance(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/variance.js), [Examples](https://observablehq.com/@d3/d3-mean-d3-median-and-friends)
+
+Returns an [unbiased estimator of the population variance](http://mathworld.wolfram.com/SampleVariance.html) of the given *iterable* of numbers using [Welford’s algorithm](https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm). If the iterable has fewer than two numbers, returns undefined. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the variance. This method ignores undefined and NaN values; this is useful for ignoring missing data.
+
+# d3.deviation(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/deviation.js), [Examples](https://observablehq.com/@d3/d3-mean-d3-median-and-friends)
+
+Returns the standard deviation, defined as the square root of the [bias-corrected variance](#variance), of the given *iterable* of numbers. If the iterable has fewer than two numbers, returns undefined. An optional *accessor* function may be specified, which is equivalent to calling Array.from before computing the standard deviation. This method ignores undefined and NaN values; this is useful for ignoring missing data.
+
+# d3.fsum([values][, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/fsum.js), [Examples](https://observablehq.com/@d3/d3-fsum)
+
+Returns a full precision summation of the given *values*.
+
+```js
+d3.fsum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]); // 1
+d3.sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]); // 0.9999999999999999
+```
+
+Although slower, d3.fsum can replace d3.sum wherever greater precision is needed. Uses d3.Adder.
+
+# d3.fcumsum([values][, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/fsum.js), [Examples](https://observablehq.com/@d3/d3-fcumsum)
+
+Returns a full precision cumulative sum of the given *values*.
+
+```js
+d3.fcumsum([1, 1e-14, -1]); // [1, 1.00000000000001, 1e-14]
+d3.cumsum([1, 1e-14, -1]); // [1, 1.00000000000001, 9.992e-15]
+```
+
+Although slower, d3.fcumsum can replace d3.cumsum when greater precision is needed. Uses d3.Adder.
+
+# new d3.Adder()
+
+Creates a full precision adder for [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754) floating point numbers, setting its initial value to 0.
+
+# *adder*.add(number)
+
+Adds the specified *number* to the adder’s current value and returns the adder.
+
+# *adder*.valueOf()
+
+Returns the IEEE 754 double precision representation of the adder’s current value. Most useful as the short-hand notation `+adder`.
+
+### Search
+
+Methods for searching arrays for a specific element.
+
+# d3.least(iterable[, comparator]) · [Source](https://github.com/d3/d3-array/blob/main/src/least.js), [Examples](https://observablehq.com/@d3/d3-least)
+ # d3.least(iterable[, accessor])
+
+Returns the least element of the specified *iterable* according to the specified *comparator* or *accessor*. If the given *iterable* contains no comparable elements (*i.e.*, the comparator returns NaN when comparing each element to itself), returns undefined. If *comparator* is not specified, it defaults to [ascending](#ascending). For example:
+
+```js
+const array = [{foo: 42}, {foo: 91}];
+d3.least(array, (a, b) => a.foo - b.foo); // {foo: 42}
+d3.least(array, (a, b) => b.foo - a.foo); // {foo: 91}
+d3.least(array, a => a.foo); // {foo: 42}
+```
+
+This function is similar to [min](#min), except it allows the use of a comparator rather than an accessor.
+
+# d3.leastIndex(iterable[, comparator]) · [Source](https://github.com/d3/d3-array/blob/main/src/leastIndex.js), [Examples](https://observablehq.com/@d3/d3-least)
+ # d3.leastIndex(iterable[, accessor])
+
+Returns the index of the least element of the specified *iterable* according to the specified *comparator* or *accessor*. If the given *iterable* contains no comparable elements (*i.e.*, the comparator returns NaN when comparing each element to itself), returns -1. If *comparator* is not specified, it defaults to [ascending](#ascending). For example:
+
+```js
+const array = [{foo: 42}, {foo: 91}];
+d3.leastIndex(array, (a, b) => a.foo - b.foo); // 0
+d3.leastIndex(array, (a, b) => b.foo - a.foo); // 1
+d3.leastIndex(array, a => a.foo); // 0
+```
+
+This function is similar to [minIndex](#minIndex), except it allows the use of a comparator rather than an accessor.
+
+# d3.greatest(iterable[, comparator]) · [Source](https://github.com/d3/d3-array/blob/main/src/greatest.js), [Examples](https://observablehq.com/@d3/d3-least)
+ # d3.greatest(iterable[, accessor])
+
+Returns the greatest element of the specified *iterable* according to the specified *comparator* or *accessor*. If the given *iterable* contains no comparable elements (*i.e.*, the comparator returns NaN when comparing each element to itself), returns undefined. If *comparator* is not specified, it defaults to [ascending](#ascending). For example:
+
+```js
+const array = [{foo: 42}, {foo: 91}];
+d3.greatest(array, (a, b) => a.foo - b.foo); // {foo: 91}
+d3.greatest(array, (a, b) => b.foo - a.foo); // {foo: 42}
+d3.greatest(array, a => a.foo); // {foo: 91}
+```
+
+This function is similar to [max](#max), except it allows the use of a comparator rather than an accessor.
+
+# d3.greatestIndex(iterable[, comparator]) · [Source](https://github.com/d3/d3-array/blob/main/src/greatestIndex.js), [Examples](https://observablehq.com/@d3/d3-least)
+ # d3.greatestIndex(iterable[, accessor])
+
+Returns the index of the greatest element of the specified *iterable* according to the specified *comparator* or *accessor*. If the given *iterable* contains no comparable elements (*i.e.*, the comparator returns NaN when comparing each element to itself), returns -1. If *comparator* is not specified, it defaults to [ascending](#ascending). For example:
+
+```js
+const array = [{foo: 42}, {foo: 91}];
+d3.greatestIndex(array, (a, b) => a.foo - b.foo); // 1
+d3.greatestIndex(array, (a, b) => b.foo - a.foo); // 0
+d3.greatestIndex(array, a => a.foo); // 1
+```
+
+This function is similar to [maxIndex](#maxIndex), except it allows the use of a comparator rather than an accessor.
+
+# d3.bisectLeft(array, x[, lo[, hi]]) · [Source](https://github.com/d3/d3-array/blob/main/src/bisect.js)
+
+Returns the insertion point for *x* in *array* to maintain sorted order. The arguments *lo* and *hi* may be used to specify a subset of the array which should be considered; by default the entire array is used. If *x* is already present in *array*, the insertion point will be before (to the left of) any existing entries. The return value is suitable for use as the first argument to [splice](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) assuming that *array* is already sorted. The returned insertion point *i* partitions the *array* into two halves so that all *v* < *x* for *v* in *array*.slice(*lo*, *i*) for the left side and all *v* >= *x* for *v* in *array*.slice(*i*, *hi*) for the right side.
+
+# d3.bisect(array, x[, lo[, hi]]) · [Source](https://github.com/d3/d3-array/blob/main/src/bisect.js), [Examples](https://observablehq.com/@d3/d3-bisect)
+ # d3.bisectRight(array, x[, lo[, hi]])
+
+Similar to [bisectLeft](#bisectLeft), but returns an insertion point which comes after (to the right of) any existing entries of *x* in *array*. The returned insertion point *i* partitions the *array* into two halves so that all *v* <= *x* for *v* in *array*.slice(*lo*, *i*) for the left side and all *v* > *x* for *v* in *array*.slice(*i*, *hi*) for the right side.
+
+# d3.bisectCenter(array, x[, lo[, hi]]) · [Source](https://github.com/d3/d3-array/blob/main/src/bisect.js), [Examples](https://observablehq.com/@d3/multi-line-chart)
+
+Returns the index of the value closest to *x* in the given *array* of numbers. The arguments *lo* (inclusive) and *hi* (exclusive) may be used to specify a subset of the array which should be considered; by default the entire array is used.
+
+See [*bisector*.center](#bisector_center).
+
+# d3.bisector(accessor) · [Source](https://github.com/d3/d3-array/blob/main/src/bisector.js)
+ # d3.bisector(comparator)
+
+Returns a new bisector using the specified *accessor* or *comparator* function. This method can be used to bisect arrays of objects instead of being limited to simple arrays of primitives. For example, given the following array of objects:
+
+```js
+var data = [
+ {date: new Date(2011, 1, 1), value: 0.5},
+ {date: new Date(2011, 2, 1), value: 0.6},
+ {date: new Date(2011, 3, 1), value: 0.7},
+ {date: new Date(2011, 4, 1), value: 0.8}
+];
+```
+
+A suitable bisect function could be constructed as:
+
+```js
+var bisectDate = d3.bisector(function(d) { return d.date; }).right;
+```
+
+This is equivalent to specifying a comparator:
+
+```js
+var bisectDate = d3.bisector(function(d, x) { return d.date - x; }).right;
+```
+
+And then applied as *bisectDate*(*array*, *date*), returning an index. Note that the comparator is always passed the search value *x* as the second argument. Use a comparator rather than an accessor if you want values to be sorted in an order different than natural order, such as in descending rather than ascending order.
+
+#bisector.left(array, x[, lo[, hi]]) · [Source](https://github.com/d3/d3-array/blob/main/src/bisector.js)
+
+Equivalent to [bisectLeft](#bisectLeft), but uses this bisector’s associated comparator.
+
+#bisector.right(array, x[, lo[, hi]]) · [Source](https://github.com/d3/d3-array/blob/main/src/bisector.js)
+
+Equivalent to [bisectRight](#bisectRight), but uses this bisector’s associated comparator.
+
+#bisector.center(array, x[, lo[, hi]]) · [Source](https://github.com/d3/d3-array/blob/main/src/bisector.js)
+
+Returns the index of the closest value to *x* in the given sorted *array*. This expects that the bisector’s associated accessor returns a quantitative value, or that the bisector’s associated comparator returns a signed distance; otherwise, this method is equivalent to *bisector*.left.
+
+# d3.quickselect(array, k, left = 0, right = array.length - 1, compare = ascending) · [Source](https://github.com/d3/d3-array/blob/main/src/quickselect.js), [Examples](https://observablehq.com/@d3/d3-quickselect)
+
+See [mourner/quickselect](https://github.com/mourner/quickselect/blob/master/README.md).
+
+# d3.ascending(a, b) · [Source](https://github.com/d3/d3-array/blob/main/src/ascending.js), [Examples](https://observablehq.com/@d3/d3-ascending)
+
+Returns -1 if *a* is less than *b*, or 1 if *a* is greater than *b*, or 0. This is the comparator function for natural order, and can be used in conjunction with the built-in [*array*.sort](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) method to arrange elements in ascending order. It is implemented as:
+
+```js
+function ascending(a, b) {
+ return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
+}
+```
+
+Note that if no comparator function is specified to the built-in sort method, the default order is lexicographic (alphabetical), not natural! This can lead to surprising behavior when sorting an array of numbers.
+
+# d3.descending(a, b) · [Source](https://github.com/d3/d3-array/blob/main/src/descending.js), [Examples](https://observablehq.com/@d3/d3-ascending)
+
+Returns -1 if *a* is greater than *b*, or 1 if *a* is less than *b*, or 0. This is the comparator function for reverse natural order, and can be used in conjunction with the built-in array sort method to arrange elements in descending order. It is implemented as:
+
+```js
+function descending(a, b) {
+ return a == null || b == null ? NaN : b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
+}
+```
+
+Note that if no comparator function is specified to the built-in sort method, the default order is lexicographic (alphabetical), not natural! This can lead to surprising behavior when sorting an array of numbers.
+
+### Transformations
+
+Methods for transforming arrays and for generating new arrays.
+
+# d3.group(iterable, ...keys) · [Source](https://github.com/d3/d3-array/blob/main/src/group.js), [Examples](https://observablehq.com/@d3/d3-group-d3-rollup)
+
+Groups the specified *iterable* of values into an [InternMap](#InternMap) from *key* to array of value. For example, given some data:
+
+```js
+data = [
+ {name: "jim", amount: "34.0", date: "11/12/2015"},
+ {name: "carl", amount: "120.11", date: "11/12/2015"},
+ {name: "stacy", amount: "12.01", date: "01/04/2016"},
+ {name: "stacy", amount: "34.05", date: "01/04/2016"}
+]
+```
+
+To group the data by name:
+
+```js
+d3.group(data, d => d.name)
+```
+
+This produces:
+
+```js
+Map(3) {
+ "jim" => Array(1)
+ "carl" => Array(1)
+ "stacy" => Array(2)
+}
+```
+
+If more than one *key* is specified, a nested InternMap is returned. For example:
+
+```js
+d3.group(data, d => d.name, d => d.date)
+```
+
+This produces:
+
+```js
+Map(3) {
+ "jim" => Map(1) {
+ "11/12/2015" => Array(1)
+ }
+ "carl" => Map(1) {
+ "11/12/2015" => Array(1)
+ }
+ "stacy" => Map(1) {
+ "01/04/2016" => Array(2)
+ }
+}
+```
+
+To convert a Map to an Array, use [Array.from](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from). For example:
+
+```js
+Array.from(d3.group(data, d => d.name))
+```
+
+This produces:
+
+```js
+[
+ ["jim", Array(1)],
+ ["carl", Array(1)],
+ ["stacy", Array(2)]
+]
+```
+
+You can also simultaneously convert the [*key*, *value*] to some other representation by passing a map function to Array.from:
+
+```js
+Array.from(d3.group(data, d => d.name), ([key, value]) => ({key, value}))
+```
+
+This produces:
+
+```js
+[
+ {key: "jim", value: Array(1)},
+ {key: "carl", value: Array(1)},
+ {key: "stacy", value: Array(2)}
+]
+```
+
+[*selection*.data](https://github.com/d3/d3-selection/blob/main/README.md#selection_data) accepts iterables directly, meaning that you can use a Map (or Set or other iterable) to perform a data join without first needing to convert to an array.
+
+# d3.groups(iterable, ...keys) · [Source](https://github.com/d3/d3-array/blob/main/src/group.js), [Examples](https://observablehq.com/@d3/d3-group-d3-rollup)
+
+Equivalent to [group](#group), but returns nested arrays instead of nested maps.
+
+# d3.flatGroup(iterable, ...keys) · [Source](https://github.com/d3/d3-array/blob/main/src/group.js), [Examples](https://observablehq.com/@d3/d3-flatgroup)
+
+Equivalent to [group](#group), but returns a flat array of [*key0*, *key1*, …, *values*] instead of nested maps.
+
+# d3.index(iterable, ...keys) · [Source](https://github.com/d3/d3-array/blob/main/src/group.js), [Examples](https://observablehq.com/@d3/d3-group)
+
+Equivalent to [group](#group) but returns a unique value per compound key instead of an array, throwing if the key is not unique.
+
+For example, given the data defined above,
+
+```js
+d3.index(data, d => d.amount)
+```
+
+returns
+
+```js
+Map(4) {
+ "34.0" => Object {name: "jim", amount: "34.0", date: "11/12/2015"}
+ "120.11" => Object {name: "carl", amount: "120.11", date: "11/12/2015"}
+ "12.01" => Object {name: "stacy", amount: "12.01", date: "01/04/2016"}
+ "34.05" => Object {name: "stacy", amount: "34.05", date: "01/04/2016"}
+}
+```
+
+On the other hand,
+
+```js
+d3.index(data, d => d.name)
+```
+
+throws an error because two objects share the same name.
+
+# d3.indexes(iterable, ...keys) · [Source](https://github.com/d3/d3-array/blob/main/src/group.js), [Examples](https://observablehq.com/@d3/d3-group)
+
+Equivalent to [index](#index), but returns nested arrays instead of nested maps.
+
+# d3.rollup(iterable, reduce, ...keys) · [Source](https://github.com/d3/d3-array/blob/main/src/group.js), [Examples](https://observablehq.com/@d3/d3-group-d3-rollup)
+
+[Groups](#group) and reduces the specified *iterable* of values into an InternMap from *key* to value. For example, given some data:
+
+```js
+data = [
+ {name: "jim", amount: "34.0", date: "11/12/2015"},
+ {name: "carl", amount: "120.11", date: "11/12/2015"},
+ {name: "stacy", amount: "12.01", date: "01/04/2016"},
+ {name: "stacy", amount: "34.05", date: "01/04/2016"}
+]
+```
+
+To count the number of elements by name:
+
+```js
+d3.rollup(data, v => v.length, d => d.name)
+```
+
+This produces:
+
+```js
+Map(3) {
+ "jim" => 1
+ "carl" => 1
+ "stacy" => 2
+}
+```
+
+If more than one *key* is specified, a nested Map is returned. For example:
+
+```js
+d3.rollup(data, v => v.length, d => d.name, d => d.date)
+```
+
+This produces:
+
+```js
+Map(3) {
+ "jim" => Map(1) {
+ "11/12/2015" => 1
+ }
+ "carl" => Map(1) {
+ "11/12/2015" => 1
+ }
+ "stacy" => Map(1) {
+ "01/04/2016" => 2
+ }
+}
+```
+
+To convert a Map to an Array, use [Array.from](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from). See [d3.group](#group) for examples.
+
+# d3.rollups(iterable, reduce, ...keys) · [Source](https://github.com/d3/d3-array/blob/main/src/group.js), [Examples](https://observablehq.com/@d3/d3-group-d3-rollup)
+
+Equivalent to [rollup](#rollup), but returns nested arrays instead of nested maps.
+
+# d3.flatRollup(iterable, reduce, ...keys) · [Source](https://github.com/d3/d3-array/blob/main/src/group.js), [Examples](https://observablehq.com/@d3/d3-flatgroup)
+
+Equivalent to [rollup](#rollup), but returns a flat array of [*key0*, *key1*, …, *value*] instead of nested maps.
+
+# d3.groupSort(iterable, comparator, key) · [Source](https://github.com/d3/d3-array/blob/main/src/groupSort.js), [Examples](https://observablehq.com/@d3/d3-groupsort)
+ # d3.groupSort(iterable, accessor, key)
+
+Groups the specified *iterable* of elements according to the specified *key* function, sorts the groups according to the specified *comparator*, and then returns an array of keys in sorted order. For example, if you had a table of barley yields for different varieties, sites, and years, to sort the barley varieties by ascending median yield:
+
+```js
+d3.groupSort(barley, g => d3.median(g, d => d.yield), d => d.variety)
+```
+
+For descending order, negate the group value:
+
+```js
+d3.groupSort(barley, g => -d3.median(g, d => d.yield), d => d.variety)
+```
+
+If a *comparator* is passed instead of an *accessor* (i.e., if the second argument is a function that takes exactly two arguments), it will be asked to compare two groups *a* and *b* and should return a negative value if *a* should be before *b*, a positive value if *a* should be after *b*, or zero for a partial ordering.
+
+# d3.count(iterable[, accessor]) · [Source](https://github.com/d3/d3-array/blob/main/src/count.js), [Examples](https://observablehq.com/@d3/d3-count)
+
+Returns the number of valid number values (*i.e.*, not null, NaN, or undefined) in the specified *iterable*; accepts an accessor.
+
+For example:
+
+```js
+d3.count([{n: "Alice", age: NaN}, {n: "Bob", age: 18}, {n: "Other"}], d => d.age) // 1
+```
+# d3.cross(...iterables[, reducer]) · [Source](https://github.com/d3/d3-array/blob/main/src/cross.js), [Examples](https://observablehq.com/@d3/d3-cross)
+
+Returns the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the specified *iterables*. For example, if two iterables *a* and *b* are specified, for each element *i* in the iterable *a* and each element *j* in the iterable *b*, in order, invokes the specified *reducer* function passing the element *i* and element *j*. If a *reducer* is not specified, it defaults to a function which creates a two-element array for each pair:
+
+```js
+function pair(a, b) {
+ return [a, b];
+}
+```
+
+For example:
+
+```js
+d3.cross([1, 2], ["x", "y"]); // returns [[1, "x"], [1, "y"], [2, "x"], [2, "y"]]
+d3.cross([1, 2], ["x", "y"], (a, b) => a + b); // returns ["1x", "1y", "2x", "2y"]
+```
+
+# d3.merge(iterables) · [Source](https://github.com/d3/d3-array/blob/main/src/merge.js), [Examples](https://observablehq.com/@d3/d3-merge)
+
+Merges the specified iterable of *iterables* into a single array. This method is similar to the built-in array concat method; the only difference is that it is more convenient when you have an array of arrays.
+
+```js
+d3.merge([[1], [2, 3]]); // returns [1, 2, 3]
+```
+
+# d3.pairs(iterable[, reducer]) · [Source](https://github.com/d3/d3-array/blob/main/src/pairs.js), [Examples](https://observablehq.com/@d3/d3-pairs)
+
+For each adjacent pair of elements in the specified *iterable*, in order, invokes the specified *reducer* function passing the element *i* and element *i* - 1. If a *reducer* is not specified, it defaults to a function which creates a two-element array for each pair:
+
+```js
+function pair(a, b) {
+ return [a, b];
+}
+```
+
+For example:
+
+```js
+d3.pairs([1, 2, 3, 4]); // returns [[1, 2], [2, 3], [3, 4]]
+d3.pairs([1, 2, 3, 4], (a, b) => b - a); // returns [1, 1, 1];
+```
+
+If the specified iterable has fewer than two elements, returns the empty array.
+
+# d3.permute(source, keys) · [Source](https://github.com/d3/d3-array/blob/main/src/permute.js), [Examples](https://observablehq.com/@d3/d3-permute)
+
+Returns a permutation of the specified *source* object (or array) using the specified iterable of *keys*. The returned array contains the corresponding property of the source object for each key in *keys*, in order. For example:
+
+```js
+permute(["a", "b", "c"], [1, 2, 0]); // returns ["b", "c", "a"]
+```
+
+It is acceptable to have more keys than source elements, and for keys to be duplicated or omitted.
+
+This method can also be used to extract the values from an object into an array with a stable order. Extracting keyed values in order can be useful for generating data arrays in nested selections. For example:
+
+```js
+let object = {yield: 27, variety: "Manchuria", year: 1931, site: "University Farm"};
+let fields = ["site", "variety", "yield"];
+
+d3.permute(object, fields); // returns ["University Farm", "Manchuria", 27]
+```
+
+# d3.shuffle(array[, start[, stop]]) · [Source](https://github.com/d3/d3-array/blob/main/src/shuffle.js), [Examples](https://observablehq.com/@d3/d3-shuffle)
+
+Randomizes the order of the specified *array* in-place using the [Fisher–Yates shuffle](https://bost.ocks.org/mike/shuffle/) and returns the *array*. If *start* is specified, it is the starting index (inclusive) of the *array* to shuffle; if *start* is not specified, it defaults to zero. If *stop* is specified, it is the ending index (exclusive) of the *array* to shuffle; if *stop* is not specified, it defaults to *array*.length. For example, to shuffle the first ten elements of the *array*: shuffle(*array*, 0, 10).
+
+# d3.shuffler(random) · [Source](https://github.com/d3/d3-array/blob/main/src/shuffle.js)
+
+Returns a [shuffle function](#shuffle) given the specified random source. For example, using [d3.randomLcg](https://github.com/d3/d3-random/blob/main/README.md#randomLcg):
+
+```js
+const random = d3.randomLcg(0.9051667019185816);
+const shuffle = d3.shuffler(random);
+
+shuffle([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); // returns [7, 4, 5, 3, 9, 0, 6, 1, 2, 8]
+```
+
+# d3.ticks(start, stop, count) · [Source](https://github.com/d3/d3-array/blob/main/src/ticks.js), [Examples](https://observablehq.com/@d3/d3-ticks)
+
+Returns an array of approximately *count* + 1 uniformly-spaced, nicely-rounded values between *start* and *stop* (inclusive). Each value is a power of ten multiplied by 1, 2 or 5. See also [d3.tickIncrement](#tickIncrement), [d3.tickStep](#tickStep) and [*linear*.ticks](https://github.com/d3/d3-scale/blob/main/README.md#linear_ticks).
+
+Ticks are inclusive in the sense that they may include the specified *start* and *stop* values if (and only if) they are exact, nicely-rounded values consistent with the inferred [step](#tickStep). More formally, each returned tick *t* satisfies *start* ≤ *t* and *t* ≤ *stop*.
+
+# d3.tickIncrement(start, stop, count) · [Source](https://github.com/d3/d3-array/blob/main/src/ticks.js), [Examples](https://observablehq.com/@d3/d3-ticks)
+
+Like [d3.tickStep](#tickStep), except requires that *start* is always less than or equal to *stop*, and if the tick step for the given *start*, *stop* and *count* would be less than one, returns the negative inverse tick step instead. This method is always guaranteed to return an integer, and is used by [d3.ticks](#ticks) to guarantee that the returned tick values are represented as precisely as possible in IEEE 754 floating point.
+
+# d3.tickStep(start, stop, count) · [Source](https://github.com/d3/d3-array/blob/main/src/ticks.js), [Examples](https://observablehq.com/@d3/d3-ticks)
+
+Returns the difference between adjacent tick values if the same arguments were passed to [d3.ticks](#ticks): a nicely-rounded value that is a power of ten multiplied by 1, 2 or 5. Note that due to the limited precision of IEEE 754 floating point, the returned value may not be exact decimals; use [d3-format](https://github.com/d3/d3-format) to format numbers for human consumption.
+
+# d3.nice(start, stop, count) · [Source](https://github.com/d3/d3-array/blob/main/src/nice.js)
+
+Returns a new interval [*niceStart*, *niceStop*] covering the given interval [*start*, *stop*] and where *niceStart* and *niceStop* are guaranteed to align with the corresponding [tick step](#tickStep). Like [d3.tickIncrement](#tickIncrement), this requires that *start* is less than or equal to *stop*.
+
+# d3.range([start, ]stop[, step]) · [Source](https://github.com/d3/d3-array/blob/main/src/range.js), [Examples](https://observablehq.com/@d3/d3-range)
+
+Returns an array containing an arithmetic progression, similar to the Python built-in [range](http://docs.python.org/library/functions.html#range). This method is often used to iterate over a sequence of uniformly-spaced numeric values, such as the indexes of an array or the ticks of a linear scale. (See also [d3.ticks](#ticks) for nicely-rounded values.)
+
+If *step* is omitted, it defaults to 1. If *start* is omitted, it defaults to 0. The *stop* value is exclusive; it is not included in the result. If *step* is positive, the last element is the largest *start* + *i* \* *step* less than *stop*; if *step* is negative, the last element is the smallest *start* + *i* \* *step* greater than *stop*. If the returned array would contain an infinite number of values, an empty range is returned.
+
+The arguments are not required to be integers; however, the results are more predictable if they are. The values in the returned array are defined as *start* + *i* \* *step*, where *i* is an integer from zero to one minus the total number of elements in the returned array. For example:
+
+```js
+d3.range(0, 1, 0.2) // [0, 0.2, 0.4, 0.6000000000000001, 0.8]
+```
+
+This unexpected behavior is due to IEEE 754 double-precision floating point, which defines 0.2 * 3 = 0.6000000000000001. Use [d3-format](https://github.com/d3/d3-format) to format numbers for human consumption with appropriate rounding; see also [linear.tickFormat](https://github.com/d3/d3-scale/blob/main/README.md#linear_tickFormat) in [d3-scale](https://github.com/d3/d3-scale).
+
+Likewise, if the returned array should have a specific length, consider using [array.map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on an integer range. For example:
+
+```js
+d3.range(0, 1, 1 / 49); // BAD: returns 50 elements!
+d3.range(49).map(function(d) { return d / 49; }); // GOOD: returns 49 elements.
+```
+
+# d3.transpose(matrix) · [Source](https://github.com/d3/d3-array/blob/main/src/transpose.js), [Examples](https://observablehq.com/@d3/d3-transpose)
+
+Uses the [zip](#zip) operator as a two-dimensional [matrix transpose](http://en.wikipedia.org/wiki/Transpose).
+
+# d3.zip(arrays…) · [Source](https://github.com/d3/d3-array/blob/main/src/zip.js), [Examples](https://observablehq.com/@d3/d3-transpose)
+
+Returns an array of arrays, where the *i*th array contains the *i*th element from each of the argument *arrays*. The returned array is truncated in length to the shortest array in *arrays*. If *arrays* contains only a single array, the returned array contains one-element arrays. With no arguments, the returned array is empty.
+
+```js
+d3.zip([1, 2], [3, 4]); // returns [[1, 3], [2, 4]]
+```
+
+#### Blur
+
+# d3.blur(*data*, *radius*) · [Source](https://github.com/d3/d3-array/blob/main/src/blur.js), [Examples](https://observablehq.com/@d3/d3-blur)
+
+Blurs an array of *data* in-place by applying three iterations of a moving average transform, for a fast approximation of a gaussian kernel of the given *radius*, a non-negative number, and returns the array.
+
+```js
+const randomWalk = d3.cumsum({length: 1000}, () => Math.random() - 0.5);
+blur(randomWalk, 5);
+```
+
+Copy the data if you don’t want to smooth it in-place:
+```js
+const smoothed = blur(randomWalk.slice(), 5);
+```
+
+# d3.blur2({*data*, *width*[, *height*]}, *rx*[, *ry*]) · [Source](https://github.com/d3/d3-array/blob/main/src/blur.js), [Examples](https://observablehq.com/@d3/d3-blur)
+
+Blurs a matrix of the given *width* and *height* in-place, by applying an horizontal blur of radius *rx* and a vertical blur or radius *ry* (which defaults to *rx*). The matrix *data* is stored in a flat array, used to determine the *height* if it is not specified. Returns the blurred {data, width, height}.
+
+```js
+data = [
+ 1, 0, 0,
+ 0, 0, 0,
+ 0, 0, 1
+];
+blur2({data, width: 3}, 1);
+```
+
+# d3.blurImage(*imageData*, *rx*[, *ry*]) · [Source](https://github.com/d3/d3-array/blob/main/src/blur.js), [Examples](https://observablehq.com/@d3/d3-blurimage)
+
+Blurs an [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData) structure in-place, blurring each of the RGBA layers independently by applying an horizontal blur of radius *rx* and a vertical blur or radius *ry* (which defaults to *rx*). Returns the blurred ImageData.
+
+```js
+const imData = context.getImageData(0, 0, width, height);
+blurImage(imData, 5);
+```
+
+### Iterables
+
+These are equivalent to built-in array methods, but work with any iterable including Map, Set, and Generator.
+
+# d3.every(iterable, test) · [Source](https://github.com/d3/d3-array/blob/main/src/every.js)
+
+Returns true if the given *test* function returns true for every value in the given *iterable*. This method returns as soon as *test* returns a non-truthy value or all values are iterated over. Equivalent to [*array*.every](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every):
+
+```js
+d3.every(new Set([1, 3, 5, 7]), x => x & 1) // true
+```
+
+# d3.some(iterable, test) · [Source](https://github.com/d3/d3-array/blob/main/src/some.js)
+
+Returns true if the given *test* function returns true for any value in the given *iterable*. This method returns as soon as *test* returns a truthy value or all values are iterated over. Equivalent to [*array*.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some):
+
+```js
+d3.some(new Set([0, 2, 3, 4]), x => x & 1) // true
+```
+
+# d3.filter(iterable, test) · [Source](https://github.com/d3/d3-array/blob/main/src/filter.js)
+
+Returns a new array containing the values from *iterable*, in order, for which the given *test* function returns true. Equivalent to [*array*.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter):
+
+```js
+d3.filter(new Set([0, 2, 3, 4]), x => x & 1) // [3]
+```
+
+# d3.map(iterable, mapper) · [Source](https://github.com/d3/d3-array/blob/main/src/map.js)
+
+Returns a new array containing the mapped values from *iterable*, in order, as defined by given *mapper* function. Equivalent to [*array*.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) and [Array.from](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from):
+
+```js
+d3.map(new Set([0, 2, 3, 4]), x => x & 1) // [0, 0, 1, 0]
+```
+
+# d3.reduce(iterable, reducer[, initialValue]) · [Source](https://github.com/d3/d3-array/blob/main/src/reduce.js)
+
+Returns the reduced value defined by given *reducer* function, which is repeatedly invoked for each value in *iterable*, being passed the current reduced value and the next value. Equivalent to [*array*.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce):
+
+```js
+d3.reduce(new Set([0, 2, 3, 4]), (p, v) => p + v, 0) // 9
+```
+
+# d3.reverse(iterable) · [Source](https://github.com/d3/d3-array/blob/main/src/reverse.js)
+
+Returns an array containing the values in the given *iterable* in reverse order. Equivalent to [*array*.reverse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse), except that it does not mutate the given *iterable*:
+
+```js
+d3.reverse(new Set([0, 2, 3, 1])) // [1, 3, 2, 0]
+```
+
+# d3.sort(iterable, comparator = d3.ascending) · [Source](https://github.com/d3/d3-array/blob/main/src/sort.js)
+ # d3.sort(iterable, ...accessors)
+
+Returns an array containing the values in the given *iterable* in the sorted order defined by the given *comparator* or *accessor* function. If *comparator* is not specified, it defaults to [d3.ascending](#ascending). Equivalent to [*array*.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort), except that it does not mutate the given *iterable*, and the comparator defaults to natural order instead of lexicographic order:
+
+```js
+d3.sort(new Set([0, 2, 3, 1])) // [0, 1, 2, 3]
+```
+
+If an *accessor* (a function that does not take exactly two arguments) is specified,
+
+```js
+d3.sort(data, d => d.value)
+```
+
+it is equivalent to a *comparator* using [natural order](#ascending):
+
+```js
+d3.sort(data, (a, b) => d3.ascending(a.value, b.value))
+```
+
+The *accessor* is only invoked once per element, and thus the returned sorted order is consistent even if the accessor is nondeterministic.
+
+Multiple accessors may be specified to break ties:
+
+```js
+d3.sort(points, ({x}) => x, ({y}) => y)
+```
+
+This is equivalent to:
+
+```js
+d3.sort(data, (a, b) => d3.ascending(a.x, b.x) || d3.ascending(a.y, b.y))
+```
+
+### Sets
+
+This methods implement basic set operations for any iterable.
+
+# d3.difference(iterable, ...others) · [Source](https://github.com/d3/d3-array/blob/main/src/difference.js)
+
+Returns a new InternSet containing every value in *iterable* that is not in any of the *others* iterables.
+
+```js
+d3.difference([0, 1, 2, 0], [1]) // Set {0, 2}
+```
+
+# d3.union(...iterables) · [Source](https://github.com/d3/d3-array/blob/main/src/union.js)
+
+Returns a new InternSet containing every (distinct) value that appears in any of the given *iterables*. The order of values in the returned set is based on their first occurrence in the given *iterables*.
+
+```js
+d3.union([0, 2, 1, 0], [1, 3]) // Set {0, 2, 1, 3}
+```
+
+# d3.intersection(...iterables) · [Source](https://github.com/d3/d3-array/blob/main/src/intersection.js)
+
+Returns a new InternSet containing every (distinct) value that appears in all of the given *iterables*. The order of values in the returned set is based on their first occurrence in the given *iterables*.
+
+```js
+d3.intersection([0, 2, 1, 0], [1, 3]) // Set {1}
+```
+
+# d3.superset(a, b) · [Source](https://github.com/d3/d3-array/blob/main/src/superset.js)
+
+Returns true if *a* is a superset of *b*: if every value in the given iterable *b* is also in the given iterable *a*.
+
+```js
+d3.superset([0, 2, 1, 3, 0], [1, 3]) // true
+```
+
+# d3.subset(a, b) · [Source](https://github.com/d3/d3-array/blob/main/src/subset.js)
+
+Returns true if *a* is a subset of *b*: if every value in the given iterable *a* is also in the given iterable *b*.
+
+```js
+d3.subset([1, 3], [0, 2, 1, 3, 0]) // true
+```
+
+# d3.disjoint(a, b) · [Source](https://github.com/d3/d3-array/blob/main/src/disjoint.js)
+
+Returns true if *a* and *b* are disjoint: if *a* and *b* contain no shared value.
+
+```js
+d3.disjoint([1, 3], [2, 4]) // true
+```
+
+### Bins
+
+[](http://bl.ocks.org/mbostock/3048450)
+
+Binning groups discrete samples into a smaller number of consecutive, non-overlapping intervals. They are often used to visualize the distribution of numerical data as histograms.
+
+# d3.bin() · [Source](https://github.com/d3/d3-array/blob/main/src/bin.js), [Examples](https://observablehq.com/@d3/d3-bin)
+
+Constructs a new bin generator with the default settings.
+
+#bin(data) · [Source](https://github.com/d3/d3-array/blob/main/src/bin.js), [Examples](https://observablehq.com/@d3/d3-bin)
+
+Bins the given iterable of *data* samples. Returns an array of bins, where each bin is an array containing the associated elements from the input *data*. Thus, the `length` of the bin is the number of elements in that bin. Each bin has two additional attributes:
+
+* `x0` - the lower bound of the bin (inclusive).
+* `x1` - the upper bound of the bin (exclusive, except for the last bin).
+
+Any null or non-comparable values in the given *data*, or those outside the [domain](#bin_domain), are ignored.
+
+#bin.value([value]) · [Source](https://github.com/d3/d3-array/blob/main/src/bin.js), [Examples](https://observablehq.com/@d3/d3-bin)
+
+If *value* is specified, sets the value accessor to the specified function or constant and returns this bin generator. If *value* is not specified, returns the current value accessor, which defaults to the identity function.
+
+When bins are [generated](#_bin), the value accessor will be invoked for each element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. The default value accessor assumes that the input data are orderable (comparable), such as numbers or dates. If your data are not, then you should specify an accessor that returns the corresponding orderable value for a given datum.
+
+This is similar to mapping your data to values before invoking the bin generator, but has the benefit that the input data remains associated with the returned bins, thereby making it easier to access other fields of the data.
+
+#bin.domain([domain]) · [Source](https://github.com/d3/d3-array/blob/main/src/bin.js), [Examples](https://observablehq.com/@d3/d3-bin)
+
+If *domain* is specified, sets the domain accessor to the specified function or array and returns this bin generator. If *domain* is not specified, returns the current domain accessor, which defaults to [extent](#extent). The bin domain is defined as an array [*min*, *max*], where *min* is the minimum observable value and *max* is the maximum observable value; both values are inclusive. Any value outside of this domain will be ignored when the bins are [generated](#_bin).
+
+For example, if you are using the bin generator in conjunction with a [linear scale](https://github.com/d3/d3-scale/blob/main/README.md#linear-scales) `x`, you might say:
+
+```js
+var bin = d3.bin()
+ .domain(x.domain())
+ .thresholds(x.ticks(20));
+```
+
+You can then compute the bins from an array of numbers like so:
+
+```js
+var bins = bin(numbers);
+```
+
+If the default [extent](#extent) domain is used and the [thresholds](#bin_thresholds) are specified as a count (rather than explicit values), then the computed domain will be [niced](#nice) such that all bins are uniform width.
+
+Note that the domain accessor is invoked on the materialized array of [values](#bin_value), not on the input data array.
+
+#bin.thresholds([count]) · [Source](https://github.com/d3/d3-array/blob/main/src/bin.js), [Examples](https://observablehq.com/@d3/d3-bin)
+ #bin.thresholds([thresholds])
+
+If *thresholds* is specified, sets the [threshold generator](#bin-thresholds) to the specified function or array and returns this bin generator. If *thresholds* is not specified, returns the current threshold generator, which by default implements [Sturges’ formula](#thresholdSturges). (Thus by default, the values to be binned must be numbers!) Thresholds are defined as an array of values [*x0*, *x1*, …]. Any value less than *x0* will be placed in the first bin; any value greater than or equal to *x0* but less than *x1* will be placed in the second bin; and so on. Thus, the [generated bins](#_bin) will have *thresholds*.length + 1 bins. See [bin thresholds](#bin-thresholds) for more information.
+
+Any threshold values outside the [domain](#bin_domain) are ignored. The first *bin*.x0 is always equal to the minimum domain value, and the last *bin*.x1 is always equal to the maximum domain value.
+
+If a *count* is specified instead of an array of *thresholds*, then the [domain](#bin_domain) will be uniformly divided into approximately *count* bins; see [ticks](#ticks).
+
+#### Bin Thresholds
+
+These functions are typically not used directly; instead, pass them to [*bin*.thresholds](#bin_thresholds).
+
+# d3.thresholdFreedmanDiaconis(values, min, max) · [Source](https://github.com/d3/d3-array/blob/main/src/threshold/freedmanDiaconis.js), [Examples](https://observablehq.com/@d3/d3-bin)
+
+Returns the number of bins according to the [Freedman–Diaconis rule](https://en.wikipedia.org/wiki/Histogram#Mathematical_definition); the input *values* must be numbers.
+
+# d3.thresholdScott(values, min, max) · [Source](https://github.com/d3/d3-array/blob/main/src/threshold/scott.js), [Examples](https://observablehq.com/@d3/d3-bin)
+
+Returns the number of bins according to [Scott’s normal reference rule](https://en.wikipedia.org/wiki/Histogram#Mathematical_definition); the input *values* must be numbers.
+
+# d3.thresholdSturges(values) · [Source](https://github.com/d3/d3-array/blob/main/src/threshold/sturges.js), [Examples](https://observablehq.com/@d3/d3-bin)
+
+Returns the number of bins according to [Sturges’ formula](https://en.wikipedia.org/wiki/Histogram#Mathematical_definition); the input *values* must be numbers.
+
+You may also implement your own threshold generator taking three arguments: the array of input [*values*](#bin_value) derived from the data, and the [observable domain](#bin_domain) represented as *min* and *max*. The generator may then return either the array of numeric thresholds or the *count* of bins; in the latter case the domain is divided uniformly into approximately *count* bins; see [ticks](#ticks).
+
+For instance, when binning date values, you might want to use the ticks from a time scale ([Example](https://observablehq.com/@d3/d3-bin-time-thresholds)).
+
+### Interning
+
+# new d3.InternMap([iterable][, key]) · [Source](https://github.com/mbostock/internmap/blob/main/src/index.js), [Examples](https://observablehq.com/d/d4c5f6ad343866b9)
+ # new d3.InternSet([iterable][, key]) · [Source](https://github.com/mbostock/internmap/blob/main/src/index.js), [Examples](https://observablehq.com/d/d4c5f6ad343866b9)
+
+The [InternMap and InternSet](https://github.com/mbostock/internmap) classes extend the native JavaScript Map and Set classes, respectively, allowing Dates and other non-primitive keys by bypassing the [SameValueZero algorithm](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness) when determining key equality. d3.group, d3.rollup and d3.index use an InternMap rather than a native Map. These two classes are exported for convenience.
diff --git a/node_modules/d3-scale/node_modules/d3-array/dist/d3-array.js b/node_modules/d3-scale/node_modules/d3-array/dist/d3-array.js
new file mode 100644
index 0000000000000000000000000000000000000000..0644ded592e5ba5d82157e675f072b5ce5eb7e65
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/dist/d3-array.js
@@ -0,0 +1,1455 @@
+// https://d3js.org/d3-array/ v3.2.4 Copyright 2010-2023 Mike Bostock
+(function (global, factory) {
+typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+typeof define === 'function' && define.amd ? define(['exports'], factory) :
+(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}));
+})(this, (function (exports) { 'use strict';
+
+function ascending(a, b) {
+ return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
+}
+
+function descending(a, b) {
+ return a == null || b == null ? NaN
+ : b < a ? -1
+ : b > a ? 1
+ : b >= a ? 0
+ : NaN;
+}
+
+function bisector(f) {
+ let compare1, compare2, delta;
+
+ // If an accessor is specified, promote it to a comparator. In this case we
+ // can test whether the search value is (self-) comparable. We can’t do this
+ // for a comparator (except for specific, known comparators) because we can’t
+ // tell if the comparator is symmetric, and an asymmetric comparator can’t be
+ // used to test whether a single value is comparable.
+ if (f.length !== 2) {
+ compare1 = ascending;
+ compare2 = (d, x) => ascending(f(d), x);
+ delta = (d, x) => f(d) - x;
+ } else {
+ compare1 = f === ascending || f === descending ? f : zero;
+ compare2 = f;
+ delta = f;
+ }
+
+ function left(a, x, lo = 0, hi = a.length) {
+ if (lo < hi) {
+ if (compare1(x, x) !== 0) return hi;
+ do {
+ const mid = (lo + hi) >>> 1;
+ if (compare2(a[mid], x) < 0) lo = mid + 1;
+ else hi = mid;
+ } while (lo < hi);
+ }
+ return lo;
+ }
+
+ function right(a, x, lo = 0, hi = a.length) {
+ if (lo < hi) {
+ if (compare1(x, x) !== 0) return hi;
+ do {
+ const mid = (lo + hi) >>> 1;
+ if (compare2(a[mid], x) <= 0) lo = mid + 1;
+ else hi = mid;
+ } while (lo < hi);
+ }
+ return lo;
+ }
+
+ function center(a, x, lo = 0, hi = a.length) {
+ const i = left(a, x, lo, hi - 1);
+ return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
+ }
+
+ return {left, center, right};
+}
+
+function zero() {
+ return 0;
+}
+
+function number(x) {
+ return x === null ? NaN : +x;
+}
+
+function* numbers(values, valueof) {
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value != null && (value = +value) >= value) {
+ yield value;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
+ yield value;
+ }
+ }
+ }
+}
+
+const ascendingBisect = bisector(ascending);
+const bisectRight = ascendingBisect.right;
+const bisectLeft = ascendingBisect.left;
+const bisectCenter = bisector(number).center;
+var bisect = bisectRight;
+
+function blur(values, r) {
+ if (!((r = +r) >= 0)) throw new RangeError("invalid r");
+ let length = values.length;
+ if (!((length = Math.floor(length)) >= 0)) throw new RangeError("invalid length");
+ if (!length || !r) return values;
+ const blur = blurf(r);
+ const temp = values.slice();
+ blur(values, temp, 0, length, 1);
+ blur(temp, values, 0, length, 1);
+ blur(values, temp, 0, length, 1);
+ return values;
+}
+
+const blur2 = Blur2(blurf);
+
+const blurImage = Blur2(blurfImage);
+
+function Blur2(blur) {
+ return function(data, rx, ry = rx) {
+ if (!((rx = +rx) >= 0)) throw new RangeError("invalid rx");
+ if (!((ry = +ry) >= 0)) throw new RangeError("invalid ry");
+ let {data: values, width, height} = data;
+ if (!((width = Math.floor(width)) >= 0)) throw new RangeError("invalid width");
+ if (!((height = Math.floor(height !== undefined ? height : values.length / width)) >= 0)) throw new RangeError("invalid height");
+ if (!width || !height || (!rx && !ry)) return data;
+ const blurx = rx && blur(rx);
+ const blury = ry && blur(ry);
+ const temp = values.slice();
+ if (blurx && blury) {
+ blurh(blurx, temp, values, width, height);
+ blurh(blurx, values, temp, width, height);
+ blurh(blurx, temp, values, width, height);
+ blurv(blury, values, temp, width, height);
+ blurv(blury, temp, values, width, height);
+ blurv(blury, values, temp, width, height);
+ } else if (blurx) {
+ blurh(blurx, values, temp, width, height);
+ blurh(blurx, temp, values, width, height);
+ blurh(blurx, values, temp, width, height);
+ } else if (blury) {
+ blurv(blury, values, temp, width, height);
+ blurv(blury, temp, values, width, height);
+ blurv(blury, values, temp, width, height);
+ }
+ return data;
+ };
+}
+
+function blurh(blur, T, S, w, h) {
+ for (let y = 0, n = w * h; y < n;) {
+ blur(T, S, y, y += w, 1);
+ }
+}
+
+function blurv(blur, T, S, w, h) {
+ for (let x = 0, n = w * h; x < w; ++x) {
+ blur(T, S, x, x + n, w);
+ }
+}
+
+function blurfImage(radius) {
+ const blur = blurf(radius);
+ return (T, S, start, stop, step) => {
+ start <<= 2, stop <<= 2, step <<= 2;
+ blur(T, S, start + 0, stop + 0, step);
+ blur(T, S, start + 1, stop + 1, step);
+ blur(T, S, start + 2, stop + 2, step);
+ blur(T, S, start + 3, stop + 3, step);
+ };
+}
+
+// Given a target array T, a source array S, sets each value T[i] to the average
+// of {S[i - r], …, S[i], …, S[i + r]}, where r = ⌊radius⌋, start <= i < stop,
+// for each i, i + step, i + 2 * step, etc., and where S[j] is clamped between
+// S[start] (inclusive) and S[stop] (exclusive). If the given radius is not an
+// integer, S[i - r - 1] and S[i + r + 1] are added to the sum, each weighted
+// according to r - ⌊radius⌋.
+function blurf(radius) {
+ const radius0 = Math.floor(radius);
+ if (radius0 === radius) return bluri(radius);
+ const t = radius - radius0;
+ const w = 2 * radius + 1;
+ return (T, S, start, stop, step) => { // stop must be aligned!
+ if (!((stop -= step) >= start)) return; // inclusive stop
+ let sum = radius0 * S[start];
+ const s0 = step * radius0;
+ const s1 = s0 + step;
+ for (let i = start, j = start + s0; i < j; i += step) {
+ sum += S[Math.min(stop, i)];
+ }
+ for (let i = start, j = stop; i <= j; i += step) {
+ sum += S[Math.min(stop, i + s0)];
+ T[i] = (sum + t * (S[Math.max(start, i - s1)] + S[Math.min(stop, i + s1)])) / w;
+ sum -= S[Math.max(start, i - s0)];
+ }
+ };
+}
+
+// Like blurf, but optimized for integer radius.
+function bluri(radius) {
+ const w = 2 * radius + 1;
+ return (T, S, start, stop, step) => { // stop must be aligned!
+ if (!((stop -= step) >= start)) return; // inclusive stop
+ let sum = radius * S[start];
+ const s = step * radius;
+ for (let i = start, j = start + s; i < j; i += step) {
+ sum += S[Math.min(stop, i)];
+ }
+ for (let i = start, j = stop; i <= j; i += step) {
+ sum += S[Math.min(stop, i + s)];
+ T[i] = sum / w;
+ sum -= S[Math.max(start, i - s)];
+ }
+ };
+}
+
+function count(values, valueof) {
+ let count = 0;
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value != null && (value = +value) >= value) {
+ ++count;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
+ ++count;
+ }
+ }
+ }
+ return count;
+}
+
+function length$1(array) {
+ return array.length | 0;
+}
+
+function empty(length) {
+ return !(length > 0);
+}
+
+function arrayify(values) {
+ return typeof values !== "object" || "length" in values ? values : Array.from(values);
+}
+
+function reducer(reduce) {
+ return values => reduce(...values);
+}
+
+function cross(...values) {
+ const reduce = typeof values[values.length - 1] === "function" && reducer(values.pop());
+ values = values.map(arrayify);
+ const lengths = values.map(length$1);
+ const j = values.length - 1;
+ const index = new Array(j + 1).fill(0);
+ const product = [];
+ if (j < 0 || lengths.some(empty)) return product;
+ while (true) {
+ product.push(index.map((j, i) => values[i][j]));
+ let i = j;
+ while (++index[i] === lengths[i]) {
+ if (i === 0) return reduce ? product.map(reduce) : product;
+ index[i--] = 0;
+ }
+ }
+}
+
+function cumsum(values, valueof) {
+ var sum = 0, index = 0;
+ return Float64Array.from(values, valueof === undefined
+ ? v => (sum += +v || 0)
+ : v => (sum += +valueof(v, index++, values) || 0));
+}
+
+function variance(values, valueof) {
+ let count = 0;
+ let delta;
+ let mean = 0;
+ let sum = 0;
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value != null && (value = +value) >= value) {
+ delta = value - mean;
+ mean += delta / ++count;
+ sum += delta * (value - mean);
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
+ delta = value - mean;
+ mean += delta / ++count;
+ sum += delta * (value - mean);
+ }
+ }
+ }
+ if (count > 1) return sum / (count - 1);
+}
+
+function deviation(values, valueof) {
+ const v = variance(values, valueof);
+ return v ? Math.sqrt(v) : v;
+}
+
+function extent(values, valueof) {
+ let min;
+ let max;
+ if (valueof === undefined) {
+ for (const value of values) {
+ if (value != null) {
+ if (min === undefined) {
+ if (value >= value) min = max = value;
+ } else {
+ if (min > value) min = value;
+ if (max < value) max = value;
+ }
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null) {
+ if (min === undefined) {
+ if (value >= value) min = max = value;
+ } else {
+ if (min > value) min = value;
+ if (max < value) max = value;
+ }
+ }
+ }
+ }
+ return [min, max];
+}
+
+// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423
+class Adder {
+ constructor() {
+ this._partials = new Float64Array(32);
+ this._n = 0;
+ }
+ add(x) {
+ const p = this._partials;
+ let i = 0;
+ for (let j = 0; j < this._n && j < 32; j++) {
+ const y = p[j],
+ hi = x + y,
+ lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);
+ if (lo) p[i++] = lo;
+ x = hi;
+ }
+ p[i] = x;
+ this._n = i + 1;
+ return this;
+ }
+ valueOf() {
+ const p = this._partials;
+ let n = this._n, x, y, lo, hi = 0;
+ if (n > 0) {
+ hi = p[--n];
+ while (n > 0) {
+ x = hi;
+ y = p[--n];
+ hi = x + y;
+ lo = y - (hi - x);
+ if (lo) break;
+ }
+ if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {
+ y = lo * 2;
+ x = hi + y;
+ if (y == x - hi) hi = x;
+ }
+ }
+ return hi;
+ }
+}
+
+function fsum(values, valueof) {
+ const adder = new Adder();
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value = +value) {
+ adder.add(value);
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if (value = +valueof(value, ++index, values)) {
+ adder.add(value);
+ }
+ }
+ }
+ return +adder;
+}
+
+function fcumsum(values, valueof) {
+ const adder = new Adder();
+ let index = -1;
+ return Float64Array.from(values, valueof === undefined
+ ? v => adder.add(+v || 0)
+ : v => adder.add(+valueof(v, ++index, values) || 0)
+ );
+}
+
+class InternMap extends Map {
+ constructor(entries, key = keyof) {
+ super();
+ Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});
+ if (entries != null) for (const [key, value] of entries) this.set(key, value);
+ }
+ get(key) {
+ return super.get(intern_get(this, key));
+ }
+ has(key) {
+ return super.has(intern_get(this, key));
+ }
+ set(key, value) {
+ return super.set(intern_set(this, key), value);
+ }
+ delete(key) {
+ return super.delete(intern_delete(this, key));
+ }
+}
+
+class InternSet extends Set {
+ constructor(values, key = keyof) {
+ super();
+ Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});
+ if (values != null) for (const value of values) this.add(value);
+ }
+ has(value) {
+ return super.has(intern_get(this, value));
+ }
+ add(value) {
+ return super.add(intern_set(this, value));
+ }
+ delete(value) {
+ return super.delete(intern_delete(this, value));
+ }
+}
+
+function intern_get({_intern, _key}, value) {
+ const key = _key(value);
+ return _intern.has(key) ? _intern.get(key) : value;
+}
+
+function intern_set({_intern, _key}, value) {
+ const key = _key(value);
+ if (_intern.has(key)) return _intern.get(key);
+ _intern.set(key, value);
+ return value;
+}
+
+function intern_delete({_intern, _key}, value) {
+ const key = _key(value);
+ if (_intern.has(key)) {
+ value = _intern.get(key);
+ _intern.delete(key);
+ }
+ return value;
+}
+
+function keyof(value) {
+ return value !== null && typeof value === "object" ? value.valueOf() : value;
+}
+
+function identity(x) {
+ return x;
+}
+
+function group(values, ...keys) {
+ return nest(values, identity, identity, keys);
+}
+
+function groups(values, ...keys) {
+ return nest(values, Array.from, identity, keys);
+}
+
+function flatten$1(groups, keys) {
+ for (let i = 1, n = keys.length; i < n; ++i) {
+ groups = groups.flatMap(g => g.pop().map(([key, value]) => [...g, key, value]));
+ }
+ return groups;
+}
+
+function flatGroup(values, ...keys) {
+ return flatten$1(groups(values, ...keys), keys);
+}
+
+function flatRollup(values, reduce, ...keys) {
+ return flatten$1(rollups(values, reduce, ...keys), keys);
+}
+
+function rollup(values, reduce, ...keys) {
+ return nest(values, identity, reduce, keys);
+}
+
+function rollups(values, reduce, ...keys) {
+ return nest(values, Array.from, reduce, keys);
+}
+
+function index(values, ...keys) {
+ return nest(values, identity, unique, keys);
+}
+
+function indexes(values, ...keys) {
+ return nest(values, Array.from, unique, keys);
+}
+
+function unique(values) {
+ if (values.length !== 1) throw new Error("duplicate key");
+ return values[0];
+}
+
+function nest(values, map, reduce, keys) {
+ return (function regroup(values, i) {
+ if (i >= keys.length) return reduce(values);
+ const groups = new InternMap();
+ const keyof = keys[i++];
+ let index = -1;
+ for (const value of values) {
+ const key = keyof(value, ++index, values);
+ const group = groups.get(key);
+ if (group) group.push(value);
+ else groups.set(key, [value]);
+ }
+ for (const [key, values] of groups) {
+ groups.set(key, regroup(values, i));
+ }
+ return map(groups);
+ })(values, 0);
+}
+
+function permute(source, keys) {
+ return Array.from(keys, key => source[key]);
+}
+
+function sort(values, ...F) {
+ if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable");
+ values = Array.from(values);
+ let [f] = F;
+ if ((f && f.length !== 2) || F.length > 1) {
+ const index = Uint32Array.from(values, (d, i) => i);
+ if (F.length > 1) {
+ F = F.map(f => values.map(f));
+ index.sort((i, j) => {
+ for (const f of F) {
+ const c = ascendingDefined(f[i], f[j]);
+ if (c) return c;
+ }
+ });
+ } else {
+ f = values.map(f);
+ index.sort((i, j) => ascendingDefined(f[i], f[j]));
+ }
+ return permute(values, index);
+ }
+ return values.sort(compareDefined(f));
+}
+
+function compareDefined(compare = ascending) {
+ if (compare === ascending) return ascendingDefined;
+ if (typeof compare !== "function") throw new TypeError("compare is not a function");
+ return (a, b) => {
+ const x = compare(a, b);
+ if (x || x === 0) return x;
+ return (compare(b, b) === 0) - (compare(a, a) === 0);
+ };
+}
+
+function ascendingDefined(a, b) {
+ return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);
+}
+
+function groupSort(values, reduce, key) {
+ return (reduce.length !== 2
+ ? sort(rollup(values, reduce, key), (([ak, av], [bk, bv]) => ascending(av, bv) || ascending(ak, bk)))
+ : sort(group(values, key), (([ak, av], [bk, bv]) => reduce(av, bv) || ascending(ak, bk))))
+ .map(([key]) => key);
+}
+
+var array = Array.prototype;
+
+var slice = array.slice;
+
+function constant(x) {
+ return () => x;
+}
+
+const e10 = Math.sqrt(50),
+ e5 = Math.sqrt(10),
+ e2 = Math.sqrt(2);
+
+function tickSpec(start, stop, count) {
+ const step = (stop - start) / Math.max(0, count),
+ power = Math.floor(Math.log10(step)),
+ error = step / Math.pow(10, power),
+ factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
+ let i1, i2, inc;
+ if (power < 0) {
+ inc = Math.pow(10, -power) / factor;
+ i1 = Math.round(start * inc);
+ i2 = Math.round(stop * inc);
+ if (i1 / inc < start) ++i1;
+ if (i2 / inc > stop) --i2;
+ inc = -inc;
+ } else {
+ inc = Math.pow(10, power) * factor;
+ i1 = Math.round(start / inc);
+ i2 = Math.round(stop / inc);
+ if (i1 * inc < start) ++i1;
+ if (i2 * inc > stop) --i2;
+ }
+ if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);
+ return [i1, i2, inc];
+}
+
+function ticks(start, stop, count) {
+ stop = +stop, start = +start, count = +count;
+ if (!(count > 0)) return [];
+ if (start === stop) return [start];
+ const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
+ if (!(i2 >= i1)) return [];
+ const n = i2 - i1 + 1, ticks = new Array(n);
+ if (reverse) {
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;
+ else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;
+ } else {
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;
+ else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;
+ }
+ return ticks;
+}
+
+function tickIncrement(start, stop, count) {
+ stop = +stop, start = +start, count = +count;
+ return tickSpec(start, stop, count)[2];
+}
+
+function tickStep(start, stop, count) {
+ stop = +stop, start = +start, count = +count;
+ const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
+ return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
+}
+
+function nice(start, stop, count) {
+ let prestep;
+ while (true) {
+ const step = tickIncrement(start, stop, count);
+ if (step === prestep || step === 0 || !isFinite(step)) {
+ return [start, stop];
+ } else if (step > 0) {
+ start = Math.floor(start / step) * step;
+ stop = Math.ceil(stop / step) * step;
+ } else if (step < 0) {
+ start = Math.ceil(start * step) / step;
+ stop = Math.floor(stop * step) / step;
+ }
+ prestep = step;
+ }
+}
+
+function thresholdSturges(values) {
+ return Math.max(1, Math.ceil(Math.log(count(values)) / Math.LN2) + 1);
+}
+
+function bin() {
+ var value = identity,
+ domain = extent,
+ threshold = thresholdSturges;
+
+ function histogram(data) {
+ if (!Array.isArray(data)) data = Array.from(data);
+
+ var i,
+ n = data.length,
+ x,
+ step,
+ values = new Array(n);
+
+ for (i = 0; i < n; ++i) {
+ values[i] = value(data[i], i, data);
+ }
+
+ var xz = domain(values),
+ x0 = xz[0],
+ x1 = xz[1],
+ tz = threshold(values, x0, x1);
+
+ // Convert number of thresholds into uniform thresholds, and nice the
+ // default domain accordingly.
+ if (!Array.isArray(tz)) {
+ const max = x1, tn = +tz;
+ if (domain === extent) [x0, x1] = nice(x0, x1, tn);
+ tz = ticks(x0, x1, tn);
+
+ // If the domain is aligned with the first tick (which it will by
+ // default), then we can use quantization rather than bisection to bin
+ // values, which is substantially faster.
+ if (tz[0] <= x0) step = tickIncrement(x0, x1, tn);
+
+ // If the last threshold is coincident with the domain’s upper bound, the
+ // last bin will be zero-width. If the default domain is used, and this
+ // last threshold is coincident with the maximum input value, we can
+ // extend the niced upper bound by one tick to ensure uniform bin widths;
+ // otherwise, we simply remove the last threshold. Note that we don’t
+ // coerce values or the domain to numbers, and thus must be careful to
+ // compare order (>=) rather than strict equality (===)!
+ if (tz[tz.length - 1] >= x1) {
+ if (max >= x1 && domain === extent) {
+ const step = tickIncrement(x0, x1, tn);
+ if (isFinite(step)) {
+ if (step > 0) {
+ x1 = (Math.floor(x1 / step) + 1) * step;
+ } else if (step < 0) {
+ x1 = (Math.ceil(x1 * -step) + 1) / -step;
+ }
+ }
+ } else {
+ tz.pop();
+ }
+ }
+ }
+
+ // Remove any thresholds outside the domain.
+ // Be careful not to mutate an array owned by the user!
+ var m = tz.length, a = 0, b = m;
+ while (tz[a] <= x0) ++a;
+ while (tz[b - 1] > x1) --b;
+ if (a || b < m) tz = tz.slice(a, b), m = b - a;
+
+ var bins = new Array(m + 1),
+ bin;
+
+ // Initialize bins.
+ for (i = 0; i <= m; ++i) {
+ bin = bins[i] = [];
+ bin.x0 = i > 0 ? tz[i - 1] : x0;
+ bin.x1 = i < m ? tz[i] : x1;
+ }
+
+ // Assign data to bins by value, ignoring any outside the domain.
+ if (isFinite(step)) {
+ if (step > 0) {
+ for (i = 0; i < n; ++i) {
+ if ((x = values[i]) != null && x0 <= x && x <= x1) {
+ bins[Math.min(m, Math.floor((x - x0) / step))].push(data[i]);
+ }
+ }
+ } else if (step < 0) {
+ for (i = 0; i < n; ++i) {
+ if ((x = values[i]) != null && x0 <= x && x <= x1) {
+ const j = Math.floor((x0 - x) * step);
+ bins[Math.min(m, j + (tz[j] <= x))].push(data[i]); // handle off-by-one due to rounding
+ }
+ }
+ }
+ } else {
+ for (i = 0; i < n; ++i) {
+ if ((x = values[i]) != null && x0 <= x && x <= x1) {
+ bins[bisect(tz, x, 0, m)].push(data[i]);
+ }
+ }
+ }
+
+ return bins;
+ }
+
+ histogram.value = function(_) {
+ return arguments.length ? (value = typeof _ === "function" ? _ : constant(_), histogram) : value;
+ };
+
+ histogram.domain = function(_) {
+ return arguments.length ? (domain = typeof _ === "function" ? _ : constant([_[0], _[1]]), histogram) : domain;
+ };
+
+ histogram.thresholds = function(_) {
+ return arguments.length ? (threshold = typeof _ === "function" ? _ : constant(Array.isArray(_) ? slice.call(_) : _), histogram) : threshold;
+ };
+
+ return histogram;
+}
+
+function max(values, valueof) {
+ let max;
+ if (valueof === undefined) {
+ for (const value of values) {
+ if (value != null
+ && (max < value || (max === undefined && value >= value))) {
+ max = value;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null
+ && (max < value || (max === undefined && value >= value))) {
+ max = value;
+ }
+ }
+ }
+ return max;
+}
+
+function maxIndex(values, valueof) {
+ let max;
+ let maxIndex = -1;
+ let index = -1;
+ if (valueof === undefined) {
+ for (const value of values) {
+ ++index;
+ if (value != null
+ && (max < value || (max === undefined && value >= value))) {
+ max = value, maxIndex = index;
+ }
+ }
+ } else {
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null
+ && (max < value || (max === undefined && value >= value))) {
+ max = value, maxIndex = index;
+ }
+ }
+ }
+ return maxIndex;
+}
+
+function min(values, valueof) {
+ let min;
+ if (valueof === undefined) {
+ for (const value of values) {
+ if (value != null
+ && (min > value || (min === undefined && value >= value))) {
+ min = value;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null
+ && (min > value || (min === undefined && value >= value))) {
+ min = value;
+ }
+ }
+ }
+ return min;
+}
+
+function minIndex(values, valueof) {
+ let min;
+ let minIndex = -1;
+ let index = -1;
+ if (valueof === undefined) {
+ for (const value of values) {
+ ++index;
+ if (value != null
+ && (min > value || (min === undefined && value >= value))) {
+ min = value, minIndex = index;
+ }
+ }
+ } else {
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null
+ && (min > value || (min === undefined && value >= value))) {
+ min = value, minIndex = index;
+ }
+ }
+ }
+ return minIndex;
+}
+
+// Based on https://github.com/mourner/quickselect
+// ISC license, Copyright 2018 Vladimir Agafonkin.
+function quickselect(array, k, left = 0, right = Infinity, compare) {
+ k = Math.floor(k);
+ left = Math.floor(Math.max(0, left));
+ right = Math.floor(Math.min(array.length - 1, right));
+
+ if (!(left <= k && k <= right)) return array;
+
+ compare = compare === undefined ? ascendingDefined : compareDefined(compare);
+
+ while (right > left) {
+ if (right - left > 600) {
+ const n = right - left + 1;
+ const m = k - left + 1;
+ const z = Math.log(n);
+ const s = 0.5 * Math.exp(2 * z / 3);
+ const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
+ const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
+ const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));
+ quickselect(array, k, newLeft, newRight, compare);
+ }
+
+ const t = array[k];
+ let i = left;
+ let j = right;
+
+ swap(array, left, k);
+ if (compare(array[right], t) > 0) swap(array, left, right);
+
+ while (i < j) {
+ swap(array, i, j), ++i, --j;
+ while (compare(array[i], t) < 0) ++i;
+ while (compare(array[j], t) > 0) --j;
+ }
+
+ if (compare(array[left], t) === 0) swap(array, left, j);
+ else ++j, swap(array, j, right);
+
+ if (j <= k) left = j + 1;
+ if (k <= j) right = j - 1;
+ }
+
+ return array;
+}
+
+function swap(array, i, j) {
+ const t = array[i];
+ array[i] = array[j];
+ array[j] = t;
+}
+
+function greatest(values, compare = ascending) {
+ let max;
+ let defined = false;
+ if (compare.length === 1) {
+ let maxValue;
+ for (const element of values) {
+ const value = compare(element);
+ if (defined
+ ? ascending(value, maxValue) > 0
+ : ascending(value, value) === 0) {
+ max = element;
+ maxValue = value;
+ defined = true;
+ }
+ }
+ } else {
+ for (const value of values) {
+ if (defined
+ ? compare(value, max) > 0
+ : compare(value, value) === 0) {
+ max = value;
+ defined = true;
+ }
+ }
+ }
+ return max;
+}
+
+function quantile(values, p, valueof) {
+ values = Float64Array.from(numbers(values, valueof));
+ if (!(n = values.length) || isNaN(p = +p)) return;
+ if (p <= 0 || n < 2) return min(values);
+ if (p >= 1) return max(values);
+ var n,
+ i = (n - 1) * p,
+ i0 = Math.floor(i),
+ value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),
+ value1 = min(values.subarray(i0 + 1));
+ return value0 + (value1 - value0) * (i - i0);
+}
+
+function quantileSorted(values, p, valueof = number) {
+ if (!(n = values.length) || isNaN(p = +p)) return;
+ if (p <= 0 || n < 2) return +valueof(values[0], 0, values);
+ if (p >= 1) return +valueof(values[n - 1], n - 1, values);
+ var n,
+ i = (n - 1) * p,
+ i0 = Math.floor(i),
+ value0 = +valueof(values[i0], i0, values),
+ value1 = +valueof(values[i0 + 1], i0 + 1, values);
+ return value0 + (value1 - value0) * (i - i0);
+}
+
+function quantileIndex(values, p, valueof = number) {
+ if (isNaN(p = +p)) return;
+ numbers = Float64Array.from(values, (_, i) => number(valueof(values[i], i, values)));
+ if (p <= 0) return minIndex(numbers);
+ if (p >= 1) return maxIndex(numbers);
+ var numbers,
+ index = Uint32Array.from(values, (_, i) => i),
+ j = numbers.length - 1,
+ i = Math.floor(j * p);
+ quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j]));
+ i = greatest(index.subarray(0, i + 1), (i) => numbers[i]);
+ return i >= 0 ? i : -1;
+}
+
+function thresholdFreedmanDiaconis(values, min, max) {
+ const c = count(values), d = quantile(values, 0.75) - quantile(values, 0.25);
+ return c && d ? Math.ceil((max - min) / (2 * d * Math.pow(c, -1 / 3))) : 1;
+}
+
+function thresholdScott(values, min, max) {
+ const c = count(values), d = deviation(values);
+ return c && d ? Math.ceil((max - min) * Math.cbrt(c) / (3.49 * d)) : 1;
+}
+
+function mean(values, valueof) {
+ let count = 0;
+ let sum = 0;
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value != null && (value = +value) >= value) {
+ ++count, sum += value;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
+ ++count, sum += value;
+ }
+ }
+ }
+ if (count) return sum / count;
+}
+
+function median(values, valueof) {
+ return quantile(values, 0.5, valueof);
+}
+
+function medianIndex(values, valueof) {
+ return quantileIndex(values, 0.5, valueof);
+}
+
+function* flatten(arrays) {
+ for (const array of arrays) {
+ yield* array;
+ }
+}
+
+function merge(arrays) {
+ return Array.from(flatten(arrays));
+}
+
+function mode(values, valueof) {
+ const counts = new InternMap();
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value != null && value >= value) {
+ counts.set(value, (counts.get(value) || 0) + 1);
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null && value >= value) {
+ counts.set(value, (counts.get(value) || 0) + 1);
+ }
+ }
+ }
+ let modeValue;
+ let modeCount = 0;
+ for (const [value, count] of counts) {
+ if (count > modeCount) {
+ modeCount = count;
+ modeValue = value;
+ }
+ }
+ return modeValue;
+}
+
+function pairs(values, pairof = pair) {
+ const pairs = [];
+ let previous;
+ let first = false;
+ for (const value of values) {
+ if (first) pairs.push(pairof(previous, value));
+ previous = value;
+ first = true;
+ }
+ return pairs;
+}
+
+function pair(a, b) {
+ return [a, b];
+}
+
+function range(start, stop, step) {
+ start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
+
+ var i = -1,
+ n = Math.max(0, Math.ceil((stop - start) / step)) | 0,
+ range = new Array(n);
+
+ while (++i < n) {
+ range[i] = start + i * step;
+ }
+
+ return range;
+}
+
+function rank(values, valueof = ascending) {
+ if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable");
+ let V = Array.from(values);
+ const R = new Float64Array(V.length);
+ if (valueof.length !== 2) V = V.map(valueof), valueof = ascending;
+ const compareIndex = (i, j) => valueof(V[i], V[j]);
+ let k, r;
+ values = Uint32Array.from(V, (_, i) => i);
+ // Risky chaining due to Safari 14 https://github.com/d3/d3-array/issues/123
+ values.sort(valueof === ascending ? (i, j) => ascendingDefined(V[i], V[j]) : compareDefined(compareIndex));
+ values.forEach((j, i) => {
+ const c = compareIndex(j, k === undefined ? j : k);
+ if (c >= 0) {
+ if (k === undefined || c > 0) k = j, r = i;
+ R[j] = r;
+ } else {
+ R[j] = NaN;
+ }
+ });
+ return R;
+}
+
+function least(values, compare = ascending) {
+ let min;
+ let defined = false;
+ if (compare.length === 1) {
+ let minValue;
+ for (const element of values) {
+ const value = compare(element);
+ if (defined
+ ? ascending(value, minValue) < 0
+ : ascending(value, value) === 0) {
+ min = element;
+ minValue = value;
+ defined = true;
+ }
+ }
+ } else {
+ for (const value of values) {
+ if (defined
+ ? compare(value, min) < 0
+ : compare(value, value) === 0) {
+ min = value;
+ defined = true;
+ }
+ }
+ }
+ return min;
+}
+
+function leastIndex(values, compare = ascending) {
+ if (compare.length === 1) return minIndex(values, compare);
+ let minValue;
+ let min = -1;
+ let index = -1;
+ for (const value of values) {
+ ++index;
+ if (min < 0
+ ? compare(value, value) === 0
+ : compare(value, minValue) < 0) {
+ minValue = value;
+ min = index;
+ }
+ }
+ return min;
+}
+
+function greatestIndex(values, compare = ascending) {
+ if (compare.length === 1) return maxIndex(values, compare);
+ let maxValue;
+ let max = -1;
+ let index = -1;
+ for (const value of values) {
+ ++index;
+ if (max < 0
+ ? compare(value, value) === 0
+ : compare(value, maxValue) > 0) {
+ maxValue = value;
+ max = index;
+ }
+ }
+ return max;
+}
+
+function scan(values, compare) {
+ const index = leastIndex(values, compare);
+ return index < 0 ? undefined : index;
+}
+
+var shuffle = shuffler(Math.random);
+
+function shuffler(random) {
+ return function shuffle(array, i0 = 0, i1 = array.length) {
+ let m = i1 - (i0 = +i0);
+ while (m) {
+ const i = random() * m-- | 0, t = array[m + i0];
+ array[m + i0] = array[i + i0];
+ array[i + i0] = t;
+ }
+ return array;
+ };
+}
+
+function sum(values, valueof) {
+ let sum = 0;
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value = +value) {
+ sum += value;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if (value = +valueof(value, ++index, values)) {
+ sum += value;
+ }
+ }
+ }
+ return sum;
+}
+
+function transpose(matrix) {
+ if (!(n = matrix.length)) return [];
+ for (var i = -1, m = min(matrix, length), transpose = new Array(m); ++i < m;) {
+ for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n;) {
+ row[j] = matrix[j][i];
+ }
+ }
+ return transpose;
+}
+
+function length(d) {
+ return d.length;
+}
+
+function zip() {
+ return transpose(arguments);
+}
+
+function every(values, test) {
+ if (typeof test !== "function") throw new TypeError("test is not a function");
+ let index = -1;
+ for (const value of values) {
+ if (!test(value, ++index, values)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+function some(values, test) {
+ if (typeof test !== "function") throw new TypeError("test is not a function");
+ let index = -1;
+ for (const value of values) {
+ if (test(value, ++index, values)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+function filter(values, test) {
+ if (typeof test !== "function") throw new TypeError("test is not a function");
+ const array = [];
+ let index = -1;
+ for (const value of values) {
+ if (test(value, ++index, values)) {
+ array.push(value);
+ }
+ }
+ return array;
+}
+
+function map(values, mapper) {
+ if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable");
+ if (typeof mapper !== "function") throw new TypeError("mapper is not a function");
+ return Array.from(values, (value, index) => mapper(value, index, values));
+}
+
+function reduce(values, reducer, value) {
+ if (typeof reducer !== "function") throw new TypeError("reducer is not a function");
+ const iterator = values[Symbol.iterator]();
+ let done, next, index = -1;
+ if (arguments.length < 3) {
+ ({done, value} = iterator.next());
+ if (done) return;
+ ++index;
+ }
+ while (({done, value: next} = iterator.next()), !done) {
+ value = reducer(value, next, ++index, values);
+ }
+ return value;
+}
+
+function reverse(values) {
+ if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable");
+ return Array.from(values).reverse();
+}
+
+function difference(values, ...others) {
+ values = new InternSet(values);
+ for (const other of others) {
+ for (const value of other) {
+ values.delete(value);
+ }
+ }
+ return values;
+}
+
+function disjoint(values, other) {
+ const iterator = other[Symbol.iterator](), set = new InternSet();
+ for (const v of values) {
+ if (set.has(v)) return false;
+ let value, done;
+ while (({value, done} = iterator.next())) {
+ if (done) break;
+ if (Object.is(v, value)) return false;
+ set.add(value);
+ }
+ }
+ return true;
+}
+
+function intersection(values, ...others) {
+ values = new InternSet(values);
+ others = others.map(set);
+ out: for (const value of values) {
+ for (const other of others) {
+ if (!other.has(value)) {
+ values.delete(value);
+ continue out;
+ }
+ }
+ }
+ return values;
+}
+
+function set(values) {
+ return values instanceof InternSet ? values : new InternSet(values);
+}
+
+function superset(values, other) {
+ const iterator = values[Symbol.iterator](), set = new Set();
+ for (const o of other) {
+ const io = intern(o);
+ if (set.has(io)) continue;
+ let value, done;
+ while (({value, done} = iterator.next())) {
+ if (done) return false;
+ const ivalue = intern(value);
+ set.add(ivalue);
+ if (Object.is(io, ivalue)) break;
+ }
+ }
+ return true;
+}
+
+function intern(value) {
+ return value !== null && typeof value === "object" ? value.valueOf() : value;
+}
+
+function subset(values, other) {
+ return superset(other, values);
+}
+
+function union(...others) {
+ const set = new InternSet();
+ for (const other of others) {
+ for (const o of other) {
+ set.add(o);
+ }
+ }
+ return set;
+}
+
+exports.Adder = Adder;
+exports.InternMap = InternMap;
+exports.InternSet = InternSet;
+exports.ascending = ascending;
+exports.bin = bin;
+exports.bisect = bisect;
+exports.bisectCenter = bisectCenter;
+exports.bisectLeft = bisectLeft;
+exports.bisectRight = bisectRight;
+exports.bisector = bisector;
+exports.blur = blur;
+exports.blur2 = blur2;
+exports.blurImage = blurImage;
+exports.count = count;
+exports.cross = cross;
+exports.cumsum = cumsum;
+exports.descending = descending;
+exports.deviation = deviation;
+exports.difference = difference;
+exports.disjoint = disjoint;
+exports.every = every;
+exports.extent = extent;
+exports.fcumsum = fcumsum;
+exports.filter = filter;
+exports.flatGroup = flatGroup;
+exports.flatRollup = flatRollup;
+exports.fsum = fsum;
+exports.greatest = greatest;
+exports.greatestIndex = greatestIndex;
+exports.group = group;
+exports.groupSort = groupSort;
+exports.groups = groups;
+exports.histogram = bin;
+exports.index = index;
+exports.indexes = indexes;
+exports.intersection = intersection;
+exports.least = least;
+exports.leastIndex = leastIndex;
+exports.map = map;
+exports.max = max;
+exports.maxIndex = maxIndex;
+exports.mean = mean;
+exports.median = median;
+exports.medianIndex = medianIndex;
+exports.merge = merge;
+exports.min = min;
+exports.minIndex = minIndex;
+exports.mode = mode;
+exports.nice = nice;
+exports.pairs = pairs;
+exports.permute = permute;
+exports.quantile = quantile;
+exports.quantileIndex = quantileIndex;
+exports.quantileSorted = quantileSorted;
+exports.quickselect = quickselect;
+exports.range = range;
+exports.rank = rank;
+exports.reduce = reduce;
+exports.reverse = reverse;
+exports.rollup = rollup;
+exports.rollups = rollups;
+exports.scan = scan;
+exports.shuffle = shuffle;
+exports.shuffler = shuffler;
+exports.some = some;
+exports.sort = sort;
+exports.subset = subset;
+exports.sum = sum;
+exports.superset = superset;
+exports.thresholdFreedmanDiaconis = thresholdFreedmanDiaconis;
+exports.thresholdScott = thresholdScott;
+exports.thresholdSturges = thresholdSturges;
+exports.tickIncrement = tickIncrement;
+exports.tickStep = tickStep;
+exports.ticks = ticks;
+exports.transpose = transpose;
+exports.union = union;
+exports.variance = variance;
+exports.zip = zip;
+
+}));
diff --git a/node_modules/d3-scale/node_modules/d3-array/dist/d3-array.min.js b/node_modules/d3-scale/node_modules/d3-array/dist/d3-array.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..8ac3c09849e2c5453bf74598c5668a356d64e9df
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/dist/d3-array.min.js
@@ -0,0 +1,2 @@
+// https://d3js.org/d3-array/ v3.2.4 Copyright 2010-2023 Mike Bostock
+!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{})}(this,(function(t){"use strict";function n(t,n){return null==t||null==n?NaN:tn?1:t>=n?0:NaN}function r(t,n){return null==t||null==n?NaN:nt?1:n>=t?0:NaN}function e(t){let e,f,i;function u(t,n,r=0,o=t.length){if(r>>1;f(t[e],n)<0?r=e+1:o=e}while(rn(t(r),e),i=(n,r)=>t(n)-r):(e=t===n||t===r?t:o,f=t,i=t),{left:u,center:function(t,n,r=0,e=t.length){const o=u(t,n,r,e-1);return o>r&&i(t[o-1],n)>-i(t[o],n)?o-1:o},right:function(t,n,r=0,o=t.length){if(r>>1;f(t[e],n)<=0?r=e+1:o=e}while(r{n(t,r,(e<<=2)+0,(o<<=2)+0,f<<=2),n(t,r,e+1,o+1,f),n(t,r,e+2,o+2,f),n(t,r,e+3,o+3,f)}}));function d(t){return function(n,r,e=r){if(!((r=+r)>=0))throw new RangeError("invalid rx");if(!((e=+e)>=0))throw new RangeError("invalid ry");let{data:o,width:f,height:i}=n;if(!((f=Math.floor(f))>=0))throw new RangeError("invalid width");if(!((i=Math.floor(void 0!==i?i:o.length/f))>=0))throw new RangeError("invalid height");if(!f||!i||!r&&!e)return n;const u=r&&t(r),l=e&&t(e),c=o.slice();return u&&l?(p(u,c,o,f,i),p(u,o,c,f,i),p(u,c,o,f,i),y(l,o,c,f,i),y(l,c,o,f,i),y(l,o,c,f,i)):u?(p(u,o,c,f,i),p(u,c,o,f,i),p(u,o,c,f,i)):l&&(y(l,o,c,f,i),y(l,c,o,f,i),y(l,o,c,f,i)),n}}function p(t,n,r,e,o){for(let f=0,i=e*o;f{if(!((f-=i)>=o))return;let u=t*e[o];const l=i*t;for(let t=o,n=o+l;t{if(!((i-=u)>=f))return;let l=n*o[f];const c=u*n,s=c+u;for(let t=f,n=f+c;t=n&&++r;else{let e=-1;for(let o of t)null!=(o=n(o,++e,t))&&(o=+o)>=o&&++r}return r}function v(t){return 0|t.length}function M(t){return!(t>0)}function w(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function b(t,n){let r,e=0,o=0,f=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(r=n-o,o+=r/++e,f+=r*(n-o));else{let i=-1;for(let u of t)null!=(u=n(u,++i,t))&&(u=+u)>=u&&(r=u-o,o+=r/++e,f+=r*(u-o))}if(e>1)return f/(e-1)}function A(t,n){const r=b(t,n);return r?Math.sqrt(r):r}function x(t,n){let r,e;if(void 0===n)for(const n of t)null!=n&&(void 0===r?n>=n&&(r=e=n):(r>n&&(r=n),e=f&&(r=e=f):(r>f&&(r=f),e0){for(f=t[--o];o>0&&(n=f,r=t[--o],f=n+r,e=r-(f-n),!e););o>0&&(e<0&&t[o-1]<0||e>0&&t[o-1]>0)&&(r=2*e,n=f+r,r==n-f&&(f=n))}return f}}class InternMap extends Map{constructor(t,n=k){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const[n,r]of t)this.set(n,r)}get(t){return super.get(E(this,t))}has(t){return super.has(E(this,t))}set(t,n){return super.set(_(this,t),n)}delete(t){return super.delete(S(this,t))}}class InternSet extends Set{constructor(t,n=k){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const n of t)this.add(n)}has(t){return super.has(E(this,t))}add(t){return super.add(_(this,t))}delete(t){return super.delete(S(this,t))}}function E({_intern:t,_key:n},r){const e=n(r);return t.has(e)?t.get(e):r}function _({_intern:t,_key:n},r){const e=n(r);return t.has(e)?t.get(e):(t.set(e,r),r)}function S({_intern:t,_key:n},r){const e=n(r);return t.has(e)&&(r=t.get(e),t.delete(e)),r}function k(t){return null!==t&&"object"==typeof t?t.valueOf():t}function T(t){return t}function F(t,...n){return U(t,T,T,n)}function I(t,...n){return U(t,Array.from,T,n)}function j(t,n){for(let r=1,e=n.length;rt.pop().map((([n,r])=>[...t,n,r]))));return t}function q(t,n,...r){return U(t,T,n,r)}function R(t,n,...r){return U(t,Array.from,n,r)}function O(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function U(t,n,r,e){return function t(o,f){if(f>=e.length)return r(o);const i=new InternMap,u=e[f++];let l=-1;for(const t of o){const n=u(t,++l,o),r=i.get(n);r?r.push(t):i.set(n,[t])}for(const[n,r]of i)i.set(n,t(r,f));return n(i)}(t,0)}function L(t,n){return Array.from(n,(n=>t[n]))}function P(t,...n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[r]=n;if(r&&2!==r.length||n.length>1){const e=Uint32Array.from(t,((t,n)=>n));return n.length>1?(n=n.map((n=>t.map(n))),e.sort(((t,r)=>{for(const e of n){const n=C(e[t],e[r]);if(n)return n}}))):(r=t.map(r),e.sort(((t,n)=>C(r[t],r[n])))),L(t,e)}return t.sort(z(r))}function z(t=n){if(t===n)return C;if("function"!=typeof t)throw new TypeError("compare is not a function");return(n,r)=>{const e=t(n,r);return e||0===e?e:(0===t(r,r))-(0===t(n,n))}}function C(t,n){return(null==t||!(t>=t))-(null==n||!(n>=n))||(tn?1:0)}var D=Array.prototype.slice;function G(t){return()=>t}const B=Math.sqrt(50),H=Math.sqrt(10),J=Math.sqrt(2);function K(t,n,r){const e=(n-t)/Math.max(0,r),o=Math.floor(Math.log10(e)),f=e/Math.pow(10,o),i=f>=B?10:f>=H?5:f>=J?2:1;let u,l,c;return o<0?(c=Math.pow(10,-o)/i,u=Math.round(t*c),l=Math.round(n*c),u/cn&&--l,c=-c):(c=Math.pow(10,o)*i,u=Math.round(t/c),l=Math.round(n/c),u*cn&&--l),l0))return[];if((t=+t)===(n=+n))return[t];const e=n=o))return[];const u=f-o+1,l=new Array(u);if(e)if(i<0)for(let t=0;t0?(t=Math.floor(t/o)*o,n=Math.ceil(n/o)*o):o<0&&(t=Math.ceil(t*o)/o,n=Math.floor(n*o)/o),e=o}}function X(t){return Math.max(1,Math.ceil(Math.log(g(t))/Math.LN2)+1)}function Y(){var t=T,n=x,r=X;function e(e){Array.isArray(e)||(e=Array.from(e));var o,f,i,u=e.length,l=new Array(u);for(o=0;o=h)if(t>=h&&n===x){const t=V(a,h,r);isFinite(t)&&(t>0?h=(Math.floor(h/t)+1)*t:t<0&&(h=(Math.ceil(h*-t)+1)/-t))}else d.pop()}for(var p=d.length,y=0,m=p;d[y]<=a;)++y;for(;d[m-1]>h;)--m;(y||m
0?d[o-1]:a,g.x1=o
0)for(o=0;o=n)&&(r=n);else{let e=-1;for(let o of t)null!=(o=n(o,++e,t))&&(r=o)&&(r=o)}return r}function $(t,n){let r,e=-1,o=-1;if(void 0===n)for(const n of t)++o,null!=n&&(r=n)&&(r=n,e=o);else for(let f of t)null!=(f=n(f,++o,t))&&(r=f)&&(r=f,e=o);return e}function tt(t,n){let r;if(void 0===n)for(const n of t)null!=n&&(r>n||void 0===r&&n>=n)&&(r=n);else{let e=-1;for(let o of t)null!=(o=n(o,++e,t))&&(r>o||void 0===r&&o>=o)&&(r=o)}return r}function nt(t,n){let r,e=-1,o=-1;if(void 0===n)for(const n of t)++o,null!=n&&(r>n||void 0===r&&n>=n)&&(r=n,e=o);else for(let f of t)null!=(f=n(f,++o,t))&&(r>f||void 0===r&&f>=f)&&(r=f,e=o);return e}function rt(t,n,r=0,e=1/0,o){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),e=Math.floor(Math.min(t.length-1,e)),!(r<=n&&n<=e))return t;for(o=void 0===o?C:z(o);e>r;){if(e-r>600){const f=e-r+1,i=n-r+1,u=Math.log(f),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(f-l)/f)*(i-f/2<0?-1:1);rt(t,n,Math.max(r,Math.floor(n-i*l/f+c)),Math.min(e,Math.floor(n+(f-i)*l/f+c)),o)}const f=t[n];let i=r,u=e;for(et(t,r,n),o(t[e],f)>0&&et(t,r,e);i0;)--u}0===o(t[r],f)?et(t,r,u):(++u,et(t,u,e)),u<=n&&(r=u+1),n<=u&&(e=u-1)}return t}function et(t,n,r){const e=t[n];t[n]=t[r],t[r]=e}function ot(t,r=n){let e,o=!1;if(1===r.length){let f;for(const i of t){const t=r(i);(o?n(t,f)>0:0===n(t,t))&&(e=i,f=t,o=!0)}}else for(const n of t)(o?r(n,e)>0:0===r(n,n))&&(e=n,o=!0);return e}function ft(t,n,r){if(t=Float64Array.from(function*(t,n){if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(yield n);else{let r=-1;for(let e of t)null!=(e=n(e,++r,t))&&(e=+e)>=e&&(yield e)}}(t,r)),(e=t.length)&&!isNaN(n=+n)){if(n<=0||e<2)return tt(t);if(n>=1)return Z(t);var e,o=(e-1)*n,f=Math.floor(o),i=Z(rt(t,f).subarray(0,f+1));return i+(tt(t.subarray(f+1))-i)*(o-f)}}function it(t,n,r=f){if(!isNaN(n=+n)){if(e=Float64Array.from(t,((n,e)=>f(r(t[e],e,t)))),n<=0)return nt(e);if(n>=1)return $(e);var e,o=Uint32Array.from(t,((t,n)=>n)),i=e.length-1,u=Math.floor(i*n);return rt(o,u,0,i,((t,n)=>C(e[t],e[n]))),(u=ot(o.subarray(0,u+1),(t=>e[t])))>=0?u:-1}}function ut(t,n){return[t,n]}function lt(t,r=n){if(1===r.length)return nt(t,r);let e,o=-1,f=-1;for(const n of t)++f,(o<0?0===r(n,n):r(n,e)<0)&&(e=n,o=f);return o}var ct=st(Math.random);function st(t){return function(n,r=0,e=n.length){let o=e-(r=+r);for(;o;){const e=t()*o--|0,f=n[o+r];n[o+r]=n[e+r],n[e+r]=f}return n}}function at(t){if(!(o=t.length))return[];for(var n=-1,r=tt(t,ht),e=new Array(r);++n=0))throw new RangeError("invalid r");let r=t.length;if(!((r=Math.floor(r))>=0))throw new RangeError("invalid length");if(!r||!n)return t;const e=m(n),o=t.slice();return e(t,o,0,r,1),e(o,t,0,r,1),e(t,o,0,r,1),t},t.blur2=a,t.blurImage=h,t.count=g,t.cross=function(...t){const n="function"==typeof t[t.length-1]&&function(t){return n=>t(...n)}(t.pop()),r=(t=t.map(w)).map(v),e=t.length-1,o=new Array(e+1).fill(0),f=[];if(e<0||r.some(M))return f;for(;;){f.push(o.map(((n,r)=>t[r][n])));let i=e;for(;++o[i]===r[i];){if(0===i)return n?f.map(n):f;o[i--]=0}}},t.cumsum=function(t,n){var r=0,e=0;return Float64Array.from(t,void 0===n?t=>r+=+t||0:o=>r+=+n(o,e++,t)||0)},t.descending=r,t.deviation=A,t.difference=function(t,...n){t=new InternSet(t);for(const r of n)for(const n of r)t.delete(n);return t},t.disjoint=function(t,n){const r=n[Symbol.iterator](),e=new InternSet;for(const n of t){if(e.has(n))return!1;let t,o;for(;({value:t,done:o}=r.next())&&!o;){if(Object.is(n,t))return!1;e.add(t)}}return!0},t.every=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let r=-1;for(const e of t)if(!n(e,++r,t))return!1;return!0},t.extent=x,t.fcumsum=function(t,n){const r=new N;let e=-1;return Float64Array.from(t,void 0===n?t=>r.add(+t||0):o=>r.add(+n(o,++e,t)||0))},t.filter=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");const r=[];let e=-1;for(const o of t)n(o,++e,t)&&r.push(o);return r},t.flatGroup=function(t,...n){return j(I(t,...n),n)},t.flatRollup=function(t,n,...r){return j(R(t,n,...r),r)},t.fsum=function(t,n){const r=new N;if(void 0===n)for(let n of t)(n=+n)&&r.add(n);else{let e=-1;for(let o of t)(o=+n(o,++e,t))&&r.add(o)}return+r},t.greatest=ot,t.greatestIndex=function(t,r=n){if(1===r.length)return $(t,r);let e,o=-1,f=-1;for(const n of t)++f,(o<0?0===r(n,n):r(n,e)>0)&&(e=n,o=f);return o},t.group=F,t.groupSort=function(t,r,e){return(2!==r.length?P(q(t,r,e),(([t,r],[e,o])=>n(r,o)||n(t,e))):P(F(t,e),(([t,e],[o,f])=>r(e,f)||n(t,o)))).map((([t])=>t))},t.groups=I,t.histogram=Y,t.index=function(t,...n){return U(t,T,O,n)},t.indexes=function(t,...n){return U(t,Array.from,O,n)},t.intersection=function(t,...n){t=new InternSet(t),n=n.map(dt);t:for(const r of t)for(const e of n)if(!e.has(r)){t.delete(r);continue t}return t},t.least=function(t,r=n){let e,o=!1;if(1===r.length){let f;for(const i of t){const t=r(i);(o?n(t,f)<0:0===n(t,t))&&(e=i,f=t,o=!0)}}else for(const n of t)(o?r(n,e)<0:0===r(n,n))&&(e=n,o=!0);return e},t.leastIndex=lt,t.map=function(t,n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");if("function"!=typeof n)throw new TypeError("mapper is not a function");return Array.from(t,((r,e)=>n(r,e,t)))},t.max=Z,t.maxIndex=$,t.mean=function(t,n){let r=0,e=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(++r,e+=n);else{let o=-1;for(let f of t)null!=(f=n(f,++o,t))&&(f=+f)>=f&&(++r,e+=f)}if(r)return e/r},t.median=function(t,n){return ft(t,.5,n)},t.medianIndex=function(t,n){return it(t,.5,n)},t.merge=function(t){return Array.from(function*(t){for(const n of t)yield*n}(t))},t.min=tt,t.minIndex=nt,t.mode=function(t,n){const r=new InternMap;if(void 0===n)for(let n of t)null!=n&&n>=n&&r.set(n,(r.get(n)||0)+1);else{let e=-1;for(let o of t)null!=(o=n(o,++e,t))&&o>=o&&r.set(o,(r.get(o)||0)+1)}let e,o=0;for(const[t,n]of r)n>o&&(o=n,e=t);return e},t.nice=W,t.pairs=function(t,n=ut){const r=[];let e,o=!1;for(const f of t)o&&r.push(n(e,f)),e=f,o=!0;return r},t.permute=L,t.quantile=ft,t.quantileIndex=it,t.quantileSorted=function(t,n,r=f){if((e=t.length)&&!isNaN(n=+n)){if(n<=0||e<2)return+r(t[0],0,t);if(n>=1)return+r(t[e-1],e-1,t);var e,o=(e-1)*n,i=Math.floor(o),u=+r(t[i],i,t);return u+(+r(t[i+1],i+1,t)-u)*(o-i)}},t.quickselect=rt,t.range=function(t,n,r){t=+t,n=+n,r=(o=arguments.length)<2?(n=t,t=0,1):o<3?1:+r;for(var e=-1,o=0|Math.max(0,Math.ceil((n-t)/r)),f=new Array(o);++er(e[t],e[n]);let i,u;return(t=Uint32Array.from(e,((t,n)=>n))).sort(r===n?(t,n)=>C(e[t],e[n]):z(f)),t.forEach(((t,n)=>{const r=f(t,void 0===i?t:i);r>=0?((void 0===i||r>0)&&(i=t,u=n),o[t]=u):o[t]=NaN})),o},t.reduce=function(t,n,r){if("function"!=typeof n)throw new TypeError("reducer is not a function");const e=t[Symbol.iterator]();let o,f,i=-1;if(arguments.length<3){if(({done:o,value:r}=e.next()),o)return;++i}for(;({done:o,value:f}=e.next()),!o;)r=n(r,f,++i,t);return r},t.reverse=function(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()},t.rollup=q,t.rollups=R,t.scan=function(t,n){const r=lt(t,n);return r<0?void 0:r},t.shuffle=ct,t.shuffler=st,t.some=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let r=-1;for(const e of t)if(n(e,++r,t))return!0;return!1},t.sort=P,t.subset=function(t,n){return pt(n,t)},t.sum=function(t,n){let r=0;if(void 0===n)for(let n of t)(n=+n)&&(r+=n);else{let e=-1;for(let o of t)(o=+n(o,++e,t))&&(r+=o)}return r},t.superset=pt,t.thresholdFreedmanDiaconis=function(t,n,r){const e=g(t),o=ft(t,.75)-ft(t,.25);return e&&o?Math.ceil((r-n)/(2*o*Math.pow(e,-1/3))):1},t.thresholdScott=function(t,n,r){const e=g(t),o=A(t);return e&&o?Math.ceil((r-n)*Math.cbrt(e)/(3.49*o)):1},t.thresholdSturges=X,t.tickIncrement=V,t.tickStep=function(t,n,r){r=+r;const e=(n=+n)<(t=+t),o=e?V(n,t,r):V(t,n,r);return(e?-1:1)*(o<0?1/-o:o)},t.ticks=Q,t.transpose=at,t.union=function(...t){const n=new InternSet;for(const r of t)for(const t of r)n.add(t);return n},t.variance=b,t.zip=function(){return at(arguments)}}));
diff --git a/node_modules/d3-scale/node_modules/d3-array/package.json b/node_modules/d3-scale/node_modules/d3-array/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..d0c54eea5970522f33a3ee92ee7e61fd8f674e2b
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/package.json
@@ -0,0 +1,61 @@
+{
+ "name": "d3-array",
+ "version": "3.2.4",
+ "description": "Array manipulation, ordering, searching, summarizing, etc.",
+ "homepage": "https://d3js.org/d3-array/",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/d3/d3-array.git"
+ },
+ "keywords": [
+ "d3",
+ "d3-module",
+ "histogram",
+ "bisect",
+ "shuffle",
+ "statistics",
+ "search",
+ "sort",
+ "array"
+ ],
+ "license": "ISC",
+ "author": {
+ "name": "Mike Bostock",
+ "url": "http://bost.ocks.org/mike"
+ },
+ "type": "module",
+ "files": [
+ "dist/**/*.js",
+ "src/**/*.js"
+ ],
+ "module": "src/index.js",
+ "main": "src/index.js",
+ "jsdelivr": "dist/d3-array.min.js",
+ "unpkg": "dist/d3-array.min.js",
+ "exports": {
+ "umd": "./dist/d3-array.min.js",
+ "default": "./src/index.js"
+ },
+ "sideEffects": false,
+ "dependencies": {
+ "internmap": "1 - 2"
+ },
+ "devDependencies": {
+ "@rollup/plugin-node-resolve": "15",
+ "d3-dsv": "3",
+ "d3-random": "2 - 3",
+ "eslint": "8",
+ "jsdom": "21",
+ "mocha": "10",
+ "rollup": "3",
+ "rollup-plugin-terser": "7"
+ },
+ "scripts": {
+ "test": "mocha 'test/**/*-test.js' && eslint src test",
+ "prepublishOnly": "rm -rf dist && rollup -c",
+ "postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd -"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/array.js b/node_modules/d3-scale/node_modules/d3-array/src/array.js
new file mode 100644
index 0000000000000000000000000000000000000000..80084030e57eea14e15c90d72598f8443fd42f7b
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/array.js
@@ -0,0 +1,4 @@
+var array = Array.prototype;
+
+export var slice = array.slice;
+export var map = array.map;
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/ascending.js b/node_modules/d3-scale/node_modules/d3-array/src/ascending.js
new file mode 100644
index 0000000000000000000000000000000000000000..7527ea79703483bb2c94615882089b83808886cf
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/ascending.js
@@ -0,0 +1,3 @@
+export default function ascending(a, b) {
+ return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/bin.js b/node_modules/d3-scale/node_modules/d3-array/src/bin.js
new file mode 100644
index 0000000000000000000000000000000000000000..4557e104bcbe8597bc3b920d2d3a3a278f2c554c
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/bin.js
@@ -0,0 +1,125 @@
+import {slice} from "./array.js";
+import bisect from "./bisect.js";
+import constant from "./constant.js";
+import extent from "./extent.js";
+import identity from "./identity.js";
+import nice from "./nice.js";
+import ticks, {tickIncrement} from "./ticks.js";
+import sturges from "./threshold/sturges.js";
+
+export default function bin() {
+ var value = identity,
+ domain = extent,
+ threshold = sturges;
+
+ function histogram(data) {
+ if (!Array.isArray(data)) data = Array.from(data);
+
+ var i,
+ n = data.length,
+ x,
+ step,
+ values = new Array(n);
+
+ for (i = 0; i < n; ++i) {
+ values[i] = value(data[i], i, data);
+ }
+
+ var xz = domain(values),
+ x0 = xz[0],
+ x1 = xz[1],
+ tz = threshold(values, x0, x1);
+
+ // Convert number of thresholds into uniform thresholds, and nice the
+ // default domain accordingly.
+ if (!Array.isArray(tz)) {
+ const max = x1, tn = +tz;
+ if (domain === extent) [x0, x1] = nice(x0, x1, tn);
+ tz = ticks(x0, x1, tn);
+
+ // If the domain is aligned with the first tick (which it will by
+ // default), then we can use quantization rather than bisection to bin
+ // values, which is substantially faster.
+ if (tz[0] <= x0) step = tickIncrement(x0, x1, tn);
+
+ // If the last threshold is coincident with the domain’s upper bound, the
+ // last bin will be zero-width. If the default domain is used, and this
+ // last threshold is coincident with the maximum input value, we can
+ // extend the niced upper bound by one tick to ensure uniform bin widths;
+ // otherwise, we simply remove the last threshold. Note that we don’t
+ // coerce values or the domain to numbers, and thus must be careful to
+ // compare order (>=) rather than strict equality (===)!
+ if (tz[tz.length - 1] >= x1) {
+ if (max >= x1 && domain === extent) {
+ const step = tickIncrement(x0, x1, tn);
+ if (isFinite(step)) {
+ if (step > 0) {
+ x1 = (Math.floor(x1 / step) + 1) * step;
+ } else if (step < 0) {
+ x1 = (Math.ceil(x1 * -step) + 1) / -step;
+ }
+ }
+ } else {
+ tz.pop();
+ }
+ }
+ }
+
+ // Remove any thresholds outside the domain.
+ // Be careful not to mutate an array owned by the user!
+ var m = tz.length, a = 0, b = m;
+ while (tz[a] <= x0) ++a;
+ while (tz[b - 1] > x1) --b;
+ if (a || b < m) tz = tz.slice(a, b), m = b - a;
+
+ var bins = new Array(m + 1),
+ bin;
+
+ // Initialize bins.
+ for (i = 0; i <= m; ++i) {
+ bin = bins[i] = [];
+ bin.x0 = i > 0 ? tz[i - 1] : x0;
+ bin.x1 = i < m ? tz[i] : x1;
+ }
+
+ // Assign data to bins by value, ignoring any outside the domain.
+ if (isFinite(step)) {
+ if (step > 0) {
+ for (i = 0; i < n; ++i) {
+ if ((x = values[i]) != null && x0 <= x && x <= x1) {
+ bins[Math.min(m, Math.floor((x - x0) / step))].push(data[i]);
+ }
+ }
+ } else if (step < 0) {
+ for (i = 0; i < n; ++i) {
+ if ((x = values[i]) != null && x0 <= x && x <= x1) {
+ const j = Math.floor((x0 - x) * step);
+ bins[Math.min(m, j + (tz[j] <= x))].push(data[i]); // handle off-by-one due to rounding
+ }
+ }
+ }
+ } else {
+ for (i = 0; i < n; ++i) {
+ if ((x = values[i]) != null && x0 <= x && x <= x1) {
+ bins[bisect(tz, x, 0, m)].push(data[i]);
+ }
+ }
+ }
+
+ return bins;
+ }
+
+ histogram.value = function(_) {
+ return arguments.length ? (value = typeof _ === "function" ? _ : constant(_), histogram) : value;
+ };
+
+ histogram.domain = function(_) {
+ return arguments.length ? (domain = typeof _ === "function" ? _ : constant([_[0], _[1]]), histogram) : domain;
+ };
+
+ histogram.thresholds = function(_) {
+ return arguments.length ? (threshold = typeof _ === "function" ? _ : constant(Array.isArray(_) ? slice.call(_) : _), histogram) : threshold;
+ };
+
+ return histogram;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/bisect.js b/node_modules/d3-scale/node_modules/d3-array/src/bisect.js
new file mode 100644
index 0000000000000000000000000000000000000000..333a7e431589dbde04f0717d81177a1b6110c174
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/bisect.js
@@ -0,0 +1,9 @@
+import ascending from "./ascending.js";
+import bisector from "./bisector.js";
+import number from "./number.js";
+
+const ascendingBisect = bisector(ascending);
+export const bisectRight = ascendingBisect.right;
+export const bisectLeft = ascendingBisect.left;
+export const bisectCenter = bisector(number).center;
+export default bisectRight;
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/bisector.js b/node_modules/d3-scale/node_modules/d3-array/src/bisector.js
new file mode 100644
index 0000000000000000000000000000000000000000..07e4c342b7d16442cb06768f42593763216127d3
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/bisector.js
@@ -0,0 +1,56 @@
+import ascending from "./ascending.js";
+import descending from "./descending.js";
+
+export default function bisector(f) {
+ let compare1, compare2, delta;
+
+ // If an accessor is specified, promote it to a comparator. In this case we
+ // can test whether the search value is (self-) comparable. We can’t do this
+ // for a comparator (except for specific, known comparators) because we can’t
+ // tell if the comparator is symmetric, and an asymmetric comparator can’t be
+ // used to test whether a single value is comparable.
+ if (f.length !== 2) {
+ compare1 = ascending;
+ compare2 = (d, x) => ascending(f(d), x);
+ delta = (d, x) => f(d) - x;
+ } else {
+ compare1 = f === ascending || f === descending ? f : zero;
+ compare2 = f;
+ delta = f;
+ }
+
+ function left(a, x, lo = 0, hi = a.length) {
+ if (lo < hi) {
+ if (compare1(x, x) !== 0) return hi;
+ do {
+ const mid = (lo + hi) >>> 1;
+ if (compare2(a[mid], x) < 0) lo = mid + 1;
+ else hi = mid;
+ } while (lo < hi);
+ }
+ return lo;
+ }
+
+ function right(a, x, lo = 0, hi = a.length) {
+ if (lo < hi) {
+ if (compare1(x, x) !== 0) return hi;
+ do {
+ const mid = (lo + hi) >>> 1;
+ if (compare2(a[mid], x) <= 0) lo = mid + 1;
+ else hi = mid;
+ } while (lo < hi);
+ }
+ return lo;
+ }
+
+ function center(a, x, lo = 0, hi = a.length) {
+ const i = left(a, x, lo, hi - 1);
+ return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
+ }
+
+ return {left, center, right};
+}
+
+function zero() {
+ return 0;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/blur.js b/node_modules/d3-scale/node_modules/d3-array/src/blur.js
new file mode 100644
index 0000000000000000000000000000000000000000..7021cbf3dcad811256178278fcd0384b9fb93375
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/blur.js
@@ -0,0 +1,115 @@
+export function blur(values, r) {
+ if (!((r = +r) >= 0)) throw new RangeError("invalid r");
+ let length = values.length;
+ if (!((length = Math.floor(length)) >= 0)) throw new RangeError("invalid length");
+ if (!length || !r) return values;
+ const blur = blurf(r);
+ const temp = values.slice();
+ blur(values, temp, 0, length, 1);
+ blur(temp, values, 0, length, 1);
+ blur(values, temp, 0, length, 1);
+ return values;
+}
+
+export const blur2 = Blur2(blurf);
+
+export const blurImage = Blur2(blurfImage);
+
+function Blur2(blur) {
+ return function(data, rx, ry = rx) {
+ if (!((rx = +rx) >= 0)) throw new RangeError("invalid rx");
+ if (!((ry = +ry) >= 0)) throw new RangeError("invalid ry");
+ let {data: values, width, height} = data;
+ if (!((width = Math.floor(width)) >= 0)) throw new RangeError("invalid width");
+ if (!((height = Math.floor(height !== undefined ? height : values.length / width)) >= 0)) throw new RangeError("invalid height");
+ if (!width || !height || (!rx && !ry)) return data;
+ const blurx = rx && blur(rx);
+ const blury = ry && blur(ry);
+ const temp = values.slice();
+ if (blurx && blury) {
+ blurh(blurx, temp, values, width, height);
+ blurh(blurx, values, temp, width, height);
+ blurh(blurx, temp, values, width, height);
+ blurv(blury, values, temp, width, height);
+ blurv(blury, temp, values, width, height);
+ blurv(blury, values, temp, width, height);
+ } else if (blurx) {
+ blurh(blurx, values, temp, width, height);
+ blurh(blurx, temp, values, width, height);
+ blurh(blurx, values, temp, width, height);
+ } else if (blury) {
+ blurv(blury, values, temp, width, height);
+ blurv(blury, temp, values, width, height);
+ blurv(blury, values, temp, width, height);
+ }
+ return data;
+ };
+}
+
+function blurh(blur, T, S, w, h) {
+ for (let y = 0, n = w * h; y < n;) {
+ blur(T, S, y, y += w, 1);
+ }
+}
+
+function blurv(blur, T, S, w, h) {
+ for (let x = 0, n = w * h; x < w; ++x) {
+ blur(T, S, x, x + n, w);
+ }
+}
+
+function blurfImage(radius) {
+ const blur = blurf(radius);
+ return (T, S, start, stop, step) => {
+ start <<= 2, stop <<= 2, step <<= 2;
+ blur(T, S, start + 0, stop + 0, step);
+ blur(T, S, start + 1, stop + 1, step);
+ blur(T, S, start + 2, stop + 2, step);
+ blur(T, S, start + 3, stop + 3, step);
+ };
+}
+
+// Given a target array T, a source array S, sets each value T[i] to the average
+// of {S[i - r], …, S[i], …, S[i + r]}, where r = ⌊radius⌋, start <= i < stop,
+// for each i, i + step, i + 2 * step, etc., and where S[j] is clamped between
+// S[start] (inclusive) and S[stop] (exclusive). If the given radius is not an
+// integer, S[i - r - 1] and S[i + r + 1] are added to the sum, each weighted
+// according to r - ⌊radius⌋.
+function blurf(radius) {
+ const radius0 = Math.floor(radius);
+ if (radius0 === radius) return bluri(radius);
+ const t = radius - radius0;
+ const w = 2 * radius + 1;
+ return (T, S, start, stop, step) => { // stop must be aligned!
+ if (!((stop -= step) >= start)) return; // inclusive stop
+ let sum = radius0 * S[start];
+ const s0 = step * radius0;
+ const s1 = s0 + step;
+ for (let i = start, j = start + s0; i < j; i += step) {
+ sum += S[Math.min(stop, i)];
+ }
+ for (let i = start, j = stop; i <= j; i += step) {
+ sum += S[Math.min(stop, i + s0)];
+ T[i] = (sum + t * (S[Math.max(start, i - s1)] + S[Math.min(stop, i + s1)])) / w;
+ sum -= S[Math.max(start, i - s0)];
+ }
+ };
+}
+
+// Like blurf, but optimized for integer radius.
+function bluri(radius) {
+ const w = 2 * radius + 1;
+ return (T, S, start, stop, step) => { // stop must be aligned!
+ if (!((stop -= step) >= start)) return; // inclusive stop
+ let sum = radius * S[start];
+ const s = step * radius;
+ for (let i = start, j = start + s; i < j; i += step) {
+ sum += S[Math.min(stop, i)];
+ }
+ for (let i = start, j = stop; i <= j; i += step) {
+ sum += S[Math.min(stop, i + s)];
+ T[i] = sum / w;
+ sum -= S[Math.max(start, i - s)];
+ }
+ };
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/constant.js b/node_modules/d3-scale/node_modules/d3-array/src/constant.js
new file mode 100644
index 0000000000000000000000000000000000000000..bb0ec8605c4d2257b0af885ae7494266a0fb5e5e
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/constant.js
@@ -0,0 +1,3 @@
+export default function constant(x) {
+ return () => x;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/count.js b/node_modules/d3-scale/node_modules/d3-array/src/count.js
new file mode 100644
index 0000000000000000000000000000000000000000..b8783f08b2f39adcb29a76f69787eb6dab6d997c
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/count.js
@@ -0,0 +1,18 @@
+export default function count(values, valueof) {
+ let count = 0;
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value != null && (value = +value) >= value) {
+ ++count;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
+ ++count;
+ }
+ }
+ }
+ return count;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/cross.js b/node_modules/d3-scale/node_modules/d3-array/src/cross.js
new file mode 100644
index 0000000000000000000000000000000000000000..7efdbe3cd033a71cd37a6256d81873e30ca7122c
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/cross.js
@@ -0,0 +1,33 @@
+function length(array) {
+ return array.length | 0;
+}
+
+function empty(length) {
+ return !(length > 0);
+}
+
+function arrayify(values) {
+ return typeof values !== "object" || "length" in values ? values : Array.from(values);
+}
+
+function reducer(reduce) {
+ return values => reduce(...values);
+}
+
+export default function cross(...values) {
+ const reduce = typeof values[values.length - 1] === "function" && reducer(values.pop());
+ values = values.map(arrayify);
+ const lengths = values.map(length);
+ const j = values.length - 1;
+ const index = new Array(j + 1).fill(0);
+ const product = [];
+ if (j < 0 || lengths.some(empty)) return product;
+ while (true) {
+ product.push(index.map((j, i) => values[i][j]));
+ let i = j;
+ while (++index[i] === lengths[i]) {
+ if (i === 0) return reduce ? product.map(reduce) : product;
+ index[i--] = 0;
+ }
+ }
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/cumsum.js b/node_modules/d3-scale/node_modules/d3-array/src/cumsum.js
new file mode 100644
index 0000000000000000000000000000000000000000..86fb0522cc6e1e260c987635c616802775fe2372
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/cumsum.js
@@ -0,0 +1,6 @@
+export default function cumsum(values, valueof) {
+ var sum = 0, index = 0;
+ return Float64Array.from(values, valueof === undefined
+ ? v => (sum += +v || 0)
+ : v => (sum += +valueof(v, index++, values) || 0));
+}
\ No newline at end of file
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/descending.js b/node_modules/d3-scale/node_modules/d3-array/src/descending.js
new file mode 100644
index 0000000000000000000000000000000000000000..215f81ea26c8a333aa6d960953b857178fda93c0
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/descending.js
@@ -0,0 +1,7 @@
+export default function descending(a, b) {
+ return a == null || b == null ? NaN
+ : b < a ? -1
+ : b > a ? 1
+ : b >= a ? 0
+ : NaN;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/deviation.js b/node_modules/d3-scale/node_modules/d3-array/src/deviation.js
new file mode 100644
index 0000000000000000000000000000000000000000..d5dbe7a9839485d1f311bf059ec1d828d2d9dfa0
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/deviation.js
@@ -0,0 +1,6 @@
+import variance from "./variance.js";
+
+export default function deviation(values, valueof) {
+ const v = variance(values, valueof);
+ return v ? Math.sqrt(v) : v;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/difference.js b/node_modules/d3-scale/node_modules/d3-array/src/difference.js
new file mode 100644
index 0000000000000000000000000000000000000000..c19ba7882ca34371e0b4927bf9a308241f199e40
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/difference.js
@@ -0,0 +1,11 @@
+import {InternSet} from "internmap";
+
+export default function difference(values, ...others) {
+ values = new InternSet(values);
+ for (const other of others) {
+ for (const value of other) {
+ values.delete(value);
+ }
+ }
+ return values;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/disjoint.js b/node_modules/d3-scale/node_modules/d3-array/src/disjoint.js
new file mode 100644
index 0000000000000000000000000000000000000000..d62a67010310dfa71b6f1b2d088621e1fdf4fc71
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/disjoint.js
@@ -0,0 +1,15 @@
+import {InternSet} from "internmap";
+
+export default function disjoint(values, other) {
+ const iterator = other[Symbol.iterator](), set = new InternSet();
+ for (const v of values) {
+ if (set.has(v)) return false;
+ let value, done;
+ while (({value, done} = iterator.next())) {
+ if (done) break;
+ if (Object.is(v, value)) return false;
+ set.add(value);
+ }
+ }
+ return true;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/every.js b/node_modules/d3-scale/node_modules/d3-array/src/every.js
new file mode 100644
index 0000000000000000000000000000000000000000..484cac23efffd1253b68164cb4efada62c0c2fcd
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/every.js
@@ -0,0 +1,10 @@
+export default function every(values, test) {
+ if (typeof test !== "function") throw new TypeError("test is not a function");
+ let index = -1;
+ for (const value of values) {
+ if (!test(value, ++index, values)) {
+ return false;
+ }
+ }
+ return true;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/extent.js b/node_modules/d3-scale/node_modules/d3-array/src/extent.js
new file mode 100644
index 0000000000000000000000000000000000000000..580171fd3554af31b42558576f0e4bf54e96cb5e
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/extent.js
@@ -0,0 +1,29 @@
+export default function extent(values, valueof) {
+ let min;
+ let max;
+ if (valueof === undefined) {
+ for (const value of values) {
+ if (value != null) {
+ if (min === undefined) {
+ if (value >= value) min = max = value;
+ } else {
+ if (min > value) min = value;
+ if (max < value) max = value;
+ }
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null) {
+ if (min === undefined) {
+ if (value >= value) min = max = value;
+ } else {
+ if (min > value) min = value;
+ if (max < value) max = value;
+ }
+ }
+ }
+ }
+ return [min, max];
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/filter.js b/node_modules/d3-scale/node_modules/d3-array/src/filter.js
new file mode 100644
index 0000000000000000000000000000000000000000..d653392f25e93b7c73de3d0feb9655ba063c52f2
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/filter.js
@@ -0,0 +1,11 @@
+export default function filter(values, test) {
+ if (typeof test !== "function") throw new TypeError("test is not a function");
+ const array = [];
+ let index = -1;
+ for (const value of values) {
+ if (test(value, ++index, values)) {
+ array.push(value);
+ }
+ }
+ return array;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/fsum.js b/node_modules/d3-scale/node_modules/d3-array/src/fsum.js
new file mode 100644
index 0000000000000000000000000000000000000000..4a8e1cfc1fd2628e9d5c5e15c898bfdb717d44ea
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/fsum.js
@@ -0,0 +1,69 @@
+// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423
+export class Adder {
+ constructor() {
+ this._partials = new Float64Array(32);
+ this._n = 0;
+ }
+ add(x) {
+ const p = this._partials;
+ let i = 0;
+ for (let j = 0; j < this._n && j < 32; j++) {
+ const y = p[j],
+ hi = x + y,
+ lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);
+ if (lo) p[i++] = lo;
+ x = hi;
+ }
+ p[i] = x;
+ this._n = i + 1;
+ return this;
+ }
+ valueOf() {
+ const p = this._partials;
+ let n = this._n, x, y, lo, hi = 0;
+ if (n > 0) {
+ hi = p[--n];
+ while (n > 0) {
+ x = hi;
+ y = p[--n];
+ hi = x + y;
+ lo = y - (hi - x);
+ if (lo) break;
+ }
+ if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {
+ y = lo * 2;
+ x = hi + y;
+ if (y == x - hi) hi = x;
+ }
+ }
+ return hi;
+ }
+}
+
+export function fsum(values, valueof) {
+ const adder = new Adder();
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value = +value) {
+ adder.add(value);
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if (value = +valueof(value, ++index, values)) {
+ adder.add(value);
+ }
+ }
+ }
+ return +adder;
+}
+
+export function fcumsum(values, valueof) {
+ const adder = new Adder();
+ let index = -1;
+ return Float64Array.from(values, valueof === undefined
+ ? v => adder.add(+v || 0)
+ : v => adder.add(+valueof(v, ++index, values) || 0)
+ );
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/greatest.js b/node_modules/d3-scale/node_modules/d3-array/src/greatest.js
new file mode 100644
index 0000000000000000000000000000000000000000..521f4f5c037e8bbad4a56c2961072c0bb56b1ea2
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/greatest.js
@@ -0,0 +1,29 @@
+import ascending from "./ascending.js";
+
+export default function greatest(values, compare = ascending) {
+ let max;
+ let defined = false;
+ if (compare.length === 1) {
+ let maxValue;
+ for (const element of values) {
+ const value = compare(element);
+ if (defined
+ ? ascending(value, maxValue) > 0
+ : ascending(value, value) === 0) {
+ max = element;
+ maxValue = value;
+ defined = true;
+ }
+ }
+ } else {
+ for (const value of values) {
+ if (defined
+ ? compare(value, max) > 0
+ : compare(value, value) === 0) {
+ max = value;
+ defined = true;
+ }
+ }
+ }
+ return max;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/greatestIndex.js b/node_modules/d3-scale/node_modules/d3-array/src/greatestIndex.js
new file mode 100644
index 0000000000000000000000000000000000000000..2f390e5b42b8e04958a108026eea7bfbb785f74c
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/greatestIndex.js
@@ -0,0 +1,19 @@
+import ascending from "./ascending.js";
+import maxIndex from "./maxIndex.js";
+
+export default function greatestIndex(values, compare = ascending) {
+ if (compare.length === 1) return maxIndex(values, compare);
+ let maxValue;
+ let max = -1;
+ let index = -1;
+ for (const value of values) {
+ ++index;
+ if (max < 0
+ ? compare(value, value) === 0
+ : compare(value, maxValue) > 0) {
+ maxValue = value;
+ max = index;
+ }
+ }
+ return max;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/group.js b/node_modules/d3-scale/node_modules/d3-array/src/group.js
new file mode 100644
index 0000000000000000000000000000000000000000..0c30d7e9622d8dea3b7f8c72eb90f19941a8230c
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/group.js
@@ -0,0 +1,65 @@
+import {InternMap} from "internmap";
+import identity from "./identity.js";
+
+export default function group(values, ...keys) {
+ return nest(values, identity, identity, keys);
+}
+
+export function groups(values, ...keys) {
+ return nest(values, Array.from, identity, keys);
+}
+
+function flatten(groups, keys) {
+ for (let i = 1, n = keys.length; i < n; ++i) {
+ groups = groups.flatMap(g => g.pop().map(([key, value]) => [...g, key, value]));
+ }
+ return groups;
+}
+
+export function flatGroup(values, ...keys) {
+ return flatten(groups(values, ...keys), keys);
+}
+
+export function flatRollup(values, reduce, ...keys) {
+ return flatten(rollups(values, reduce, ...keys), keys);
+}
+
+export function rollup(values, reduce, ...keys) {
+ return nest(values, identity, reduce, keys);
+}
+
+export function rollups(values, reduce, ...keys) {
+ return nest(values, Array.from, reduce, keys);
+}
+
+export function index(values, ...keys) {
+ return nest(values, identity, unique, keys);
+}
+
+export function indexes(values, ...keys) {
+ return nest(values, Array.from, unique, keys);
+}
+
+function unique(values) {
+ if (values.length !== 1) throw new Error("duplicate key");
+ return values[0];
+}
+
+function nest(values, map, reduce, keys) {
+ return (function regroup(values, i) {
+ if (i >= keys.length) return reduce(values);
+ const groups = new InternMap();
+ const keyof = keys[i++];
+ let index = -1;
+ for (const value of values) {
+ const key = keyof(value, ++index, values);
+ const group = groups.get(key);
+ if (group) group.push(value);
+ else groups.set(key, [value]);
+ }
+ for (const [key, values] of groups) {
+ groups.set(key, regroup(values, i));
+ }
+ return map(groups);
+ })(values, 0);
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/groupSort.js b/node_modules/d3-scale/node_modules/d3-array/src/groupSort.js
new file mode 100644
index 0000000000000000000000000000000000000000..2d56ccf0d00380a24e70718082de3928bdfc251c
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/groupSort.js
@@ -0,0 +1,10 @@
+import ascending from "./ascending.js";
+import group, {rollup} from "./group.js";
+import sort from "./sort.js";
+
+export default function groupSort(values, reduce, key) {
+ return (reduce.length !== 2
+ ? sort(rollup(values, reduce, key), (([ak, av], [bk, bv]) => ascending(av, bv) || ascending(ak, bk)))
+ : sort(group(values, key), (([ak, av], [bk, bv]) => reduce(av, bv) || ascending(ak, bk))))
+ .map(([key]) => key);
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/identity.js b/node_modules/d3-scale/node_modules/d3-array/src/identity.js
new file mode 100644
index 0000000000000000000000000000000000000000..0c86fdf011dbdde1fb19fd34fb4cdbbc3fe01c98
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/identity.js
@@ -0,0 +1,3 @@
+export default function identity(x) {
+ return x;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/index.js b/node_modules/d3-scale/node_modules/d3-array/src/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..7759f6dbb8b93af5c7f45f2db59ce4faa3e54411
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/index.js
@@ -0,0 +1,57 @@
+export {default as bisect, bisectRight, bisectLeft, bisectCenter} from "./bisect.js";
+export {default as ascending} from "./ascending.js";
+export {default as bisector} from "./bisector.js";
+export {blur, blur2, blurImage} from "./blur.js";
+export {default as count} from "./count.js";
+export {default as cross} from "./cross.js";
+export {default as cumsum} from "./cumsum.js";
+export {default as descending} from "./descending.js";
+export {default as deviation} from "./deviation.js";
+export {default as extent} from "./extent.js";
+export {Adder, fsum, fcumsum} from "./fsum.js";
+export {default as group, flatGroup, flatRollup, groups, index, indexes, rollup, rollups} from "./group.js";
+export {default as groupSort} from "./groupSort.js";
+export {default as bin, default as histogram} from "./bin.js"; // Deprecated; use bin.
+export {default as thresholdFreedmanDiaconis} from "./threshold/freedmanDiaconis.js";
+export {default as thresholdScott} from "./threshold/scott.js";
+export {default as thresholdSturges} from "./threshold/sturges.js";
+export {default as max} from "./max.js";
+export {default as maxIndex} from "./maxIndex.js";
+export {default as mean} from "./mean.js";
+export {default as median, medianIndex} from "./median.js";
+export {default as merge} from "./merge.js";
+export {default as min} from "./min.js";
+export {default as minIndex} from "./minIndex.js";
+export {default as mode} from "./mode.js";
+export {default as nice} from "./nice.js";
+export {default as pairs} from "./pairs.js";
+export {default as permute} from "./permute.js";
+export {default as quantile, quantileIndex, quantileSorted} from "./quantile.js";
+export {default as quickselect} from "./quickselect.js";
+export {default as range} from "./range.js";
+export {default as rank} from "./rank.js";
+export {default as least} from "./least.js";
+export {default as leastIndex} from "./leastIndex.js";
+export {default as greatest} from "./greatest.js";
+export {default as greatestIndex} from "./greatestIndex.js";
+export {default as scan} from "./scan.js"; // Deprecated; use leastIndex.
+export {default as shuffle, shuffler} from "./shuffle.js";
+export {default as sum} from "./sum.js";
+export {default as ticks, tickIncrement, tickStep} from "./ticks.js";
+export {default as transpose} from "./transpose.js";
+export {default as variance} from "./variance.js";
+export {default as zip} from "./zip.js";
+export {default as every} from "./every.js";
+export {default as some} from "./some.js";
+export {default as filter} from "./filter.js";
+export {default as map} from "./map.js";
+export {default as reduce} from "./reduce.js";
+export {default as reverse} from "./reverse.js";
+export {default as sort} from "./sort.js";
+export {default as difference} from "./difference.js";
+export {default as disjoint} from "./disjoint.js";
+export {default as intersection} from "./intersection.js";
+export {default as subset} from "./subset.js";
+export {default as superset} from "./superset.js";
+export {default as union} from "./union.js";
+export {InternMap, InternSet} from "internmap";
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/intersection.js b/node_modules/d3-scale/node_modules/d3-array/src/intersection.js
new file mode 100644
index 0000000000000000000000000000000000000000..43aff3994156d27f77d71389bd44559517652f15
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/intersection.js
@@ -0,0 +1,19 @@
+import {InternSet} from "internmap";
+
+export default function intersection(values, ...others) {
+ values = new InternSet(values);
+ others = others.map(set);
+ out: for (const value of values) {
+ for (const other of others) {
+ if (!other.has(value)) {
+ values.delete(value);
+ continue out;
+ }
+ }
+ }
+ return values;
+}
+
+function set(values) {
+ return values instanceof InternSet ? values : new InternSet(values);
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/least.js b/node_modules/d3-scale/node_modules/d3-array/src/least.js
new file mode 100644
index 0000000000000000000000000000000000000000..a756abf4c757d18f408de40ec421246b06c74d73
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/least.js
@@ -0,0 +1,29 @@
+import ascending from "./ascending.js";
+
+export default function least(values, compare = ascending) {
+ let min;
+ let defined = false;
+ if (compare.length === 1) {
+ let minValue;
+ for (const element of values) {
+ const value = compare(element);
+ if (defined
+ ? ascending(value, minValue) < 0
+ : ascending(value, value) === 0) {
+ min = element;
+ minValue = value;
+ defined = true;
+ }
+ }
+ } else {
+ for (const value of values) {
+ if (defined
+ ? compare(value, min) < 0
+ : compare(value, value) === 0) {
+ min = value;
+ defined = true;
+ }
+ }
+ }
+ return min;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/leastIndex.js b/node_modules/d3-scale/node_modules/d3-array/src/leastIndex.js
new file mode 100644
index 0000000000000000000000000000000000000000..ee3542be8bd1ec4c6e88da86ccd7a1d7b8244bea
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/leastIndex.js
@@ -0,0 +1,19 @@
+import ascending from "./ascending.js";
+import minIndex from "./minIndex.js";
+
+export default function leastIndex(values, compare = ascending) {
+ if (compare.length === 1) return minIndex(values, compare);
+ let minValue;
+ let min = -1;
+ let index = -1;
+ for (const value of values) {
+ ++index;
+ if (min < 0
+ ? compare(value, value) === 0
+ : compare(value, minValue) < 0) {
+ minValue = value;
+ min = index;
+ }
+ }
+ return min;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/map.js b/node_modules/d3-scale/node_modules/d3-array/src/map.js
new file mode 100644
index 0000000000000000000000000000000000000000..4e5681907f95d6cf91cd54ebb72567d782233bd6
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/map.js
@@ -0,0 +1,5 @@
+export default function map(values, mapper) {
+ if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable");
+ if (typeof mapper !== "function") throw new TypeError("mapper is not a function");
+ return Array.from(values, (value, index) => mapper(value, index, values));
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/max.js b/node_modules/d3-scale/node_modules/d3-array/src/max.js
new file mode 100644
index 0000000000000000000000000000000000000000..ce287368eb4402d359f18ec1c6c81dde0c774cc5
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/max.js
@@ -0,0 +1,20 @@
+export default function max(values, valueof) {
+ let max;
+ if (valueof === undefined) {
+ for (const value of values) {
+ if (value != null
+ && (max < value || (max === undefined && value >= value))) {
+ max = value;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null
+ && (max < value || (max === undefined && value >= value))) {
+ max = value;
+ }
+ }
+ }
+ return max;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/maxIndex.js b/node_modules/d3-scale/node_modules/d3-array/src/maxIndex.js
new file mode 100644
index 0000000000000000000000000000000000000000..87da1a2c48b87096a44883ef7f72b3a8cdd2991a
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/maxIndex.js
@@ -0,0 +1,22 @@
+export default function maxIndex(values, valueof) {
+ let max;
+ let maxIndex = -1;
+ let index = -1;
+ if (valueof === undefined) {
+ for (const value of values) {
+ ++index;
+ if (value != null
+ && (max < value || (max === undefined && value >= value))) {
+ max = value, maxIndex = index;
+ }
+ }
+ } else {
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null
+ && (max < value || (max === undefined && value >= value))) {
+ max = value, maxIndex = index;
+ }
+ }
+ }
+ return maxIndex;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/mean.js b/node_modules/d3-scale/node_modules/d3-array/src/mean.js
new file mode 100644
index 0000000000000000000000000000000000000000..ff6fc461f6c9c1023a6b2af20601df21b80de997
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/mean.js
@@ -0,0 +1,19 @@
+export default function mean(values, valueof) {
+ let count = 0;
+ let sum = 0;
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value != null && (value = +value) >= value) {
+ ++count, sum += value;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
+ ++count, sum += value;
+ }
+ }
+ }
+ if (count) return sum / count;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/median.js b/node_modules/d3-scale/node_modules/d3-array/src/median.js
new file mode 100644
index 0000000000000000000000000000000000000000..2604df878b3e412f83b067d9babb3b81149b1339
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/median.js
@@ -0,0 +1,9 @@
+import quantile, {quantileIndex} from "./quantile.js";
+
+export default function median(values, valueof) {
+ return quantile(values, 0.5, valueof);
+}
+
+export function medianIndex(values, valueof) {
+ return quantileIndex(values, 0.5, valueof);
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/merge.js b/node_modules/d3-scale/node_modules/d3-array/src/merge.js
new file mode 100644
index 0000000000000000000000000000000000000000..a368002876bb4b47eb04acfbcedf120028fb0194
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/merge.js
@@ -0,0 +1,9 @@
+function* flatten(arrays) {
+ for (const array of arrays) {
+ yield* array;
+ }
+}
+
+export default function merge(arrays) {
+ return Array.from(flatten(arrays));
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/min.js b/node_modules/d3-scale/node_modules/d3-array/src/min.js
new file mode 100644
index 0000000000000000000000000000000000000000..df88bfb2676e32bec9e7ff3416aa3c5d65a585d3
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/min.js
@@ -0,0 +1,20 @@
+export default function min(values, valueof) {
+ let min;
+ if (valueof === undefined) {
+ for (const value of values) {
+ if (value != null
+ && (min > value || (min === undefined && value >= value))) {
+ min = value;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null
+ && (min > value || (min === undefined && value >= value))) {
+ min = value;
+ }
+ }
+ }
+ return min;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/minIndex.js b/node_modules/d3-scale/node_modules/d3-array/src/minIndex.js
new file mode 100644
index 0000000000000000000000000000000000000000..5c07d1ead978be18312c5fd4cdb22852d452a56e
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/minIndex.js
@@ -0,0 +1,22 @@
+export default function minIndex(values, valueof) {
+ let min;
+ let minIndex = -1;
+ let index = -1;
+ if (valueof === undefined) {
+ for (const value of values) {
+ ++index;
+ if (value != null
+ && (min > value || (min === undefined && value >= value))) {
+ min = value, minIndex = index;
+ }
+ }
+ } else {
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null
+ && (min > value || (min === undefined && value >= value))) {
+ min = value, minIndex = index;
+ }
+ }
+ }
+ return minIndex;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/mode.js b/node_modules/d3-scale/node_modules/d3-array/src/mode.js
new file mode 100644
index 0000000000000000000000000000000000000000..386be57988a33dce5cfa70396573bfd8dfd48c5a
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/mode.js
@@ -0,0 +1,28 @@
+import {InternMap} from "internmap";
+
+export default function mode(values, valueof) {
+ const counts = new InternMap();
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value != null && value >= value) {
+ counts.set(value, (counts.get(value) || 0) + 1);
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null && value >= value) {
+ counts.set(value, (counts.get(value) || 0) + 1);
+ }
+ }
+ }
+ let modeValue;
+ let modeCount = 0;
+ for (const [value, count] of counts) {
+ if (count > modeCount) {
+ modeCount = count;
+ modeValue = value;
+ }
+ }
+ return modeValue;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/nice.js b/node_modules/d3-scale/node_modules/d3-array/src/nice.js
new file mode 100644
index 0000000000000000000000000000000000000000..579b418c71fcbcd5eeb8173b8599bd93b82c256c
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/nice.js
@@ -0,0 +1,18 @@
+import {tickIncrement} from "./ticks.js";
+
+export default function nice(start, stop, count) {
+ let prestep;
+ while (true) {
+ const step = tickIncrement(start, stop, count);
+ if (step === prestep || step === 0 || !isFinite(step)) {
+ return [start, stop];
+ } else if (step > 0) {
+ start = Math.floor(start / step) * step;
+ stop = Math.ceil(stop / step) * step;
+ } else if (step < 0) {
+ start = Math.ceil(start * step) / step;
+ stop = Math.floor(stop * step) / step;
+ }
+ prestep = step;
+ }
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/number.js b/node_modules/d3-scale/node_modules/d3-array/src/number.js
new file mode 100644
index 0000000000000000000000000000000000000000..f282cdfb7b697a6e95bb79500fc31e6dd4680336
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/number.js
@@ -0,0 +1,20 @@
+export default function number(x) {
+ return x === null ? NaN : +x;
+}
+
+export function* numbers(values, valueof) {
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value != null && (value = +value) >= value) {
+ yield value;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
+ yield value;
+ }
+ }
+ }
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/pairs.js b/node_modules/d3-scale/node_modules/d3-array/src/pairs.js
new file mode 100644
index 0000000000000000000000000000000000000000..bfaafece59c7e059ebf471d4db6da5c6b7fb5a03
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/pairs.js
@@ -0,0 +1,15 @@
+export default function pairs(values, pairof = pair) {
+ const pairs = [];
+ let previous;
+ let first = false;
+ for (const value of values) {
+ if (first) pairs.push(pairof(previous, value));
+ previous = value;
+ first = true;
+ }
+ return pairs;
+}
+
+export function pair(a, b) {
+ return [a, b];
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/permute.js b/node_modules/d3-scale/node_modules/d3-array/src/permute.js
new file mode 100644
index 0000000000000000000000000000000000000000..f050865cbdb4b1205c34c255348b0c843793c56e
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/permute.js
@@ -0,0 +1,3 @@
+export default function permute(source, keys) {
+ return Array.from(keys, key => source[key]);
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/quantile.js b/node_modules/d3-scale/node_modules/d3-array/src/quantile.js
new file mode 100644
index 0000000000000000000000000000000000000000..75d97268e92a23478021df6a7697218fea8e25d9
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/quantile.js
@@ -0,0 +1,47 @@
+import max from "./max.js";
+import maxIndex from "./maxIndex.js";
+import min from "./min.js";
+import minIndex from "./minIndex.js";
+import quickselect from "./quickselect.js";
+import number, {numbers} from "./number.js";
+import {ascendingDefined} from "./sort.js";
+import greatest from "./greatest.js";
+
+export default function quantile(values, p, valueof) {
+ values = Float64Array.from(numbers(values, valueof));
+ if (!(n = values.length) || isNaN(p = +p)) return;
+ if (p <= 0 || n < 2) return min(values);
+ if (p >= 1) return max(values);
+ var n,
+ i = (n - 1) * p,
+ i0 = Math.floor(i),
+ value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),
+ value1 = min(values.subarray(i0 + 1));
+ return value0 + (value1 - value0) * (i - i0);
+}
+
+export function quantileSorted(values, p, valueof = number) {
+ if (!(n = values.length) || isNaN(p = +p)) return;
+ if (p <= 0 || n < 2) return +valueof(values[0], 0, values);
+ if (p >= 1) return +valueof(values[n - 1], n - 1, values);
+ var n,
+ i = (n - 1) * p,
+ i0 = Math.floor(i),
+ value0 = +valueof(values[i0], i0, values),
+ value1 = +valueof(values[i0 + 1], i0 + 1, values);
+ return value0 + (value1 - value0) * (i - i0);
+}
+
+export function quantileIndex(values, p, valueof = number) {
+ if (isNaN(p = +p)) return;
+ numbers = Float64Array.from(values, (_, i) => number(valueof(values[i], i, values)));
+ if (p <= 0) return minIndex(numbers);
+ if (p >= 1) return maxIndex(numbers);
+ var numbers,
+ index = Uint32Array.from(values, (_, i) => i),
+ j = numbers.length - 1,
+ i = Math.floor(j * p);
+ quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j]));
+ i = greatest(index.subarray(0, i + 1), (i) => numbers[i]);
+ return i >= 0 ? i : -1;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/quickselect.js b/node_modules/d3-scale/node_modules/d3-array/src/quickselect.js
new file mode 100644
index 0000000000000000000000000000000000000000..19dbb4670eff563fc8a4514f5e94990091897d68
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/quickselect.js
@@ -0,0 +1,53 @@
+import {ascendingDefined, compareDefined} from "./sort.js";
+
+// Based on https://github.com/mourner/quickselect
+// ISC license, Copyright 2018 Vladimir Agafonkin.
+export default function quickselect(array, k, left = 0, right = Infinity, compare) {
+ k = Math.floor(k);
+ left = Math.floor(Math.max(0, left));
+ right = Math.floor(Math.min(array.length - 1, right));
+
+ if (!(left <= k && k <= right)) return array;
+
+ compare = compare === undefined ? ascendingDefined : compareDefined(compare);
+
+ while (right > left) {
+ if (right - left > 600) {
+ const n = right - left + 1;
+ const m = k - left + 1;
+ const z = Math.log(n);
+ const s = 0.5 * Math.exp(2 * z / 3);
+ const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
+ const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
+ const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));
+ quickselect(array, k, newLeft, newRight, compare);
+ }
+
+ const t = array[k];
+ let i = left;
+ let j = right;
+
+ swap(array, left, k);
+ if (compare(array[right], t) > 0) swap(array, left, right);
+
+ while (i < j) {
+ swap(array, i, j), ++i, --j;
+ while (compare(array[i], t) < 0) ++i;
+ while (compare(array[j], t) > 0) --j;
+ }
+
+ if (compare(array[left], t) === 0) swap(array, left, j);
+ else ++j, swap(array, j, right);
+
+ if (j <= k) left = j + 1;
+ if (k <= j) right = j - 1;
+ }
+
+ return array;
+}
+
+function swap(array, i, j) {
+ const t = array[i];
+ array[i] = array[j];
+ array[j] = t;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/range.js b/node_modules/d3-scale/node_modules/d3-array/src/range.js
new file mode 100644
index 0000000000000000000000000000000000000000..5b86b561d771889456b63d7c70e7c591856a392f
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/range.js
@@ -0,0 +1,13 @@
+export default function range(start, stop, step) {
+ start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
+
+ var i = -1,
+ n = Math.max(0, Math.ceil((stop - start) / step)) | 0,
+ range = new Array(n);
+
+ while (++i < n) {
+ range[i] = start + i * step;
+ }
+
+ return range;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/rank.js b/node_modules/d3-scale/node_modules/d3-array/src/rank.js
new file mode 100644
index 0000000000000000000000000000000000000000..44fb675bafa56bffba3df9ff0dc28c9c96de1cb8
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/rank.js
@@ -0,0 +1,24 @@
+import ascending from "./ascending.js";
+import {ascendingDefined, compareDefined} from "./sort.js";
+
+export default function rank(values, valueof = ascending) {
+ if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable");
+ let V = Array.from(values);
+ const R = new Float64Array(V.length);
+ if (valueof.length !== 2) V = V.map(valueof), valueof = ascending;
+ const compareIndex = (i, j) => valueof(V[i], V[j]);
+ let k, r;
+ values = Uint32Array.from(V, (_, i) => i);
+ // Risky chaining due to Safari 14 https://github.com/d3/d3-array/issues/123
+ values.sort(valueof === ascending ? (i, j) => ascendingDefined(V[i], V[j]) : compareDefined(compareIndex));
+ values.forEach((j, i) => {
+ const c = compareIndex(j, k === undefined ? j : k);
+ if (c >= 0) {
+ if (k === undefined || c > 0) k = j, r = i;
+ R[j] = r;
+ } else {
+ R[j] = NaN;
+ }
+ });
+ return R;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/reduce.js b/node_modules/d3-scale/node_modules/d3-array/src/reduce.js
new file mode 100644
index 0000000000000000000000000000000000000000..3b49cf56b2823f7ecb4964d75eb5a7ca0b884aa8
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/reduce.js
@@ -0,0 +1,14 @@
+export default function reduce(values, reducer, value) {
+ if (typeof reducer !== "function") throw new TypeError("reducer is not a function");
+ const iterator = values[Symbol.iterator]();
+ let done, next, index = -1;
+ if (arguments.length < 3) {
+ ({done, value} = iterator.next());
+ if (done) return;
+ ++index;
+ }
+ while (({done, value: next} = iterator.next()), !done) {
+ value = reducer(value, next, ++index, values);
+ }
+ return value;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/reverse.js b/node_modules/d3-scale/node_modules/d3-array/src/reverse.js
new file mode 100644
index 0000000000000000000000000000000000000000..da6742cf276c9dc0a896a8828d76e3ec080fc354
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/reverse.js
@@ -0,0 +1,4 @@
+export default function reverse(values) {
+ if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable");
+ return Array.from(values).reverse();
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/scan.js b/node_modules/d3-scale/node_modules/d3-array/src/scan.js
new file mode 100644
index 0000000000000000000000000000000000000000..9c538f8a1894f9d3697dcf387d5c299ebf1ee30e
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/scan.js
@@ -0,0 +1,6 @@
+import leastIndex from "./leastIndex.js";
+
+export default function scan(values, compare) {
+ const index = leastIndex(values, compare);
+ return index < 0 ? undefined : index;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/shuffle.js b/node_modules/d3-scale/node_modules/d3-array/src/shuffle.js
new file mode 100644
index 0000000000000000000000000000000000000000..426cdac065a9b3a40aade00bcac4780aa718690e
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/shuffle.js
@@ -0,0 +1,13 @@
+export default shuffler(Math.random);
+
+export function shuffler(random) {
+ return function shuffle(array, i0 = 0, i1 = array.length) {
+ let m = i1 - (i0 = +i0);
+ while (m) {
+ const i = random() * m-- | 0, t = array[m + i0];
+ array[m + i0] = array[i + i0];
+ array[i + i0] = t;
+ }
+ return array;
+ };
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/some.js b/node_modules/d3-scale/node_modules/d3-array/src/some.js
new file mode 100644
index 0000000000000000000000000000000000000000..0b8f98b914d815854a04b04bbd43a85599131d22
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/some.js
@@ -0,0 +1,10 @@
+export default function some(values, test) {
+ if (typeof test !== "function") throw new TypeError("test is not a function");
+ let index = -1;
+ for (const value of values) {
+ if (test(value, ++index, values)) {
+ return true;
+ }
+ }
+ return false;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/sort.js b/node_modules/d3-scale/node_modules/d3-array/src/sort.js
new file mode 100644
index 0000000000000000000000000000000000000000..14541beb75344728acaae85e545bbf292c7f9895
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/sort.js
@@ -0,0 +1,39 @@
+import ascending from "./ascending.js";
+import permute from "./permute.js";
+
+export default function sort(values, ...F) {
+ if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable");
+ values = Array.from(values);
+ let [f] = F;
+ if ((f && f.length !== 2) || F.length > 1) {
+ const index = Uint32Array.from(values, (d, i) => i);
+ if (F.length > 1) {
+ F = F.map(f => values.map(f));
+ index.sort((i, j) => {
+ for (const f of F) {
+ const c = ascendingDefined(f[i], f[j]);
+ if (c) return c;
+ }
+ });
+ } else {
+ f = values.map(f);
+ index.sort((i, j) => ascendingDefined(f[i], f[j]));
+ }
+ return permute(values, index);
+ }
+ return values.sort(compareDefined(f));
+}
+
+export function compareDefined(compare = ascending) {
+ if (compare === ascending) return ascendingDefined;
+ if (typeof compare !== "function") throw new TypeError("compare is not a function");
+ return (a, b) => {
+ const x = compare(a, b);
+ if (x || x === 0) return x;
+ return (compare(b, b) === 0) - (compare(a, a) === 0);
+ };
+}
+
+export function ascendingDefined(a, b) {
+ return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/subset.js b/node_modules/d3-scale/node_modules/d3-array/src/subset.js
new file mode 100644
index 0000000000000000000000000000000000000000..8a1c56407ef3d476e67af176b82ac09b2d31f82e
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/subset.js
@@ -0,0 +1,5 @@
+import superset from "./superset.js";
+
+export default function subset(values, other) {
+ return superset(other, values);
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/sum.js b/node_modules/d3-scale/node_modules/d3-array/src/sum.js
new file mode 100644
index 0000000000000000000000000000000000000000..0720e2a1f8d6a5e4e5995093a18394455598263d
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/sum.js
@@ -0,0 +1,18 @@
+export default function sum(values, valueof) {
+ let sum = 0;
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value = +value) {
+ sum += value;
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if (value = +valueof(value, ++index, values)) {
+ sum += value;
+ }
+ }
+ }
+ return sum;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/superset.js b/node_modules/d3-scale/node_modules/d3-array/src/superset.js
new file mode 100644
index 0000000000000000000000000000000000000000..d178e9c24acc926e3bc9b9da4dafe03df57d0ed0
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/superset.js
@@ -0,0 +1,19 @@
+export default function superset(values, other) {
+ const iterator = values[Symbol.iterator](), set = new Set();
+ for (const o of other) {
+ const io = intern(o);
+ if (set.has(io)) continue;
+ let value, done;
+ while (({value, done} = iterator.next())) {
+ if (done) return false;
+ const ivalue = intern(value);
+ set.add(ivalue);
+ if (Object.is(io, ivalue)) break;
+ }
+ }
+ return true;
+}
+
+function intern(value) {
+ return value !== null && typeof value === "object" ? value.valueOf() : value;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/threshold/freedmanDiaconis.js b/node_modules/d3-scale/node_modules/d3-array/src/threshold/freedmanDiaconis.js
new file mode 100644
index 0000000000000000000000000000000000000000..c78cff407bed831238fca89379932172c9f8c987
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/threshold/freedmanDiaconis.js
@@ -0,0 +1,7 @@
+import count from "../count.js";
+import quantile from "../quantile.js";
+
+export default function thresholdFreedmanDiaconis(values, min, max) {
+ const c = count(values), d = quantile(values, 0.75) - quantile(values, 0.25);
+ return c && d ? Math.ceil((max - min) / (2 * d * Math.pow(c, -1 / 3))) : 1;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/threshold/scott.js b/node_modules/d3-scale/node_modules/d3-array/src/threshold/scott.js
new file mode 100644
index 0000000000000000000000000000000000000000..2541d2dc6b985c76894385eb876ad35bc034cbe3
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/threshold/scott.js
@@ -0,0 +1,7 @@
+import count from "../count.js";
+import deviation from "../deviation.js";
+
+export default function thresholdScott(values, min, max) {
+ const c = count(values), d = deviation(values);
+ return c && d ? Math.ceil((max - min) * Math.cbrt(c) / (3.49 * d)) : 1;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/threshold/sturges.js b/node_modules/d3-scale/node_modules/d3-array/src/threshold/sturges.js
new file mode 100644
index 0000000000000000000000000000000000000000..3370968e9ac5d668c60228a8bead548e9826f3c8
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/threshold/sturges.js
@@ -0,0 +1,5 @@
+import count from "../count.js";
+
+export default function thresholdSturges(values) {
+ return Math.max(1, Math.ceil(Math.log(count(values)) / Math.LN2) + 1);
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/ticks.js b/node_modules/d3-scale/node_modules/d3-array/src/ticks.js
new file mode 100644
index 0000000000000000000000000000000000000000..5868d8d20b312bd901fd3bc595d2ea9afdae2a37
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/ticks.js
@@ -0,0 +1,55 @@
+const e10 = Math.sqrt(50),
+ e5 = Math.sqrt(10),
+ e2 = Math.sqrt(2);
+
+function tickSpec(start, stop, count) {
+ const step = (stop - start) / Math.max(0, count),
+ power = Math.floor(Math.log10(step)),
+ error = step / Math.pow(10, power),
+ factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
+ let i1, i2, inc;
+ if (power < 0) {
+ inc = Math.pow(10, -power) / factor;
+ i1 = Math.round(start * inc);
+ i2 = Math.round(stop * inc);
+ if (i1 / inc < start) ++i1;
+ if (i2 / inc > stop) --i2;
+ inc = -inc;
+ } else {
+ inc = Math.pow(10, power) * factor;
+ i1 = Math.round(start / inc);
+ i2 = Math.round(stop / inc);
+ if (i1 * inc < start) ++i1;
+ if (i2 * inc > stop) --i2;
+ }
+ if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);
+ return [i1, i2, inc];
+}
+
+export default function ticks(start, stop, count) {
+ stop = +stop, start = +start, count = +count;
+ if (!(count > 0)) return [];
+ if (start === stop) return [start];
+ const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
+ if (!(i2 >= i1)) return [];
+ const n = i2 - i1 + 1, ticks = new Array(n);
+ if (reverse) {
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;
+ else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;
+ } else {
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;
+ else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;
+ }
+ return ticks;
+}
+
+export function tickIncrement(start, stop, count) {
+ stop = +stop, start = +start, count = +count;
+ return tickSpec(start, stop, count)[2];
+}
+
+export function tickStep(start, stop, count) {
+ stop = +stop, start = +start, count = +count;
+ const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
+ return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/transpose.js b/node_modules/d3-scale/node_modules/d3-array/src/transpose.js
new file mode 100644
index 0000000000000000000000000000000000000000..de6caebdee8087ef4de340d24d70314c62ce9fca
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/transpose.js
@@ -0,0 +1,15 @@
+import min from "./min.js";
+
+export default function transpose(matrix) {
+ if (!(n = matrix.length)) return [];
+ for (var i = -1, m = min(matrix, length), transpose = new Array(m); ++i < m;) {
+ for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n;) {
+ row[j] = matrix[j][i];
+ }
+ }
+ return transpose;
+}
+
+function length(d) {
+ return d.length;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/union.js b/node_modules/d3-scale/node_modules/d3-array/src/union.js
new file mode 100644
index 0000000000000000000000000000000000000000..57c20b108b0fb2aedb26c01c9d109416a5869698
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/union.js
@@ -0,0 +1,11 @@
+import {InternSet} from "internmap";
+
+export default function union(...others) {
+ const set = new InternSet();
+ for (const other of others) {
+ for (const o of other) {
+ set.add(o);
+ }
+ }
+ return set;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/variance.js b/node_modules/d3-scale/node_modules/d3-array/src/variance.js
new file mode 100644
index 0000000000000000000000000000000000000000..2428bf85fbd3a79c2f1558b960171707a0b42386
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/variance.js
@@ -0,0 +1,25 @@
+export default function variance(values, valueof) {
+ let count = 0;
+ let delta;
+ let mean = 0;
+ let sum = 0;
+ if (valueof === undefined) {
+ for (let value of values) {
+ if (value != null && (value = +value) >= value) {
+ delta = value - mean;
+ mean += delta / ++count;
+ sum += delta * (value - mean);
+ }
+ }
+ } else {
+ let index = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
+ delta = value - mean;
+ mean += delta / ++count;
+ sum += delta * (value - mean);
+ }
+ }
+ }
+ if (count > 1) return sum / (count - 1);
+}
diff --git a/node_modules/d3-scale/node_modules/d3-array/src/zip.js b/node_modules/d3-scale/node_modules/d3-array/src/zip.js
new file mode 100644
index 0000000000000000000000000000000000000000..48cfb425abd9ede84035a697124fb9433c6838ec
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-array/src/zip.js
@@ -0,0 +1,5 @@
+import transpose from "./transpose.js";
+
+export default function zip() {
+ return transpose(arguments);
+}
diff --git a/node_modules/d3-scale/node_modules/d3-time/LICENSE b/node_modules/d3-scale/node_modules/d3-time/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..fbe44bdc9ad516c2d0e9a52d686cd97b592ab9b0
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2010-2022 Mike Bostock
+
+Permission to use, copy, modify, and/or distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright notice
+and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
diff --git a/node_modules/d3-scale/node_modules/d3-time/README.md b/node_modules/d3-scale/node_modules/d3-time/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..4a05cdf9350654af59b03bd1f211d918bc6c4e6b
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/README.md
@@ -0,0 +1,380 @@
+# d3-time
+
+When visualizing time series data, analyzing temporal patterns, or working with time in general, the irregularities of conventional time units quickly become apparent. In the [Gregorian calendar](https://en.wikipedia.org/wiki/Gregorian_calendar), for example, most months have 31 days but some have 28, 29 or 30; most years have 365 days but [leap years](https://en.wikipedia.org/wiki/Leap_year) have 366; and with [daylight saving](https://en.wikipedia.org/wiki/Daylight_saving_time), most days have 24 hours but some have 23 or 25. Adding to complexity, daylight saving conventions vary around the world.
+
+As a result of these temporal peculiarities, it can be difficult to perform seemingly-trivial tasks. For example, if you want to compute the number of days that have passed between two dates, you can’t simply subtract and divide by 24 hours (86,400,000 ms):
+
+```js
+start = new Date(2015, 02, 01) // 2015-03-01T00:00
+end = new Date(2015, 03, 01) // 2015-04-01T00:00
+(end - start) / 864e5 // 30.958333333333332, oops! 🤯
+```
+
+You can, however, use [d3.timeDay](#timeDay).[count](#interval_count):
+
+```js
+d3.timeDay.count(start, end) // 31 😌
+```
+
+The [day](#day) [interval](#api-reference) is one of several provided by d3-time. Each interval represents a conventional unit of time—[hours](#timeHour), [weeks](#timeWeek), [months](#timeMonth), *etc.*—and has methods to calculate boundary dates. For example, [d3.timeDay](#timeDay) computes midnight (typically 12:00 AM local time) of the corresponding day. In addition to [rounding](#interval_round) and [counting](#interval_count), intervals can also be used to generate arrays of boundary dates. For example, to compute each Sunday in the current month:
+
+```js
+start = d3.timeMonth.floor() // 2015-01-01T00:00
+stop = d3.timeMonth.ceil() // 2015-02-01T00:00
+d3.timeWeek.range(start, stop) // [2015-01-07T00:00, 2015-01-14T00:00, 2015-01-21T00:00, 2015-01-28T00:00]
+```
+
+The d3-time module does not implement its own calendaring system; it merely implements a convenient API for calendar math on top of ECMAScript [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date). Thus, it ignores leap seconds and can only work with the local time zone and [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) (UTC).
+
+This module is used by D3’s time scales to generate sensible ticks, by D3’s time format, and can also be used directly to do things like [calendar layouts](http://bl.ocks.org/mbostock/4063318).
+
+## Installing
+
+If you use npm, `npm install d3-time`. You can also download the [latest release on GitHub](https://github.com/d3/d3-time/releases/latest). For vanilla HTML in modern browsers, import d3-time from Skypack:
+
+```html
+
+```
+
+For legacy environments, you can load d3-time’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported:
+
+```html
+
+
+
+```
+
+[Try d3-time in your browser.](https://observablehq.com/collection/@d3/d3-time)
+
+## API Reference
+
+#interval([date]) · [Source](https://github.com/d3/d3-time/blob/main/src/interval.js)
+
+Equivalent to [*interval*.floor](#interval_floor), except if *date* is not specified, it defaults to the current time. For example, [d3.timeYear](#timeYear)(*date*) and d3.timeYear.floor(*date*) are equivalent.
+
+```js
+monday = d3.timeMonday() // the latest preceeding Monday, local time
+```
+
+#interval.floor(date) · [Source](https://github.com/d3/d3-time/blob/main/src/interval.js)
+
+Returns a new date representing the latest interval boundary date before or equal to *date*. For example, [d3.timeDay](#timeDay).floor(*date*) typically returns 12:00 AM local time on the given *date*.
+
+This method is idempotent: if the specified *date* is already floored to the current interval, a new date with an identical time is returned. Furthermore, the returned date is the minimum expressible value of the associated interval, such that *interval*.floor(*interval*.floor(*date*) - 1) returns the preceeding interval boundary date.
+
+Note that the `==` and `===` operators do not compare by value with [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) objects, and thus you cannot use them to tell whether the specified *date* has already been floored. Instead, coerce to a number and then compare:
+
+```js
+// Returns true if the specified date is a day boundary.
+function isDay(date) {
+ return +d3.timeDay.floor(date) === +date;
+}
+```
+
+This is more reliable than testing whether the time is 12:00 AM, as in some time zones midnight may not exist due to daylight saving.
+
+#interval.round(date) · [Source](https://github.com/d3/d3-time/blob/main/src/interval.js)
+
+Returns a new date representing the closest interval boundary date to *date*. For example, [d3.timeDay](#timeDay).round(*date*) typically returns 12:00 AM local time on the given *date* if it is on or before noon, and 12:00 AM of the following day if it is after noon.
+
+This method is idempotent: if the specified *date* is already rounded to the current interval, a new date with an identical time is returned.
+
+#interval.ceil(date) · [Source](https://github.com/d3/d3-time/blob/main/src/interval.js)
+
+Returns a new date representing the earliest interval boundary date after or equal to *date*. For example, [d3.timeDay](#timeDay).ceil(*date*) typically returns 12:00 AM local time on the date following the given *date*.
+
+This method is idempotent: if the specified *date* is already ceilinged to the current interval, a new date with an identical time is returned. Furthermore, the returned date is the maximum expressible value of the associated interval, such that *interval*.ceil(*interval*.ceil(*date*) + 1) returns the following interval boundary date.
+
+#interval.offset(date[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/interval.js)
+
+Returns a new date equal to *date* plus *step* intervals. If *step* is not specified it defaults to 1. If *step* is negative, then the returned date will be before the specified *date*; if *step* is zero, then a copy of the specified *date* is returned; if *step* is not an integer, it is [floored](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor). This method does not round the specified *date* to the interval. For example, if *date* is today at 5:34 PM, then [d3.timeDay](#timeDay).offset(*date*, 1) returns 5:34 PM tomorrow (even if daylight saving changes!).
+
+#interval.range(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/interval.js)
+
+Returns an array of dates representing every interval boundary after or equal to *start* (inclusive) and before *stop* (exclusive). If *step* is specified, then every *step*th boundary will be returned; for example, for the [d3.timeDay](#timeDay) interval a *step* of 2 will return every other day. If *step* is not an integer, it is [floored](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor).
+
+The first date in the returned array is the earliest boundary after or equal to *start*; subsequent dates are [offset](#interval_offset) by *step* intervals and [floored](#interval_floor). Thus, two overlapping ranges may be consistent. For example, this range contains odd days:
+
+```js
+d3.timeDay.range(new Date(2015, 0, 1), new Date(2015, 0, 7), 2) // [2015-01-01T00:00, 2015-01-03T00:00, 2015-01-05T00:00]
+```
+
+While this contains even days:
+
+```js
+d3.timeDay.range(new Date(2015, 0, 2), new Date(2015, 0, 8), 2) // [2015-01-02T00:00, 2015-01-04T00:00, 2015-01-06T00:00]
+```
+
+To make ranges consistent when a *step* is specified, use [*interval*.every](#interval_every) instead.
+
+#interval.filter(test) · [Source](https://github.com/d3/d3-time/blob/main/src/interval.js)
+
+Returns a new interval that is a filtered subset of this interval using the specified *test* function. The *test* function is passed a date and should return true if and only if the specified date should be considered part of the interval. For example, to create an interval that returns the 1st, 11th, 21th and 31th (if it exists) of each month:
+
+```js
+d3.timeDay.filter(d => (d.getDate() - 1) % 10 === 0)
+```
+
+The returned filtered interval does not support [*interval*.count](#interval_count). See also [*interval*.every](#interval_every).
+
+#interval.every(step) · [Source](https://github.com/d3/d3-time/blob/main/src/interval.js)
+
+Returns a [filtered](#interval_filter) view of this interval representing every *step*th date. The meaning of *step* is dependent on this interval’s parent interval as defined by the field function. For example, [d3.timeMinute](#timeMinute).every(15) returns an interval representing every fifteen minutes, starting on the hour: :00, :15, :30, :45, etc. Note that for some intervals, the resulting dates may not be uniformly-spaced; [d3.timeDay](#timeDay)’s parent interval is [d3.timeMonth](#timeMonth), and thus the interval number resets at the start of each month. If *step* is not valid, returns null. If *step* is one, returns this interval.
+
+This method can be used in conjunction with [*interval*.range](#interval_range) to ensure that two overlapping ranges are consistent. For example, this range contains odd days:
+
+```js
+d3.timeDay.every(2).range(new Date(2015, 0, 1), new Date(2015, 0, 7)) // [2015-01-01T00:00, 2015-01-03T00:00, 2015-01-05T00:00]
+```
+
+As does this one:
+
+```js
+d3.timeDay.every(2).range(new Date(2015, 0, 2), new Date(2015, 0, 8)) // [2015-01-03T00:00, 2015-01-05T00:00, 2015-01-07T00:00]
+```
+
+The returned filtered interval does not support [*interval*.count](#interval_count). See also [*interval*.filter](#interval_filter).
+
+#interval.count(start, end) · [Source](https://github.com/d3/d3-time/blob/main/src/interval.js)
+
+Returns the number of interval boundaries after *start* (exclusive) and before or equal to *end* (inclusive). Note that this behavior is slightly different than [*interval*.range](#interval_range) because its purpose is to return the zero-based number of the specified *end* date relative to the specified *start* date. For example, to compute the current zero-based day-of-year number:
+
+```js
+d3.timeDay.count(d3.timeYear(now), now) // 177
+```
+
+Likewise, to compute the current zero-based week-of-year number for weeks that start on Sunday:
+
+```js
+d3.timeSunday.count(d3.timeYear(now), now) // 25
+```
+
+# d3.timeInterval(floor, offset[, count[, field]]) · [Source](https://github.com/d3/d3-time/blob/main/src/interval.js)
+
+Constructs a new custom interval given the specified *floor* and *offset* functions and an optional *count* function.
+
+The *floor* function takes a single date as an argument and rounds it down to the nearest interval boundary.
+
+The *offset* function takes a date and an integer step as arguments and advances the specified date by the specified number of boundaries; the step may be positive, negative or zero.
+
+The optional *count* function takes a start date and an end date, already floored to the current interval, and returns the number of boundaries between the start (exclusive) and end (inclusive). If a *count* function is not specified, the returned interval does not expose [*interval*.count](#interval_count) or [*interval*.every](#interval_every) methods. Note: due to an internal optimization, the specified *count* function must not invoke *interval*.count on other time intervals.
+
+The optional *field* function takes a date, already floored to the current interval, and returns the field value of the specified date, corresponding to the number of boundaries between this date (exclusive) and the latest previous parent boundary. For example, for the [d3.timeDay](#timeDay) interval, this returns the number of days since the start of the month. If a *field* function is not specified, it defaults to counting the number of interval boundaries since the UNIX epoch of January 1, 1970 UTC. The *field* function defines the behavior of [*interval*.every](#interval_every).
+
+### Intervals
+
+The following intervals are provided:
+
+# d3.timeMillisecond · [Source](https://github.com/d3/d3-time/blob/main/src/millisecond.js "Source")
+ # d3.utcMillisecond
+
+Milliseconds; the shortest available time unit.
+
+# d3.timeSecond · [Source](https://github.com/d3/d3-time/blob/main/src/second.js "Source")
+ # d3.utcSecond
+
+Seconds (e.g., 01:23:45.0000 AM); 1,000 milliseconds.
+
+# d3.timeMinute · [Source](https://github.com/d3/d3-time/blob/main/src/minute.js "Source")
+ # d3.utcMinute · [Source](https://github.com/d3/d3-time/blob/main/src/utcMinute.js "Source")
+
+Minutes (e.g., 01:02:00 AM); 60 seconds. Note that ECMAScript [ignores leap seconds](http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.1).
+
+# d3.timeHour · [Source](https://github.com/d3/d3-time/blob/main/src/hour.js "Source")
+ # d3.utcHour · [Source](https://github.com/d3/d3-time/blob/main/src/utcHour.js "Source")
+
+Hours (e.g., 01:00 AM); 60 minutes. Note that advancing time by one hour in local time can return the same hour or skip an hour due to daylight saving.
+
+# d3.timeDay · [Source](https://github.com/d3/d3-time/blob/main/src/day.js "Source")
+ # d3.utcDay · [Source](https://github.com/d3/d3-time/blob/main/src/utcDay.js "Source")
+ # d3.unixDay · [Source](https://github.com/d3/d3-time/blob/main/src/unixDay.js "Source")
+
+Days (e.g., February 7, 2012 at 12:00 AM); typically 24 hours. Days in local time may range from 23 to 25 hours due to daylight saving. d3.unixDay is like [d3.utcDay](#timeDay), except it counts days since the UNIX epoch (January 1, 1970) such that *interval*.every returns uniformly-spaced dates rather than varying based on day-of-month.
+
+# d3.timeWeek · [Source](https://github.com/d3/d3-time/blob/main/src/week.js "Source")
+ # d3.utcWeek · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js "Source")
+
+Alias for [d3.timeSunday](#timeSunday); 7 days and typically 168 hours. Weeks in local time may range from 167 to 169 hours due to daylight saving.
+
+# d3.timeSunday · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcSunday · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Sunday-based weeks (e.g., February 5, 2012 at 12:00 AM).
+
+# d3.timeMonday · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcMonday · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Monday-based weeks (e.g., February 6, 2012 at 12:00 AM).
+
+# d3.timeTuesday · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcTuesday · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Tuesday-based weeks (e.g., February 7, 2012 at 12:00 AM).
+
+# d3.timeWednesday · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcWednesday · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Wednesday-based weeks (e.g., February 8, 2012 at 12:00 AM).
+
+# d3.timeThursday · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcThursday · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Thursday-based weeks (e.g., February 9, 2012 at 12:00 AM).
+
+# d3.timeFriday · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcFriday · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Friday-based weeks (e.g., February 10, 2012 at 12:00 AM).
+
+# d3.timeSaturday · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcSaturday · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Saturday-based weeks (e.g., February 11, 2012 at 12:00 AM).
+
+# d3.timeMonth · [Source](https://github.com/d3/d3-time/blob/main/src/month.js "Source")
+ # d3.utcMonth · [Source](https://github.com/d3/d3-time/blob/main/src/utcMonth.js "Source")
+
+Months (e.g., February 1, 2012 at 12:00 AM); ranges from 28 to 31 days.
+
+# d3.timeYear · [Source](https://github.com/d3/d3-time/blob/main/src/year.js "Source")
+ # d3.utcYear · [Source](https://github.com/d3/d3-time/blob/main/src/utcYear.js "Source")
+
+Years (e.g., January 1, 2012 at 12:00 AM); ranges from 365 to 366 days.
+
+### Ranges
+
+For convenience, aliases for [*interval*.range](#interval_range) are also provided as plural forms of the corresponding interval.
+
+# d3.timeMilliseconds(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/millisecond.js)
+ # d3.utcMilliseconds(start, stop[, step])
+
+Aliases for [d3.timeMillisecond](#timeMillisecond).[range](#interval_range) and [d3.utcMillisecond](#timeMillisecond).[range](#interval_range).
+
+# d3.timeSeconds(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/second.js)
+ # d3.utcSeconds(start, stop[, step])
+
+Aliases for [d3.timeSecond](#timeSecond).[range](#interval_range) and [d3.utcSecond](#timeSecond).[range](#interval_range).
+
+# d3.timeMinutes(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/minute.js)
+ # d3.utcMinutes(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcMinute.js)
+
+Aliases for [d3.timeMinute](#timeMinute).[range](#interval_range) and [d3.utcMinute](#timeMinute).[range](#interval_range).
+
+# d3.timeHours(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/hour.js)
+ # d3.utcHours(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcHour.js)
+
+Aliases for [d3.timeHour](#timeHour).[range](#interval_range) and [d3.utcHour](#timeHour).[range](#interval_range).
+
+# d3.timeDays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/day.js)
+ # d3.utcDays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcDay.js)
+ # d3.unixDays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/unixDay.js)
+
+Aliases for [d3.timeDay](#timeDay).[range](#interval_range), [d3.utcDay](#timeDay).[range](#interval_range), and [d3.unixDay](#timeDay).[range](#interval_range).
+
+# d3.timeWeeks(start, stop[, step])
+ # d3.utcWeeks(start, stop[, step])
+
+Aliases for [d3.timeWeek](#timeWeek).[range](#interval_range) and [d3.utcWeek](#timeWeek).[range](#interval_range).
+
+# d3.timeSundays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcSundays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Aliases for [d3.timeSunday](#timeSunday).[range](#interval_range) and [d3.utcSunday](#timeSunday).[range](#interval_range).
+
+# d3.timeMondays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcMondays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Aliases for [d3.timeMonday](#timeMonday).[range](#interval_range) and [d3.utcMonday](#timeMonday).[range](#interval_range).
+
+# d3.timeTuesdays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcTuesdays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Aliases for [d3.timeTuesday](#timeTuesday).[range](#interval_range) and [d3.utcTuesday](#timeTuesday).[range](#interval_range).
+
+# d3.timeWednesdays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcWednesdays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Aliases for [d3.timeWednesday](#timeWednesday).[range](#interval_range) and [d3.utcWednesday](#timeWednesday).[range](#interval_range).
+
+# d3.timeThursdays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcThursdays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Aliases for [d3.timeThursday](#timeThursday).[range](#interval_range) and [d3.utcThursday](#timeThursday).[range](#interval_range).
+
+# d3.timeFridays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcFridays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Aliases for [d3.timeFriday](#timeFriday).[range](#interval_range) and [d3.utcFriday](#timeFriday).[range](#interval_range).
+
+# d3.timeSaturdays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/week.js)
+ # d3.utcSaturdays(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcWeek.js)
+
+Aliases for [d3.timeSaturday](#timeSaturday).[range](#interval_range) and [d3.utcSaturday](#timeSaturday).[range](#interval_range).
+
+# d3.timeMonths(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/month.js)
+ # d3.utcMonths(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcMonth.js)
+
+Aliases for [d3.timeMonth](#timeMonth).[range](#interval_range) and [d3.utcMonth](#timeMonth).[range](#interval_range).
+
+# d3.timeYears(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/year.js)
+ # d3.utcYears(start, stop[, step]) · [Source](https://github.com/d3/d3-time/blob/main/src/utcYear.js)
+
+Aliases for [d3.timeYear](#timeYear).[range](#interval_range) and [d3.utcYear](#timeYear).[range](#interval_range).
+
+### Ticks
+
+# d3.timeTicks(start, stop, count) · [Source](https://github.com/d3/d3-time/blob/main/src/ticks.js)
+
+Equivalent to [d3.utcTicks](#utcTicks), but in local time.
+
+# d3.timeTickInterval(start, stop, count) · [Source](https://github.com/d3/d3-time/blob/main/src/ticks.js)
+
+Returns the time interval that would be used by [d3.timeTicks](#timeTicks) given the same arguments.
+
+# d3.utcTicks(start, stop, count) · [Source](https://github.com/d3/d3-time/blob/main/src/ticks.js)
+
+Returns an array of approximately *count* dates at regular intervals between *start* and *stop* (inclusive). If *stop* is before *start*, dates are returned in reverse chronological order; otherwise dates are returned in chronological order. The following UTC time intervals are considered:
+
+* 1 second
+* 5 seconds
+* 15 seconds
+* 30 seconds
+* 1 minute
+* 5 minutes
+* 15 minutes
+* 30 minutes
+* 1 hour
+* 3 hours
+* 6 hours
+* 12 hours
+* 1 day
+* 2 days
+* 1 week
+* 1 month
+* 3 months
+* 1 year
+
+Multiples of milliseconds (for small ranges) and years (for large ranges) are also considered, following the rules of [d3.ticks](https://github.com/d3/d3-array/blob/main/README.md#ticks). The interval producing the number of dates that is closest to *count* is used. For example:
+
+```js
+start = new Date(Date.UTC(1970, 2, 1))
+stop = new Date(Date.UTC(1996, 2, 19))
+count = 4
+d3.utcTicks(start, stop, count) // [1975-01-01, 1980-01-01, 1985-01-01, 1990-01-01, 1995-01-01]
+```
+
+If *count* is a time interval, this function behaves similarly to [*interval*.range](#interval_range) except that both *start* and *stop* are inclusive and it may return dates in reverse chronological order if *stop* is before *start*.
+
+# d3.utcTickInterval(start, stop, count) · [Source](https://github.com/d3/d3-time/blob/main/src/ticks.js)
+
+Returns the time interval that would be used by [d3.utcTicks](#utcTicks) given the same arguments. If there is no associated interval, such as when *start* or *stop* is invalid, returns null.
diff --git a/node_modules/d3-scale/node_modules/d3-time/dist/d3-time.js b/node_modules/d3-scale/node_modules/d3-time/dist/d3-time.js
new file mode 100644
index 0000000000000000000000000000000000000000..6ca6e2d21e814cbb0e5baa457a34ed4c679b21be
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/dist/d3-time.js
@@ -0,0 +1,445 @@
+// https://d3js.org/d3-time/ v3.1.0 Copyright 2010-2022 Mike Bostock
+(function (global, factory) {
+typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array')) :
+typeof define === 'function' && define.amd ? define(['exports', 'd3-array'], factory) :
+(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3));
+})(this, (function (exports, d3Array) { 'use strict';
+
+const t0 = new Date, t1 = new Date;
+
+function timeInterval(floori, offseti, count, field) {
+
+ function interval(date) {
+ return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
+ }
+
+ interval.floor = (date) => {
+ return floori(date = new Date(+date)), date;
+ };
+
+ interval.ceil = (date) => {
+ return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
+ };
+
+ interval.round = (date) => {
+ const d0 = interval(date), d1 = interval.ceil(date);
+ return date - d0 < d1 - date ? d0 : d1;
+ };
+
+ interval.offset = (date, step) => {
+ return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
+ };
+
+ interval.range = (start, stop, step) => {
+ const range = [];
+ start = interval.ceil(start);
+ step = step == null ? 1 : Math.floor(step);
+ if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
+ let previous;
+ do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
+ while (previous < start && start < stop);
+ return range;
+ };
+
+ interval.filter = (test) => {
+ return timeInterval((date) => {
+ if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
+ }, (date, step) => {
+ if (date >= date) {
+ if (step < 0) while (++step <= 0) {
+ while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
+ } else while (--step >= 0) {
+ while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
+ }
+ }
+ });
+ };
+
+ if (count) {
+ interval.count = (start, end) => {
+ t0.setTime(+start), t1.setTime(+end);
+ floori(t0), floori(t1);
+ return Math.floor(count(t0, t1));
+ };
+
+ interval.every = (step) => {
+ step = Math.floor(step);
+ return !isFinite(step) || !(step > 0) ? null
+ : !(step > 1) ? interval
+ : interval.filter(field
+ ? (d) => field(d) % step === 0
+ : (d) => interval.count(0, d) % step === 0);
+ };
+ }
+
+ return interval;
+}
+
+const millisecond = timeInterval(() => {
+ // noop
+}, (date, step) => {
+ date.setTime(+date + step);
+}, (start, end) => {
+ return end - start;
+});
+
+// An optimized implementation for this simple case.
+millisecond.every = (k) => {
+ k = Math.floor(k);
+ if (!isFinite(k) || !(k > 0)) return null;
+ if (!(k > 1)) return millisecond;
+ return timeInterval((date) => {
+ date.setTime(Math.floor(date / k) * k);
+ }, (date, step) => {
+ date.setTime(+date + step * k);
+ }, (start, end) => {
+ return (end - start) / k;
+ });
+};
+
+const milliseconds = millisecond.range;
+
+const durationSecond = 1000;
+const durationMinute = durationSecond * 60;
+const durationHour = durationMinute * 60;
+const durationDay = durationHour * 24;
+const durationWeek = durationDay * 7;
+const durationMonth = durationDay * 30;
+const durationYear = durationDay * 365;
+
+const second = timeInterval((date) => {
+ date.setTime(date - date.getMilliseconds());
+}, (date, step) => {
+ date.setTime(+date + step * durationSecond);
+}, (start, end) => {
+ return (end - start) / durationSecond;
+}, (date) => {
+ return date.getUTCSeconds();
+});
+
+const seconds = second.range;
+
+const timeMinute = timeInterval((date) => {
+ date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
+}, (date, step) => {
+ date.setTime(+date + step * durationMinute);
+}, (start, end) => {
+ return (end - start) / durationMinute;
+}, (date) => {
+ return date.getMinutes();
+});
+
+const timeMinutes = timeMinute.range;
+
+const utcMinute = timeInterval((date) => {
+ date.setUTCSeconds(0, 0);
+}, (date, step) => {
+ date.setTime(+date + step * durationMinute);
+}, (start, end) => {
+ return (end - start) / durationMinute;
+}, (date) => {
+ return date.getUTCMinutes();
+});
+
+const utcMinutes = utcMinute.range;
+
+const timeHour = timeInterval((date) => {
+ date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
+}, (date, step) => {
+ date.setTime(+date + step * durationHour);
+}, (start, end) => {
+ return (end - start) / durationHour;
+}, (date) => {
+ return date.getHours();
+});
+
+const timeHours = timeHour.range;
+
+const utcHour = timeInterval((date) => {
+ date.setUTCMinutes(0, 0, 0);
+}, (date, step) => {
+ date.setTime(+date + step * durationHour);
+}, (start, end) => {
+ return (end - start) / durationHour;
+}, (date) => {
+ return date.getUTCHours();
+});
+
+const utcHours = utcHour.range;
+
+const timeDay = timeInterval(
+ date => date.setHours(0, 0, 0, 0),
+ (date, step) => date.setDate(date.getDate() + step),
+ (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
+ date => date.getDate() - 1
+);
+
+const timeDays = timeDay.range;
+
+const utcDay = timeInterval((date) => {
+ date.setUTCHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setUTCDate(date.getUTCDate() + step);
+}, (start, end) => {
+ return (end - start) / durationDay;
+}, (date) => {
+ return date.getUTCDate() - 1;
+});
+
+const utcDays = utcDay.range;
+
+const unixDay = timeInterval((date) => {
+ date.setUTCHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setUTCDate(date.getUTCDate() + step);
+}, (start, end) => {
+ return (end - start) / durationDay;
+}, (date) => {
+ return Math.floor(date / durationDay);
+});
+
+const unixDays = unixDay.range;
+
+function timeWeekday(i) {
+ return timeInterval((date) => {
+ date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
+ date.setHours(0, 0, 0, 0);
+ }, (date, step) => {
+ date.setDate(date.getDate() + step * 7);
+ }, (start, end) => {
+ return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
+ });
+}
+
+const timeSunday = timeWeekday(0);
+const timeMonday = timeWeekday(1);
+const timeTuesday = timeWeekday(2);
+const timeWednesday = timeWeekday(3);
+const timeThursday = timeWeekday(4);
+const timeFriday = timeWeekday(5);
+const timeSaturday = timeWeekday(6);
+
+const timeSundays = timeSunday.range;
+const timeMondays = timeMonday.range;
+const timeTuesdays = timeTuesday.range;
+const timeWednesdays = timeWednesday.range;
+const timeThursdays = timeThursday.range;
+const timeFridays = timeFriday.range;
+const timeSaturdays = timeSaturday.range;
+
+function utcWeekday(i) {
+ return timeInterval((date) => {
+ date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
+ date.setUTCHours(0, 0, 0, 0);
+ }, (date, step) => {
+ date.setUTCDate(date.getUTCDate() + step * 7);
+ }, (start, end) => {
+ return (end - start) / durationWeek;
+ });
+}
+
+const utcSunday = utcWeekday(0);
+const utcMonday = utcWeekday(1);
+const utcTuesday = utcWeekday(2);
+const utcWednesday = utcWeekday(3);
+const utcThursday = utcWeekday(4);
+const utcFriday = utcWeekday(5);
+const utcSaturday = utcWeekday(6);
+
+const utcSundays = utcSunday.range;
+const utcMondays = utcMonday.range;
+const utcTuesdays = utcTuesday.range;
+const utcWednesdays = utcWednesday.range;
+const utcThursdays = utcThursday.range;
+const utcFridays = utcFriday.range;
+const utcSaturdays = utcSaturday.range;
+
+const timeMonth = timeInterval((date) => {
+ date.setDate(1);
+ date.setHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setMonth(date.getMonth() + step);
+}, (start, end) => {
+ return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
+}, (date) => {
+ return date.getMonth();
+});
+
+const timeMonths = timeMonth.range;
+
+const utcMonth = timeInterval((date) => {
+ date.setUTCDate(1);
+ date.setUTCHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setUTCMonth(date.getUTCMonth() + step);
+}, (start, end) => {
+ return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
+}, (date) => {
+ return date.getUTCMonth();
+});
+
+const utcMonths = utcMonth.range;
+
+const timeYear = timeInterval((date) => {
+ date.setMonth(0, 1);
+ date.setHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setFullYear(date.getFullYear() + step);
+}, (start, end) => {
+ return end.getFullYear() - start.getFullYear();
+}, (date) => {
+ return date.getFullYear();
+});
+
+// An optimized implementation for this simple case.
+timeYear.every = (k) => {
+ return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
+ date.setFullYear(Math.floor(date.getFullYear() / k) * k);
+ date.setMonth(0, 1);
+ date.setHours(0, 0, 0, 0);
+ }, (date, step) => {
+ date.setFullYear(date.getFullYear() + step * k);
+ });
+};
+
+const timeYears = timeYear.range;
+
+const utcYear = timeInterval((date) => {
+ date.setUTCMonth(0, 1);
+ date.setUTCHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setUTCFullYear(date.getUTCFullYear() + step);
+}, (start, end) => {
+ return end.getUTCFullYear() - start.getUTCFullYear();
+}, (date) => {
+ return date.getUTCFullYear();
+});
+
+// An optimized implementation for this simple case.
+utcYear.every = (k) => {
+ return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
+ date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
+ date.setUTCMonth(0, 1);
+ date.setUTCHours(0, 0, 0, 0);
+ }, (date, step) => {
+ date.setUTCFullYear(date.getUTCFullYear() + step * k);
+ });
+};
+
+const utcYears = utcYear.range;
+
+function ticker(year, month, week, day, hour, minute) {
+
+ const tickIntervals = [
+ [second, 1, durationSecond],
+ [second, 5, 5 * durationSecond],
+ [second, 15, 15 * durationSecond],
+ [second, 30, 30 * durationSecond],
+ [minute, 1, durationMinute],
+ [minute, 5, 5 * durationMinute],
+ [minute, 15, 15 * durationMinute],
+ [minute, 30, 30 * durationMinute],
+ [ hour, 1, durationHour ],
+ [ hour, 3, 3 * durationHour ],
+ [ hour, 6, 6 * durationHour ],
+ [ hour, 12, 12 * durationHour ],
+ [ day, 1, durationDay ],
+ [ day, 2, 2 * durationDay ],
+ [ week, 1, durationWeek ],
+ [ month, 1, durationMonth ],
+ [ month, 3, 3 * durationMonth ],
+ [ year, 1, durationYear ]
+ ];
+
+ function ticks(start, stop, count) {
+ const reverse = stop < start;
+ if (reverse) [start, stop] = [stop, start];
+ const interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count);
+ const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop
+ return reverse ? ticks.reverse() : ticks;
+ }
+
+ function tickInterval(start, stop, count) {
+ const target = Math.abs(stop - start) / count;
+ const i = d3Array.bisector(([,, step]) => step).right(tickIntervals, target);
+ if (i === tickIntervals.length) return year.every(d3Array.tickStep(start / durationYear, stop / durationYear, count));
+ if (i === 0) return millisecond.every(Math.max(d3Array.tickStep(start, stop, count), 1));
+ const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
+ return t.every(step);
+ }
+
+ return [ticks, tickInterval];
+}
+
+const [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);
+const [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);
+
+exports.timeDay = timeDay;
+exports.timeDays = timeDays;
+exports.timeFriday = timeFriday;
+exports.timeFridays = timeFridays;
+exports.timeHour = timeHour;
+exports.timeHours = timeHours;
+exports.timeInterval = timeInterval;
+exports.timeMillisecond = millisecond;
+exports.timeMilliseconds = milliseconds;
+exports.timeMinute = timeMinute;
+exports.timeMinutes = timeMinutes;
+exports.timeMonday = timeMonday;
+exports.timeMondays = timeMondays;
+exports.timeMonth = timeMonth;
+exports.timeMonths = timeMonths;
+exports.timeSaturday = timeSaturday;
+exports.timeSaturdays = timeSaturdays;
+exports.timeSecond = second;
+exports.timeSeconds = seconds;
+exports.timeSunday = timeSunday;
+exports.timeSundays = timeSundays;
+exports.timeThursday = timeThursday;
+exports.timeThursdays = timeThursdays;
+exports.timeTickInterval = timeTickInterval;
+exports.timeTicks = timeTicks;
+exports.timeTuesday = timeTuesday;
+exports.timeTuesdays = timeTuesdays;
+exports.timeWednesday = timeWednesday;
+exports.timeWednesdays = timeWednesdays;
+exports.timeWeek = timeSunday;
+exports.timeWeeks = timeSundays;
+exports.timeYear = timeYear;
+exports.timeYears = timeYears;
+exports.unixDay = unixDay;
+exports.unixDays = unixDays;
+exports.utcDay = utcDay;
+exports.utcDays = utcDays;
+exports.utcFriday = utcFriday;
+exports.utcFridays = utcFridays;
+exports.utcHour = utcHour;
+exports.utcHours = utcHours;
+exports.utcMillisecond = millisecond;
+exports.utcMilliseconds = milliseconds;
+exports.utcMinute = utcMinute;
+exports.utcMinutes = utcMinutes;
+exports.utcMonday = utcMonday;
+exports.utcMondays = utcMondays;
+exports.utcMonth = utcMonth;
+exports.utcMonths = utcMonths;
+exports.utcSaturday = utcSaturday;
+exports.utcSaturdays = utcSaturdays;
+exports.utcSecond = second;
+exports.utcSeconds = seconds;
+exports.utcSunday = utcSunday;
+exports.utcSundays = utcSundays;
+exports.utcThursday = utcThursday;
+exports.utcThursdays = utcThursdays;
+exports.utcTickInterval = utcTickInterval;
+exports.utcTicks = utcTicks;
+exports.utcTuesday = utcTuesday;
+exports.utcTuesdays = utcTuesdays;
+exports.utcWednesday = utcWednesday;
+exports.utcWednesdays = utcWednesdays;
+exports.utcWeek = utcSunday;
+exports.utcWeeks = utcSundays;
+exports.utcYear = utcYear;
+exports.utcYears = utcYears;
+
+}));
diff --git a/node_modules/d3-scale/node_modules/d3-time/dist/d3-time.min.js b/node_modules/d3-scale/node_modules/d3-time/dist/d3-time.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..27b04dbbd76f57b75433ba3162fdfa1f0d3b6fe0
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/dist/d3-time.min.js
@@ -0,0 +1,2 @@
+// https://d3js.org/d3-time/ v3.1.0 Copyright 2010-2022 Mike Bostock
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).d3=e.d3||{},e.d3)}(this,(function(e,t){"use strict";const n=new Date,s=new Date;function r(e,t,a,u){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,s,r)=>{const a=[];if(n=i.ceil(n),r=null==r?1:Math.floor(r),!(n0))return a;let u;do{a.push(u=new Date(+n)),t(n,r),e(n)}while(ur((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,s)=>{if(e>=e)if(s<0)for(;++s<=0;)for(;t(e,-1),!n(e););else for(;--s>=0;)for(;t(e,1),!n(e););})),a&&(i.count=(t,r)=>(n.setTime(+t),s.setTime(+r),e(n),e(s),Math.floor(a(n,s))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(u?t=>u(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const a=r((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e));a.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):a:null);const u=a.range,i=1e3,o=6e4,l=36e5,c=864e5,g=6048e5,T=2592e6,d=31536e6,f=r((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*i)}),((e,t)=>(t-e)/i),(e=>e.getUTCSeconds())),m=f.range,y=r((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*i)}),((e,t)=>{e.setTime(+e+t*o)}),((e,t)=>(t-e)/o),(e=>e.getMinutes())),M=y.range,h=r((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*o)}),((e,t)=>(t-e)/o),(e=>e.getUTCMinutes())),C=h.range,U=r((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*i-e.getMinutes()*o)}),((e,t)=>{e.setTime(+e+t*l)}),((e,t)=>(t-e)/l),(e=>e.getHours())),D=U.range,F=r((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*l)}),((e,t)=>(t-e)/l),(e=>e.getUTCHours())),Y=F.range,S=r((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*o)/c),(e=>e.getDate()-1)),H=S.range,p=r((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/c),(e=>e.getUTCDate()-1)),v=p.range,k=r((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/c),(e=>Math.floor(e/c))),w=k.range;function W(e){return r((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*o)/g))}const x=W(0),b=W(1),z=W(2),O=W(3),I=W(4),j=W(5),q=W(6),A=x.range,B=b.range,E=z.range,G=O.range,J=I.range,K=j.range,L=q.range;function N(e){return r((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/g))}const P=N(0),Q=N(1),R=N(2),V=N(3),X=N(4),Z=N(5),$=N(6),_=P.range,ee=Q.range,te=R.range,ne=V.range,se=X.range,re=Z.range,ae=$.range,ue=r((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth())),ie=ue.range,oe=r((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth())),le=oe.range,ce=r((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));ce.every=e=>isFinite(e=Math.floor(e))&&e>0?r((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null;const ge=ce.range,Te=r((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));Te.every=e=>isFinite(e=Math.floor(e))&&e>0?r((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null;const de=Te.range;function fe(e,n,s,r,u,m){const y=[[f,1,i],[f,5,5e3],[f,15,15e3],[f,30,3e4],[m,1,o],[m,5,3e5],[m,15,9e5],[m,30,18e5],[u,1,l],[u,3,108e5],[u,6,216e5],[u,12,432e5],[r,1,c],[r,2,1728e5],[s,1,g],[n,1,T],[n,3,7776e6],[e,1,d]];function M(n,s,r){const u=Math.abs(s-n)/r,i=t.bisector((([,,e])=>e)).right(y,u);if(i===y.length)return e.every(t.tickStep(n/d,s/d,r));if(0===i)return a.every(Math.max(t.tickStep(n,s,r),1));const[o,l]=y[u/y[i-1][2]=12"
+ }
+}
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/day.js b/node_modules/d3-scale/node_modules/d3-time/src/day.js
new file mode 100644
index 0000000000000000000000000000000000000000..2b5d4b6ecf25983159fdab35d529285f4fc802ef
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/day.js
@@ -0,0 +1,35 @@
+import {timeInterval} from "./interval.js";
+import {durationDay, durationMinute} from "./duration.js";
+
+export const timeDay = timeInterval(
+ date => date.setHours(0, 0, 0, 0),
+ (date, step) => date.setDate(date.getDate() + step),
+ (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
+ date => date.getDate() - 1
+);
+
+export const timeDays = timeDay.range;
+
+export const utcDay = timeInterval((date) => {
+ date.setUTCHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setUTCDate(date.getUTCDate() + step);
+}, (start, end) => {
+ return (end - start) / durationDay;
+}, (date) => {
+ return date.getUTCDate() - 1;
+});
+
+export const utcDays = utcDay.range;
+
+export const unixDay = timeInterval((date) => {
+ date.setUTCHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setUTCDate(date.getUTCDate() + step);
+}, (start, end) => {
+ return (end - start) / durationDay;
+}, (date) => {
+ return Math.floor(date / durationDay);
+});
+
+export const unixDays = unixDay.range;
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/duration.js b/node_modules/d3-scale/node_modules/d3-time/src/duration.js
new file mode 100644
index 0000000000000000000000000000000000000000..341fa8fe8f480474c10c3faca32a38407534704a
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/duration.js
@@ -0,0 +1,7 @@
+export const durationSecond = 1000;
+export const durationMinute = durationSecond * 60;
+export const durationHour = durationMinute * 60;
+export const durationDay = durationHour * 24;
+export const durationWeek = durationDay * 7;
+export const durationMonth = durationDay * 30;
+export const durationYear = durationDay * 365;
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/hour.js b/node_modules/d3-scale/node_modules/d3-time/src/hour.js
new file mode 100644
index 0000000000000000000000000000000000000000..77b77a3b59a8120a5ecdbccdd28302491d4b459e
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/hour.js
@@ -0,0 +1,26 @@
+import {timeInterval} from "./interval.js";
+import {durationHour, durationMinute, durationSecond} from "./duration.js";
+
+export const timeHour = timeInterval((date) => {
+ date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
+}, (date, step) => {
+ date.setTime(+date + step * durationHour);
+}, (start, end) => {
+ return (end - start) / durationHour;
+}, (date) => {
+ return date.getHours();
+});
+
+export const timeHours = timeHour.range;
+
+export const utcHour = timeInterval((date) => {
+ date.setUTCMinutes(0, 0, 0);
+}, (date, step) => {
+ date.setTime(+date + step * durationHour);
+}, (start, end) => {
+ return (end - start) / durationHour;
+}, (date) => {
+ return date.getUTCHours();
+});
+
+export const utcHours = utcHour.range;
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/index.js b/node_modules/d3-scale/node_modules/d3-time/src/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..d6dfd9024f2eb0a1d50f70bd091e4fb025221091
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/index.js
@@ -0,0 +1,96 @@
+export {
+ timeInterval
+} from "./interval.js";
+
+export {
+ millisecond as utcMillisecond,
+ milliseconds as utcMilliseconds,
+ millisecond as timeMillisecond,
+ milliseconds as timeMilliseconds
+} from "./millisecond.js";
+
+export {
+ second as utcSecond,
+ seconds as utcSeconds,
+ second as timeSecond,
+ seconds as timeSeconds
+} from "./second.js";
+
+export {
+ timeMinute,
+ timeMinutes,
+ utcMinute,
+ utcMinutes
+} from "./minute.js";
+
+export {
+ timeHour,
+ timeHours,
+ utcHour,
+ utcHours
+} from "./hour.js";
+
+export {
+ timeDay,
+ timeDays,
+ utcDay,
+ utcDays,
+ unixDay,
+ unixDays
+} from "./day.js";
+
+export {
+ timeSunday as timeWeek,
+ timeSundays as timeWeeks,
+ timeSunday,
+ timeSundays,
+ timeMonday,
+ timeMondays,
+ timeTuesday,
+ timeTuesdays,
+ timeWednesday,
+ timeWednesdays,
+ timeThursday,
+ timeThursdays,
+ timeFriday,
+ timeFridays,
+ timeSaturday,
+ timeSaturdays,
+ utcSunday as utcWeek,
+ utcSundays as utcWeeks,
+ utcSunday,
+ utcSundays,
+ utcMonday,
+ utcMondays,
+ utcTuesday,
+ utcTuesdays,
+ utcWednesday,
+ utcWednesdays,
+ utcThursday,
+ utcThursdays,
+ utcFriday,
+ utcFridays,
+ utcSaturday,
+ utcSaturdays
+} from "./week.js";
+
+export {
+ timeMonth,
+ timeMonths,
+ utcMonth,
+ utcMonths
+} from "./month.js";
+
+export {
+ timeYear,
+ timeYears,
+ utcYear,
+ utcYears
+} from "./year.js";
+
+export {
+ utcTicks,
+ utcTickInterval,
+ timeTicks,
+ timeTickInterval
+} from "./ticks.js";
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/interval.js b/node_modules/d3-scale/node_modules/d3-time/src/interval.js
new file mode 100644
index 0000000000000000000000000000000000000000..492ae909e7d72d4af401b0da86fd0fb4ca2f0a01
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/interval.js
@@ -0,0 +1,69 @@
+const t0 = new Date, t1 = new Date;
+
+export function timeInterval(floori, offseti, count, field) {
+
+ function interval(date) {
+ return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
+ }
+
+ interval.floor = (date) => {
+ return floori(date = new Date(+date)), date;
+ };
+
+ interval.ceil = (date) => {
+ return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
+ };
+
+ interval.round = (date) => {
+ const d0 = interval(date), d1 = interval.ceil(date);
+ return date - d0 < d1 - date ? d0 : d1;
+ };
+
+ interval.offset = (date, step) => {
+ return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
+ };
+
+ interval.range = (start, stop, step) => {
+ const range = [];
+ start = interval.ceil(start);
+ step = step == null ? 1 : Math.floor(step);
+ if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
+ let previous;
+ do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
+ while (previous < start && start < stop);
+ return range;
+ };
+
+ interval.filter = (test) => {
+ return timeInterval((date) => {
+ if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
+ }, (date, step) => {
+ if (date >= date) {
+ if (step < 0) while (++step <= 0) {
+ while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
+ } else while (--step >= 0) {
+ while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
+ }
+ }
+ });
+ };
+
+ if (count) {
+ interval.count = (start, end) => {
+ t0.setTime(+start), t1.setTime(+end);
+ floori(t0), floori(t1);
+ return Math.floor(count(t0, t1));
+ };
+
+ interval.every = (step) => {
+ step = Math.floor(step);
+ return !isFinite(step) || !(step > 0) ? null
+ : !(step > 1) ? interval
+ : interval.filter(field
+ ? (d) => field(d) % step === 0
+ : (d) => interval.count(0, d) % step === 0);
+ };
+ }
+
+ return interval;
+}
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/millisecond.js b/node_modules/d3-scale/node_modules/d3-time/src/millisecond.js
new file mode 100644
index 0000000000000000000000000000000000000000..e3aa380aa490b6ed5112e039f723f5e281656a55
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/millisecond.js
@@ -0,0 +1,25 @@
+import {timeInterval} from "./interval.js";
+
+export const millisecond = timeInterval(() => {
+ // noop
+}, (date, step) => {
+ date.setTime(+date + step);
+}, (start, end) => {
+ return end - start;
+});
+
+// An optimized implementation for this simple case.
+millisecond.every = (k) => {
+ k = Math.floor(k);
+ if (!isFinite(k) || !(k > 0)) return null;
+ if (!(k > 1)) return millisecond;
+ return timeInterval((date) => {
+ date.setTime(Math.floor(date / k) * k);
+ }, (date, step) => {
+ date.setTime(+date + step * k);
+ }, (start, end) => {
+ return (end - start) / k;
+ });
+};
+
+export const milliseconds = millisecond.range;
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/minute.js b/node_modules/d3-scale/node_modules/d3-time/src/minute.js
new file mode 100644
index 0000000000000000000000000000000000000000..ba8e4d9e045a38297d75c971b2fdec15e020da65
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/minute.js
@@ -0,0 +1,26 @@
+import {timeInterval} from "./interval.js";
+import {durationMinute, durationSecond} from "./duration.js";
+
+export const timeMinute = timeInterval((date) => {
+ date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
+}, (date, step) => {
+ date.setTime(+date + step * durationMinute);
+}, (start, end) => {
+ return (end - start) / durationMinute;
+}, (date) => {
+ return date.getMinutes();
+});
+
+export const timeMinutes = timeMinute.range;
+
+export const utcMinute = timeInterval((date) => {
+ date.setUTCSeconds(0, 0);
+}, (date, step) => {
+ date.setTime(+date + step * durationMinute);
+}, (start, end) => {
+ return (end - start) / durationMinute;
+}, (date) => {
+ return date.getUTCMinutes();
+});
+
+export const utcMinutes = utcMinute.range;
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/month.js b/node_modules/d3-scale/node_modules/d3-time/src/month.js
new file mode 100644
index 0000000000000000000000000000000000000000..6dab69cf570fd74a2eafe024676cabbf6924461f
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/month.js
@@ -0,0 +1,27 @@
+import {timeInterval} from "./interval.js";
+
+export const timeMonth = timeInterval((date) => {
+ date.setDate(1);
+ date.setHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setMonth(date.getMonth() + step);
+}, (start, end) => {
+ return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
+}, (date) => {
+ return date.getMonth();
+});
+
+export const timeMonths = timeMonth.range;
+
+export const utcMonth = timeInterval((date) => {
+ date.setUTCDate(1);
+ date.setUTCHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setUTCMonth(date.getUTCMonth() + step);
+}, (start, end) => {
+ return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
+}, (date) => {
+ return date.getUTCMonth();
+});
+
+export const utcMonths = utcMonth.range;
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/second.js b/node_modules/d3-scale/node_modules/d3-time/src/second.js
new file mode 100644
index 0000000000000000000000000000000000000000..47b2f43c0c8f48c0c9db912a4bab94b9a46381e0
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/second.js
@@ -0,0 +1,14 @@
+import {timeInterval} from "./interval.js";
+import {durationSecond} from "./duration.js";
+
+export const second = timeInterval((date) => {
+ date.setTime(date - date.getMilliseconds());
+}, (date, step) => {
+ date.setTime(+date + step * durationSecond);
+}, (start, end) => {
+ return (end - start) / durationSecond;
+}, (date) => {
+ return date.getUTCSeconds();
+});
+
+export const seconds = second.range;
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/ticks.js b/node_modules/d3-scale/node_modules/d3-time/src/ticks.js
new file mode 100644
index 0000000000000000000000000000000000000000..c314789a0e03f4181cb575726775366efcf87ba9
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/ticks.js
@@ -0,0 +1,58 @@
+import {bisector, tickStep} from "d3-array";
+import {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from "./duration.js";
+import {millisecond} from "./millisecond.js";
+import {second} from "./second.js";
+import {timeMinute, utcMinute} from "./minute.js";
+import {timeHour, utcHour} from "./hour.js";
+import {timeDay, unixDay} from "./day.js";
+import {timeSunday, utcSunday} from "./week.js";
+import {timeMonth, utcMonth} from "./month.js";
+import {timeYear, utcYear} from "./year.js";
+
+function ticker(year, month, week, day, hour, minute) {
+
+ const tickIntervals = [
+ [second, 1, durationSecond],
+ [second, 5, 5 * durationSecond],
+ [second, 15, 15 * durationSecond],
+ [second, 30, 30 * durationSecond],
+ [minute, 1, durationMinute],
+ [minute, 5, 5 * durationMinute],
+ [minute, 15, 15 * durationMinute],
+ [minute, 30, 30 * durationMinute],
+ [ hour, 1, durationHour ],
+ [ hour, 3, 3 * durationHour ],
+ [ hour, 6, 6 * durationHour ],
+ [ hour, 12, 12 * durationHour ],
+ [ day, 1, durationDay ],
+ [ day, 2, 2 * durationDay ],
+ [ week, 1, durationWeek ],
+ [ month, 1, durationMonth ],
+ [ month, 3, 3 * durationMonth ],
+ [ year, 1, durationYear ]
+ ];
+
+ function ticks(start, stop, count) {
+ const reverse = stop < start;
+ if (reverse) [start, stop] = [stop, start];
+ const interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count);
+ const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop
+ return reverse ? ticks.reverse() : ticks;
+ }
+
+ function tickInterval(start, stop, count) {
+ const target = Math.abs(stop - start) / count;
+ const i = bisector(([,, step]) => step).right(tickIntervals, target);
+ if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));
+ if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));
+ const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
+ return t.every(step);
+ }
+
+ return [ticks, tickInterval];
+}
+
+const [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);
+const [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);
+
+export {utcTicks, utcTickInterval, timeTicks, timeTickInterval};
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/week.js b/node_modules/d3-scale/node_modules/d3-time/src/week.js
new file mode 100644
index 0000000000000000000000000000000000000000..f75ff52973632a8d08080e6fb7f8f697d03cd8d3
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/week.js
@@ -0,0 +1,56 @@
+import {timeInterval} from "./interval.js";
+import {durationMinute, durationWeek} from "./duration.js";
+
+function timeWeekday(i) {
+ return timeInterval((date) => {
+ date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
+ date.setHours(0, 0, 0, 0);
+ }, (date, step) => {
+ date.setDate(date.getDate() + step * 7);
+ }, (start, end) => {
+ return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
+ });
+}
+
+export const timeSunday = timeWeekday(0);
+export const timeMonday = timeWeekday(1);
+export const timeTuesday = timeWeekday(2);
+export const timeWednesday = timeWeekday(3);
+export const timeThursday = timeWeekday(4);
+export const timeFriday = timeWeekday(5);
+export const timeSaturday = timeWeekday(6);
+
+export const timeSundays = timeSunday.range;
+export const timeMondays = timeMonday.range;
+export const timeTuesdays = timeTuesday.range;
+export const timeWednesdays = timeWednesday.range;
+export const timeThursdays = timeThursday.range;
+export const timeFridays = timeFriday.range;
+export const timeSaturdays = timeSaturday.range;
+
+function utcWeekday(i) {
+ return timeInterval((date) => {
+ date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
+ date.setUTCHours(0, 0, 0, 0);
+ }, (date, step) => {
+ date.setUTCDate(date.getUTCDate() + step * 7);
+ }, (start, end) => {
+ return (end - start) / durationWeek;
+ });
+}
+
+export const utcSunday = utcWeekday(0);
+export const utcMonday = utcWeekday(1);
+export const utcTuesday = utcWeekday(2);
+export const utcWednesday = utcWeekday(3);
+export const utcThursday = utcWeekday(4);
+export const utcFriday = utcWeekday(5);
+export const utcSaturday = utcWeekday(6);
+
+export const utcSundays = utcSunday.range;
+export const utcMondays = utcMonday.range;
+export const utcTuesdays = utcTuesday.range;
+export const utcWednesdays = utcWednesday.range;
+export const utcThursdays = utcThursday.range;
+export const utcFridays = utcFriday.range;
+export const utcSaturdays = utcSaturday.range;
diff --git a/node_modules/d3-scale/node_modules/d3-time/src/year.js b/node_modules/d3-scale/node_modules/d3-time/src/year.js
new file mode 100644
index 0000000000000000000000000000000000000000..9eadff3454b86abc0ab18dad1e3218d15cb64306
--- /dev/null
+++ b/node_modules/d3-scale/node_modules/d3-time/src/year.js
@@ -0,0 +1,49 @@
+import {timeInterval} from "./interval.js";
+
+export const timeYear = timeInterval((date) => {
+ date.setMonth(0, 1);
+ date.setHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setFullYear(date.getFullYear() + step);
+}, (start, end) => {
+ return end.getFullYear() - start.getFullYear();
+}, (date) => {
+ return date.getFullYear();
+});
+
+// An optimized implementation for this simple case.
+timeYear.every = (k) => {
+ return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
+ date.setFullYear(Math.floor(date.getFullYear() / k) * k);
+ date.setMonth(0, 1);
+ date.setHours(0, 0, 0, 0);
+ }, (date, step) => {
+ date.setFullYear(date.getFullYear() + step * k);
+ });
+};
+
+export const timeYears = timeYear.range;
+
+export const utcYear = timeInterval((date) => {
+ date.setUTCMonth(0, 1);
+ date.setUTCHours(0, 0, 0, 0);
+}, (date, step) => {
+ date.setUTCFullYear(date.getUTCFullYear() + step);
+}, (start, end) => {
+ return end.getUTCFullYear() - start.getUTCFullYear();
+}, (date) => {
+ return date.getUTCFullYear();
+});
+
+// An optimized implementation for this simple case.
+utcYear.every = (k) => {
+ return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
+ date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
+ date.setUTCMonth(0, 1);
+ date.setUTCHours(0, 0, 0, 0);
+ }, (date, step) => {
+ date.setUTCFullYear(date.getUTCFullYear() + step * k);
+ });
+};
+
+export const utcYears = utcYear.range;
diff --git a/node_modules/d3-scale/package.json b/node_modules/d3-scale/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..cd770391b6294f07e7abb709b5eb0f57a601d510
--- /dev/null
+++ b/node_modules/d3-scale/package.json
@@ -0,0 +1,57 @@
+{
+ "name": "d3-scale",
+ "version": "4.0.2",
+ "description": "Encodings that map abstract data to visual representation.",
+ "homepage": "https://d3js.org/d3-scale/",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/d3/d3-scale.git"
+ },
+ "keywords": [
+ "d3",
+ "d3-module",
+ "scale",
+ "visualization"
+ ],
+ "license": "ISC",
+ "author": {
+ "name": "Mike Bostock",
+ "url": "https://bost.ocks.org/mike"
+ },
+ "type": "module",
+ "files": [
+ "dist/**/*.js",
+ "src/**/*.js"
+ ],
+ "module": "src/index.js",
+ "main": "src/index.js",
+ "jsdelivr": "dist/d3-scale.min.js",
+ "unpkg": "dist/d3-scale.min.js",
+ "exports": {
+ "umd": "./dist/d3-scale.min.js",
+ "default": "./src/index.js"
+ },
+ "sideEffects": false,
+ "dependencies": {
+ "d3-array": "2.10.0 - 3",
+ "d3-format": "1 - 3",
+ "d3-interpolate": "1.2.0 - 3",
+ "d3-time": "2.1.1 - 3",
+ "d3-time-format": "2 - 4"
+ },
+ "devDependencies": {
+ "d3-color": "1 - 3",
+ "eslint": "7",
+ "mocha": "9",
+ "rollup": "2",
+ "rollup-plugin-terser": "7"
+ },
+ "scripts": {
+ "test": "TZ=America/Los_Angeles mocha 'test/**/*-test.js' && eslint src test",
+ "prepublishOnly": "rm -rf dist && yarn test && rollup -c",
+ "postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd -"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+}
diff --git a/node_modules/d3-scale/src/band.js b/node_modules/d3-scale/src/band.js
new file mode 100644
index 0000000000000000000000000000000000000000..88e1fbdf9f5c1953ffb756a97f55a544841c08c8
--- /dev/null
+++ b/node_modules/d3-scale/src/band.js
@@ -0,0 +1,101 @@
+import {range as sequence} from "d3-array";
+import {initRange} from "./init.js";
+import ordinal from "./ordinal.js";
+
+export default function band() {
+ var scale = ordinal().unknown(undefined),
+ domain = scale.domain,
+ ordinalRange = scale.range,
+ r0 = 0,
+ r1 = 1,
+ step,
+ bandwidth,
+ round = false,
+ paddingInner = 0,
+ paddingOuter = 0,
+ align = 0.5;
+
+ delete scale.unknown;
+
+ function rescale() {
+ var n = domain().length,
+ reverse = r1 < r0,
+ start = reverse ? r1 : r0,
+ stop = reverse ? r0 : r1;
+ step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
+ if (round) step = Math.floor(step);
+ start += (stop - start - step * (n - paddingInner)) * align;
+ bandwidth = step * (1 - paddingInner);
+ if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
+ var values = sequence(n).map(function(i) { return start + step * i; });
+ return ordinalRange(reverse ? values.reverse() : values);
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain(_), rescale()) : domain();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
+ };
+
+ scale.rangeRound = function(_) {
+ return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
+ };
+
+ scale.bandwidth = function() {
+ return bandwidth;
+ };
+
+ scale.step = function() {
+ return step;
+ };
+
+ scale.round = function(_) {
+ return arguments.length ? (round = !!_, rescale()) : round;
+ };
+
+ scale.padding = function(_) {
+ return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
+ };
+
+ scale.paddingInner = function(_) {
+ return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
+ };
+
+ scale.paddingOuter = function(_) {
+ return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
+ };
+
+ scale.align = function(_) {
+ return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
+ };
+
+ scale.copy = function() {
+ return band(domain(), [r0, r1])
+ .round(round)
+ .paddingInner(paddingInner)
+ .paddingOuter(paddingOuter)
+ .align(align);
+ };
+
+ return initRange.apply(rescale(), arguments);
+}
+
+function pointish(scale) {
+ var copy = scale.copy;
+
+ scale.padding = scale.paddingOuter;
+ delete scale.paddingInner;
+ delete scale.paddingOuter;
+
+ scale.copy = function() {
+ return pointish(copy());
+ };
+
+ return scale;
+}
+
+export function point() {
+ return pointish(band.apply(null, arguments).paddingInner(1));
+}
diff --git a/node_modules/d3-scale/src/colors.js b/node_modules/d3-scale/src/colors.js
new file mode 100644
index 0000000000000000000000000000000000000000..b344ddb7098b8297045e79e70f6d5b3e8d9959d2
--- /dev/null
+++ b/node_modules/d3-scale/src/colors.js
@@ -0,0 +1,5 @@
+export default function colors(s) {
+ return s.match(/.{6}/g).map(function(x) {
+ return "#" + x;
+ });
+}
diff --git a/node_modules/d3-scale/src/constant.js b/node_modules/d3-scale/src/constant.js
new file mode 100644
index 0000000000000000000000000000000000000000..be84feecdd99fb90c8d48ffd76825d79b5e57342
--- /dev/null
+++ b/node_modules/d3-scale/src/constant.js
@@ -0,0 +1,5 @@
+export default function constants(x) {
+ return function() {
+ return x;
+ };
+}
diff --git a/node_modules/d3-scale/src/continuous.js b/node_modules/d3-scale/src/continuous.js
new file mode 100644
index 0000000000000000000000000000000000000000..d932095f4cda274ffd0a611031bfd40b6d104e86
--- /dev/null
+++ b/node_modules/d3-scale/src/continuous.js
@@ -0,0 +1,125 @@
+import {bisect} from "d3-array";
+import {interpolate as interpolateValue, interpolateNumber, interpolateRound} from "d3-interpolate";
+import constant from "./constant.js";
+import number from "./number.js";
+
+var unit = [0, 1];
+
+export function identity(x) {
+ return x;
+}
+
+function normalize(a, b) {
+ return (b -= (a = +a))
+ ? function(x) { return (x - a) / b; }
+ : constant(isNaN(b) ? NaN : 0.5);
+}
+
+function clamper(a, b) {
+ var t;
+ if (a > b) t = a, a = b, b = t;
+ return function(x) { return Math.max(a, Math.min(b, x)); };
+}
+
+// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
+// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
+function bimap(domain, range, interpolate) {
+ var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
+ if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
+ else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
+ return function(x) { return r0(d0(x)); };
+}
+
+function polymap(domain, range, interpolate) {
+ var j = Math.min(domain.length, range.length) - 1,
+ d = new Array(j),
+ r = new Array(j),
+ i = -1;
+
+ // Reverse descending domains.
+ if (domain[j] < domain[0]) {
+ domain = domain.slice().reverse();
+ range = range.slice().reverse();
+ }
+
+ while (++i < j) {
+ d[i] = normalize(domain[i], domain[i + 1]);
+ r[i] = interpolate(range[i], range[i + 1]);
+ }
+
+ return function(x) {
+ var i = bisect(domain, x, 1, j) - 1;
+ return r[i](d[i](x));
+ };
+}
+
+export function copy(source, target) {
+ return target
+ .domain(source.domain())
+ .range(source.range())
+ .interpolate(source.interpolate())
+ .clamp(source.clamp())
+ .unknown(source.unknown());
+}
+
+export function transformer() {
+ var domain = unit,
+ range = unit,
+ interpolate = interpolateValue,
+ transform,
+ untransform,
+ unknown,
+ clamp = identity,
+ piecewise,
+ output,
+ input;
+
+ function rescale() {
+ var n = Math.min(domain.length, range.length);
+ if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);
+ piecewise = n > 2 ? polymap : bimap;
+ output = input = null;
+ return scale;
+ }
+
+ function scale(x) {
+ return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));
+ }
+
+ scale.invert = function(y) {
+ return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
+ };
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
+ };
+
+ scale.rangeRound = function(_) {
+ return range = Array.from(_), interpolate = interpolateRound, rescale();
+ };
+
+ scale.clamp = function(_) {
+ return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;
+ };
+
+ scale.interpolate = function(_) {
+ return arguments.length ? (interpolate = _, rescale()) : interpolate;
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ return function(t, u) {
+ transform = t, untransform = u;
+ return rescale();
+ };
+}
+
+export default function continuous() {
+ return transformer()(identity, identity);
+}
diff --git a/node_modules/d3-scale/src/diverging.js b/node_modules/d3-scale/src/diverging.js
new file mode 100644
index 0000000000000000000000000000000000000000..f59074883b5d1c7a1a4dfbff395770386d0d0a81
--- /dev/null
+++ b/node_modules/d3-scale/src/diverging.js
@@ -0,0 +1,104 @@
+import {interpolate, interpolateRound, piecewise} from "d3-interpolate";
+import {identity} from "./continuous.js";
+import {initInterpolator} from "./init.js";
+import {linearish} from "./linear.js";
+import {loggish} from "./log.js";
+import {copy} from "./sequential.js";
+import {symlogish} from "./symlog.js";
+import {powish} from "./pow.js";
+
+function transformer() {
+ var x0 = 0,
+ x1 = 0.5,
+ x2 = 1,
+ s = 1,
+ t0,
+ t1,
+ t2,
+ k10,
+ k21,
+ interpolator = identity,
+ transform,
+ clamp = false,
+ unknown;
+
+ function scale(x) {
+ return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];
+ };
+
+ scale.clamp = function(_) {
+ return arguments.length ? (clamp = !!_, scale) : clamp;
+ };
+
+ scale.interpolator = function(_) {
+ return arguments.length ? (interpolator = _, scale) : interpolator;
+ };
+
+ function range(interpolate) {
+ return function(_) {
+ var r0, r1, r2;
+ return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];
+ };
+ }
+
+ scale.range = range(interpolate);
+
+ scale.rangeRound = range(interpolateRound);
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ return function(t) {
+ transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;
+ return scale;
+ };
+}
+
+export default function diverging() {
+ var scale = linearish(transformer()(identity));
+
+ scale.copy = function() {
+ return copy(scale, diverging());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+export function divergingLog() {
+ var scale = loggish(transformer()).domain([0.1, 1, 10]);
+
+ scale.copy = function() {
+ return copy(scale, divergingLog()).base(scale.base());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+export function divergingSymlog() {
+ var scale = symlogish(transformer());
+
+ scale.copy = function() {
+ return copy(scale, divergingSymlog()).constant(scale.constant());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+export function divergingPow() {
+ var scale = powish(transformer());
+
+ scale.copy = function() {
+ return copy(scale, divergingPow()).exponent(scale.exponent());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+export function divergingSqrt() {
+ return divergingPow.apply(null, arguments).exponent(0.5);
+}
diff --git a/node_modules/d3-scale/src/identity.js b/node_modules/d3-scale/src/identity.js
new file mode 100644
index 0000000000000000000000000000000000000000..e1d1da7740ffea7d0a76f4ffca5e047f22209887
--- /dev/null
+++ b/node_modules/d3-scale/src/identity.js
@@ -0,0 +1,28 @@
+import {linearish} from "./linear.js";
+import number from "./number.js";
+
+export default function identity(domain) {
+ var unknown;
+
+ function scale(x) {
+ return x == null || isNaN(x = +x) ? unknown : x;
+ }
+
+ scale.invert = scale;
+
+ scale.domain = scale.range = function(_) {
+ return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.copy = function() {
+ return identity(domain).unknown(unknown);
+ };
+
+ domain = arguments.length ? Array.from(domain, number) : [0, 1];
+
+ return linearish(scale);
+}
diff --git a/node_modules/d3-scale/src/index.js b/node_modules/d3-scale/src/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..510103ccf95d801131b5ace69c505b3934d928b6
--- /dev/null
+++ b/node_modules/d3-scale/src/index.js
@@ -0,0 +1,78 @@
+export {
+ default as scaleBand,
+ point as scalePoint
+} from "./band.js";
+
+export {
+ default as scaleIdentity
+} from "./identity.js";
+
+export {
+ default as scaleLinear
+} from "./linear.js";
+
+export {
+ default as scaleLog
+} from "./log.js";
+
+export {
+ default as scaleSymlog
+} from "./symlog.js";
+
+export {
+ default as scaleOrdinal,
+ implicit as scaleImplicit
+} from "./ordinal.js";
+
+export {
+ default as scalePow,
+ sqrt as scaleSqrt
+} from "./pow.js";
+
+export {
+ default as scaleRadial
+} from "./radial.js";
+
+export {
+ default as scaleQuantile
+} from "./quantile.js";
+
+export {
+ default as scaleQuantize
+} from "./quantize.js";
+
+export {
+ default as scaleThreshold
+} from "./threshold.js";
+
+export {
+ default as scaleTime
+} from "./time.js";
+
+export {
+ default as scaleUtc
+} from "./utcTime.js";
+
+export {
+ default as scaleSequential,
+ sequentialLog as scaleSequentialLog,
+ sequentialPow as scaleSequentialPow,
+ sequentialSqrt as scaleSequentialSqrt,
+ sequentialSymlog as scaleSequentialSymlog
+} from "./sequential.js";
+
+export {
+ default as scaleSequentialQuantile
+} from "./sequentialQuantile.js";
+
+export {
+ default as scaleDiverging,
+ divergingLog as scaleDivergingLog,
+ divergingPow as scaleDivergingPow,
+ divergingSqrt as scaleDivergingSqrt,
+ divergingSymlog as scaleDivergingSymlog
+} from "./diverging.js";
+
+export {
+ default as tickFormat
+} from "./tickFormat.js";
diff --git a/node_modules/d3-scale/src/init.js b/node_modules/d3-scale/src/init.js
new file mode 100644
index 0000000000000000000000000000000000000000..61f51a07e8bab382c144236f73b1b1dc24874bf8
--- /dev/null
+++ b/node_modules/d3-scale/src/init.js
@@ -0,0 +1,26 @@
+export function initRange(domain, range) {
+ switch (arguments.length) {
+ case 0: break;
+ case 1: this.range(domain); break;
+ default: this.range(range).domain(domain); break;
+ }
+ return this;
+}
+
+export function initInterpolator(domain, interpolator) {
+ switch (arguments.length) {
+ case 0: break;
+ case 1: {
+ if (typeof domain === "function") this.interpolator(domain);
+ else this.range(domain);
+ break;
+ }
+ default: {
+ this.domain(domain);
+ if (typeof interpolator === "function") this.interpolator(interpolator);
+ else this.range(interpolator);
+ break;
+ }
+ }
+ return this;
+}
diff --git a/node_modules/d3-scale/src/linear.js b/node_modules/d3-scale/src/linear.js
new file mode 100644
index 0000000000000000000000000000000000000000..3617d32a64ce3fdc8600b8773fde1e8b2aa1f1d1
--- /dev/null
+++ b/node_modules/d3-scale/src/linear.js
@@ -0,0 +1,70 @@
+import {ticks, tickIncrement} from "d3-array";
+import continuous, {copy} from "./continuous.js";
+import {initRange} from "./init.js";
+import tickFormat from "./tickFormat.js";
+
+export function linearish(scale) {
+ var domain = scale.domain;
+
+ scale.ticks = function(count) {
+ var d = domain();
+ return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
+ };
+
+ scale.tickFormat = function(count, specifier) {
+ var d = domain();
+ return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
+ };
+
+ scale.nice = function(count) {
+ if (count == null) count = 10;
+
+ var d = domain();
+ var i0 = 0;
+ var i1 = d.length - 1;
+ var start = d[i0];
+ var stop = d[i1];
+ var prestep;
+ var step;
+ var maxIter = 10;
+
+ if (stop < start) {
+ step = start, start = stop, stop = step;
+ step = i0, i0 = i1, i1 = step;
+ }
+
+ while (maxIter-- > 0) {
+ step = tickIncrement(start, stop, count);
+ if (step === prestep) {
+ d[i0] = start
+ d[i1] = stop
+ return domain(d);
+ } else if (step > 0) {
+ start = Math.floor(start / step) * step;
+ stop = Math.ceil(stop / step) * step;
+ } else if (step < 0) {
+ start = Math.ceil(start * step) / step;
+ stop = Math.floor(stop * step) / step;
+ } else {
+ break;
+ }
+ prestep = step;
+ }
+
+ return scale;
+ };
+
+ return scale;
+}
+
+export default function linear() {
+ var scale = continuous();
+
+ scale.copy = function() {
+ return copy(scale, linear());
+ };
+
+ initRange.apply(scale, arguments);
+
+ return linearish(scale);
+}
diff --git a/node_modules/d3-scale/src/log.js b/node_modules/d3-scale/src/log.js
new file mode 100644
index 0000000000000000000000000000000000000000..170cd6977acff48ccd5a725cd7d54f2d67b29f3b
--- /dev/null
+++ b/node_modules/d3-scale/src/log.js
@@ -0,0 +1,140 @@
+import {ticks} from "d3-array";
+import {format, formatSpecifier} from "d3-format";
+import nice from "./nice.js";
+import {copy, transformer} from "./continuous.js";
+import {initRange} from "./init.js";
+
+function transformLog(x) {
+ return Math.log(x);
+}
+
+function transformExp(x) {
+ return Math.exp(x);
+}
+
+function transformLogn(x) {
+ return -Math.log(-x);
+}
+
+function transformExpn(x) {
+ return -Math.exp(-x);
+}
+
+function pow10(x) {
+ return isFinite(x) ? +("1e" + x) : x < 0 ? 0 : x;
+}
+
+function powp(base) {
+ return base === 10 ? pow10
+ : base === Math.E ? Math.exp
+ : x => Math.pow(base, x);
+}
+
+function logp(base) {
+ return base === Math.E ? Math.log
+ : base === 10 && Math.log10
+ || base === 2 && Math.log2
+ || (base = Math.log(base), x => Math.log(x) / base);
+}
+
+function reflect(f) {
+ return (x, k) => -f(-x, k);
+}
+
+export function loggish(transform) {
+ const scale = transform(transformLog, transformExp);
+ const domain = scale.domain;
+ let base = 10;
+ let logs;
+ let pows;
+
+ function rescale() {
+ logs = logp(base), pows = powp(base);
+ if (domain()[0] < 0) {
+ logs = reflect(logs), pows = reflect(pows);
+ transform(transformLogn, transformExpn);
+ } else {
+ transform(transformLog, transformExp);
+ }
+ return scale;
+ }
+
+ scale.base = function(_) {
+ return arguments.length ? (base = +_, rescale()) : base;
+ };
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain(_), rescale()) : domain();
+ };
+
+ scale.ticks = count => {
+ const d = domain();
+ let u = d[0];
+ let v = d[d.length - 1];
+ const r = v < u;
+
+ if (r) ([u, v] = [v, u]);
+
+ let i = logs(u);
+ let j = logs(v);
+ let k;
+ let t;
+ const n = count == null ? 10 : +count;
+ let z = [];
+
+ if (!(base % 1) && j - i < n) {
+ i = Math.floor(i), j = Math.ceil(j);
+ if (u > 0) for (; i <= j; ++i) {
+ for (k = 1; k < base; ++k) {
+ t = i < 0 ? k / pows(-i) : k * pows(i);
+ if (t < u) continue;
+ if (t > v) break;
+ z.push(t);
+ }
+ } else for (; i <= j; ++i) {
+ for (k = base - 1; k >= 1; --k) {
+ t = i > 0 ? k / pows(-i) : k * pows(i);
+ if (t < u) continue;
+ if (t > v) break;
+ z.push(t);
+ }
+ }
+ if (z.length * 2 < n) z = ticks(u, v, n);
+ } else {
+ z = ticks(i, j, Math.min(j - i, n)).map(pows);
+ }
+ return r ? z.reverse() : z;
+ };
+
+ scale.tickFormat = (count, specifier) => {
+ if (count == null) count = 10;
+ if (specifier == null) specifier = base === 10 ? "s" : ",";
+ if (typeof specifier !== "function") {
+ if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;
+ specifier = format(specifier);
+ }
+ if (count === Infinity) return specifier;
+ const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?
+ return d => {
+ let i = d / pows(Math.round(logs(d)));
+ if (i * base < base - 0.5) i *= base;
+ return i <= k ? specifier(d) : "";
+ };
+ };
+
+ scale.nice = () => {
+ return domain(nice(domain(), {
+ floor: x => pows(Math.floor(logs(x))),
+ ceil: x => pows(Math.ceil(logs(x)))
+ }));
+ };
+
+ return scale;
+}
+
+export default function log() {
+ const scale = loggish(transformer()).domain([1, 10]);
+ scale.copy = () => copy(scale, log()).base(scale.base());
+ initRange.apply(scale, arguments);
+ return scale;
+}
diff --git a/node_modules/d3-scale/src/nice.js b/node_modules/d3-scale/src/nice.js
new file mode 100644
index 0000000000000000000000000000000000000000..a44e6015ee404a5ec27a3c6d51decf4e67e23437
--- /dev/null
+++ b/node_modules/d3-scale/src/nice.js
@@ -0,0 +1,18 @@
+export default function nice(domain, interval) {
+ domain = domain.slice();
+
+ var i0 = 0,
+ i1 = domain.length - 1,
+ x0 = domain[i0],
+ x1 = domain[i1],
+ t;
+
+ if (x1 < x0) {
+ t = i0, i0 = i1, i1 = t;
+ t = x0, x0 = x1, x1 = t;
+ }
+
+ domain[i0] = interval.floor(x0);
+ domain[i1] = interval.ceil(x1);
+ return domain;
+}
diff --git a/node_modules/d3-scale/src/number.js b/node_modules/d3-scale/src/number.js
new file mode 100644
index 0000000000000000000000000000000000000000..d185907fb427269c03be78680c6b3103be984f2e
--- /dev/null
+++ b/node_modules/d3-scale/src/number.js
@@ -0,0 +1,3 @@
+export default function number(x) {
+ return +x;
+}
diff --git a/node_modules/d3-scale/src/ordinal.js b/node_modules/d3-scale/src/ordinal.js
new file mode 100644
index 0000000000000000000000000000000000000000..74152805624fa1b0c5b72a1dcc243841d78f0fd9
--- /dev/null
+++ b/node_modules/d3-scale/src/ordinal.js
@@ -0,0 +1,46 @@
+import {InternMap} from "d3-array";
+import {initRange} from "./init.js";
+
+export const implicit = Symbol("implicit");
+
+export default function ordinal() {
+ var index = new InternMap(),
+ domain = [],
+ range = [],
+ unknown = implicit;
+
+ function scale(d) {
+ let i = index.get(d);
+ if (i === undefined) {
+ if (unknown !== implicit) return unknown;
+ index.set(d, i = domain.push(d) - 1);
+ }
+ return range[i % range.length];
+ }
+
+ scale.domain = function(_) {
+ if (!arguments.length) return domain.slice();
+ domain = [], index = new InternMap();
+ for (const value of _) {
+ if (index.has(value)) continue;
+ index.set(value, domain.push(value) - 1);
+ }
+ return scale;
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = Array.from(_), scale) : range.slice();
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.copy = function() {
+ return ordinal(domain, range).unknown(unknown);
+ };
+
+ initRange.apply(scale, arguments);
+
+ return scale;
+}
diff --git a/node_modules/d3-scale/src/pow.js b/node_modules/d3-scale/src/pow.js
new file mode 100644
index 0000000000000000000000000000000000000000..8146f1c0421bd257fa1563e233e26dee3bd520c9
--- /dev/null
+++ b/node_modules/d3-scale/src/pow.js
@@ -0,0 +1,50 @@
+import {linearish} from "./linear.js";
+import {copy, identity, transformer} from "./continuous.js";
+import {initRange} from "./init.js";
+
+function transformPow(exponent) {
+ return function(x) {
+ return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
+ };
+}
+
+function transformSqrt(x) {
+ return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);
+}
+
+function transformSquare(x) {
+ return x < 0 ? -x * x : x * x;
+}
+
+export function powish(transform) {
+ var scale = transform(identity, identity),
+ exponent = 1;
+
+ function rescale() {
+ return exponent === 1 ? transform(identity, identity)
+ : exponent === 0.5 ? transform(transformSqrt, transformSquare)
+ : transform(transformPow(exponent), transformPow(1 / exponent));
+ }
+
+ scale.exponent = function(_) {
+ return arguments.length ? (exponent = +_, rescale()) : exponent;
+ };
+
+ return linearish(scale);
+}
+
+export default function pow() {
+ var scale = powish(transformer());
+
+ scale.copy = function() {
+ return copy(scale, pow()).exponent(scale.exponent());
+ };
+
+ initRange.apply(scale, arguments);
+
+ return scale;
+}
+
+export function sqrt() {
+ return pow.apply(null, arguments).exponent(0.5);
+}
diff --git a/node_modules/d3-scale/src/quantile.js b/node_modules/d3-scale/src/quantile.js
new file mode 100644
index 0000000000000000000000000000000000000000..303f935a70223c9ee0d28450c3e146e6b6eced48
--- /dev/null
+++ b/node_modules/d3-scale/src/quantile.js
@@ -0,0 +1,57 @@
+import {ascending, bisect, quantileSorted as threshold} from "d3-array";
+import {initRange} from "./init.js";
+
+export default function quantile() {
+ var domain = [],
+ range = [],
+ thresholds = [],
+ unknown;
+
+ function rescale() {
+ var i = 0, n = Math.max(1, range.length);
+ thresholds = new Array(n - 1);
+ while (++i < n) thresholds[i - 1] = threshold(domain, i / n);
+ return scale;
+ }
+
+ function scale(x) {
+ return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];
+ }
+
+ scale.invertExtent = function(y) {
+ var i = range.indexOf(y);
+ return i < 0 ? [NaN, NaN] : [
+ i > 0 ? thresholds[i - 1] : domain[0],
+ i < thresholds.length ? thresholds[i] : domain[domain.length - 1]
+ ];
+ };
+
+ scale.domain = function(_) {
+ if (!arguments.length) return domain.slice();
+ domain = [];
+ for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);
+ domain.sort(ascending);
+ return rescale();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.quantiles = function() {
+ return thresholds.slice();
+ };
+
+ scale.copy = function() {
+ return quantile()
+ .domain(domain)
+ .range(range)
+ .unknown(unknown);
+ };
+
+ return initRange.apply(scale, arguments);
+}
diff --git a/node_modules/d3-scale/src/quantize.js b/node_modules/d3-scale/src/quantize.js
new file mode 100644
index 0000000000000000000000000000000000000000..0f540035c3d2e96eaeeb6b39ded54a0b3f6c3d38
--- /dev/null
+++ b/node_modules/d3-scale/src/quantize.js
@@ -0,0 +1,56 @@
+import {bisect} from "d3-array";
+import {linearish} from "./linear.js";
+import {initRange} from "./init.js";
+
+export default function quantize() {
+ var x0 = 0,
+ x1 = 1,
+ n = 1,
+ domain = [0.5],
+ range = [0, 1],
+ unknown;
+
+ function scale(x) {
+ return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;
+ }
+
+ function rescale() {
+ var i = -1;
+ domain = new Array(n);
+ while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);
+ return scale;
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();
+ };
+
+ scale.invertExtent = function(y) {
+ var i = range.indexOf(y);
+ return i < 0 ? [NaN, NaN]
+ : i < 1 ? [x0, domain[0]]
+ : i >= n ? [domain[n - 1], x1]
+ : [domain[i - 1], domain[i]];
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : scale;
+ };
+
+ scale.thresholds = function() {
+ return domain.slice();
+ };
+
+ scale.copy = function() {
+ return quantize()
+ .domain([x0, x1])
+ .range(range)
+ .unknown(unknown);
+ };
+
+ return initRange.apply(linearish(scale), arguments);
+}
diff --git a/node_modules/d3-scale/src/radial.js b/node_modules/d3-scale/src/radial.js
new file mode 100644
index 0000000000000000000000000000000000000000..5c00cc6d3e3b7f481f9d708b3a0361c2098aed0c
--- /dev/null
+++ b/node_modules/d3-scale/src/radial.js
@@ -0,0 +1,63 @@
+import continuous from "./continuous.js";
+import {initRange} from "./init.js";
+import {linearish} from "./linear.js";
+import number from "./number.js";
+
+function square(x) {
+ return Math.sign(x) * x * x;
+}
+
+function unsquare(x) {
+ return Math.sign(x) * Math.sqrt(Math.abs(x));
+}
+
+export default function radial() {
+ var squared = continuous(),
+ range = [0, 1],
+ round = false,
+ unknown;
+
+ function scale(x) {
+ var y = unsquare(squared(x));
+ return isNaN(y) ? unknown : round ? Math.round(y) : y;
+ }
+
+ scale.invert = function(y) {
+ return squared.invert(square(y));
+ };
+
+ scale.domain = function(_) {
+ return arguments.length ? (squared.domain(_), scale) : squared.domain();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (squared.range((range = Array.from(_, number)).map(square)), scale) : range.slice();
+ };
+
+ scale.rangeRound = function(_) {
+ return scale.range(_).round(true);
+ };
+
+ scale.round = function(_) {
+ return arguments.length ? (round = !!_, scale) : round;
+ };
+
+ scale.clamp = function(_) {
+ return arguments.length ? (squared.clamp(_), scale) : squared.clamp();
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.copy = function() {
+ return radial(squared.domain(), range)
+ .round(round)
+ .clamp(squared.clamp())
+ .unknown(unknown);
+ };
+
+ initRange.apply(scale, arguments);
+
+ return linearish(scale);
+}
diff --git a/node_modules/d3-scale/src/sequential.js b/node_modules/d3-scale/src/sequential.js
new file mode 100644
index 0000000000000000000000000000000000000000..547dc4040a574f0bea58a12b33a0643b15b29e31
--- /dev/null
+++ b/node_modules/d3-scale/src/sequential.js
@@ -0,0 +1,107 @@
+import {interpolate, interpolateRound} from "d3-interpolate";
+import {identity} from "./continuous.js";
+import {initInterpolator} from "./init.js";
+import {linearish} from "./linear.js";
+import {loggish} from "./log.js";
+import {symlogish} from "./symlog.js";
+import {powish} from "./pow.js";
+
+function transformer() {
+ var x0 = 0,
+ x1 = 1,
+ t0,
+ t1,
+ k10,
+ transform,
+ interpolator = identity,
+ clamp = false,
+ unknown;
+
+ function scale(x) {
+ return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];
+ };
+
+ scale.clamp = function(_) {
+ return arguments.length ? (clamp = !!_, scale) : clamp;
+ };
+
+ scale.interpolator = function(_) {
+ return arguments.length ? (interpolator = _, scale) : interpolator;
+ };
+
+ function range(interpolate) {
+ return function(_) {
+ var r0, r1;
+ return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];
+ };
+ }
+
+ scale.range = range(interpolate);
+
+ scale.rangeRound = range(interpolateRound);
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ return function(t) {
+ transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);
+ return scale;
+ };
+}
+
+export function copy(source, target) {
+ return target
+ .domain(source.domain())
+ .interpolator(source.interpolator())
+ .clamp(source.clamp())
+ .unknown(source.unknown());
+}
+
+export default function sequential() {
+ var scale = linearish(transformer()(identity));
+
+ scale.copy = function() {
+ return copy(scale, sequential());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+export function sequentialLog() {
+ var scale = loggish(transformer()).domain([1, 10]);
+
+ scale.copy = function() {
+ return copy(scale, sequentialLog()).base(scale.base());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+export function sequentialSymlog() {
+ var scale = symlogish(transformer());
+
+ scale.copy = function() {
+ return copy(scale, sequentialSymlog()).constant(scale.constant());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+export function sequentialPow() {
+ var scale = powish(transformer());
+
+ scale.copy = function() {
+ return copy(scale, sequentialPow()).exponent(scale.exponent());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+export function sequentialSqrt() {
+ return sequentialPow.apply(null, arguments).exponent(0.5);
+}
diff --git a/node_modules/d3-scale/src/sequentialQuantile.js b/node_modules/d3-scale/src/sequentialQuantile.js
new file mode 100644
index 0000000000000000000000000000000000000000..7437e558f8b9c180e00db005b25ddc11f74face1
--- /dev/null
+++ b/node_modules/d3-scale/src/sequentialQuantile.js
@@ -0,0 +1,38 @@
+import {ascending, bisect, quantile} from "d3-array";
+import {identity} from "./continuous.js";
+import {initInterpolator} from "./init.js";
+
+export default function sequentialQuantile() {
+ var domain = [],
+ interpolator = identity;
+
+ function scale(x) {
+ if (x != null && !isNaN(x = +x)) return interpolator((bisect(domain, x, 1) - 1) / (domain.length - 1));
+ }
+
+ scale.domain = function(_) {
+ if (!arguments.length) return domain.slice();
+ domain = [];
+ for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);
+ domain.sort(ascending);
+ return scale;
+ };
+
+ scale.interpolator = function(_) {
+ return arguments.length ? (interpolator = _, scale) : interpolator;
+ };
+
+ scale.range = function() {
+ return domain.map((d, i) => interpolator(i / (domain.length - 1)));
+ };
+
+ scale.quantiles = function(n) {
+ return Array.from({length: n + 1}, (_, i) => quantile(domain, i / n));
+ };
+
+ scale.copy = function() {
+ return sequentialQuantile(interpolator).domain(domain);
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
diff --git a/node_modules/d3-scale/src/symlog.js b/node_modules/d3-scale/src/symlog.js
new file mode 100644
index 0000000000000000000000000000000000000000..125fa7b518b23625e1dd6c927b0dde762a1dc18c
--- /dev/null
+++ b/node_modules/d3-scale/src/symlog.js
@@ -0,0 +1,35 @@
+import {linearish} from "./linear.js";
+import {copy, transformer} from "./continuous.js";
+import {initRange} from "./init.js";
+
+function transformSymlog(c) {
+ return function(x) {
+ return Math.sign(x) * Math.log1p(Math.abs(x / c));
+ };
+}
+
+function transformSymexp(c) {
+ return function(x) {
+ return Math.sign(x) * Math.expm1(Math.abs(x)) * c;
+ };
+}
+
+export function symlogish(transform) {
+ var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));
+
+ scale.constant = function(_) {
+ return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;
+ };
+
+ return linearish(scale);
+}
+
+export default function symlog() {
+ var scale = symlogish(transformer());
+
+ scale.copy = function() {
+ return copy(scale, symlog()).constant(scale.constant());
+ };
+
+ return initRange.apply(scale, arguments);
+}
diff --git a/node_modules/d3-scale/src/threshold.js b/node_modules/d3-scale/src/threshold.js
new file mode 100644
index 0000000000000000000000000000000000000000..bbdbe39204bad20a9c9cf8aea6d82e27a7abefe5
--- /dev/null
+++ b/node_modules/d3-scale/src/threshold.js
@@ -0,0 +1,39 @@
+import {bisect} from "d3-array";
+import {initRange} from "./init.js";
+
+export default function threshold() {
+ var domain = [0.5],
+ range = [0, 1],
+ unknown,
+ n = 1;
+
+ function scale(x) {
+ return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();
+ };
+
+ scale.invertExtent = function(y) {
+ var i = range.indexOf(y);
+ return [domain[i - 1], domain[i]];
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.copy = function() {
+ return threshold()
+ .domain(domain)
+ .range(range)
+ .unknown(unknown);
+ };
+
+ return initRange.apply(scale, arguments);
+}
diff --git a/node_modules/d3-scale/src/tickFormat.js b/node_modules/d3-scale/src/tickFormat.js
new file mode 100644
index 0000000000000000000000000000000000000000..15fc54efc68a25a7f70d4137a2bc579afd4cab8f
--- /dev/null
+++ b/node_modules/d3-scale/src/tickFormat.js
@@ -0,0 +1,29 @@
+import {tickStep} from "d3-array";
+import {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from "d3-format";
+
+export default function tickFormat(start, stop, count, specifier) {
+ var step = tickStep(start, stop, count),
+ precision;
+ specifier = formatSpecifier(specifier == null ? ",f" : specifier);
+ switch (specifier.type) {
+ case "s": {
+ var value = Math.max(Math.abs(start), Math.abs(stop));
+ if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
+ return formatPrefix(specifier, value);
+ }
+ case "":
+ case "e":
+ case "g":
+ case "p":
+ case "r": {
+ if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
+ break;
+ }
+ case "f":
+ case "%": {
+ if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
+ break;
+ }
+ }
+ return format(specifier);
+}
diff --git a/node_modules/d3-scale/src/time.js b/node_modules/d3-scale/src/time.js
new file mode 100644
index 0000000000000000000000000000000000000000..d1ea678fb0299da029ff8c4cdc51e1fcec1e49a8
--- /dev/null
+++ b/node_modules/d3-scale/src/time.js
@@ -0,0 +1,71 @@
+import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from "d3-time";
+import {timeFormat} from "d3-time-format";
+import continuous, {copy} from "./continuous.js";
+import {initRange} from "./init.js";
+import nice from "./nice.js";
+
+function date(t) {
+ return new Date(t);
+}
+
+function number(t) {
+ return t instanceof Date ? +t : +new Date(+t);
+}
+
+export function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {
+ var scale = continuous(),
+ invert = scale.invert,
+ domain = scale.domain;
+
+ var formatMillisecond = format(".%L"),
+ formatSecond = format(":%S"),
+ formatMinute = format("%I:%M"),
+ formatHour = format("%I %p"),
+ formatDay = format("%a %d"),
+ formatWeek = format("%b %d"),
+ formatMonth = format("%B"),
+ formatYear = format("%Y");
+
+ function tickFormat(date) {
+ return (second(date) < date ? formatMillisecond
+ : minute(date) < date ? formatSecond
+ : hour(date) < date ? formatMinute
+ : day(date) < date ? formatHour
+ : month(date) < date ? (week(date) < date ? formatDay : formatWeek)
+ : year(date) < date ? formatMonth
+ : formatYear)(date);
+ }
+
+ scale.invert = function(y) {
+ return new Date(invert(y));
+ };
+
+ scale.domain = function(_) {
+ return arguments.length ? domain(Array.from(_, number)) : domain().map(date);
+ };
+
+ scale.ticks = function(interval) {
+ var d = domain();
+ return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);
+ };
+
+ scale.tickFormat = function(count, specifier) {
+ return specifier == null ? tickFormat : format(specifier);
+ };
+
+ scale.nice = function(interval) {
+ var d = domain();
+ if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);
+ return interval ? domain(nice(d, interval)) : scale;
+ };
+
+ scale.copy = function() {
+ return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));
+ };
+
+ return scale;
+}
+
+export default function time() {
+ return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);
+}
diff --git a/node_modules/d3-scale/src/utcTime.js b/node_modules/d3-scale/src/utcTime.js
new file mode 100644
index 0000000000000000000000000000000000000000..9741716b15b405224c7739074d719b6e20ca00a1
--- /dev/null
+++ b/node_modules/d3-scale/src/utcTime.js
@@ -0,0 +1,8 @@
+import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from "d3-time";
+import {utcFormat} from "d3-time-format";
+import {calendar} from "./time.js";
+import {initRange} from "./init.js";
+
+export default function utcTime() {
+ return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);
+}
diff --git a/node_modules/d3-shape/LICENSE b/node_modules/d3-shape/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..4f0b022ceefd39f1f270bce414220b2aa51faff5
--- /dev/null
+++ b/node_modules/d3-shape/LICENSE
@@ -0,0 +1,27 @@
+Copyright 2010-2015 Mike Bostock
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of the author nor the names of contributors may be used to
+ endorse or promote products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/d3-shape/README.md b/node_modules/d3-shape/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..8d4e8f4942cf9f5cdee26ecaccc6cf21bb726b80
--- /dev/null
+++ b/node_modules/d3-shape/README.md
@@ -0,0 +1,1149 @@
+# d3-shape
+
+Visualizations typically consist of discrete graphical marks, such as [symbols](#symbols), [arcs](#arcs), [lines](#lines) and [areas](#areas). While the rectangles of a bar chart may be easy enough to generate directly using [SVG](http://www.w3.org/TR/SVG/paths.html#PathData) or [Canvas](http://www.w3.org/TR/2dcontext/#canvaspathmethods), other shapes are complex, such as rounded annular sectors and centripetal Catmull–Rom splines. This module provides a variety of shape generators for your convenience.
+
+As with other aspects of D3, these shapes are driven by data: each shape generator exposes accessors that control how the input data are mapped to a visual representation. For example, you might define a line generator for a time series by [scaling](https://github.com/d3/d3-scale) fields of your data to fit the chart:
+
+```js
+var line = d3.line()
+ .x(function(d) { return x(d.date); })
+ .y(function(d) { return y(d.value); });
+```
+
+This line generator can then be used to compute the `d` attribute of an SVG path element:
+
+```js
+path.datum(data).attr("d", line);
+```
+
+Or you can use it to render to a Canvas 2D context:
+
+```js
+line.context(context)(data);
+```
+
+For more, read [Introducing d3-shape](https://medium.com/@mbostock/introducing-d3-shape-73f8367e6d12).
+
+## Installing
+
+If you use NPM, `npm install d3-shape`. Otherwise, download the [latest release](https://github.com/d3/d3-shape/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-shape.v1.min.js) or as part of [D3](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
+
+```html
+
+
+
+```
+
+
+## API Reference
+
+* [Arcs](#arcs)
+* [Pies](#pies)
+* [Lines](#lines)
+* [Areas](#areas)
+* [Curves](#curves)
+* [Custom Curves](#custom-curves)
+* [Links](#links)
+* [Symbols](#symbols)
+* [Custom Symbol Types](#custom-symbol-types)
+* [Stacks](#stacks)
+
+### Arcs
+
+[](http://bl.ocks.org/mbostock/8878e7fd82034f1d63cf)[](http://bl.ocks.org/mbostock/2394b23da1994fc202e1)
+
+The arc generator produces a [circular](https://en.wikipedia.org/wiki/Circular_sector) or [annular](https://en.wikipedia.org/wiki/Annulus_\(mathematics\)) sector, as in a pie or donut chart. If the difference between the [start](#arc_startAngle) and [end](#arc_endAngle) angles (the *angular span*) is greater than [τ](https://en.wikipedia.org/wiki/Turn_\(geometry\)#Tau_proposal), the arc generator will produce a complete circle or annulus. If it is less than τ, arcs may have [rounded corners](#arc_cornerRadius) and [angular padding](#arc_padAngle). Arcs are always centered at ⟨0,0⟩; use a transform (see: [SVG](http://www.w3.org/TR/SVG/coords.html#TransformAttribute), [Canvas](http://www.w3.org/TR/2dcontext/#transformations)) to move the arc to a different position.
+
+See also the [pie generator](#pies), which computes the necessary angles to represent an array of data as a pie or donut chart; these angles can then be passed to an arc generator.
+
+# d3.arc() · [Source](https://github.com/d3/d3-shape/blob/master/src/arc.js)
+
+Constructs a new arc generator with the default settings.
+
+#arc(arguments…) · [Source](https://github.com/d3/d3-shape/blob/master/src/arc.js)
+
+Generates an arc for the given *arguments*. The *arguments* are arbitrary; they are simply propagated to the arc generator’s accessor functions along with the `this` object. For example, with the default settings, an object with radii and angles is expected:
+
+```js
+var arc = d3.arc();
+
+arc({
+ innerRadius: 0,
+ outerRadius: 100,
+ startAngle: 0,
+ endAngle: Math.PI / 2
+}); // "M0,-100A100,100,0,0,1,100,0L0,0Z"
+```
+
+If the radii and angles are instead defined as constants, you can generate an arc without any arguments:
+
+```js
+var arc = d3.arc()
+ .innerRadius(0)
+ .outerRadius(100)
+ .startAngle(0)
+ .endAngle(Math.PI / 2);
+
+arc(); // "M0,-100A100,100,0,0,1,100,0L0,0Z"
+```
+
+If the arc generator has a [context](#arc_context), then the arc is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls and this function returns void. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string is returned.
+
+#arc.centroid(arguments…) · [Source](https://github.com/d3/d3-shape/blob/master/src/arc.js)
+
+Computes the midpoint [*x*, *y*] of the center line of the arc that would be [generated](#_arc) by the given *arguments*. The *arguments* are arbitrary; they are simply propagated to the arc generator’s accessor functions along with the `this` object. To be consistent with the generated arc, the accessors must be deterministic, *i.e.*, return the same value given the same arguments. The midpoint is defined as ([startAngle](#arc_startAngle) + [endAngle](#arc_endAngle)) / 2 and ([innerRadius](#arc_innerRadius) + [outerRadius](#arc_outerRadius)) / 2. For example:
+
+[](http://bl.ocks.org/mbostock/9b5a2fd1ce1a146f27e4)[](http://bl.ocks.org/mbostock/c274877f647361f3df7d)
+
+Note that this is **not the geometric center** of the arc, which may be outside the arc; this method is merely a convenience for positioning labels.
+
+#arc.innerRadius([radius]) · [Source](https://github.com/d3/d3-shape/blob/master/src/arc.js)
+
+If *radius* is specified, sets the inner radius to the specified function or number and returns this arc generator. If *radius* is not specified, returns the current inner radius accessor, which defaults to:
+
+```js
+function innerRadius(d) {
+ return d.innerRadius;
+}
+```
+
+Specifying the inner radius as a function is useful for constructing a stacked polar bar chart, often in conjunction with a [sqrt scale](https://github.com/d3/d3-scale#sqrt). More commonly, a constant inner radius is used for a donut or pie chart. If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. A negative value is treated as zero.
+
+#arc.outerRadius([radius]) · [Source](https://github.com/d3/d3-shape/blob/master/src/arc.js)
+
+If *radius* is specified, sets the outer radius to the specified function or number and returns this arc generator. If *radius* is not specified, returns the current outer radius accessor, which defaults to:
+
+```js
+function outerRadius(d) {
+ return d.outerRadius;
+}
+```
+
+Specifying the outer radius as a function is useful for constructing a coxcomb or polar bar chart, often in conjunction with a [sqrt scale](https://github.com/d3/d3-scale#sqrt). More commonly, a constant outer radius is used for a pie or donut chart. If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. A negative value is treated as zero.
+
+#arc.cornerRadius([radius]) · [Source](https://github.com/d3/d3-shape/blob/master/src/arc.js)
+
+If *radius* is specified, sets the corner radius to the specified function or number and returns this arc generator. If *radius* is not specified, returns the current corner radius accessor, which defaults to:
+
+```js
+function cornerRadius() {
+ return 0;
+}
+```
+
+If the corner radius is greater than zero, the corners of the arc are rounded using circles of the given radius. For a circular sector, the two outer corners are rounded; for an annular sector, all four corners are rounded. The corner circles are shown in this diagram:
+
+[](http://bl.ocks.org/mbostock/e5e3680f3079cf5c3437)[](http://bl.ocks.org/mbostock/f41f50e06a6c04828b6e)
+
+The corner radius may not be larger than ([outerRadius](#arc_outerRadius) - [innerRadius](#arc_innerRadius)) / 2. In addition, for arcs whose angular span is less than π, the corner radius may be reduced as two adjacent rounded corners intersect. This is occurs more often with the inner corners. See the [arc corners animation](http://bl.ocks.org/mbostock/b7671cb38efdfa5da3af) for illustration.
+
+#arc.startAngle([angle]) · [Source](https://github.com/d3/d3-shape/blob/master/src/arc.js)
+
+If *angle* is specified, sets the start angle to the specified function or number and returns this arc generator. If *angle* is not specified, returns the current start angle accessor, which defaults to:
+
+```js
+function startAngle(d) {
+ return d.startAngle;
+}
+```
+
+The *angle* is specified in radians, with 0 at -*y* (12 o’clock) and positive angles proceeding clockwise. If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector.
+
+#arc.endAngle([angle]) · [Source](https://github.com/d3/d3-shape/blob/master/src/arc.js)
+
+If *angle* is specified, sets the end angle to the specified function or number and returns this arc generator. If *angle* is not specified, returns the current end angle accessor, which defaults to:
+
+```js
+function endAngle(d) {
+ return d.endAngle;
+}
+```
+
+The *angle* is specified in radians, with 0 at -*y* (12 o’clock) and positive angles proceeding clockwise. If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector.
+
+#arc.padAngle([angle]) · [Source](https://github.com/d3/d3-shape/blob/master/src/arc.js)
+
+If *angle* is specified, sets the pad angle to the specified function or number and returns this arc generator. If *angle* is not specified, returns the current pad angle accessor, which defaults to:
+
+```js
+function padAngle() {
+ return d && d.padAngle;
+}
+```
+
+The pad angle is converted to a fixed linear distance separating adjacent arcs, defined as [padRadius](#arc_padRadius) * padAngle. This distance is subtracted equally from the [start](#arc_startAngle) and [end](#arc_endAngle) of the arc. If the arc forms a complete circle or annulus, as when |endAngle - startAngle| ≥ τ, the pad angle is ignored.
+
+If the [inner radius](#arc_innerRadius) or angular span is small relative to the pad angle, it may not be possible to maintain parallel edges between adjacent arcs. In this case, the inner edge of the arc may collapse to a point, similar to a circular sector. For this reason, padding is typically only applied to annular sectors (*i.e.*, when innerRadius is positive), as shown in this diagram:
+
+[](http://bl.ocks.org/mbostock/f37b07b92633781a46f7)[](http://bl.ocks.org/mbostock/99f0a6533f7c949cf8b8)
+
+The recommended minimum inner radius when using padding is outerRadius \* padAngle / sin(θ), where θ is the angular span of the smallest arc before padding. For example, if the outer radius is 200 pixels and the pad angle is 0.02 radians, a reasonable θ is 0.04 radians, and a reasonable inner radius is 100 pixels. See the [arc padding animation](http://bl.ocks.org/mbostock/053fcc2295a445afab07) for illustration.
+
+Often, the pad angle is not set directly on the arc generator, but is instead computed by the [pie generator](#pies) so as to ensure that the area of padded arcs is proportional to their value; see [*pie*.padAngle](#pie_padAngle). See the [pie padding animation](http://bl.ocks.org/mbostock/3e961b4c97a1b543fff2) for illustration. If you apply a constant pad angle to the arc generator directly, it tends to subtract disproportionately from smaller arcs, introducing distortion.
+
+#arc.padRadius([radius]) · [Source](https://github.com/d3/d3-shape/blob/master/src/arc.js)
+
+If *radius* is specified, sets the pad radius to the specified function or number and returns this arc generator. If *radius* is not specified, returns the current pad radius accessor, which defaults to null, indicating that the pad radius should be automatically computed as sqrt([innerRadius](#arc_innerRadius) * innerRadius + [outerRadius](#arc_outerRadius) * outerRadius). The pad radius determines the fixed linear distance separating adjacent arcs, defined as padRadius * [padAngle](#arc_padAngle).
+
+#arc.context([context]) · [Source](https://github.com/d3/d3-shape/blob/master/src/arc.js)
+
+If *context* is specified, sets the context and returns this arc generator. If *context* is not specified, returns the current context, which defaults to null. If the context is not null, then the [generated arc](#_arc) is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string representing the generated arc is returned.
+
+### Pies
+
+The pie generator does not produce a shape directly, but instead computes the necessary angles to represent a tabular dataset as a pie or donut chart; these angles can then be passed to an [arc generator](#arcs).
+
+# d3.pie() · [Source](https://github.com/d3/d3-shape/blob/master/src/pie.js)
+
+Constructs a new pie generator with the default settings.
+
+#pie(data[, arguments…]) · [Source](https://github.com/d3/d3-shape/blob/master/src/pie.js)
+
+Generates a pie for the given array of *data*, returning an array of objects representing each datum’s arc angles. Any additional *arguments* are arbitrary; they are simply propagated to the pie generator’s accessor functions along with the `this` object. The length of the returned array is the same as *data*, and each element *i* in the returned array corresponds to the element *i* in the input data. Each object in the returned array has the following properties:
+
+* `data` - the input datum; the corresponding element in the input data array.
+* `value` - the numeric [value](#pie_value) of the arc.
+* `index` - the zero-based [sorted index](#pie_sort) of the arc.
+* `startAngle` - the [start angle](#pie_startAngle) of the arc.
+* `endAngle` - the [end angle](#pie_endAngle) of the arc.
+* `padAngle` - the [pad angle](#pie_padAngle) of the arc.
+
+This representation is designed to work with the arc generator’s default [startAngle](#arc_startAngle), [endAngle](#arc_endAngle) and [padAngle](#arc_padAngle) accessors. The angular units are arbitrary, but if you plan to use the pie generator in conjunction with an [arc generator](#arcs), you should specify angles in radians, with 0 at -*y* (12 o’clock) and positive angles proceeding clockwise.
+
+Given a small dataset of numbers, here is how to compute the arc angles to render this data as a pie chart:
+
+```js
+var data = [1, 1, 2, 3, 5, 8, 13, 21];
+var arcs = d3.pie()(data);
+```
+
+The first pair of parens, `pie()`, [constructs](#pie) a default pie generator. The second, `pie()(data)`, [invokes](#_pie) this generator on the dataset, returning an array of objects:
+
+```json
+[
+ {"data": 1, "value": 1, "index": 6, "startAngle": 6.050474740247008, "endAngle": 6.166830023713296, "padAngle": 0},
+ {"data": 1, "value": 1, "index": 7, "startAngle": 6.166830023713296, "endAngle": 6.283185307179584, "padAngle": 0},
+ {"data": 2, "value": 2, "index": 5, "startAngle": 5.817764173314431, "endAngle": 6.050474740247008, "padAngle": 0},
+ {"data": 3, "value": 3, "index": 4, "startAngle": 5.468698322915565, "endAngle": 5.817764173314431, "padAngle": 0},
+ {"data": 5, "value": 5, "index": 3, "startAngle": 4.886921905584122, "endAngle": 5.468698322915565, "padAngle": 0},
+ {"data": 8, "value": 8, "index": 2, "startAngle": 3.956079637853813, "endAngle": 4.886921905584122, "padAngle": 0},
+ {"data": 13, "value": 13, "index": 1, "startAngle": 2.443460952792061, "endAngle": 3.956079637853813, "padAngle": 0},
+ {"data": 21, "value": 21, "index": 0, "startAngle": 0.000000000000000, "endAngle": 2.443460952792061, "padAngle": 0}
+]
+```
+
+Note that the returned array is in the same order as the data, even though this pie chart is [sorted](#pie_sortValues) by descending value, starting with the arc for the last datum (value 21) at 12 o’clock.
+
+#pie.value([value]) · [Source](https://github.com/d3/d3-shape/blob/master/src/pie.js)
+
+If *value* is specified, sets the value accessor to the specified function or number and returns this pie generator. If *value* is not specified, returns the current value accessor, which defaults to:
+
+```js
+function value(d) {
+ return d;
+}
+```
+
+When a pie is [generated](#_pie), the value accessor will be invoked for each element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. The default value accessor assumes that the input data are numbers, or that they are coercible to numbers using [valueOf](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf). If your data are not simply numbers, then you should specify an accessor that returns the corresponding numeric value for a given datum. For example:
+
+```js
+var data = [
+ {"number": 4, "name": "Locke"},
+ {"number": 8, "name": "Reyes"},
+ {"number": 15, "name": "Ford"},
+ {"number": 16, "name": "Jarrah"},
+ {"number": 23, "name": "Shephard"},
+ {"number": 42, "name": "Kwon"}
+];
+
+var arcs = d3.pie()
+ .value(function(d) { return d.number; })
+ (data);
+```
+
+This is similar to [mapping](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) your data to values before invoking the pie generator:
+
+```js
+var arcs = d3.pie()(data.map(function(d) { return d.number; }));
+```
+
+The benefit of an accessor is that the input data remains associated with the returned objects, thereby making it easier to access other fields of the data, for example to set the color or to add text labels.
+
+#pie.sort([compare]) · [Source](https://github.com/d3/d3-shape/blob/master/src/pie.js)
+
+If *compare* is specified, sets the data comparator to the specified function and returns this pie generator. If *compare* is not specified, returns the current data comparator, which defaults to null. If both the data comparator and the value comparator are null, then arcs are positioned in the original input order. Otherwise, the data is sorted according to the data comparator, and the resulting order is used. Setting the data comparator implicitly sets the [value comparator](#pie_sortValues) to null.
+
+The *compare* function takes two arguments *a* and *b*, each elements from the input data array. If the arc for *a* should be before the arc for *b*, then the comparator must return a number less than zero; if the arc for *a* should be after the arc for *b*, then the comparator must return a number greater than zero; returning zero means that the relative order of *a* and *b* is unspecified. For example, to sort arcs by their associated name:
+
+```js
+pie.sort(function(a, b) { return a.name.localeCompare(b.name); });
+```
+
+Sorting does not affect the order of the [generated arc array](#_pie) which is always in the same order as the input data array; it merely affects the computed angles of each arc. The first arc starts at the [start angle](#pie_startAngle) and the last arc ends at the [end angle](#pie_endAngle).
+
+#pie.sortValues([compare]) · [Source](https://github.com/d3/d3-shape/blob/master/src/pie.js)
+
+If *compare* is specified, sets the value comparator to the specified function and returns this pie generator. If *compare* is not specified, returns the current value comparator, which defaults to descending value. The default value comparator is implemented as:
+
+```js
+function compare(a, b) {
+ return b - a;
+}
+```
+
+If both the data comparator and the value comparator are null, then arcs are positioned in the original input order. Otherwise, the data is sorted according to the data comparator, and the resulting order is used. Setting the value comparator implicitly sets the [data comparator](#pie_sort) to null.
+
+The value comparator is similar to the [data comparator](#pie_sort), except the two arguments *a* and *b* are values derived from the input data array using the [value accessor](#pie_value), not the data elements. If the arc for *a* should be before the arc for *b*, then the comparator must return a number less than zero; if the arc for *a* should be after the arc for *b*, then the comparator must return a number greater than zero; returning zero means that the relative order of *a* and *b* is unspecified. For example, to sort arcs by ascending value:
+
+```js
+pie.sortValues(function(a, b) { return a - b; });
+```
+
+Sorting does not affect the order of the [generated arc array](#_pie) which is always in the same order as the input data array; it merely affects the computed angles of each arc. The first arc starts at the [start angle](#pie_startAngle) and the last arc ends at the [end angle](#pie_endAngle).
+
+#pie.startAngle([angle]) · [Source](https://github.com/d3/d3-shape/blob/master/src/pie.js)
+
+If *angle* is specified, sets the overall start angle of the pie to the specified function or number and returns this pie generator. If *angle* is not specified, returns the current start angle accessor, which defaults to:
+
+```js
+function startAngle() {
+ return 0;
+}
+```
+
+The start angle here means the *overall* start angle of the pie, *i.e.*, the start angle of the first arc. The start angle accessor is invoked once, being passed the same arguments and `this` context as the [pie generator](#_pie). The units of *angle* are arbitrary, but if you plan to use the pie generator in conjunction with an [arc generator](#arcs), you should specify an angle in radians, with 0 at -*y* (12 o’clock) and positive angles proceeding clockwise.
+
+#pie.endAngle([angle]) · [Source](https://github.com/d3/d3-shape/blob/master/src/pie.js)
+
+If *angle* is specified, sets the overall end angle of the pie to the specified function or number and returns this pie generator. If *angle* is not specified, returns the current end angle accessor, which defaults to:
+
+```js
+function endAngle() {
+ return 2 * Math.PI;
+}
+```
+
+The end angle here means the *overall* end angle of the pie, *i.e.*, the end angle of the last arc. The end angle accessor is invoked once, being passed the same arguments and `this` context as the [pie generator](#_pie). The units of *angle* are arbitrary, but if you plan to use the pie generator in conjunction with an [arc generator](#arcs), you should specify an angle in radians, with 0 at -*y* (12 o’clock) and positive angles proceeding clockwise.
+
+The value of the end angle is constrained to [startAngle](#pie_startAngle) ± τ, such that |endAngle - startAngle| ≤ τ.
+
+#pie.padAngle([angle]) · [Source](https://github.com/d3/d3-shape/blob/master/src/pie.js)
+
+If *angle* is specified, sets the pad angle to the specified function or number and returns this pie generator. If *angle* is not specified, returns the current pad angle accessor, which defaults to:
+
+```js
+function padAngle() {
+ return 0;
+}
+```
+
+The pad angle here means the angular separation between each adjacent arc. The total amount of padding reserved is the specified *angle* times the number of elements in the input data array, and at most |endAngle - startAngle|; the remaining space is then divided proportionally by [value](#pie_value) such that the relative area of each arc is preserved. See the [pie padding animation](http://bl.ocks.org/mbostock/3e961b4c97a1b543fff2) for illustration. The pad angle accessor is invoked once, being passed the same arguments and `this` context as the [pie generator](#_pie). The units of *angle* are arbitrary, but if you plan to use the pie generator in conjunction with an [arc generator](#arcs), you should specify an angle in radians.
+
+### Lines
+
+[](https://observablehq.com/@d3/line-chart)
+
+The line generator produces a [spline](https://en.wikipedia.org/wiki/Spline_\(mathematics\)) or [polyline](https://en.wikipedia.org/wiki/Polygonal_chain), as in a line chart. Lines also appear in many other visualization types, such as the links in [hierarchical edge bundling](https://observablehq.com/@d3/hierarchical-edge-bundling).
+
+# d3.line() · [Source](https://github.com/d3/d3-shape/blob/master/src/line.js), [Examples](https://observablehq.com/@d3/d3-line)
+
+Constructs a new line generator with the default settings.
+
+#line(data) · [Source](https://github.com/d3/d3-shape/blob/master/src/line.js), [Examples](https://observablehq.com/@d3/d3-line)
+
+Generates a line for the given array of *data*. Depending on this line generator’s associated [curve](#line_curve), the given input *data* may need to be sorted by *x*-value before being passed to the line generator. If the line generator has a [context](#line_context), then the line is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls and this function returns void. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string is returned.
+
+#line.x([x]) · [Source](https://github.com/d3/d3-shape/blob/master/src/line.js), [Examples](https://observablehq.com/@d3/d3-line)
+
+If *x* is specified, sets the x accessor to the specified function or number and returns this line generator. If *x* is not specified, returns the current x accessor, which defaults to:
+
+```js
+function x(d) {
+ return d[0];
+}
+```
+
+When a line is [generated](#_line), the x accessor will be invoked for each [defined](#line_defined) element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. The default x accessor assumes that the input data are two-element arrays of numbers. If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. For example, if `x` is a [time scale](https://github.com/d3/d3-scale#time-scales) and `y` is a [linear scale](https://github.com/d3/d3-scale#linear-scales):
+
+```js
+var data = [
+ {date: new Date(2007, 3, 24), value: 93.24},
+ {date: new Date(2007, 3, 25), value: 95.35},
+ {date: new Date(2007, 3, 26), value: 98.84},
+ {date: new Date(2007, 3, 27), value: 99.92},
+ {date: new Date(2007, 3, 30), value: 99.80},
+ {date: new Date(2007, 4, 1), value: 99.47},
+ …
+];
+
+var line = d3.line()
+ .x(function(d) { return x(d.date); })
+ .y(function(d) { return y(d.value); });
+```
+
+#line.y([y]) · [Source](https://github.com/d3/d3-shape/blob/master/src/line.js), [Examples](https://observablehq.com/@d3/d3-line)
+
+If *y* is specified, sets the y accessor to the specified function or number and returns this line generator. If *y* is not specified, returns the current y accessor, which defaults to:
+
+```js
+function y(d) {
+ return d[1];
+}
+```
+
+When a line is [generated](#_line), the y accessor will be invoked for each [defined](#line_defined) element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. The default y accessor assumes that the input data are two-element arrays of numbers. See [*line*.x](#line_x) for more information.
+
+#line.defined([defined]) · [Source](https://github.com/d3/d3-shape/blob/master/src/line.js), [Examples](https://observablehq.com/@d3/d3-line)
+
+If *defined* is specified, sets the defined accessor to the specified function or boolean and returns this line generator. If *defined* is not specified, returns the current defined accessor, which defaults to:
+
+```js
+function defined() {
+ return true;
+}
+```
+
+The default accessor thus assumes that the input data is always defined. When a line is [generated](#_line), the defined accessor will be invoked for each element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. If the given element is defined (*i.e.*, if the defined accessor returns a truthy value for this element), the [x](#line_x) and [y](#line_y) accessors will subsequently be evaluated and the point will be added to the current line segment. Otherwise, the element will be skipped, the current line segment will be ended, and a new line segment will be generated for the next defined point. As a result, the generated line may have several discrete segments. For example:
+
+[](http://bl.ocks.org/mbostock/0533f44f2cfabecc5e3a)
+
+Note that if a line segment consists of only a single point, it may appear invisible unless rendered with rounded or square [line caps](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap). In addition, some curves such as [curveCardinalOpen](#curveCardinalOpen) only render a visible segment if it contains multiple points.
+
+#line.curve([curve]) · [Source](https://github.com/d3/d3-shape/blob/master/src/line.js), [Examples](https://observablehq.com/@d3/d3-line)
+
+If *curve* is specified, sets the [curve factory](#curves) and returns this line generator. If *curve* is not specified, returns the current curve factory, which defaults to [curveLinear](#curveLinear).
+
+#line.context([context]) · [Source](https://github.com/d3/d3-shape/blob/master/src/line.js), [Examples](https://observablehq.com/@d3/d3-line)
+
+If *context* is specified, sets the context and returns this line generator. If *context* is not specified, returns the current context, which defaults to null. If the context is not null, then the [generated line](#_line) is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string representing the generated line is returned.
+
+# d3.lineRadial() · [Source](https://github.com/d3/d3-shape/blob/master/src/lineRadial.js), [Examples](https://observablehq.com/@d3/d3-lineradial)
+
+
+
+Constructs a new radial line generator with the default settings. A radial line generator is equivalent to the standard Cartesian [line generator](#line), except the [x](#line_x) and [y](#line_y) accessors are replaced with [angle](#lineRadial_angle) and [radius](#lineRadial_radius) accessors. Radial lines are always positioned relative to ⟨0,0⟩; use a transform (see: [SVG](http://www.w3.org/TR/SVG/coords.html#TransformAttribute), [Canvas](http://www.w3.org/TR/2dcontext/#transformations)) to change the origin.
+
+#lineRadial(data) · [Source](https://github.com/d3/d3-shape/blob/master/src/lineRadial.js#L4), [Examples](https://observablehq.com/@d3/d3-lineradial)
+
+Equivalent to [*line*](#_line).
+
+#lineRadial.angle([angle]) · [Source](https://github.com/d3/d3-shape/blob/master/src/lineRadial.js#L7), [Examples](https://observablehq.com/@d3/d3-lineradial)
+
+Equivalent to [*line*.x](#line_x), except the accessor returns the angle in radians, with 0 at -*y* (12 o’clock).
+
+#lineRadial.radius([radius]) · [Source](https://github.com/d3/d3-shape/blob/master/src/lineRadial.js#L8), [Examples](https://observablehq.com/@d3/d3-lineradial)
+
+Equivalent to [*line*.y](#line_y), except the accessor returns the radius: the distance from the origin ⟨0,0⟩.
+
+#lineRadial.defined([defined])
+
+Equivalent to [*line*.defined](#line_defined).
+
+#lineRadial.curve([curve]) · [Source](https://github.com/d3/d3-shape/blob/master/src/lineRadial.js), [Examples](https://observablehq.com/@d3/d3-lineradial)
+
+Equivalent to [*line*.curve](#line_curve). Note that [curveMonotoneX](#curveMonotoneX) or [curveMonotoneY](#curveMonotoneY) are not recommended for radial lines because they assume that the data is monotonic in *x* or *y*, which is typically untrue of radial lines.
+
+#lineRadial.context([context])
+
+Equivalent to [*line*.context](#line_context).
+
+### Areas
+
+[](https://observablehq.com/@d3/area-chart)[](https://observablehq.com/@d3/stacked-area-chart)[](https://observablehq.com/@d3/difference-chart)
+
+The area generator produces an area, as in an area chart. An area is defined by two bounding [lines](#lines), either splines or polylines. Typically, the two lines share the same [*x*-values](#area_x) ([x0](#area_x0) = [x1](#area_x1)), differing only in *y*-value ([y0](#area_y0) and [y1](#area_y1)); most commonly, y0 is defined as a constant representing [zero](http://www.vox.com/2015/11/19/9758062/y-axis-zero-chart). The first line (the topline) is defined by x1 and y1 and is rendered first; the second line (the baseline) is defined by x0 and y0 and is rendered second, with the points in reverse order. With a [curveLinear](#curveLinear) [curve](#area_curve), this produces a clockwise polygon.
+
+# d3.area() · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+Constructs a new area generator with the default settings.
+
+#area(data) · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+Generates an area for the given array of *data*. Depending on this area generator’s associated [curve](#area_curve), the given input *data* may need to be sorted by *x*-value before being passed to the area generator. If the area generator has a [context](#line_context), then the area is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls and this function returns void. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string is returned.
+
+#area.x([x]) · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+If *x* is specified, sets [x0](#area_x0) to *x* and [x1](#area_x1) to null and returns this area generator. If *x* is not specified, returns the current x0 accessor.
+
+#area.x0([x]) · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+If *x* is specified, sets the x0 accessor to the specified function or number and returns this area generator. If *x* is not specified, returns the current x0 accessor, which defaults to:
+
+```js
+function x(d) {
+ return d[0];
+}
+```
+
+When an area is [generated](#_area), the x0 accessor will be invoked for each [defined](#area_defined) element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. The default x0 accessor assumes that the input data are two-element arrays of numbers. If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. For example, if `x` is a [time scale](https://github.com/d3/d3-scale#time-scales) and `y` is a [linear scale](https://github.com/d3/d3-scale#linear-scales):
+
+```js
+var data = [
+ {date: new Date(2007, 3, 24), value: 93.24},
+ {date: new Date(2007, 3, 25), value: 95.35},
+ {date: new Date(2007, 3, 26), value: 98.84},
+ {date: new Date(2007, 3, 27), value: 99.92},
+ {date: new Date(2007, 3, 30), value: 99.80},
+ {date: new Date(2007, 4, 1), value: 99.47},
+ …
+];
+
+var area = d3.area()
+ .x(function(d) { return x(d.date); })
+ .y1(function(d) { return y(d.value); })
+ .y0(y(0));
+```
+
+#area.x1([x]) · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+If *x* is specified, sets the x1 accessor to the specified function or number and returns this area generator. If *x* is not specified, returns the current x1 accessor, which defaults to null, indicating that the previously-computed [x0](#area_x0) value should be reused for the x1 value.
+
+When an area is [generated](#_area), the x1 accessor will be invoked for each [defined](#area_defined) element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. See [*area*.x0](#area_x0) for more information.
+
+#area.y([y]) · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+If *y* is specified, sets [y0](#area_y0) to *y* and [y1](#area_y1) to null and returns this area generator. If *y* is not specified, returns the current y0 accessor.
+
+#area.y0([y]) · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+If *y* is specified, sets the y0 accessor to the specified function or number and returns this area generator. If *y* is not specified, returns the current y0 accessor, which defaults to:
+
+```js
+function y() {
+ return 0;
+}
+```
+
+When an area is [generated](#_area), the y0 accessor will be invoked for each [defined](#area_defined) element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. See [*area*.x0](#area_x0) for more information.
+
+#area.y1([y]) · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+If *y* is specified, sets the y1 accessor to the specified function or number and returns this area generator. If *y* is not specified, returns the current y1 accessor, which defaults to:
+
+```js
+function y(d) {
+ return d[1];
+}
+```
+
+A null accessor is also allowed, indicating that the previously-computed [y0](#area_y0) value should be reused for the y1 value. When an area is [generated](#_area), the y1 accessor will be invoked for each [defined](#area_defined) element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. See [*area*.x0](#area_x0) for more information.
+
+#area.defined([defined]) · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+If *defined* is specified, sets the defined accessor to the specified function or boolean and returns this area generator. If *defined* is not specified, returns the current defined accessor, which defaults to:
+
+```js
+function defined() {
+ return true;
+}
+```
+
+The default accessor thus assumes that the input data is always defined. When an area is [generated](#_area), the defined accessor will be invoked for each element in the input data array, being passed the element `d`, the index `i`, and the array `data` as three arguments. If the given element is defined (*i.e.*, if the defined accessor returns a truthy value for this element), the [x0](#area_x0), [x1](#area_x1), [y0](#area_y0) and [y1](#area_y1) accessors will subsequently be evaluated and the point will be added to the current area segment. Otherwise, the element will be skipped, the current area segment will be ended, and a new area segment will be generated for the next defined point. As a result, the generated area may have several discrete segments. For example:
+
+[](http://bl.ocks.org/mbostock/3035090)
+
+Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square [line caps](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap). In addition, some curves such as [curveCardinalOpen](#curveCardinalOpen) only render a visible segment if it contains multiple points.
+
+#area.curve([curve]) · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+If *curve* is specified, sets the [curve factory](#curves) and returns this area generator. If *curve* is not specified, returns the current curve factory, which defaults to [curveLinear](#curveLinear).
+
+#area.context([context]) · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+If *context* is specified, sets the context and returns this area generator. If *context* is not specified, returns the current context, which defaults to null. If the context is not null, then the [generated area](#_area) is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string representing the generated area is returned.
+
+#area.lineX0() · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+ #area.lineY0() · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+Returns a new [line generator](#lines) that has this area generator’s current [defined accessor](#area_defined), [curve](#area_curve) and [context](#area_context). The line’s [*x*-accessor](#line_x) is this area’s [*x0*-accessor](#area_x0), and the line’s [*y*-accessor](#line_y) is this area’s [*y0*-accessor](#area_y0).
+
+#area.lineX1() · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+Returns a new [line generator](#lines) that has this area generator’s current [defined accessor](#area_defined), [curve](#area_curve) and [context](#area_context). The line’s [*x*-accessor](#line_x) is this area’s [*x1*-accessor](#area_x1), and the line’s [*y*-accessor](#line_y) is this area’s [*y0*-accessor](#area_y0).
+
+#area.lineY1() · [Source](https://github.com/d3/d3-shape/blob/master/src/area.js)
+
+Returns a new [line generator](#lines) that has this area generator’s current [defined accessor](#area_defined), [curve](#area_curve) and [context](#area_context). The line’s [*x*-accessor](#line_x) is this area’s [*x0*-accessor](#area_x0), and the line’s [*y*-accessor](#line_y) is this area’s [*y1*-accessor](#area_y1).
+
+# d3.areaRadial() · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+
+
+
+Constructs a new radial area generator with the default settings. A radial area generator is equivalent to the standard Cartesian [area generator](#area), except the [x](#area_x) and [y](#area_y) accessors are replaced with [angle](#areaRadial_angle) and [radius](#areaRadial_radius) accessors. Radial areas are always positioned relative to ⟨0,0⟩; use a transform (see: [SVG](http://www.w3.org/TR/SVG/coords.html#TransformAttribute), [Canvas](http://www.w3.org/TR/2dcontext/#transformations)) to change the origin.
+
+#areaRadial(data)
+
+Equivalent to [*area*](#_area).
+
+#areaRadial.angle([angle]) · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+
+Equivalent to [*area*.x](#area_x), except the accessor returns the angle in radians, with 0 at -*y* (12 o’clock).
+
+#areaRadial.startAngle([angle]) · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+
+Equivalent to [*area*.x0](#area_x0), except the accessor returns the angle in radians, with 0 at -*y* (12 o’clock). Note: typically [angle](#areaRadial_angle) is used instead of setting separate start and end angles.
+
+#areaRadial.endAngle([angle]) · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+
+Equivalent to [*area*.x1](#area_x1), except the accessor returns the angle in radians, with 0 at -*y* (12 o’clock). Note: typically [angle](#areaRadial_angle) is used instead of setting separate start and end angles.
+
+#areaRadial.radius([radius]) · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+
+Equivalent to [*area*.y](#area_y), except the accessor returns the radius: the distance from the origin ⟨0,0⟩.
+
+#areaRadial.innerRadius([radius]) · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+
+Equivalent to [*area*.y0](#area_y0), except the accessor returns the radius: the distance from the origin ⟨0,0⟩.
+
+#areaRadial.outerRadius([radius]) · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+
+Equivalent to [*area*.y1](#area_y1), except the accessor returns the radius: the distance from the origin ⟨0,0⟩.
+
+#areaRadial.defined([defined])
+
+Equivalent to [*area*.defined](#area_defined).
+
+#areaRadial.curve([curve]) · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+
+Equivalent to [*area*.curve](#area_curve). Note that [curveMonotoneX](#curveMonotoneX) or [curveMonotoneY](#curveMonotoneY) are not recommended for radial areas because they assume that the data is monotonic in *x* or *y*, which is typically untrue of radial areas.
+
+#areaRadial.context([context])
+
+Equivalent to [*line*.context](#line_context).
+
+#areaRadial.lineStartAngle() · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+ #areaRadial.lineInnerRadius() · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+
+Returns a new [radial line generator](#lineRadial) that has this radial area generator’s current [defined accessor](#areaRadial_defined), [curve](#areaRadial_curve) and [context](#areaRadial_context). The line’s [angle accessor](#lineRadial_angle) is this area’s [start angle accessor](#areaRadial_startAngle), and the line’s [radius accessor](#lineRadial_radius) is this area’s [inner radius accessor](#areaRadial_innerRadius).
+
+#areaRadial.lineEndAngle() · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+
+Returns a new [radial line generator](#lineRadial) that has this radial area generator’s current [defined accessor](#areaRadial_defined), [curve](#areaRadial_curve) and [context](#areaRadial_context). The line’s [angle accessor](#lineRadial_angle) is this area’s [end angle accessor](#areaRadial_endAngle), and the line’s [radius accessor](#lineRadial_radius) is this area’s [inner radius accessor](#areaRadial_innerRadius).
+
+#areaRadial.lineOuterRadius() · [Source](https://github.com/d3/d3-shape/blob/master/src/areaRadial.js)
+
+Returns a new [radial line generator](#lineRadial) that has this radial area generator’s current [defined accessor](#areaRadial_defined), [curve](#areaRadial_curve) and [context](#areaRadial_context). The line’s [angle accessor](#lineRadial_angle) is this area’s [start angle accessor](#areaRadial_startAngle), and the line’s [radius accessor](#lineRadial_radius) is this area’s [outer radius accessor](#areaRadial_outerRadius).
+
+### Curves
+
+While [lines](#lines) are defined as a sequence of two-dimensional [*x*, *y*] points, and [areas](#areas) are similarly defined by a topline and a baseline, there remains the task of transforming this discrete representation into a continuous shape: *i.e.*, how to interpolate between the points. A variety of curves are provided for this purpose.
+
+Curves are typically not constructed or used directly, instead being passed to [*line*.curve](#line_curve) and [*area*.curve](#area_curve). For example:
+
+```js
+var line = d3.line()
+ .x(function(d) { return x(d.date); })
+ .y(function(d) { return y(d.value); })
+ .curve(d3.curveCatmullRom.alpha(0.5));
+```
+
+# d3.curveBasis(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/basis.js)
+
+
+
+Produces a cubic [basis spline](https://en.wikipedia.org/wiki/B-spline) using the specified control points. The first and last points are triplicated such that the spline starts at the first point and ends at the last point, and is tangent to the line between the first and second points, and to the line between the penultimate and last points.
+
+# d3.curveBasisClosed(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/basisClosed.js)
+
+
+
+Produces a closed cubic [basis spline](https://en.wikipedia.org/wiki/B-spline) using the specified control points. When a line segment ends, the first three control points are repeated, producing a closed loop with C2 continuity.
+
+# d3.curveBasisOpen(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/basisOpen.js)
+
+
+
+Produces a cubic [basis spline](https://en.wikipedia.org/wiki/B-spline) using the specified control points. Unlike [basis](#basis), the first and last points are not repeated, and thus the curve typically does not intersect these points.
+
+# d3.curveBundle(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/bundle.js)
+
+
+
+Produces a straightened cubic [basis spline](https://en.wikipedia.org/wiki/B-spline) using the specified control points, with the spline straightened according to the curve’s [*beta*](#curveBundle_beta), which defaults to 0.85. This curve is typically used in [hierarchical edge bundling](https://observablehq.com/@d3/hierarchical-edge-bundling) to disambiguate connections, as proposed by [Danny Holten](https://www.win.tue.nl/vis1/home/dholten/) in [Hierarchical Edge Bundles: Visualization of Adjacency Relations in Hierarchical Data](https://www.win.tue.nl/vis1/home/dholten/papers/bundles_infovis.pdf). This curve does not implement [*curve*.areaStart](#curve_areaStart) and [*curve*.areaEnd](#curve_areaEnd); it is intended to work with [d3.line](#lines), not [d3.area](#areas).
+
+#bundle.beta(beta) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/bundle.js)
+
+Returns a bundle curve with the specified *beta* in the range [0, 1], representing the bundle strength. If *beta* equals zero, a straight line between the first and last point is produced; if *beta* equals one, a standard [basis](#basis) spline is produced. For example:
+
+```js
+var line = d3.line().curve(d3.curveBundle.beta(0.5));
+```
+
+# d3.curveCardinal(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/cardinal.js)
+
+
+
+Produces a cubic [cardinal spline](https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline) using the specified control points, with one-sided differences used for the first and last piece. The default [tension](#curveCardinal_tension) is 0.
+
+# d3.curveCardinalClosed(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/cardinalClosed.js)
+
+
+
+Produces a closed cubic [cardinal spline](https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline) using the specified control points. When a line segment ends, the first three control points are repeated, producing a closed loop. The default [tension](#curveCardinal_tension) is 0.
+
+# d3.curveCardinalOpen(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/cardinalOpen.js)
+
+
+
+Produces a cubic [cardinal spline](https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline) using the specified control points. Unlike [curveCardinal](#curveCardinal), one-sided differences are not used for the first and last piece, and thus the curve starts at the second point and ends at the penultimate point. The default [tension](#curveCardinal_tension) is 0.
+
+#cardinal.tension(tension) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/cardinalOpen.js)
+
+Returns a cardinal curve with the specified *tension* in the range [0, 1]. The *tension* determines the length of the tangents: a *tension* of one yields all zero tangents, equivalent to [curveLinear](#curveLinear); a *tension* of zero produces a uniform [Catmull–Rom](#curveCatmullRom) spline. For example:
+
+```js
+var line = d3.line().curve(d3.curveCardinal.tension(0.5));
+```
+
+# d3.curveCatmullRom(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/catmullRom.js)
+
+
+
+Produces a cubic Catmull–Rom spline using the specified control points and the parameter [*alpha*](#curveCatmullRom_alpha), which defaults to 0.5, as proposed by Yuksel et al. in [On the Parameterization of Catmull–Rom Curves](http://www.cemyuksel.com/research/catmullrom_param/), with one-sided differences used for the first and last piece.
+
+# d3.curveCatmullRomClosed(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/catmullRomClosed.js)
+
+
+
+Produces a closed cubic Catmull–Rom spline using the specified control points and the parameter [*alpha*](#curveCatmullRom_alpha), which defaults to 0.5, as proposed by Yuksel et al. When a line segment ends, the first three control points are repeated, producing a closed loop.
+
+# d3.curveCatmullRomOpen(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/catmullRomOpen.js)
+
+
+
+Produces a cubic Catmull–Rom spline using the specified control points and the parameter [*alpha*](#curveCatmullRom_alpha), which defaults to 0.5, as proposed by Yuksel et al. Unlike [curveCatmullRom](#curveCatmullRom), one-sided differences are not used for the first and last piece, and thus the curve starts at the second point and ends at the penultimate point.
+
+#catmullRom.alpha(alpha) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/catmullRom.js)
+
+Returns a cubic Catmull–Rom curve with the specified *alpha* in the range [0, 1]. If *alpha* is zero, produces a uniform spline, equivalent to [curveCardinal](#curveCardinal) with a tension of zero; if *alpha* is one, produces a chordal spline; if *alpha* is 0.5, produces a [centripetal spline](https://en.wikipedia.org/wiki/Centripetal_Catmull–Rom_spline). Centripetal splines are recommended to avoid self-intersections and overshoot. For example:
+
+```js
+var line = d3.line().curve(d3.curveCatmullRom.alpha(0.5));
+```
+
+# d3.curveLinear(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/linear.js)
+
+
+
+Produces a polyline through the specified points.
+
+# d3.curveLinearClosed(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/linearClosed.js)
+
+
+
+Produces a closed polyline through the specified points by repeating the first point when the line segment ends.
+
+# d3.curveMonotoneX(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/monotone.js)
+
+
+
+Produces a cubic spline that [preserves monotonicity](https://en.wikipedia.org/wiki/Monotone_cubic_interpolation) in *y*, assuming monotonicity in *x*, as proposed by Steffen in [A simple method for monotonic interpolation in one dimension](http://adsabs.harvard.edu/full/1990A%26A...239..443S): “a smooth curve with continuous first-order derivatives that passes through any given set of data points without spurious oscillations. Local extrema can occur only at grid points where they are given by the data, but not in between two adjacent grid points.”
+
+# d3.curveMonotoneY(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/monotone.js)
+
+
+
+Produces a cubic spline that [preserves monotonicity](https://en.wikipedia.org/wiki/Monotone_cubic_interpolation) in *x*, assuming monotonicity in *y*, as proposed by Steffen in [A simple method for monotonic interpolation in one dimension](http://adsabs.harvard.edu/full/1990A%26A...239..443S): “a smooth curve with continuous first-order derivatives that passes through any given set of data points without spurious oscillations. Local extrema can occur only at grid points where they are given by the data, but not in between two adjacent grid points.”
+
+# d3.curveNatural(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/natural.js)
+
+
+
+Produces a [natural](https://en.wikipedia.org/wiki/Spline_interpolation) [cubic spline](http://mathworld.wolfram.com/CubicSpline.html) with the second derivative of the spline set to zero at the endpoints.
+
+# d3.curveStep(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/step.js)
+
+
+
+Produces a piecewise constant function (a [step function](https://en.wikipedia.org/wiki/Step_function)) consisting of alternating horizontal and vertical lines. The *y*-value changes at the midpoint of each pair of adjacent *x*-values.
+
+# d3.curveStepAfter(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/step.js)
+
+
+
+Produces a piecewise constant function (a [step function](https://en.wikipedia.org/wiki/Step_function)) consisting of alternating horizontal and vertical lines. The *y*-value changes after the *x*-value.
+
+# d3.curveStepBefore(context) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/step.js)
+
+
+
+Produces a piecewise constant function (a [step function](https://en.wikipedia.org/wiki/Step_function)) consisting of alternating horizontal and vertical lines. The *y*-value changes before the *x*-value.
+
+### Custom Curves
+
+Curves are typically not used directly, instead being passed to [*line*.curve](#line_curve) and [*area*.curve](#area_curve). However, you can define your own curve implementation should none of the built-in curves satisfy your needs using the following interface. You can also use this low-level interface with a built-in curve type as an alternative to the line and area generators.
+
+#curve.areaStart() · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/step.js#L7)
+
+Indicates the start of a new area segment. Each area segment consists of exactly two [line segments](#curve_lineStart): the topline, followed by the baseline, with the baseline points in reverse order.
+
+#curve.areaEnd() · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/step.js)
+
+Indicates the end of the current area segment.
+
+#curve.lineStart() · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/step.js)
+
+Indicates the start of a new line segment. Zero or more [points](#curve_point) will follow.
+
+#curve.lineEnd() · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/step.js)
+
+Indicates the end of the current line segment.
+
+#curve.point(x, y) · [Source](https://github.com/d3/d3-shape/blob/master/src/curve/step.js)
+
+Indicates a new point in the current line segment with the given *x*- and *y*-values.
+
+### Links
+
+[](https://observablehq.com/@d3/tidy-tree)
+
+The **link** shape generates a smooth cubic Bézier curve from a source point to a target point. The tangents of the curve at the start and end are either [vertical](#linkVertical), [horizontal](#linkHorizontal) or [radial](#linkRadial).
+
+# d3.linkVertical() · [Source](https://github.com/d3/d3-shape/blob/master/src/link/index.js)
+
+Returns a new [link generator](#_link) with vertical tangents. For example, to visualize [links](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_links) in a [tree diagram](https://github.com/d3/d3-hierarchy/blob/master/README.md#tree) rooted on the top edge of the display, you might say:
+
+```js
+var link = d3.linkVertical()
+ .x(function(d) { return d.x; })
+ .y(function(d) { return d.y; });
+```
+
+# d3.linkHorizontal() · [Source](https://github.com/d3/d3-shape/blob/master/src/link/index.js)
+
+Returns a new [link generator](#_link) with horizontal tangents. For example, to visualize [links](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_links) in a [tree diagram](https://github.com/d3/d3-hierarchy/blob/master/README.md#tree) rooted on the left edge of the display, you might say:
+
+```js
+var link = d3.linkHorizontal()
+ .x(function(d) { return d.y; })
+ .y(function(d) { return d.x; });
+```
+
+#link(arguments…) · [Source](https://github.com/d3/d3-shape/blob/master/src/link/index.js)
+
+Generates a link for the given *arguments*. The *arguments* are arbitrary; they are simply propagated to the link generator’s accessor functions along with the `this` object. For example, with the default settings, an object expected:
+
+```js
+link({
+ source: [100, 100],
+ target: [300, 300]
+});
+```
+
+#link.source([source]) · [Source](https://github.com/d3/d3-shape/blob/master/src/link/index.js)
+
+If *source* is specified, sets the source accessor to the specified function and returns this link generator. If *source* is not specified, returns the current source accessor, which defaults to:
+
+```js
+function source(d) {
+ return d.source;
+}
+```
+
+#link.target([target]) · [Source](https://github.com/d3/d3-shape/blob/master/src/link/index.js)
+
+If *target* is specified, sets the target accessor to the specified function and returns this link generator. If *target* is not specified, returns the current target accessor, which defaults to:
+
+```js
+function target(d) {
+ return d.target;
+}
+```
+
+#link.x([x]) · [Source](https://github.com/d3/d3-shape/blob/master/src/link/index.js)
+
+If *x* is specified, sets the *x*-accessor to the specified function or number and returns this link generator. If *x* is not specified, returns the current *x*-accessor, which defaults to:
+
+```js
+function x(d) {
+ return d[0];
+}
+```
+
+#link.y([y]) · [Source](https://github.com/d3/d3-shape/blob/master/src/link/index.js)
+
+If *y* is specified, sets the *y*-accessor to the specified function or number and returns this link generator. If *y* is not specified, returns the current *y*-accessor, which defaults to:
+
+```js
+function y(d) {
+ return d[1];
+}
+```
+
+#link.context([context]) · [Source](https://github.com/d3/d3-shape/blob/master/src/link/index.js)
+
+If *context* is specified, sets the context and returns this link generator. If *context* is not specified, returns the current context, which defaults to null. If the context is not null, then the [generated link](#_link) is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string representing the generated link is returned. See also [d3-path](https://github.com/d3/d3-path).
+
+# d3.linkRadial() · [Source](https://github.com/d3/d3-shape/blob/master/src/link/index.js)
+
+Returns a new [link generator](#_link) with radial tangents. For example, to visualize [links](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_links) in a [tree diagram](https://github.com/d3/d3-hierarchy/blob/master/README.md#tree) rooted in the center of the display, you might say:
+
+```js
+var link = d3.linkRadial()
+ .angle(function(d) { return d.x; })
+ .radius(function(d) { return d.y; });
+```
+
+#linkRadial.angle([angle]) · [Source](https://github.com/d3/d3-shape/blob/master/src/link/index.js)
+
+Equivalent to [*link*.x](#link_x), except the accessor returns the angle in radians, with 0 at -*y* (12 o’clock).
+
+#linkRadial.radius([radius]) · [Source](https://github.com/d3/d3-shape/blob/master/src/link/index.js)
+
+Equivalent to [*link*.y](#link_y), except the accessor returns the radius: the distance from the origin ⟨0,0⟩.
+
+### Symbols
+
+
+
+Symbols provide a categorical shape encoding as is commonly used in scatterplots. Symbols are always centered at ⟨0,0⟩; use a transform (see: [SVG](http://www.w3.org/TR/SVG/coords.html#TransformAttribute), [Canvas](http://www.w3.org/TR/2dcontext/#transformations)) to move the symbol to a different position.
+
+# d3.symbol() · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol.js)
+
+Constructs a new symbol generator with the default settings.
+
+#symbol(arguments…) · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol.js)
+
+Generates a symbol for the given *arguments*. The *arguments* are arbitrary; they are simply propagated to the symbol generator’s accessor functions along with the `this` object. For example, with the default settings, no arguments are needed to produce a circle with area 64 square pixels. If the symbol generator has a [context](#symbol_context), then the symbol is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls and this function returns void. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string is returned.
+
+#symbol.type([type]) · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol.js)
+
+If *type* is specified, sets the symbol type to the specified function or symbol type and returns this symbol generator. If *type* is a function, the symbol generator’s arguments and *this* are passed through. (See [*selection*.attr](https://github.com/d3/d3-selection/blob/master/README.md#selection_attr) if you are using d3-selection.) If *type* is not specified, returns the current symbol type accessor, which defaults to:
+
+```js
+function type() {
+ return circle;
+}
+```
+
+See [symbols](#symbols) for the set of built-in symbol types. To implement a custom symbol type, pass an object that implements [*symbolType*.draw](#symbolType_draw).
+
+#symbol.size([size]) · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol.js)
+
+If *size* is specified, sets the size to the specified function or number and returns this symbol generator. If *size* is a function, the symbol generator’s arguments and *this* are passed through. (See [*selection*.attr](https://github.com/d3/d3-selection/blob/master/README.md#selection_attr) if you are using d3-selection.) If *size* is not specified, returns the current size accessor, which defaults to:
+
+```js
+function size() {
+ return 64;
+}
+```
+
+Specifying the size as a function is useful for constructing a scatterplot with a size encoding. If you wish to scale the symbol to fit a given bounding box, rather than by area, try [SVG’s getBBox](https://observablehq.com/d/1fac2626b9e1b65f).
+
+#symbol.context([context]) · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol.js)
+
+If *context* is specified, sets the context and returns this symbol generator. If *context* is not specified, returns the current context, which defaults to null. If the context is not null, then the [generated symbol](#_symbol) is rendered to this context as a sequence of [path method](http://www.w3.org/TR/2dcontext/#canvaspathmethods) calls. Otherwise, a [path data](http://www.w3.org/TR/SVG/paths.html#PathData) string representing the generated symbol is returned.
+
+# d3.symbols
+
+An array containing the set of all built-in symbol types: [circle](#symbolCircle), [cross](#symbolCross), [diamond](#symbolDiamond), [square](#symbolSquare), [star](#symbolStar), [triangle](#symbolTriangle), and [wye](#symbolWye). Useful for constructing the range of an [ordinal scale](https://github.com/d3/d3-scale#ordinal-scales) should you wish to use a shape encoding for categorical data.
+
+# d3.symbolCircle · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol/circle.js)
+
+The circle symbol type.
+
+# d3.symbolCross · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol/cross.js)
+
+The Greek cross symbol type, with arms of equal length.
+
+# d3.symbolDiamond · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol/diamond.js)
+
+The rhombus symbol type.
+
+# d3.symbolSquare · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol/square.js)
+
+The square symbol type.
+
+# d3.symbolStar · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol/star.js)
+
+The pentagonal star (pentagram) symbol type.
+
+# d3.symbolTriangle · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol/triangle.js)
+
+The up-pointing triangle symbol type.
+
+# d3.symbolWye · [Source](https://github.com/d3/d3-shape/blob/master/src/symbol/wye.js)
+
+The Y-shape symbol type.
+
+# d3.pointRadial(angle, radius) · [Source](https://github.com/d3/d3-shape/blob/master/src/pointRadial.js)
+
+Returns the point [x, y] for the given *angle* in radians, with 0 at -*y* (12 o’clock) and positive angles proceeding clockwise, and the given *radius*.
+
+### Custom Symbol Types
+
+Symbol types are typically not used directly, instead being passed to [*symbol*.type](#symbol_type). However, you can define your own symbol type implementation should none of the built-in types satisfy your needs using the following interface. You can also use this low-level interface with a built-in symbol type as an alternative to the symbol generator.
+
+#symbolType.draw(context, size)
+
+Renders this symbol type to the specified *context* with the specified *size* in square pixels. The *context* implements the [CanvasPathMethods](http://www.w3.org/TR/2dcontext/#canvaspathmethods) interface. (Note that this is a subset of the CanvasRenderingContext2D interface!)
+
+### Stacks
+
+[](https://observablehq.com/@d3/stacked-bar-chart)[](https://observablehq.com/@mbostock/streamgraph-transitions)
+
+Some shape types can be stacked, placing one shape adjacent to another. For example, a bar chart of monthly sales might be broken down into a multi-series bar chart by product category, stacking bars vertically. This is equivalent to subdividing a bar chart by an ordinal dimension (such as product category) and applying a color encoding.
+
+Stacked charts can show overall value and per-category value simultaneously; however, it is typically harder to compare across categories, as only the bottom layer of the stack is aligned. So, chose the [stack order](#stack_order) carefully, and consider a [streamgraph](#stackOffsetWiggle). (See also [grouped charts](https://observablehq.com/@d3/grouped-bar-chart).)
+
+Like the [pie generator](#pies), the stack generator does not produce a shape directly. Instead it computes positions which you can then pass to an [area generator](#areas) or use directly, say to position bars.
+
+# d3.stack() · [Source](https://github.com/d3/d3-shape/blob/master/src/stack.js)
+
+Constructs a new stack generator with the default settings.
+
+#stack(data[, arguments…]) · [Source](https://github.com/d3/d3-shape/blob/master/src/stack.js)
+
+Generates a stack for the given array of *data*, returning an array representing each series. Any additional *arguments* are arbitrary; they are simply propagated to accessors along with the `this` object.
+
+The series are determined by the [keys accessor](#stack_keys); each series *i* in the returned array corresponds to the *i*th key. Each series is an array of points, where each point *j* corresponds to the *j*th element in the input *data*. Lastly, each point is represented as an array [*y0*, *y1*] where *y0* is the lower value (baseline) and *y1* is the upper value (topline); the difference between *y0* and *y1* corresponds to the computed [value](#stack_value) for this point. The key for each series is available as *series*.key, and the [index](#stack_order) as *series*.index. The input data element for each point is available as *point*.data.
+
+For example, consider the following table representing monthly sales of fruits:
+
+Month | Apples | Bananas | Cherries | Dates
+--------|--------|---------|----------|-------
+ 1/2015 | 3840 | 1920 | 960 | 400
+ 2/2015 | 1600 | 1440 | 960 | 400
+ 3/2015 | 640 | 960 | 640 | 400
+ 4/2015 | 320 | 480 | 640 | 400
+
+This might be represented in JavaScript as an array of objects:
+
+```js
+var data = [
+ {month: new Date(2015, 0, 1), apples: 3840, bananas: 1920, cherries: 960, dates: 400},
+ {month: new Date(2015, 1, 1), apples: 1600, bananas: 1440, cherries: 960, dates: 400},
+ {month: new Date(2015, 2, 1), apples: 640, bananas: 960, cherries: 640, dates: 400},
+ {month: new Date(2015, 3, 1), apples: 320, bananas: 480, cherries: 640, dates: 400}
+];
+```
+
+To produce a stack for this data:
+
+```js
+var stack = d3.stack()
+ .keys(["apples", "bananas", "cherries", "dates"])
+ .order(d3.stackOrderNone)
+ .offset(d3.stackOffsetNone);
+
+var series = stack(data);
+```
+
+The resulting array has one element per *series*. Each series has one point per month, and each point has a lower and upper value defining the baseline and topline:
+
+```js
+[
+ [[ 0, 3840], [ 0, 1600], [ 0, 640], [ 0, 320]], // apples
+ [[3840, 5760], [1600, 3040], [ 640, 1600], [ 320, 800]], // bananas
+ [[5760, 6720], [3040, 4000], [1600, 2240], [ 800, 1440]], // cherries
+ [[6720, 7120], [4000, 4400], [2240, 2640], [1440, 1840]], // dates
+]
+```
+
+Each series in then typically passed to an [area generator](#areas) to render an area chart, or used to construct rectangles for a bar chart.
+
+#stack.keys([keys]) · [Source](https://github.com/d3/d3-shape/blob/master/src/stack.js)
+
+If *keys* is specified, sets the keys accessor to the specified function or array and returns this stack generator. If *keys* is not specified, returns the current keys accessor, which defaults to the empty array. A series (layer) is [generated](#_stack) for each key. Keys are typically strings, but they may be arbitrary values. The series’ key is passed to the [value accessor](#stack_value), along with each data point, to compute the point’s value.
+
+#stack.value([value]) · [Source](https://github.com/d3/d3-shape/blob/master/src/stack.js)
+
+If *value* is specified, sets the value accessor to the specified function or number and returns this stack generator. If *value* is not specified, returns the current value accessor, which defaults to:
+
+```js
+function value(d, key) {
+ return d[key];
+}
+```
+
+Thus, by default the stack generator assumes that the input data is an array of objects, with each object exposing named properties with numeric values; see [*stack*](#_stack) for an example.
+
+#stack.order([order]) · [Source](https://github.com/d3/d3-shape/blob/master/src/stack.js)
+
+If *order* is specified, sets the order accessor to the specified function or array and returns this stack generator. If *order* is not specified, returns the current order acccesor, which defaults to [stackOrderNone](#stackOrderNone); this uses the order given by the [key accessor](#stack_key). See [stack orders](#stack-orders) for the built-in orders.
+
+If *order* is a function, it is passed the generated series array and must return an array of numeric indexes representing the stack order. For example, the default order is defined as:
+
+```js
+function orderNone(series) {
+ var n = series.length, o = new Array(n);
+ while (--n >= 0) o[n] = n;
+ return o;
+}
+```
+
+The stack order is computed prior to the [offset](#stack_offset); thus, the lower value for all points is zero at the time the order is computed. The index attribute for each series is also not set until after the order is computed.
+
+#stack.offset([offset]) · [Source](https://github.com/d3/d3-shape/blob/master/src/stack.js)
+
+If *offset* is specified, sets the offset accessor to the specified function or array and returns this stack generator. If *offset* is not specified, returns the current offset acccesor, which defaults to [stackOffsetNone](#stackOffsetNone); this uses a zero baseline. See [stack offsets](#stack-offsets) for the built-in offsets.
+
+If *offset* is a function, it is passed the generated series array and the order index array. The offset function is then responsible for updating the lower and upper values in the series array to layout the stack. For example, the default offset is defined as:
+
+```js
+function offsetNone(series, order) {
+ if (!((n = series.length) > 1)) return;
+ for (var i = 1, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {
+ s0 = s1, s1 = series[order[i]];
+ for (var j = 0; j < m; ++j) {
+ s1[j][1] += s1[j][0] = s0[j][1];
+ }
+ }
+}
+```
+
+### Stack Orders
+
+Stack orders are typically not used directly, but are instead passed to [*stack*.order](#stack_order).
+
+# d3.stackOrderAppearance(series) · [Source](https://github.com/d3/d3-shape/blob/master/src/order/appearance.js)
+
+Returns a series order such that the earliest series (according to the maximum value) is at the bottom.
+
+# d3.stackOrderAscending(series) · [Source](https://github.com/d3/d3-shape/blob/master/src/order/ascending.js)
+
+Returns a series order such that the smallest series (according to the sum of values) is at the bottom.
+
+# d3.stackOrderDescending(series) · [Source](https://github.com/d3/d3-shape/blob/master/src/order/descending.js)
+
+Returns a series order such that the largest series (according to the sum of values) is at the bottom.
+
+# d3.stackOrderInsideOut(series) · [Source](https://github.com/d3/d3-shape/blob/master/src/order/insideOut.js)
+
+Returns a series order such that the earliest series (according to the maximum value) are on the inside and the later series are on the outside. This order is recommended for streamgraphs in conjunction with the [wiggle offset](#stackOffsetWiggle). See [Stacked Graphs—Geometry & Aesthetics](http://leebyron.com/streamgraph/) by Byron & Wattenberg for more information.
+
+# d3.stackOrderNone(series) · [Source](https://github.com/d3/d3-shape/blob/master/src/order/none.js)
+
+Returns the given series order [0, 1, … *n* - 1] where *n* is the number of elements in *series*. Thus, the stack order is given by the [key accessor](#stack_keys).
+
+# d3.stackOrderReverse(series) · [Source](https://github.com/d3/d3-shape/blob/master/src/order/reverse.js)
+
+Returns the reverse of the given series order [*n* - 1, *n* - 2, … 0] where *n* is the number of elements in *series*. Thus, the stack order is given by the reverse of the [key accessor](#stack_keys).
+
+### Stack Offsets
+
+Stack offsets are typically not used directly, but are instead passed to [*stack*.offset](#stack_offset).
+
+# d3.stackOffsetExpand(series, order) · [Source](https://github.com/d3/d3-shape/blob/master/src/offset/expand.js)
+
+Applies a zero baseline and normalizes the values for each point such that the topline is always one.
+
+# d3.stackOffsetDiverging(series, order) · [Source](https://github.com/d3/d3-shape/blob/master/src/offset/diverging.js)
+
+Positive values are stacked above zero, negative values are [stacked below zero](https://bl.ocks.org/mbostock/b5935342c6d21928111928401e2c8608), and zero values are stacked at zero.
+
+# d3.stackOffsetNone(series, order) · [Source](https://github.com/d3/d3-shape/blob/master/src/offset/none.js)
+
+Applies a zero baseline.
+
+# d3.stackOffsetSilhouette(series, order) · [Source](https://github.com/d3/d3-shape/blob/master/src/offset/silhouette.js)
+
+Shifts the baseline down such that the center of the streamgraph is always at zero.
+
+# d3.stackOffsetWiggle(series, order) · [Source](https://github.com/d3/d3-shape/blob/master/src/offset/wiggle.js)
+
+Shifts the baseline so as to minimize the weighted wiggle of layers. This offset is recommended for streamgraphs in conjunction with the [inside-out order](#stackOrderInsideOut). See [Stacked Graphs—Geometry & Aesthetics](http://leebyron.com/streamgraph/) by Bryon & Wattenberg for more information.
diff --git a/node_modules/d3-shape/dist/d3-shape.js b/node_modules/d3-shape/dist/d3-shape.js
new file mode 100644
index 0000000000000000000000000000000000000000..054a0ff4c9f595c1aaae6f47ccdfa3c0e8cd7d96
--- /dev/null
+++ b/node_modules/d3-shape/dist/d3-shape.js
@@ -0,0 +1,1949 @@
+// https://d3js.org/d3-shape/ v1.3.7 Copyright 2019 Mike Bostock
+(function (global, factory) {
+typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-path')) :
+typeof define === 'function' && define.amd ? define(['exports', 'd3-path'], factory) :
+(global = global || self, factory(global.d3 = global.d3 || {}, global.d3));
+}(this, function (exports, d3Path) { 'use strict';
+
+function constant(x) {
+ return function constant() {
+ return x;
+ };
+}
+
+var abs = Math.abs;
+var atan2 = Math.atan2;
+var cos = Math.cos;
+var max = Math.max;
+var min = Math.min;
+var sin = Math.sin;
+var sqrt = Math.sqrt;
+
+var epsilon = 1e-12;
+var pi = Math.PI;
+var halfPi = pi / 2;
+var tau = 2 * pi;
+
+function acos(x) {
+ return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
+}
+
+function asin(x) {
+ return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);
+}
+
+function arcInnerRadius(d) {
+ return d.innerRadius;
+}
+
+function arcOuterRadius(d) {
+ return d.outerRadius;
+}
+
+function arcStartAngle(d) {
+ return d.startAngle;
+}
+
+function arcEndAngle(d) {
+ return d.endAngle;
+}
+
+function arcPadAngle(d) {
+ return d && d.padAngle; // Note: optional!
+}
+
+function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
+ var x10 = x1 - x0, y10 = y1 - y0,
+ x32 = x3 - x2, y32 = y3 - y2,
+ t = y32 * x10 - x32 * y10;
+ if (t * t < epsilon) return;
+ t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
+ return [x0 + t * x10, y0 + t * y10];
+}
+
+// Compute perpendicular offset line of length rc.
+// http://mathworld.wolfram.com/Circle-LineIntersection.html
+function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
+ var x01 = x0 - x1,
+ y01 = y0 - y1,
+ lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),
+ ox = lo * y01,
+ oy = -lo * x01,
+ x11 = x0 + ox,
+ y11 = y0 + oy,
+ x10 = x1 + ox,
+ y10 = y1 + oy,
+ x00 = (x11 + x10) / 2,
+ y00 = (y11 + y10) / 2,
+ dx = x10 - x11,
+ dy = y10 - y11,
+ d2 = dx * dx + dy * dy,
+ r = r1 - rc,
+ D = x11 * y10 - x10 * y11,
+ d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),
+ cx0 = (D * dy - dx * d) / d2,
+ cy0 = (-D * dx - dy * d) / d2,
+ cx1 = (D * dy + dx * d) / d2,
+ cy1 = (-D * dx + dy * d) / d2,
+ dx0 = cx0 - x00,
+ dy0 = cy0 - y00,
+ dx1 = cx1 - x00,
+ dy1 = cy1 - y00;
+
+ // Pick the closer of the two intersection points.
+ // TODO Is there a faster way to determine which intersection to use?
+ if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
+
+ return {
+ cx: cx0,
+ cy: cy0,
+ x01: -ox,
+ y01: -oy,
+ x11: cx0 * (r1 / r - 1),
+ y11: cy0 * (r1 / r - 1)
+ };
+}
+
+function arc() {
+ var innerRadius = arcInnerRadius,
+ outerRadius = arcOuterRadius,
+ cornerRadius = constant(0),
+ padRadius = null,
+ startAngle = arcStartAngle,
+ endAngle = arcEndAngle,
+ padAngle = arcPadAngle,
+ context = null;
+
+ function arc() {
+ var buffer,
+ r,
+ r0 = +innerRadius.apply(this, arguments),
+ r1 = +outerRadius.apply(this, arguments),
+ a0 = startAngle.apply(this, arguments) - halfPi,
+ a1 = endAngle.apply(this, arguments) - halfPi,
+ da = abs(a1 - a0),
+ cw = a1 > a0;
+
+ if (!context) context = buffer = d3Path.path();
+
+ // Ensure that the outer radius is always larger than the inner radius.
+ if (r1 < r0) r = r1, r1 = r0, r0 = r;
+
+ // Is it a point?
+ if (!(r1 > epsilon)) context.moveTo(0, 0);
+
+ // Or is it a circle or annulus?
+ else if (da > tau - epsilon) {
+ context.moveTo(r1 * cos(a0), r1 * sin(a0));
+ context.arc(0, 0, r1, a0, a1, !cw);
+ if (r0 > epsilon) {
+ context.moveTo(r0 * cos(a1), r0 * sin(a1));
+ context.arc(0, 0, r0, a1, a0, cw);
+ }
+ }
+
+ // Or is it a circular or annular sector?
+ else {
+ var a01 = a0,
+ a11 = a1,
+ a00 = a0,
+ a10 = a1,
+ da0 = da,
+ da1 = da,
+ ap = padAngle.apply(this, arguments) / 2,
+ rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),
+ rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
+ rc0 = rc,
+ rc1 = rc,
+ t0,
+ t1;
+
+ // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
+ if (rp > epsilon) {
+ var p0 = asin(rp / r0 * sin(ap)),
+ p1 = asin(rp / r1 * sin(ap));
+ if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;
+ else da0 = 0, a00 = a10 = (a0 + a1) / 2;
+ if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;
+ else da1 = 0, a01 = a11 = (a0 + a1) / 2;
+ }
+
+ var x01 = r1 * cos(a01),
+ y01 = r1 * sin(a01),
+ x10 = r0 * cos(a10),
+ y10 = r0 * sin(a10);
+
+ // Apply rounded corners?
+ if (rc > epsilon) {
+ var x11 = r1 * cos(a11),
+ y11 = r1 * sin(a11),
+ x00 = r0 * cos(a00),
+ y00 = r0 * sin(a00),
+ oc;
+
+ // Restrict the corner radius according to the sector angle.
+ if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {
+ var ax = x01 - oc[0],
+ ay = y01 - oc[1],
+ bx = x11 - oc[0],
+ by = y11 - oc[1],
+ kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),
+ lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
+ rc0 = min(rc, (r0 - lc) / (kc - 1));
+ rc1 = min(rc, (r1 - lc) / (kc + 1));
+ }
+ }
+
+ // Is the sector collapsed to a line?
+ if (!(da1 > epsilon)) context.moveTo(x01, y01);
+
+ // Does the sector’s outer ring have rounded corners?
+ else if (rc1 > epsilon) {
+ t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
+ t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
+
+ context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
+
+ // Have the corners merged?
+ if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
+
+ // Otherwise, draw the two corners and the ring.
+ else {
+ context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
+ context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
+ context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
+ }
+ }
+
+ // Or is the outer ring just a circular arc?
+ else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
+
+ // Is there no inner ring, and it’s a circular sector?
+ // Or perhaps it’s an annular sector collapsed due to padding?
+ if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);
+
+ // Does the sector’s inner ring (or point) have rounded corners?
+ else if (rc0 > epsilon) {
+ t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
+ t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
+
+ context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
+
+ // Have the corners merged?
+ if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
+
+ // Otherwise, draw the two corners and the ring.
+ else {
+ context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
+ context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
+ context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
+ }
+ }
+
+ // Or is the inner ring just a circular arc?
+ else context.arc(0, 0, r0, a10, a00, cw);
+ }
+
+ context.closePath();
+
+ if (buffer) return context = null, buffer + "" || null;
+ }
+
+ arc.centroid = function() {
+ var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
+ a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
+ return [cos(a) * r, sin(a) * r];
+ };
+
+ arc.innerRadius = function(_) {
+ return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius;
+ };
+
+ arc.outerRadius = function(_) {
+ return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius;
+ };
+
+ arc.cornerRadius = function(_) {
+ return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius;
+ };
+
+ arc.padRadius = function(_) {
+ return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius;
+ };
+
+ arc.startAngle = function(_) {
+ return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle;
+ };
+
+ arc.endAngle = function(_) {
+ return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle;
+ };
+
+ arc.padAngle = function(_) {
+ return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle;
+ };
+
+ arc.context = function(_) {
+ return arguments.length ? ((context = _ == null ? null : _), arc) : context;
+ };
+
+ return arc;
+}
+
+function Linear(context) {
+ this._context = context;
+}
+
+Linear.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; // proceed
+ default: this._context.lineTo(x, y); break;
+ }
+ }
+};
+
+function curveLinear(context) {
+ return new Linear(context);
+}
+
+function x(p) {
+ return p[0];
+}
+
+function y(p) {
+ return p[1];
+}
+
+function line() {
+ var x$1 = x,
+ y$1 = y,
+ defined = constant(true),
+ context = null,
+ curve = curveLinear,
+ output = null;
+
+ function line(data) {
+ var i,
+ n = data.length,
+ d,
+ defined0 = false,
+ buffer;
+
+ if (context == null) output = curve(buffer = d3Path.path());
+
+ for (i = 0; i <= n; ++i) {
+ if (!(i < n && defined(d = data[i], i, data)) === defined0) {
+ if (defined0 = !defined0) output.lineStart();
+ else output.lineEnd();
+ }
+ if (defined0) output.point(+x$1(d, i, data), +y$1(d, i, data));
+ }
+
+ if (buffer) return output = null, buffer + "" || null;
+ }
+
+ line.x = function(_) {
+ return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), line) : x$1;
+ };
+
+ line.y = function(_) {
+ return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), line) : y$1;
+ };
+
+ line.defined = function(_) {
+ return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), line) : defined;
+ };
+
+ line.curve = function(_) {
+ return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
+ };
+
+ line.context = function(_) {
+ return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
+ };
+
+ return line;
+}
+
+function area() {
+ var x0 = x,
+ x1 = null,
+ y0 = constant(0),
+ y1 = y,
+ defined = constant(true),
+ context = null,
+ curve = curveLinear,
+ output = null;
+
+ function area(data) {
+ var i,
+ j,
+ k,
+ n = data.length,
+ d,
+ defined0 = false,
+ buffer,
+ x0z = new Array(n),
+ y0z = new Array(n);
+
+ if (context == null) output = curve(buffer = d3Path.path());
+
+ for (i = 0; i <= n; ++i) {
+ if (!(i < n && defined(d = data[i], i, data)) === defined0) {
+ if (defined0 = !defined0) {
+ j = i;
+ output.areaStart();
+ output.lineStart();
+ } else {
+ output.lineEnd();
+ output.lineStart();
+ for (k = i - 1; k >= j; --k) {
+ output.point(x0z[k], y0z[k]);
+ }
+ output.lineEnd();
+ output.areaEnd();
+ }
+ }
+ if (defined0) {
+ x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);
+ output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);
+ }
+ }
+
+ if (buffer) return output = null, buffer + "" || null;
+ }
+
+ function arealine() {
+ return line().defined(defined).curve(curve).context(context);
+ }
+
+ area.x = function(_) {
+ return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), x1 = null, area) : x0;
+ };
+
+ area.x0 = function(_) {
+ return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), area) : x0;
+ };
+
+ area.x1 = function(_) {
+ return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : x1;
+ };
+
+ area.y = function(_) {
+ return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), y1 = null, area) : y0;
+ };
+
+ area.y0 = function(_) {
+ return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), area) : y0;
+ };
+
+ area.y1 = function(_) {
+ return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : y1;
+ };
+
+ area.lineX0 =
+ area.lineY0 = function() {
+ return arealine().x(x0).y(y0);
+ };
+
+ area.lineY1 = function() {
+ return arealine().x(x0).y(y1);
+ };
+
+ area.lineX1 = function() {
+ return arealine().x(x1).y(y0);
+ };
+
+ area.defined = function(_) {
+ return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), area) : defined;
+ };
+
+ area.curve = function(_) {
+ return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;
+ };
+
+ area.context = function(_) {
+ return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;
+ };
+
+ return area;
+}
+
+function descending(a, b) {
+ return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
+}
+
+function identity(d) {
+ return d;
+}
+
+function pie() {
+ var value = identity,
+ sortValues = descending,
+ sort = null,
+ startAngle = constant(0),
+ endAngle = constant(tau),
+ padAngle = constant(0);
+
+ function pie(data) {
+ var i,
+ n = data.length,
+ j,
+ k,
+ sum = 0,
+ index = new Array(n),
+ arcs = new Array(n),
+ a0 = +startAngle.apply(this, arguments),
+ da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),
+ a1,
+ p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),
+ pa = p * (da < 0 ? -1 : 1),
+ v;
+
+ for (i = 0; i < n; ++i) {
+ if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {
+ sum += v;
+ }
+ }
+
+ // Optionally sort the arcs by previously-computed values or by data.
+ if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });
+ else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });
+
+ // Compute the arcs! They are stored in the original data's order.
+ for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {
+ j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {
+ data: data[j],
+ index: i,
+ value: v,
+ startAngle: a0,
+ endAngle: a1,
+ padAngle: p
+ };
+ }
+
+ return arcs;
+ }
+
+ pie.value = function(_) {
+ return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), pie) : value;
+ };
+
+ pie.sortValues = function(_) {
+ return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;
+ };
+
+ pie.sort = function(_) {
+ return arguments.length ? (sort = _, sortValues = null, pie) : sort;
+ };
+
+ pie.startAngle = function(_) {
+ return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), pie) : startAngle;
+ };
+
+ pie.endAngle = function(_) {
+ return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), pie) : endAngle;
+ };
+
+ pie.padAngle = function(_) {
+ return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), pie) : padAngle;
+ };
+
+ return pie;
+}
+
+var curveRadialLinear = curveRadial(curveLinear);
+
+function Radial(curve) {
+ this._curve = curve;
+}
+
+Radial.prototype = {
+ areaStart: function() {
+ this._curve.areaStart();
+ },
+ areaEnd: function() {
+ this._curve.areaEnd();
+ },
+ lineStart: function() {
+ this._curve.lineStart();
+ },
+ lineEnd: function() {
+ this._curve.lineEnd();
+ },
+ point: function(a, r) {
+ this._curve.point(r * Math.sin(a), r * -Math.cos(a));
+ }
+};
+
+function curveRadial(curve) {
+
+ function radial(context) {
+ return new Radial(curve(context));
+ }
+
+ radial._curve = curve;
+
+ return radial;
+}
+
+function lineRadial(l) {
+ var c = l.curve;
+
+ l.angle = l.x, delete l.x;
+ l.radius = l.y, delete l.y;
+
+ l.curve = function(_) {
+ return arguments.length ? c(curveRadial(_)) : c()._curve;
+ };
+
+ return l;
+}
+
+function lineRadial$1() {
+ return lineRadial(line().curve(curveRadialLinear));
+}
+
+function areaRadial() {
+ var a = area().curve(curveRadialLinear),
+ c = a.curve,
+ x0 = a.lineX0,
+ x1 = a.lineX1,
+ y0 = a.lineY0,
+ y1 = a.lineY1;
+
+ a.angle = a.x, delete a.x;
+ a.startAngle = a.x0, delete a.x0;
+ a.endAngle = a.x1, delete a.x1;
+ a.radius = a.y, delete a.y;
+ a.innerRadius = a.y0, delete a.y0;
+ a.outerRadius = a.y1, delete a.y1;
+ a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;
+ a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;
+ a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;
+ a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;
+
+ a.curve = function(_) {
+ return arguments.length ? c(curveRadial(_)) : c()._curve;
+ };
+
+ return a;
+}
+
+function pointRadial(x, y) {
+ return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];
+}
+
+var slice = Array.prototype.slice;
+
+function linkSource(d) {
+ return d.source;
+}
+
+function linkTarget(d) {
+ return d.target;
+}
+
+function link(curve) {
+ var source = linkSource,
+ target = linkTarget,
+ x$1 = x,
+ y$1 = y,
+ context = null;
+
+ function link() {
+ var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);
+ if (!context) context = buffer = d3Path.path();
+ curve(context, +x$1.apply(this, (argv[0] = s, argv)), +y$1.apply(this, argv), +x$1.apply(this, (argv[0] = t, argv)), +y$1.apply(this, argv));
+ if (buffer) return context = null, buffer + "" || null;
+ }
+
+ link.source = function(_) {
+ return arguments.length ? (source = _, link) : source;
+ };
+
+ link.target = function(_) {
+ return arguments.length ? (target = _, link) : target;
+ };
+
+ link.x = function(_) {
+ return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), link) : x$1;
+ };
+
+ link.y = function(_) {
+ return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), link) : y$1;
+ };
+
+ link.context = function(_) {
+ return arguments.length ? ((context = _ == null ? null : _), link) : context;
+ };
+
+ return link;
+}
+
+function curveHorizontal(context, x0, y0, x1, y1) {
+ context.moveTo(x0, y0);
+ context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);
+}
+
+function curveVertical(context, x0, y0, x1, y1) {
+ context.moveTo(x0, y0);
+ context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);
+}
+
+function curveRadial$1(context, x0, y0, x1, y1) {
+ var p0 = pointRadial(x0, y0),
+ p1 = pointRadial(x0, y0 = (y0 + y1) / 2),
+ p2 = pointRadial(x1, y0),
+ p3 = pointRadial(x1, y1);
+ context.moveTo(p0[0], p0[1]);
+ context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);
+}
+
+function linkHorizontal() {
+ return link(curveHorizontal);
+}
+
+function linkVertical() {
+ return link(curveVertical);
+}
+
+function linkRadial() {
+ var l = link(curveRadial$1);
+ l.angle = l.x, delete l.x;
+ l.radius = l.y, delete l.y;
+ return l;
+}
+
+var circle = {
+ draw: function(context, size) {
+ var r = Math.sqrt(size / pi);
+ context.moveTo(r, 0);
+ context.arc(0, 0, r, 0, tau);
+ }
+};
+
+var cross = {
+ draw: function(context, size) {
+ var r = Math.sqrt(size / 5) / 2;
+ context.moveTo(-3 * r, -r);
+ context.lineTo(-r, -r);
+ context.lineTo(-r, -3 * r);
+ context.lineTo(r, -3 * r);
+ context.lineTo(r, -r);
+ context.lineTo(3 * r, -r);
+ context.lineTo(3 * r, r);
+ context.lineTo(r, r);
+ context.lineTo(r, 3 * r);
+ context.lineTo(-r, 3 * r);
+ context.lineTo(-r, r);
+ context.lineTo(-3 * r, r);
+ context.closePath();
+ }
+};
+
+var tan30 = Math.sqrt(1 / 3),
+ tan30_2 = tan30 * 2;
+
+var diamond = {
+ draw: function(context, size) {
+ var y = Math.sqrt(size / tan30_2),
+ x = y * tan30;
+ context.moveTo(0, -y);
+ context.lineTo(x, 0);
+ context.lineTo(0, y);
+ context.lineTo(-x, 0);
+ context.closePath();
+ }
+};
+
+var ka = 0.89081309152928522810,
+ kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),
+ kx = Math.sin(tau / 10) * kr,
+ ky = -Math.cos(tau / 10) * kr;
+
+var star = {
+ draw: function(context, size) {
+ var r = Math.sqrt(size * ka),
+ x = kx * r,
+ y = ky * r;
+ context.moveTo(0, -r);
+ context.lineTo(x, y);
+ for (var i = 1; i < 5; ++i) {
+ var a = tau * i / 5,
+ c = Math.cos(a),
+ s = Math.sin(a);
+ context.lineTo(s * r, -c * r);
+ context.lineTo(c * x - s * y, s * x + c * y);
+ }
+ context.closePath();
+ }
+};
+
+var square = {
+ draw: function(context, size) {
+ var w = Math.sqrt(size),
+ x = -w / 2;
+ context.rect(x, x, w, w);
+ }
+};
+
+var sqrt3 = Math.sqrt(3);
+
+var triangle = {
+ draw: function(context, size) {
+ var y = -Math.sqrt(size / (sqrt3 * 3));
+ context.moveTo(0, y * 2);
+ context.lineTo(-sqrt3 * y, -y);
+ context.lineTo(sqrt3 * y, -y);
+ context.closePath();
+ }
+};
+
+var c = -0.5,
+ s = Math.sqrt(3) / 2,
+ k = 1 / Math.sqrt(12),
+ a = (k / 2 + 1) * 3;
+
+var wye = {
+ draw: function(context, size) {
+ var r = Math.sqrt(size / a),
+ x0 = r / 2,
+ y0 = r * k,
+ x1 = x0,
+ y1 = r * k + r,
+ x2 = -x1,
+ y2 = y1;
+ context.moveTo(x0, y0);
+ context.lineTo(x1, y1);
+ context.lineTo(x2, y2);
+ context.lineTo(c * x0 - s * y0, s * x0 + c * y0);
+ context.lineTo(c * x1 - s * y1, s * x1 + c * y1);
+ context.lineTo(c * x2 - s * y2, s * x2 + c * y2);
+ context.lineTo(c * x0 + s * y0, c * y0 - s * x0);
+ context.lineTo(c * x1 + s * y1, c * y1 - s * x1);
+ context.lineTo(c * x2 + s * y2, c * y2 - s * x2);
+ context.closePath();
+ }
+};
+
+var symbols = [
+ circle,
+ cross,
+ diamond,
+ square,
+ star,
+ triangle,
+ wye
+];
+
+function symbol() {
+ var type = constant(circle),
+ size = constant(64),
+ context = null;
+
+ function symbol() {
+ var buffer;
+ if (!context) context = buffer = d3Path.path();
+ type.apply(this, arguments).draw(context, +size.apply(this, arguments));
+ if (buffer) return context = null, buffer + "" || null;
+ }
+
+ symbol.type = function(_) {
+ return arguments.length ? (type = typeof _ === "function" ? _ : constant(_), symbol) : type;
+ };
+
+ symbol.size = function(_) {
+ return arguments.length ? (size = typeof _ === "function" ? _ : constant(+_), symbol) : size;
+ };
+
+ symbol.context = function(_) {
+ return arguments.length ? (context = _ == null ? null : _, symbol) : context;
+ };
+
+ return symbol;
+}
+
+function noop() {}
+
+function point(that, x, y) {
+ that._context.bezierCurveTo(
+ (2 * that._x0 + that._x1) / 3,
+ (2 * that._y0 + that._y1) / 3,
+ (that._x0 + 2 * that._x1) / 3,
+ (that._y0 + 2 * that._y1) / 3,
+ (that._x0 + 4 * that._x1 + x) / 6,
+ (that._y0 + 4 * that._y1 + y) / 6
+ );
+}
+
+function Basis(context) {
+ this._context = context;
+}
+
+Basis.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 =
+ this._y0 = this._y1 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 3: point(this, this._x1, this._y1); // proceed
+ case 2: this._context.lineTo(this._x1, this._y1); break;
+ }
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed
+ default: point(this, x, y); break;
+ }
+ this._x0 = this._x1, this._x1 = x;
+ this._y0 = this._y1, this._y1 = y;
+ }
+};
+
+function basis(context) {
+ return new Basis(context);
+}
+
+function BasisClosed(context) {
+ this._context = context;
+}
+
+BasisClosed.prototype = {
+ areaStart: noop,
+ areaEnd: noop,
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =
+ this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 1: {
+ this._context.moveTo(this._x2, this._y2);
+ this._context.closePath();
+ break;
+ }
+ case 2: {
+ this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
+ this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
+ this._context.closePath();
+ break;
+ }
+ case 3: {
+ this.point(this._x2, this._y2);
+ this.point(this._x3, this._y3);
+ this.point(this._x4, this._y4);
+ break;
+ }
+ }
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._x2 = x, this._y2 = y; break;
+ case 1: this._point = 2; this._x3 = x, this._y3 = y; break;
+ case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;
+ default: point(this, x, y); break;
+ }
+ this._x0 = this._x1, this._x1 = x;
+ this._y0 = this._y1, this._y1 = y;
+ }
+};
+
+function basisClosed(context) {
+ return new BasisClosed(context);
+}
+
+function BasisOpen(context) {
+ this._context = context;
+}
+
+BasisOpen.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 =
+ this._y0 = this._y1 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;
+ case 3: this._point = 4; // proceed
+ default: point(this, x, y); break;
+ }
+ this._x0 = this._x1, this._x1 = x;
+ this._y0 = this._y1, this._y1 = y;
+ }
+};
+
+function basisOpen(context) {
+ return new BasisOpen(context);
+}
+
+function Bundle(context, beta) {
+ this._basis = new Basis(context);
+ this._beta = beta;
+}
+
+Bundle.prototype = {
+ lineStart: function() {
+ this._x = [];
+ this._y = [];
+ this._basis.lineStart();
+ },
+ lineEnd: function() {
+ var x = this._x,
+ y = this._y,
+ j = x.length - 1;
+
+ if (j > 0) {
+ var x0 = x[0],
+ y0 = y[0],
+ dx = x[j] - x0,
+ dy = y[j] - y0,
+ i = -1,
+ t;
+
+ while (++i <= j) {
+ t = i / j;
+ this._basis.point(
+ this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),
+ this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)
+ );
+ }
+ }
+
+ this._x = this._y = null;
+ this._basis.lineEnd();
+ },
+ point: function(x, y) {
+ this._x.push(+x);
+ this._y.push(+y);
+ }
+};
+
+var bundle = (function custom(beta) {
+
+ function bundle(context) {
+ return beta === 1 ? new Basis(context) : new Bundle(context, beta);
+ }
+
+ bundle.beta = function(beta) {
+ return custom(+beta);
+ };
+
+ return bundle;
+})(0.85);
+
+function point$1(that, x, y) {
+ that._context.bezierCurveTo(
+ that._x1 + that._k * (that._x2 - that._x0),
+ that._y1 + that._k * (that._y2 - that._y0),
+ that._x2 + that._k * (that._x1 - x),
+ that._y2 + that._k * (that._y1 - y),
+ that._x2,
+ that._y2
+ );
+}
+
+function Cardinal(context, tension) {
+ this._context = context;
+ this._k = (1 - tension) / 6;
+}
+
+Cardinal.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 =
+ this._y0 = this._y1 = this._y2 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 2: this._context.lineTo(this._x2, this._y2); break;
+ case 3: point$1(this, this._x1, this._y1); break;
+ }
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; this._x1 = x, this._y1 = y; break;
+ case 2: this._point = 3; // proceed
+ default: point$1(this, x, y); break;
+ }
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
+ }
+};
+
+var cardinal = (function custom(tension) {
+
+ function cardinal(context) {
+ return new Cardinal(context, tension);
+ }
+
+ cardinal.tension = function(tension) {
+ return custom(+tension);
+ };
+
+ return cardinal;
+})(0);
+
+function CardinalClosed(context, tension) {
+ this._context = context;
+ this._k = (1 - tension) / 6;
+}
+
+CardinalClosed.prototype = {
+ areaStart: noop,
+ areaEnd: noop,
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =
+ this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 1: {
+ this._context.moveTo(this._x3, this._y3);
+ this._context.closePath();
+ break;
+ }
+ case 2: {
+ this._context.lineTo(this._x3, this._y3);
+ this._context.closePath();
+ break;
+ }
+ case 3: {
+ this.point(this._x3, this._y3);
+ this.point(this._x4, this._y4);
+ this.point(this._x5, this._y5);
+ break;
+ }
+ }
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._x3 = x, this._y3 = y; break;
+ case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;
+ case 2: this._point = 3; this._x5 = x, this._y5 = y; break;
+ default: point$1(this, x, y); break;
+ }
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
+ }
+};
+
+var cardinalClosed = (function custom(tension) {
+
+ function cardinal(context) {
+ return new CardinalClosed(context, tension);
+ }
+
+ cardinal.tension = function(tension) {
+ return custom(+tension);
+ };
+
+ return cardinal;
+})(0);
+
+function CardinalOpen(context, tension) {
+ this._context = context;
+ this._k = (1 - tension) / 6;
+}
+
+CardinalOpen.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 =
+ this._y0 = this._y1 = this._y2 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;
+ case 3: this._point = 4; // proceed
+ default: point$1(this, x, y); break;
+ }
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
+ }
+};
+
+var cardinalOpen = (function custom(tension) {
+
+ function cardinal(context) {
+ return new CardinalOpen(context, tension);
+ }
+
+ cardinal.tension = function(tension) {
+ return custom(+tension);
+ };
+
+ return cardinal;
+})(0);
+
+function point$2(that, x, y) {
+ var x1 = that._x1,
+ y1 = that._y1,
+ x2 = that._x2,
+ y2 = that._y2;
+
+ if (that._l01_a > epsilon) {
+ var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,
+ n = 3 * that._l01_a * (that._l01_a + that._l12_a);
+ x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;
+ y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;
+ }
+
+ if (that._l23_a > epsilon) {
+ var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,
+ m = 3 * that._l23_a * (that._l23_a + that._l12_a);
+ x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;
+ y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;
+ }
+
+ that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);
+}
+
+function CatmullRom(context, alpha) {
+ this._context = context;
+ this._alpha = alpha;
+}
+
+CatmullRom.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 =
+ this._y0 = this._y1 = this._y2 = NaN;
+ this._l01_a = this._l12_a = this._l23_a =
+ this._l01_2a = this._l12_2a = this._l23_2a =
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 2: this._context.lineTo(this._x2, this._y2); break;
+ case 3: this.point(this._x2, this._y2); break;
+ }
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+
+ if (this._point) {
+ var x23 = this._x2 - x,
+ y23 = this._y2 - y;
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
+ }
+
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; // proceed
+ default: point$2(this, x, y); break;
+ }
+
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
+ }
+};
+
+var catmullRom = (function custom(alpha) {
+
+ function catmullRom(context) {
+ return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
+ }
+
+ catmullRom.alpha = function(alpha) {
+ return custom(+alpha);
+ };
+
+ return catmullRom;
+})(0.5);
+
+function CatmullRomClosed(context, alpha) {
+ this._context = context;
+ this._alpha = alpha;
+}
+
+CatmullRomClosed.prototype = {
+ areaStart: noop,
+ areaEnd: noop,
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =
+ this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
+ this._l01_a = this._l12_a = this._l23_a =
+ this._l01_2a = this._l12_2a = this._l23_2a =
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 1: {
+ this._context.moveTo(this._x3, this._y3);
+ this._context.closePath();
+ break;
+ }
+ case 2: {
+ this._context.lineTo(this._x3, this._y3);
+ this._context.closePath();
+ break;
+ }
+ case 3: {
+ this.point(this._x3, this._y3);
+ this.point(this._x4, this._y4);
+ this.point(this._x5, this._y5);
+ break;
+ }
+ }
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+
+ if (this._point) {
+ var x23 = this._x2 - x,
+ y23 = this._y2 - y;
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
+ }
+
+ switch (this._point) {
+ case 0: this._point = 1; this._x3 = x, this._y3 = y; break;
+ case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;
+ case 2: this._point = 3; this._x5 = x, this._y5 = y; break;
+ default: point$2(this, x, y); break;
+ }
+
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
+ }
+};
+
+var catmullRomClosed = (function custom(alpha) {
+
+ function catmullRom(context) {
+ return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
+ }
+
+ catmullRom.alpha = function(alpha) {
+ return custom(+alpha);
+ };
+
+ return catmullRom;
+})(0.5);
+
+function CatmullRomOpen(context, alpha) {
+ this._context = context;
+ this._alpha = alpha;
+}
+
+CatmullRomOpen.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 =
+ this._y0 = this._y1 = this._y2 = NaN;
+ this._l01_a = this._l12_a = this._l23_a =
+ this._l01_2a = this._l12_2a = this._l23_2a =
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+
+ if (this._point) {
+ var x23 = this._x2 - x,
+ y23 = this._y2 - y;
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
+ }
+
+ switch (this._point) {
+ case 0: this._point = 1; break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;
+ case 3: this._point = 4; // proceed
+ default: point$2(this, x, y); break;
+ }
+
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
+ }
+};
+
+var catmullRomOpen = (function custom(alpha) {
+
+ function catmullRom(context) {
+ return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
+ }
+
+ catmullRom.alpha = function(alpha) {
+ return custom(+alpha);
+ };
+
+ return catmullRom;
+})(0.5);
+
+function LinearClosed(context) {
+ this._context = context;
+}
+
+LinearClosed.prototype = {
+ areaStart: noop,
+ areaEnd: noop,
+ lineStart: function() {
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._point) this._context.closePath();
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ if (this._point) this._context.lineTo(x, y);
+ else this._point = 1, this._context.moveTo(x, y);
+ }
+};
+
+function linearClosed(context) {
+ return new LinearClosed(context);
+}
+
+function sign(x) {
+ return x < 0 ? -1 : 1;
+}
+
+// Calculate the slopes of the tangents (Hermite-type interpolation) based on
+// the following paper: Steffen, M. 1990. A Simple Method for Monotonic
+// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.
+// NOV(II), P. 443, 1990.
+function slope3(that, x2, y2) {
+ var h0 = that._x1 - that._x0,
+ h1 = x2 - that._x1,
+ s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),
+ s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),
+ p = (s0 * h1 + s1 * h0) / (h0 + h1);
+ return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;
+}
+
+// Calculate a one-sided slope.
+function slope2(that, t) {
+ var h = that._x1 - that._x0;
+ return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;
+}
+
+// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations
+// "you can express cubic Hermite interpolation in terms of cubic Bézier curves
+// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1".
+function point$3(that, t0, t1) {
+ var x0 = that._x0,
+ y0 = that._y0,
+ x1 = that._x1,
+ y1 = that._y1,
+ dx = (x1 - x0) / 3;
+ that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);
+}
+
+function MonotoneX(context) {
+ this._context = context;
+}
+
+MonotoneX.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 =
+ this._y0 = this._y1 =
+ this._t0 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 2: this._context.lineTo(this._x1, this._y1); break;
+ case 3: point$3(this, this._t0, slope2(this, this._t0)); break;
+ }
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ var t1 = NaN;
+
+ x = +x, y = +y;
+ if (x === this._x1 && y === this._y1) return; // Ignore coincident points.
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; point$3(this, slope2(this, t1 = slope3(this, x, y)), t1); break;
+ default: point$3(this, this._t0, t1 = slope3(this, x, y)); break;
+ }
+
+ this._x0 = this._x1, this._x1 = x;
+ this._y0 = this._y1, this._y1 = y;
+ this._t0 = t1;
+ }
+};
+
+function MonotoneY(context) {
+ this._context = new ReflectContext(context);
+}
+
+(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {
+ MonotoneX.prototype.point.call(this, y, x);
+};
+
+function ReflectContext(context) {
+ this._context = context;
+}
+
+ReflectContext.prototype = {
+ moveTo: function(x, y) { this._context.moveTo(y, x); },
+ closePath: function() { this._context.closePath(); },
+ lineTo: function(x, y) { this._context.lineTo(y, x); },
+ bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }
+};
+
+function monotoneX(context) {
+ return new MonotoneX(context);
+}
+
+function monotoneY(context) {
+ return new MonotoneY(context);
+}
+
+function Natural(context) {
+ this._context = context;
+}
+
+Natural.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x = [];
+ this._y = [];
+ },
+ lineEnd: function() {
+ var x = this._x,
+ y = this._y,
+ n = x.length;
+
+ if (n) {
+ this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);
+ if (n === 2) {
+ this._context.lineTo(x[1], y[1]);
+ } else {
+ var px = controlPoints(x),
+ py = controlPoints(y);
+ for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {
+ this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);
+ }
+ }
+ }
+
+ if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ this._x = this._y = null;
+ },
+ point: function(x, y) {
+ this._x.push(+x);
+ this._y.push(+y);
+ }
+};
+
+// See https://www.particleincell.com/2012/bezier-splines/ for derivation.
+function controlPoints(x) {
+ var i,
+ n = x.length - 1,
+ m,
+ a = new Array(n),
+ b = new Array(n),
+ r = new Array(n);
+ a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];
+ for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];
+ a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];
+ for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];
+ a[n - 1] = r[n - 1] / b[n - 1];
+ for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];
+ b[n - 1] = (x[n] + a[n - 1]) / 2;
+ for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];
+ return [a, b];
+}
+
+function natural(context) {
+ return new Natural(context);
+}
+
+function Step(context, t) {
+ this._context = context;
+ this._t = t;
+}
+
+Step.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x = this._y = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; // proceed
+ default: {
+ if (this._t <= 0) {
+ this._context.lineTo(this._x, y);
+ this._context.lineTo(x, y);
+ } else {
+ var x1 = this._x * (1 - this._t) + x * this._t;
+ this._context.lineTo(x1, this._y);
+ this._context.lineTo(x1, y);
+ }
+ break;
+ }
+ }
+ this._x = x, this._y = y;
+ }
+};
+
+function step(context) {
+ return new Step(context, 0.5);
+}
+
+function stepBefore(context) {
+ return new Step(context, 0);
+}
+
+function stepAfter(context) {
+ return new Step(context, 1);
+}
+
+function none(series, order) {
+ if (!((n = series.length) > 1)) return;
+ for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {
+ s0 = s1, s1 = series[order[i]];
+ for (j = 0; j < m; ++j) {
+ s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];
+ }
+ }
+}
+
+function none$1(series) {
+ var n = series.length, o = new Array(n);
+ while (--n >= 0) o[n] = n;
+ return o;
+}
+
+function stackValue(d, key) {
+ return d[key];
+}
+
+function stack() {
+ var keys = constant([]),
+ order = none$1,
+ offset = none,
+ value = stackValue;
+
+ function stack(data) {
+ var kz = keys.apply(this, arguments),
+ i,
+ m = data.length,
+ n = kz.length,
+ sz = new Array(n),
+ oz;
+
+ for (i = 0; i < n; ++i) {
+ for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) {
+ si[j] = sij = [0, +value(data[j], ki, j, data)];
+ sij.data = data[j];
+ }
+ si.key = ki;
+ }
+
+ for (i = 0, oz = order(sz); i < n; ++i) {
+ sz[oz[i]].index = i;
+ }
+
+ offset(sz, oz);
+ return sz;
+ }
+
+ stack.keys = function(_) {
+ return arguments.length ? (keys = typeof _ === "function" ? _ : constant(slice.call(_)), stack) : keys;
+ };
+
+ stack.value = function(_) {
+ return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), stack) : value;
+ };
+
+ stack.order = function(_) {
+ return arguments.length ? (order = _ == null ? none$1 : typeof _ === "function" ? _ : constant(slice.call(_)), stack) : order;
+ };
+
+ stack.offset = function(_) {
+ return arguments.length ? (offset = _ == null ? none : _, stack) : offset;
+ };
+
+ return stack;
+}
+
+function expand(series, order) {
+ if (!((n = series.length) > 0)) return;
+ for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {
+ for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;
+ if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;
+ }
+ none(series, order);
+}
+
+function diverging(series, order) {
+ if (!((n = series.length) > 0)) return;
+ for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {
+ for (yp = yn = 0, i = 0; i < n; ++i) {
+ if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {
+ d[0] = yp, d[1] = yp += dy;
+ } else if (dy < 0) {
+ d[1] = yn, d[0] = yn += dy;
+ } else {
+ d[0] = 0, d[1] = dy;
+ }
+ }
+ }
+}
+
+function silhouette(series, order) {
+ if (!((n = series.length) > 0)) return;
+ for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {
+ for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;
+ s0[j][1] += s0[j][0] = -y / 2;
+ }
+ none(series, order);
+}
+
+function wiggle(series, order) {
+ if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;
+ for (var y = 0, j = 1, s0, m, n; j < m; ++j) {
+ for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {
+ var si = series[order[i]],
+ sij0 = si[j][1] || 0,
+ sij1 = si[j - 1][1] || 0,
+ s3 = (sij0 - sij1) / 2;
+ for (var k = 0; k < i; ++k) {
+ var sk = series[order[k]],
+ skj0 = sk[j][1] || 0,
+ skj1 = sk[j - 1][1] || 0;
+ s3 += skj0 - skj1;
+ }
+ s1 += sij0, s2 += s3 * sij0;
+ }
+ s0[j - 1][1] += s0[j - 1][0] = y;
+ if (s1) y -= s2 / s1;
+ }
+ s0[j - 1][1] += s0[j - 1][0] = y;
+ none(series, order);
+}
+
+function appearance(series) {
+ var peaks = series.map(peak);
+ return none$1(series).sort(function(a, b) { return peaks[a] - peaks[b]; });
+}
+
+function peak(series) {
+ var i = -1, j = 0, n = series.length, vi, vj = -Infinity;
+ while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i;
+ return j;
+}
+
+function ascending(series) {
+ var sums = series.map(sum);
+ return none$1(series).sort(function(a, b) { return sums[a] - sums[b]; });
+}
+
+function sum(series) {
+ var s = 0, i = -1, n = series.length, v;
+ while (++i < n) if (v = +series[i][1]) s += v;
+ return s;
+}
+
+function descending$1(series) {
+ return ascending(series).reverse();
+}
+
+function insideOut(series) {
+ var n = series.length,
+ i,
+ j,
+ sums = series.map(sum),
+ order = appearance(series),
+ top = 0,
+ bottom = 0,
+ tops = [],
+ bottoms = [];
+
+ for (i = 0; i < n; ++i) {
+ j = order[i];
+ if (top < bottom) {
+ top += sums[j];
+ tops.push(j);
+ } else {
+ bottom += sums[j];
+ bottoms.push(j);
+ }
+ }
+
+ return bottoms.reverse().concat(tops);
+}
+
+function reverse(series) {
+ return none$1(series).reverse();
+}
+
+exports.arc = arc;
+exports.area = area;
+exports.areaRadial = areaRadial;
+exports.curveBasis = basis;
+exports.curveBasisClosed = basisClosed;
+exports.curveBasisOpen = basisOpen;
+exports.curveBundle = bundle;
+exports.curveCardinal = cardinal;
+exports.curveCardinalClosed = cardinalClosed;
+exports.curveCardinalOpen = cardinalOpen;
+exports.curveCatmullRom = catmullRom;
+exports.curveCatmullRomClosed = catmullRomClosed;
+exports.curveCatmullRomOpen = catmullRomOpen;
+exports.curveLinear = curveLinear;
+exports.curveLinearClosed = linearClosed;
+exports.curveMonotoneX = monotoneX;
+exports.curveMonotoneY = monotoneY;
+exports.curveNatural = natural;
+exports.curveStep = step;
+exports.curveStepAfter = stepAfter;
+exports.curveStepBefore = stepBefore;
+exports.line = line;
+exports.lineRadial = lineRadial$1;
+exports.linkHorizontal = linkHorizontal;
+exports.linkRadial = linkRadial;
+exports.linkVertical = linkVertical;
+exports.pie = pie;
+exports.pointRadial = pointRadial;
+exports.radialArea = areaRadial;
+exports.radialLine = lineRadial$1;
+exports.stack = stack;
+exports.stackOffsetDiverging = diverging;
+exports.stackOffsetExpand = expand;
+exports.stackOffsetNone = none;
+exports.stackOffsetSilhouette = silhouette;
+exports.stackOffsetWiggle = wiggle;
+exports.stackOrderAppearance = appearance;
+exports.stackOrderAscending = ascending;
+exports.stackOrderDescending = descending$1;
+exports.stackOrderInsideOut = insideOut;
+exports.stackOrderNone = none$1;
+exports.stackOrderReverse = reverse;
+exports.symbol = symbol;
+exports.symbolCircle = circle;
+exports.symbolCross = cross;
+exports.symbolDiamond = diamond;
+exports.symbolSquare = square;
+exports.symbolStar = star;
+exports.symbolTriangle = triangle;
+exports.symbolWye = wye;
+exports.symbols = symbols;
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+}));
diff --git a/node_modules/d3-shape/dist/d3-shape.min.js b/node_modules/d3-shape/dist/d3-shape.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..88c96e38b5f2508f0cd6c709b90f79f7b4f51362
--- /dev/null
+++ b/node_modules/d3-shape/dist/d3-shape.min.js
@@ -0,0 +1,2 @@
+// https://d3js.org/d3-shape/ v1.3.7 Copyright 2019 Mike Bostock
+!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-path")):"function"==typeof define&&define.amd?define(["exports","d3-path"],n):n((t=t||self).d3=t.d3||{},t.d3)}(this,function(t,n){"use strict";function i(t){return function(){return t}}var e=Math.abs,s=Math.atan2,h=Math.cos,o=Math.max,_=Math.min,r=Math.sin,a=Math.sqrt,c=1e-12,l=Math.PI,u=l/2,f=2*l;function x(t){return t>=1?u:t<=-1?-u:Math.asin(t)}function y(t){return t.innerRadius}function p(t){return t.outerRadius}function v(t){return t.startAngle}function d(t){return t.endAngle}function T(t){return t&&t.padAngle}function g(t,n,i,e,s,h,_){var r=t-i,c=n-e,l=(_?h:-h)/a(r*r+c*c),u=l*c,f=-l*r,x=t+u,y=n+f,p=i+u,v=e+f,d=(x+p)/2,T=(y+v)/2,g=p-x,b=v-y,w=g*g+b*b,k=s-h,m=x*v-p*y,N=(b<0?-1:1)*a(o(0,k*k*w-m*m)),M=(m*b-g*N)/w,S=(-m*g-b*N)/w,E=(m*b+g*N)/w,A=(-m*g+b*N)/w,P=M-d,C=S-T,O=E-d,R=A-T;return P*P+C*C>O*O+R*R&&(M=E,S=A),{cx:M,cy:S,x01:-u,y01:-f,x11:M*(s/k-1),y11:S*(s/k-1)}}function b(t){this._context=t}function w(t){return new b(t)}function k(t){return t[0]}function m(t){return t[1]}function N(){var t=k,e=m,s=i(!0),h=null,o=w,_=null;function r(i){var r,a,c,l=i.length,u=!1;for(null==h&&(_=o(c=n.path())),r=0;r<=l;++r)!(r=l;--u)a.point(v[u],d[u]);a.lineEnd(),a.areaEnd()}p&&(v[c]=+t(f,c,i),d[c]=+s(f,c,i),a.point(e?+e(f,c,i):v[c],h?+h(f,c,i):d[c]))}if(x)return a=null,x+""||null}function l(){return N().defined(o).curve(r).context(_)}return c.x=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),e=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),c):t},c.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:i(+t),c):e},c.y=function(t){return arguments.length?(s="function"==typeof t?t:i(+t),h=null,c):s},c.y0=function(t){return arguments.length?(s="function"==typeof t?t:i(+t),c):s},c.y1=function(t){return arguments.length?(h=null==t?null:"function"==typeof t?t:i(+t),c):h},c.lineX0=c.lineY0=function(){return l().x(t).y(s)},c.lineY1=function(){return l().x(t).y(h)},c.lineX1=function(){return l().x(e).y(s)},c.defined=function(t){return arguments.length?(o="function"==typeof t?t:i(!!t),c):o},c.curve=function(t){return arguments.length?(r=t,null!=_&&(a=r(_)),c):r},c.context=function(t){return arguments.length?(null==t?_=a=null:a=r(_=t),c):_},c}function S(t,n){return nt?1:n>=t?0:NaN}function E(t){return t}b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var A=C(w);function P(t){this._curve=t}function C(t){function n(n){return new P(t(n))}return n._curve=t,n}function O(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(C(t)):n()._curve},t}function R(){return O(N().curve(A))}function q(){var t=M().curve(A),n=t.curve,i=t.lineX0,e=t.lineX1,s=t.lineY0,h=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return O(i())},delete t.lineX0,t.lineEndAngle=function(){return O(e())},delete t.lineX1,t.lineInnerRadius=function(){return O(s())},delete t.lineY0,t.lineOuterRadius=function(){return O(h())},delete t.lineY1,t.curve=function(t){return arguments.length?n(C(t)):n()._curve},t}function z(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}P.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var X=Array.prototype.slice;function Y(t){return t.source}function B(t){return t.target}function I(t){var e=Y,s=B,h=k,o=m,_=null;function r(){var i,r=X.call(arguments),a=e.apply(this,r),c=s.apply(this,r);if(_||(_=i=n.path()),t(_,+h.apply(this,(r[0]=a,r)),+o.apply(this,r),+h.apply(this,(r[0]=c,r)),+o.apply(this,r)),i)return _=null,i+""||null}return r.source=function(t){return arguments.length?(e=t,r):e},r.target=function(t){return arguments.length?(s=t,r):s},r.x=function(t){return arguments.length?(h="function"==typeof t?t:i(+t),r):h},r.y=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),r):o},r.context=function(t){return arguments.length?(_=null==t?null:t,r):_},r}function j(t,n,i,e,s){t.moveTo(n,i),t.bezierCurveTo(n=(n+e)/2,i,n,s,e,s)}function D(t,n,i,e,s){t.moveTo(n,i),t.bezierCurveTo(n,i=(i+s)/2,e,i,e,s)}function L(t,n,i,e,s){var h=z(n,i),o=z(n,i=(i+s)/2),_=z(e,i),r=z(e,s);t.moveTo(h[0],h[1]),t.bezierCurveTo(o[0],o[1],_[0],_[1],r[0],r[1])}var V={draw:function(t,n){var i=Math.sqrt(n/l);t.moveTo(i,0),t.arc(0,0,i,0,f)}},W={draw:function(t,n){var i=Math.sqrt(n/5)/2;t.moveTo(-3*i,-i),t.lineTo(-i,-i),t.lineTo(-i,-3*i),t.lineTo(i,-3*i),t.lineTo(i,-i),t.lineTo(3*i,-i),t.lineTo(3*i,i),t.lineTo(i,i),t.lineTo(i,3*i),t.lineTo(-i,3*i),t.lineTo(-i,i),t.lineTo(-3*i,i),t.closePath()}},H=Math.sqrt(1/3),F=2*H,G={draw:function(t,n){var i=Math.sqrt(n/F),e=i*H;t.moveTo(0,-i),t.lineTo(e,0),t.lineTo(0,i),t.lineTo(-e,0),t.closePath()}},J=Math.sin(l/10)/Math.sin(7*l/10),K=Math.sin(f/10)*J,Q=-Math.cos(f/10)*J,U={draw:function(t,n){var i=Math.sqrt(.8908130915292852*n),e=K*i,s=Q*i;t.moveTo(0,-i),t.lineTo(e,s);for(var h=1;h<5;++h){var o=f*h/5,_=Math.cos(o),r=Math.sin(o);t.lineTo(r*i,-_*i),t.lineTo(_*e-r*s,r*e+_*s)}t.closePath()}},Z={draw:function(t,n){var i=Math.sqrt(n),e=-i/2;t.rect(e,e,i,i)}},$=Math.sqrt(3),tt={draw:function(t,n){var i=-Math.sqrt(n/(3*$));t.moveTo(0,2*i),t.lineTo(-$*i,-i),t.lineTo($*i,-i),t.closePath()}},nt=-.5,it=Math.sqrt(3)/2,et=1/Math.sqrt(12),st=3*(et/2+1),ht={draw:function(t,n){var i=Math.sqrt(n/st),e=i/2,s=i*et,h=e,o=i*et+i,_=-h,r=o;t.moveTo(e,s),t.lineTo(h,o),t.lineTo(_,r),t.lineTo(nt*e-it*s,it*e+nt*s),t.lineTo(nt*h-it*o,it*h+nt*o),t.lineTo(nt*_-it*r,it*_+nt*r),t.lineTo(nt*e+it*s,nt*s-it*e),t.lineTo(nt*h+it*o,nt*o-it*h),t.lineTo(nt*_+it*r,nt*r-it*_),t.closePath()}},ot=[V,W,G,Z,U,tt,ht];function _t(){}function rt(t,n,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+i)/6)}function at(t){this._context=t}function ct(t){this._context=t}function lt(t){this._context=t}function ut(t,n){this._basis=new at(t),this._beta=n}at.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:rt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:rt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},ct.prototype={areaStart:_t,areaEnd:_t,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:rt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var i=(this._x0+4*this._x1+t)/6,e=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(i,e):this._context.moveTo(i,e);break;case 3:this._point=4;default:rt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},ut.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,i=t.length-1;if(i>0)for(var e,s=t[0],h=n[0],o=t[i]-s,_=n[i]-h,r=-1;++r<=i;)e=r/i,this._basis.point(this._beta*t[r]+(1-this._beta)*(s+e*o),this._beta*n[r]+(1-this._beta)*(h+e*_));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var ft=function t(n){function i(t){return 1===n?new at(t):new ut(t,n)}return i.beta=function(n){return t(+n)},i}(.85);function xt(t,n,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function yt(t,n){this._context=t,this._k=(1-n)/6}yt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:xt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:xt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var pt=function t(n){function i(t){return new yt(t,n)}return i.tension=function(n){return t(+n)},i}(0);function vt(t,n){this._context=t,this._k=(1-n)/6}vt.prototype={areaStart:_t,areaEnd:_t,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:xt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var dt=function t(n){function i(t){return new vt(t,n)}return i.tension=function(n){return t(+n)},i}(0);function Tt(t,n){this._context=t,this._k=(1-n)/6}Tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:xt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var gt=function t(n){function i(t){return new Tt(t,n)}return i.tension=function(n){return t(+n)},i}(0);function bt(t,n,i){var e=t._x1,s=t._y1,h=t._x2,o=t._y2;if(t._l01_a>c){var _=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,r=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*_-t._x0*t._l12_2a+t._x2*t._l01_2a)/r,s=(s*_-t._y0*t._l12_2a+t._y2*t._l01_2a)/r}if(t._l23_a>c){var a=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);h=(h*a+t._x1*t._l23_2a-n*t._l12_2a)/l,o=(o*a+t._y1*t._l23_2a-i*t._l12_2a)/l}t._context.bezierCurveTo(e,s,h,o,t._x2,t._y2)}function wt(t,n){this._context=t,this._alpha=n}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:bt(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var kt=function t(n){function i(t){return n?new wt(t,n):new yt(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);function mt(t,n){this._context=t,this._alpha=n}mt.prototype={areaStart:_t,areaEnd:_t,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:bt(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Nt=function t(n){function i(t){return n?new mt(t,n):new vt(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);function Mt(t,n){this._context=t,this._alpha=n}Mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:bt(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var St=function t(n){function i(t){return n?new Mt(t,n):new Tt(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);function Et(t){this._context=t}function At(t){return t<0?-1:1}function Pt(t,n,i){var e=t._x1-t._x0,s=n-t._x1,h=(t._y1-t._y0)/(e||s<0&&-0),o=(i-t._y1)/(s||e<0&&-0),_=(h*s+o*e)/(e+s);return(At(h)+At(o))*Math.min(Math.abs(h),Math.abs(o),.5*Math.abs(_))||0}function Ct(t,n){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-n)/2:n}function Ot(t,n,i){var e=t._x0,s=t._y0,h=t._x1,o=t._y1,_=(h-e)/3;t._context.bezierCurveTo(e+_,s+_*n,h-_,o-_*i,h,o)}function Rt(t){this._context=t}function qt(t){this._context=new zt(t)}function zt(t){this._context=t}function Xt(t){this._context=t}function Yt(t){var n,i,e=t.length-1,s=new Array(e),h=new Array(e),o=new Array(e);for(s[0]=0,h[0]=2,o[0]=t[0]+2*t[1],n=1;n=0;--n)s[n]=(o[n]-s[n+1])/h[n];for(h[e-1]=(t[e]+s[e-1])/2,n=0;n1)for(var i,e,s,h=1,o=t[n[0]],_=o.length;h=0;)i[n]=n;return i}function Dt(t,n){return t[n]}function Lt(t){var n=t.map(Vt);return jt(t).sort(function(t,i){return n[t]-n[i]})}function Vt(t){for(var n,i=-1,e=0,s=t.length,h=-1/0;++ih&&(h=n,e=i);return e}function Wt(t){var n=t.map(Ht);return jt(t).sort(function(t,i){return n[t]-n[i]})}function Ht(t){for(var n,i=0,e=-1,s=t.length;++e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,n)}}this._x=t,this._y=n}},t.arc=function(){var t=y,o=p,b=i(0),w=null,k=v,m=d,N=T,M=null;function S(){var i,y,p=+t.apply(this,arguments),v=+o.apply(this,arguments),d=k.apply(this,arguments)-u,T=m.apply(this,arguments)-u,S=e(T-d),E=T>d;if(M||(M=i=n.path()),v
+ See the README on GitHub for a quick-start
+ introduction.
+
+
+ In all examples below, var and semicolons are not shown, and if a commented-out
+ value is in quotes it means toString has been called on the preceding expression.
+
+
+ When the library is loaded, it defines a single function object,
+ Decimal, the constructor of Decimal instances.
+
+
+
+ If necessary, multiple Decimal constructors can be created, each with their own independent
+ configuration, e.g. precision and range, which applies to all Decimal instances created from
+ it.
+
+
+
+
+ A new Decimal constructor is created by calling the clone
+ method of an already existing Decimal constructor.
+
+
+
+
+
+
CONSTRUCTOR
+
+
+ DecimalDecimal(value) ⇒ Decimal
+
+
+
value: number|string|Decimal
+
+ Integer or float.
+
+
+ The number of digits is not limited, except by JavaScript's maximum array size and, in
+ practice, the processing time required.
+
+
+ The maximum permissible exponent magnitude is approximately 9007199254740991.
+
+
+ String values may be in exponential (floating-point), as well as normal (fixed-point)
+ notation.
+
+
+ In exponential notation, e or E defines a power-of-ten exponent.
+
+ Returns a new independent Decimal constructor with configuration settings as described by
+ object (see config), or with the same
+ settings as this Decimal constructor if object is omitted.
+
+ It is not inefficient in terms of memory usage to use multiple Decimal constructors as
+ functions are shared between them.
+
+
+
+
+
+ config.set(object) ⇒ Decimal constructor
+
+
object: object
+
+ Configures the 'global' settings for this particular Decimal constructor, i.e.
+ the settings which apply to operations performed on the Decimal instances created by it.
+
+
Returns this Decimal constructor.
+
+ The configuration object, object, can contain some or all of the properties
+ described in detail at Properties and shown in the
+ example below.
+
+
+ The values of the configuration object properties are checked for validity and then stored as
+ equivalently-named properties of this Decimal constructor.
+
+
Throws on an invalid object or configuration property value.
+ The properties of a Decimal constructor can also be set by direct assignment, but that will
+ by-pass the validity checking that this method performs - which is not a problem if the user
+ knows that the checks are unnecessary.
+
+ As simple object properties they can be set directly without using
+ config, and it is fine to do so, but the values assigned
+ will not then be checked for validity. For example:
+
+
Decimal.config({ precision: 0 })
+// '[DecimalError] Invalid argument: precision: 0'
+
+Decimal.precision = 0
+// No error is thrown and the results of calculations are unreliable
+ JavaScript numbers use exponential notation for negative exponents of -7 and
+ below.
+
+
+ Regardless of the value of toExpNeg, the
+ toFixed method will always return a value in normal
+ notation and the toExponential method will always
+ return a value in exponential form.
+
+ JavaScript numbers use exponential notation for positive exponents of 20 and
+ above.
+
+
+ Regardless of the value of toExpPos, the
+ toFixed method will always return a value in normal
+ notation and the toExponential method will always
+ return a value in exponential form.
+
+
+
+
+
LN10
+
+ string|Decimal: the natural logarithm of 10
+ The default value has 115 digits
+
+ The default value of LN10 enables a maximum precision of about 100
+ digits. To increase this, assign a new value to LN10 using a string or Decimal
+ value with about 15 digits more than the maximum precision required.
+
+
+ An error will be thrown if the LN10 value does not have sufficient precision to
+ enable an operation to be performed.
+
+ The library's enumerated rounding modes are stored as properties of the Decimal constructor.
+ They are not referenced internally by the library itself.
+
+
Rounding modes 0 to 6 (inclusive) are the same as those of Java's BigDecimal class.
+
+
Property
Value
Description
+
ROUND_UP
0
Rounds away from zero
+
ROUND_DOWN
1
Rounds towards zero
+
ROUND_CEIL
2
Rounds towards Infinity
+
ROUND_FLOOR
3
Rounds towards -Infinity
+
+
ROUND_HALF_UP
4
+
Rounds towards nearest neighbour. If equidistant, rounds away from zero
+
+
+
ROUND_HALF_DOWN
5
+
Rounds towards nearest neighbour. If equidistant, rounds towards zero
+
+
+
ROUND_HALF_EVEN
6
+
+ Rounds towards nearest neighbour. If equidistant, rounds towards even neighbour
+
+
+
+
ROUND_HALF_CEIL
7
+
Rounds towards nearest neighbour. If equidistant, rounds towards Infinity
+
+
+
ROUND_HALF_FLOOR
8
+
Rounds towards nearest neighbour. If equidistant, rounds towards -Infinity
+ Returns a new Decimal whose value is the base e (Euler's number, the base of the
+ natural logarithm) exponential of the value of this Decimal, truncated to
+ precision significant digits.
+
+
+ The naturalLogarithm function is the inverse of this function.
+
+
+x = new Decimal(1)
+x.naturalExponential() // '2.7182818284590452354'
+y = new Decimal(2)
+y.exp() // '7.3890560989306502272'
+
The maximum error will be 1ulp (unit in the last place).
+
The performance of this method degrades exponentially with increasing digits.
+
+
+
+
naturalLogarithm.ln() ⇒ Decimal
+
+ Returns a new Decimal whose value is the natural logarithm of the value of this Decimal,
+ truncated to precision significant digits.
+
+
+ The natural logarithm is the inverse of the naturalExponential
+ function.
+
+
+x = new Decimal(10)
+x.naturalLogarithm() // '2.3026'
+y = new Decimal('1.23e+30')
+y.ln() // '69.28'
+
+ The mathematical result of the natural logarithm function is non-terminating, unless its
+ argument is 1.
+
+
+ The time-taken by this method increases exponentially with increasing digits.
+
+
+ See LN10 to configure the maximum precision available.
+
+
+
+
+
negated.neg() ⇒ Decimal
+
+ Returns a new Decimal whose value is the value of this Decimal negated, i.e. multiplied by
+ -1.
+
+
+ The return value is not affected by the value of the
+ precision setting.
+
+
+x = new Decimal(1.8)
+x.negated() // '-1.8'
+y = new Decimal(-1.3)
+y.neg() // '1.3'
+
+
+
+
plus.plus(x) ⇒ Decimal
+
x: number|string|Decimal
+
+ Returns a new Decimal whose value is the value of this Decimal plus x, truncated
+ to precision significant digits.
+
+ dp: number: integer, 0 to 1e+9 inclusive
+ rm: number: integer, 0 to 8 inclusive
+
+
+ Returns a string representing the value of this Decimal in exponential notation rounded
+ using rounding mode rm to dp decimal places, i.e with one digit
+ before the decimal point and dp digits after it.
+
+
+ If the value of this Decimal in exponential notation has fewer than dp fraction
+ digits, the return value will be appended with zeros accordingly.
+
+
+ If dp is omitted, the number of digits after the decimal point defaults to the
+ minimum number of digits necessary to represent the value exactly.
+
+
+ If rm is omitted, rounding mode rounding is
+ used.
+
+ dp: number: integer, 0 to 1e+9 inclusive
+ rm: number: integer, 0 to 8 inclusive
+
+
+ Returns a string representing the value of this Decimal in normal (fixed-point) notation
+ rounded to dp decimal places using rounding mode rm.
+
+
+ If the value of this Decimal in normal notation has fewer than dp fraction
+ digits, the return value will be appended with zeros accordingly.
+
+
+ Unlike Number.prototype.toFixed, which returns exponential notation if a number
+ is greater or equal to 1021, this method will always return normal
+ notation.
+
+
+ If dp is omitted, the return value will be unrounded and in normal notation. This
+ is unlike Number.prototype.toFixed, which returns the value to zero decimal
+ places, but is useful when because of the current
+ toExpNeg or
+ toExpNeg values,
+ toString returns exponential notation.
+
+
+ If rm is omitted, rounding mode rounding is
+ used.
+
Returns the value of this Decimal converted to a primitive number.
+
+ Type coercion with, for example, JavaScript's unary plus operator will also work, except that
+ a Decimal with the value minus zero will convert to positive zero.
+
+
+x = new Decimal(456.789)
+x.toNumber() // 456.789
++x // 456.789
+
+y = new Decimal('45987349857634085409857349856430985')
+y.toNumber() // 4.598734985763409e+34
+
+
+
+
toPower.pow(x) ⇒ Decimal
+
x: number|string|Decimal: integer or non-integer
+
+ Returns a new Decimal whose value is the value of this Decimal raised to the power
+ x, truncated to precision significant
+ digits.
+
+
+ The performance of this method degrades exponentially with increasing digits.
+ For non-integer exponents in particular, the performance of this method may not be adequate.
+
+
The maximum error will be 1ulp (unit in the last place).
+ sd: number: integer, 1 to 1e+9 inclusive
+ rm: number: integer, 0 to 8 inclusive
+
+
+ Returns a string representing the value of this Decimal rounded to sd significant
+ digits using rounding mode rm.
+
+
+ If sd is less than the number of digits necessary to represent the integer part
+ of the value in normal (fixed-point) notation, then exponential notation is used.
+
+
+ If sd is omitted, the return value is the same as
+ toString.
+
+
+ If rm is omitted, rounding mode rounding is
+ used.
+
Returns a string representing the value of this Decimal.
+
+ If this Decimal has a positive exponent that is equal to or greater than
+ toExpPos, or a negative exponent equal to or less than
+ toExpNeg, then exponential notation will be returned.
+
Why are trailing fractional zeros removed from Decimals?
+
+ Some arbitrary-precision libraries retain trailing fractional zeros as they can indicate the
+ precision of a value. This can be useful but the results of arithmetic operations can be
+ misleading.
+
+
+x = new BigDecimal("1.0")
+y = new BigDecimal("1.1000")
+z = x.add(y) // 2.1000
+
+x = new BigDecimal("1.20")
+y = new BigDecimal("3.45000")
+z = x.multiply(y) // 4.1400000
+
+ To specify the precision of a value is to specify that the value lies
+ within a certain range.
+
+
+ In the first example, x has a value of 1.0. The trailing zero shows
+ the precision of the value, implying that it is in the range 0.95 to
+ 1.05. Similarly, the precision indicated by the trailing zeros of y
+ indicates that the value is in the range 1.09995 to 1.10005.
+
+
+ If we add the two lowest values in the ranges we have, 0.95 + 1.09995 = 2.04995,
+ and if we add the two highest values we have, 1.05 + 1.10005 = 2.15005, so the
+ range of the result of the addition implied by the precision of its operands is
+ 2.04995 to 2.15005.
+
+
+ The result given by BigDecimal of 2.1000 however, indicates that the value is in
+ the range 2.09995 to 2.10005 and therefore the precision implied by
+ its trailing zeros may be misleading.
+
+
+ In the second example, the true range is 4.122744 to 4.157256 yet
+ the BigDecimal answer of 4.1400000 indicates a range of 4.13999995
+ to 4.14000005. Again, the precision implied by the trailing zeros may be
+ misleading.
+
+
+ This library, like binary floating point and most calculators, does not retain trailing
+ fractional zeros. Instead, the toExponential, toFixed and
+ toPrecision methods enable trailing zeros to be added if and when required.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Node's domain module for the web browser. This is merely an evented try...catch with the same API as node, nothing more.
+
+
+
+
+
+
+