@ledgerhq/lumen-ui-react-visualization 0.1.3 → 0.1.5
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/index.js +5 -2
- package/dist/lib/Components/Axis/Axis.types.d.ts +33 -0
- package/dist/lib/Components/Axis/Axis.types.d.ts.map +1 -0
- package/dist/lib/Components/Axis/XAxis/XAxis.d.ts +4 -0
- package/dist/lib/Components/Axis/XAxis/XAxis.d.ts.map +1 -0
- package/dist/lib/Components/Axis/XAxis/XAxis.js +83 -0
- package/dist/lib/Components/Axis/XAxis/index.d.ts.map +1 -0
- package/dist/lib/Components/Axis/XAxis/types.d.ts +9 -0
- package/dist/lib/Components/Axis/XAxis/types.d.ts.map +1 -0
- package/dist/lib/Components/Axis/YAxis/YAxis.d.ts +4 -0
- package/dist/lib/Components/Axis/YAxis/YAxis.d.ts.map +1 -0
- package/dist/lib/Components/Axis/YAxis/YAxis.js +83 -0
- package/dist/lib/Components/Axis/YAxis/index.d.ts.map +1 -0
- package/dist/lib/Components/Axis/YAxis/types.d.ts +14 -0
- package/dist/lib/Components/Axis/YAxis/types.d.ts.map +1 -0
- package/dist/lib/Components/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/lib/Components/CartesianChart/CartesianChart.js +60 -51
- package/dist/lib/Components/CartesianChart/types.d.ts +4 -2
- package/dist/lib/Components/CartesianChart/types.d.ts.map +1 -1
- package/dist/lib/Components/CartesianChart/utils.d.ts +19 -0
- package/dist/lib/Components/CartesianChart/utils.d.ts.map +1 -0
- package/dist/lib/Components/CartesianChart/utils.js +42 -0
- package/dist/lib/Components/Line/Line.d.ts.map +1 -1
- package/dist/lib/Components/Line/Line.js +52 -31
- package/dist/lib/Components/Line/utils.d.ts +1 -1
- package/dist/lib/Components/Line/utils.d.ts.map +1 -1
- package/dist/lib/Components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/lib/Components/LineChart/LineChart.js +32 -31
- package/dist/lib/Components/LineChart/types.d.ts +5 -3
- package/dist/lib/Components/LineChart/types.d.ts.map +1 -1
- package/dist/lib/Components/Point/Point.d.ts +4 -0
- package/dist/lib/Components/Point/Point.d.ts.map +1 -0
- package/dist/lib/Components/Point/Point.js +85 -0
- package/dist/lib/Components/Point/index.d.ts +3 -0
- package/dist/lib/Components/Point/index.d.ts.map +1 -0
- package/dist/lib/Components/Point/types.d.ts +71 -0
- package/dist/lib/Components/Point/types.d.ts.map +1 -0
- package/dist/lib/Components/Point/utils.d.ts +24 -0
- package/dist/lib/Components/Point/utils.d.ts.map +1 -0
- package/dist/lib/Components/Point/utils.js +26 -0
- package/dist/lib/Components/index.d.ts +1 -0
- package/dist/lib/Components/index.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 +12 -0
- package/dist/lib/utils/scales/scales.d.ts.map +1 -1
- package/dist/lib/utils/scales/scales.js +17 -13
- package/dist/lib/utils/ticks/ticks.d.ts +11 -1
- package/dist/lib/utils/ticks/ticks.d.ts.map +1 -1
- package/dist/lib/utils/ticks/ticks.js +19 -17
- package/dist/lib/utils/types.d.ts +4 -43
- package/dist/lib/utils/types.d.ts.map +1 -1
- package/dist/libs/design-core/dist/lib/cssVar/cssVar.js +4 -0
- package/dist/package.json +3 -3
- package/package.json +2 -2
- package/dist/lib/Components/XAxis/XAxis.d.ts +0 -4
- package/dist/lib/Components/XAxis/XAxis.d.ts.map +0 -1
- package/dist/lib/Components/XAxis/XAxis.js +0 -79
- package/dist/lib/Components/XAxis/index.d.ts.map +0 -1
- package/dist/lib/Components/XAxis/types.d.ts +0 -3
- package/dist/lib/Components/XAxis/types.d.ts.map +0 -1
- package/dist/lib/Components/YAxis/YAxis.d.ts +0 -4
- package/dist/lib/Components/YAxis/YAxis.d.ts.map +0 -1
- package/dist/lib/Components/YAxis/YAxis.js +0 -79
- package/dist/lib/Components/YAxis/index.d.ts.map +0 -1
- package/dist/lib/Components/YAxis/types.d.ts +0 -3
- package/dist/lib/Components/YAxis/types.d.ts.map +0 -1
- /package/dist/lib/Components/{XAxis → Axis/XAxis}/index.d.ts +0 -0
- /package/dist/lib/Components/{YAxis → Axis/YAxis}/index.d.ts +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as b, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as E } from "react";
|
|
3
|
-
import { DEFAULT_AXIS_WIDTH as
|
|
4
|
-
import { DEFAULT_AXIS_HEIGHT as m, XAxis as
|
|
5
|
-
import { CartesianChart as
|
|
6
|
-
import { Line as
|
|
3
|
+
import { DEFAULT_AXIS_WIDTH as H, YAxis as j } from "../Axis/YAxis/YAxis.js";
|
|
4
|
+
import { DEFAULT_AXIS_HEIGHT as m, XAxis as F } from "../Axis/XAxis/XAxis.js";
|
|
5
|
+
import { CartesianChart as U } from "../CartesianChart/CartesianChart.js";
|
|
6
|
+
import { Line as V } from "../Line/Line.js";
|
|
7
7
|
function q({
|
|
8
8
|
series: r,
|
|
9
9
|
showArea: d = !1,
|
|
10
|
-
areaType:
|
|
10
|
+
areaType: c = "gradient",
|
|
11
11
|
showXAxis: t = !1,
|
|
12
|
-
showYAxis:
|
|
13
|
-
xAxis:
|
|
12
|
+
showYAxis: i = !1,
|
|
13
|
+
xAxis: f,
|
|
14
14
|
yAxis: l,
|
|
15
15
|
width: x = "100%",
|
|
16
16
|
height: y = 160,
|
|
@@ -19,39 +19,40 @@ function q({
|
|
|
19
19
|
}) {
|
|
20
20
|
const {
|
|
21
21
|
scaleType: u,
|
|
22
|
-
data:
|
|
23
|
-
domain:
|
|
24
|
-
...
|
|
25
|
-
} =
|
|
22
|
+
data: A,
|
|
23
|
+
domain: D,
|
|
24
|
+
...n
|
|
25
|
+
} = f ?? {}, {
|
|
26
26
|
scaleType: C,
|
|
27
27
|
data: I,
|
|
28
28
|
domain: P,
|
|
29
|
-
...
|
|
29
|
+
...o
|
|
30
30
|
} = l ?? {}, L = {
|
|
31
31
|
scaleType: u,
|
|
32
|
-
data:
|
|
33
|
-
domain:
|
|
32
|
+
data: A,
|
|
33
|
+
domain: D
|
|
34
34
|
}, S = {
|
|
35
35
|
scaleType: C,
|
|
36
36
|
data: I,
|
|
37
37
|
domain: P
|
|
38
38
|
}, _ = E(() => {
|
|
39
|
-
if (!t && !
|
|
40
|
-
const
|
|
39
|
+
if (!t && !i) return;
|
|
40
|
+
const a = n.position === "top" ? "top" : "bottom", s = o.position === "end" ? "right" : "left", p = o.width ?? H;
|
|
41
41
|
return {
|
|
42
|
-
top: t &&
|
|
43
|
-
bottom: t &&
|
|
44
|
-
left:
|
|
45
|
-
right:
|
|
42
|
+
top: t && a === "top" ? m : 0,
|
|
43
|
+
bottom: t && a === "bottom" ? m : 0,
|
|
44
|
+
left: i && s === "left" ? p : 0,
|
|
45
|
+
right: i && s === "right" ? p : 0
|
|
46
46
|
};
|
|
47
47
|
}, [
|
|
48
48
|
t,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
i,
|
|
50
|
+
n.position,
|
|
51
|
+
o.position,
|
|
52
|
+
o.width
|
|
52
53
|
]);
|
|
53
54
|
return /* @__PURE__ */ b(
|
|
54
|
-
|
|
55
|
+
U,
|
|
55
56
|
{
|
|
56
57
|
series: r ?? [],
|
|
57
58
|
xAxis: L,
|
|
@@ -61,16 +62,16 @@ function q({
|
|
|
61
62
|
inset: T,
|
|
62
63
|
axisPadding: _,
|
|
63
64
|
children: [
|
|
64
|
-
t && /* @__PURE__ */ e(
|
|
65
|
-
|
|
66
|
-
r?.map((
|
|
67
|
-
|
|
65
|
+
t && /* @__PURE__ */ e(F, { ...n }),
|
|
66
|
+
i && /* @__PURE__ */ e(j, { ...o }),
|
|
67
|
+
r?.map((a) => /* @__PURE__ */ e(
|
|
68
|
+
V,
|
|
68
69
|
{
|
|
69
|
-
seriesId:
|
|
70
|
+
seriesId: a.id,
|
|
70
71
|
showArea: d,
|
|
71
|
-
areaType:
|
|
72
|
+
areaType: c
|
|
72
73
|
},
|
|
73
|
-
|
|
74
|
+
a.id
|
|
74
75
|
)),
|
|
75
76
|
g
|
|
76
77
|
]
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { AxisConfigProps, ChartInset, Series
|
|
2
|
+
import { AxisConfigProps, ChartInset, Series } from '../../utils/types';
|
|
3
|
+
import { XAxisProps } from '../Axis/XAxis';
|
|
4
|
+
import { YAxisProps } from '../Axis/YAxis';
|
|
3
5
|
export type LineChartProps = {
|
|
4
6
|
/**
|
|
5
7
|
* Data series to render as lines.
|
|
@@ -31,12 +33,12 @@ export type LineChartProps = {
|
|
|
31
33
|
* Combined axis configuration and visual props for the x-axis.
|
|
32
34
|
* Includes scale/domain settings as well as visual options like `showGrid` and `showLine`.
|
|
33
35
|
*/
|
|
34
|
-
xAxis?: Partial<AxisConfigProps> &
|
|
36
|
+
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
35
37
|
/**
|
|
36
38
|
* Combined axis configuration and visual props for the y-axis.
|
|
37
39
|
* Includes scale/domain settings as well as visual options like `showGrid` and `showLine`.
|
|
38
40
|
*/
|
|
39
|
-
yAxis?: Partial<AxisConfigProps> &
|
|
41
|
+
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
40
42
|
/**
|
|
41
43
|
* Width of the chart.
|
|
42
44
|
* A number is treated as pixels; a string (e.g. `'100%'`) fills the container.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/LineChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/LineChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;IAC9C;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;IAC9C;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PointLabelProps, PointProps } from './types';
|
|
2
|
+
export declare function PointLabel({ style, textAnchor, dominantBaseline, ...props }: Readonly<PointLabelProps>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function Point({ dataX, dataY, color, label, LabelComponent, labelPosition, hidePoint, showLabelArrow, size, onClick, }: Readonly<PointProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
//# sourceMappingURL=Point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Point/Point.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAU3D,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,UAAqB,EACrB,gBAAyB,EACzB,GAAG,KAAK,EACT,EAAE,QAAQ,CAAC,eAAe,CAAC,2CAe3B;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,cAAc,EACd,aAAqB,EACrB,SAAiB,EACjB,cAAqB,EACrB,IAAmB,EACnB,OAAO,GACR,EAAE,QAAQ,CAAC,UAAU,CAAC,kDA0DtB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsxs as W, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as j } from "react";
|
|
3
|
+
import { projectPoint as k } from "../../utils/scales/scales.js";
|
|
4
|
+
import { isWithinBounds as E, resolveLabel as P, STROKE_WIDTH as T, buildArrowPoints as z, computeLabelY as C, DEFAULT_SIZE as D } from "./utils.js";
|
|
5
|
+
import { useCartesianChartContext as F } from "../CartesianChart/context/cartesianChartContext.js";
|
|
6
|
+
import { cssVar as o } from "../../../libs/design-core/dist/lib/cssVar/cssVar.js";
|
|
7
|
+
function I({
|
|
8
|
+
style: e,
|
|
9
|
+
textAnchor: r = "middle",
|
|
10
|
+
dominantBaseline: i = "auto",
|
|
11
|
+
...s
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ n(
|
|
14
|
+
"text",
|
|
15
|
+
{
|
|
16
|
+
textAnchor: r,
|
|
17
|
+
dominantBaseline: i,
|
|
18
|
+
style: {
|
|
19
|
+
fill: o("var(--text-base)"),
|
|
20
|
+
fontSize: o("var(--font-style-body-4-size)"),
|
|
21
|
+
fontWeight: o("var(--font-style-body-4-weight-medium)"),
|
|
22
|
+
fontFamily: o("var(--font-family-font)"),
|
|
23
|
+
...e
|
|
24
|
+
},
|
|
25
|
+
...s
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function O({
|
|
30
|
+
dataX: e,
|
|
31
|
+
dataY: r,
|
|
32
|
+
color: i,
|
|
33
|
+
label: s,
|
|
34
|
+
LabelComponent: p,
|
|
35
|
+
labelPosition: d = "top",
|
|
36
|
+
hidePoint: y = !1,
|
|
37
|
+
showLabelArrow: x = !0,
|
|
38
|
+
size: b = D,
|
|
39
|
+
onClick: f
|
|
40
|
+
}) {
|
|
41
|
+
const { getXScale: v, getYScale: g, drawingArea: h } = F(), l = v(), a = g(), c = b / 2, L = i ?? o("var(--background-muted-strong)"), t = j(() => {
|
|
42
|
+
if (!(!l || !a))
|
|
43
|
+
return k(e, r, l, a);
|
|
44
|
+
}, [e, r, l, a]);
|
|
45
|
+
if (!t || !E(t.x, t.y, h))
|
|
46
|
+
return null;
|
|
47
|
+
const u = P(s, e), S = u != null, m = x && S, w = C(t.y, c, d, m), A = p ?? I;
|
|
48
|
+
return /* @__PURE__ */ W(
|
|
49
|
+
"g",
|
|
50
|
+
{
|
|
51
|
+
"data-testid": "point-group",
|
|
52
|
+
onClick: f,
|
|
53
|
+
style: f ? { cursor: "pointer" } : void 0,
|
|
54
|
+
children: [
|
|
55
|
+
!y && /* @__PURE__ */ n(
|
|
56
|
+
"circle",
|
|
57
|
+
{
|
|
58
|
+
"data-testid": "point-circle",
|
|
59
|
+
cx: t.x,
|
|
60
|
+
cy: t.y,
|
|
61
|
+
r: c,
|
|
62
|
+
style: {
|
|
63
|
+
fill: L,
|
|
64
|
+
stroke: o("var(--background-canvas)")
|
|
65
|
+
},
|
|
66
|
+
strokeWidth: T
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
m && /* @__PURE__ */ n(
|
|
70
|
+
"polygon",
|
|
71
|
+
{
|
|
72
|
+
"data-testid": "point-arrow",
|
|
73
|
+
points: z(t.x, t.y, c, d),
|
|
74
|
+
style: { fill: o("var(--text-base)") }
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
u != null && /* @__PURE__ */ n(A, { x: t.x, y: w, children: u })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
O as Point,
|
|
84
|
+
I as PointLabel
|
|
85
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Point/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ComponentType, MouseEvent, SVGProps } from 'react';
|
|
2
|
+
export type PointLabelProps = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
children: string;
|
|
6
|
+
} & Omit<SVGProps<SVGTextElement>, 'x' | 'y' | 'children'>;
|
|
7
|
+
export type PointLabelComponent = ComponentType<PointLabelProps>;
|
|
8
|
+
export type PointProps = {
|
|
9
|
+
/**
|
|
10
|
+
* X coordinate in data space (index or explicit value).
|
|
11
|
+
*/
|
|
12
|
+
dataX: number;
|
|
13
|
+
/**
|
|
14
|
+
* Y coordinate in data space.
|
|
15
|
+
*/
|
|
16
|
+
dataY: number;
|
|
17
|
+
/**
|
|
18
|
+
* Fill color of the point circle.
|
|
19
|
+
* Defaults to `var(--background-muted-strong)`.
|
|
20
|
+
*
|
|
21
|
+
* Use the `cssVar` helper from `@ledgerhq/lumen-design-core` to
|
|
22
|
+
* resolve a design-token CSS variable at runtime:
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { cssVar } from '@ledgerhq/lumen-design-core';
|
|
27
|
+
*
|
|
28
|
+
* <Point dataX={0} dataY={42} color={cssVar('var(--background-error-strong)')} />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
color?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Text label displayed near the point.
|
|
34
|
+
* A string is rendered directly; a function receives `dataX` and returns
|
|
35
|
+
* the label string, enabling index-based formatting.
|
|
36
|
+
*/
|
|
37
|
+
label?: string | ((dataIndex: number) => string);
|
|
38
|
+
/**
|
|
39
|
+
* Custom component rendered instead of the default `PointLabel`.
|
|
40
|
+
* Receives pixel coordinates (`x`, `y`) and the resolved label as
|
|
41
|
+
* `children`. Use `PointLabel` inside your component to retain
|
|
42
|
+
* design-token styling while customising layout or appearance.
|
|
43
|
+
*/
|
|
44
|
+
LabelComponent?: PointLabelComponent;
|
|
45
|
+
/**
|
|
46
|
+
* Placement of the label relative to the point.
|
|
47
|
+
* @default 'top'
|
|
48
|
+
*/
|
|
49
|
+
labelPosition?: 'top' | 'bottom';
|
|
50
|
+
/**
|
|
51
|
+
* When `true`, the point circle is hidden but the label (if any) is still rendered.
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
hidePoint?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Diameter of the point circle in pixels.
|
|
57
|
+
* Internally converted to an SVG radius (`size / 2`).
|
|
58
|
+
* @default 10
|
|
59
|
+
*/
|
|
60
|
+
size?: number;
|
|
61
|
+
/**
|
|
62
|
+
* When `true`, an arrow is displayed pointing from the point to the label.
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
showLabelArrow?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Called when the point is clicked.
|
|
68
|
+
*/
|
|
69
|
+
onClick?: (event: MouseEvent<SVGGElement>) => void;
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Point/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,UAAU,CAAC,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAEjE,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IACjD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACpD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DrawingArea } from '../../utils/types';
|
|
2
|
+
export declare const DEFAULT_SIZE = 10;
|
|
3
|
+
export declare const STROKE_WIDTH = 2;
|
|
4
|
+
export declare const ARROW_WIDTH = 6;
|
|
5
|
+
export declare const ARROW_HEIGHT = 4;
|
|
6
|
+
export declare const GAP = 4;
|
|
7
|
+
export declare const LABEL_FONT_SIZE = 10;
|
|
8
|
+
export declare const isWithinBounds: (px: number, py: number, area: DrawingArea) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Builds the three SVG points of the arrow triangle.
|
|
11
|
+
*
|
|
12
|
+
* `'top'` → arrow sits below the label, tip pointing **down** toward the circle.
|
|
13
|
+
* `'bottom'` → arrow sits above the label, tip pointing **up** toward the circle.
|
|
14
|
+
*/
|
|
15
|
+
export declare const buildArrowPoints: (cx: number, cy: number, radius: number, position: "top" | "bottom") => string;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the label prop to a string or undefined.
|
|
18
|
+
*/
|
|
19
|
+
export declare const resolveLabel: (label: string | ((dataIndex: number) => string) | undefined, dataX: number) => string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Computes the vertical position of the label text baseline.
|
|
22
|
+
*/
|
|
23
|
+
export declare const computeLabelY: (pixelY: number, radius: number, labelPosition: "top" | "bottom", renderArrow: boolean) => number;
|
|
24
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Point/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,GAAG,IAAI,CAAC;AACrB,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,eAAO,MAAM,cAAc,GACzB,IAAI,MAAM,EACV,IAAI,MAAM,EACV,MAAM,WAAW,KAChB,OAIyB,CAAC;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,IAAI,MAAM,EACV,IAAI,MAAM,EACV,QAAQ,MAAM,EACd,UAAU,KAAK,GAAG,QAAQ,KACzB,MAYF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,EAC3D,OAAO,MAAM,KACZ,MAAM,GAAG,SAGX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,eAAe,KAAK,GAAG,QAAQ,EAC/B,aAAa,OAAO,KACnB,MAMF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const $ = 10, E = 2, G = 6, H = 4, T = 4, f = 10, I = (t, n, o) => t >= o.x && t <= o.x + o.width && n >= o.y && n <= o.y + o.height, O = (t, n, o, s) => {
|
|
2
|
+
if (s === "top") {
|
|
3
|
+
const R = n - o - 4, _ = R - 4;
|
|
4
|
+
return `${t},${R} ${t - 3},${_} ${t + 3},${_}`;
|
|
5
|
+
}
|
|
6
|
+
const W = n + o + 4, c = W + 4;
|
|
7
|
+
return `${t},${W} ${t - 3},${c} ${t + 3},${c}`;
|
|
8
|
+
}, e = (t, n) => {
|
|
9
|
+
const o = typeof t == "function" ? t(n) : t;
|
|
10
|
+
return o === "" ? void 0 : o;
|
|
11
|
+
}, h = (t, n, o, s) => {
|
|
12
|
+
const A = s ? 8 : 4;
|
|
13
|
+
return o === "top" ? t - n - A - 4 : t + n + A + 4 + 10;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
H as ARROW_HEIGHT,
|
|
17
|
+
G as ARROW_WIDTH,
|
|
18
|
+
$ as DEFAULT_SIZE,
|
|
19
|
+
T as GAP,
|
|
20
|
+
f as LABEL_FONT_SIZE,
|
|
21
|
+
E as STROKE_WIDTH,
|
|
22
|
+
O as buildArrowPoints,
|
|
23
|
+
h as computeLabelY,
|
|
24
|
+
I as isWithinBounds,
|
|
25
|
+
e as resolveLabel
|
|
26
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { AxisBounds, AxisConfigProps, CartesianChartContextValue, CategoricalScale, ChartInset, ChartScaleFunction, DrawingArea, NumericScale, Series,
|
|
1
|
+
export type { AxisBounds, AxisConfigProps, CartesianChartContextValue, CategoricalScale, ChartInset, ChartScaleFunction, DrawingArea, NumericScale, Series, } from './types';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,eAAe,EACf,0BAA0B,EAC1B,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,eAAe,EACf,0BAA0B,EAC1B,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,MAAM,GACP,MAAM,SAAS,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { AxisBounds, AxisConfigProps, CategoricalScale, ChartScaleFunction, NumericScale } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a numeric scale with `.nice()` applied so the domain
|
|
4
|
+
* extends to clean rounded boundaries (e.g. `[4, 98]` → `[0, 100]`).
|
|
5
|
+
*/
|
|
2
6
|
export declare const getNumericScale: ({ scaleType, domain, range, }: {
|
|
3
7
|
scaleType: "linear" | "log";
|
|
4
8
|
domain: AxisBounds;
|
|
@@ -21,4 +25,12 @@ export declare const isCategoricalScale: (scale: ChartScaleFunction) => scale is
|
|
|
21
25
|
* Checks if a scale is a numeric scale.
|
|
22
26
|
*/
|
|
23
27
|
export declare const isNumericScale: (scale: ChartScaleFunction) => scale is NumericScale;
|
|
28
|
+
/**
|
|
29
|
+
* Projects a single data-space coordinate pair into pixel-space.
|
|
30
|
+
* Handles centering for categorical (band) scales.
|
|
31
|
+
*/
|
|
32
|
+
export declare const projectPoint: (dataX: number, dataY: number, xScale: ChartScaleFunction, yScale: ChartScaleFunction) => {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
};
|
|
24
36
|
//# sourceMappingURL=scales.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scales.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/scales/scales.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACb,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,eAAe,GAAI,+BAI7B;IACD,SAAS,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;CACnB,KAAG,
|
|
1
|
+
{"version":3,"file":"scales.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/scales/scales.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACb,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,+BAI7B;IACD,SAAS,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;CACnB,KAAG,YAMH,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,6BAIjC;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,gBAUH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAW,eAAe,CAAC,WAAW,CAAC,KACtC,SAAS,IAAI,MAA8B,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,kBAAkB,KACxB,KAAK,IAAI,gBAEX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,kBAAkB,KACxB,KAAK,IAAI,YAEX,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,EACb,OAAO,MAAM,EACb,QAAQ,kBAAkB,EAC1B,QAAQ,kBAAkB,KACzB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAQxB,CAAC"}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import c from "../../../node_modules/d3-scale/src/band.js";
|
|
2
|
+
import a from "../../../node_modules/d3-scale/src/log.js";
|
|
3
|
+
import s from "../../../node_modules/d3-scale/src/linear.js";
|
|
4
|
+
const p = ({
|
|
5
5
|
scaleType: n,
|
|
6
6
|
domain: r,
|
|
7
7
|
range: t
|
|
8
|
-
}) => (n === "log" ?
|
|
8
|
+
}) => (n === "log" ? a() : s()).domain([r.min, r.max]).nice().range([t.min, t.max]), b = ({
|
|
9
9
|
domain: n,
|
|
10
10
|
range: r,
|
|
11
11
|
padding: t = 0.1
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
13
|
+
const o = Array.from(
|
|
14
14
|
{ length: n.max - n.min + 1 },
|
|
15
|
-
(
|
|
15
|
+
(m, i) => n.min + i
|
|
16
16
|
);
|
|
17
|
-
return
|
|
18
|
-
}, f = (n) => n === "band",
|
|
17
|
+
return c().domain(o).range([r.min, r.max]).paddingInner(t).paddingOuter(t / 2);
|
|
18
|
+
}, f = (n) => n === "band", e = (n) => "bandwidth" in n && typeof n.bandwidth == "function", l = (n) => !e(n), h = (n, r, t, o) => {
|
|
19
|
+
const m = e(t) ? (t(n) ?? 0) + t.bandwidth() / 2 : t(n), i = e(o) ? (o(r) ?? 0) + o.bandwidth() / 2 : o(r);
|
|
20
|
+
return { x: m, y: i };
|
|
21
|
+
};
|
|
19
22
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
b as getCategoricalScale,
|
|
24
|
+
p as getNumericScale,
|
|
22
25
|
f as isBandScaleType,
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
e as isCategoricalScale,
|
|
27
|
+
l as isNumericScale,
|
|
28
|
+
h as projectPoint
|
|
25
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxisConfigProps, ChartScaleFunction } from '../types';
|
|
1
|
+
import { AxisConfigProps, ChartScaleFunction, DrawingArea } from '../types';
|
|
2
2
|
export declare const APPROXIMATE_TICK_COUNT = 5;
|
|
3
3
|
export type TickData = {
|
|
4
4
|
position: number;
|
|
@@ -24,4 +24,14 @@ export declare const getTickLabel: (tick: number, axisData: AxisConfigProps["dat
|
|
|
24
24
|
* Builds the complete tick data array from a scale and axis configuration.
|
|
25
25
|
*/
|
|
26
26
|
export declare const buildTicksData: (scale: ChartScaleFunction, axisConfig?: AxisConfigProps, explicitTicks?: number[], formatter?: (value: number | string) => string) => TickData[];
|
|
27
|
+
/**
|
|
28
|
+
* Excludes the X grid line at the Y-axis origin (left edge)
|
|
29
|
+
* to prevent overlap with the Y-axis solid line.
|
|
30
|
+
*/
|
|
31
|
+
export declare const isTickOnXAxisDomainEdge: (tick: TickData, drawingArea: DrawingArea) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Excludes the Y grid line at the X-axis origin (bottom edge)
|
|
34
|
+
* to prevent overlap with the X-axis solid line.
|
|
35
|
+
*/
|
|
36
|
+
export declare const isTickOnYAxisDomainEdge: (tick: TickData, drawingArea: DrawingArea) => boolean;
|
|
27
37
|
//# sourceMappingURL=ticks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/ticks/ticks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/ticks/ticks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,WAAW,EACZ,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,kBAAkB,EACzB,gBAAgB,MAAM,EAAE,KACvB,MAAM,EAKR,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,kBAAkB,EACzB,MAAM,MAAM,KACX,MAKF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,EACZ,UAAU,eAAe,CAAC,MAAM,CAAC,EACjC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,KAC7C,MAeF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,kBAAkB,EACzB,aAAa,eAAe,EAC5B,gBAAgB,MAAM,EAAE,EACxB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,KAC7C,QAAQ,EASV,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,QAAQ,EACd,aAAa,WAAW,KACvB,OAEF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,QAAQ,EACd,aAAa,WAAW,KACvB,OAEF,CAAC"}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { isCategoricalScale as u, isNumericScale as
|
|
2
|
-
const d = 5,
|
|
3
|
-
const
|
|
1
|
+
import { isCategoricalScale as u, isNumericScale as g } from "../scales/scales.js";
|
|
2
|
+
const d = 5, T = (n, r) => r || (u(n) ? n.domain() : g(n) ? n.ticks(d) : []), f = (n, r) => u(n) ? (n(r) ?? 0) + n.bandwidth() / 2 : n(r), c = (n, r, t) => {
|
|
3
|
+
const i = r && Array.isArray(r) && typeof r[0] == "string";
|
|
4
4
|
if (t) {
|
|
5
|
-
const
|
|
6
|
-
return String(t(
|
|
5
|
+
const o = i && r[n] !== void 0 ? r[n] : n;
|
|
6
|
+
return String(t(o));
|
|
7
7
|
}
|
|
8
|
-
return
|
|
9
|
-
},
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
position:
|
|
13
|
-
value:
|
|
14
|
-
label:
|
|
8
|
+
return i && r[n] !== void 0 ? String(r[n]) : String(n);
|
|
9
|
+
}, p = (n, r, t, i) => {
|
|
10
|
+
const o = T(n, t), s = r?.data;
|
|
11
|
+
return o.map((e) => ({
|
|
12
|
+
position: f(n, e),
|
|
13
|
+
value: e,
|
|
14
|
+
label: c(e, s, i)
|
|
15
15
|
}));
|
|
16
|
-
};
|
|
16
|
+
}, S = (n, r) => n.position !== r.x, b = (n, r) => n.position !== r.y + r.height;
|
|
17
17
|
export {
|
|
18
18
|
d as APPROXIMATE_TICK_COUNT,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
p as buildTicksData,
|
|
20
|
+
c as getTickLabel,
|
|
21
|
+
f as getTickPosition,
|
|
22
|
+
T as getTickValues,
|
|
23
|
+
S as isTickOnXAxisDomainEdge,
|
|
24
|
+
b as isTickOnYAxisDomainEdge
|
|
23
25
|
};
|
|
@@ -26,7 +26,7 @@ export type Series = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Numeric data points; `null` entries represent gaps.
|
|
28
28
|
*/
|
|
29
|
-
data?:
|
|
29
|
+
data?: (number | null)[];
|
|
30
30
|
/**
|
|
31
31
|
* Human-readable label used in legends and tooltips.
|
|
32
32
|
*/
|
|
@@ -52,50 +52,12 @@ export type AxisConfigProps = {
|
|
|
52
52
|
* Fixed domain bounds or a function that adjusts the computed bounds.
|
|
53
53
|
* A partial object overrides only the specified bound(s).
|
|
54
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]`).
|
|
55
58
|
*/
|
|
56
59
|
domain?: Partial<AxisBounds> | ((bounds: AxisBounds) => AxisBounds);
|
|
57
60
|
};
|
|
58
|
-
type AxisVisualProps = {
|
|
59
|
-
/**
|
|
60
|
-
* Whether to render grid lines at each tick.
|
|
61
|
-
* @default false
|
|
62
|
-
*/
|
|
63
|
-
showGrid?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Whether to render the axis baseline.
|
|
66
|
-
* @default false
|
|
67
|
-
*/
|
|
68
|
-
showLine?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Whether to render tick marks at each tick position.
|
|
71
|
-
* @default false
|
|
72
|
-
*/
|
|
73
|
-
showTickMark?: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Explicit tick positions along the axis.
|
|
76
|
-
* When omitted, ticks are computed automatically from the scale.
|
|
77
|
-
*/
|
|
78
|
-
ticks?: number[];
|
|
79
|
-
/**
|
|
80
|
-
* Formats a tick value into its display label.
|
|
81
|
-
* Receives the raw tick value (number or string label) and must return a string.
|
|
82
|
-
*/
|
|
83
|
-
tickLabelFormatter?: (value: number | string) => string;
|
|
84
|
-
};
|
|
85
|
-
export type XAxisVisualProps = {
|
|
86
|
-
/**
|
|
87
|
-
* Where the x-axis is rendered relative to the drawing area.
|
|
88
|
-
* @default 'bottom'
|
|
89
|
-
*/
|
|
90
|
-
position?: 'top' | 'bottom';
|
|
91
|
-
} & AxisVisualProps;
|
|
92
|
-
export type YAxisVisualProps = {
|
|
93
|
-
/**
|
|
94
|
-
* Where the y-axis is rendered relative to the drawing area.
|
|
95
|
-
* @default 'start'
|
|
96
|
-
*/
|
|
97
|
-
position?: 'start' | 'end';
|
|
98
|
-
} & AxisVisualProps;
|
|
99
61
|
export type NumericScale = ScaleLinear<number, number> | ScaleLogarithmic<number, number>;
|
|
100
62
|
export type CategoricalScale = ScaleBand<number>;
|
|
101
63
|
export type ChartScaleFunction = NumericScale | CategoricalScale;
|
|
@@ -133,5 +95,4 @@ export type CartesianChartContextValue = {
|
|
|
133
95
|
*/
|
|
134
96
|
dataLength: number;
|
|
135
97
|
};
|
|
136
|
-
export {};
|
|
137
98
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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;AAEzE,MAAM,MAAM,UAAU,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,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,
|
|
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;AAEzE,MAAM,MAAM,UAAU,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,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,eAAe,GAAG;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IACtC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC3B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,UAAU,CAAC,CAAC;CACrE,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,eAAe,GAAG,SAAS,CAAC;IAC7D;;OAEG;IACH,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAC;IAC7D;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
|