@dudousxd/nestjs-catalog-react 0.1.0
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/LICENSE-bklit +21 -0
- package/README.md +282 -0
- package/dist/AccessConsole.d.ts +40 -0
- package/dist/AccessConsole.js +160 -0
- package/dist/CatalogManager.d.ts +12 -0
- package/dist/CatalogManager.js +123 -0
- package/dist/ConnectionPanel.d.ts +41 -0
- package/dist/ConnectionPanel.js +228 -0
- package/dist/CoverageLedger.d.ts +16 -0
- package/dist/CoverageLedger.js +16 -0
- package/dist/DashboardBoard.d.ts +10 -0
- package/dist/DashboardBoard.js +206 -0
- package/dist/EditableField.d.ts +18 -0
- package/dist/EditableField.js +61 -0
- package/dist/FlowView.d.ts +13 -0
- package/dist/FlowView.js +93 -0
- package/dist/GovernanceTimeline.d.ts +16 -0
- package/dist/GovernanceTimeline.js +93 -0
- package/dist/ObjectExplorer.d.ts +9 -0
- package/dist/ObjectExplorer.js +153 -0
- package/dist/PipelineConsole.d.ts +20 -0
- package/dist/PipelineConsole.js +272 -0
- package/dist/QueryConsole.d.ts +11 -0
- package/dist/QueryConsole.js +144 -0
- package/dist/SavedQueryPanel.d.ts +16 -0
- package/dist/SavedQueryPanel.js +78 -0
- package/dist/TraceExplorer.d.ts +54 -0
- package/dist/TraceExplorer.js +342 -0
- package/dist/TransformEditor.d.ts +23 -0
- package/dist/TransformEditor.js +129 -0
- package/dist/WorkflowCanvas.d.ts +24 -0
- package/dist/WorkflowCanvas.js +701 -0
- package/dist/charts/bklit/animation.d.ts +19 -0
- package/dist/charts/bklit/animation.js +28 -0
- package/dist/charts/bklit/area-chart-loading.d.ts +33 -0
- package/dist/charts/bklit/area-chart-loading.js +30 -0
- package/dist/charts/bklit/area-chart.d.ts +47 -0
- package/dist/charts/bklit/area-chart.js +65 -0
- package/dist/charts/bklit/area-gradient-defs.d.ts +28 -0
- package/dist/charts/bklit/area-gradient-defs.js +23 -0
- package/dist/charts/bklit/area.d.ts +75 -0
- package/dist/charts/bklit/area.js +112 -0
- package/dist/charts/bklit/bar-chart-loading.d.ts +16 -0
- package/dist/charts/bklit/bar-chart-loading.js +22 -0
- package/dist/charts/bklit/bar-chart.d.ts +54 -0
- package/dist/charts/bklit/bar-chart.js +440 -0
- package/dist/charts/bklit/bar-depth-geometry.d.ts +41 -0
- package/dist/charts/bklit/bar-depth-geometry.js +46 -0
- package/dist/charts/bklit/bar-squares-layout.d.ts +36 -0
- package/dist/charts/bklit/bar-squares-layout.js +46 -0
- package/dist/charts/bklit/bar-squares.d.ts +48 -0
- package/dist/charts/bklit/bar-squares.js +206 -0
- package/dist/charts/bklit/bar-x-axis.d.ts +13 -0
- package/dist/charts/bklit/bar-x-axis.js +81 -0
- package/dist/charts/bklit/bar-y-axis.d.ts +11 -0
- package/dist/charts/bklit/bar-y-axis.js +72 -0
- package/dist/charts/bklit/bar.d.ts +40 -0
- package/dist/charts/bklit/bar.js +207 -0
- package/dist/charts/bklit/chart-child-passthrough.d.ts +25 -0
- package/dist/charts/bklit/chart-child-passthrough.js +82 -0
- package/dist/charts/bklit/chart-config-context.d.ts +34 -0
- package/dist/charts/bklit/chart-config-context.js +55 -0
- package/dist/charts/bklit/chart-context.d.ts +207 -0
- package/dist/charts/bklit/chart-context.js +200 -0
- package/dist/charts/bklit/chart-defs.d.ts +21 -0
- package/dist/charts/bklit/chart-defs.js +57 -0
- package/dist/charts/bklit/chart-formatters.d.ts +16 -0
- package/dist/charts/bklit/chart-formatters.js +26 -0
- package/dist/charts/bklit/chart-legend-hover.d.ts +21 -0
- package/dist/charts/bklit/chart-legend-hover.js +26 -0
- package/dist/charts/bklit/chart-loading-label.d.ts +9 -0
- package/dist/charts/bklit/chart-loading-label.js +29 -0
- package/dist/charts/bklit/chart-phase.d.ts +39 -0
- package/dist/charts/bklit/chart-phase.js +20 -0
- package/dist/charts/bklit/chart-reveal-clip.d.ts +32 -0
- package/dist/charts/bklit/chart-reveal-clip.js +23 -0
- package/dist/charts/bklit/dash-tail-stroke.d.ts +17 -0
- package/dist/charts/bklit/dash-tail-stroke.js +21 -0
- package/dist/charts/bklit/decimate-time-series.d.ts +18 -0
- package/dist/charts/bklit/decimate-time-series.js +120 -0
- package/dist/charts/bklit/fade-edges.d.ts +42 -0
- package/dist/charts/bklit/fade-edges.js +34 -0
- package/dist/charts/bklit/filter-data-by-x-domain.d.ts +13 -0
- package/dist/charts/bklit/filter-data-by-x-domain.js +50 -0
- package/dist/charts/bklit/generate-chart-skeleton-data.d.ts +24 -0
- package/dist/charts/bklit/generate-chart-skeleton-data.js +33 -0
- package/dist/charts/bklit/grid.d.ts +57 -0
- package/dist/charts/bklit/grid.js +88 -0
- package/dist/charts/bklit/highlight-segment-bounds.d.ts +26 -0
- package/dist/charts/bklit/highlight-segment-bounds.js +35 -0
- package/dist/charts/bklit/highlight-segment.d.ts +30 -0
- package/dist/charts/bklit/highlight-segment.js +22 -0
- package/dist/charts/bklit/indicator-fade.d.ts +23 -0
- package/dist/charts/bklit/indicator-fade.js +41 -0
- package/dist/charts/bklit/line-chart-loading.d.ts +33 -0
- package/dist/charts/bklit/line-chart-loading.js +30 -0
- package/dist/charts/bklit/line-chart.d.ts +45 -0
- package/dist/charts/bklit/line-chart.js +99 -0
- package/dist/charts/bklit/line-loading-pulse.d.ts +19 -0
- package/dist/charts/bklit/line-loading-pulse.js +132 -0
- package/dist/charts/bklit/line-loading-timing.d.ts +18 -0
- package/dist/charts/bklit/line-loading-timing.js +18 -0
- package/dist/charts/bklit/line-series-terminal-marker.d.ts +15 -0
- package/dist/charts/bklit/line-series-terminal-marker.js +54 -0
- package/dist/charts/bklit/line.d.ts +63 -0
- package/dist/charts/bklit/line.js +104 -0
- package/dist/charts/bklit/loading-sweep.d.ts +65 -0
- package/dist/charts/bklit/loading-sweep.js +182 -0
- package/dist/charts/bklit/motion-utils.d.ts +17 -0
- package/dist/charts/bklit/motion-utils.js +27 -0
- package/dist/charts/bklit/path-stroke-utils.d.ts +28 -0
- package/dist/charts/bklit/path-stroke-utils.js +64 -0
- package/dist/charts/bklit/pattern-area.d.ts +20 -0
- package/dist/charts/bklit/pattern-area.js +27 -0
- package/dist/charts/bklit/pattern-preset.d.ts +34 -0
- package/dist/charts/bklit/pattern-preset.js +82 -0
- package/dist/charts/bklit/projection-config.d.ts +19 -0
- package/dist/charts/bklit/projection-config.js +88 -0
- package/dist/charts/bklit/projection-line-end-marker.d.ts +14 -0
- package/dist/charts/bklit/projection-line-end-marker.js +35 -0
- package/dist/charts/bklit/projection-line.d.ts +39 -0
- package/dist/charts/bklit/projection-line.js +87 -0
- package/dist/charts/bklit/projection-utils.d.ts +54 -0
- package/dist/charts/bklit/projection-utils.js +252 -0
- package/dist/charts/bklit/reference-area-config.d.ts +18 -0
- package/dist/charts/bklit/reference-area-config.js +47 -0
- package/dist/charts/bklit/reference-area-registration-context.d.ts +7 -0
- package/dist/charts/bklit/reference-area-registration-context.js +15 -0
- package/dist/charts/bklit/series-bar-layout.d.ts +26 -0
- package/dist/charts/bklit/series-bar-layout.js +39 -0
- package/dist/charts/bklit/series-dash-tail-overlay.d.ts +16 -0
- package/dist/charts/bklit/series-dash-tail-overlay.js +47 -0
- package/dist/charts/bklit/series-highlight-layer.d.ts +31 -0
- package/dist/charts/bklit/series-highlight-layer.js +20 -0
- package/dist/charts/bklit/series-hover-dim.d.ts +28 -0
- package/dist/charts/bklit/series-hover-dim.js +34 -0
- package/dist/charts/bklit/series-markers.d.ts +13 -0
- package/dist/charts/bklit/series-markers.js +106 -0
- package/dist/charts/bklit/series-path-utils.d.ts +18 -0
- package/dist/charts/bklit/series-path-utils.js +68 -0
- package/dist/charts/bklit/series-point-marker.d.ts +47 -0
- package/dist/charts/bklit/series-point-marker.js +47 -0
- package/dist/charts/bklit/static-chart-preview-context.d.ts +15 -0
- package/dist/charts/bklit/static-chart-preview-context.js +20 -0
- package/dist/charts/bklit/time-series-chart-shell.d.ts +46 -0
- package/dist/charts/bklit/time-series-chart-shell.js +398 -0
- package/dist/charts/bklit/tooltip/chart-tooltip.d.ts +75 -0
- package/dist/charts/bklit/tooltip/chart-tooltip.js +158 -0
- package/dist/charts/bklit/tooltip/date-ticker.d.ts +10 -0
- package/dist/charts/bklit/tooltip/date-ticker.js +85 -0
- package/dist/charts/bklit/tooltip/index.d.ts +15 -0
- package/dist/charts/bklit/tooltip/index.js +15 -0
- package/dist/charts/bklit/tooltip/tooltip-box.d.ts +56 -0
- package/dist/charts/bklit/tooltip/tooltip-box.js +122 -0
- package/dist/charts/bklit/tooltip/tooltip-content.d.ts +26 -0
- package/dist/charts/bklit/tooltip/tooltip-content.js +8 -0
- package/dist/charts/bklit/tooltip/tooltip-dot.d.ts +27 -0
- package/dist/charts/bklit/tooltip/tooltip-dot.js +62 -0
- package/dist/charts/bklit/tooltip/tooltip-indicator.d.ts +44 -0
- package/dist/charts/bklit/tooltip/tooltip-indicator.js +73 -0
- package/dist/charts/bklit/use-animated-series-path.d.ts +18 -0
- package/dist/charts/bklit/use-animated-series-path.js +101 -0
- package/dist/charts/bklit/use-animated-y-domains.d.ts +13 -0
- package/dist/charts/bklit/use-animated-y-domains.js +158 -0
- package/dist/charts/bklit/use-chart-interaction.d.ts +40 -0
- package/dist/charts/bklit/use-chart-interaction.js +252 -0
- package/dist/charts/bklit/use-chart-phase-orchestrator.d.ts +22 -0
- package/dist/charts/bklit/use-chart-phase-orchestrator.js +147 -0
- package/dist/charts/bklit/use-enter-complete.d.ts +16 -0
- package/dist/charts/bklit/use-enter-complete.js +22 -0
- package/dist/charts/bklit/use-grid-shimmer.d.ts +15 -0
- package/dist/charts/bklit/use-grid-shimmer.js +71 -0
- package/dist/charts/bklit/use-highlight-segment.d.ts +22 -0
- package/dist/charts/bklit/use-highlight-segment.js +42 -0
- package/dist/charts/bklit/use-mount-progress.d.ts +12 -0
- package/dist/charts/bklit/use-mount-progress.js +30 -0
- package/dist/charts/bklit/use-scheduled-tooltip.d.ts +8 -0
- package/dist/charts/bklit/use-scheduled-tooltip.js +84 -0
- package/dist/charts/bklit/visx-pattern.d.ts +27 -0
- package/dist/charts/bklit/visx-pattern.js +28 -0
- package/dist/charts/bklit/x-axis.d.ts +26 -0
- package/dist/charts/bklit/x-axis.js +423 -0
- package/dist/charts/bklit/y-axis-scales.d.ts +34 -0
- package/dist/charts/bklit/y-axis-scales.js +80 -0
- package/dist/charts/bklit/y-axis-ticks.d.ts +20 -0
- package/dist/charts/bklit/y-axis-ticks.js +32 -0
- package/dist/charts/bklit/y-domain-utils.d.ts +26 -0
- package/dist/charts/bklit/y-domain-utils.js +96 -0
- package/dist/charts/bklit.d.ts +2 -0
- package/dist/charts/bklit.js +90 -0
- package/dist/charts/components/shimmering-text.d.ts +31 -0
- package/dist/charts/components/shimmering-text.js +39 -0
- package/dist/charts/css.d.ts +35 -0
- package/dist/charts/css.js +64 -0
- package/dist/charts/recharts.d.ts +28 -0
- package/dist/charts/recharts.js +48 -0
- package/dist/charts/registry.d.ts +34 -0
- package/dist/charts/registry.js +60 -0
- package/dist/charts/skeleton.d.ts +55 -0
- package/dist/charts/skeleton.js +66 -0
- package/dist/cn.d.ts +10 -0
- package/dist/cn.js +13 -0
- package/dist/context.d.ts +346 -0
- package/dist/context.js +95 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +65 -0
- package/dist/routes.d.ts +70 -0
- package/dist/routes.js +73 -0
- package/dist/source-fields.d.ts +111 -0
- package/dist/source-fields.js +204 -0
- package/dist/ui/chart.d.ts +54 -0
- package/dist/ui/chart.js +122 -0
- package/dist/ui/dialog.d.ts +27 -0
- package/dist/ui/dialog.js +24 -0
- package/dist/ui/field.d.ts +29 -0
- package/dist/ui/field.js +31 -0
- package/dist/ui/select.d.ts +42 -0
- package/dist/ui/select.js +30 -0
- package/dist/ui/sheet.d.ts +38 -0
- package/dist/ui/sheet.js +37 -0
- package/dist/ui/switch.d.ts +17 -0
- package/dist/ui/switch.js +14 -0
- package/dist/ui/tabs.d.ts +30 -0
- package/dist/ui/tabs.js +36 -0
- package/dist/ui/tooltip.d.ts +37 -0
- package/dist/ui/tooltip.js +43 -0
- package/dist/workflow/graph.d.ts +112 -0
- package/dist/workflow/graph.js +297 -0
- package/dist/workflow/index.d.ts +16 -0
- package/dist/workflow/index.js +16 -0
- package/dist/workflow/model.d.ts +151 -0
- package/dist/workflow/model.js +97 -0
- package/dist/workflow/name.d.ts +28 -0
- package/dist/workflow/name.js +28 -0
- package/dist/workflow/nodes.d.ts +40 -0
- package/dist/workflow/nodes.js +86 -0
- package/dist/workflow/validate.d.ts +104 -0
- package/dist/workflow/validate.js +199 -0
- package/package.json +148 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendored from bklit-ui — https://github.com/bklit/bklit-ui
|
|
3
|
+
* Copyright (c) 2026 uixmat. Released under the MIT licence; the full text is in
|
|
4
|
+
* LICENSE-bklit at the root of this package.
|
|
5
|
+
*
|
|
6
|
+
* Local change: the `@/lib/utils` import was repointed at this package's own
|
|
7
|
+
* `cn`, which is the same function. Nothing else is modified, so re-syncing
|
|
8
|
+
* with upstream stays a diff rather than a merge.
|
|
9
|
+
*/
|
|
10
|
+
import type { RefObject } from 'react';
|
|
11
|
+
interface SeriesHighlightLayerProps {
|
|
12
|
+
/** Caller already gated `showHighlight && showLine`; this just routes through. */
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
height: number;
|
|
15
|
+
pathRef: RefObject<SVGPathElement | null>;
|
|
16
|
+
stroke: string;
|
|
17
|
+
strokeWidth: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Self-contained hover-highlight band over a series stroke.
|
|
21
|
+
*
|
|
22
|
+
* Owns the `useHighlightSegment` subscription (which reads both stable + hover
|
|
23
|
+
* context) so the parent <Area> / <Line> can stay on the stable slice. This
|
|
24
|
+
* component still re-renders on hover — that's the price of driving the
|
|
25
|
+
* highlight band — but it's a tiny leaf so the cost is bounded to itself.
|
|
26
|
+
*/
|
|
27
|
+
export declare function SeriesHighlightLayer({ enabled, height, pathRef, stroke, strokeWidth, }: SeriesHighlightLayerProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare namespace SeriesHighlightLayer {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
31
|
+
export default SeriesHighlightLayer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useChartStable } from './chart-context';
|
|
4
|
+
import { HighlightSegment } from './highlight-segment';
|
|
5
|
+
import { useHighlightSegment } from './use-highlight-segment';
|
|
6
|
+
/**
|
|
7
|
+
* Self-contained hover-highlight band over a series stroke.
|
|
8
|
+
*
|
|
9
|
+
* Owns the `useHighlightSegment` subscription (which reads both stable + hover
|
|
10
|
+
* context) so the parent <Area> / <Line> can stay on the stable slice. This
|
|
11
|
+
* component still re-renders on hover — that's the price of driving the
|
|
12
|
+
* highlight band — but it's a tiny leaf so the cost is bounded to itself.
|
|
13
|
+
*/
|
|
14
|
+
export function SeriesHighlightLayer({ enabled, height, pathRef, stroke, strokeWidth, }) {
|
|
15
|
+
const { isLoaded } = useChartStable();
|
|
16
|
+
const { xSpring, widthSpring, isActive } = useHighlightSegment({ enabled });
|
|
17
|
+
return (_jsx(HighlightSegment, { height: height, pathRef: pathRef, stroke: stroke, strokeWidth: strokeWidth, visible: enabled && isActive && isLoaded, width: widthSpring, x: xSpring }));
|
|
18
|
+
}
|
|
19
|
+
SeriesHighlightLayer.displayName = 'SeriesHighlightLayer';
|
|
20
|
+
export default SeriesHighlightLayer;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
interface SeriesHoverDimProps {
|
|
3
|
+
/** Skip the dim entirely. */
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
/** Opacity to fade to while the chart is being hovered. */
|
|
6
|
+
dimOpacity?: number;
|
|
7
|
+
/** Tween duration in seconds. */
|
|
8
|
+
durationSec?: number;
|
|
9
|
+
/** Series index for multi-series legend hover dimming. */
|
|
10
|
+
seriesIndex?: number;
|
|
11
|
+
/** Stable chart visuals — area fill, stroke line, dashed tail, etc. */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Wraps stable series visuals with a hover-driven opacity animation.
|
|
16
|
+
*
|
|
17
|
+
* The wrapper subscribes to chart hover state internally so the parent (Area /
|
|
18
|
+
* Line) can stay on the stable context slice. Children come in as a React prop:
|
|
19
|
+
* because the parent is not re-rendering on hover, the children element
|
|
20
|
+
* reference stays identical and React skips re-rendering them when this
|
|
21
|
+
* wrapper re-renders. That keeps expensive subtrees (`SeriesDashTailOverlay`
|
|
22
|
+
* and its `getPointAtLength` binary search) quiescent on cursor motion.
|
|
23
|
+
*/
|
|
24
|
+
export declare function SeriesHoverDim({ enabled, dimOpacity, durationSec, seriesIndex, children, }: SeriesHoverDimProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare namespace SeriesHoverDim {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
28
|
+
export default SeriesHoverDim;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Vendored from bklit-ui — https://github.com/bklit/bklit-ui
|
|
5
|
+
* Copyright (c) 2026 uixmat. Released under the MIT licence; the full text is in
|
|
6
|
+
* LICENSE-bklit at the root of this package.
|
|
7
|
+
*
|
|
8
|
+
* Local change: the `@/lib/utils` import was repointed at this package's own
|
|
9
|
+
* `cn`, which is the same function. Nothing else is modified, so re-syncing
|
|
10
|
+
* with upstream stays a diff rather than a merge.
|
|
11
|
+
*/
|
|
12
|
+
import { motion } from 'motion/react';
|
|
13
|
+
import { useChartHover } from './chart-context';
|
|
14
|
+
import { useChartLegendHover } from './chart-legend-hover';
|
|
15
|
+
/**
|
|
16
|
+
* Wraps stable series visuals with a hover-driven opacity animation.
|
|
17
|
+
*
|
|
18
|
+
* The wrapper subscribes to chart hover state internally so the parent (Area /
|
|
19
|
+
* Line) can stay on the stable context slice. Children come in as a React prop:
|
|
20
|
+
* because the parent is not re-rendering on hover, the children element
|
|
21
|
+
* reference stays identical and React skips re-rendering them when this
|
|
22
|
+
* wrapper re-renders. That keeps expensive subtrees (`SeriesDashTailOverlay`
|
|
23
|
+
* and its `getPointAtLength` binary search) quiescent on cursor motion.
|
|
24
|
+
*/
|
|
25
|
+
export function SeriesHoverDim({ enabled = true, dimOpacity = 0.5, durationSec = 0.4, seriesIndex, children, }) {
|
|
26
|
+
const { tooltipData, selection } = useChartHover();
|
|
27
|
+
const { hoveredIndex: legendHoveredIndex } = useChartLegendHover();
|
|
28
|
+
const isChartHovering = tooltipData !== null || selection?.active === true;
|
|
29
|
+
const isLegendDimmed = legendHoveredIndex !== null && seriesIndex !== undefined && legendHoveredIndex !== seriesIndex;
|
|
30
|
+
const opacity = enabled && (isChartHovering || isLegendDimmed) ? dimOpacity : 1;
|
|
31
|
+
return (_jsx(motion.g, { animate: { opacity }, initial: { opacity: 1 }, transition: { duration: durationSec, ease: 'easeInOut' }, children: children }));
|
|
32
|
+
}
|
|
33
|
+
SeriesHoverDim.displayName = 'SeriesHoverDim';
|
|
34
|
+
export default SeriesHoverDim;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SeriesPointMarkerStyle } from './series-point-marker';
|
|
2
|
+
export interface SeriesMarkersProps extends SeriesPointMarkerStyle {
|
|
3
|
+
dataKey: string;
|
|
4
|
+
/** Marker fill color. Defaults to series stroke or chart palette color. */
|
|
5
|
+
fill?: string;
|
|
6
|
+
/** Whether to animate markers with clip reveal. Default: true */
|
|
7
|
+
animate?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function SeriesMarkers({ dataKey, fill, stroke, strokeWidth, ringGap, outlineWidth, outlineColor, radius, animate, fadeOnHover, inactiveOpacity, inactiveBlur, enterBlur, showActiveHighlight, }: SeriesMarkersProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare namespace SeriesMarkers {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
export default SeriesMarkers;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Vendored from bklit-ui — https://github.com/bklit/bklit-ui
|
|
5
|
+
* Copyright (c) 2026 uixmat. Released under the MIT licence; the full text is in
|
|
6
|
+
* LICENSE-bklit at the root of this package.
|
|
7
|
+
*
|
|
8
|
+
* Local change: the `@/lib/utils` import was repointed at this package's own
|
|
9
|
+
* `cn`, which is the same function. Nothing else is modified, so re-syncing
|
|
10
|
+
* with upstream stays a diff rather than a merge.
|
|
11
|
+
*/
|
|
12
|
+
import { useCallback, useMemo } from 'react';
|
|
13
|
+
import { clipRevealTransition } from './animation';
|
|
14
|
+
import { defaultScatterColors, useChartHover, useChartStable, useYScale } from './chart-context';
|
|
15
|
+
import { useChartLegendHover } from './chart-legend-hover';
|
|
16
|
+
import { SeriesPointMarker, StaticSeriesPointMarker, getSeriesMarkerVisualExtent, } from './series-point-marker';
|
|
17
|
+
export function SeriesMarkers({ dataKey, fill, stroke, strokeWidth = 2, ringGap = 2, outlineWidth = 0, outlineColor, radius = 5, animate = true, fadeOnHover = true, inactiveOpacity = 0.5, inactiveBlur = 2, enterBlur = 2, showActiveHighlight = true, }) {
|
|
18
|
+
// Stable slice only. Hover-driven dim + active-highlight live in the inner
|
|
19
|
+
// <SeriesMarkersDimWrapper> / <SeriesMarkersActiveHighlight> components, so
|
|
20
|
+
// mouse motion does not re-render the full point grid.
|
|
21
|
+
const { data, xScale, innerWidth, enterTransition, animationDuration, revealEpoch, isLoaded, xAccessor, lines, } = useChartStable();
|
|
22
|
+
const seriesIndex = useMemo(() => {
|
|
23
|
+
const index = lines.findIndex((line) => line.dataKey === dataKey);
|
|
24
|
+
return index >= 0 ? index : 0;
|
|
25
|
+
}, [lines, dataKey]);
|
|
26
|
+
const seriesConfig = lines[seriesIndex];
|
|
27
|
+
const yScale = useYScale(seriesConfig?.yAxisId);
|
|
28
|
+
const seriesColor = defaultScatterColors[seriesIndex % defaultScatterColors.length] ?? defaultScatterColors[0];
|
|
29
|
+
const resolvedFill = fill ?? seriesConfig?.stroke ?? seriesColor;
|
|
30
|
+
const resolvedStroke = stroke ?? resolvedFill;
|
|
31
|
+
const visualExtent = useMemo(() => getSeriesMarkerVisualExtent({
|
|
32
|
+
radius,
|
|
33
|
+
strokeWidth,
|
|
34
|
+
ringGap,
|
|
35
|
+
outlineWidth,
|
|
36
|
+
showActiveHighlight,
|
|
37
|
+
}), [radius, strokeWidth, ringGap, outlineWidth, showActiveHighlight]);
|
|
38
|
+
const revealDurationSec = clipRevealTransition(enterTransition).duration ?? animationDuration / 1000;
|
|
39
|
+
const enterDuration = 0.5;
|
|
40
|
+
const isRevealing = animate && !isLoaded;
|
|
41
|
+
const getY = useCallback((d) => {
|
|
42
|
+
const value = d[dataKey];
|
|
43
|
+
return typeof value === 'number' ? (yScale(value) ?? 0) : null;
|
|
44
|
+
}, [dataKey, yScale]);
|
|
45
|
+
const points = useMemo(() => data.flatMap((d, index) => {
|
|
46
|
+
const cy = getY(d);
|
|
47
|
+
if (cy === null) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
const cx = xScale(xAccessor(d)) ?? 0;
|
|
51
|
+
const leadingEdge = Math.max(0, cx - visualExtent);
|
|
52
|
+
const revealDelay = innerWidth > 0 && isRevealing ? (leadingEdge / innerWidth) * revealDurationSec : 0;
|
|
53
|
+
return [{ index, cx, cy, revealDelay }];
|
|
54
|
+
}), [data, getY, xScale, xAccessor, innerWidth, isRevealing, revealDurationSec, visualExtent]);
|
|
55
|
+
// Memo so the inner <SeriesMarkersActiveHighlight> sees a stable prop and
|
|
56
|
+
// can be cheaply re-rendered on hover without re-creating the spread.
|
|
57
|
+
const markerStyle = useMemo(() => ({
|
|
58
|
+
fill: resolvedFill,
|
|
59
|
+
stroke: resolvedStroke,
|
|
60
|
+
strokeWidth,
|
|
61
|
+
ringGap,
|
|
62
|
+
outlineWidth,
|
|
63
|
+
outlineColor,
|
|
64
|
+
radius,
|
|
65
|
+
}), [resolvedFill, resolvedStroke, strokeWidth, ringGap, outlineWidth, outlineColor, radius]);
|
|
66
|
+
if (isRevealing) {
|
|
67
|
+
return (_jsx("g", { children: points.map((point) => (_jsx(SeriesPointMarker, { cx: point.cx, cy: point.cy, dataKey: dataKey, enterBlur: enterBlur, enterDuration: enterDuration, index: point.index, revealDelay: point.revealDelay, revealEpoch: revealEpoch ?? 0, ...markerStyle }, `${dataKey}-${point.index}`))) }));
|
|
68
|
+
}
|
|
69
|
+
// Stable base layer — its children come from the parent and stay
|
|
70
|
+
// referentially identical when the dim wrapper re-renders for hover.
|
|
71
|
+
const baseMarkers = points.map((point) => (_jsx(StaticSeriesPointMarker, { cx: point.cx, cy: point.cy, ...markerStyle }, `${dataKey}-${point.index}`)));
|
|
72
|
+
const activeScale = showActiveHighlight ? 1.35 : 1;
|
|
73
|
+
return (_jsxs("g", { children: [_jsx(SeriesMarkersDimWrapper, { enabled: fadeOnHover, inactiveBlur: inactiveBlur, inactiveOpacity: inactiveOpacity, seriesIndex: seriesIndex, children: baseMarkers }), _jsx(SeriesMarkersActiveHighlight, { activeScale: activeScale, enabled: fadeOnHover, markerStyle: markerStyle, points: points })] }));
|
|
74
|
+
}
|
|
75
|
+
SeriesMarkers.displayName = 'SeriesMarkers';
|
|
76
|
+
/**
|
|
77
|
+
* Wraps the stable point grid with hover-driven opacity + blur. Subscribes to
|
|
78
|
+
* hover internally so the grid (passed as `children`) keeps a stable reference
|
|
79
|
+
* and React skips reconciling it when this wrapper re-renders.
|
|
80
|
+
*/
|
|
81
|
+
function SeriesMarkersDimWrapper({ enabled, inactiveOpacity, inactiveBlur, seriesIndex, children, }) {
|
|
82
|
+
const { tooltipData } = useChartHover();
|
|
83
|
+
const { hoveredIndex: legendHoveredIndex } = useChartLegendHover();
|
|
84
|
+
const isLegendDimmed = legendHoveredIndex !== null && legendHoveredIndex !== seriesIndex;
|
|
85
|
+
const dimBase = enabled && (tooltipData !== null || isLegendDimmed);
|
|
86
|
+
return (_jsx("g", { opacity: dimBase ? inactiveOpacity : 1, style: {
|
|
87
|
+
transition: 'opacity 0.15s ease-in-out, filter 0.15s ease-in-out',
|
|
88
|
+
filter: dimBase && inactiveBlur > 0 ? `blur(${inactiveBlur}px)` : 'none',
|
|
89
|
+
}, children: children }));
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Renders the scaled "active" marker on top of the base grid. Subscribes to
|
|
93
|
+
* hover internally; the parent doesn't re-render on cursor motion.
|
|
94
|
+
*/
|
|
95
|
+
function SeriesMarkersActiveHighlight({ enabled, points, markerStyle, activeScale, }) {
|
|
96
|
+
const { tooltipData } = useChartHover();
|
|
97
|
+
if (!enabled || tooltipData === null) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
const activePoint = points.find((point) => point.index === tooltipData.index);
|
|
101
|
+
if (!activePoint) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
return (_jsx(StaticSeriesPointMarker, { cx: activePoint.cx, cy: activePoint.cy, scale: activeScale, ...markerStyle }));
|
|
105
|
+
}
|
|
106
|
+
export default SeriesMarkers;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type CurveFactory = any;
|
|
2
|
+
export interface SeriesPathPoint {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
key: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function computeSeriesPathPoints(data: Record<string, unknown>[], xAccessor: (datum: Record<string, unknown>) => Date, xScale: (value: Date) => number | undefined, yScale: (value: number) => number | undefined, dataKey: string): SeriesPathPoint[];
|
|
8
|
+
export declare function interpolateSeriesPathPoints(from: SeriesPathPoint[], to: SeriesPathPoint[], progress: number): SeriesPathPoint[];
|
|
9
|
+
export declare function seriesPathFromPoints(points: SeriesPathPoint[], curve: CurveFactory): string;
|
|
10
|
+
export declare function seriesPathTransitionSignature({ renderData, xAccessor, dataKey, innerWidth, xDomainMin, xDomainMax, }: {
|
|
11
|
+
renderData: Record<string, unknown>[];
|
|
12
|
+
xAccessor: (datum: Record<string, unknown>) => Date;
|
|
13
|
+
dataKey: string;
|
|
14
|
+
innerWidth: number;
|
|
15
|
+
xDomainMin: number;
|
|
16
|
+
xDomainMax: number;
|
|
17
|
+
}): string;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendored from bklit-ui — https://github.com/bklit/bklit-ui
|
|
3
|
+
* Copyright (c) 2026 uixmat. Released under the MIT licence; the full text is in
|
|
4
|
+
* LICENSE-bklit at the root of this package.
|
|
5
|
+
*
|
|
6
|
+
* Local change: the `@/lib/utils` import was repointed at this package's own
|
|
7
|
+
* `cn`, which is the same function. Nothing else is modified, so re-syncing
|
|
8
|
+
* with upstream stays a diff rather than a merge.
|
|
9
|
+
*/
|
|
10
|
+
import { line as d3Line } from 'd3-shape';
|
|
11
|
+
export function computeSeriesPathPoints(data, xAccessor, xScale, yScale, dataKey) {
|
|
12
|
+
return data.map((datum, index) => {
|
|
13
|
+
const xValue = xAccessor(datum);
|
|
14
|
+
const yValue = datum[dataKey];
|
|
15
|
+
return {
|
|
16
|
+
x: xScale(xValue) ?? 0,
|
|
17
|
+
y: typeof yValue === 'number' ? (yScale(yValue) ?? 0) : 0,
|
|
18
|
+
key: String(xValue.getTime?.() ?? index),
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export function interpolateSeriesPathPoints(from, to, progress) {
|
|
23
|
+
if (progress >= 1) {
|
|
24
|
+
return to;
|
|
25
|
+
}
|
|
26
|
+
if (progress <= 0) {
|
|
27
|
+
return from.length > 0 ? from : to;
|
|
28
|
+
}
|
|
29
|
+
const fromByKey = new Map(from.map((point) => [point.key, point]));
|
|
30
|
+
return to.map((target, index) => {
|
|
31
|
+
const source = fromByKey.get(target.key);
|
|
32
|
+
if (source) {
|
|
33
|
+
return {
|
|
34
|
+
key: target.key,
|
|
35
|
+
x: source.x + (target.x - source.x) * progress,
|
|
36
|
+
y: source.y + (target.y - source.y) * progress,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const previousTarget = index > 0 ? to[index - 1] : undefined;
|
|
40
|
+
const previousSource = previousTarget ? fromByKey.get(previousTarget.key) : undefined;
|
|
41
|
+
const nextTarget = index < to.length - 1 ? to[index + 1] : undefined;
|
|
42
|
+
const nextSource = nextTarget ? fromByKey.get(nextTarget.key) : undefined;
|
|
43
|
+
const anchor = previousSource ?? nextSource ?? from[0] ?? target;
|
|
44
|
+
return {
|
|
45
|
+
key: target.key,
|
|
46
|
+
x: anchor.x + (target.x - anchor.x) * progress,
|
|
47
|
+
y: anchor.y + (target.y - anchor.y) * progress,
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
export function seriesPathFromPoints(points, curve) {
|
|
52
|
+
if (points.length === 0) {
|
|
53
|
+
return '';
|
|
54
|
+
}
|
|
55
|
+
const generator = d3Line()
|
|
56
|
+
.x((point) => point.x)
|
|
57
|
+
.y((point) => point.y)
|
|
58
|
+
.curve(curve);
|
|
59
|
+
return generator(points) ?? '';
|
|
60
|
+
}
|
|
61
|
+
export function seriesPathTransitionSignature({ renderData, xAccessor, dataKey, innerWidth, xDomainMin, xDomainMax, }) {
|
|
62
|
+
const values = renderData.map((datum) => {
|
|
63
|
+
const xValue = xAccessor(datum);
|
|
64
|
+
const yValue = datum[dataKey];
|
|
65
|
+
return `${xValue.getTime()}:${typeof yValue === 'number' ? yValue : ''}`;
|
|
66
|
+
});
|
|
67
|
+
return `${innerWidth}|${xDomainMin}|${xDomainMax}|${values.join(',')}`;
|
|
68
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface SeriesPointMarkerStyle {
|
|
2
|
+
/** Fill color for the inner circle */
|
|
3
|
+
fill?: string;
|
|
4
|
+
/** Outer ring stroke color. Default: same as `fill` */
|
|
5
|
+
stroke?: string;
|
|
6
|
+
/** Outer ring stroke width in px. Default: 2. Set to 0 to disable. */
|
|
7
|
+
strokeWidth?: number;
|
|
8
|
+
/** Gap between the inner fill and outer ring in px. Default: 2 */
|
|
9
|
+
ringGap?: number;
|
|
10
|
+
/** Optional outer outline beyond the ring. Default: 0 */
|
|
11
|
+
outlineWidth?: number;
|
|
12
|
+
/** Outer outline color. Default: same as `stroke` */
|
|
13
|
+
outlineColor?: string;
|
|
14
|
+
/** Point radius in px. Default: 5 */
|
|
15
|
+
radius?: number;
|
|
16
|
+
/** Dim non-active points while hovering. Default: true */
|
|
17
|
+
fadeOnHover?: boolean;
|
|
18
|
+
/** Opacity for non-hovered points when `fadeOnHover` is true. Default: 0.5 */
|
|
19
|
+
inactiveOpacity?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Blur in px for non-hovered points when `fadeOnHover` is true.
|
|
22
|
+
* Applied once on the dimmed layer (not per dot) for performance. Default: 2
|
|
23
|
+
*/
|
|
24
|
+
inactiveBlur?: number;
|
|
25
|
+
/** Initial blur in px during enter animation. Default: 2 */
|
|
26
|
+
enterBlur?: number;
|
|
27
|
+
/** Enlarge the active point while hovering. Default: true */
|
|
28
|
+
showActiveHighlight?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface StaticSeriesPointMarkerProps extends SeriesPointMarkerStyle {
|
|
31
|
+
cx: number;
|
|
32
|
+
cy: number;
|
|
33
|
+
scale?: number;
|
|
34
|
+
}
|
|
35
|
+
export declare const StaticSeriesPointMarker: import("react").NamedExoticComponent<StaticSeriesPointMarkerProps>;
|
|
36
|
+
export interface SeriesPointMarkerProps extends SeriesPointMarkerStyle {
|
|
37
|
+
dataKey: string;
|
|
38
|
+
index: number;
|
|
39
|
+
cx: number;
|
|
40
|
+
cy: number;
|
|
41
|
+
revealDelay: number;
|
|
42
|
+
revealEpoch: number;
|
|
43
|
+
enterDuration: number;
|
|
44
|
+
}
|
|
45
|
+
/** Motion enter marker — used only while the chart reveal is running. */
|
|
46
|
+
export declare function SeriesPointMarker({ dataKey, index, cx, cy, enterBlur, revealDelay, revealEpoch, enterDuration, fill, stroke, strokeWidth, ringGap, outlineWidth, outlineColor, radius, }: SeriesPointMarkerProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare function getSeriesMarkerVisualExtent(style: Pick<SeriesPointMarkerStyle, 'radius' | 'strokeWidth' | 'ringGap' | 'outlineWidth' | 'showActiveHighlight'>): number;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { motion } from 'motion/react';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
import { DEFAULT_CHART_ENTER_TRANSITION } from './animation';
|
|
6
|
+
function MarkerCircles({ fill, stroke, strokeWidth, ringGap, outlineWidth, outlineColor, radius, }) {
|
|
7
|
+
const resolvedStroke = stroke ?? fill ?? 'currentColor';
|
|
8
|
+
const resolvedOutlineColor = outlineColor ?? resolvedStroke;
|
|
9
|
+
const ringOuter = strokeWidth > 0 ? radius + ringGap + strokeWidth : radius;
|
|
10
|
+
const outlineRadius = outlineWidth > 0 ? ringOuter + outlineWidth / 2 : 0;
|
|
11
|
+
return (_jsxs(_Fragment, { children: [outlineWidth > 0 ? (_jsx("circle", { cx: 0, cy: 0, fill: "none", r: outlineRadius, stroke: resolvedOutlineColor, strokeWidth: outlineWidth })) : null, _jsx("circle", { cx: 0, cy: 0, fill: fill, r: radius }), strokeWidth > 0 ? (_jsx("circle", { cx: 0, cy: 0, fill: "none", r: radius + ringGap + strokeWidth / 2, stroke: resolvedStroke, strokeWidth: strokeWidth })) : null] }));
|
|
12
|
+
}
|
|
13
|
+
export const StaticSeriesPointMarker = memo(function StaticSeriesPointMarker({ cx, cy, scale = 1, fill, stroke, strokeWidth = 2, ringGap = 2, outlineWidth = 0, outlineColor, radius = 5, }) {
|
|
14
|
+
return (_jsx("g", { transform: `translate(${cx}, ${cy}) scale(${scale})`, children: _jsx(MarkerCircles, { fill: fill, outlineColor: outlineColor, outlineWidth: outlineWidth, radius: radius, ringGap: ringGap, stroke: stroke, strokeWidth: strokeWidth }) }));
|
|
15
|
+
});
|
|
16
|
+
/** Motion enter marker — used only while the chart reveal is running. */
|
|
17
|
+
export function SeriesPointMarker({ dataKey, index, cx, cy, enterBlur = 2, revealDelay, revealEpoch, enterDuration, fill, stroke, strokeWidth = 2, ringGap = 2, outlineWidth = 0, outlineColor, radius = 5, }) {
|
|
18
|
+
const variants = {
|
|
19
|
+
hidden: {
|
|
20
|
+
opacity: 0,
|
|
21
|
+
filter: `blur(${enterBlur}px)`,
|
|
22
|
+
scale: 1,
|
|
23
|
+
},
|
|
24
|
+
visible: {
|
|
25
|
+
opacity: 1,
|
|
26
|
+
filter: 'blur(0px)',
|
|
27
|
+
scale: 1,
|
|
28
|
+
transition: {
|
|
29
|
+
delay: revealDelay,
|
|
30
|
+
duration: enterDuration,
|
|
31
|
+
ease: DEFAULT_CHART_ENTER_TRANSITION.ease,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
return (_jsx("g", { transform: `translate(${cx}, ${cy})`, children: _jsx(motion.g, { animate: "visible", initial: "hidden", variants: variants, children: _jsx(MarkerCircles, { fill: fill, outlineColor: outlineColor, outlineWidth: outlineWidth, radius: radius, ringGap: ringGap, stroke: stroke, strokeWidth: strokeWidth }) }, `${dataKey}-${index}-${revealEpoch}`) }));
|
|
36
|
+
}
|
|
37
|
+
export function getSeriesMarkerVisualExtent(style) {
|
|
38
|
+
const radius = style.radius ?? 5;
|
|
39
|
+
const strokeWidth = style.strokeWidth ?? 2;
|
|
40
|
+
const ringGap = style.ringGap ?? 2;
|
|
41
|
+
const outlineWidth = style.outlineWidth ?? 0;
|
|
42
|
+
const showActiveHighlight = style.showActiveHighlight ?? true;
|
|
43
|
+
const ring = strokeWidth > 0 ? ringGap + strokeWidth : 0;
|
|
44
|
+
const outline = outlineWidth > 0 ? outlineWidth : 0;
|
|
45
|
+
const highlightPad = showActiveHighlight ? radius * 0.35 : 0;
|
|
46
|
+
return radius + ring + outline + highlightPad + 2;
|
|
47
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendored from bklit-ui — https://github.com/bklit/bklit-ui
|
|
3
|
+
* Copyright (c) 2026 uixmat. Released under the MIT licence; the full text is in
|
|
4
|
+
* LICENSE-bklit at the root of this package.
|
|
5
|
+
*
|
|
6
|
+
* Local change: the `@/lib/utils` import was repointed at this package's own
|
|
7
|
+
* `cn`, which is the same function. Nothing else is modified, so re-syncing
|
|
8
|
+
* with upstream stays a diff rather than a merge.
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from 'react';
|
|
11
|
+
/** Disables cartesian reveal clip-path for static docs previews. */
|
|
12
|
+
export declare function StaticChartPreviewProvider({ children, }: {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function useStaticChartPreview(): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Vendored from bklit-ui — https://github.com/bklit/bklit-ui
|
|
5
|
+
* Copyright (c) 2026 uixmat. Released under the MIT licence; the full text is in
|
|
6
|
+
* LICENSE-bklit at the root of this package.
|
|
7
|
+
*
|
|
8
|
+
* Local change: the `@/lib/utils` import was repointed at this package's own
|
|
9
|
+
* `cn`, which is the same function. Nothing else is modified, so re-syncing
|
|
10
|
+
* with upstream stays a diff rather than a merge.
|
|
11
|
+
*/
|
|
12
|
+
import { createContext, useContext } from 'react';
|
|
13
|
+
const StaticChartPreviewContext = createContext(false);
|
|
14
|
+
/** Disables cartesian reveal clip-path for static docs previews. */
|
|
15
|
+
export function StaticChartPreviewProvider({ children, }) {
|
|
16
|
+
return (_jsx(StaticChartPreviewContext.Provider, { value: true, children: children }));
|
|
17
|
+
}
|
|
18
|
+
export function useStaticChartPreview() {
|
|
19
|
+
return useContext(StaticChartPreviewContext);
|
|
20
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Transition } from 'motion/react';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import { type LineConfig, type Margin } from './chart-context';
|
|
4
|
+
import { type ChartPhase, type ChartStatus } from './chart-phase';
|
|
5
|
+
export interface TimeSeriesChartInnerProps {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
data: Record<string, unknown>[];
|
|
9
|
+
xDataKey: string;
|
|
10
|
+
margin: Margin;
|
|
11
|
+
animationDuration: number;
|
|
12
|
+
animationEasing?: string;
|
|
13
|
+
enterTransition?: Transition;
|
|
14
|
+
/** Signature of motion URL state — triggers reveal replay when it changes. */
|
|
15
|
+
revealSignature?: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
18
|
+
/** Series keys driving y-domain and tooltip (Line / Area / SeriesBar configs). */
|
|
19
|
+
lines: LineConfig[];
|
|
20
|
+
/** SVG clipPath id for grow animation. */
|
|
21
|
+
clipPathId: string;
|
|
22
|
+
/** Optional ComposedChart bar layout (forwarded into context). */
|
|
23
|
+
composedBarDataKeys?: string[];
|
|
24
|
+
composedBarSize?: number;
|
|
25
|
+
composedMaxBarSize?: number;
|
|
26
|
+
composedBarGap?: number;
|
|
27
|
+
composedStacked?: boolean;
|
|
28
|
+
composedStackOffsets?: Map<number, Map<string, number>>;
|
|
29
|
+
composedStackGap?: number;
|
|
30
|
+
/** When set, drives the y-axis max instead of scanning `lines` (e.g. stacked bar totals). */
|
|
31
|
+
yScaleDomainMax?: number;
|
|
32
|
+
/** Loading vs ready — drives chart phase until transition orchestration lands. */
|
|
33
|
+
chartStatus?: ChartStatus;
|
|
34
|
+
loadingLabel?: string;
|
|
35
|
+
/** Animate y-domain on status / data transitions. Default: true */
|
|
36
|
+
yDomainTween?: boolean;
|
|
37
|
+
yDomainTweenDuration?: number;
|
|
38
|
+
/** Visible x-domain for brush zoom. When set, y-domain and series use data in this range. */
|
|
39
|
+
xDomain?: [Date, Date];
|
|
40
|
+
/** Full dataset length for x-scale padding when `xDomain` is set. */
|
|
41
|
+
xDomainSlotCount?: number;
|
|
42
|
+
/** Tween y-domain when the visible x-range changes during the ready phase. */
|
|
43
|
+
tweenYDomainOnXDomainChange?: boolean;
|
|
44
|
+
onPhaseChange?: (phase: ChartPhase) => void;
|
|
45
|
+
}
|
|
46
|
+
export declare function TimeSeriesChartInner(props: TimeSeriesChartInnerProps): import("react/jsx-runtime").JSX.Element | null;
|