@ledgerhq/lumen-ui-react-visualization 0.1.15 → 0.1.17
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.
- package/dist/lib/Components/Axis/Axis.constants.d.ts +9 -0
- package/dist/lib/Components/Axis/Axis.constants.d.ts.map +1 -0
- package/dist/lib/Components/Axis/Axis.constants.js +24 -0
- package/dist/lib/Components/Axis/Axis.types.d.ts +37 -0
- package/dist/lib/Components/Axis/Axis.types.d.ts.map +1 -1
- package/dist/lib/Components/Axis/XAxis/XAxis.d.ts +0 -1
- package/dist/lib/Components/Axis/XAxis/XAxis.d.ts.map +1 -1
- package/dist/lib/Components/Axis/XAxis/XAxis.js +21 -22
- package/dist/lib/Components/Axis/XAxis/index.d.ts +1 -1
- package/dist/lib/Components/Axis/XAxis/index.d.ts.map +1 -1
- package/dist/lib/Components/Axis/YAxis/YAxis.d.ts +0 -1
- package/dist/lib/Components/Axis/YAxis/YAxis.d.ts.map +1 -1
- package/dist/lib/Components/Axis/YAxis/YAxis.js +16 -17
- package/dist/lib/Components/Axis/YAxis/index.d.ts +1 -1
- package/dist/lib/Components/Axis/YAxis/index.d.ts.map +1 -1
- package/dist/lib/Components/Axis/index.d.ts +3 -0
- package/dist/lib/Components/Axis/index.d.ts.map +1 -0
- package/dist/lib/Components/CartesianChart/CartesianChart.d.ts +1 -1
- package/dist/lib/Components/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/lib/Components/CartesianChart/CartesianChart.js +62 -58
- package/dist/lib/Components/CartesianChart/context/useBuildChartContext.d.ts +7 -4
- package/dist/lib/Components/CartesianChart/context/useBuildChartContext.d.ts.map +1 -1
- package/dist/lib/Components/CartesianChart/context/useBuildChartContext.js +31 -31
- package/dist/lib/Components/CartesianChart/types.d.ts +11 -3
- package/dist/lib/Components/CartesianChart/types.d.ts.map +1 -1
- package/dist/lib/Components/CartesianChart/utils.d.ts +19 -8
- package/dist/lib/Components/CartesianChart/utils.d.ts.map +1 -1
- package/dist/lib/Components/CartesianChart/utils.js +14 -15
- package/dist/lib/Components/Line/utils.d.ts +4 -0
- package/dist/lib/Components/Line/utils.d.ts.map +1 -1
- package/dist/lib/Components/Line/utils.js +15 -15
- package/dist/lib/Components/LineChart/LineChart.d.ts +1 -1
- package/dist/lib/Components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/lib/Components/LineChart/LineChart.js +64 -74
- package/dist/lib/Components/LineChart/__stories__/chartStoryFixtures.d.ts +46 -0
- package/dist/lib/Components/LineChart/__stories__/chartStoryFixtures.d.ts.map +1 -0
- package/dist/lib/Components/LineChart/__stories__/cryptoChartData.d.ts +85 -0
- package/dist/lib/Components/LineChart/__stories__/cryptoChartData.d.ts.map +1 -0
- package/dist/lib/Components/LineChart/types.d.ts +10 -3
- package/dist/lib/Components/LineChart/types.d.ts.map +1 -1
- package/dist/lib/Components/Point/Point.d.ts +1 -1
- package/dist/lib/Components/Point/Point.d.ts.map +1 -1
- package/dist/lib/Components/Point/Point.js +35 -30
- package/dist/lib/Components/Point/constants.d.ts +7 -0
- package/dist/lib/Components/Point/constants.d.ts.map +1 -0
- package/dist/lib/Components/Point/constants.js +9 -0
- package/dist/lib/Components/Point/pointContext/MagneticPointsProvider.d.ts +7 -0
- package/dist/lib/Components/Point/pointContext/MagneticPointsProvider.d.ts.map +1 -0
- package/dist/lib/Components/Point/pointContext/MagneticPointsProvider.js +19 -0
- package/dist/lib/Components/Point/pointContext/index.d.ts +3 -0
- package/dist/lib/Components/Point/pointContext/index.d.ts.map +1 -0
- package/dist/lib/Components/Point/pointContext/magneticPointsContext.d.ts +13 -0
- package/dist/lib/Components/Point/pointContext/magneticPointsContext.d.ts.map +1 -0
- package/dist/lib/Components/Point/pointContext/magneticPointsContext.js +9 -0
- package/dist/lib/Components/Point/types.d.ts +7 -0
- package/dist/lib/Components/Point/types.d.ts.map +1 -1
- package/dist/lib/Components/Point/utils.d.ts +8 -6
- package/dist/lib/Components/Point/utils.d.ts.map +1 -1
- package/dist/lib/Components/Point/utils.js +32 -20
- package/dist/lib/Components/ReferenceLine/constants.d.ts +1 -1
- package/dist/lib/Components/ReferenceLine/constants.d.ts.map +1 -1
- package/dist/lib/Components/ReferenceLine/utils.d.ts +3 -2
- package/dist/lib/Components/ReferenceLine/utils.d.ts.map +1 -1
- package/dist/lib/Components/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.js +14 -14
- package/dist/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.d.ts.map +1 -1
- package/dist/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.js +38 -38
- package/dist/lib/Components/Scrubber/DefaultScrubberTooltip/constants.d.ts +1 -2
- package/dist/lib/Components/Scrubber/DefaultScrubberTooltip/constants.d.ts.map +1 -1
- package/dist/lib/Components/Scrubber/DefaultScrubberTooltip/constants.js +8 -9
- package/dist/lib/Components/Scrubber/ScrubberProvider.d.ts +1 -1
- package/dist/lib/Components/Scrubber/ScrubberProvider.d.ts.map +1 -1
- package/dist/lib/Components/Scrubber/ScrubberProvider.js +97 -72
- package/dist/lib/Components/Scrubber/types.d.ts +6 -0
- package/dist/lib/Components/Scrubber/types.d.ts.map +1 -1
- package/dist/lib/Components/Scrubber/utils.d.ts +33 -3
- package/dist/lib/Components/Scrubber/utils.d.ts.map +1 -1
- package/dist/lib/Components/Scrubber/utils.js +71 -37
- package/dist/lib/utils/domain/domain.d.ts +5 -4
- package/dist/lib/utils/domain/domain.d.ts.map +1 -1
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/scales/scales.d.ts +11 -5
- package/dist/lib/utils/scales/scales.d.ts.map +1 -1
- package/dist/lib/utils/scales/scales.js +19 -15
- package/dist/lib/utils/ticks/ticks.d.ts +13 -5
- package/dist/lib/utils/ticks/ticks.d.ts.map +1 -1
- package/dist/lib/utils/ticks/ticks.js +20 -20
- package/dist/lib/utils/types.d.ts +3 -28
- package/dist/lib/utils/types.d.ts.map +1 -1
- package/dist/package.json +4 -4
- package/package.json +4 -4
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { isCategoricalScale as u, isNumericScale as g } from "../scales/scales.js";
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
if (
|
|
5
|
-
const
|
|
6
|
-
return String(t
|
|
2
|
+
const s = 5, f = (n, r, o) => r && r.length > 0 ? r : o && o.length > 0 ? typeof o[0] == "number" ? o : o.map((e, t) => t) : u(n) ? n.domain() : g(n) ? n.ticks(s) : [], d = (n, r) => u(n) ? (n(r) ?? 0) + n.bandwidth() / 2 : n(r), m = (n, r, o) => {
|
|
3
|
+
const e = r && Array.isArray(r) && typeof r[0] == "string";
|
|
4
|
+
if (o) {
|
|
5
|
+
const t = e && r[n] !== void 0 ? r[n] : n;
|
|
6
|
+
return String(o(t));
|
|
7
7
|
}
|
|
8
|
-
return
|
|
9
|
-
},
|
|
10
|
-
const
|
|
11
|
-
return o.map((
|
|
12
|
-
position:
|
|
13
|
-
value:
|
|
14
|
-
label:
|
|
8
|
+
return e && r[n] !== void 0 ? String(r[n]) : String(n);
|
|
9
|
+
}, b = (n, r, o, e) => {
|
|
10
|
+
const t = r?.data;
|
|
11
|
+
return f(n, o, t).map((i) => ({
|
|
12
|
+
position: d(n, i),
|
|
13
|
+
value: i,
|
|
14
|
+
label: m(i, t, e)
|
|
15
15
|
}));
|
|
16
|
-
},
|
|
16
|
+
}, h = (n, r) => n.position !== r.x, l = (n, r) => n.position !== r.y + r.height;
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
s as APPROXIMATE_TICK_COUNT,
|
|
19
|
+
b as buildTicksData,
|
|
20
|
+
m as getTickLabel,
|
|
21
|
+
d as getTickPosition,
|
|
22
|
+
f as getTickValues,
|
|
23
|
+
h as isTickOnXAxisDomainEdge,
|
|
24
|
+
l as isTickOnYAxisDomainEdge
|
|
25
25
|
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { ScaleBand, ScaleLinear, ScaleLogarithmic } from 'd3-scale';
|
|
2
|
-
|
|
3
|
-
min: number;
|
|
4
|
-
max: number;
|
|
5
|
-
};
|
|
2
|
+
import { BaseAxisProps } from '../Components/Axis';
|
|
6
3
|
export type ChartInset = {
|
|
7
4
|
top: number;
|
|
8
5
|
right: number;
|
|
@@ -36,28 +33,6 @@ export type Series = {
|
|
|
36
33
|
*/
|
|
37
34
|
stroke: string;
|
|
38
35
|
};
|
|
39
|
-
export type AxisConfigProps = {
|
|
40
|
-
/**
|
|
41
|
-
* Scale algorithm used by this axis.
|
|
42
|
-
* @default 'linear'
|
|
43
|
-
*/
|
|
44
|
-
scaleType?: 'linear' | 'log' | 'band';
|
|
45
|
-
/**
|
|
46
|
-
* Explicit data values for band scales or category labels.
|
|
47
|
-
* For band scales, provides the discrete domain. For numeric scales, string values
|
|
48
|
-
* are used as tick labels at corresponding indices.
|
|
49
|
-
*/
|
|
50
|
-
data?: string[] | number[];
|
|
51
|
-
/**
|
|
52
|
-
* Fixed domain bounds or a function that adjusts the computed bounds.
|
|
53
|
-
* A partial object overrides only the specified bound(s).
|
|
54
|
-
* A function receives the auto-computed bounds and returns adjusted ones.
|
|
55
|
-
*
|
|
56
|
-
* The final domain is always rounded to nice boundaries via d3's `.nice()`,
|
|
57
|
-
* ensuring tick marks land on clean values (e.g. `[4, 98]` becomes `[0, 100]`).
|
|
58
|
-
*/
|
|
59
|
-
domain?: Partial<AxisBounds> | ((bounds: AxisBounds) => AxisBounds);
|
|
60
|
-
};
|
|
61
36
|
export type NumericScale = ScaleLinear<number, number> | ScaleLogarithmic<number, number>;
|
|
62
37
|
export type CategoricalScale = ScaleBand<number>;
|
|
63
38
|
export type ChartScaleFunction = NumericScale | CategoricalScale;
|
|
@@ -81,11 +56,11 @@ export type CartesianChartContextValue = {
|
|
|
81
56
|
/**
|
|
82
57
|
* Returns the x-axis config. Accepts an optional axis ID for future multi-axis support.
|
|
83
58
|
*/
|
|
84
|
-
getXAxisConfig: (id?: string) =>
|
|
59
|
+
getXAxisConfig: (id?: string) => BaseAxisProps | undefined;
|
|
85
60
|
/**
|
|
86
61
|
* Returns the y-axis config. Accepts an optional axis ID for future multi-axis support.
|
|
87
62
|
*/
|
|
88
|
-
getYAxisConfig: (id?: string) =>
|
|
63
|
+
getYAxisConfig: (id?: string) => BaseAxisProps | undefined;
|
|
89
64
|
/**
|
|
90
65
|
* Pixel bounds of the drawable region.
|
|
91
66
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErC,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEjE,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B;;OAEG;IACH,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react-visualization",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
37
|
-
"@ledgerhq/lumen-ui-react": "0.1.
|
|
36
|
+
"@ledgerhq/lumen-design-core": "0.1.16",
|
|
37
|
+
"@ledgerhq/lumen-ui-react": "0.1.37",
|
|
38
38
|
"class-variance-authority": "^0.7.1",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"tailwind-merge": "^2.6.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ledgerhq/lumen-utils-shared": "0.1.
|
|
45
|
+
"@ledgerhq/lumen-utils-shared": "0.1.5",
|
|
46
46
|
"d3-array": "^3.2.4",
|
|
47
47
|
"d3-scale": "^4.0.2",
|
|
48
48
|
"d3-shape": "^3.2.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react-visualization",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
37
|
-
"@ledgerhq/lumen-ui-react": "0.1.
|
|
36
|
+
"@ledgerhq/lumen-design-core": "0.1.16",
|
|
37
|
+
"@ledgerhq/lumen-ui-react": "0.1.38",
|
|
38
38
|
"class-variance-authority": "^0.7.1",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"tailwind-merge": "^2.6.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ledgerhq/lumen-utils-shared": "0.1.
|
|
45
|
+
"@ledgerhq/lumen-utils-shared": "0.1.5",
|
|
46
46
|
"d3-array": "^3.2.4",
|
|
47
47
|
"d3-scale": "^4.0.2",
|
|
48
48
|
"d3-shape": "^3.2.0"
|