@ledgerhq/lumen-ui-react 0.1.56 → 0.1.58
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/ai-rules/RULES.md +5 -4
- package/dist/index.js +176 -172
- package/dist/lib/Components/core/DotIcon/DotIcon.d.ts +0 -13
- package/dist/lib/Components/core/DotIcon/DotIcon.d.ts.map +1 -1
- package/dist/lib/Components/core/DotIcon/DotIcon.js +15 -28
- package/dist/lib/Components/core/DotIcon/getDotIconProps.d.ts +66 -0
- package/dist/lib/Components/core/DotIcon/getDotIconProps.d.ts.map +1 -0
- package/dist/lib/Components/core/DotIcon/getDotIconProps.js +19 -0
- package/dist/lib/Components/core/DotIcon/index.d.ts +9 -1
- package/dist/lib/Components/core/DotIcon/index.d.ts.map +1 -1
- package/dist/lib/Components/core/DotIcon/index.js +10 -0
- package/dist/lib/Components/core/DotSymbol/DotSymbol.d.ts +1 -5
- package/dist/lib/Components/core/DotSymbol/DotSymbol.d.ts.map +1 -1
- package/dist/lib/Components/core/DotSymbol/DotSymbol.js +14 -33
- package/dist/lib/Components/core/DotSymbol/getDotSymbolProps.d.ts +102 -0
- package/dist/lib/Components/core/DotSymbol/getDotSymbolProps.d.ts.map +1 -0
- package/dist/lib/Components/core/DotSymbol/getDotSymbolProps.js +25 -0
- package/dist/lib/Components/core/DotSymbol/index.d.ts +14 -1
- package/dist/lib/Components/core/DotSymbol/index.d.ts.map +1 -1
- package/dist/lib/Components/core/DotSymbol/index.js +15 -0
- package/dist/lib/Components/core/Tooltip/Tooltip.d.ts +0 -8
- package/dist/lib/Components/core/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/lib/Components/core/Tooltip/Tooltip.js +1 -1
- package/dist/lib/Components/visualization/Axis/XAxis/XAxis.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/XAxis/XAxis.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/XAxis/XAxis.js +85 -0
- package/dist/lib/Components/visualization/Axis/XAxis/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/XAxis/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/XAxis/types.d.ts +9 -0
- package/dist/lib/Components/visualization/Axis/XAxis/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/YAxis/YAxis.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/YAxis/YAxis.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/YAxis/YAxis.js +85 -0
- package/dist/lib/Components/visualization/Axis/YAxis/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/YAxis/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/YAxis/types.d.ts +14 -0
- package/dist/lib/Components/visualization/Axis/YAxis/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/index.d.ts +2 -0
- package/dist/lib/Components/visualization/Axis/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/types.d.ts +80 -0
- package/dist/lib/Components/visualization/Axis/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/CartesianChart.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/CartesianChart.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/CartesianChart.js +107 -0
- package/dist/lib/Components/visualization/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts +11 -0
- package/dist/lib/Components/visualization/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js +21 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/RevealAnimationProvider.js +41 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/context.d.ts +15 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/context.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/context.js +10 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/index.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/types.d.ts +57 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/utils.d.ts +35 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/utils.js +69 -0
- package/dist/lib/Components/visualization/CartesianChart/context/cartesianChartContext.d.ts +8 -0
- package/dist/lib/Components/visualization/CartesianChart/context/cartesianChartContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/context/cartesianChartContext.js +9 -0
- package/dist/lib/Components/visualization/CartesianChart/context/index.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/context/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/context/useBuildChartContext.d.ts +25 -0
- package/dist/lib/Components/visualization/CartesianChart/context/useBuildChartContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/context/useBuildChartContext.js +61 -0
- package/dist/lib/Components/visualization/CartesianChart/hooks/useShimmerAnimation.d.ts +18 -0
- package/dist/lib/Components/visualization/CartesianChart/hooks/useShimmerAnimation.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/hooks/useShimmerAnimation.js +15 -0
- package/dist/lib/Components/visualization/CartesianChart/index.d.ts +4 -0
- package/dist/lib/Components/visualization/CartesianChart/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/types.d.ts +127 -0
- package/dist/lib/Components/visualization/CartesianChart/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/utils.d.ts +5 -0
- package/dist/lib/Components/visualization/CartesianChart/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/utils.js +24 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChart.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChart.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChart.js +90 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartAnimatedCenter.d.ts +10 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartAnimatedCenter.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartAnimatedCenter.js +61 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.d.ts +9 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.js +20 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartDescription.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartDescription.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartDescription.js +49 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartTitle.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartTitle.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartTitle.js +55 -0
- package/dist/lib/Components/visualization/DonutChart/DonutRing.d.ts +12 -0
- package/dist/lib/Components/visualization/DonutChart/DonutRing.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutRing.js +110 -0
- package/dist/lib/Components/visualization/DonutChart/RevealAnimation.d.ts +7 -0
- package/dist/lib/Components/visualization/DonutChart/RevealAnimation.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/RevealAnimation.js +28 -0
- package/dist/lib/Components/visualization/DonutChart/donutSizeContext.d.ts +18 -0
- package/dist/lib/Components/visualization/DonutChart/donutSizeContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/donutSizeContext.js +6 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useContrastSafeSeries.d.ts +12 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useContrastSafeSeries.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useContrastSafeSeries.js +13 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useDonutLoadingAnimation.d.ts +8 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useDonutLoadingAnimation.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useDonutLoadingAnimation.js +16 -0
- package/dist/lib/Components/visualization/DonutChart/index.d.ts +7 -0
- package/dist/lib/Components/visualization/DonutChart/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/types.d.ts +172 -0
- package/dist/lib/Components/visualization/DonutChart/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/index.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/useDonutSeries.d.ts +10 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/useDonutSeries.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/useDonutSeries.js +16 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/utils.d.ts +9 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/utils.js +46 -0
- package/dist/lib/Components/visualization/DonutChart/utils.d.ts +37 -0
- package/dist/lib/Components/visualization/DonutChart/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/utils.js +83 -0
- package/dist/lib/Components/visualization/Legend/Legend.d.ts +3 -0
- package/dist/lib/Components/visualization/Legend/Legend.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Legend/Legend.js +23 -0
- package/dist/lib/Components/visualization/Legend/LegendItem.d.ts +7 -0
- package/dist/lib/Components/visualization/Legend/LegendItem.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Legend/LegendItem.js +19 -0
- package/dist/lib/Components/visualization/Legend/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Legend/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Legend/types.d.ts +32 -0
- package/dist/lib/Components/visualization/Legend/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/Line.d.ts +3 -0
- package/dist/lib/Components/visualization/Line/Line.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/Line.js +82 -0
- package/dist/lib/Components/visualization/Line/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Line/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/types.d.ts +45 -0
- package/dist/lib/Components/visualization/Line/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/utils.d.ts +28 -0
- package/dist/lib/Components/visualization/Line/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/utils.js +34 -0
- package/dist/lib/Components/visualization/LineChart/LineChart.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/LineChart.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChart.js +181 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts +9 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.js +51 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/index.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/types.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/utils.d.ts +8 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/utils.js +8 -0
- package/dist/lib/Components/visualization/LineChart/index.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/types.d.ts +82 -0
- package/dist/lib/Components/visualization/LineChart/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/utils.d.ts +56 -0
- package/dist/lib/Components/visualization/LineChart/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/utils.js +57 -0
- package/dist/lib/Components/visualization/Point/Point.d.ts +4 -0
- package/dist/lib/Components/visualization/Point/Point.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/Point.js +122 -0
- package/dist/lib/Components/visualization/Point/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Point/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/MagneticPointsProvider.d.ts +7 -0
- package/dist/lib/Components/visualization/Point/pointContext/MagneticPointsProvider.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/MagneticPointsProvider.js +22 -0
- package/dist/lib/Components/visualization/Point/pointContext/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Point/pointContext/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/magneticPointsContext.d.ts +30 -0
- package/dist/lib/Components/visualization/Point/pointContext/magneticPointsContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/magneticPointsContext.js +14 -0
- package/dist/lib/Components/visualization/Point/types.d.ts +110 -0
- package/dist/lib/Components/visualization/Point/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/usePointGeometry.d.ts +33 -0
- package/dist/lib/Components/visualization/Point/usePointGeometry.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/usePointGeometry.js +30 -0
- package/dist/lib/Components/visualization/Point/utils.d.ts +51 -0
- package/dist/lib/Components/visualization/Point/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/utils.js +54 -0
- package/dist/lib/Components/visualization/ReferenceLine/ReferenceLine.d.ts +3 -0
- package/dist/lib/Components/visualization/ReferenceLine/ReferenceLine.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/ReferenceLine.js +42 -0
- package/dist/lib/Components/visualization/ReferenceLine/index.d.ts +3 -0
- package/dist/lib/Components/visualization/ReferenceLine/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/types.d.ts +74 -0
- package/dist/lib/Components/visualization/ReferenceLine/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/useReferenceLineGeometry.d.ts +21 -0
- package/dist/lib/Components/visualization/ReferenceLine/useReferenceLineGeometry.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/useReferenceLineGeometry.js +49 -0
- package/dist/lib/Components/visualization/ReferenceLine/utils.d.ts +50 -0
- package/dist/lib/Components/visualization/ReferenceLine/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/utils.js +66 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.d.ts +9 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.js +50 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.d.ts +12 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.js +82 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.d.ts +58 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.js +80 -0
- package/dist/lib/Components/visualization/Scrubber/Scrubber.d.ts +29 -0
- package/dist/lib/Components/visualization/Scrubber/Scrubber.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/Scrubber.js +114 -0
- package/dist/lib/Components/visualization/Scrubber/ScrubberProvider.d.ts +3 -0
- package/dist/lib/Components/visualization/Scrubber/ScrubberProvider.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/ScrubberProvider.js +154 -0
- package/dist/lib/Components/visualization/Scrubber/context/index.d.ts +2 -0
- package/dist/lib/Components/visualization/Scrubber/context/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/context/scrubberContext.d.ts +8 -0
- package/dist/lib/Components/visualization/Scrubber/context/scrubberContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/context/scrubberContext.js +9 -0
- package/dist/lib/Components/visualization/Scrubber/index.d.ts +4 -0
- package/dist/lib/Components/visualization/Scrubber/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/types.d.ts +130 -0
- package/dist/lib/Components/visualization/Scrubber/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/useScrubberGeometry.d.ts +29 -0
- package/dist/lib/Components/visualization/Scrubber/useScrubberGeometry.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/useScrubberGeometry.js +37 -0
- package/dist/lib/Components/visualization/Scrubber/utils.d.ts +79 -0
- package/dist/lib/Components/visualization/Scrubber/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/utils.js +104 -0
- package/dist/lib/Components/visualization/config.d.ts +162 -0
- package/dist/lib/Components/visualization/config.d.ts.map +1 -0
- package/dist/lib/Components/visualization/config.js +156 -0
- package/dist/lib/Components/visualization/index.d.ts +8 -0
- package/dist/lib/Components/visualization/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/index.js +27 -0
- package/dist/lib/Components/visualization/utils/domain/domain.d.ts +18 -0
- package/dist/lib/Components/visualization/utils/domain/domain.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/domain/domain.js +35 -0
- package/dist/lib/Components/visualization/utils/index.d.ts +2 -0
- package/dist/lib/Components/visualization/utils/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/numbers.d.ts +13 -0
- package/dist/lib/Components/visualization/utils/numbers.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/numbers.js +5 -0
- package/dist/lib/Components/visualization/utils/scales/scales.d.ts +47 -0
- package/dist/lib/Components/visualization/utils/scales/scales.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/scales/scales.js +32 -0
- package/dist/lib/Components/visualization/utils/ticks/ticks.d.ts +35 -0
- package/dist/lib/Components/visualization/utils/ticks/ticks.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/ticks/ticks.js +23 -0
- package/dist/lib/Components/visualization/utils/types.d.ts +63 -0
- package/dist/lib/Components/visualization/utils/types.d.ts.map +1 -0
- package/dist/libs/design-core/dist/lib/colorContrast/colorContrast.js +15 -0
- package/dist/libs/design-core/dist/lib/colorContrast/hexToHsl.js +14 -0
- package/dist/libs/design-core/dist/lib/colorContrast/hslToHex.js +10 -0
- package/dist/libs/design-core/dist/lib/themes/js/primitives/primitive.colors.js +15 -0
- package/dist/libs/utils-shared/dist/index.js +115 -113
- package/dist/package.json +12 -4
- package/package.json +12 -4
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { chartConfig as h } from "../config.js";
|
|
3
|
+
import { useReferenceLineGeometry as m } from "./useReferenceLineGeometry.js";
|
|
4
|
+
const { color: o, font: t, referenceLine: y, strokeWidth: x } = h, u = {
|
|
5
|
+
fill: o.textMuted,
|
|
6
|
+
fontSize: t.labelSize,
|
|
7
|
+
fontWeight: t.labelWeightMedium,
|
|
8
|
+
fontFamily: t.family
|
|
9
|
+
};
|
|
10
|
+
function A(n) {
|
|
11
|
+
const r = m(n), { label: l, stroke: a = o.stroke, lineStyle: s = "dashed" } = n, d = s === "dashed" ? y.dashArray : void 0;
|
|
12
|
+
if (!r) return null;
|
|
13
|
+
const { linePoints: c, labelCoords: e } = r;
|
|
14
|
+
return /* @__PURE__ */ f("g", { "data-testid": "reference-line", children: [
|
|
15
|
+
/* @__PURE__ */ i(
|
|
16
|
+
"line",
|
|
17
|
+
{
|
|
18
|
+
"data-testid": "reference-line-line",
|
|
19
|
+
...c,
|
|
20
|
+
stroke: a,
|
|
21
|
+
strokeWidth: x.line,
|
|
22
|
+
strokeDasharray: d,
|
|
23
|
+
strokeLinecap: "round"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
e && /* @__PURE__ */ i(
|
|
27
|
+
"text",
|
|
28
|
+
{
|
|
29
|
+
"data-testid": "reference-line-label",
|
|
30
|
+
x: e.x,
|
|
31
|
+
y: e.y,
|
|
32
|
+
textAnchor: e.textAnchor,
|
|
33
|
+
dominantBaseline: e.dominantBaseline,
|
|
34
|
+
style: u,
|
|
35
|
+
children: l
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
] });
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
A as ReferenceLine
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/ReferenceLine/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export type LabelAlignment = 'start' | 'center' | 'end';
|
|
2
|
+
export type LabelPosition = 'start' | 'center' | 'end';
|
|
3
|
+
export type ReferenceLineBaseProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Label text displayed near the reference line.
|
|
6
|
+
*/
|
|
7
|
+
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Horizontal pixel offset applied to the label position.
|
|
10
|
+
* @default 0
|
|
11
|
+
*/
|
|
12
|
+
labelDx?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Vertical pixel offset applied to the label position.
|
|
15
|
+
* @default 0
|
|
16
|
+
*/
|
|
17
|
+
labelDy?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Position of the label along the line.
|
|
20
|
+
* @default 'end'
|
|
21
|
+
*/
|
|
22
|
+
labelPosition?: LabelPosition;
|
|
23
|
+
/**
|
|
24
|
+
* Controls the direction the label text extends from its position.
|
|
25
|
+
* - `'start'`: text extends toward the start of the axis (left)
|
|
26
|
+
* - `'center'`: text is centered on the position
|
|
27
|
+
* - `'end'`: text extends toward the end of the axis (right)
|
|
28
|
+
*
|
|
29
|
+
* Defaults: `'center'` for vertical lines, inferred from `labelPosition` for horizontal lines.
|
|
30
|
+
*/
|
|
31
|
+
labelHorizontalAlignment?: LabelAlignment;
|
|
32
|
+
/**
|
|
33
|
+
* Controls the direction the label text extends from its position.
|
|
34
|
+
* - `'start'`: text extends toward the start of the axis (up)
|
|
35
|
+
* - `'center'`: text is vertically centered on the position
|
|
36
|
+
* - `'end'`: text extends toward the end of the axis (down)
|
|
37
|
+
*
|
|
38
|
+
* Defaults: `'end'` for horizontal lines, inferred from `labelPosition` for vertical lines.
|
|
39
|
+
*/
|
|
40
|
+
labelVerticalAlignment?: LabelAlignment;
|
|
41
|
+
/**
|
|
42
|
+
* Line color.
|
|
43
|
+
* @default cssVar('var(--border-muted)')
|
|
44
|
+
*/
|
|
45
|
+
stroke?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Line dash style.
|
|
48
|
+
* - `'dashed'`: rounded dots with `strokeDasharray="0.1 6"`
|
|
49
|
+
* - `'solid'`: continuous line
|
|
50
|
+
* @default 'dashed'
|
|
51
|
+
*/
|
|
52
|
+
lineStyle?: 'solid' | 'dashed';
|
|
53
|
+
};
|
|
54
|
+
export type HorizontalReferenceLineProps = ReferenceLineBaseProps & {
|
|
55
|
+
/**
|
|
56
|
+
* Y-axis value in data space where the horizontal line is drawn.
|
|
57
|
+
* The horizontal line is rendered at this Y position spanning the full
|
|
58
|
+
* width of the drawing area.
|
|
59
|
+
*/
|
|
60
|
+
dataY: number;
|
|
61
|
+
dataX?: never;
|
|
62
|
+
};
|
|
63
|
+
export type VerticalReferenceLineProps = ReferenceLineBaseProps & {
|
|
64
|
+
/**
|
|
65
|
+
* Data index along the X axis. When `xAxis.data` contains numeric values,
|
|
66
|
+
* the index is mapped to the corresponding axis value automatically.
|
|
67
|
+
* The vertical line is drawn at this position spanning the full height
|
|
68
|
+
* of the drawing area.
|
|
69
|
+
*/
|
|
70
|
+
dataX: number;
|
|
71
|
+
dataY?: never;
|
|
72
|
+
};
|
|
73
|
+
export type ReferenceLineProps = HorizontalReferenceLineProps | VerticalReferenceLineProps;
|
|
74
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/ReferenceLine/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AACxD,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,cAAc,CAAC;IAC1C;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,cAAc,CAAC;IACxC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,sBAAsB,GAAG;IAClE;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,sBAAsB,GAAG;IAChE;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B,4BAA4B,GAC5B,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReferenceLineProps } from './types';
|
|
2
|
+
import { LabelCoordinates } from './utils';
|
|
3
|
+
type ReferenceLineGeometry = {
|
|
4
|
+
linePoints: {
|
|
5
|
+
x1: number;
|
|
6
|
+
y1: number;
|
|
7
|
+
x2: number;
|
|
8
|
+
y2: number;
|
|
9
|
+
};
|
|
10
|
+
labelCoords: LabelCoordinates | null;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Resolves a reference line's chart geometry: reads the chart context, projects
|
|
14
|
+
* the targeted `dataX` (vertical) or `dataY` (horizontal) value to a validated
|
|
15
|
+
* pixel, and derives the line endpoints and optional label coordinates.
|
|
16
|
+
* Returns `null` when the value cannot be projected into the drawing area
|
|
17
|
+
* (see {@link resolvePixel}) or when neither axis is set.
|
|
18
|
+
*/
|
|
19
|
+
export declare const useReferenceLineGeometry: (props: Readonly<ReferenceLineProps>) => ReferenceLineGeometry | null;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=useReferenceLineGeometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReferenceLineGeometry.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/ReferenceLine/useReferenceLineGeometry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,SAAS,CAAC;AAEjB,KAAK,qBAAqB,GAAG;IAC3B,UAAU,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,WAAW,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,OAAO,QAAQ,CAAC,kBAAkB,CAAC,KAClC,qBAAqB,GAAG,IAwD1B,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { resolvePixel as n, computeHorizontalLabelCoordinates as s, computeVerticalLabelCoordinates as c } from "./utils.js";
|
|
2
|
+
import { useCartesianChartContext as g } from "../CartesianChart/context/cartesianChartContext.js";
|
|
3
|
+
const m = (e) => {
|
|
4
|
+
const { getXScale: o, getYScale: x, getXAxisConfig: r, getYAxisConfig: d, drawingArea: l } = g(), t = {
|
|
5
|
+
labelPosition: e.labelPosition ?? "end",
|
|
6
|
+
drawingArea: l,
|
|
7
|
+
dx: e.labelDx ?? 0,
|
|
8
|
+
dy: e.labelDy ?? 0,
|
|
9
|
+
horizontalAlignment: e.labelHorizontalAlignment,
|
|
10
|
+
verticalAlignment: e.labelVerticalAlignment
|
|
11
|
+
};
|
|
12
|
+
if (e.dataY !== void 0) {
|
|
13
|
+
const a = n({
|
|
14
|
+
dataValue: e.dataY,
|
|
15
|
+
scale: x(),
|
|
16
|
+
axis: "y",
|
|
17
|
+
drawingArea: l,
|
|
18
|
+
axisConfig: d()
|
|
19
|
+
});
|
|
20
|
+
return a === void 0 ? null : {
|
|
21
|
+
linePoints: {
|
|
22
|
+
x1: l.x,
|
|
23
|
+
y1: a,
|
|
24
|
+
x2: l.x + l.width,
|
|
25
|
+
y2: a
|
|
26
|
+
},
|
|
27
|
+
labelCoords: e.label ? s({ pixel: a, ...t }) : null
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const i = n({
|
|
31
|
+
dataValue: e.dataX,
|
|
32
|
+
scale: o(),
|
|
33
|
+
axis: "x",
|
|
34
|
+
drawingArea: l,
|
|
35
|
+
axisConfig: r()
|
|
36
|
+
});
|
|
37
|
+
return i === void 0 ? null : {
|
|
38
|
+
linePoints: {
|
|
39
|
+
x1: i,
|
|
40
|
+
y1: l.y,
|
|
41
|
+
x2: i,
|
|
42
|
+
y2: l.y + l.height
|
|
43
|
+
},
|
|
44
|
+
labelCoords: e.label ? c({ pixel: i, ...t }) : null
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
m as useReferenceLineGeometry
|
|
49
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BaseAxisProps } from '../Axis';
|
|
2
|
+
import { ChartScaleFunction, DrawingArea } from '../utils/types';
|
|
3
|
+
import { LabelAlignment, LabelPosition } from './types';
|
|
4
|
+
export type LabelCoordinates = {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
textAnchor: 'start' | 'middle' | 'end';
|
|
8
|
+
dominantBaseline: 'hanging' | 'central' | 'auto';
|
|
9
|
+
};
|
|
10
|
+
type ResolvePixelParams = {
|
|
11
|
+
dataValue: number;
|
|
12
|
+
scale: ChartScaleFunction | undefined;
|
|
13
|
+
axis: 'x' | 'y';
|
|
14
|
+
drawingArea: DrawingArea;
|
|
15
|
+
axisConfig?: BaseAxisProps;
|
|
16
|
+
};
|
|
17
|
+
type LabelParams = {
|
|
18
|
+
pixel: number;
|
|
19
|
+
labelPosition: LabelPosition;
|
|
20
|
+
drawingArea: DrawingArea;
|
|
21
|
+
dx?: number;
|
|
22
|
+
dy?: number;
|
|
23
|
+
horizontalAlignment?: LabelAlignment;
|
|
24
|
+
verticalAlignment?: LabelAlignment;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Checks whether a pixel coordinate falls within the drawing area
|
|
28
|
+
* along a single axis.
|
|
29
|
+
*/
|
|
30
|
+
export declare const isPixelWithinDrawingArea: (pixel: number, axis: "x" | "y", drawingArea: DrawingArea) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Resolves a data-space value to a validated pixel coordinate.
|
|
33
|
+
* When `axisConfig` is provided, the data value is first translated
|
|
34
|
+
* through the axis data array before being projected onto the scale.
|
|
35
|
+
* Returns `undefined` if the value is out of bounds, the scale is missing,
|
|
36
|
+
* the result is not finite, or the pixel falls outside the drawing area.
|
|
37
|
+
*/
|
|
38
|
+
export declare const resolvePixel: ({ dataValue, scale, axis, drawingArea, axisConfig, }: ResolvePixelParams) => number | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Computes the label pixel coordinates and text alignment attributes
|
|
41
|
+
* for a horizontal reference line.
|
|
42
|
+
*/
|
|
43
|
+
export declare const computeHorizontalLabelCoordinates: ({ pixel, labelPosition, drawingArea, dx, dy, horizontalAlignment, verticalAlignment, }: LabelParams) => LabelCoordinates;
|
|
44
|
+
/**
|
|
45
|
+
* Computes the label pixel coordinates and text alignment attributes
|
|
46
|
+
* for a vertical reference line.
|
|
47
|
+
*/
|
|
48
|
+
export declare const computeVerticalLabelCoordinates: ({ pixel, labelPosition, drawingArea, dx, dy, horizontalAlignment, verticalAlignment, }: LabelParams) => LabelCoordinates;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/ReferenceLine/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvC,gBAAgB,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;CAClD,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACtC,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mBAAmB,CAAC,EAAE,cAAc,CAAC;IACrC,iBAAiB,CAAC,EAAE,cAAc,CAAC;CACpC,CAAC;AAuBF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GACnC,OAAO,MAAM,EACb,MAAM,GAAG,GAAG,GAAG,EACf,aAAa,WAAW,KACvB,OAKF,CAAC;AAqBF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,sDAM1B,kBAAkB,KAAG,MAAM,GAAG,SAehC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAAI,wFAQ/C,WAAW,KAAG,gBAKf,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,+BAA+B,GAAI,wFAQ7C,WAAW,KAAG,gBAKf,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { isFiniteNumber as d } from "../utils/numbers.js";
|
|
2
|
+
import { isCategoricalScale as h, getPointOnScale as m } from "../utils/scales/scales.js";
|
|
3
|
+
const l = "center", f = "end", c = {
|
|
4
|
+
start: "end",
|
|
5
|
+
center: "middle",
|
|
6
|
+
end: "start"
|
|
7
|
+
}, a = {
|
|
8
|
+
start: "auto",
|
|
9
|
+
center: "central",
|
|
10
|
+
end: "hanging"
|
|
11
|
+
}, u = {
|
|
12
|
+
start: 0,
|
|
13
|
+
center: 0.5,
|
|
14
|
+
end: 1
|
|
15
|
+
}, v = (n, e, t) => e === "x" ? n >= t.x && n <= t.x + t.width : n >= t.y && n <= t.y + t.height, p = (n, e) => {
|
|
16
|
+
const t = e?.data;
|
|
17
|
+
if (!t || t.length === 0) return n;
|
|
18
|
+
if (n < 0 || n >= t.length) return;
|
|
19
|
+
const o = t[n];
|
|
20
|
+
return typeof o == "number" ? o : n;
|
|
21
|
+
}, L = ({
|
|
22
|
+
dataValue: n,
|
|
23
|
+
scale: e,
|
|
24
|
+
axis: t,
|
|
25
|
+
drawingArea: o,
|
|
26
|
+
axisConfig: s
|
|
27
|
+
}) => {
|
|
28
|
+
const r = p(n, s);
|
|
29
|
+
if (r === void 0 || !e || h(e) && e(r) === void 0)
|
|
30
|
+
return;
|
|
31
|
+
const i = m(r, e);
|
|
32
|
+
if (!(!d(i) || !v(i, t, o)))
|
|
33
|
+
return i;
|
|
34
|
+
}, D = ({
|
|
35
|
+
pixel: n,
|
|
36
|
+
labelPosition: e,
|
|
37
|
+
drawingArea: t,
|
|
38
|
+
dx: o = 0,
|
|
39
|
+
dy: s = 0,
|
|
40
|
+
horizontalAlignment: r,
|
|
41
|
+
verticalAlignment: i
|
|
42
|
+
}) => ({
|
|
43
|
+
x: t.x + t.width * u[e] + o,
|
|
44
|
+
y: n + s,
|
|
45
|
+
textAnchor: c[r ?? e],
|
|
46
|
+
dominantBaseline: a[i ?? f]
|
|
47
|
+
}), V = ({
|
|
48
|
+
pixel: n,
|
|
49
|
+
labelPosition: e,
|
|
50
|
+
drawingArea: t,
|
|
51
|
+
dx: o = 0,
|
|
52
|
+
dy: s = 0,
|
|
53
|
+
horizontalAlignment: r,
|
|
54
|
+
verticalAlignment: i
|
|
55
|
+
}) => ({
|
|
56
|
+
x: n + o,
|
|
57
|
+
y: t.y + t.height * u[e] + s,
|
|
58
|
+
textAnchor: c[r ?? l],
|
|
59
|
+
dominantBaseline: a[i ?? e]
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
D as computeHorizontalLabelCoordinates,
|
|
63
|
+
V as computeVerticalLabelCoordinates,
|
|
64
|
+
v as isPixelWithinDrawingArea,
|
|
65
|
+
L as resolvePixel
|
|
66
|
+
};
|
package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChartTooltipItemProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Memoized so it only re-renders when one of its primitive props actually
|
|
4
|
+
* changes. Combined with the stable per-index ref callbacks built in
|
|
5
|
+
* `DefaultScrubberTooltip`, this keeps the row out of the per-scrub-frame
|
|
6
|
+
* reconciliation path when its label / value / position have not changed.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ChartTooltipItem: import('react').NamedExoticComponent<Readonly<ChartTooltipItemProps>>;
|
|
9
|
+
//# sourceMappingURL=ChartTooltipItem.d.ts.map
|
package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartTooltipItem.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAiBtD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,uEAgC3B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { memo as s } from "react";
|
|
3
|
+
import { chartConfig as h } from "../../config.js";
|
|
4
|
+
const { color: l, font: t, tooltip: n } = h, p = {
|
|
5
|
+
fontSize: t.bodySize,
|
|
6
|
+
fontFamily: t.family,
|
|
7
|
+
fill: l.textMuted
|
|
8
|
+
}, x = {
|
|
9
|
+
fontSize: t.bodySize,
|
|
10
|
+
fontFamily: t.family,
|
|
11
|
+
fill: l.text,
|
|
12
|
+
fontWeight: t.bodyWeightSemiBold
|
|
13
|
+
}, z = s(function({
|
|
14
|
+
label: d,
|
|
15
|
+
value: m,
|
|
16
|
+
x: o = 0,
|
|
17
|
+
y: e = 0,
|
|
18
|
+
width: r,
|
|
19
|
+
labelRef: f,
|
|
20
|
+
valueRef: a
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ c("g", { children: [
|
|
23
|
+
/* @__PURE__ */ i(
|
|
24
|
+
"text",
|
|
25
|
+
{
|
|
26
|
+
ref: f,
|
|
27
|
+
x: o + n.paddingX,
|
|
28
|
+
y: e,
|
|
29
|
+
dominantBaseline: "middle",
|
|
30
|
+
style: p,
|
|
31
|
+
children: d
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ i(
|
|
35
|
+
"text",
|
|
36
|
+
{
|
|
37
|
+
ref: a,
|
|
38
|
+
x: o + r - n.paddingX,
|
|
39
|
+
y: e,
|
|
40
|
+
dominantBaseline: "middle",
|
|
41
|
+
textAnchor: "end",
|
|
42
|
+
style: x,
|
|
43
|
+
children: m
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] });
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
z as ChartTooltipItem
|
|
50
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ScrubberTooltipProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Default structured tooltip anchored to the scrubber line.
|
|
4
|
+
*
|
|
5
|
+
* The tooltip auto-fits its width to the rendered content via `getBBox`,
|
|
6
|
+
* with `minWidth` acting as an optional minimum width override. Use with
|
|
7
|
+
* {@link ScrubberProps.tooltip}; layout options (`offset`, `minWidth`) belong
|
|
8
|
+
* on the object returned from the `tooltip` callback. Return `{ items: [] }`
|
|
9
|
+
* from the callback to hide the tooltip at a given index.
|
|
10
|
+
*/
|
|
11
|
+
export declare function DefaultScrubberTooltip({ pixelX, drawingArea, title, items, offset, minWidth, }: Readonly<ScrubberTooltipProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
//# sourceMappingURL=DefaultScrubberTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultScrubberTooltip.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAoBrD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,WAAW,EACX,KAAK,EACL,KAAK,EACL,MAA8B,EAC9B,QAAkC,GACnC,EAAE,QAAQ,CAAC,oBAAoB,CAAC,kDAuEhC"}
|
package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsxs as S, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { chartConfig as H } from "../../config.js";
|
|
3
|
+
import { ChartTooltipItem as W } from "./ChartTooltipItem.js";
|
|
4
|
+
import { useTooltipMeasurement as w, useBuildRefSetters as h, computeTooltipWidth as B, computeTooltipHeight as M, computeTooltipX as Y, computeItemsBaseY as E } from "./utils.js";
|
|
5
|
+
const { color: I, font: f, tooltip: t } = H, X = {
|
|
6
|
+
fontSize: f.bodySize,
|
|
7
|
+
fontFamily: f.family,
|
|
8
|
+
fill: I.textMuted,
|
|
9
|
+
fontWeight: f.bodyWeightMedium
|
|
10
|
+
};
|
|
11
|
+
function k({
|
|
12
|
+
pixelX: u,
|
|
13
|
+
drawingArea: l,
|
|
14
|
+
title: n,
|
|
15
|
+
items: e,
|
|
16
|
+
offset: c = t.defaultOffset,
|
|
17
|
+
minWidth: m = t.defaultMinWidth
|
|
18
|
+
}) {
|
|
19
|
+
const o = n !== void 0, { widths: p, titleRef: g, labelRefs: y, valueRefs: b } = w(
|
|
20
|
+
e,
|
|
21
|
+
o,
|
|
22
|
+
n
|
|
23
|
+
), T = h(y, e.length), x = h(b, e.length);
|
|
24
|
+
if (e.length === 0)
|
|
25
|
+
return null;
|
|
26
|
+
const r = B(p, o, m), s = Y(u, c, r, l), R = M(e.length, o), v = E(l.y, o);
|
|
27
|
+
return /* @__PURE__ */ S(
|
|
28
|
+
"g",
|
|
29
|
+
{
|
|
30
|
+
"data-testid": "chart-tooltip",
|
|
31
|
+
role: "tooltip",
|
|
32
|
+
style: {
|
|
33
|
+
opacity: p === null ? 0 : 1,
|
|
34
|
+
transition: t.transition,
|
|
35
|
+
pointerEvents: "none"
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ a(
|
|
39
|
+
"rect",
|
|
40
|
+
{
|
|
41
|
+
x: s,
|
|
42
|
+
y: l.y,
|
|
43
|
+
width: r,
|
|
44
|
+
height: R,
|
|
45
|
+
fill: t.background,
|
|
46
|
+
style: {
|
|
47
|
+
rx: t.borderRadius
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
o && /* @__PURE__ */ a(
|
|
52
|
+
"text",
|
|
53
|
+
{
|
|
54
|
+
ref: g,
|
|
55
|
+
"data-testid": "chart-tooltip-title",
|
|
56
|
+
x: s + t.paddingX,
|
|
57
|
+
y: l.y + t.paddingY + t.rowHeight / 2,
|
|
58
|
+
dominantBaseline: "middle",
|
|
59
|
+
style: X,
|
|
60
|
+
children: n
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
e.map((d, i) => /* @__PURE__ */ a(
|
|
64
|
+
W,
|
|
65
|
+
{
|
|
66
|
+
label: d.label,
|
|
67
|
+
value: d.value,
|
|
68
|
+
x: s,
|
|
69
|
+
y: v + i * (t.rowHeight + t.rowGap) + t.rowHeight / 2,
|
|
70
|
+
width: r,
|
|
71
|
+
labelRef: T[i],
|
|
72
|
+
valueRef: x[i]
|
|
73
|
+
},
|
|
74
|
+
i
|
|
75
|
+
))
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
k as DefaultScrubberTooltip
|
|
82
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { DrawingArea } from '../../utils/types';
|
|
3
|
+
import { ChartTooltipItemData, SvgTextContent } from '../types';
|
|
4
|
+
type Widths = {
|
|
5
|
+
title: number;
|
|
6
|
+
labels: number[];
|
|
7
|
+
values: number[];
|
|
8
|
+
};
|
|
9
|
+
type UseTooltipMeasurementReturn = {
|
|
10
|
+
widths: Widths | null;
|
|
11
|
+
titleRef: RefObject<SVGTextElement | null>;
|
|
12
|
+
labelRefs: RefObject<(SVGTextElement | null)[]>;
|
|
13
|
+
valueRefs: RefObject<(SVGTextElement | null)[]>;
|
|
14
|
+
};
|
|
15
|
+
export declare const safeGetBBoxWidth: (el: SVGGraphicsElement | null) => number;
|
|
16
|
+
/**
|
|
17
|
+
* Derive the auto-fit tooltip width from measured text widths,
|
|
18
|
+
* clamped to a minimum floor.
|
|
19
|
+
*/
|
|
20
|
+
export declare const computeTooltipWidth: (widths: Widths | null, hasTitle: boolean, minWidth: number) => number;
|
|
21
|
+
/**
|
|
22
|
+
* Compute the tooltip's horizontal position, flipping to the left
|
|
23
|
+
* of the scrubber line when it would overflow the drawing area.
|
|
24
|
+
*/
|
|
25
|
+
export declare const computeTooltipX: (pixelX: number, offset: number, tooltipWidth: number, drawingArea: DrawingArea) => number;
|
|
26
|
+
/**
|
|
27
|
+
* Compute the total tooltip height from item count and title presence.
|
|
28
|
+
*/
|
|
29
|
+
export declare const computeTooltipHeight: (itemCount: number, hasTitle: boolean) => number;
|
|
30
|
+
/**
|
|
31
|
+
* Vertical offset where tooltip rows begin, accounting for title presence.
|
|
32
|
+
*/
|
|
33
|
+
export declare const computeItemsBaseY: (drawingAreaY: number, hasTitle: boolean) => number;
|
|
34
|
+
/**
|
|
35
|
+
* Manages SVG text measurement for the tooltip via `getBBox`.
|
|
36
|
+
*
|
|
37
|
+
* A single `ResizeObserver` is created on mount and reused for the component's
|
|
38
|
+
* entire lifetime, avoiding the cost of tearing down and recreating an observer
|
|
39
|
+
* on every scrubber movement.
|
|
40
|
+
*
|
|
41
|
+
* The re-measure / re-observe effect's dependency is a shape signature (labels
|
|
42
|
+
* + title + count) rather than the raw `items` reference, so high-frequency
|
|
43
|
+
* value updates during a scrub do not trigger a fresh measurement or
|
|
44
|
+
* disconnect / re-observe cycle. The `ResizeObserver` still picks up real
|
|
45
|
+
* geometry changes (e.g. value strings widening past the current rect).
|
|
46
|
+
*/
|
|
47
|
+
export declare function useTooltipMeasurement(items: ChartTooltipItemData[], hasTitle: boolean, title: SvgTextContent | undefined): UseTooltipMeasurementReturn;
|
|
48
|
+
type SvgTextRefSetter = (el: SVGTextElement | null) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Builds stable per-index ref-callback arrays that mutate the given refs in
|
|
51
|
+
* place. Recomputed only when `length` changes, so the same callback identity
|
|
52
|
+
* is passed to each `ChartTooltipItem` across scrub frames. This unlocks
|
|
53
|
+
* `React.memo` on `ChartTooltipItem` and avoids the per-frame detach /
|
|
54
|
+
* re-attach dance of inline arrow ref callbacks.
|
|
55
|
+
*/
|
|
56
|
+
export declare const useBuildRefSetters: (refs: RefObject<(SVGTextElement | null)[]>, length: number) => SvgTextRefSetter[];
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAIrE,KAAK,MAAM,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC3C,SAAS,EAAE,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;IAChD,SAAS,EAAE,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,IAAI,kBAAkB,GAAG,IAAI,KAAG,MAOhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,MAAM,GAAG,IAAI,EACrB,UAAU,OAAO,EACjB,UAAU,MAAM,KACf,MAUF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,cAAc,MAAM,EACpB,aAAa,WAAW,KACvB,MAOF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,UAAU,OAAO,KAChB,MAQF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,MAAM,EACpB,UAAU,OAAO,KAChB,MAGF,CAAC;AA4BF;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,oBAAoB,EAAE,EAC7B,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,cAAc,GAAG,SAAS,GAChC,2BAA2B,CAuD7B;AAED,KAAK,gBAAgB,GAAG,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,EAC1C,QAAQ,MAAM,KACb,gBAAgB,EAUlB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { useRef as a, useState as B, useEffect as R, useLayoutEffect as x, useMemo as W } from "react";
|
|
2
|
+
import { chartConfig as H } from "../../config.js";
|
|
3
|
+
const { tooltip: u } = H, d = (t) => {
|
|
4
|
+
if (!t || typeof t.getBBox != "function") return 0;
|
|
5
|
+
try {
|
|
6
|
+
return t.getBBox().width;
|
|
7
|
+
} catch {
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
}, w = (t, r, n) => {
|
|
11
|
+
const e = t && r ? t.title : 0, o = t ? t.labels.map(
|
|
12
|
+
(f, h) => f + u.labelValueGap + (t.values[h] ?? 0)
|
|
13
|
+
) : [], s = Math.max(e, ...o) + u.paddingX * 2;
|
|
14
|
+
return Math.max(s, n);
|
|
15
|
+
}, E = (t, r, n, e) => {
|
|
16
|
+
const o = t + r + n > e.x + e.width;
|
|
17
|
+
return Math.max(
|
|
18
|
+
e.x,
|
|
19
|
+
o ? t - r - n : t + r
|
|
20
|
+
);
|
|
21
|
+
}, T = (t, r) => {
|
|
22
|
+
const n = r ? u.rowHeight + u.titleGap : 0;
|
|
23
|
+
return u.paddingY * 2 + n + t * u.rowHeight + (t - 1) * u.rowGap;
|
|
24
|
+
}, L = (t, r) => {
|
|
25
|
+
const n = r ? u.rowHeight + u.titleGap : 0;
|
|
26
|
+
return t + u.paddingY + n;
|
|
27
|
+
}, S = (t, r, n) => {
|
|
28
|
+
let e = "";
|
|
29
|
+
for (let c = 0; c < t.length; c++) {
|
|
30
|
+
c > 0 && (e += "");
|
|
31
|
+
const s = t[c].label;
|
|
32
|
+
e += typeof s == "string" || typeof s == "number" ? String(s) : "";
|
|
33
|
+
}
|
|
34
|
+
const o = typeof n == "string" || typeof n == "number" ? String(n) : "";
|
|
35
|
+
return `${r ? "1" : "0"}|${e}|${o}`;
|
|
36
|
+
};
|
|
37
|
+
function Y(t, r, n) {
|
|
38
|
+
const e = a(null), o = a([]), c = a([]), s = a(null), f = a(() => {
|
|
39
|
+
}), [h, b] = B(null);
|
|
40
|
+
f.current = () => {
|
|
41
|
+
const p = r ? d(e.current) : 0, i = t.map(
|
|
42
|
+
(v, g) => d(o.current[g])
|
|
43
|
+
), l = t.map(
|
|
44
|
+
(v, g) => d(c.current[g])
|
|
45
|
+
);
|
|
46
|
+
b({
|
|
47
|
+
title: p,
|
|
48
|
+
labels: i,
|
|
49
|
+
values: l
|
|
50
|
+
});
|
|
51
|
+
}, R(() => {
|
|
52
|
+
if (!(typeof ResizeObserver > "u"))
|
|
53
|
+
return s.current = new ResizeObserver(() => f.current()), () => s.current?.disconnect();
|
|
54
|
+
}, []);
|
|
55
|
+
const y = S(t, r, n), m = a(t.length);
|
|
56
|
+
return m.current = t.length, x(() => {
|
|
57
|
+
const p = m.current;
|
|
58
|
+
if (p === 0) return;
|
|
59
|
+
o.current.length = p, c.current.length = p, f.current();
|
|
60
|
+
const i = s.current;
|
|
61
|
+
i && (i.disconnect(), e.current && i.observe(e.current), o.current.forEach((l) => l && i.observe(l)), c.current.forEach((l) => l && i.observe(l)));
|
|
62
|
+
}, [y]), { widths: h, titleRef: e, labelRefs: o, valueRefs: c };
|
|
63
|
+
}
|
|
64
|
+
const $ = (t, r) => W(() => {
|
|
65
|
+
const n = new Array(r);
|
|
66
|
+
for (let e = 0; e < r; e++)
|
|
67
|
+
n[e] = (o) => {
|
|
68
|
+
t.current[e] = o;
|
|
69
|
+
};
|
|
70
|
+
return n;
|
|
71
|
+
}, [t, r]);
|
|
72
|
+
export {
|
|
73
|
+
L as computeItemsBaseY,
|
|
74
|
+
T as computeTooltipHeight,
|
|
75
|
+
w as computeTooltipWidth,
|
|
76
|
+
E as computeTooltipX,
|
|
77
|
+
d as safeGetBBoxWidth,
|
|
78
|
+
$ as useBuildRefSetters,
|
|
79
|
+
Y as useTooltipMeasurement
|
|
80
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ScrubberProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Renders the scrubber visuals: vertical reference line, future-data overlay
|
|
4
|
+
* rect, per-series beacon dots, and an optional tooltip when
|
|
5
|
+
* {@link ScrubberProps.tooltip} is set, using {@link DefaultScrubberTooltip}.
|
|
6
|
+
*
|
|
7
|
+
* Must be used as a child of `LineChart` (or `CartesianChart`) with
|
|
8
|
+
* `enableScrubbing` enabled. Renders nothing when no scrubber position is active.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <LineChart series={data} enableScrubbing>
|
|
13
|
+
* <Scrubber showBeacons />
|
|
14
|
+
* </LineChart>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Tooltip
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <Scrubber
|
|
20
|
+
* tooltip={(i) => ({
|
|
21
|
+
* title: `${counts[i]} Transactions`,
|
|
22
|
+
* items: [{ label: 'Index', value: String(i) }],
|
|
23
|
+
* minWidth: 160,
|
|
24
|
+
* })}
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function Scrubber({ hideLine, hideOverlay, showBeacons, tooltip, }: Readonly<ScrubberProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
29
|
+
//# sourceMappingURL=Scrubber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Scrubber/Scrubber.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAoD7C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAgB,EAChB,WAAmB,EACnB,WAAmB,EACnB,OAAO,GACR,EAAE,QAAQ,CAAC,aAAa,CAAC,kDAwDzB"}
|