Comparing version 3.0.1 to 3.1.0
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-shape/ v3.0.1 Copyright 2010-2021 Mike Bostock | ||
// https://d3js.org/d3-shape/ v3.1.0 Copyright 2010-2021 Mike Bostock | ||
(function (global, factory) { | ||
@@ -6,3 +6,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-path')) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3)); | ||
}(this, (function (exports, d3Path) { 'use strict'; | ||
})(this, (function (exports, d3Path) { 'use strict'; | ||
@@ -15,14 +15,14 @@ function constant(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; | ||
const abs = Math.abs; | ||
const atan2 = Math.atan2; | ||
const cos = Math.cos; | ||
const max = Math.max; | ||
const min = Math.min; | ||
const sin = Math.sin; | ||
const sqrt = Math.sqrt; | ||
var epsilon = 1e-12; | ||
var pi = Math.PI; | ||
var halfPi = pi / 2; | ||
var tau = 2 * pi; | ||
const epsilon = 1e-12; | ||
const pi = Math.PI; | ||
const halfPi = pi / 2; | ||
const tau = 2 * pi; | ||
@@ -335,3 +335,3 @@ function acos(x) { | ||
function x(p) { | ||
function x$1(p) { | ||
return p[0]; | ||
@@ -344,3 +344,3 @@ } | ||
function line(x$1, y$1) { | ||
function line(x, y$1) { | ||
var defined = constant(true), | ||
@@ -351,3 +351,3 @@ context = null, | ||
x$1 = typeof x$1 === "function" ? x$1 : (x$1 === undefined) ? x : constant(x$1); | ||
x = typeof x === "function" ? x : (x === undefined) ? x$1 : constant(x); | ||
y$1 = typeof y$1 === "function" ? y$1 : (y$1 === undefined) ? y : constant(y$1); | ||
@@ -369,3 +369,3 @@ | ||
} | ||
if (defined0) output.point(+x$1(d, i, data), +y$1(d, i, data)); | ||
if (defined0) output.point(+x(d, i, data), +y$1(d, i, data)); | ||
} | ||
@@ -377,3 +377,3 @@ | ||
line.x = function(_) { | ||
return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), line) : x$1; | ||
return arguments.length ? (x = typeof _ === "function" ? _ : constant(+_), line) : x; | ||
}; | ||
@@ -407,3 +407,3 @@ | ||
x0 = typeof x0 === "function" ? x0 : (x0 === undefined) ? x : constant(+x0); | ||
x0 = typeof x0 === "function" ? x0 : (x0 === undefined) ? x$1 : constant(+x0); | ||
y0 = typeof y0 === "function" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0); | ||
@@ -589,3 +589,3 @@ y1 = typeof y1 === "function" ? y1 : (y1 === undefined) ? y : constant(+y1); | ||
var curveRadialLinear = curveRadial$1(curveLinear); | ||
var curveRadialLinear = curveRadial(curveLinear); | ||
@@ -614,3 +614,3 @@ function Radial(curve) { | ||
function curveRadial$1(curve) { | ||
function curveRadial(curve) { | ||
@@ -633,3 +633,3 @@ function radial(context) { | ||
l.curve = function(_) { | ||
return arguments.length ? c(curveRadial$1(_)) : c()._curve; | ||
return arguments.length ? c(curveRadial(_)) : c()._curve; | ||
}; | ||
@@ -664,3 +664,3 @@ | ||
a.curve = function(_) { | ||
return arguments.length ? c(curveRadial$1(_)) : c()._curve; | ||
return arguments.length ? c(curveRadial(_)) : c()._curve; | ||
}; | ||
@@ -675,2 +675,75 @@ | ||
class Bump { | ||
constructor(context, x) { | ||
this._context = context; | ||
this._x = x; | ||
} | ||
areaStart() { | ||
this._line = 0; | ||
} | ||
areaEnd() { | ||
this._line = NaN; | ||
} | ||
lineStart() { | ||
this._point = 0; | ||
} | ||
lineEnd() { | ||
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); | ||
this._line = 1 - this._line; | ||
} | ||
point(x, y) { | ||
x = +x, y = +y; | ||
switch (this._point) { | ||
case 0: { | ||
this._point = 1; | ||
if (this._line) this._context.lineTo(x, y); | ||
else this._context.moveTo(x, y); | ||
break; | ||
} | ||
case 1: this._point = 2; // falls through | ||
default: { | ||
if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y); | ||
else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y); | ||
break; | ||
} | ||
} | ||
this._x0 = x, this._y0 = y; | ||
} | ||
} | ||
class BumpRadial { | ||
constructor(context) { | ||
this._context = context; | ||
} | ||
lineStart() { | ||
this._point = 0; | ||
} | ||
lineEnd() {} | ||
point(x, y) { | ||
x = +x, y = +y; | ||
if (this._point++ === 0) { | ||
this._x0 = x, this._y0 = y; | ||
} else { | ||
const p0 = pointRadial(this._x0, this._y0); | ||
const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2); | ||
const p2 = pointRadial(x, this._y0); | ||
const p3 = pointRadial(x, y); | ||
this._context.moveTo(...p0); | ||
this._context.bezierCurveTo(...p1, ...p2, ...p3); | ||
} | ||
} | ||
} | ||
function bumpX(context) { | ||
return new Bump(context, true); | ||
} | ||
function bumpY(context) { | ||
return new Bump(context, false); | ||
} | ||
function bumpRadial(context) { | ||
return new BumpRadial(context); | ||
} | ||
function linkSource(d) { | ||
@@ -685,13 +758,20 @@ return d.source; | ||
function link(curve) { | ||
var source = linkSource, | ||
target = linkTarget, | ||
x$1 = x, | ||
y$1 = y, | ||
context = null; | ||
let source = linkSource; | ||
let target = linkTarget; | ||
let x = x$1; | ||
let y$1 = y; | ||
let context = null; | ||
let output = 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; | ||
let buffer; | ||
const argv = slice.call(arguments); | ||
const s = source.apply(this, argv); | ||
const t = target.apply(this, argv); | ||
if (context == null) output = curve(buffer = d3Path.path()); | ||
output.lineStart(); | ||
argv[0] = s, output.point(+x.apply(this, argv), +y$1.apply(this, argv)); | ||
argv[0] = t, output.point(+x.apply(this, argv), +y$1.apply(this, argv)); | ||
output.lineEnd(); | ||
if (buffer) return output = null, buffer + "" || null; | ||
} | ||
@@ -708,3 +788,3 @@ | ||
link.x = function(_) { | ||
return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), link) : x$1; | ||
return arguments.length ? (x = typeof _ === "function" ? _ : constant(+_), link) : x; | ||
}; | ||
@@ -717,3 +797,3 @@ | ||
link.context = function(_) { | ||
return arguments.length ? ((context = _ == null ? null : _), link) : context; | ||
return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), link) : context; | ||
}; | ||
@@ -724,31 +804,12 @@ | ||
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(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); | ||
return link(bumpX); | ||
} | ||
function linkVertical() { | ||
return link(curveVertical); | ||
return link(bumpY); | ||
} | ||
function linkRadial() { | ||
var l = link(curveRadial); | ||
const l = link(bumpRadial); | ||
l.angle = l.x, delete l.x; | ||
@@ -759,5 +820,21 @@ l.radius = l.y, delete l.y; | ||
const sqrt3$2 = sqrt(3); | ||
var asterisk = { | ||
draw(context, size) { | ||
const r = sqrt(size + min(size / 28, 0.75)) * 0.59436; | ||
const t = r / 2; | ||
const u = t * sqrt3$2; | ||
context.moveTo(0, r); | ||
context.lineTo(0, -r); | ||
context.moveTo(-u, -t); | ||
context.lineTo(u, t); | ||
context.moveTo(-u, t); | ||
context.lineTo(u, -t); | ||
} | ||
}; | ||
var circle = { | ||
draw: function(context, size) { | ||
var r = Math.sqrt(size / pi); | ||
draw(context, size) { | ||
const r = sqrt(size / pi); | ||
context.moveTo(r, 0); | ||
@@ -769,4 +846,4 @@ context.arc(0, 0, r, 0, tau); | ||
var cross = { | ||
draw: function(context, size) { | ||
var r = Math.sqrt(size / 5) / 2; | ||
draw(context, size) { | ||
const r = sqrt(size / 5) / 2; | ||
context.moveTo(-3 * r, -r); | ||
@@ -788,9 +865,9 @@ context.lineTo(-r, -r); | ||
var tan30 = Math.sqrt(1 / 3), | ||
tan30_2 = tan30 * 2; | ||
const tan30 = sqrt(1 / 3); | ||
const tan30_2 = tan30 * 2; | ||
var diamond = { | ||
draw: function(context, size) { | ||
var y = Math.sqrt(size / tan30_2), | ||
x = y * tan30; | ||
draw(context, size) { | ||
const y = sqrt(size / tan30_2); | ||
const x = y * tan30; | ||
context.moveTo(0, -y); | ||
@@ -804,18 +881,58 @@ context.lineTo(x, 0); | ||
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 diamond2 = { | ||
draw(context, size) { | ||
const r = sqrt(size) * 0.62625; | ||
context.moveTo(0, -r); | ||
context.lineTo(r, 0); | ||
context.lineTo(0, r); | ||
context.lineTo(-r, 0); | ||
context.closePath(); | ||
} | ||
}; | ||
var plus = { | ||
draw(context, size) { | ||
const r = sqrt(size - min(size / 7, 2)) * 0.87559; | ||
context.moveTo(-r, 0); | ||
context.lineTo(r, 0); | ||
context.moveTo(0, r); | ||
context.lineTo(0, -r); | ||
} | ||
}; | ||
var square = { | ||
draw(context, size) { | ||
const w = sqrt(size); | ||
const x = -w / 2; | ||
context.rect(x, x, w, w); | ||
} | ||
}; | ||
var square2 = { | ||
draw(context, size) { | ||
const r = sqrt(size) * 0.4431; | ||
context.moveTo(r, r); | ||
context.lineTo(r, -r); | ||
context.lineTo(-r, -r); | ||
context.lineTo(-r, r); | ||
context.closePath(); | ||
} | ||
}; | ||
const ka = 0.89081309152928522810; | ||
const kr = sin(pi / 10) / sin(7 * pi / 10); | ||
const kx = sin(tau / 10) * kr; | ||
const ky = -cos(tau / 10) * kr; | ||
var star = { | ||
draw: function(context, size) { | ||
var r = Math.sqrt(size * ka), | ||
x = kx * r, | ||
y = ky * r; | ||
draw(context, size) { | ||
const r = sqrt(size * ka); | ||
const x = kx * r; | ||
const 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); | ||
for (let i = 1; i < 5; ++i) { | ||
const a = tau * i / 5; | ||
const c = cos(a); | ||
const s = sin(a); | ||
context.lineTo(s * r, -c * r); | ||
@@ -828,18 +945,24 @@ context.lineTo(c * x - s * y, s * x + c * y); | ||
var square = { | ||
draw: function(context, size) { | ||
var w = Math.sqrt(size), | ||
x = -w / 2; | ||
context.rect(x, x, w, w); | ||
const sqrt3$1 = sqrt(3); | ||
var triangle = { | ||
draw(context, size) { | ||
const y = -sqrt(size / (sqrt3$1 * 3)); | ||
context.moveTo(0, y * 2); | ||
context.lineTo(-sqrt3$1 * y, -y); | ||
context.lineTo(sqrt3$1 * y, -y); | ||
context.closePath(); | ||
} | ||
}; | ||
var sqrt3 = Math.sqrt(3); | ||
const sqrt3 = 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); | ||
var triangle2 = { | ||
draw(context, size) { | ||
const s = sqrt(size) * 0.6824; | ||
const t = s / 2; | ||
const u = (s * sqrt3) / 2; // cos(Math.PI / 6) | ||
context.moveTo(0, -s); | ||
context.lineTo(u, t); | ||
context.lineTo(-u, t); | ||
context.closePath(); | ||
@@ -849,16 +972,13 @@ } | ||
var c = -0.5, | ||
s = Math.sqrt(3) / 2, | ||
k = 1 / Math.sqrt(12), | ||
a = (k / 2 + 1) * 3; | ||
const c = -0.5; | ||
const s = sqrt(3) / 2; | ||
const k = 1 / sqrt(12); | ||
const 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; | ||
draw(context, size) { | ||
const r = sqrt(size / a); | ||
const x0 = r / 2, y0 = r * k; | ||
const x1 = x0, y1 = r * k + r; | ||
const x2 = -x1, y2 = y1; | ||
context.moveTo(x0, y0); | ||
@@ -877,3 +997,14 @@ context.lineTo(x1, y1); | ||
var symbols = [ | ||
var x = { | ||
draw(context, size) { | ||
const r = sqrt(size - min(size / 6, 1.7)) * 0.6189; | ||
context.moveTo(-r, -r); | ||
context.lineTo(r, r); | ||
context.moveTo(-r, r); | ||
context.lineTo(r, -r); | ||
} | ||
}; | ||
// These symbols are designed to be filled. | ||
const symbolsFill = [ | ||
circle, | ||
@@ -888,4 +1019,16 @@ cross, | ||
function symbol(type, size) { | ||
var context = null; | ||
// These symbols are designed to be stroked (with a width of 1.5px and round caps). | ||
const symbolsStroke = [ | ||
circle, | ||
plus, | ||
x, | ||
triangle2, | ||
asterisk, | ||
square2, | ||
diamond2 | ||
]; | ||
function Symbol(type, size) { | ||
let context = null; | ||
type = typeof type === "function" ? type : constant(type || circle); | ||
@@ -895,3 +1038,3 @@ size = typeof size === "function" ? size : constant(size === undefined ? 64 : +size); | ||
function symbol() { | ||
var buffer; | ||
let buffer; | ||
if (!context) context = buffer = d3Path.path(); | ||
@@ -1059,48 +1202,2 @@ type.apply(this, arguments).draw(context, +size.apply(this, arguments)); | ||
class Bump { | ||
constructor(context, x) { | ||
this._context = context; | ||
this._x = x; | ||
} | ||
areaStart() { | ||
this._line = 0; | ||
} | ||
areaEnd() { | ||
this._line = NaN; | ||
} | ||
lineStart() { | ||
this._point = 0; | ||
} | ||
lineEnd() { | ||
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); | ||
this._line = 1 - this._line; | ||
} | ||
point(x, y) { | ||
x = +x, y = +y; | ||
switch (this._point) { | ||
case 0: { | ||
this._point = 1; | ||
if (this._line) this._context.lineTo(x, y); | ||
else this._context.moveTo(x, y); | ||
break; | ||
} | ||
case 1: this._point = 2; // falls through | ||
default: { | ||
if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y); | ||
else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y); | ||
break; | ||
} | ||
} | ||
this._x0 = x, this._y0 = y; | ||
} | ||
} | ||
function bumpX(context) { | ||
return new Bump(context, true); | ||
} | ||
function bumpY(context) { | ||
return new Bump(context, false); | ||
} | ||
function Bundle(context, beta) { | ||
@@ -2002,2 +2099,3 @@ this._basis = new Basis(context); | ||
exports.lineRadial = lineRadial$1; | ||
exports.link = link; | ||
exports.linkHorizontal = linkHorizontal; | ||
@@ -2022,14 +2120,22 @@ exports.linkRadial = linkRadial; | ||
exports.stackOrderReverse = reverse; | ||
exports.symbol = symbol; | ||
exports.symbol = Symbol; | ||
exports.symbolAsterisk = asterisk; | ||
exports.symbolCircle = circle; | ||
exports.symbolCross = cross; | ||
exports.symbolDiamond = diamond; | ||
exports.symbolDiamond2 = diamond2; | ||
exports.symbolPlus = plus; | ||
exports.symbolSquare = square; | ||
exports.symbolSquare2 = square2; | ||
exports.symbolStar = star; | ||
exports.symbolTriangle = triangle; | ||
exports.symbolTriangle2 = triangle2; | ||
exports.symbolWye = wye; | ||
exports.symbols = symbols; | ||
exports.symbolX = x; | ||
exports.symbols = symbolsFill; | ||
exports.symbolsFill = symbolsFill; | ||
exports.symbolsStroke = symbolsStroke; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); | ||
})); |
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-shape/ v3.0.1 Copyright 2010-2021 Mike Bostock | ||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("d3-path")):"function"==typeof define&&define.amd?define(["exports","d3-path"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{},t.d3)}(this,(function(t,i){"use strict";function n(t){return function(){return t}}var e=Math.abs,s=Math.atan2,o=Math.cos,h=Math.max,_=Math.min,r=Math.sin,a=Math.sqrt,c=1e-12,l=Math.PI,u=l/2,f=2*l;function y(t){return t>1?0:t<-1?l:Math.acos(t)}function x(t){return t>=1?u:t<=-1?-u:Math.asin(t)}function p(t){return t.innerRadius}function v(t){return t.outerRadius}function d(t){return t.startAngle}function T(t){return t.endAngle}function g(t){return t&&t.padAngle}function b(t,i,n,e,s,o,h,_){var r=n-t,a=e-i,l=h-s,u=_-o,f=u*r-l*a;if(!(f*f<c))return[t+(f=(l*(i-o)-u*(t-s))/f)*r,i+f*a]}function m(t,i,n,e,s,o,_){var r=t-n,c=i-e,l=(_?o:-o)/a(r*r+c*c),u=l*c,f=-l*r,y=t+u,x=i+f,p=n+u,v=e+f,d=(y+p)/2,T=(x+v)/2,g=p-y,b=v-x,m=g*g+b*b,w=s-o,k=y*v-p*x,N=(b<0?-1:1)*a(h(0,w*w*m-k*k)),M=(k*b-g*N)/m,S=(-k*g-b*N)/m,E=(k*b+g*N)/m,A=(-k*g+b*N)/m,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/w-1),y11:S*(s/w-1)}}var w=Array.prototype.slice;function k(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function N(t){this._context=t}function M(t){return new N(t)}function S(t){return t[0]}function E(t){return t[1]}function A(t,e){var s=n(!0),o=null,h=M,_=null;function r(n){var r,a,c,l=(n=k(n)).length,u=!1;for(null==o&&(_=h(c=i.path())),r=0;r<=l;++r)!(r<l&&s(a=n[r],r,n))===u&&((u=!u)?_.lineStart():_.lineEnd()),u&&_.point(+t(a,r,n),+e(a,r,n));if(c)return _=null,c+""||null}return t="function"==typeof t?t:void 0===t?S:n(t),e="function"==typeof e?e:void 0===e?E:n(e),r.x=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:n(+t),r):e},r.defined=function(t){return arguments.length?(s="function"==typeof t?t:n(!!t),r):s},r.curve=function(t){return arguments.length?(h=t,null!=o&&(_=h(o)),r):h},r.context=function(t){return arguments.length?(null==t?o=_=null:_=h(o=t),r):o},r}function P(t,e,s){var o=null,h=n(!0),_=null,r=M,a=null;function c(n){var c,l,u,f,y,x=(n=k(n)).length,p=!1,v=new Array(x),d=new Array(x);for(null==_&&(a=r(y=i.path())),c=0;c<=x;++c){if(!(c<x&&h(f=n[c],c,n))===p)if(p=!p)l=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),u=c-1;u>=l;--u)a.point(v[u],d[u]);a.lineEnd(),a.areaEnd()}p&&(v[c]=+t(f,c,n),d[c]=+e(f,c,n),a.point(o?+o(f,c,n):v[c],s?+s(f,c,n):d[c]))}if(y)return a=null,y+""||null}function l(){return A().defined(h).curve(r).context(_)}return t="function"==typeof t?t:void 0===t?S:n(+t),e="function"==typeof e?e:n(void 0===e?0:+e),s="function"==typeof s?s:void 0===s?E:n(+s),c.x=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),o=null,c):t},c.x0=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),c):t},c.x1=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:n(+t),c):o},c.y=function(t){return arguments.length?(e="function"==typeof t?t:n(+t),s=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:n(+t),c):e},c.y1=function(t){return arguments.length?(s=null==t?null:"function"==typeof t?t:n(+t),c):s},c.lineX0=c.lineY0=function(){return l().x(t).y(e)},c.lineY1=function(){return l().x(t).y(s)},c.lineX1=function(){return l().x(o).y(e)},c.defined=function(t){return arguments.length?(h="function"==typeof t?t:n(!!t),c):h},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 C(t,i){return i<t?-1:i>t?1:i>=t?0:NaN}function O(t){return t}N.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,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:this._context.lineTo(t,i)}}};var R=z(M);function q(t){this._curve=t}function z(t){function i(i){return new q(t(i))}return i._curve=t,i}function X(t){var i=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?i(z(t)):i()._curve},t}function Y(){return X(A().curve(R))}function B(){var t=P().curve(R),i=t.curve,n=t.lineX0,e=t.lineX1,s=t.lineY0,o=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 X(n())},delete t.lineX0,t.lineEndAngle=function(){return X(e())},delete t.lineX1,t.lineInnerRadius=function(){return X(s())},delete t.lineY0,t.lineOuterRadius=function(){return X(o())},delete t.lineY1,t.curve=function(t){return arguments.length?i(z(t)):i()._curve},t}function j(t,i){return[(i=+i)*Math.cos(t-=Math.PI/2),i*Math.sin(t)]}function I(t){return t.source}function D(t){return t.target}function L(t){var e=I,s=D,o=S,h=E,_=null;function r(){var n,r=w.call(arguments),a=e.apply(this,r),c=s.apply(this,r);if(_||(_=n=i.path()),t(_,+o.apply(this,(r[0]=a,r)),+h.apply(this,r),+o.apply(this,(r[0]=c,r)),+h.apply(this,r)),n)return _=null,n+""||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?(o="function"==typeof t?t:n(+t),r):o},r.y=function(t){return arguments.length?(h="function"==typeof t?t:n(+t),r):h},r.context=function(t){return arguments.length?(_=null==t?null:t,r):_},r}function V(t,i,n,e,s){t.moveTo(i,n),t.bezierCurveTo(i=(i+e)/2,n,i,s,e,s)}function W(t,i,n,e,s){t.moveTo(i,n),t.bezierCurveTo(i,n=(n+s)/2,e,n,e,s)}function H(t,i,n,e,s){var o=j(i,n),h=j(i,n=(n+s)/2),_=j(e,n),r=j(e,s);t.moveTo(o[0],o[1]),t.bezierCurveTo(h[0],h[1],_[0],_[1],r[0],r[1])}q.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,i){this._curve.point(i*Math.sin(t),i*-Math.cos(t))}};var F={draw:function(t,i){var n=Math.sqrt(i/l);t.moveTo(n,0),t.arc(0,0,n,0,f)}},G={draw:function(t,i){var n=Math.sqrt(i/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},J=Math.sqrt(1/3),K=2*J,Q={draw:function(t,i){var n=Math.sqrt(i/K),e=n*J;t.moveTo(0,-n),t.lineTo(e,0),t.lineTo(0,n),t.lineTo(-e,0),t.closePath()}},U=Math.sin(l/10)/Math.sin(7*l/10),Z=Math.sin(f/10)*U,$=-Math.cos(f/10)*U,tt={draw:function(t,i){var n=Math.sqrt(.8908130915292852*i),e=Z*n,s=$*n;t.moveTo(0,-n),t.lineTo(e,s);for(var o=1;o<5;++o){var h=f*o/5,_=Math.cos(h),r=Math.sin(h);t.lineTo(r*n,-_*n),t.lineTo(_*e-r*s,r*e+_*s)}t.closePath()}},it={draw:function(t,i){var n=Math.sqrt(i),e=-n/2;t.rect(e,e,n,n)}},nt=Math.sqrt(3),et={draw:function(t,i){var n=-Math.sqrt(i/(3*nt));t.moveTo(0,2*n),t.lineTo(-nt*n,-n),t.lineTo(nt*n,-n),t.closePath()}},st=-.5,ot=Math.sqrt(3)/2,ht=1/Math.sqrt(12),_t=3*(ht/2+1),rt={draw:function(t,i){var n=Math.sqrt(i/_t),e=n/2,s=n*ht,o=e,h=n*ht+n,_=-o,r=h;t.moveTo(e,s),t.lineTo(o,h),t.lineTo(_,r),t.lineTo(st*e-ot*s,ot*e+st*s),t.lineTo(st*o-ot*h,ot*o+st*h),t.lineTo(st*_-ot*r,ot*_+st*r),t.lineTo(st*e+ot*s,st*s-ot*e),t.lineTo(st*o+ot*h,st*h-ot*o),t.lineTo(st*_+ot*r,st*r-ot*_),t.closePath()}},at=[F,G,Q,it,tt,et,rt];function ct(){}function lt(t,i,n){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+i)/6,(t._y0+4*t._y1+n)/6)}function ut(t){this._context=t}function ft(t){this._context=t}function yt(t){this._context=t}ut.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:lt(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,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);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:lt(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},ft.prototype={areaStart:ct,areaEnd:ct,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,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._x2=t,this._y2=i;break;case 1:this._point=2,this._x3=t,this._y3=i;break;case 2:this._point=3,this._x4=t,this._y4=i,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+i)/6);break;default:lt(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},yt.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,i){switch(t=+t,i=+i,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,e=(this._y0+4*this._y1+i)/6;this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break;case 3:this._point=4;default:lt(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}};class xt{constructor(t,i){this._context=t,this._x=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,i,t,i):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+i)/2,t,this._y0,t,i)}this._x0=t,this._y0=i}}function pt(t,i){this._basis=new ut(t),this._beta=i}pt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,i=this._y,n=t.length-1;if(n>0)for(var e,s=t[0],o=i[0],h=t[n]-s,_=i[n]-o,r=-1;++r<=n;)e=r/n,this._basis.point(this._beta*t[r]+(1-this._beta)*(s+e*h),this._beta*i[r]+(1-this._beta)*(o+e*_));this._x=this._y=null,this._basis.lineEnd()},point:function(t,i){this._x.push(+t),this._y.push(+i)}};var vt=function t(i){function n(t){return 1===i?new ut(t):new pt(t,i)}return n.beta=function(i){return t(+i)},n}(.85);function dt(t,i,n){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-i),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Tt(t,i){this._context=t,this._k=(1-i)/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(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:dt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2,this._x1=t,this._y1=i;break;case 2:this._point=3;default:dt(this,t,i)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var gt=function t(i){function n(t){return new Tt(t,i)}return n.tension=function(i){return t(+i)},n}(0);function bt(t,i){this._context=t,this._k=(1-i)/6}bt.prototype={areaStart:ct,areaEnd:ct,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,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._x3=t,this._y3=i;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=i);break;case 2:this._point=3,this._x5=t,this._y5=i;break;default:dt(this,t,i)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var mt=function t(i){function n(t){return new bt(t,i)}return n.tension=function(i){return t(+i)},n}(0);function wt(t,i){this._context=t,this._k=(1-i)/6}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._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,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:dt(this,t,i)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var kt=function t(i){function n(t){return new wt(t,i)}return n.tension=function(i){return t(+i)},n}(0);function Nt(t,i,n){var e=t._x1,s=t._y1,o=t._x2,h=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);o=(o*a+t._x1*t._l23_2a-i*t._l12_2a)/l,h=(h*a+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(e,s,o,h,t._x2,t._y2)}function Mt(t,i){this._context=t,this._alpha=i}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(){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,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3;default:Nt(this,t,i)}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=i}};var St=function t(i){function n(t){return i?new Mt(t,i):new Tt(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);function Et(t,i){this._context=t,this._alpha=i}Et.prototype={areaStart:ct,areaEnd:ct,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,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=i;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=i);break;case 2:this._point=3,this._x5=t,this._y5=i;break;default:Nt(this,t,i)}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=i}};var At=function t(i){function n(t){return i?new Et(t,i):new bt(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);function Pt(t,i){this._context=t,this._alpha=i}Pt.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,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+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:Nt(this,t,i)}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=i}};var Ct=function t(i){function n(t){return i?new Pt(t,i):new wt(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);function Ot(t){this._context=t}function Rt(t){return t<0?-1:1}function qt(t,i,n){var e=t._x1-t._x0,s=i-t._x1,o=(t._y1-t._y0)/(e||s<0&&-0),h=(n-t._y1)/(s||e<0&&-0),_=(o*s+h*e)/(e+s);return(Rt(o)+Rt(h))*Math.min(Math.abs(o),Math.abs(h),.5*Math.abs(_))||0}function zt(t,i){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-i)/2:i}function Xt(t,i,n){var e=t._x0,s=t._y0,o=t._x1,h=t._y1,_=(o-e)/3;t._context.bezierCurveTo(e+_,s+_*i,o-_,h-_*n,o,h)}function Yt(t){this._context=t}function Bt(t){this._context=new jt(t)}function jt(t){this._context=t}function It(t){this._context=t}function Dt(t){var i,n,e=t.length-1,s=new Array(e),o=new Array(e),h=new Array(e);for(s[0]=0,o[0]=2,h[0]=t[0]+2*t[1],i=1;i<e-1;++i)s[i]=1,o[i]=4,h[i]=4*t[i]+2*t[i+1];for(s[e-1]=2,o[e-1]=7,h[e-1]=8*t[e-1]+t[e],i=1;i<e;++i)n=s[i]/o[i-1],o[i]-=n,h[i]-=n*h[i-1];for(s[e-1]=h[e-1]/o[e-1],i=e-2;i>=0;--i)s[i]=(h[i]-s[i+1])/o[i];for(o[e-1]=(t[e]+s[e-1])/2,i=0;i<e-1;++i)o[i]=2*t[i+1]-s[i+1];return[s,o]}function Lt(t,i){this._context=t,this._t=i}function Vt(t,i){if((s=t.length)>1)for(var n,e,s,o=1,h=t[i[0]],_=h.length;o<s;++o)for(e=h,h=t[i[o]],n=0;n<_;++n)h[n][1]+=h[n][0]=isNaN(e[n][1])?e[n][0]:e[n][1]}function Wt(t){for(var i=t.length,n=new Array(i);--i>=0;)n[i]=i;return n}function Ht(t,i){return t[i]}function Ft(t){const i=[];return i.key=t,i}function Gt(t){var i=t.map(Jt);return Wt(t).sort((function(t,n){return i[t]-i[n]}))}function Jt(t){for(var i,n=-1,e=0,s=t.length,o=-1/0;++n<s;)(i=+t[n][1])>o&&(o=i,e=n);return e}function Kt(t){var i=t.map(Qt);return Wt(t).sort((function(t,n){return i[t]-i[n]}))}function Qt(t){for(var i,n=0,e=-1,s=t.length;++e<s;)(i=+t[e][1])&&(n+=i);return n}Ot.prototype={areaStart:ct,areaEnd:ct,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,i){t=+t,i=+i,this._point?this._context.lineTo(t,i):(this._point=1,this._context.moveTo(t,i))}},Yt.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:Xt(this,this._t0,zt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){var n=NaN;if(i=+i,(t=+t)!==this._x1||i!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3,Xt(this,zt(this,n=qt(this,t,i)),n);break;default:Xt(this,this._t0,n=qt(this,t,i))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i,this._t0=n}}},(Bt.prototype=Object.create(Yt.prototype)).point=function(t,i){Yt.prototype.point.call(this,i,t)},jt.prototype={moveTo:function(t,i){this._context.moveTo(i,t)},closePath:function(){this._context.closePath()},lineTo:function(t,i){this._context.lineTo(i,t)},bezierCurveTo:function(t,i,n,e,s,o){this._context.bezierCurveTo(i,t,e,n,o,s)}},It.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,i=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],i[0]):this._context.moveTo(t[0],i[0]),2===n)this._context.lineTo(t[1],i[1]);else for(var e=Dt(t),s=Dt(i),o=0,h=1;h<n;++o,++h)this._context.bezierCurveTo(e[0][o],s[0][o],e[1][o],s[1][o],t[h],i[h]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,i){this._x.push(+t),this._y.push(+i)}},Lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,i),this._context.lineTo(t,i);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,i)}}this._x=t,this._y=i}},t.arc=function(){var t=p,h=v,w=n(0),k=null,N=d,M=T,S=g,E=null;function A(){var n,p,v=+t.apply(this,arguments),d=+h.apply(this,arguments),T=N.apply(this,arguments)-u,g=M.apply(this,arguments)-u,A=e(g-T),P=g>T;if(E||(E=n=i.path()),d<v&&(p=d,d=v,v=p),d>c)if(A>f-c)E.moveTo(d*o(T),d*r(T)),E.arc(0,0,d,T,g,!P),v>c&&(E.moveTo(v*o(g),v*r(g)),E.arc(0,0,v,g,T,P));else{var C,O,R=T,q=g,z=T,X=g,Y=A,B=A,j=S.apply(this,arguments)/2,I=j>c&&(k?+k.apply(this,arguments):a(v*v+d*d)),D=_(e(d-v)/2,+w.apply(this,arguments)),L=D,V=D;if(I>c){var W=x(I/v*r(j)),H=x(I/d*r(j));(Y-=2*W)>c?(z+=W*=P?1:-1,X-=W):(Y=0,z=X=(T+g)/2),(B-=2*H)>c?(R+=H*=P?1:-1,q-=H):(B=0,R=q=(T+g)/2)}var F=d*o(R),G=d*r(R),J=v*o(X),K=v*r(X);if(D>c){var Q,U=d*o(q),Z=d*r(q),$=v*o(z),tt=v*r(z);if(A<l&&(Q=b(F,G,$,tt,U,Z,J,K))){var it=F-Q[0],nt=G-Q[1],et=U-Q[0],st=Z-Q[1],ot=1/r(y((it*et+nt*st)/(a(it*it+nt*nt)*a(et*et+st*st)))/2),ht=a(Q[0]*Q[0]+Q[1]*Q[1]);L=_(D,(v-ht)/(ot-1)),V=_(D,(d-ht)/(ot+1))}}B>c?V>c?(C=m($,tt,F,G,d,V,P),O=m(U,Z,J,K,d,V,P),E.moveTo(C.cx+C.x01,C.cy+C.y01),V<D?E.arc(C.cx,C.cy,V,s(C.y01,C.x01),s(O.y01,O.x01),!P):(E.arc(C.cx,C.cy,V,s(C.y01,C.x01),s(C.y11,C.x11),!P),E.arc(0,0,d,s(C.cy+C.y11,C.cx+C.x11),s(O.cy+O.y11,O.cx+O.x11),!P),E.arc(O.cx,O.cy,V,s(O.y11,O.x11),s(O.y01,O.x01),!P))):(E.moveTo(F,G),E.arc(0,0,d,R,q,!P)):E.moveTo(F,G),v>c&&Y>c?L>c?(C=m(J,K,U,Z,v,-L,P),O=m(F,G,$,tt,v,-L,P),E.lineTo(C.cx+C.x01,C.cy+C.y01),L<D?E.arc(C.cx,C.cy,L,s(C.y01,C.x01),s(O.y01,O.x01),!P):(E.arc(C.cx,C.cy,L,s(C.y01,C.x01),s(C.y11,C.x11),!P),E.arc(0,0,v,s(C.cy+C.y11,C.cx+C.x11),s(O.cy+O.y11,O.cx+O.x11),P),E.arc(O.cx,O.cy,L,s(O.y11,O.x11),s(O.y01,O.x01),!P))):E.arc(0,0,v,X,z,P):E.lineTo(J,K)}else E.moveTo(0,0);if(E.closePath(),n)return E=null,n+""||null}return A.centroid=function(){var i=(+t.apply(this,arguments)+ +h.apply(this,arguments))/2,n=(+N.apply(this,arguments)+ +M.apply(this,arguments))/2-l/2;return[o(n)*i,r(n)*i]},A.innerRadius=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),A):t},A.outerRadius=function(t){return arguments.length?(h="function"==typeof t?t:n(+t),A):h},A.cornerRadius=function(t){return arguments.length?(w="function"==typeof t?t:n(+t),A):w},A.padRadius=function(t){return arguments.length?(k=null==t?null:"function"==typeof t?t:n(+t),A):k},A.startAngle=function(t){return arguments.length?(N="function"==typeof t?t:n(+t),A):N},A.endAngle=function(t){return arguments.length?(M="function"==typeof t?t:n(+t),A):M},A.padAngle=function(t){return arguments.length?(S="function"==typeof t?t:n(+t),A):S},A.context=function(t){return arguments.length?(E=null==t?null:t,A):E},A},t.area=P,t.areaRadial=B,t.curveBasis=function(t){return new ut(t)},t.curveBasisClosed=function(t){return new ft(t)},t.curveBasisOpen=function(t){return new yt(t)},t.curveBumpX=function(t){return new xt(t,!0)},t.curveBumpY=function(t){return new xt(t,!1)},t.curveBundle=vt,t.curveCardinal=gt,t.curveCardinalClosed=mt,t.curveCardinalOpen=kt,t.curveCatmullRom=St,t.curveCatmullRomClosed=At,t.curveCatmullRomOpen=Ct,t.curveLinear=M,t.curveLinearClosed=function(t){return new Ot(t)},t.curveMonotoneX=function(t){return new Yt(t)},t.curveMonotoneY=function(t){return new Bt(t)},t.curveNatural=function(t){return new It(t)},t.curveStep=function(t){return new Lt(t,.5)},t.curveStepAfter=function(t){return new Lt(t,1)},t.curveStepBefore=function(t){return new Lt(t,0)},t.line=A,t.lineRadial=Y,t.linkHorizontal=function(){return L(V)},t.linkRadial=function(){var t=L(H);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return L(W)},t.pie=function(){var t=O,i=C,e=null,s=n(0),o=n(f),h=n(0);function _(n){var _,r,a,c,l,u=(n=k(n)).length,y=0,x=new Array(u),p=new Array(u),v=+s.apply(this,arguments),d=Math.min(f,Math.max(-f,o.apply(this,arguments)-v)),T=Math.min(Math.abs(d)/u,h.apply(this,arguments)),g=T*(d<0?-1:1);for(_=0;_<u;++_)(l=p[x[_]=_]=+t(n[_],_,n))>0&&(y+=l);for(null!=i?x.sort((function(t,n){return i(p[t],p[n])})):null!=e&&x.sort((function(t,i){return e(n[t],n[i])})),_=0,a=y?(d-u*g)/y:0;_<u;++_,v=c)r=x[_],c=v+((l=p[r])>0?l*a:0)+g,p[r]={data:n[r],index:_,value:l,startAngle:v,endAngle:c,padAngle:T};return p}return _.value=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),_):t},_.sortValues=function(t){return arguments.length?(i=t,e=null,_):i},_.sort=function(t){return arguments.length?(e=t,i=null,_):e},_.startAngle=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),_):s},_.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),_):o},_.padAngle=function(t){return arguments.length?(h="function"==typeof t?t:n(+t),_):h},_},t.pointRadial=j,t.radialArea=B,t.radialLine=Y,t.stack=function(){var t=n([]),i=Wt,e=Vt,s=Ht;function o(n){var o,h,_=Array.from(t.apply(this,arguments),Ft),r=_.length,a=-1;for(const t of n)for(o=0,++a;o<r;++o)(_[o][a]=[0,+s(t,_[o].key,a,n)]).data=t;for(o=0,h=k(i(_));o<r;++o)_[h[o]].index=o;return e(_,h),_}return o.keys=function(i){return arguments.length?(t="function"==typeof i?i:n(Array.from(i)),o):t},o.value=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),o):s},o.order=function(t){return arguments.length?(i=null==t?Wt:"function"==typeof t?t:n(Array.from(t)),o):i},o.offset=function(t){return arguments.length?(e=null==t?Vt:t,o):e},o},t.stackOffsetDiverging=function(t,i){if((_=t.length)>0)for(var n,e,s,o,h,_,r=0,a=t[i[0]].length;r<a;++r)for(o=h=0,n=0;n<_;++n)(s=(e=t[i[n]][r])[1]-e[0])>0?(e[0]=o,e[1]=o+=s):s<0?(e[1]=h,e[0]=h+=s):(e[0]=0,e[1]=s)},t.stackOffsetExpand=function(t,i){if((e=t.length)>0){for(var n,e,s,o=0,h=t[0].length;o<h;++o){for(s=n=0;n<e;++n)s+=t[n][o][1]||0;if(s)for(n=0;n<e;++n)t[n][o][1]/=s}Vt(t,i)}},t.stackOffsetNone=Vt,t.stackOffsetSilhouette=function(t,i){if((n=t.length)>0){for(var n,e=0,s=t[i[0]],o=s.length;e<o;++e){for(var h=0,_=0;h<n;++h)_+=t[h][e][1]||0;s[e][1]+=s[e][0]=-_/2}Vt(t,i)}},t.stackOffsetWiggle=function(t,i){if((s=t.length)>0&&(e=(n=t[i[0]]).length)>0){for(var n,e,s,o=0,h=1;h<e;++h){for(var _=0,r=0,a=0;_<s;++_){for(var c=t[i[_]],l=c[h][1]||0,u=(l-(c[h-1][1]||0))/2,f=0;f<_;++f){var y=t[i[f]];u+=(y[h][1]||0)-(y[h-1][1]||0)}r+=l,a+=u*l}n[h-1][1]+=n[h-1][0]=o,r&&(o-=a/r)}n[h-1][1]+=n[h-1][0]=o,Vt(t,i)}},t.stackOrderAppearance=Gt,t.stackOrderAscending=Kt,t.stackOrderDescending=function(t){return Kt(t).reverse()},t.stackOrderInsideOut=function(t){var i,n,e=t.length,s=t.map(Qt),o=Gt(t),h=0,_=0,r=[],a=[];for(i=0;i<e;++i)n=o[i],h<_?(h+=s[n],r.push(n)):(_+=s[n],a.push(n));return a.reverse().concat(r)},t.stackOrderNone=Wt,t.stackOrderReverse=function(t){return Wt(t).reverse()},t.symbol=function(t,e){var s=null;function o(){var n;if(s||(s=n=i.path()),t.apply(this,arguments).draw(s,+e.apply(this,arguments)),n)return s=null,n+""||null}return t="function"==typeof t?t:n(t||F),e="function"==typeof e?e:n(void 0===e?64:+e),o.type=function(i){return arguments.length?(t="function"==typeof i?i:n(i),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:n(+t),o):e},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o},t.symbolCircle=F,t.symbolCross=G,t.symbolDiamond=Q,t.symbolSquare=it,t.symbolStar=tt,t.symbolTriangle=et,t.symbolWye=rt,t.symbols=at,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
// https://d3js.org/d3-shape/ v3.1.0 Copyright 2010-2021 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="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{},t.d3)}(this,(function(t,n){"use strict";function i(t){return function(){return t}}const e=Math.abs,s=Math.atan2,o=Math.cos,h=Math.max,_=Math.min,r=Math.sin,a=Math.sqrt,l=1e-12,c=Math.PI,u=c/2,f=2*c;function y(t){return t>1?0:t<-1?c:Math.acos(t)}function x(t){return t>=1?u:t<=-1?-u:Math.asin(t)}function p(t){return t.innerRadius}function v(t){return t.outerRadius}function d(t){return t.startAngle}function T(t){return t.endAngle}function g(t){return t&&t.padAngle}function b(t,n,i,e,s,o,h,_){var r=i-t,a=e-n,c=h-s,u=_-o,f=u*r-c*a;if(!(f*f<l))return[t+(f=(c*(n-o)-u*(t-s))/f)*r,n+f*a]}function m(t,n,i,e,s,o,_){var r=t-i,l=n-e,c=(_?o:-o)/a(r*r+l*l),u=c*l,f=-c*r,y=t+u,x=n+f,p=i+u,v=e+f,d=(y+p)/2,T=(x+v)/2,g=p-y,b=v-x,m=g*g+b*b,w=s-o,k=y*v-p*x,N=(b<0?-1:1)*a(h(0,w*w*m-k*k)),S=(k*b-g*N)/m,E=(-k*g-b*N)/m,A=(k*b+g*N)/m,P=(-k*g+b*N)/m,M=S-d,C=E-T,O=A-d,R=P-T;return M*M+C*C>O*O+R*R&&(S=A,E=P),{cx:S,cy:E,x01:-u,y01:-f,x11:S*(s/w-1),y11:E*(s/w-1)}}var w=Array.prototype.slice;function k(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function N(t){this._context=t}function S(t){return new N(t)}function E(t){return t[0]}function A(t){return t[1]}function P(t,e){var s=i(!0),o=null,h=S,_=null;function r(i){var r,a,l,c=(i=k(i)).length,u=!1;for(null==o&&(_=h(l=n.path())),r=0;r<=c;++r)!(r<c&&s(a=i[r],r,i))===u&&((u=!u)?_.lineStart():_.lineEnd()),u&&_.point(+t(a,r,i),+e(a,r,i));if(l)return _=null,l+""||null}return t="function"==typeof t?t:void 0===t?E:i(t),e="function"==typeof e?e:void 0===e?A:i(e),r.x=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),r):e},r.defined=function(t){return arguments.length?(s="function"==typeof t?t:i(!!t),r):s},r.curve=function(t){return arguments.length?(h=t,null!=o&&(_=h(o)),r):h},r.context=function(t){return arguments.length?(null==t?o=_=null:_=h(o=t),r):o},r}function M(t,e,s){var o=null,h=i(!0),_=null,r=S,a=null;function l(i){var l,c,u,f,y,x=(i=k(i)).length,p=!1,v=new Array(x),d=new Array(x);for(null==_&&(a=r(y=n.path())),l=0;l<=x;++l){if(!(l<x&&h(f=i[l],l,i))===p)if(p=!p)c=l,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),u=l-1;u>=c;--u)a.point(v[u],d[u]);a.lineEnd(),a.areaEnd()}p&&(v[l]=+t(f,l,i),d[l]=+e(f,l,i),a.point(o?+o(f,l,i):v[l],s?+s(f,l,i):d[l]))}if(y)return a=null,y+""||null}function c(){return P().defined(h).curve(r).context(_)}return t="function"==typeof t?t:void 0===t?E:i(+t),e="function"==typeof e?e:i(void 0===e?0:+e),s="function"==typeof s?s:void 0===s?A:i(+s),l.x=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),o=null,l):t},l.x0=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),l):t},l.x1=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:i(+t),l):o},l.y=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),s=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),l):e},l.y1=function(t){return arguments.length?(s=null==t?null:"function"==typeof t?t:i(+t),l):s},l.lineX0=l.lineY0=function(){return c().x(t).y(e)},l.lineY1=function(){return c().x(t).y(s)},l.lineX1=function(){return c().x(o).y(e)},l.defined=function(t){return arguments.length?(h="function"==typeof t?t:i(!!t),l):h},l.curve=function(t){return arguments.length?(r=t,null!=_&&(a=r(_)),l):r},l.context=function(t){return arguments.length?(null==t?_=a=null:a=r(_=t),l):_},l}function C(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function O(t){return t}N.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 R=X(S);function z(t){this._curve=t}function X(t){function n(n){return new z(t(n))}return n._curve=t,n}function Y(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(X(t)):n()._curve},t}function q(){return Y(P().curve(R))}function B(){var t=M().curve(R),n=t.curve,i=t.lineX0,e=t.lineX1,s=t.lineY0,o=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 Y(i())},delete t.lineX0,t.lineEndAngle=function(){return Y(e())},delete t.lineX1,t.lineInnerRadius=function(){return Y(s())},delete t.lineY0,t.lineOuterRadius=function(){return Y(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(X(t)):n()._curve},t}function j(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}z.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))}};class D{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(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._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}}class I{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,n){if(t=+t,n=+n,0==this._point++)this._x0=t,this._y0=n;else{const i=j(this._x0,this._y0),e=j(this._x0,this._y0=(this._y0+n)/2),s=j(t,this._y0),o=j(t,n);this._context.moveTo(...i),this._context.bezierCurveTo(...e,...s,...o)}}}function L(t){return new D(t,!0)}function V(t){return new D(t,!1)}function W(t){return new I(t)}function F(t){return t.source}function H(t){return t.target}function G(t){let e=F,s=H,o=E,h=A,_=null,r=null;function a(){let i;const a=w.call(arguments),l=e.apply(this,a),c=s.apply(this,a);if(null==_&&(r=t(i=n.path())),r.lineStart(),a[0]=l,r.point(+o.apply(this,a),+h.apply(this,a)),a[0]=c,r.point(+o.apply(this,a),+h.apply(this,a)),r.lineEnd(),i)return r=null,i+""||null}return a.source=function(t){return arguments.length?(e=t,a):e},a.target=function(t){return arguments.length?(s=t,a):s},a.x=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),a):o},a.y=function(t){return arguments.length?(h="function"==typeof t?t:i(+t),a):h},a.context=function(n){return arguments.length?(null==n?_=r=null:r=t(_=n),a):_},a}const J=a(3);var K={draw(t,n){const i=.59436*a(n+_(n/28,.75)),e=i/2,s=e*J;t.moveTo(0,i),t.lineTo(0,-i),t.moveTo(-s,-e),t.lineTo(s,e),t.moveTo(-s,e),t.lineTo(s,-e)}},Q={draw(t,n){const i=a(n/c);t.moveTo(i,0),t.arc(0,0,i,0,f)}},U={draw(t,n){const i=a(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()}};const Z=a(1/3),$=2*Z;var tt={draw(t,n){const i=a(n/$),e=i*Z;t.moveTo(0,-i),t.lineTo(e,0),t.lineTo(0,i),t.lineTo(-e,0),t.closePath()}},nt={draw(t,n){const i=.62625*a(n);t.moveTo(0,-i),t.lineTo(i,0),t.lineTo(0,i),t.lineTo(-i,0),t.closePath()}},it={draw(t,n){const i=.87559*a(n-_(n/7,2));t.moveTo(-i,0),t.lineTo(i,0),t.moveTo(0,i),t.lineTo(0,-i)}},et={draw(t,n){const i=a(n),e=-i/2;t.rect(e,e,i,i)}},st={draw(t,n){const i=.4431*a(n);t.moveTo(i,i),t.lineTo(i,-i),t.lineTo(-i,-i),t.lineTo(-i,i),t.closePath()}};const ot=r(c/10)/r(7*c/10),ht=r(f/10)*ot,_t=-o(f/10)*ot;var rt={draw(t,n){const i=a(.8908130915292852*n),e=ht*i,s=_t*i;t.moveTo(0,-i),t.lineTo(e,s);for(let n=1;n<5;++n){const h=f*n/5,_=o(h),a=r(h);t.lineTo(a*i,-_*i),t.lineTo(_*e-a*s,a*e+_*s)}t.closePath()}};const at=a(3);var lt={draw(t,n){const i=-a(n/(3*at));t.moveTo(0,2*i),t.lineTo(-at*i,-i),t.lineTo(at*i,-i),t.closePath()}};const ct=a(3);var ut={draw(t,n){const i=.6824*a(n),e=i/2,s=i*ct/2;t.moveTo(0,-i),t.lineTo(s,e),t.lineTo(-s,e),t.closePath()}};const ft=-.5,yt=a(3)/2,xt=1/a(12),pt=3*(xt/2+1);var vt={draw(t,n){const i=a(n/pt),e=i/2,s=i*xt,o=e,h=i*xt+i,_=-o,r=h;t.moveTo(e,s),t.lineTo(o,h),t.lineTo(_,r),t.lineTo(ft*e-yt*s,yt*e+ft*s),t.lineTo(ft*o-yt*h,yt*o+ft*h),t.lineTo(ft*_-yt*r,yt*_+ft*r),t.lineTo(ft*e+yt*s,ft*s-yt*e),t.lineTo(ft*o+yt*h,ft*h-yt*o),t.lineTo(ft*_+yt*r,ft*r-yt*_),t.closePath()}},dt={draw(t,n){const i=.6189*a(n-_(n/6,1.7));t.moveTo(-i,-i),t.lineTo(i,i),t.moveTo(-i,i),t.lineTo(i,-i)}};const Tt=[Q,U,tt,et,rt,lt,vt],gt=[Q,it,dt,ut,K,st,nt];function bt(){}function mt(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 wt(t){this._context=t}function kt(t){this._context=t}function Nt(t){this._context=t}function St(t,n){this._basis=new wt(t),this._beta=n}wt.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:mt(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:mt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},kt.prototype={areaStart:bt,areaEnd:bt,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:mt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},Nt.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:mt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},St.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],o=n[0],h=t[i]-s,_=n[i]-o,r=-1;++r<=i;)e=r/i,this._basis.point(this._beta*t[r]+(1-this._beta)*(s+e*h),this._beta*n[r]+(1-this._beta)*(o+e*_));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Et=function t(n){function i(t){return 1===n?new wt(t):new St(t,n)}return i.beta=function(n){return t(+n)},i}(.85);function At(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 Pt(t,n){this._context=t,this._k=(1-n)/6}Pt.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:At(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:At(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 Mt=function t(n){function i(t){return new Pt(t,n)}return i.tension=function(n){return t(+n)},i}(0);function Ct(t,n){this._context=t,this._k=(1-n)/6}Ct.prototype={areaStart:bt,areaEnd:bt,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:At(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 Ot=function t(n){function i(t){return new Ct(t,n)}return i.tension=function(n){return t(+n)},i}(0);function Rt(t,n){this._context=t,this._k=(1-n)/6}Rt.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:At(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 zt=function t(n){function i(t){return new Rt(t,n)}return i.tension=function(n){return t(+n)},i}(0);function Xt(t,n,i){var e=t._x1,s=t._y1,o=t._x2,h=t._y2;if(t._l01_a>l){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>l){var a=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*a+t._x1*t._l23_2a-n*t._l12_2a)/c,h=(h*a+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(e,s,o,h,t._x2,t._y2)}function Yt(t,n){this._context=t,this._alpha=n}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._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:Xt(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 qt=function t(n){function i(t){return n?new Yt(t,n):new Pt(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);function Bt(t,n){this._context=t,this._alpha=n}Bt.prototype={areaStart:bt,areaEnd:bt,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:Xt(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 jt=function t(n){function i(t){return n?new Bt(t,n):new Ct(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);function Dt(t,n){this._context=t,this._alpha=n}Dt.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:Xt(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 It=function t(n){function i(t){return n?new Dt(t,n):new Rt(t,0)}return i.alpha=function(n){return t(+n)},i}(.5);function Lt(t){this._context=t}function Vt(t){return t<0?-1:1}function Wt(t,n,i){var e=t._x1-t._x0,s=n-t._x1,o=(t._y1-t._y0)/(e||s<0&&-0),h=(i-t._y1)/(s||e<0&&-0),_=(o*s+h*e)/(e+s);return(Vt(o)+Vt(h))*Math.min(Math.abs(o),Math.abs(h),.5*Math.abs(_))||0}function Ft(t,n){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-n)/2:n}function Ht(t,n,i){var e=t._x0,s=t._y0,o=t._x1,h=t._y1,_=(o-e)/3;t._context.bezierCurveTo(e+_,s+_*n,o-_,h-_*i,o,h)}function Gt(t){this._context=t}function Jt(t){this._context=new Kt(t)}function Kt(t){this._context=t}function Qt(t){this._context=t}function Ut(t){var n,i,e=t.length-1,s=new Array(e),o=new Array(e),h=new Array(e);for(s[0]=0,o[0]=2,h[0]=t[0]+2*t[1],n=1;n<e-1;++n)s[n]=1,o[n]=4,h[n]=4*t[n]+2*t[n+1];for(s[e-1]=2,o[e-1]=7,h[e-1]=8*t[e-1]+t[e],n=1;n<e;++n)i=s[n]/o[n-1],o[n]-=i,h[n]-=i*h[n-1];for(s[e-1]=h[e-1]/o[e-1],n=e-2;n>=0;--n)s[n]=(h[n]-s[n+1])/o[n];for(o[e-1]=(t[e]+s[e-1])/2,n=0;n<e-1;++n)o[n]=2*t[n+1]-s[n+1];return[s,o]}function Zt(t,n){this._context=t,this._t=n}function $t(t,n){if((s=t.length)>1)for(var i,e,s,o=1,h=t[n[0]],_=h.length;o<s;++o)for(e=h,h=t[n[o]],i=0;i<_;++i)h[i][1]+=h[i][0]=isNaN(e[i][1])?e[i][0]:e[i][1]}function tn(t){for(var n=t.length,i=new Array(n);--n>=0;)i[n]=n;return i}function nn(t,n){return t[n]}function en(t){const n=[];return n.key=t,n}function sn(t){var n=t.map(on);return tn(t).sort((function(t,i){return n[t]-n[i]}))}function on(t){for(var n,i=-1,e=0,s=t.length,o=-1/0;++i<s;)(n=+t[i][1])>o&&(o=n,e=i);return e}function hn(t){var n=t.map(_n);return tn(t).sort((function(t,i){return n[t]-n[i]}))}function _n(t){for(var n,i=0,e=-1,s=t.length;++e<s;)(n=+t[e][1])&&(i+=n);return i}Lt.prototype={areaStart:bt,areaEnd:bt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}},Gt.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:Ht(this,this._t0,Ft(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var i=NaN;if(n=+n,(t=+t)!==this._x1||n!==this._y1){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,Ht(this,Ft(this,i=Wt(this,t,n)),i);break;default:Ht(this,this._t0,i=Wt(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=i}}},(Jt.prototype=Object.create(Gt.prototype)).point=function(t,n){Gt.prototype.point.call(this,n,t)},Kt.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,i,e,s,o){this._context.bezierCurveTo(n,t,e,i,o,s)}},Qt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),2===i)this._context.lineTo(t[1],n[1]);else for(var e=Ut(t),s=Ut(n),o=0,h=1;h<i;++o,++h)this._context.bezierCurveTo(e[0][o],s[0][o],e[1][o],s[1][o],t[h],n[h]);(this._line||0!==this._line&&1===i)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}},Zt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=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=p,h=v,w=i(0),k=null,N=d,S=T,E=g,A=null;function P(){var i,p,v=+t.apply(this,arguments),d=+h.apply(this,arguments),T=N.apply(this,arguments)-u,g=S.apply(this,arguments)-u,P=e(g-T),M=g>T;if(A||(A=i=n.path()),d<v&&(p=d,d=v,v=p),d>l)if(P>f-l)A.moveTo(d*o(T),d*r(T)),A.arc(0,0,d,T,g,!M),v>l&&(A.moveTo(v*o(g),v*r(g)),A.arc(0,0,v,g,T,M));else{var C,O,R=T,z=g,X=T,Y=g,q=P,B=P,j=E.apply(this,arguments)/2,D=j>l&&(k?+k.apply(this,arguments):a(v*v+d*d)),I=_(e(d-v)/2,+w.apply(this,arguments)),L=I,V=I;if(D>l){var W=x(D/v*r(j)),F=x(D/d*r(j));(q-=2*W)>l?(X+=W*=M?1:-1,Y-=W):(q=0,X=Y=(T+g)/2),(B-=2*F)>l?(R+=F*=M?1:-1,z-=F):(B=0,R=z=(T+g)/2)}var H=d*o(R),G=d*r(R),J=v*o(Y),K=v*r(Y);if(I>l){var Q,U=d*o(z),Z=d*r(z),$=v*o(X),tt=v*r(X);if(P<c&&(Q=b(H,G,$,tt,U,Z,J,K))){var nt=H-Q[0],it=G-Q[1],et=U-Q[0],st=Z-Q[1],ot=1/r(y((nt*et+it*st)/(a(nt*nt+it*it)*a(et*et+st*st)))/2),ht=a(Q[0]*Q[0]+Q[1]*Q[1]);L=_(I,(v-ht)/(ot-1)),V=_(I,(d-ht)/(ot+1))}}B>l?V>l?(C=m($,tt,H,G,d,V,M),O=m(U,Z,J,K,d,V,M),A.moveTo(C.cx+C.x01,C.cy+C.y01),V<I?A.arc(C.cx,C.cy,V,s(C.y01,C.x01),s(O.y01,O.x01),!M):(A.arc(C.cx,C.cy,V,s(C.y01,C.x01),s(C.y11,C.x11),!M),A.arc(0,0,d,s(C.cy+C.y11,C.cx+C.x11),s(O.cy+O.y11,O.cx+O.x11),!M),A.arc(O.cx,O.cy,V,s(O.y11,O.x11),s(O.y01,O.x01),!M))):(A.moveTo(H,G),A.arc(0,0,d,R,z,!M)):A.moveTo(H,G),v>l&&q>l?L>l?(C=m(J,K,U,Z,v,-L,M),O=m(H,G,$,tt,v,-L,M),A.lineTo(C.cx+C.x01,C.cy+C.y01),L<I?A.arc(C.cx,C.cy,L,s(C.y01,C.x01),s(O.y01,O.x01),!M):(A.arc(C.cx,C.cy,L,s(C.y01,C.x01),s(C.y11,C.x11),!M),A.arc(0,0,v,s(C.cy+C.y11,C.cx+C.x11),s(O.cy+O.y11,O.cx+O.x11),M),A.arc(O.cx,O.cy,L,s(O.y11,O.x11),s(O.y01,O.x01),!M))):A.arc(0,0,v,Y,X,M):A.lineTo(J,K)}else A.moveTo(0,0);if(A.closePath(),i)return A=null,i+""||null}return P.centroid=function(){var n=(+t.apply(this,arguments)+ +h.apply(this,arguments))/2,i=(+N.apply(this,arguments)+ +S.apply(this,arguments))/2-c/2;return[o(i)*n,r(i)*n]},P.innerRadius=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),P):t},P.outerRadius=function(t){return arguments.length?(h="function"==typeof t?t:i(+t),P):h},P.cornerRadius=function(t){return arguments.length?(w="function"==typeof t?t:i(+t),P):w},P.padRadius=function(t){return arguments.length?(k=null==t?null:"function"==typeof t?t:i(+t),P):k},P.startAngle=function(t){return arguments.length?(N="function"==typeof t?t:i(+t),P):N},P.endAngle=function(t){return arguments.length?(S="function"==typeof t?t:i(+t),P):S},P.padAngle=function(t){return arguments.length?(E="function"==typeof t?t:i(+t),P):E},P.context=function(t){return arguments.length?(A=null==t?null:t,P):A},P},t.area=M,t.areaRadial=B,t.curveBasis=function(t){return new wt(t)},t.curveBasisClosed=function(t){return new kt(t)},t.curveBasisOpen=function(t){return new Nt(t)},t.curveBumpX=L,t.curveBumpY=V,t.curveBundle=Et,t.curveCardinal=Mt,t.curveCardinalClosed=Ot,t.curveCardinalOpen=zt,t.curveCatmullRom=qt,t.curveCatmullRomClosed=jt,t.curveCatmullRomOpen=It,t.curveLinear=S,t.curveLinearClosed=function(t){return new Lt(t)},t.curveMonotoneX=function(t){return new Gt(t)},t.curveMonotoneY=function(t){return new Jt(t)},t.curveNatural=function(t){return new Qt(t)},t.curveStep=function(t){return new Zt(t,.5)},t.curveStepAfter=function(t){return new Zt(t,1)},t.curveStepBefore=function(t){return new Zt(t,0)},t.line=P,t.lineRadial=q,t.link=G,t.linkHorizontal=function(){return G(L)},t.linkRadial=function(){const t=G(W);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return G(V)},t.pie=function(){var t=O,n=C,e=null,s=i(0),o=i(f),h=i(0);function _(i){var _,r,a,l,c,u=(i=k(i)).length,y=0,x=new Array(u),p=new Array(u),v=+s.apply(this,arguments),d=Math.min(f,Math.max(-f,o.apply(this,arguments)-v)),T=Math.min(Math.abs(d)/u,h.apply(this,arguments)),g=T*(d<0?-1:1);for(_=0;_<u;++_)(c=p[x[_]=_]=+t(i[_],_,i))>0&&(y+=c);for(null!=n?x.sort((function(t,i){return n(p[t],p[i])})):null!=e&&x.sort((function(t,n){return e(i[t],i[n])})),_=0,a=y?(d-u*g)/y:0;_<u;++_,v=l)r=x[_],l=v+((c=p[r])>0?c*a:0)+g,p[r]={data:i[r],index:_,value:c,startAngle:v,endAngle:l,padAngle:T};return p}return _.value=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),_):t},_.sortValues=function(t){return arguments.length?(n=t,e=null,_):n},_.sort=function(t){return arguments.length?(e=t,n=null,_):e},_.startAngle=function(t){return arguments.length?(s="function"==typeof t?t:i(+t),_):s},_.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),_):o},_.padAngle=function(t){return arguments.length?(h="function"==typeof t?t:i(+t),_):h},_},t.pointRadial=j,t.radialArea=B,t.radialLine=q,t.stack=function(){var t=i([]),n=tn,e=$t,s=nn;function o(i){var o,h,_=Array.from(t.apply(this,arguments),en),r=_.length,a=-1;for(const t of i)for(o=0,++a;o<r;++o)(_[o][a]=[0,+s(t,_[o].key,a,i)]).data=t;for(o=0,h=k(n(_));o<r;++o)_[h[o]].index=o;return e(_,h),_}return o.keys=function(n){return arguments.length?(t="function"==typeof n?n:i(Array.from(n)),o):t},o.value=function(t){return arguments.length?(s="function"==typeof t?t:i(+t),o):s},o.order=function(t){return arguments.length?(n=null==t?tn:"function"==typeof t?t:i(Array.from(t)),o):n},o.offset=function(t){return arguments.length?(e=null==t?$t:t,o):e},o},t.stackOffsetDiverging=function(t,n){if((_=t.length)>0)for(var i,e,s,o,h,_,r=0,a=t[n[0]].length;r<a;++r)for(o=h=0,i=0;i<_;++i)(s=(e=t[n[i]][r])[1]-e[0])>0?(e[0]=o,e[1]=o+=s):s<0?(e[1]=h,e[0]=h+=s):(e[0]=0,e[1]=s)},t.stackOffsetExpand=function(t,n){if((e=t.length)>0){for(var i,e,s,o=0,h=t[0].length;o<h;++o){for(s=i=0;i<e;++i)s+=t[i][o][1]||0;if(s)for(i=0;i<e;++i)t[i][o][1]/=s}$t(t,n)}},t.stackOffsetNone=$t,t.stackOffsetSilhouette=function(t,n){if((i=t.length)>0){for(var i,e=0,s=t[n[0]],o=s.length;e<o;++e){for(var h=0,_=0;h<i;++h)_+=t[h][e][1]||0;s[e][1]+=s[e][0]=-_/2}$t(t,n)}},t.stackOffsetWiggle=function(t,n){if((s=t.length)>0&&(e=(i=t[n[0]]).length)>0){for(var i,e,s,o=0,h=1;h<e;++h){for(var _=0,r=0,a=0;_<s;++_){for(var l=t[n[_]],c=l[h][1]||0,u=(c-(l[h-1][1]||0))/2,f=0;f<_;++f){var y=t[n[f]];u+=(y[h][1]||0)-(y[h-1][1]||0)}r+=c,a+=u*c}i[h-1][1]+=i[h-1][0]=o,r&&(o-=a/r)}i[h-1][1]+=i[h-1][0]=o,$t(t,n)}},t.stackOrderAppearance=sn,t.stackOrderAscending=hn,t.stackOrderDescending=function(t){return hn(t).reverse()},t.stackOrderInsideOut=function(t){var n,i,e=t.length,s=t.map(_n),o=sn(t),h=0,_=0,r=[],a=[];for(n=0;n<e;++n)i=o[n],h<_?(h+=s[i],r.push(i)):(_+=s[i],a.push(i));return a.reverse().concat(r)},t.stackOrderNone=tn,t.stackOrderReverse=function(t){return tn(t).reverse()},t.symbol=function(t,e){let s=null;function o(){let i;if(s||(s=i=n.path()),t.apply(this,arguments).draw(s,+e.apply(this,arguments)),i)return s=null,i+""||null}return t="function"==typeof t?t:i(t||Q),e="function"==typeof e?e:i(void 0===e?64:+e),o.type=function(n){return arguments.length?(t="function"==typeof n?n:i(n),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),o):e},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o},t.symbolAsterisk=K,t.symbolCircle=Q,t.symbolCross=U,t.symbolDiamond=tt,t.symbolDiamond2=nt,t.symbolPlus=it,t.symbolSquare=et,t.symbolSquare2=st,t.symbolStar=rt,t.symbolTriangle=lt,t.symbolTriangle2=ut,t.symbolWye=vt,t.symbolX=dt,t.symbols=Tt,t.symbolsFill=Tt,t.symbolsStroke=gt,Object.defineProperty(t,"__esModule",{value:!0})})); |
{ | ||
"name": "d3-shape", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "Graphical primitives for visualization, such as lines and areas.", | ||
@@ -42,4 +42,4 @@ "homepage": "https://d3js.org/d3-shape/", | ||
"d3-polygon": "1 - 3", | ||
"eslint": "7", | ||
"mocha": "8", | ||
"eslint": "8", | ||
"mocha": "9", | ||
"rollup": "2", | ||
@@ -46,0 +46,0 @@ "rollup-plugin-terser": "7" |
@@ -0,1 +1,3 @@ | ||
import pointRadial from "../pointRadial.js"; | ||
class Bump { | ||
@@ -39,2 +41,25 @@ constructor(context, x) { | ||
class BumpRadial { | ||
constructor(context) { | ||
this._context = context; | ||
} | ||
lineStart() { | ||
this._point = 0; | ||
} | ||
lineEnd() {} | ||
point(x, y) { | ||
x = +x, y = +y; | ||
if (this._point++ === 0) { | ||
this._x0 = x, this._y0 = y; | ||
} else { | ||
const p0 = pointRadial(this._x0, this._y0); | ||
const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2); | ||
const p2 = pointRadial(x, this._y0); | ||
const p3 = pointRadial(x, y); | ||
this._context.moveTo(...p0); | ||
this._context.bezierCurveTo(...p1, ...p2, ...p3); | ||
} | ||
} | ||
} | ||
export function bumpX(context) { | ||
@@ -47,1 +72,5 @@ return new Bump(context, true); | ||
} | ||
export function bumpRadial(context) { | ||
return new BumpRadial(context); | ||
} |
@@ -8,12 +8,18 @@ export {default as arc} from "./arc.js"; | ||
export {default as pointRadial} from "./pointRadial.js"; | ||
export {linkHorizontal, linkVertical, linkRadial} from "./link/index.js"; | ||
export {link, linkHorizontal, linkVertical, linkRadial} from "./link.js"; | ||
export {default as symbol, symbols} from "./symbol.js"; | ||
export {default as symbol, symbolsStroke, symbolsFill, symbolsFill as symbols} from "./symbol.js"; | ||
export {default as symbolAsterisk} from "./symbol/asterisk.js"; | ||
export {default as symbolCircle} from "./symbol/circle.js"; | ||
export {default as symbolCross} from "./symbol/cross.js"; | ||
export {default as symbolDiamond} from "./symbol/diamond.js"; | ||
export {default as symbolDiamond2} from "./symbol/diamond2.js"; | ||
export {default as symbolPlus} from "./symbol/plus.js"; | ||
export {default as symbolSquare} from "./symbol/square.js"; | ||
export {default as symbolSquare2} from "./symbol/square2.js"; | ||
export {default as symbolStar} from "./symbol/star.js"; | ||
export {default as symbolTriangle} from "./symbol/triangle.js"; | ||
export {default as symbolTriangle2} from "./symbol/triangle2.js"; | ||
export {default as symbolWye} from "./symbol/wye.js"; | ||
export {default as symbolX} from "./symbol/x.js"; | ||
@@ -20,0 +26,0 @@ export {default as curveBasisClosed} from "./curve/basisClosed.js"; |
@@ -1,13 +0,13 @@ | ||
export var abs = Math.abs; | ||
export var atan2 = Math.atan2; | ||
export var cos = Math.cos; | ||
export var max = Math.max; | ||
export var min = Math.min; | ||
export var sin = Math.sin; | ||
export var sqrt = Math.sqrt; | ||
export const abs = Math.abs; | ||
export const atan2 = Math.atan2; | ||
export const cos = Math.cos; | ||
export const max = Math.max; | ||
export const min = Math.min; | ||
export const sin = Math.sin; | ||
export const sqrt = Math.sqrt; | ||
export var epsilon = 1e-12; | ||
export var pi = Math.PI; | ||
export var halfPi = pi / 2; | ||
export var tau = 2 * pi; | ||
export const epsilon = 1e-12; | ||
export const pi = Math.PI; | ||
export const halfPi = pi / 2; | ||
export const tau = 2 * pi; | ||
@@ -14,0 +14,0 @@ export function acos(x) { |
import {path} from "d3-path"; | ||
import constant from "./constant.js"; | ||
import asterisk from "./symbol/asterisk.js"; | ||
import circle from "./symbol/circle.js"; | ||
import cross from "./symbol/cross.js"; | ||
import diamond from "./symbol/diamond.js"; | ||
import diamond2 from "./symbol/diamond2.js"; | ||
import plus from "./symbol/plus.js"; | ||
import square from "./symbol/square.js"; | ||
import square2 from "./symbol/square2.js"; | ||
import star from "./symbol/star.js"; | ||
import square from "./symbol/square.js"; | ||
import triangle from "./symbol/triangle.js"; | ||
import triangle2 from "./symbol/triangle2.js"; | ||
import wye from "./symbol/wye.js"; | ||
import constant from "./constant.js"; | ||
import x from "./symbol/x.js"; | ||
export var symbols = [ | ||
// These symbols are designed to be filled. | ||
export const symbolsFill = [ | ||
circle, | ||
@@ -21,4 +28,16 @@ cross, | ||
export default function(type, size) { | ||
var context = null; | ||
// These symbols are designed to be stroked (with a width of 1.5px and round caps). | ||
export const symbolsStroke = [ | ||
circle, | ||
plus, | ||
x, | ||
triangle2, | ||
asterisk, | ||
square2, | ||
diamond2 | ||
]; | ||
export default function Symbol(type, size) { | ||
let context = null; | ||
type = typeof type === "function" ? type : constant(type || circle); | ||
@@ -28,3 +47,3 @@ size = typeof size === "function" ? size : constant(size === undefined ? 64 : +size); | ||
function symbol() { | ||
var buffer; | ||
let buffer; | ||
if (!context) context = buffer = path(); | ||
@@ -31,0 +50,0 @@ type.apply(this, arguments).draw(context, +size.apply(this, arguments)); |
@@ -1,6 +0,6 @@ | ||
import {pi, tau} from "../math.js"; | ||
import {pi, sqrt, tau} from "../math.js"; | ||
export default { | ||
draw: function(context, size) { | ||
var r = Math.sqrt(size / pi); | ||
draw(context, size) { | ||
const r = sqrt(size / pi); | ||
context.moveTo(r, 0); | ||
@@ -7,0 +7,0 @@ context.arc(0, 0, r, 0, tau); |
@@ -0,4 +1,6 @@ | ||
import {sqrt} from "../math.js"; | ||
export default { | ||
draw: function(context, size) { | ||
var r = Math.sqrt(size / 5) / 2; | ||
draw(context, size) { | ||
const r = sqrt(size / 5) / 2; | ||
context.moveTo(-3 * r, -r); | ||
@@ -5,0 +7,0 @@ context.lineTo(-r, -r); |
@@ -1,8 +0,10 @@ | ||
var tan30 = Math.sqrt(1 / 3), | ||
tan30_2 = tan30 * 2; | ||
import {sqrt} from "../math.js"; | ||
const tan30 = sqrt(1 / 3); | ||
const tan30_2 = tan30 * 2; | ||
export default { | ||
draw: function(context, size) { | ||
var y = Math.sqrt(size / tan30_2), | ||
x = y * tan30; | ||
draw(context, size) { | ||
const y = sqrt(size / tan30_2); | ||
const x = y * tan30; | ||
context.moveTo(0, -y); | ||
@@ -9,0 +11,0 @@ context.lineTo(x, 0); |
@@ -0,7 +1,9 @@ | ||
import {sqrt} from "../math.js"; | ||
export default { | ||
draw: function(context, size) { | ||
var w = Math.sqrt(size), | ||
x = -w / 2; | ||
draw(context, size) { | ||
const w = sqrt(size); | ||
const x = -w / 2; | ||
context.rect(x, x, w, w); | ||
} | ||
}; |
@@ -1,19 +0,19 @@ | ||
import {pi, tau} from "../math.js"; | ||
import {sin, cos, sqrt, pi, tau} from "../math.js"; | ||
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; | ||
const ka = 0.89081309152928522810; | ||
const kr = sin(pi / 10) / sin(7 * pi / 10); | ||
const kx = sin(tau / 10) * kr; | ||
const ky = -cos(tau / 10) * kr; | ||
export default { | ||
draw: function(context, size) { | ||
var r = Math.sqrt(size * ka), | ||
x = kx * r, | ||
y = ky * r; | ||
draw(context, size) { | ||
const r = sqrt(size * ka); | ||
const x = kx * r; | ||
const 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); | ||
for (let i = 1; i < 5; ++i) { | ||
const a = tau * i / 5; | ||
const c = cos(a); | ||
const s = sin(a); | ||
context.lineTo(s * r, -c * r); | ||
@@ -20,0 +20,0 @@ context.lineTo(c * x - s * y, s * x + c * y); |
@@ -1,6 +0,8 @@ | ||
var sqrt3 = Math.sqrt(3); | ||
import {sqrt} from "../math.js"; | ||
const sqrt3 = sqrt(3); | ||
export default { | ||
draw: function(context, size) { | ||
var y = -Math.sqrt(size / (sqrt3 * 3)); | ||
draw(context, size) { | ||
const y = -sqrt(size / (sqrt3 * 3)); | ||
context.moveTo(0, y * 2); | ||
@@ -7,0 +9,0 @@ context.lineTo(-sqrt3 * y, -y); |
@@ -1,15 +0,14 @@ | ||
var c = -0.5, | ||
s = Math.sqrt(3) / 2, | ||
k = 1 / Math.sqrt(12), | ||
a = (k / 2 + 1) * 3; | ||
import {sqrt} from "../math.js"; | ||
const c = -0.5; | ||
const s = sqrt(3) / 2; | ||
const k = 1 / sqrt(12); | ||
const a = (k / 2 + 1) * 3; | ||
export default { | ||
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; | ||
draw(context, size) { | ||
const r = sqrt(size / a); | ||
const x0 = r / 2, y0 = r * k; | ||
const x1 = x0, y1 = r * k + r; | ||
const x2 = -x1, y2 = y1; | ||
context.moveTo(x0, y0); | ||
@@ -16,0 +15,0 @@ context.lineTo(x1, y1); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
244986
64
3822
1208