@guardian/interactive-component-library 0.2.0-rc2 → 0.2.0-rc3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/components/molecules/canvas-map/lib/Map.js +2 -2
  2. package/dist/components/molecules/canvas-map/lib/projection/index.js +1 -1
  3. package/dist/components/molecules/canvas-map/lib/renderers/MapRenderer.js +1 -1
  4. package/dist/components/molecules/canvas-map/lib/sources/VectorSource.js +2 -2
  5. package/dist/components/molecules/modal/index.js +2 -2
  6. package/dist/components/molecules/result-summary/index.js +3 -1
  7. package/dist/components/molecules/svg-map/index.js +2 -1
  8. package/dist/components/molecules/svg-map/layers/Polygon.js +1 -1
  9. package/dist/components/particles/relative-time-sentence/index.js +2 -2
  10. package/package.json +1 -1
  11. package/dist/_virtual/_commonjsHelpers.js +0 -8
  12. package/dist/_virtual/dayjs.min.js +0 -4
  13. package/dist/_virtual/relativeTime.js +0 -4
  14. package/dist/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js +0 -338
  15. package/dist/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js +0 -13
  16. package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/albersUk.js +0 -108
  17. package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/bounds.js +0 -24
  18. package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/fit.js +0 -18
  19. package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/math.js +0 -4
  20. package/dist/node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js +0 -70
  21. package/dist/node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js +0 -6
  22. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js +0 -24
  23. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js +0 -4
  24. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js +0 -8
  25. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js +0 -20
  26. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js +0 -43
  27. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js +0 -28
  28. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js +0 -59
  29. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js +0 -18
  30. package/dist/node_modules/.pnpm/d3-path@2.0.0/node_modules/d3-path/src/path.js +0 -73
  31. package/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js +0 -13
  32. package/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js +0 -96
  33. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js +0 -21
  34. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js +0 -5
  35. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js +0 -9
  36. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js +0 -39
  37. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js +0 -55
  38. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js +0 -42
  39. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js +0 -18
  40. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js +0 -18
  41. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js +0 -14
  42. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js +0 -15
  43. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js +0 -23
  44. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js +0 -16
  45. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js +0 -68
  46. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js +0 -11
  47. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js +0 -18
  48. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js +0 -23
  49. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js +0 -13
  50. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js +0 -125
  51. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js +0 -20
  52. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js +0 -24
  53. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js +0 -8
  54. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js +0 -47
  55. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js +0 -25
  56. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js +0 -18
  57. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js +0 -25
  58. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js +0 -22
  59. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js +0 -64
  60. package/dist/node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/dayjs.min.js +0 -282
  61. package/dist/node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/relativeTime.js +0 -48
  62. package/dist/node_modules/.pnpm/flatbush@4.4.0/node_modules/flatbush/index.js +0 -339
  63. package/dist/node_modules/.pnpm/flatqueue@2.0.3/node_modules/flatqueue/index.js +0 -67
  64. package/dist/node_modules/.pnpm/preact-merge-refs@1.0.2_preact@10.21.0/node_modules/preact-merge-refs/lib/preact-merge-refs.modern.js +0 -10
  65. package/dist/node_modules/.pnpm/preact-transitioning@1.4.1_preact@10.21.0/node_modules/preact-transitioning/lib/preact-transitioning.modern.js +0 -63
  66. package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.js +0 -47
  67. package/dist/node_modules/.pnpm/rbush-knn@4.0.0/node_modules/rbush-knn/index.js +0 -42
  68. package/dist/node_modules/.pnpm/rbush@4.0.0/node_modules/rbush/index.js +0 -378
  69. package/dist/node_modules/.pnpm/tinyqueue@2.0.3/node_modules/tinyqueue/index.js +0 -65
@@ -1,70 +0,0 @@
1
- var noop = { value: () => {
2
- } };
3
- function dispatch() {
4
- for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
5
- if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t)) throw new Error("illegal type: " + t);
6
- _[t] = [];
7
- }
8
- return new Dispatch(_);
9
- }
10
- function Dispatch(_) {
11
- this._ = _;
12
- }
13
- function parseTypenames(typenames, types) {
14
- return typenames.trim().split(/^|\s+/).map(function(t) {
15
- var name = "", i = t.indexOf(".");
16
- if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
17
- if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);
18
- return { type: t, name };
19
- });
20
- }
21
- Dispatch.prototype = dispatch.prototype = {
22
- constructor: Dispatch,
23
- on: function(typename, callback) {
24
- var _ = this._, T = parseTypenames(typename + "", _), t, i = -1, n = T.length;
25
- if (arguments.length < 2) {
26
- while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;
27
- return;
28
- }
29
- if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
30
- while (++i < n) {
31
- if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);
32
- else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);
33
- }
34
- return this;
35
- },
36
- copy: function() {
37
- var copy = {}, _ = this._;
38
- for (var t in _) copy[t] = _[t].slice();
39
- return new Dispatch(copy);
40
- },
41
- call: function(type, that) {
42
- if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];
43
- if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
44
- for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
45
- },
46
- apply: function(type, that, args) {
47
- if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
48
- for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
49
- }
50
- };
51
- function get(type, name) {
52
- for (var i = 0, n = type.length, c; i < n; ++i) {
53
- if ((c = type[i]).name === name) {
54
- return c.value;
55
- }
56
- }
57
- }
58
- function set(type, name, callback) {
59
- for (var i = 0, n = type.length; i < n; ++i) {
60
- if (type[i].name === name) {
61
- type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
62
- break;
63
- }
64
- }
65
- if (callback != null) type.push({ name, value: callback });
66
- return type;
67
- }
68
- export {
69
- dispatch as default
70
- };
@@ -1,6 +0,0 @@
1
- function cubicInOut(t) {
2
- return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
3
- }
4
- export {
5
- cubicInOut
6
- };
@@ -1,24 +0,0 @@
1
- import constant from "./constant.js";
2
- function linear(a, d) {
3
- return function(t) {
4
- return a + t * d;
5
- };
6
- }
7
- function exponential(a, b, y) {
8
- return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
9
- return Math.pow(a + t * b, y);
10
- };
11
- }
12
- function gamma(y) {
13
- return (y = +y) === 1 ? nogamma : function(a, b) {
14
- return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
15
- };
16
- }
17
- function nogamma(a, b) {
18
- var d = b - a;
19
- return d ? linear(a, d) : constant(isNaN(a) ? b : a);
20
- }
21
- export {
22
- nogamma as default,
23
- gamma
24
- };
@@ -1,4 +0,0 @@
1
- const constant = (x) => () => x;
2
- export {
3
- constant as default
4
- };
@@ -1,8 +0,0 @@
1
- function interpolateNumber(a, b) {
2
- return a = +a, b = +b, function(t) {
3
- return a * (1 - t) + b * t;
4
- };
5
- }
6
- export {
7
- interpolateNumber as default
8
- };
@@ -1,20 +0,0 @@
1
- import nogamma, { gamma } from "./color.js";
2
- import { rgb } from "../../../../d3-color@3.1.0/node_modules/d3-color/src/color.js";
3
- const interpolateRgb = function rgbGamma(y) {
4
- var color = gamma(y);
5
- function rgb$1(start, end) {
6
- var r = color((start = rgb(start)).r, (end = rgb(end)).r), g = color(start.g, end.g), b = color(start.b, end.b), opacity = nogamma(start.opacity, end.opacity);
7
- return function(t) {
8
- start.r = r(t);
9
- start.g = g(t);
10
- start.b = b(t);
11
- start.opacity = opacity(t);
12
- return start + "";
13
- };
14
- }
15
- rgb$1.gamma = rgbGamma;
16
- return rgb$1;
17
- }(1);
18
- export {
19
- interpolateRgb as default
20
- };
@@ -1,43 +0,0 @@
1
- import interpolateNumber from "./number.js";
2
- var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, reB = new RegExp(reA.source, "g");
3
- function zero(b) {
4
- return function() {
5
- return b;
6
- };
7
- }
8
- function one(b) {
9
- return function(t) {
10
- return b(t) + "";
11
- };
12
- }
13
- function interpolateString(a, b) {
14
- var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
15
- a = a + "", b = b + "";
16
- while ((am = reA.exec(a)) && (bm = reB.exec(b))) {
17
- if ((bs = bm.index) > bi) {
18
- bs = b.slice(bi, bs);
19
- if (s[i]) s[i] += bs;
20
- else s[++i] = bs;
21
- }
22
- if ((am = am[0]) === (bm = bm[0])) {
23
- if (s[i]) s[i] += bm;
24
- else s[++i] = bm;
25
- } else {
26
- s[++i] = null;
27
- q.push({ i, x: interpolateNumber(am, bm) });
28
- }
29
- bi = reB.lastIndex;
30
- }
31
- if (bi < b.length) {
32
- bs = b.slice(bi);
33
- if (s[i]) s[i] += bs;
34
- else s[++i] = bs;
35
- }
36
- return s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t) {
37
- for (var i2 = 0, o; i2 < b; ++i2) s[(o = q[i2]).i] = o.x(t);
38
- return s.join("");
39
- });
40
- }
41
- export {
42
- interpolateString as default
43
- };
@@ -1,28 +0,0 @@
1
- var degrees = 180 / Math.PI;
2
- var identity = {
3
- translateX: 0,
4
- translateY: 0,
5
- rotate: 0,
6
- skewX: 0,
7
- scaleX: 1,
8
- scaleY: 1
9
- };
10
- function decompose(a, b, c, d, e, f) {
11
- var scaleX, scaleY, skewX;
12
- if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
13
- if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
14
- if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
15
- if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
16
- return {
17
- translateX: e,
18
- translateY: f,
19
- rotate: Math.atan2(b, a) * degrees,
20
- skewX: Math.atan(skewX) * degrees,
21
- scaleX,
22
- scaleY
23
- };
24
- }
25
- export {
26
- decompose as default,
27
- identity
28
- };
@@ -1,59 +0,0 @@
1
- import interpolateNumber from "../number.js";
2
- import { parseCss, parseSvg } from "./parse.js";
3
- function interpolateTransform(parse, pxComma, pxParen, degParen) {
4
- function pop(s) {
5
- return s.length ? s.pop() + " " : "";
6
- }
7
- function translate(xa, ya, xb, yb, s, q) {
8
- if (xa !== xb || ya !== yb) {
9
- var i = s.push("translate(", null, pxComma, null, pxParen);
10
- q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
11
- } else if (xb || yb) {
12
- s.push("translate(" + xb + pxComma + yb + pxParen);
13
- }
14
- }
15
- function rotate(a, b, s, q) {
16
- if (a !== b) {
17
- if (a - b > 180) b += 360;
18
- else if (b - a > 180) a += 360;
19
- q.push({ i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b) });
20
- } else if (b) {
21
- s.push(pop(s) + "rotate(" + b + degParen);
22
- }
23
- }
24
- function skewX(a, b, s, q) {
25
- if (a !== b) {
26
- q.push({ i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b) });
27
- } else if (b) {
28
- s.push(pop(s) + "skewX(" + b + degParen);
29
- }
30
- }
31
- function scale(xa, ya, xb, yb, s, q) {
32
- if (xa !== xb || ya !== yb) {
33
- var i = s.push(pop(s) + "scale(", null, ",", null, ")");
34
- q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
35
- } else if (xb !== 1 || yb !== 1) {
36
- s.push(pop(s) + "scale(" + xb + "," + yb + ")");
37
- }
38
- }
39
- return function(a, b) {
40
- var s = [], q = [];
41
- a = parse(a), b = parse(b);
42
- translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
43
- rotate(a.rotate, b.rotate, s, q);
44
- skewX(a.skewX, b.skewX, s, q);
45
- scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
46
- a = b = null;
47
- return function(t) {
48
- var i = -1, n = q.length, o;
49
- while (++i < n) s[(o = q[i]).i] = o.x(t);
50
- return s.join("");
51
- };
52
- };
53
- }
54
- var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
55
- var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
56
- export {
57
- interpolateTransformCss,
58
- interpolateTransformSvg
59
- };
@@ -1,18 +0,0 @@
1
- import decompose, { identity } from "./decompose.js";
2
- var svgNode;
3
- function parseCss(value) {
4
- const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
5
- return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
6
- }
7
- function parseSvg(value) {
8
- if (value == null) return identity;
9
- if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
10
- svgNode.setAttribute("transform", value);
11
- if (!(value = svgNode.transform.baseVal.consolidate())) return identity;
12
- value = value.matrix;
13
- return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
14
- }
15
- export {
16
- parseCss,
17
- parseSvg
18
- };
@@ -1,73 +0,0 @@
1
- const pi = Math.PI, tau = 2 * pi, epsilon = 1e-6, tauEpsilon = tau - epsilon;
2
- function Path() {
3
- this._x0 = this._y0 = // start of current subpath
4
- this._x1 = this._y1 = null;
5
- this._ = "";
6
- }
7
- function path() {
8
- return new Path();
9
- }
10
- Path.prototype = path.prototype = {
11
- constructor: Path,
12
- moveTo: function(x, y) {
13
- this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);
14
- },
15
- closePath: function() {
16
- if (this._x1 !== null) {
17
- this._x1 = this._x0, this._y1 = this._y0;
18
- this._ += "Z";
19
- }
20
- },
21
- lineTo: function(x, y) {
22
- this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);
23
- },
24
- quadraticCurveTo: function(x1, y1, x, y) {
25
- this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
26
- },
27
- bezierCurveTo: function(x1, y1, x2, y2, x, y) {
28
- this._ += "C" + +x1 + "," + +y1 + "," + +x2 + "," + +y2 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
29
- },
30
- arcTo: function(x1, y1, x2, y2, r) {
31
- x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
32
- 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;
33
- if (r < 0) throw new Error("negative radius: " + r);
34
- if (this._x1 === null) {
35
- this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
36
- } else if (!(l01_2 > epsilon)) ;
37
- else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {
38
- this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
39
- } else {
40
- 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;
41
- if (Math.abs(t01 - 1) > epsilon) {
42
- this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
43
- }
44
- this._ += "A" + r + "," + r + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
45
- }
46
- },
47
- arc: function(x, y, r, a0, a1, ccw) {
48
- x = +x, y = +y, r = +r, ccw = !!ccw;
49
- 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;
50
- if (r < 0) throw new Error("negative radius: " + r);
51
- if (this._x1 === null) {
52
- this._ += "M" + x0 + "," + y0;
53
- } else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {
54
- this._ += "L" + x0 + "," + y0;
55
- }
56
- if (!r) return;
57
- if (da < 0) da = da % tau + tau;
58
- if (da > tauEpsilon) {
59
- this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
60
- } else if (da > epsilon) {
61
- this._ += "A" + r + "," + r + ",0," + +(da >= pi) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
62
- }
63
- },
64
- rect: function(x, y, w, h) {
65
- this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + +w + "v" + +h + "h" + -w + "Z";
66
- },
67
- toString: function() {
68
- return this._;
69
- }
70
- };
71
- export {
72
- path as default
73
- };
@@ -1,13 +0,0 @@
1
- import { Timer } from "./timer.js";
2
- function timeout(callback, delay, time) {
3
- var t = new Timer();
4
- delay = delay == null ? 0 : +delay;
5
- t.restart((elapsed) => {
6
- t.stop();
7
- callback(elapsed + delay);
8
- }, delay, time);
9
- return t;
10
- }
11
- export {
12
- timeout as default
13
- };
@@ -1,96 +0,0 @@
1
- var frame = 0, timeout = 0, interval = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance === "object" && performance.now ? performance : Date, setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
2
- setTimeout(f, 17);
3
- };
4
- function now() {
5
- return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
6
- }
7
- function clearNow() {
8
- clockNow = 0;
9
- }
10
- function Timer() {
11
- this._call = this._time = this._next = null;
12
- }
13
- Timer.prototype = timer.prototype = {
14
- constructor: Timer,
15
- restart: function(callback, delay, time) {
16
- if (typeof callback !== "function") throw new TypeError("callback is not a function");
17
- time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
18
- if (!this._next && taskTail !== this) {
19
- if (taskTail) taskTail._next = this;
20
- else taskHead = this;
21
- taskTail = this;
22
- }
23
- this._call = callback;
24
- this._time = time;
25
- sleep();
26
- },
27
- stop: function() {
28
- if (this._call) {
29
- this._call = null;
30
- this._time = Infinity;
31
- sleep();
32
- }
33
- }
34
- };
35
- function timer(callback, delay, time) {
36
- var t = new Timer();
37
- t.restart(callback, delay, time);
38
- return t;
39
- }
40
- function timerFlush() {
41
- now();
42
- ++frame;
43
- var t = taskHead, e;
44
- while (t) {
45
- if ((e = clockNow - t._time) >= 0) t._call.call(void 0, e);
46
- t = t._next;
47
- }
48
- --frame;
49
- }
50
- function wake() {
51
- clockNow = (clockLast = clock.now()) + clockSkew;
52
- frame = timeout = 0;
53
- try {
54
- timerFlush();
55
- } finally {
56
- frame = 0;
57
- nap();
58
- clockNow = 0;
59
- }
60
- }
61
- function poke() {
62
- var now2 = clock.now(), delay = now2 - clockLast;
63
- if (delay > pokeDelay) clockSkew -= delay, clockLast = now2;
64
- }
65
- function nap() {
66
- var t0, t1 = taskHead, t2, time = Infinity;
67
- while (t1) {
68
- if (t1._call) {
69
- if (time > t1._time) time = t1._time;
70
- t0 = t1, t1 = t1._next;
71
- } else {
72
- t2 = t1._next, t1._next = null;
73
- t1 = t0 ? t0._next = t2 : taskHead = t2;
74
- }
75
- }
76
- taskTail = t0;
77
- sleep(time);
78
- }
79
- function sleep(time) {
80
- if (frame) return;
81
- if (timeout) timeout = clearTimeout(timeout);
82
- var delay = time - clockNow;
83
- if (delay > 24) {
84
- if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
85
- if (interval) interval = clearInterval(interval);
86
- } else {
87
- if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
88
- frame = 1, setFrame(wake);
89
- }
90
- }
91
- export {
92
- Timer,
93
- now,
94
- timer,
95
- timerFlush
96
- };
@@ -1,21 +0,0 @@
1
- import { STARTING, ENDING, ENDED } from "./transition/schedule.js";
2
- function interrupt(node, name) {
3
- var schedules = node.__transition, schedule, active, empty = true, i;
4
- if (!schedules) return;
5
- name = name == null ? null : name + "";
6
- for (i in schedules) {
7
- if ((schedule = schedules[i]).name !== name) {
8
- empty = false;
9
- continue;
10
- }
11
- active = schedule.state > STARTING && schedule.state < ENDING;
12
- schedule.state = ENDED;
13
- schedule.timer.stop();
14
- schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group);
15
- delete schedules[i];
16
- }
17
- if (empty) delete node.__transition;
18
- }
19
- export {
20
- interrupt as default
21
- };
@@ -1,5 +0,0 @@
1
- import { selection } from "d3-selection";
2
- import selection_interrupt from "./interrupt.js";
3
- import selection_transition from "./transition.js";
4
- selection.prototype.interrupt = selection_interrupt;
5
- selection.prototype.transition = selection_transition;
@@ -1,9 +0,0 @@
1
- import interrupt from "../interrupt.js";
2
- function selection_interrupt(name) {
3
- return this.each(function() {
4
- interrupt(this, name);
5
- });
6
- }
7
- export {
8
- selection_interrupt as default
9
- };
@@ -1,39 +0,0 @@
1
- import { Transition, newId } from "../transition/index.js";
2
- import schedule from "../transition/schedule.js";
3
- import { now } from "../../../../../d3-timer@3.0.1/node_modules/d3-timer/src/timer.js";
4
- import { cubicInOut } from "../../../../../d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js";
5
- var defaultTiming = {
6
- time: null,
7
- // Set on use.
8
- delay: 0,
9
- duration: 250,
10
- ease: cubicInOut
11
- };
12
- function inherit(node, id) {
13
- var timing;
14
- while (!(timing = node.__transition) || !(timing = timing[id])) {
15
- if (!(node = node.parentNode)) {
16
- throw new Error(`transition ${id} not found`);
17
- }
18
- }
19
- return timing;
20
- }
21
- function selection_transition(name) {
22
- var id, timing;
23
- if (name instanceof Transition) {
24
- id = name._id, name = name._name;
25
- } else {
26
- id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
27
- }
28
- for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
29
- for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
30
- if (node = group[i]) {
31
- schedule(node, name, id, i, group, timing || inherit(node, id));
32
- }
33
- }
34
- }
35
- return new Transition(groups, this._parents, name, id);
36
- }
37
- export {
38
- selection_transition as default
39
- };
@@ -1,55 +0,0 @@
1
- import { namespace } from "d3-selection";
2
- import { tweenValue } from "./tween.js";
3
- import interpolate from "./interpolate.js";
4
- import { interpolateTransformSvg } from "../../../../../d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js";
5
- function attrRemove(name) {
6
- return function() {
7
- this.removeAttribute(name);
8
- };
9
- }
10
- function attrRemoveNS(fullname) {
11
- return function() {
12
- this.removeAttributeNS(fullname.space, fullname.local);
13
- };
14
- }
15
- function attrConstant(name, interpolate2, value1) {
16
- var string00, string1 = value1 + "", interpolate0;
17
- return function() {
18
- var string0 = this.getAttribute(name);
19
- return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
20
- };
21
- }
22
- function attrConstantNS(fullname, interpolate2, value1) {
23
- var string00, string1 = value1 + "", interpolate0;
24
- return function() {
25
- var string0 = this.getAttributeNS(fullname.space, fullname.local);
26
- return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
27
- };
28
- }
29
- function attrFunction(name, interpolate2, value) {
30
- var string00, string10, interpolate0;
31
- return function() {
32
- var string0, value1 = value(this), string1;
33
- if (value1 == null) return void this.removeAttribute(name);
34
- string0 = this.getAttribute(name);
35
- string1 = value1 + "";
36
- return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
37
- };
38
- }
39
- function attrFunctionNS(fullname, interpolate2, value) {
40
- var string00, string10, interpolate0;
41
- return function() {
42
- var string0, value1 = value(this), string1;
43
- if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
44
- string0 = this.getAttributeNS(fullname.space, fullname.local);
45
- string1 = value1 + "";
46
- return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
47
- };
48
- }
49
- function transition_attr(name, value) {
50
- var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate;
51
- return this.attrTween(name, typeof value === "function" ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, "attr." + name, value)) : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname) : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));
52
- }
53
- export {
54
- transition_attr as default
55
- };
@@ -1,42 +0,0 @@
1
- import { namespace } from "d3-selection";
2
- function attrInterpolate(name, i) {
3
- return function(t) {
4
- this.setAttribute(name, i.call(this, t));
5
- };
6
- }
7
- function attrInterpolateNS(fullname, i) {
8
- return function(t) {
9
- this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));
10
- };
11
- }
12
- function attrTweenNS(fullname, value) {
13
- var t0, i0;
14
- function tween() {
15
- var i = value.apply(this, arguments);
16
- if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);
17
- return t0;
18
- }
19
- tween._value = value;
20
- return tween;
21
- }
22
- function attrTween(name, value) {
23
- var t0, i0;
24
- function tween() {
25
- var i = value.apply(this, arguments);
26
- if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);
27
- return t0;
28
- }
29
- tween._value = value;
30
- return tween;
31
- }
32
- function transition_attrTween(name, value) {
33
- var key = "attr." + name;
34
- if (arguments.length < 2) return (key = this.tween(key)) && key._value;
35
- if (value == null) return this.tween(key, null);
36
- if (typeof value !== "function") throw new Error();
37
- var fullname = namespace(name);
38
- return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
39
- }
40
- export {
41
- transition_attrTween as default
42
- };
@@ -1,18 +0,0 @@
1
- import { get, init } from "./schedule.js";
2
- function delayFunction(id, value) {
3
- return function() {
4
- init(this, id).delay = +value.apply(this, arguments);
5
- };
6
- }
7
- function delayConstant(id, value) {
8
- return value = +value, function() {
9
- init(this, id).delay = value;
10
- };
11
- }
12
- function transition_delay(value) {
13
- var id = this._id;
14
- return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id, value)) : get(this.node(), id).delay;
15
- }
16
- export {
17
- transition_delay as default
18
- };