@ledgerhq/lumen-ui-react-visualization 0.1.2 → 0.1.4

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 (123) hide show
  1. package/dist/lib/Components/Axis/Axis.types.d.ts +33 -0
  2. package/dist/lib/Components/Axis/Axis.types.d.ts.map +1 -0
  3. package/dist/lib/Components/Axis/XAxis/XAxis.d.ts +4 -0
  4. package/dist/lib/Components/Axis/XAxis/XAxis.d.ts.map +1 -0
  5. package/dist/lib/Components/Axis/XAxis/XAxis.js +84 -0
  6. package/dist/lib/Components/Axis/XAxis/index.d.ts +3 -0
  7. package/dist/lib/Components/Axis/XAxis/index.d.ts.map +1 -0
  8. package/dist/lib/Components/Axis/XAxis/types.d.ts +9 -0
  9. package/dist/lib/Components/Axis/XAxis/types.d.ts.map +1 -0
  10. package/dist/lib/Components/Axis/YAxis/YAxis.d.ts +4 -0
  11. package/dist/lib/Components/Axis/YAxis/YAxis.d.ts.map +1 -0
  12. package/dist/lib/Components/Axis/YAxis/YAxis.js +81 -0
  13. package/dist/lib/Components/Axis/YAxis/index.d.ts +3 -0
  14. package/dist/lib/Components/Axis/YAxis/index.d.ts.map +1 -0
  15. package/dist/lib/Components/Axis/YAxis/types.d.ts +14 -0
  16. package/dist/lib/Components/Axis/YAxis/types.d.ts.map +1 -0
  17. package/dist/lib/Components/CartesianChart/CartesianChart.d.ts +3 -0
  18. package/dist/lib/Components/CartesianChart/CartesianChart.d.ts.map +1 -0
  19. package/dist/lib/Components/CartesianChart/CartesianChart.js +79 -0
  20. package/dist/lib/Components/CartesianChart/context/cartesianChartContext.d.ts +8 -0
  21. package/dist/lib/Components/CartesianChart/context/cartesianChartContext.d.ts.map +1 -0
  22. package/dist/lib/Components/CartesianChart/context/cartesianChartContext.js +9 -0
  23. package/dist/lib/Components/CartesianChart/context/index.d.ts +3 -0
  24. package/dist/lib/Components/CartesianChart/context/index.d.ts.map +1 -0
  25. package/dist/lib/Components/CartesianChart/context/useBuildChartContext.d.ts +23 -0
  26. package/dist/lib/Components/CartesianChart/context/useBuildChartContext.d.ts.map +1 -0
  27. package/dist/lib/Components/CartesianChart/context/useBuildChartContext.js +61 -0
  28. package/dist/lib/Components/CartesianChart/index.d.ts +4 -0
  29. package/dist/lib/Components/CartesianChart/index.d.ts.map +1 -0
  30. package/dist/lib/Components/CartesianChart/types.d.ts +48 -0
  31. package/dist/lib/Components/CartesianChart/types.d.ts.map +1 -0
  32. package/dist/lib/Components/Line/Line.d.ts +3 -0
  33. package/dist/lib/Components/Line/Line.d.ts.map +1 -0
  34. package/dist/lib/Components/Line/Line.js +73 -0
  35. package/dist/lib/Components/Line/index.d.ts +3 -0
  36. package/dist/lib/Components/Line/index.d.ts.map +1 -0
  37. package/dist/lib/Components/Line/types.d.ts +24 -0
  38. package/dist/lib/Components/Line/types.d.ts.map +1 -0
  39. package/dist/lib/Components/Line/utils.d.ts +19 -0
  40. package/dist/lib/Components/Line/utils.d.ts.map +1 -0
  41. package/dist/lib/Components/Line/utils.js +22 -0
  42. package/dist/lib/Components/LineChart/LineChart.d.ts +2 -8
  43. package/dist/lib/Components/LineChart/LineChart.d.ts.map +1 -1
  44. package/dist/lib/Components/LineChart/LineChart.js +79 -23
  45. package/dist/lib/Components/LineChart/index.d.ts +1 -0
  46. package/dist/lib/Components/LineChart/index.d.ts.map +1 -1
  47. package/dist/lib/Components/LineChart/types.d.ts +63 -0
  48. package/dist/lib/Components/LineChart/types.d.ts.map +1 -0
  49. package/dist/lib/utils/domain/domain.d.ts +17 -0
  50. package/dist/lib/utils/domain/domain.d.ts.map +1 -0
  51. package/dist/lib/utils/domain/domain.js +38 -0
  52. package/dist/lib/utils/index.d.ts +1 -1
  53. package/dist/lib/utils/index.d.ts.map +1 -1
  54. package/dist/lib/utils/scales/scales.d.ts +24 -0
  55. package/dist/lib/utils/scales/scales.d.ts.map +1 -0
  56. package/dist/lib/utils/scales/scales.js +25 -0
  57. package/dist/lib/utils/ticks/ticks.d.ts +27 -0
  58. package/dist/lib/utils/ticks/ticks.d.ts.map +1 -0
  59. package/dist/lib/utils/ticks/ticks.js +23 -0
  60. package/dist/lib/utils/types.d.ts +90 -6
  61. package/dist/lib/utils/types.d.ts.map +1 -1
  62. package/dist/libs/ui-react/dist/lib/Components/ThemeProvider/ThemeProvider.js +8 -0
  63. package/dist/libs/ui-react/dist/libs/utils-shared/dist/index.js +35 -0
  64. package/dist/libs/utils-shared/dist/index.js +35 -0
  65. package/dist/node_modules/d3-array/src/ascending.js +6 -0
  66. package/dist/node_modules/d3-array/src/bisect.js +9 -0
  67. package/dist/node_modules/d3-array/src/bisector.js +37 -0
  68. package/dist/node_modules/d3-array/src/descending.js +6 -0
  69. package/dist/node_modules/d3-array/src/number.js +6 -0
  70. package/dist/node_modules/d3-array/src/range.js +9 -0
  71. package/dist/node_modules/d3-array/src/ticks.js +32 -0
  72. package/dist/node_modules/d3-color/src/color.js +305 -0
  73. package/dist/node_modules/d3-color/src/define.js +12 -0
  74. package/dist/node_modules/d3-format/src/defaultLocale.js +15 -0
  75. package/dist/node_modules/d3-format/src/exponent.js +7 -0
  76. package/dist/node_modules/d3-format/src/formatDecimal.js +15 -0
  77. package/dist/node_modules/d3-format/src/formatGroup.js +10 -0
  78. package/dist/node_modules/d3-format/src/formatNumerals.js +10 -0
  79. package/dist/node_modules/d3-format/src/formatPrefixAuto.js +12 -0
  80. package/dist/node_modules/d3-format/src/formatRounded.js +10 -0
  81. package/dist/node_modules/d3-format/src/formatSpecifier.js +28 -0
  82. package/dist/node_modules/d3-format/src/formatTrim.js +19 -0
  83. package/dist/node_modules/d3-format/src/formatTypes.js +21 -0
  84. package/dist/node_modules/d3-format/src/identity.js +6 -0
  85. package/dist/node_modules/d3-format/src/locale.js +68 -0
  86. package/dist/node_modules/d3-format/src/precisionFixed.js +7 -0
  87. package/dist/node_modules/d3-format/src/precisionPrefix.js +7 -0
  88. package/dist/node_modules/d3-format/src/precisionRound.js +7 -0
  89. package/dist/node_modules/d3-interpolate/src/array.js +13 -0
  90. package/dist/node_modules/d3-interpolate/src/color.js +24 -0
  91. package/dist/node_modules/d3-interpolate/src/constant.js +4 -0
  92. package/dist/node_modules/d3-interpolate/src/date.js +9 -0
  93. package/dist/node_modules/d3-interpolate/src/number.js +8 -0
  94. package/dist/node_modules/d3-interpolate/src/numberArray.js +15 -0
  95. package/dist/node_modules/d3-interpolate/src/object.js +14 -0
  96. package/dist/node_modules/d3-interpolate/src/rgb.js +15 -0
  97. package/dist/node_modules/d3-interpolate/src/round.js +8 -0
  98. package/dist/node_modules/d3-interpolate/src/string.js +24 -0
  99. package/dist/node_modules/d3-interpolate/src/value.js +16 -0
  100. package/dist/node_modules/d3-path/src/path.js +64 -0
  101. package/dist/node_modules/d3-scale/src/band.js +41 -0
  102. package/dist/node_modules/d3-scale/src/constant.js +8 -0
  103. package/dist/node_modules/d3-scale/src/continuous.js +75 -0
  104. package/dist/node_modules/d3-scale/src/init.js +16 -0
  105. package/dist/node_modules/d3-scale/src/linear.js +39 -0
  106. package/dist/node_modules/d3-scale/src/log.js +86 -0
  107. package/dist/node_modules/d3-scale/src/nice.js +8 -0
  108. package/dist/node_modules/d3-scale/src/number.js +6 -0
  109. package/dist/node_modules/d3-scale/src/ordinal.js +31 -0
  110. package/dist/node_modules/d3-scale/src/tickFormat.js +32 -0
  111. package/dist/node_modules/d3-shape/src/area.js +56 -0
  112. package/dist/node_modules/d3-shape/src/array.js +6 -0
  113. package/dist/node_modules/d3-shape/src/constant.js +8 -0
  114. package/dist/node_modules/d3-shape/src/curve/bump.js +39 -0
  115. package/dist/node_modules/d3-shape/src/curve/linear.js +36 -0
  116. package/dist/node_modules/d3-shape/src/line.js +29 -0
  117. package/dist/node_modules/d3-shape/src/path.js +18 -0
  118. package/dist/node_modules/d3-shape/src/point.js +10 -0
  119. package/dist/node_modules/internmap/src/index.js +35 -0
  120. package/dist/package.json +15 -3
  121. package/package.json +13 -1
  122. package/dist/lib/utils/math/index.d.ts +0 -1
  123. package/dist/lib/utils/math/index.d.ts.map +0 -1
@@ -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
+ };
@@ -0,0 +1,29 @@
1
+ import d from "./array.js";
2
+ import o from "./constant.js";
3
+ import a from "./curve/linear.js";
4
+ import { withPath as v } from "./path.js";
5
+ import { x as b, y as w } from "./point.js";
6
+ function j(e, r) {
7
+ var m = o(!0), i = null, l = a, u = null, s = v(t);
8
+ e = typeof e == "function" ? e : e === void 0 ? b : o(e), r = typeof r == "function" ? r : r === void 0 ? w : o(r);
9
+ function t(n) {
10
+ var f, h = (n = d(n)).length, p, c = !1, g;
11
+ for (i == null && (u = l(g = s())), f = 0; f <= h; ++f)
12
+ !(f < h && m(p = n[f], f, n)) === c && ((c = !c) ? u.lineStart() : u.lineEnd()), c && u.point(+e(p, f, n), +r(p, f, n));
13
+ if (g) return u = null, g + "" || null;
14
+ }
15
+ return t.x = function(n) {
16
+ return arguments.length ? (e = typeof n == "function" ? n : o(+n), t) : e;
17
+ }, t.y = function(n) {
18
+ return arguments.length ? (r = typeof n == "function" ? n : o(+n), t) : r;
19
+ }, t.defined = function(n) {
20
+ return arguments.length ? (m = typeof n == "function" ? n : o(!!n), t) : m;
21
+ }, t.curve = function(n) {
22
+ return arguments.length ? (l = n, i != null && (u = l(i)), t) : l;
23
+ }, t.context = function(n) {
24
+ return arguments.length ? (n == null ? i = u = null : u = l(i = n), t) : i;
25
+ }, t;
26
+ }
27
+ export {
28
+ j as default
29
+ };
@@ -0,0 +1,18 @@
1
+ import { Path as e } from "../../d3-path/src/path.js";
2
+ function l(i) {
3
+ let t = 3;
4
+ return i.digits = function(n) {
5
+ if (!arguments.length) return t;
6
+ if (n == null)
7
+ t = null;
8
+ else {
9
+ const r = Math.floor(n);
10
+ if (!(r >= 0)) throw new RangeError(`invalid digits: ${n}`);
11
+ t = r;
12
+ }
13
+ return i;
14
+ }, () => new e(t);
15
+ }
16
+ export {
17
+ l as withPath
18
+ };
@@ -0,0 +1,10 @@
1
+ function r(n) {
2
+ return n[0];
3
+ }
4
+ function t(n) {
5
+ return n[1];
6
+ }
7
+ export {
8
+ r as x,
9
+ t as y
10
+ };
@@ -0,0 +1,35 @@
1
+ class i extends Map {
2
+ constructor(t, s = f) {
3
+ if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: s } }), t != null) for (const [r, o] of t) this.set(r, o);
4
+ }
5
+ get(t) {
6
+ return super.get(n(this, t));
7
+ }
8
+ has(t) {
9
+ return super.has(n(this, t));
10
+ }
11
+ set(t, s) {
12
+ return super.set(u(this, t), s);
13
+ }
14
+ delete(t) {
15
+ return super.delete(c(this, t));
16
+ }
17
+ }
18
+ function n({ _intern: e, _key: t }, s) {
19
+ const r = t(s);
20
+ return e.has(r) ? e.get(r) : s;
21
+ }
22
+ function u({ _intern: e, _key: t }, s) {
23
+ const r = t(s);
24
+ return e.has(r) ? e.get(r) : (e.set(r, s), s);
25
+ }
26
+ function c({ _intern: e, _key: t }, s) {
27
+ const r = t(s);
28
+ return e.has(r) && (s = e.get(r), e.delete(r)), s;
29
+ }
30
+ function f(e) {
31
+ return e !== null && typeof e == "object" ? e.valueOf() : e;
32
+ }
33
+ export {
34
+ i as InternMap
35
+ };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react-visualization",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [
@@ -33,11 +33,23 @@
33
33
  ]
34
34
  },
35
35
  "peerDependencies": {
36
- "@ledgerhq/lumen-design-core": "0.1.10",
36
+ "@ledgerhq/lumen-design-core": "0.1.11",
37
+ "@ledgerhq/lumen-ui-react": "0.1.24",
37
38
  "class-variance-authority": "^0.7.1",
38
39
  "clsx": "^2.1.1",
39
40
  "react": "^18.0.0 || ^19.0.0",
40
41
  "react-dom": "^18.0.0 || ^19.0.0",
41
42
  "tailwind-merge": "^2.6.0"
43
+ },
44
+ "dependencies": {
45
+ "@ledgerhq/lumen-utils-shared": "0.1.3",
46
+ "d3-array": "^3.2.4",
47
+ "d3-scale": "^4.0.2",
48
+ "d3-shape": "^3.2.0"
49
+ },
50
+ "devDependencies": {
51
+ "@types/d3-array": "^3.2.2",
52
+ "@types/d3-scale": "^4.0.9",
53
+ "@types/d3-shape": "^3.1.8"
42
54
  }
43
- }
55
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react-visualization",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [
@@ -34,10 +34,22 @@
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@ledgerhq/lumen-design-core": "0.1.11",
37
+ "@ledgerhq/lumen-ui-react": "0.1.25",
37
38
  "class-variance-authority": "^0.7.1",
38
39
  "clsx": "^2.1.1",
39
40
  "react": "^18.0.0 || ^19.0.0",
40
41
  "react-dom": "^18.0.0 || ^19.0.0",
41
42
  "tailwind-merge": "^2.6.0"
43
+ },
44
+ "dependencies": {
45
+ "@ledgerhq/lumen-utils-shared": "0.1.3",
46
+ "d3-array": "^3.2.4",
47
+ "d3-scale": "^4.0.2",
48
+ "d3-shape": "^3.2.0"
49
+ },
50
+ "devDependencies": {
51
+ "@types/d3-array": "^3.2.2",
52
+ "@types/d3-scale": "^4.0.9",
53
+ "@types/d3-shape": "^3.1.8"
42
54
  }
43
55
  }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/math/index.ts"],"names":[],"mappings":""}