@ledgerhq/lumen-ui-react-visualization 0.1.1 → 0.1.3

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 (119) hide show
  1. package/dist/lib/Components/CartesianChart/CartesianChart.d.ts +3 -0
  2. package/dist/lib/Components/CartesianChart/CartesianChart.d.ts.map +1 -0
  3. package/dist/lib/Components/CartesianChart/CartesianChart.js +70 -0
  4. package/dist/lib/Components/CartesianChart/context/cartesianChartContext.d.ts +8 -0
  5. package/dist/lib/Components/CartesianChart/context/cartesianChartContext.d.ts.map +1 -0
  6. package/dist/lib/Components/CartesianChart/context/cartesianChartContext.js +9 -0
  7. package/dist/lib/Components/CartesianChart/context/index.d.ts +3 -0
  8. package/dist/lib/Components/CartesianChart/context/index.d.ts.map +1 -0
  9. package/dist/lib/Components/CartesianChart/context/useBuildChartContext.d.ts +23 -0
  10. package/dist/lib/Components/CartesianChart/context/useBuildChartContext.d.ts.map +1 -0
  11. package/dist/lib/Components/CartesianChart/context/useBuildChartContext.js +61 -0
  12. package/dist/lib/Components/CartesianChart/index.d.ts +4 -0
  13. package/dist/lib/Components/CartesianChart/index.d.ts.map +1 -0
  14. package/dist/lib/Components/CartesianChart/types.d.ts +48 -0
  15. package/dist/lib/Components/CartesianChart/types.d.ts.map +1 -0
  16. package/dist/lib/Components/Line/Line.d.ts +3 -0
  17. package/dist/lib/Components/Line/Line.d.ts.map +1 -0
  18. package/dist/lib/Components/Line/Line.js +53 -0
  19. package/dist/lib/Components/Line/index.d.ts +3 -0
  20. package/dist/lib/Components/Line/index.d.ts.map +1 -0
  21. package/dist/lib/Components/Line/types.d.ts +24 -0
  22. package/dist/lib/Components/Line/types.d.ts.map +1 -0
  23. package/dist/lib/Components/Line/utils.d.ts +19 -0
  24. package/dist/lib/Components/Line/utils.d.ts.map +1 -0
  25. package/dist/lib/Components/Line/utils.js +22 -0
  26. package/dist/lib/Components/LineChart/LineChart.d.ts +2 -8
  27. package/dist/lib/Components/LineChart/LineChart.d.ts.map +1 -1
  28. package/dist/lib/Components/LineChart/LineChart.js +78 -23
  29. package/dist/lib/Components/LineChart/index.d.ts +1 -0
  30. package/dist/lib/Components/LineChart/index.d.ts.map +1 -1
  31. package/dist/lib/Components/LineChart/types.d.ts +61 -0
  32. package/dist/lib/Components/LineChart/types.d.ts.map +1 -0
  33. package/dist/lib/Components/XAxis/XAxis.d.ts +4 -0
  34. package/dist/lib/Components/XAxis/XAxis.d.ts.map +1 -0
  35. package/dist/lib/Components/XAxis/XAxis.js +79 -0
  36. package/dist/lib/Components/XAxis/index.d.ts +3 -0
  37. package/dist/lib/Components/XAxis/index.d.ts.map +1 -0
  38. package/dist/lib/Components/XAxis/types.d.ts +3 -0
  39. package/dist/lib/Components/XAxis/types.d.ts.map +1 -0
  40. package/dist/lib/Components/YAxis/YAxis.d.ts +4 -0
  41. package/dist/lib/Components/YAxis/YAxis.d.ts.map +1 -0
  42. package/dist/lib/Components/YAxis/YAxis.js +79 -0
  43. package/dist/lib/Components/YAxis/index.d.ts +3 -0
  44. package/dist/lib/Components/YAxis/index.d.ts.map +1 -0
  45. package/dist/lib/Components/YAxis/types.d.ts +3 -0
  46. package/dist/lib/Components/YAxis/types.d.ts.map +1 -0
  47. package/dist/lib/utils/domain/domain.d.ts +17 -0
  48. package/dist/lib/utils/domain/domain.d.ts.map +1 -0
  49. package/dist/lib/utils/domain/domain.js +38 -0
  50. package/dist/lib/utils/index.d.ts +1 -1
  51. package/dist/lib/utils/index.d.ts.map +1 -1
  52. package/dist/lib/utils/scales/scales.d.ts +24 -0
  53. package/dist/lib/utils/scales/scales.d.ts.map +1 -0
  54. package/dist/lib/utils/scales/scales.js +25 -0
  55. package/dist/lib/utils/ticks/ticks.d.ts +27 -0
  56. package/dist/lib/utils/ticks/ticks.d.ts.map +1 -0
  57. package/dist/lib/utils/ticks/ticks.js +23 -0
  58. package/dist/lib/utils/types.d.ts +132 -6
  59. package/dist/lib/utils/types.d.ts.map +1 -1
  60. package/dist/libs/utils-shared/dist/index.js +35 -0
  61. package/dist/node_modules/d3-array/src/ascending.js +6 -0
  62. package/dist/node_modules/d3-array/src/bisect.js +9 -0
  63. package/dist/node_modules/d3-array/src/bisector.js +37 -0
  64. package/dist/node_modules/d3-array/src/descending.js +6 -0
  65. package/dist/node_modules/d3-array/src/number.js +6 -0
  66. package/dist/node_modules/d3-array/src/range.js +9 -0
  67. package/dist/node_modules/d3-array/src/ticks.js +32 -0
  68. package/dist/node_modules/d3-color/src/color.js +305 -0
  69. package/dist/node_modules/d3-color/src/define.js +12 -0
  70. package/dist/node_modules/d3-format/src/defaultLocale.js +15 -0
  71. package/dist/node_modules/d3-format/src/exponent.js +7 -0
  72. package/dist/node_modules/d3-format/src/formatDecimal.js +15 -0
  73. package/dist/node_modules/d3-format/src/formatGroup.js +10 -0
  74. package/dist/node_modules/d3-format/src/formatNumerals.js +10 -0
  75. package/dist/node_modules/d3-format/src/formatPrefixAuto.js +12 -0
  76. package/dist/node_modules/d3-format/src/formatRounded.js +10 -0
  77. package/dist/node_modules/d3-format/src/formatSpecifier.js +28 -0
  78. package/dist/node_modules/d3-format/src/formatTrim.js +19 -0
  79. package/dist/node_modules/d3-format/src/formatTypes.js +21 -0
  80. package/dist/node_modules/d3-format/src/identity.js +6 -0
  81. package/dist/node_modules/d3-format/src/locale.js +68 -0
  82. package/dist/node_modules/d3-format/src/precisionFixed.js +7 -0
  83. package/dist/node_modules/d3-format/src/precisionPrefix.js +7 -0
  84. package/dist/node_modules/d3-format/src/precisionRound.js +7 -0
  85. package/dist/node_modules/d3-interpolate/src/array.js +13 -0
  86. package/dist/node_modules/d3-interpolate/src/color.js +24 -0
  87. package/dist/node_modules/d3-interpolate/src/constant.js +4 -0
  88. package/dist/node_modules/d3-interpolate/src/date.js +9 -0
  89. package/dist/node_modules/d3-interpolate/src/number.js +8 -0
  90. package/dist/node_modules/d3-interpolate/src/numberArray.js +15 -0
  91. package/dist/node_modules/d3-interpolate/src/object.js +14 -0
  92. package/dist/node_modules/d3-interpolate/src/rgb.js +15 -0
  93. package/dist/node_modules/d3-interpolate/src/round.js +8 -0
  94. package/dist/node_modules/d3-interpolate/src/string.js +24 -0
  95. package/dist/node_modules/d3-interpolate/src/value.js +16 -0
  96. package/dist/node_modules/d3-path/src/path.js +64 -0
  97. package/dist/node_modules/d3-scale/src/band.js +41 -0
  98. package/dist/node_modules/d3-scale/src/constant.js +8 -0
  99. package/dist/node_modules/d3-scale/src/continuous.js +75 -0
  100. package/dist/node_modules/d3-scale/src/init.js +16 -0
  101. package/dist/node_modules/d3-scale/src/linear.js +39 -0
  102. package/dist/node_modules/d3-scale/src/log.js +86 -0
  103. package/dist/node_modules/d3-scale/src/nice.js +8 -0
  104. package/dist/node_modules/d3-scale/src/number.js +6 -0
  105. package/dist/node_modules/d3-scale/src/ordinal.js +31 -0
  106. package/dist/node_modules/d3-scale/src/tickFormat.js +32 -0
  107. package/dist/node_modules/d3-shape/src/area.js +56 -0
  108. package/dist/node_modules/d3-shape/src/array.js +6 -0
  109. package/dist/node_modules/d3-shape/src/constant.js +8 -0
  110. package/dist/node_modules/d3-shape/src/curve/bump.js +39 -0
  111. package/dist/node_modules/d3-shape/src/curve/linear.js +36 -0
  112. package/dist/node_modules/d3-shape/src/line.js +29 -0
  113. package/dist/node_modules/d3-shape/src/path.js +18 -0
  114. package/dist/node_modules/d3-shape/src/point.js +10 -0
  115. package/dist/node_modules/internmap/src/index.js +35 -0
  116. package/dist/package.json +14 -2
  117. package/package.json +14 -2
  118. package/dist/lib/utils/math/index.d.ts +0 -1
  119. package/dist/lib/utils/math/index.d.ts.map +0 -1
@@ -0,0 +1,15 @@
1
+ function f(r, e) {
2
+ e || (e = []);
3
+ var u = r ? Math.min(e.length, r.length) : 0, i = e.slice(), n;
4
+ return function(t) {
5
+ for (n = 0; n < u; ++n) i[n] = r[n] * (1 - t) + e[n] * t;
6
+ return i;
7
+ };
8
+ }
9
+ function a(r) {
10
+ return ArrayBuffer.isView(r) && !(r instanceof DataView);
11
+ }
12
+ export {
13
+ f as default,
14
+ a as isNumberArray
15
+ };
@@ -0,0 +1,14 @@
1
+ import r from "./value.js";
2
+ function u(o, e) {
3
+ var n = {}, f = {}, t;
4
+ (o === null || typeof o != "object") && (o = {}), (e === null || typeof e != "object") && (e = {});
5
+ for (t in e)
6
+ t in o ? n[t] = r(o[t], e[t]) : f[t] = e[t];
7
+ return function(i) {
8
+ for (t in n) f[t] = n[t](i);
9
+ return f;
10
+ };
11
+ }
12
+ export {
13
+ u as default
14
+ };
@@ -0,0 +1,15 @@
1
+ import y, { gamma as l } from "./color.js";
2
+ import { rgb as c } from "../../d3-color/src/color.js";
3
+ const x = (function i(a) {
4
+ var m = l(a);
5
+ function b(o, r) {
6
+ var n = m((o = c(o)).r, (r = c(r)).r), p = m(o.g, r.g), u = m(o.b, r.b), f = y(o.opacity, r.opacity);
7
+ return function(g) {
8
+ return o.r = n(g), o.g = p(g), o.b = u(g), o.opacity = f(g), o + "";
9
+ };
10
+ }
11
+ return b.gamma = i, b;
12
+ })(1);
13
+ export {
14
+ x as default
15
+ };
@@ -0,0 +1,8 @@
1
+ function u(n, t) {
2
+ return n = +n, t = +t, function(r) {
3
+ return Math.round(n * (1 - r) + t * r);
4
+ };
5
+ }
6
+ export {
7
+ u as default
8
+ };
@@ -0,0 +1,24 @@
1
+ import g from "./number.js";
2
+ var x = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, c = new RegExp(x.source, "g");
3
+ function h(i) {
4
+ return function() {
5
+ return i;
6
+ };
7
+ }
8
+ function m(i) {
9
+ return function(n) {
10
+ return i(n) + "";
11
+ };
12
+ }
13
+ function v(i, n) {
14
+ var u = x.lastIndex = c.lastIndex = 0, s, l, t, r = -1, e = [], f = [];
15
+ for (i = i + "", n = n + ""; (s = x.exec(i)) && (l = c.exec(n)); )
16
+ (t = l.index) > u && (t = n.slice(u, t), e[r] ? e[r] += t : e[++r] = t), (s = s[0]) === (l = l[0]) ? e[r] ? e[r] += l : e[++r] = l : (e[++r] = null, f.push({ i: r, x: g(s, l) })), u = c.lastIndex;
17
+ return u < n.length && (t = n.slice(u), e[r] ? e[r] += t : e[++r] = t), e.length < 2 ? f[0] ? m(f[0].x) : h(n) : (n = f.length, function(a) {
18
+ for (var o = 0, d; o < n; ++o) e[(d = f[o]).i] = d.x(a);
19
+ return e.join("");
20
+ });
21
+ }
22
+ export {
23
+ v as default
24
+ };
@@ -0,0 +1,16 @@
1
+ import e from "./rgb.js";
2
+ import { genericArray as f } from "./array.js";
3
+ import a from "./date.js";
4
+ import i from "./number.js";
5
+ import p from "./object.js";
6
+ import u from "./string.js";
7
+ import c from "./constant.js";
8
+ import s, { isNumberArray as l } from "./numberArray.js";
9
+ import n from "../../d3-color/src/color.js";
10
+ function O(m, r) {
11
+ var o = typeof r, t;
12
+ return r == null || o === "boolean" ? c(r) : (o === "number" ? i : o === "string" ? (t = n(r)) ? (r = t, e) : u : r instanceof n ? e : r instanceof Date ? a : l(r) ? s : Array.isArray(r) ? f : typeof r.valueOf != "function" && typeof r.toString != "function" || isNaN(r) ? p : i)(m, r);
13
+ }
14
+ export {
15
+ O as default
16
+ };
@@ -0,0 +1,64 @@
1
+ const x = Math.PI, c = 2 * x, d = 1e-6, m = c - d;
2
+ function E(l) {
3
+ this._ += l[0];
4
+ for (let t = 1, h = l.length; t < h; ++t)
5
+ this._ += arguments[t] + l[t];
6
+ }
7
+ function q(l) {
8
+ let t = Math.floor(l);
9
+ if (!(t >= 0)) throw new Error(`invalid digits: ${l}`);
10
+ if (t > 15) return E;
11
+ const h = 10 ** t;
12
+ return function(i) {
13
+ this._ += i[0];
14
+ for (let s = 1, _ = i.length; s < _; ++s)
15
+ this._ += Math.round(arguments[s] * h) / h + i[s];
16
+ };
17
+ }
18
+ class C {
19
+ constructor(t) {
20
+ this._x0 = this._y0 = // start of current subpath
21
+ this._x1 = this._y1 = null, this._ = "", this._append = t == null ? E : q(t);
22
+ }
23
+ moveTo(t, h) {
24
+ this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}`;
25
+ }
26
+ closePath() {
27
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
28
+ }
29
+ lineTo(t, h) {
30
+ this._append`L${this._x1 = +t},${this._y1 = +h}`;
31
+ }
32
+ quadraticCurveTo(t, h, i, s) {
33
+ this._append`Q${+t},${+h},${this._x1 = +i},${this._y1 = +s}`;
34
+ }
35
+ bezierCurveTo(t, h, i, s, _, n) {
36
+ this._append`C${+t},${+h},${+i},${+s},${this._x1 = +_},${this._y1 = +n}`;
37
+ }
38
+ arcTo(t, h, i, s, _) {
39
+ if (t = +t, h = +h, i = +i, s = +s, _ = +_, _ < 0) throw new Error(`negative radius: ${_}`);
40
+ let n = this._x1, u = this._y1, o = i - t, a = s - h, e = n - t, p = u - h, $ = e * e + p * p;
41
+ if (this._x1 === null)
42
+ this._append`M${this._x1 = t},${this._y1 = h}`;
43
+ else if ($ > d) if (!(Math.abs(p * o - a * e) > d) || !_)
44
+ this._append`L${this._x1 = t},${this._y1 = h}`;
45
+ else {
46
+ let f = i - n, M = s - u, y = o * o + a * a, L = f * f + M * M, v = Math.sqrt(y), b = Math.sqrt($), T = _ * Math.tan((x - Math.acos((y + $ - L) / (2 * v * b))) / 2), r = T / b, A = T / v;
47
+ Math.abs(r - 1) > d && this._append`L${t + r * e},${h + r * p}`, this._append`A${_},${_},0,0,${+(p * f > e * M)},${this._x1 = t + A * o},${this._y1 = h + A * a}`;
48
+ }
49
+ }
50
+ arc(t, h, i, s, _, n) {
51
+ if (t = +t, h = +h, i = +i, n = !!n, i < 0) throw new Error(`negative radius: ${i}`);
52
+ let u = i * Math.cos(s), o = i * Math.sin(s), a = t + u, e = h + o, p = 1 ^ n, $ = n ? s - _ : _ - s;
53
+ this._x1 === null ? this._append`M${a},${e}` : (Math.abs(this._x1 - a) > d || Math.abs(this._y1 - e) > d) && this._append`L${a},${e}`, i && ($ < 0 && ($ = $ % c + c), $ > m ? this._append`A${i},${i},0,1,${p},${t - u},${h - o}A${i},${i},0,1,${p},${this._x1 = a},${this._y1 = e}` : $ > d && this._append`A${i},${i},0,${+($ >= x)},${p},${this._x1 = t + i * Math.cos(_)},${this._y1 = h + i * Math.sin(_)}`);
54
+ }
55
+ rect(t, h, i, s) {
56
+ this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}h${i = +i}v${+s}h${-i}Z`;
57
+ }
58
+ toString() {
59
+ return this._;
60
+ }
61
+ }
62
+ export {
63
+ C as Path
64
+ };
@@ -0,0 +1,41 @@
1
+ import { initRange as v } from "./init.js";
2
+ import w from "./ordinal.js";
3
+ import b from "../../d3-array/src/range.js";
4
+ function x() {
5
+ var r = w().unknown(void 0), f = r.domain, c = r.range, t = 0, e = 1, i, m, o = !1, u = 0, g = 0, l = 0.5;
6
+ delete r.unknown;
7
+ function a() {
8
+ var n = f().length, s = e < t, d = s ? e : t, h = s ? t : e;
9
+ i = (h - d) / Math.max(1, n - u + g * 2), o && (i = Math.floor(i)), d += (h - d - i * (n - u)) * l, m = i * (1 - u), o && (d = Math.round(d), m = Math.round(m));
10
+ var p = b(n).map(function(M) {
11
+ return d + i * M;
12
+ });
13
+ return c(s ? p.reverse() : p);
14
+ }
15
+ return r.domain = function(n) {
16
+ return arguments.length ? (f(n), a()) : f();
17
+ }, r.range = function(n) {
18
+ return arguments.length ? ([t, e] = n, t = +t, e = +e, a()) : [t, e];
19
+ }, r.rangeRound = function(n) {
20
+ return [t, e] = n, t = +t, e = +e, o = !0, a();
21
+ }, r.bandwidth = function() {
22
+ return m;
23
+ }, r.step = function() {
24
+ return i;
25
+ }, r.round = function(n) {
26
+ return arguments.length ? (o = !!n, a()) : o;
27
+ }, r.padding = function(n) {
28
+ return arguments.length ? (u = Math.min(1, g = +n), a()) : u;
29
+ }, r.paddingInner = function(n) {
30
+ return arguments.length ? (u = Math.min(1, n), a()) : u;
31
+ }, r.paddingOuter = function(n) {
32
+ return arguments.length ? (g = +n, a()) : g;
33
+ }, r.align = function(n) {
34
+ return arguments.length ? (l = Math.max(0, Math.min(1, n)), a()) : l;
35
+ }, r.copy = function() {
36
+ return x(f(), [t, e]).round(o).paddingInner(u).paddingOuter(g).align(l);
37
+ }, v.apply(a(), arguments);
38
+ }
39
+ export {
40
+ x as default
41
+ };
@@ -0,0 +1,8 @@
1
+ function t(n) {
2
+ return function() {
3
+ return n;
4
+ };
5
+ }
6
+ export {
7
+ t as default
8
+ };
@@ -0,0 +1,75 @@
1
+ import w from "./constant.js";
2
+ import y from "./number.js";
3
+ import N from "../../d3-interpolate/src/number.js";
4
+ import A from "../../d3-interpolate/src/value.js";
5
+ import { bisectRight as k } from "../../d3-array/src/bisect.js";
6
+ import M from "../../d3-interpolate/src/round.js";
7
+ var h = [0, 1];
8
+ function p(n) {
9
+ return n;
10
+ }
11
+ function g(n, r) {
12
+ return (r -= n = +n) ? function(i) {
13
+ return (i - n) / r;
14
+ } : w(isNaN(r) ? NaN : 0.5);
15
+ }
16
+ function d(n, r) {
17
+ var i;
18
+ return n > r && (i = n, n = r, r = i), function(e) {
19
+ return Math.max(n, Math.min(r, e));
20
+ };
21
+ }
22
+ function R(n, r, i) {
23
+ var e = n[0], a = n[1], o = r[0], u = r[1];
24
+ return a < e ? (e = g(a, e), o = i(u, o)) : (e = g(e, a), o = i(o, u)), function(l) {
25
+ return o(e(l));
26
+ };
27
+ }
28
+ function j(n, r, i) {
29
+ var e = Math.min(n.length, r.length) - 1, a = new Array(e), o = new Array(e), u = -1;
30
+ for (n[e] < n[0] && (n = n.slice().reverse(), r = r.slice().reverse()); ++u < e; )
31
+ a[u] = g(n[u], n[u + 1]), o[u] = i(r[u], r[u + 1]);
32
+ return function(l) {
33
+ var m = k(n, l, 1, e) - 1;
34
+ return o[m](a[m](l));
35
+ };
36
+ }
37
+ function F(n, r) {
38
+ return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown());
39
+ }
40
+ function z() {
41
+ var n = h, r = h, i = A, e, a, o, u = p, l, m, s;
42
+ function c() {
43
+ var t = Math.min(n.length, r.length);
44
+ return u !== p && (u = d(n[0], n[t - 1])), l = t > 2 ? j : R, m = s = null, f;
45
+ }
46
+ function f(t) {
47
+ return t == null || isNaN(t = +t) ? o : (m || (m = l(n.map(e), r, i)))(e(u(t)));
48
+ }
49
+ return f.invert = function(t) {
50
+ return u(a((s || (s = l(r, n.map(e), N)))(t)));
51
+ }, f.domain = function(t) {
52
+ return arguments.length ? (n = Array.from(t, y), c()) : n.slice();
53
+ }, f.range = function(t) {
54
+ return arguments.length ? (r = Array.from(t), c()) : r.slice();
55
+ }, f.rangeRound = function(t) {
56
+ return r = Array.from(t), i = M, c();
57
+ }, f.clamp = function(t) {
58
+ return arguments.length ? (u = t ? !0 : p, c()) : u !== p;
59
+ }, f.interpolate = function(t) {
60
+ return arguments.length ? (i = t, c()) : i;
61
+ }, f.unknown = function(t) {
62
+ return arguments.length ? (o = t, f) : o;
63
+ }, function(t, v) {
64
+ return e = t, a = v, c();
65
+ };
66
+ }
67
+ function G() {
68
+ return z()(p, p);
69
+ }
70
+ export {
71
+ F as copy,
72
+ G as default,
73
+ p as identity,
74
+ z as transformer
75
+ };
@@ -0,0 +1,16 @@
1
+ function a(e, t) {
2
+ switch (arguments.length) {
3
+ case 0:
4
+ break;
5
+ case 1:
6
+ this.range(e);
7
+ break;
8
+ default:
9
+ this.range(t).domain(e);
10
+ break;
11
+ }
12
+ return this;
13
+ }
14
+ export {
15
+ a as initRange
16
+ };
@@ -0,0 +1,39 @@
1
+ import p, { copy as v } from "./continuous.js";
2
+ import { initRange as c } from "./init.js";
3
+ import h from "./tickFormat.js";
4
+ import s, { tickIncrement as d } from "../../d3-array/src/ticks.js";
5
+ function k(i) {
6
+ var f = i.domain;
7
+ return i.ticks = function(n) {
8
+ var t = f();
9
+ return s(t[0], t[t.length - 1], n ?? 10);
10
+ }, i.tickFormat = function(n, t) {
11
+ var o = f();
12
+ return h(o[0], o[o.length - 1], n ?? 10, t);
13
+ }, i.nice = function(n) {
14
+ n == null && (n = 10);
15
+ var t = f(), o = 0, l = t.length - 1, e = t[o], a = t[l], u, r, m = 10;
16
+ for (a < e && (r = e, e = a, a = r, r = o, o = l, l = r); m-- > 0; ) {
17
+ if (r = d(e, a, n), r === u)
18
+ return t[o] = e, t[l] = a, f(t);
19
+ if (r > 0)
20
+ e = Math.floor(e / r) * r, a = Math.ceil(a / r) * r;
21
+ else if (r < 0)
22
+ e = Math.ceil(e * r) / r, a = Math.floor(a * r) / r;
23
+ else
24
+ break;
25
+ u = r;
26
+ }
27
+ return i;
28
+ }, i;
29
+ }
30
+ function g() {
31
+ var i = p();
32
+ return i.copy = function() {
33
+ return v(i, g());
34
+ }, c.apply(i, arguments), k(i);
35
+ }
36
+ export {
37
+ g as default,
38
+ k as linearish
39
+ };
@@ -0,0 +1,86 @@
1
+ import E from "./nice.js";
2
+ import { transformer as v, copy as F } from "./continuous.js";
3
+ import { initRange as L } from "./init.js";
4
+ import d from "../../d3-array/src/ticks.js";
5
+ import j from "../../d3-format/src/formatSpecifier.js";
6
+ import { format as z } from "../../d3-format/src/defaultLocale.js";
7
+ function y(t) {
8
+ return Math.log(t);
9
+ }
10
+ function w(t) {
11
+ return Math.exp(t);
12
+ }
13
+ function I(t) {
14
+ return -Math.log(-t);
15
+ }
16
+ function R(t) {
17
+ return -Math.exp(-t);
18
+ }
19
+ function S(t) {
20
+ return isFinite(t) ? +("1e" + t) : t < 0 ? 0 : t;
21
+ }
22
+ function q(t) {
23
+ return t === 10 ? S : t === Math.E ? Math.exp : (n) => Math.pow(t, n);
24
+ }
25
+ function A(t) {
26
+ return t === Math.E ? Math.log : t === 10 && Math.log10 || t === 2 && Math.log2 || (t = Math.log(t), (n) => Math.log(n) / t);
27
+ }
28
+ function x(t) {
29
+ return (n, m) => -t(-n, m);
30
+ }
31
+ function B(t) {
32
+ const n = t(y, w), m = n.domain;
33
+ let l = 10, h, i;
34
+ function k() {
35
+ return h = A(l), i = q(l), m()[0] < 0 ? (h = x(h), i = x(i), t(I, R)) : t(y, w), n;
36
+ }
37
+ return n.base = function(o) {
38
+ return arguments.length ? (l = +o, k()) : l;
39
+ }, n.domain = function(o) {
40
+ return arguments.length ? (m(o), k()) : m();
41
+ }, n.ticks = (o) => {
42
+ const e = m();
43
+ let u = e[0], f = e[e.length - 1];
44
+ const M = f < u;
45
+ M && ([u, f] = [f, u]);
46
+ let r = h(u), g = h(f), a, c;
47
+ const p = o == null ? 10 : +o;
48
+ let s = [];
49
+ if (!(l % 1) && g - r < p) {
50
+ if (r = Math.floor(r), g = Math.ceil(g), u > 0) {
51
+ for (; r <= g; ++r)
52
+ for (a = 1; a < l; ++a)
53
+ if (c = r < 0 ? a / i(-r) : a * i(r), !(c < u)) {
54
+ if (c > f) break;
55
+ s.push(c);
56
+ }
57
+ } else for (; r <= g; ++r)
58
+ for (a = l - 1; a >= 1; --a)
59
+ if (c = r > 0 ? a / i(-r) : a * i(r), !(c < u)) {
60
+ if (c > f) break;
61
+ s.push(c);
62
+ }
63
+ s.length * 2 < p && (s = d(u, f, p));
64
+ } else
65
+ s = d(r, g, Math.min(g - r, p)).map(i);
66
+ return M ? s.reverse() : s;
67
+ }, n.tickFormat = (o, e) => {
68
+ if (o == null && (o = 10), e == null && (e = l === 10 ? "s" : ","), typeof e != "function" && (!(l % 1) && (e = j(e)).precision == null && (e.trim = !0), e = z(e)), o === 1 / 0) return e;
69
+ const u = Math.max(1, l * o / n.ticks().length);
70
+ return (f) => {
71
+ let M = f / i(Math.round(h(f)));
72
+ return M * l < l - 0.5 && (M *= l), M <= u ? e(f) : "";
73
+ };
74
+ }, n.nice = () => m(E(m(), {
75
+ floor: (o) => i(Math.floor(h(o))),
76
+ ceil: (o) => i(Math.ceil(h(o)))
77
+ })), n;
78
+ }
79
+ function C() {
80
+ const t = B(v()).domain([1, 10]);
81
+ return t.copy = () => F(t, C()).base(t.base()), L.apply(t, arguments), t;
82
+ }
83
+ export {
84
+ C as default,
85
+ B as loggish
86
+ };
@@ -0,0 +1,8 @@
1
+ function x(e, u) {
2
+ e = e.slice();
3
+ var t = 0, c = e.length - 1, f = e[t], l = e[c], r;
4
+ return l < f && (r = t, t = c, c = r, r = f, f = l, l = r), e[t] = u.floor(f), e[c] = u.ceil(l), e;
5
+ }
6
+ export {
7
+ x as default
8
+ };
@@ -0,0 +1,6 @@
1
+ function n(e) {
2
+ return +e;
3
+ }
4
+ export {
5
+ n as default
6
+ };
@@ -0,0 +1,31 @@
1
+ import { initRange as c } from "./init.js";
2
+ import { InternMap as a } from "../../internmap/src/index.js";
3
+ const f = /* @__PURE__ */ Symbol("implicit");
4
+ function l() {
5
+ var r = new a(), i = [], u = [], o = f;
6
+ function n(t) {
7
+ let e = r.get(t);
8
+ if (e === void 0) {
9
+ if (o !== f) return o;
10
+ r.set(t, e = i.push(t) - 1);
11
+ }
12
+ return u[e % u.length];
13
+ }
14
+ return n.domain = function(t) {
15
+ if (!arguments.length) return i.slice();
16
+ i = [], r = new a();
17
+ for (const e of t)
18
+ r.has(e) || r.set(e, i.push(e) - 1);
19
+ return n;
20
+ }, n.range = function(t) {
21
+ return arguments.length ? (u = Array.from(t), n) : u.slice();
22
+ }, n.unknown = function(t) {
23
+ return arguments.length ? (o = t, n) : o;
24
+ }, n.copy = function() {
25
+ return l(i, u).unknown(o);
26
+ }, c.apply(n, arguments), n;
27
+ }
28
+ export {
29
+ l as default,
30
+ f as implicit
31
+ };
@@ -0,0 +1,32 @@
1
+ import s from "../../d3-format/src/formatSpecifier.js";
2
+ import c from "../../d3-format/src/precisionFixed.js";
3
+ import { tickStep as e } from "../../d3-array/src/ticks.js";
4
+ import p from "../../d3-format/src/precisionRound.js";
5
+ import l from "../../d3-format/src/precisionPrefix.js";
6
+ import { formatPrefix as u, format as h } from "../../d3-format/src/defaultLocale.js";
7
+ function d(r, t, i, a) {
8
+ var n = e(r, t, i), o;
9
+ switch (a = s(a ?? ",f"), a.type) {
10
+ case "s": {
11
+ var m = Math.max(Math.abs(r), Math.abs(t));
12
+ return a.precision == null && !isNaN(o = l(n, m)) && (a.precision = o), u(a, m);
13
+ }
14
+ case "":
15
+ case "e":
16
+ case "g":
17
+ case "p":
18
+ case "r": {
19
+ a.precision == null && !isNaN(o = p(n, Math.max(Math.abs(r), Math.abs(t)))) && (a.precision = o - (a.type === "e"));
20
+ break;
21
+ }
22
+ case "f":
23
+ case "%": {
24
+ a.precision == null && !isNaN(o = c(n)) && (a.precision = o - (a.type === "%") * 2);
25
+ break;
26
+ }
27
+ }
28
+ return h(a);
29
+ }
30
+ export {
31
+ d as default
32
+ };
@@ -0,0 +1,56 @@
1
+ import z from "./array.js";
2
+ import i from "./constant.js";
3
+ import A from "./curve/linear.js";
4
+ import X from "./line.js";
5
+ import { withPath as Y } from "./path.js";
6
+ import { x as b, y as j } from "./point.js";
7
+ function C(u, f, o) {
8
+ var c = null, g = i(!0), l = null, a = A, r = null, x = Y(t);
9
+ u = typeof u == "function" ? u : u === void 0 ? b : i(+u), f = typeof f == "function" ? f : f === void 0 ? i(0) : i(+f), o = typeof o == "function" ? o : o === void 0 ? j : i(+o);
10
+ function t(n) {
11
+ var e, S, m, h = (n = z(n)).length, p, s = !1, v, w = new Array(h), E = new Array(h);
12
+ for (l == null && (r = a(v = x())), e = 0; e <= h; ++e) {
13
+ if (!(e < h && g(p = n[e], e, n)) === s)
14
+ if (s = !s)
15
+ S = e, r.areaStart(), r.lineStart();
16
+ else {
17
+ for (r.lineEnd(), r.lineStart(), m = e - 1; m >= S; --m)
18
+ r.point(w[m], E[m]);
19
+ r.lineEnd(), r.areaEnd();
20
+ }
21
+ s && (w[e] = +u(p, e, n), E[e] = +f(p, e, n), r.point(c ? +c(p, e, n) : w[e], o ? +o(p, e, n) : E[e]));
22
+ }
23
+ if (v) return r = null, v + "" || null;
24
+ }
25
+ function d() {
26
+ return X().defined(g).curve(a).context(l);
27
+ }
28
+ return t.x = function(n) {
29
+ return arguments.length ? (u = typeof n == "function" ? n : i(+n), c = null, t) : u;
30
+ }, t.x0 = function(n) {
31
+ return arguments.length ? (u = typeof n == "function" ? n : i(+n), t) : u;
32
+ }, t.x1 = function(n) {
33
+ return arguments.length ? (c = n == null ? null : typeof n == "function" ? n : i(+n), t) : c;
34
+ }, t.y = function(n) {
35
+ return arguments.length ? (f = typeof n == "function" ? n : i(+n), o = null, t) : f;
36
+ }, t.y0 = function(n) {
37
+ return arguments.length ? (f = typeof n == "function" ? n : i(+n), t) : f;
38
+ }, t.y1 = function(n) {
39
+ return arguments.length ? (o = n == null ? null : typeof n == "function" ? n : i(+n), t) : o;
40
+ }, t.lineX0 = t.lineY0 = function() {
41
+ return d().x(u).y(f);
42
+ }, t.lineY1 = function() {
43
+ return d().x(u).y(o);
44
+ }, t.lineX1 = function() {
45
+ return d().x(c).y(f);
46
+ }, t.defined = function(n) {
47
+ return arguments.length ? (g = typeof n == "function" ? n : i(!!n), t) : g;
48
+ }, t.curve = function(n) {
49
+ return arguments.length ? (a = n, l != null && (r = a(l)), t) : a;
50
+ }, t.context = function(n) {
51
+ return arguments.length ? (n == null ? l = r = null : r = a(l = n), t) : l;
52
+ }, t;
53
+ }
54
+ export {
55
+ C as default
56
+ };
@@ -0,0 +1,6 @@
1
+ function t(r) {
2
+ return typeof r == "object" && "length" in r ? r : Array.from(r);
3
+ }
4
+ export {
5
+ t as default
6
+ };
@@ -0,0 +1,8 @@
1
+ function o(n) {
2
+ return function() {
3
+ return n;
4
+ };
5
+ }
6
+ export {
7
+ o as default
8
+ };
@@ -0,0 +1,39 @@
1
+ class s {
2
+ constructor(t, i) {
3
+ this._context = t, this._x = i;
4
+ }
5
+ areaStart() {
6
+ this._line = 0;
7
+ }
8
+ areaEnd() {
9
+ this._line = NaN;
10
+ }
11
+ lineStart() {
12
+ this._point = 0;
13
+ }
14
+ lineEnd() {
15
+ (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
16
+ }
17
+ point(t, i) {
18
+ switch (t = +t, i = +i, this._point) {
19
+ case 0: {
20
+ this._point = 1, this._line ? this._context.lineTo(t, i) : this._context.moveTo(t, i);
21
+ break;
22
+ }
23
+ case 1:
24
+ this._point = 2;
25
+ // falls through
26
+ default: {
27
+ 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);
28
+ break;
29
+ }
30
+ }
31
+ this._x0 = t, this._y0 = i;
32
+ }
33
+ }
34
+ function h(e) {
35
+ return new s(e, !0);
36
+ }
37
+ export {
38
+ h as bumpX
39
+ };
@@ -0,0 +1,36 @@
1
+ function n(t) {
2
+ this._context = t;
3
+ }
4
+ n.prototype = {
5
+ areaStart: function() {
6
+ this._line = 0;
7
+ },
8
+ areaEnd: function() {
9
+ this._line = NaN;
10
+ },
11
+ lineStart: function() {
12
+ this._point = 0;
13
+ },
14
+ lineEnd: function() {
15
+ (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
16
+ },
17
+ point: function(t, i) {
18
+ switch (t = +t, i = +i, this._point) {
19
+ case 0:
20
+ this._point = 1, this._line ? this._context.lineTo(t, i) : this._context.moveTo(t, i);
21
+ break;
22
+ case 1:
23
+ this._point = 2;
24
+ // falls through
25
+ default:
26
+ this._context.lineTo(t, i);
27
+ break;
28
+ }
29
+ }
30
+ };
31
+ function e(t) {
32
+ return new n(t);
33
+ }
34
+ export {
35
+ e as default
36
+ };