@aiconstructions/graficos 0.0.0-stage → 0.2.1
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/ALTERACOES.md +53 -0
- package/LICENSE-BKLIT +21 -0
- package/LICENSE-visx-pattern +21 -0
- package/README.md +188 -2
- package/dist/aic/cores.js +83 -0
- package/dist/aic/index.js +22 -0
- package/dist/aic/interacao.js +55 -0
- package/dist/charts/animation.js +55 -0
- package/dist/charts/arc-geometry.js +58 -0
- package/dist/charts/arc-path.js +15 -0
- package/dist/charts/area-chart-loading.js +89 -0
- package/dist/charts/area-chart.js +149 -0
- package/dist/charts/area-gradient-defs.js +90 -0
- package/dist/charts/area-value-label-layout.js +70 -0
- package/dist/charts/area-value-labels.js +211 -0
- package/dist/charts/area.js +272 -0
- package/dist/charts/background.js +198 -0
- package/dist/charts/band-config.js +82 -0
- package/dist/charts/band-geometry.js +186 -0
- package/dist/charts/band.js +346 -0
- package/dist/charts/bar-chart-loading.js +27 -0
- package/dist/charts/bar-chart.js +545 -0
- package/dist/charts/bar-depth-geometry.js +18 -0
- package/dist/charts/bar-depth.js +608 -0
- package/dist/charts/bar-lollipop.js +278 -0
- package/dist/charts/bar-squares-layout.js +66 -0
- package/dist/charts/bar-squares.js +467 -0
- package/dist/charts/bar-value-label-layout.js +42 -0
- package/dist/charts/bar-x-axis.js +133 -0
- package/dist/charts/bar-y-axis.js +116 -0
- package/dist/charts/bar.js +457 -0
- package/dist/charts/bollinger.js +49 -0
- package/dist/charts/candlestick-chart.js +370 -0
- package/dist/charts/candlestick.js +368 -0
- package/dist/charts/chart-brush-handle.js +91 -0
- package/dist/charts/chart-brush-layout.js +91 -0
- package/dist/charts/chart-brush-selection-overlay.js +87 -0
- package/dist/charts/chart-brush-state.js +253 -0
- package/dist/charts/chart-brush-track-overlay.js +103 -0
- package/dist/charts/chart-brush.js +517 -0
- package/dist/charts/chart-center-typography.js +8 -0
- package/dist/charts/chart-child-passthrough.js +119 -0
- package/dist/charts/chart-config-context.js +56 -0
- package/dist/charts/chart-context.js +337 -0
- package/dist/charts/chart-crosshair.js +262 -0
- package/dist/charts/chart-data-override.js +186 -0
- package/dist/charts/chart-defs.js +56 -0
- package/dist/charts/chart-formatters.js +77 -0
- package/dist/charts/chart-legend-hover.js +27 -0
- package/dist/charts/chart-legend.js +163 -0
- package/dist/charts/chart-loading-label.js +52 -0
- package/dist/charts/chart-parent-size.js +138 -0
- package/dist/charts/chart-phase.js +29 -0
- package/dist/charts/chart-reveal-clip.js +62 -0
- package/dist/charts/chart-scale.js +19 -0
- package/dist/charts/chart-stat-flow.js +72 -0
- package/dist/charts/choropleth/choropleth-background.js +29 -0
- package/dist/charts/choropleth/choropleth-camera.js +379 -0
- package/dist/charts/choropleth/choropleth-chart.js +644 -0
- package/dist/charts/choropleth/choropleth-context.js +152 -0
- package/dist/charts/choropleth/choropleth-dot-grid.js +293 -0
- package/dist/charts/choropleth/choropleth-feature.js +291 -0
- package/dist/charts/choropleth/choropleth-graticule.js +40 -0
- package/dist/charts/choropleth/choropleth-marker.js +222 -0
- package/dist/charts/choropleth/choropleth-projection.js +37 -0
- package/dist/charts/choropleth/choropleth-tooltip.js +82 -0
- package/dist/charts/choropleth/choropleth-zoom-matrix.js +150 -0
- package/dist/charts/choropleth/index.js +44 -0
- package/dist/charts/choropleth/use-choropleth-zoom-state.js +636 -0
- package/dist/charts/composed-chart.js +346 -0
- package/dist/charts/crosshair-store.js +49 -0
- package/dist/charts/dash-tail-stroke.js +58 -0
- package/dist/charts/date-pill-store.js +50 -0
- package/dist/charts/date-ranges.js +131 -0
- package/dist/charts/deadline.js +295 -0
- package/dist/charts/decimate-time-series.js +112 -0
- package/dist/charts/fade-edges.js +171 -0
- package/dist/charts/fast-path.js +78 -0
- package/dist/charts/filter-data-by-x-domain.js +45 -0
- package/dist/charts/funnel-chart.js +773 -0
- package/dist/charts/gauge-arc-layers.js +479 -0
- package/dist/charts/gauge-dial.js +329 -0
- package/dist/charts/gauge-label-layout.js +148 -0
- package/dist/charts/gauge.js +946 -0
- package/dist/charts/generate-chart-skeleton-data.js +27 -0
- package/dist/charts/gradients.js +158 -0
- package/dist/charts/grid-lines.js +114 -0
- package/dist/charts/grid.js +225 -0
- package/dist/charts/heatmap/generate-heatmap-skeleton-data.js +13 -0
- package/dist/charts/heatmap/heatmap-animation.js +128 -0
- package/dist/charts/heatmap/heatmap-cells.js +519 -0
- package/dist/charts/heatmap/heatmap-chart-loading.js +44 -0
- package/dist/charts/heatmap/heatmap-chart.js +548 -0
- package/dist/charts/heatmap/heatmap-colors.js +127 -0
- package/dist/charts/heatmap/heatmap-context.js +107 -0
- package/dist/charts/heatmap/heatmap-legend-gradient.js +97 -0
- package/dist/charts/heatmap/heatmap-legend-swatch.js +76 -0
- package/dist/charts/heatmap/heatmap-legend.js +165 -0
- package/dist/charts/heatmap/heatmap-pattern-defs.js +37 -0
- package/dist/charts/heatmap/heatmap-rect-cells.js +39 -0
- package/dist/charts/heatmap/heatmap-resolve-separator.js +84 -0
- package/dist/charts/heatmap/heatmap-separator.js +168 -0
- package/dist/charts/heatmap/heatmap-tooltip.js +73 -0
- package/dist/charts/heatmap/heatmap-utils.js +633 -0
- package/dist/charts/heatmap/heatmap-x-axis.js +79 -0
- package/dist/charts/heatmap/heatmap-y-axis.js +72 -0
- package/dist/charts/heatmap/index.js +208 -0
- package/dist/charts/highlight-segment-bounds.js +34 -0
- package/dist/charts/highlight-segment.js +119 -0
- package/dist/charts/index.js +944 -0
- package/dist/charts/indicator-fade.js +44 -0
- package/dist/charts/legend/index.js +22 -0
- package/dist/charts/legend/legend-context.js +47 -0
- package/dist/charts/legend/legend-item.js +30 -0
- package/dist/charts/legend/legend-label.js +14 -0
- package/dist/charts/legend/legend-marker.js +18 -0
- package/dist/charts/legend/legend-progress.js +39 -0
- package/dist/charts/legend/legend-value.js +31 -0
- package/dist/charts/legend/legend.js +69 -0
- package/dist/charts/line-backdrop.js +129 -0
- package/dist/charts/line-chart-loading.js +85 -0
- package/dist/charts/line-chart.js +182 -0
- package/dist/charts/line-loading-pulse.js +185 -0
- package/dist/charts/line-loading-timing.js +12 -0
- package/dist/charts/line-path.js +58 -0
- package/dist/charts/line-series-terminal-marker.js +75 -0
- package/dist/charts/line.js +499 -0
- package/dist/charts/live-line-chart.js +494 -0
- package/dist/charts/live-line.js +277 -0
- package/dist/charts/live-x-axis.js +116 -0
- package/dist/charts/live-y-axis.js +164 -0
- package/dist/charts/loading-sweep.js +344 -0
- package/dist/charts/local-point.js +56 -0
- package/dist/charts/markers/chart-markers.js +149 -0
- package/dist/charts/markers/index.js +14 -0
- package/dist/charts/markers/marker-group.js +411 -0
- package/dist/charts/motion-utils.js +29 -0
- package/dist/charts/notch-gauge-shared.js +146 -0
- package/dist/charts/particle-line.js +1340 -0
- package/dist/charts/path-stroke-utils.js +51 -0
- package/dist/charts/pattern-area.js +127 -0
- package/dist/charts/pattern-preset.js +287 -0
- package/dist/charts/pattern-tile.js +31 -0
- package/dist/charts/patterns/circles.js +62 -0
- package/dist/charts/patterns/constants.js +9 -0
- package/dist/charts/patterns/hexagons.js +38 -0
- package/dist/charts/patterns/index.js +16 -0
- package/dist/charts/patterns/lines.js +65 -0
- package/dist/charts/patterns/path.js +37 -0
- package/dist/charts/patterns/pattern.js +16 -0
- package/dist/charts/patterns/waves.js +40 -0
- package/dist/charts/pie-center-shell.js +127 -0
- package/dist/charts/pie-center.js +87 -0
- package/dist/charts/pie-chart.js +377 -0
- package/dist/charts/pie-context.js +116 -0
- package/dist/charts/pie-slice.js +394 -0
- package/dist/charts/pie-ticks.js +332 -0
- package/dist/charts/profit-loss-legend-hover.js +18 -0
- package/dist/charts/profit-loss-legend.js +53 -0
- package/dist/charts/profit-loss-line.js +162 -0
- package/dist/charts/profit-loss-segments.js +88 -0
- package/dist/charts/projection-config.js +90 -0
- package/dist/charts/projection-line-end-marker.js +50 -0
- package/dist/charts/projection-line.js +466 -0
- package/dist/charts/projection-utils.js +303 -0
- package/dist/charts/radar-area.js +192 -0
- package/dist/charts/radar-axis.js +41 -0
- package/dist/charts/radar-chart.js +184 -0
- package/dist/charts/radar-context.js +104 -0
- package/dist/charts/radar-grid.js +121 -0
- package/dist/charts/radar-labels.js +62 -0
- package/dist/charts/radial-area.js +498 -0
- package/dist/charts/radial-axis.js +652 -0
- package/dist/charts/radial-bar.js +316 -0
- package/dist/charts/radial-center.js +67 -0
- package/dist/charts/radial-chart.js +740 -0
- package/dist/charts/radial-dot-bar-layout.js +68 -0
- package/dist/charts/radial-dot-bar.js +387 -0
- package/dist/charts/radial-geometry.js +114 -0
- package/dist/charts/radial-legend.js +66 -0
- package/dist/charts/radial-line.js +280 -0
- package/dist/charts/radial-ring-bar.js +255 -0
- package/dist/charts/radial-scrubber.js +120 -0
- package/dist/charts/radial-series-color.js +10 -0
- package/dist/charts/reference-area-config.js +43 -0
- package/dist/charts/reference-area-geometry.js +76 -0
- package/dist/charts/reference-area-registration-context.js +10 -0
- package/dist/charts/reference-area.js +241 -0
- package/dist/charts/responsive-chart-label-count.js +18 -0
- package/dist/charts/ring-center.js +78 -0
- package/dist/charts/ring-chart.js +362 -0
- package/dist/charts/ring-context.js +122 -0
- package/dist/charts/ring-grid.js +175 -0
- package/dist/charts/ring-labels.js +109 -0
- package/dist/charts/ring.js +237 -0
- package/dist/charts/sankey/index.js +22 -0
- package/dist/charts/sankey/sankey-chart.js +199 -0
- package/dist/charts/sankey/sankey-context.js +32 -0
- package/dist/charts/sankey/sankey-link.js +232 -0
- package/dist/charts/sankey/sankey-node.js +348 -0
- package/dist/charts/sankey/sankey-tooltip.js +94 -0
- package/dist/charts/scatter-chart-shell.js +279 -0
- package/dist/charts/scatter-chart.js +150 -0
- package/dist/charts/scatter-jitter.js +86 -0
- package/dist/charts/scatter-svg.js +17 -0
- package/dist/charts/scatter.js +92 -0
- package/dist/charts/segment.js +107 -0
- package/dist/charts/series-bar-layout.js +42 -0
- package/dist/charts/series-bar.js +241 -0
- package/dist/charts/series-dash-tail-overlay.js +53 -0
- package/dist/charts/series-highlight-layer.js +43 -0
- package/dist/charts/series-hover-dim.js +32 -0
- package/dist/charts/series-markers.js +239 -0
- package/dist/charts/series-path-utils.js +185 -0
- package/dist/charts/series-point-marker.js +150 -0
- package/dist/charts/sparkline-geometry.js +197 -0
- package/dist/charts/sparkline.js +910 -0
- package/dist/charts/static-chart-preview-context.js +16 -0
- package/dist/charts/sunburst-breadcrumb.js +33 -0
- package/dist/charts/sunburst-center.js +37 -0
- package/dist/charts/sunburst-chart.js +408 -0
- package/dist/charts/sunburst-context.js +140 -0
- package/dist/charts/sunburst-data.js +0 -0
- package/dist/charts/sunburst-hint.js +42 -0
- package/dist/charts/sunburst-labels.js +130 -0
- package/dist/charts/sunburst-segment.js +144 -0
- package/dist/charts/sunburst.js +419 -0
- package/dist/charts/time-series-chart-shell.js +688 -0
- package/dist/charts/tooltip/chart-tooltip.js +516 -0
- package/dist/charts/tooltip/cursor-tooltip-box.js +183 -0
- package/dist/charts/tooltip/date-ticker.js +376 -0
- package/dist/charts/tooltip/index.js +32 -0
- package/dist/charts/tooltip/liquid-glass.js +142 -0
- package/dist/charts/tooltip/tooltip-box.js +502 -0
- package/dist/charts/tooltip/tooltip-content.js +59 -0
- package/dist/charts/tooltip/tooltip-dot.js +170 -0
- package/dist/charts/tooltip/tooltip-indicator.js +175 -0
- package/dist/charts/tooltip/use-delayed-tooltip-data.js +41 -0
- package/dist/charts/tooltip/use-velocity-stretch.js +52 -0
- package/dist/charts/trend-line-utils.js +64 -0
- package/dist/charts/trend-line.js +318 -0
- package/dist/charts/use-animated-band.js +175 -0
- package/dist/charts/use-animated-series-path.js +208 -0
- package/dist/charts/use-animated-y-domains.js +192 -0
- package/dist/charts/use-category-slots.js +29 -0
- package/dist/charts/use-chart-interaction.js +296 -0
- package/dist/charts/use-chart-phase-orchestrator.js +183 -0
- package/dist/charts/use-enter-complete.js +18 -0
- package/dist/charts/use-grid-shimmer.js +88 -0
- package/dist/charts/use-highlight-segment.js +65 -0
- package/dist/charts/use-mount-progress.js +23 -0
- package/dist/charts/use-scatter-chart-interaction.js +364 -0
- package/dist/charts/use-scheduled-tooltip.js +84 -0
- package/dist/charts/visx-pattern.js +30 -0
- package/dist/charts/weekends.js +174 -0
- package/dist/charts/x-axis-hover.js +46 -0
- package/dist/charts/x-axis.js +523 -0
- package/dist/charts/y-axis-scales.js +71 -0
- package/dist/charts/y-axis-ticks.js +22 -0
- package/dist/charts/y-axis.js +233 -0
- package/dist/charts/y-domain-utils.js +189 -0
- package/dist/index.d.ts +7346 -0
- package/dist/index.js +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/shimmering-text.js +54 -0
- package/package.json +78 -4
- package/tema.css +202 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { domAnimation, LazyMotion } from "motion/react";
|
|
4
|
+
import {
|
|
5
|
+
Children,
|
|
6
|
+
isValidElement,
|
|
7
|
+
memo,
|
|
8
|
+
useCallback,
|
|
9
|
+
useEffect,
|
|
10
|
+
useMemo,
|
|
11
|
+
useRef,
|
|
12
|
+
useState
|
|
13
|
+
} from "react";
|
|
14
|
+
import { cn } from "../lib/utils";
|
|
15
|
+
import { arcPath } from "./arc-path";
|
|
16
|
+
import { useChartDataOverride } from "./chart-data-override";
|
|
17
|
+
import { ParentSize } from "./chart-parent-size";
|
|
18
|
+
import {
|
|
19
|
+
defaultRingColors,
|
|
20
|
+
RingProvider,
|
|
21
|
+
ringCssVars
|
|
22
|
+
} from "./ring-context";
|
|
23
|
+
import { RING_GRID_PADDING } from "./ring-grid";
|
|
24
|
+
function isRing(child) {
|
|
25
|
+
return isValidElement(child) && typeof child.type === "function" && (child.type.displayName === "Ring" || child.type.name === "Ring");
|
|
26
|
+
}
|
|
27
|
+
function isRingGrid(child) {
|
|
28
|
+
return isValidElement(child) && typeof child.type !== "string" && child.type.displayName === "RingGrid";
|
|
29
|
+
}
|
|
30
|
+
function hasRingGrid(children) {
|
|
31
|
+
let found = false;
|
|
32
|
+
Children.forEach(children, (child) => {
|
|
33
|
+
if (isRingGrid(child)) {
|
|
34
|
+
found = true;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return found;
|
|
38
|
+
}
|
|
39
|
+
function isRingCenter(child) {
|
|
40
|
+
return isValidElement(child) && typeof child.type === "function" && (child.type.displayName === "RingCenter" || child.type.name === "RingCenter");
|
|
41
|
+
}
|
|
42
|
+
function RingChartInner(props) {
|
|
43
|
+
const size = Math.min(props.width, props.height);
|
|
44
|
+
if (size < 10) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return /* @__PURE__ */ jsx(RingChartCore, { ...props });
|
|
48
|
+
}
|
|
49
|
+
const RingChartCore = memo(function RingChartCore2({
|
|
50
|
+
width,
|
|
51
|
+
height,
|
|
52
|
+
data,
|
|
53
|
+
strokeWidth: strokeWidthProp,
|
|
54
|
+
ringGap: ringGapProp,
|
|
55
|
+
baseInnerRadius: baseInnerRadiusProp,
|
|
56
|
+
padding: paddingProp,
|
|
57
|
+
children,
|
|
58
|
+
containerRef,
|
|
59
|
+
hoveredIndexProp,
|
|
60
|
+
onHoverChange,
|
|
61
|
+
startAngle,
|
|
62
|
+
endAngle,
|
|
63
|
+
enterTransition,
|
|
64
|
+
enterStaggerScale,
|
|
65
|
+
geometryScrubbing
|
|
66
|
+
}) {
|
|
67
|
+
const [internalHoveredIndex, setInternalHoveredIndex] = useState(null);
|
|
68
|
+
const [animationKey] = useState(0);
|
|
69
|
+
const [isLoaded, setIsLoaded] = useState(false);
|
|
70
|
+
const isControlled = hoveredIndexProp !== void 0;
|
|
71
|
+
const hoveredIndex = isControlled ? hoveredIndexProp : internalHoveredIndex;
|
|
72
|
+
const setHoveredIndex = useCallback(
|
|
73
|
+
(index) => {
|
|
74
|
+
if (isControlled) {
|
|
75
|
+
onHoverChange?.(index);
|
|
76
|
+
} else {
|
|
77
|
+
setInternalHoveredIndex(index);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
[isControlled, onHoverChange]
|
|
81
|
+
);
|
|
82
|
+
const size = Math.min(width, height);
|
|
83
|
+
const center = size / 2;
|
|
84
|
+
const ringCount = data.length;
|
|
85
|
+
const padding = paddingProp ?? (hasRingGrid(children) ? RING_GRID_PADDING : 8);
|
|
86
|
+
const availableRadius = center - padding;
|
|
87
|
+
const designOuterRadius = baseInnerRadiusProp + (ringCount - 1) * (strokeWidthProp + ringGapProp) + strokeWidthProp;
|
|
88
|
+
const scale = Math.min(1, availableRadius / designOuterRadius);
|
|
89
|
+
const strokeWidth = strokeWidthProp * scale;
|
|
90
|
+
const ringGap = ringGapProp * scale;
|
|
91
|
+
const baseInnerRadius = baseInnerRadiusProp * scale;
|
|
92
|
+
const totalValue = useMemo(
|
|
93
|
+
() => data.reduce((sum, d) => sum + d.value, 0),
|
|
94
|
+
[data]
|
|
95
|
+
);
|
|
96
|
+
const getColor = useCallback(
|
|
97
|
+
(index) => {
|
|
98
|
+
const item = data[index];
|
|
99
|
+
if (item?.color) {
|
|
100
|
+
return item.color;
|
|
101
|
+
}
|
|
102
|
+
return defaultRingColors[index % defaultRingColors.length];
|
|
103
|
+
},
|
|
104
|
+
[data]
|
|
105
|
+
);
|
|
106
|
+
const getRingRadii = useCallback(
|
|
107
|
+
(index) => {
|
|
108
|
+
const innerRadius = baseInnerRadius + index * (strokeWidth + ringGap);
|
|
109
|
+
const outerRadius = innerRadius + strokeWidth;
|
|
110
|
+
return { innerRadius, outerRadius };
|
|
111
|
+
},
|
|
112
|
+
[baseInnerRadius, strokeWidth, ringGap]
|
|
113
|
+
);
|
|
114
|
+
const arcRange = endAngle - startAngle;
|
|
115
|
+
const scrubRingLayers = useMemo(() => {
|
|
116
|
+
if (!geometryScrubbing) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
return data.map((ringData, index) => {
|
|
120
|
+
const { innerRadius, outerRadius } = getRingRadii(index);
|
|
121
|
+
const cornerRadius = (outerRadius - innerRadius) / 2;
|
|
122
|
+
const progress = ringData.value / ringData.maxValue;
|
|
123
|
+
const progressEndAngle = startAngle + arcRange * progress;
|
|
124
|
+
return {
|
|
125
|
+
bgPath: arcPath(
|
|
126
|
+
innerRadius,
|
|
127
|
+
outerRadius,
|
|
128
|
+
startAngle,
|
|
129
|
+
endAngle,
|
|
130
|
+
cornerRadius
|
|
131
|
+
),
|
|
132
|
+
progressPath: progressEndAngle <= startAngle + 0.01 ? "" : arcPath(
|
|
133
|
+
innerRadius,
|
|
134
|
+
outerRadius,
|
|
135
|
+
startAngle,
|
|
136
|
+
progressEndAngle,
|
|
137
|
+
cornerRadius
|
|
138
|
+
),
|
|
139
|
+
color: getColor(index)
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
}, [
|
|
143
|
+
geometryScrubbing,
|
|
144
|
+
data,
|
|
145
|
+
getRingRadii,
|
|
146
|
+
getColor,
|
|
147
|
+
startAngle,
|
|
148
|
+
endAngle,
|
|
149
|
+
arcRange
|
|
150
|
+
]);
|
|
151
|
+
const effectiveIsLoaded = geometryScrubbing || isLoaded;
|
|
152
|
+
const [enterKey, setEnterKey] = useState({
|
|
153
|
+
enterTransition,
|
|
154
|
+
enterStaggerScale,
|
|
155
|
+
geometryScrubbing
|
|
156
|
+
});
|
|
157
|
+
if (enterKey.enterTransition !== enterTransition || enterKey.enterStaggerScale !== enterStaggerScale || enterKey.geometryScrubbing !== geometryScrubbing) {
|
|
158
|
+
setEnterKey({ enterTransition, enterStaggerScale, geometryScrubbing });
|
|
159
|
+
if (!geometryScrubbing) {
|
|
160
|
+
setIsLoaded(false);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
if (geometryScrubbing) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const timer = setTimeout(() => {
|
|
168
|
+
setIsLoaded(true);
|
|
169
|
+
}, 100);
|
|
170
|
+
return () => clearTimeout(timer);
|
|
171
|
+
}, [enterTransition, enterStaggerScale, geometryScrubbing]);
|
|
172
|
+
const { svgChildren, centerChildren } = useMemo(() => {
|
|
173
|
+
const svgNodes = [];
|
|
174
|
+
const centerNodes = [];
|
|
175
|
+
Children.forEach(children, (child) => {
|
|
176
|
+
if (isRingCenter(child)) {
|
|
177
|
+
centerNodes.push(child);
|
|
178
|
+
} else if (geometryScrubbing && isRing(child)) {
|
|
179
|
+
return;
|
|
180
|
+
} else {
|
|
181
|
+
svgNodes.push(child);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
return { svgChildren: svgNodes, centerChildren: centerNodes };
|
|
185
|
+
}, [children, geometryScrubbing]);
|
|
186
|
+
const contextValue = useMemo(
|
|
187
|
+
() => ({
|
|
188
|
+
data,
|
|
189
|
+
size,
|
|
190
|
+
center,
|
|
191
|
+
strokeWidth,
|
|
192
|
+
ringGap,
|
|
193
|
+
baseInnerRadius,
|
|
194
|
+
hoveredIndex,
|
|
195
|
+
setHoveredIndex,
|
|
196
|
+
animationKey,
|
|
197
|
+
isLoaded: effectiveIsLoaded,
|
|
198
|
+
enterTransition,
|
|
199
|
+
enterStaggerScale,
|
|
200
|
+
containerRef,
|
|
201
|
+
totalValue,
|
|
202
|
+
getColor,
|
|
203
|
+
getRingRadii,
|
|
204
|
+
startAngle,
|
|
205
|
+
endAngle,
|
|
206
|
+
geometryScrubbing
|
|
207
|
+
}),
|
|
208
|
+
[
|
|
209
|
+
data,
|
|
210
|
+
size,
|
|
211
|
+
center,
|
|
212
|
+
strokeWidth,
|
|
213
|
+
ringGap,
|
|
214
|
+
baseInnerRadius,
|
|
215
|
+
hoveredIndex,
|
|
216
|
+
setHoveredIndex,
|
|
217
|
+
animationKey,
|
|
218
|
+
effectiveIsLoaded,
|
|
219
|
+
enterTransition,
|
|
220
|
+
enterStaggerScale,
|
|
221
|
+
containerRef,
|
|
222
|
+
totalValue,
|
|
223
|
+
getColor,
|
|
224
|
+
getRingRadii,
|
|
225
|
+
startAngle,
|
|
226
|
+
endAngle,
|
|
227
|
+
geometryScrubbing
|
|
228
|
+
]
|
|
229
|
+
);
|
|
230
|
+
return /* @__PURE__ */ jsx(RingProvider, { value: contextValue, children: /* @__PURE__ */ jsxs(
|
|
231
|
+
"div",
|
|
232
|
+
{
|
|
233
|
+
className: "grid",
|
|
234
|
+
style: {
|
|
235
|
+
gridTemplateColumns: "1fr",
|
|
236
|
+
gridTemplateRows: "1fr",
|
|
237
|
+
width: size,
|
|
238
|
+
height: size
|
|
239
|
+
},
|
|
240
|
+
children: [
|
|
241
|
+
/* @__PURE__ */ jsx(
|
|
242
|
+
"svg",
|
|
243
|
+
{
|
|
244
|
+
"aria-hidden": "true",
|
|
245
|
+
height: size,
|
|
246
|
+
style: {
|
|
247
|
+
gridArea: "1 / 1",
|
|
248
|
+
// No `paint` containment: it clips hover glow at the svg box.
|
|
249
|
+
contain: "layout style",
|
|
250
|
+
overflow: "visible"
|
|
251
|
+
},
|
|
252
|
+
width: size,
|
|
253
|
+
children: /* @__PURE__ */ jsxs("g", { transform: `translate(${center}, ${center})`, children: [
|
|
254
|
+
scrubRingLayers ? scrubRingLayers.map((layer, index) => /* @__PURE__ */ jsxs("g", { children: [
|
|
255
|
+
/* @__PURE__ */ jsx("path", { d: layer.bgPath, fill: ringCssVars.ringBackground }),
|
|
256
|
+
layer.progressPath ? /* @__PURE__ */ jsx("path", { d: layer.progressPath, fill: layer.color }) : null
|
|
257
|
+
] }, data[index]?.label ?? index)) : null,
|
|
258
|
+
svgChildren
|
|
259
|
+
] })
|
|
260
|
+
}
|
|
261
|
+
),
|
|
262
|
+
centerChildren.length > 0 && /* @__PURE__ */ jsx(
|
|
263
|
+
"div",
|
|
264
|
+
{
|
|
265
|
+
className: "pointer-events-none flex items-center justify-center",
|
|
266
|
+
style: { gridArea: "1 / 1" },
|
|
267
|
+
children: centerChildren
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
) });
|
|
273
|
+
}, ringChartCorePropsEqual);
|
|
274
|
+
function ringChartCorePropsEqual(prev, next) {
|
|
275
|
+
return prev.width === next.width && prev.height === next.height && prev.data === next.data && prev.strokeWidth === next.strokeWidth && prev.ringGap === next.ringGap && prev.baseInnerRadius === next.baseInnerRadius && prev.padding === next.padding && prev.hoveredIndexProp === next.hoveredIndexProp && prev.onHoverChange === next.onHoverChange && prev.startAngle === next.startAngle && prev.endAngle === next.endAngle && prev.enterTransition === next.enterTransition && prev.enterStaggerScale === next.enterStaggerScale && prev.geometryScrubbing === next.geometryScrubbing && prev.children === next.children;
|
|
276
|
+
}
|
|
277
|
+
function RingChart({
|
|
278
|
+
data: dataProp,
|
|
279
|
+
size: fixedSize,
|
|
280
|
+
strokeWidth = 12,
|
|
281
|
+
ringGap = 6,
|
|
282
|
+
baseInnerRadius = 60,
|
|
283
|
+
padding,
|
|
284
|
+
className = "",
|
|
285
|
+
hoveredIndex,
|
|
286
|
+
onHoverChange,
|
|
287
|
+
startAngle = -Math.PI / 2,
|
|
288
|
+
endAngle = 3 * Math.PI / 2,
|
|
289
|
+
enterTransition,
|
|
290
|
+
enterStaggerScale = 1,
|
|
291
|
+
geometryScrubbing = false,
|
|
292
|
+
children
|
|
293
|
+
}) {
|
|
294
|
+
const { data } = useChartDataOverride("RingChart", {
|
|
295
|
+
data: dataProp
|
|
296
|
+
});
|
|
297
|
+
const containerRef = useRef(null);
|
|
298
|
+
if (fixedSize) {
|
|
299
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
|
|
300
|
+
"div",
|
|
301
|
+
{
|
|
302
|
+
className: cn("relative flex items-center justify-center", className),
|
|
303
|
+
ref: containerRef,
|
|
304
|
+
style: { width: fixedSize, height: fixedSize },
|
|
305
|
+
children: /* @__PURE__ */ jsx(
|
|
306
|
+
RingChartInner,
|
|
307
|
+
{
|
|
308
|
+
baseInnerRadius,
|
|
309
|
+
containerRef,
|
|
310
|
+
data,
|
|
311
|
+
endAngle,
|
|
312
|
+
enterStaggerScale,
|
|
313
|
+
enterTransition,
|
|
314
|
+
geometryScrubbing,
|
|
315
|
+
height: fixedSize,
|
|
316
|
+
hoveredIndexProp: hoveredIndex,
|
|
317
|
+
onHoverChange,
|
|
318
|
+
padding,
|
|
319
|
+
ringGap,
|
|
320
|
+
startAngle,
|
|
321
|
+
strokeWidth,
|
|
322
|
+
width: fixedSize,
|
|
323
|
+
children
|
|
324
|
+
}
|
|
325
|
+
)
|
|
326
|
+
}
|
|
327
|
+
) });
|
|
328
|
+
}
|
|
329
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
|
|
330
|
+
"div",
|
|
331
|
+
{
|
|
332
|
+
className: cn("relative aspect-square w-full", className),
|
|
333
|
+
ref: containerRef,
|
|
334
|
+
children: /* @__PURE__ */ jsx(ParentSize, { debounceTime: 10, children: ({ width, height }) => /* @__PURE__ */ jsx(
|
|
335
|
+
RingChartInner,
|
|
336
|
+
{
|
|
337
|
+
baseInnerRadius,
|
|
338
|
+
containerRef,
|
|
339
|
+
data,
|
|
340
|
+
endAngle,
|
|
341
|
+
enterStaggerScale,
|
|
342
|
+
enterTransition,
|
|
343
|
+
geometryScrubbing,
|
|
344
|
+
height,
|
|
345
|
+
hoveredIndexProp: hoveredIndex,
|
|
346
|
+
onHoverChange,
|
|
347
|
+
padding,
|
|
348
|
+
ringGap,
|
|
349
|
+
startAngle,
|
|
350
|
+
strokeWidth,
|
|
351
|
+
width,
|
|
352
|
+
children
|
|
353
|
+
}
|
|
354
|
+
) })
|
|
355
|
+
}
|
|
356
|
+
) });
|
|
357
|
+
}
|
|
358
|
+
var ring_chart_default = RingChart;
|
|
359
|
+
export {
|
|
360
|
+
RingChart,
|
|
361
|
+
ring_chart_default as default
|
|
362
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
useContext,
|
|
6
|
+
useMemo
|
|
7
|
+
} from "react";
|
|
8
|
+
const ringCssVars = {
|
|
9
|
+
background: "var(--chart-background)",
|
|
10
|
+
foreground: "var(--chart-foreground)",
|
|
11
|
+
foregroundMuted: "var(--chart-foreground-muted)",
|
|
12
|
+
label: "var(--chart-label)",
|
|
13
|
+
ringBackground: "var(--chart-border)",
|
|
14
|
+
// Default ring colors from chart palette
|
|
15
|
+
ring1: "var(--chart-1)",
|
|
16
|
+
ring2: "var(--chart-2)",
|
|
17
|
+
ring3: "var(--chart-3)",
|
|
18
|
+
ring4: "var(--chart-4)",
|
|
19
|
+
ring5: "var(--chart-5)"
|
|
20
|
+
};
|
|
21
|
+
const defaultRingColors = [
|
|
22
|
+
ringCssVars.ring1,
|
|
23
|
+
ringCssVars.ring2,
|
|
24
|
+
ringCssVars.ring3,
|
|
25
|
+
ringCssVars.ring4,
|
|
26
|
+
ringCssVars.ring5
|
|
27
|
+
];
|
|
28
|
+
function getRingHitRadii(index, baseInnerRadius, strokeWidth, ringGap) {
|
|
29
|
+
const halfGap = Math.max(0, ringGap) / 2;
|
|
30
|
+
const bandInner = baseInnerRadius + index * (strokeWidth + ringGap);
|
|
31
|
+
return {
|
|
32
|
+
innerRadius: Math.max(0, bandInner - halfGap),
|
|
33
|
+
outerRadius: bandInner + strokeWidth + halfGap
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const RingStableContext = createContext(null);
|
|
37
|
+
const RingHoverContext = createContext(null);
|
|
38
|
+
function RingProvider({
|
|
39
|
+
children,
|
|
40
|
+
value
|
|
41
|
+
}) {
|
|
42
|
+
const stable = useMemo(
|
|
43
|
+
() => ({
|
|
44
|
+
data: value.data,
|
|
45
|
+
size: value.size,
|
|
46
|
+
center: value.center,
|
|
47
|
+
strokeWidth: value.strokeWidth,
|
|
48
|
+
ringGap: value.ringGap,
|
|
49
|
+
baseInnerRadius: value.baseInnerRadius,
|
|
50
|
+
animationKey: value.animationKey,
|
|
51
|
+
isLoaded: value.isLoaded,
|
|
52
|
+
enterTransition: value.enterTransition,
|
|
53
|
+
enterStaggerScale: value.enterStaggerScale,
|
|
54
|
+
containerRef: value.containerRef,
|
|
55
|
+
totalValue: value.totalValue,
|
|
56
|
+
getColor: value.getColor,
|
|
57
|
+
getRingRadii: value.getRingRadii,
|
|
58
|
+
startAngle: value.startAngle,
|
|
59
|
+
endAngle: value.endAngle,
|
|
60
|
+
geometryScrubbing: value.geometryScrubbing
|
|
61
|
+
}),
|
|
62
|
+
[
|
|
63
|
+
value.data,
|
|
64
|
+
value.size,
|
|
65
|
+
value.center,
|
|
66
|
+
value.strokeWidth,
|
|
67
|
+
value.ringGap,
|
|
68
|
+
value.baseInnerRadius,
|
|
69
|
+
value.animationKey,
|
|
70
|
+
value.isLoaded,
|
|
71
|
+
value.enterTransition,
|
|
72
|
+
value.enterStaggerScale,
|
|
73
|
+
value.containerRef,
|
|
74
|
+
value.totalValue,
|
|
75
|
+
value.getColor,
|
|
76
|
+
value.getRingRadii,
|
|
77
|
+
value.startAngle,
|
|
78
|
+
value.endAngle,
|
|
79
|
+
value.geometryScrubbing
|
|
80
|
+
]
|
|
81
|
+
);
|
|
82
|
+
const hover = useMemo(
|
|
83
|
+
() => ({
|
|
84
|
+
hoveredIndex: value.hoveredIndex,
|
|
85
|
+
setHoveredIndex: value.setHoveredIndex
|
|
86
|
+
}),
|
|
87
|
+
[value.hoveredIndex, value.setHoveredIndex]
|
|
88
|
+
);
|
|
89
|
+
return /* @__PURE__ */ jsx(RingStableContext.Provider, { value: stable, children: /* @__PURE__ */ jsx(RingHoverContext.Provider, { value: hover, children }) });
|
|
90
|
+
}
|
|
91
|
+
function useRingStable() {
|
|
92
|
+
const context = useContext(RingStableContext);
|
|
93
|
+
if (!context) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
"useRingStable must be used within a RingProvider. Make sure your component is wrapped in <RingChart>."
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
return context;
|
|
99
|
+
}
|
|
100
|
+
function useRingHover() {
|
|
101
|
+
const context = useContext(RingHoverContext);
|
|
102
|
+
if (!context) {
|
|
103
|
+
throw new Error(
|
|
104
|
+
"useRingHover must be used within a RingProvider. Make sure your component is wrapped in <RingChart>."
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return context;
|
|
108
|
+
}
|
|
109
|
+
function useRing() {
|
|
110
|
+
return { ...useRingStable(), ...useRingHover() };
|
|
111
|
+
}
|
|
112
|
+
var ring_context_default = RingStableContext;
|
|
113
|
+
export {
|
|
114
|
+
RingProvider,
|
|
115
|
+
ring_context_default as default,
|
|
116
|
+
defaultRingColors,
|
|
117
|
+
getRingHitRadii,
|
|
118
|
+
ringCssVars,
|
|
119
|
+
useRing,
|
|
120
|
+
useRingHover,
|
|
121
|
+
useRingStable
|
|
122
|
+
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { m, useReducedMotion } from "motion/react";
|
|
4
|
+
import { memo, useMemo } from "react";
|
|
5
|
+
import {
|
|
6
|
+
GRID_ANGLE_LABEL_FADE_S,
|
|
7
|
+
GRID_ANGLE_LABEL_STAGGER_S,
|
|
8
|
+
GRID_RING_STAGGER_S,
|
|
9
|
+
GRID_SPOKE_SPRING,
|
|
10
|
+
GRID_SPOKE_STAGGER_S,
|
|
11
|
+
gridLabelDelay
|
|
12
|
+
} from "./animation";
|
|
13
|
+
import {
|
|
14
|
+
isFullArc,
|
|
15
|
+
outsideArcLabelPoint,
|
|
16
|
+
polarToCartesian
|
|
17
|
+
} from "./arc-geometry";
|
|
18
|
+
import { transitionWithDelay } from "./motion-utils";
|
|
19
|
+
import { ringCssVars, useRingStable } from "./ring-context";
|
|
20
|
+
const defaultTickFormat = (fraction) => `${Math.round(fraction * 100)}%`;
|
|
21
|
+
const RING_GRID_PADDING = 32;
|
|
22
|
+
function resolveTicks(ticks, fullCircle) {
|
|
23
|
+
const list = typeof ticks === "number" ? Array.from(
|
|
24
|
+
{ length: Math.max(1, Math.round(ticks)) + 1 },
|
|
25
|
+
(_, i) => i / Math.max(1, Math.round(ticks))
|
|
26
|
+
) : ticks;
|
|
27
|
+
const clamped = list.filter((t) => t >= 0 && t <= 1);
|
|
28
|
+
return fullCircle && clamped.includes(0) ? clamped.filter((t) => t < 1) : clamped;
|
|
29
|
+
}
|
|
30
|
+
const RingGrid = memo(function RingGrid2({
|
|
31
|
+
ticks = 4,
|
|
32
|
+
tickFormat = defaultTickFormat,
|
|
33
|
+
showSpokes = true,
|
|
34
|
+
showLabels = true,
|
|
35
|
+
stroke = ringCssVars.foreground,
|
|
36
|
+
strokeOpacity = 0.2,
|
|
37
|
+
tickLength = 4,
|
|
38
|
+
labelColor = ringCssVars.label,
|
|
39
|
+
fontSize: fontSizeProp,
|
|
40
|
+
labelOffset = 4
|
|
41
|
+
}) {
|
|
42
|
+
const {
|
|
43
|
+
data,
|
|
44
|
+
size,
|
|
45
|
+
startAngle,
|
|
46
|
+
endAngle,
|
|
47
|
+
getRingRadii,
|
|
48
|
+
enterTransition,
|
|
49
|
+
enterStaggerScale,
|
|
50
|
+
animationKey,
|
|
51
|
+
geometryScrubbing
|
|
52
|
+
} = useRingStable();
|
|
53
|
+
const reducedMotion = useReducedMotion() ?? false;
|
|
54
|
+
const isStatic = reducedMotion || geometryScrubbing;
|
|
55
|
+
const fontSize = fontSizeProp ?? Math.min(12, Math.max(9, size / 26));
|
|
56
|
+
const ringCount = data.length;
|
|
57
|
+
const geometry = useMemo(() => {
|
|
58
|
+
if (ringCount === 0) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const inner = getRingRadii(0).innerRadius;
|
|
62
|
+
const outer = getRingRadii(ringCount - 1).outerRadius + tickLength;
|
|
63
|
+
const span = endAngle - startAngle;
|
|
64
|
+
return resolveTicks(ticks, isFullArc(startAngle, endAngle)).map(
|
|
65
|
+
(fraction) => {
|
|
66
|
+
const angle = startAngle + span * fraction;
|
|
67
|
+
const text = tickFormat(fraction);
|
|
68
|
+
return {
|
|
69
|
+
key: `tick-${fraction}`,
|
|
70
|
+
text,
|
|
71
|
+
a: polarToCartesian(angle, inner),
|
|
72
|
+
b: polarToCartesian(angle, outer),
|
|
73
|
+
label: outsideArcLabelPoint(
|
|
74
|
+
angle,
|
|
75
|
+
outer,
|
|
76
|
+
labelOffset,
|
|
77
|
+
text.length * fontSize * 0.62,
|
|
78
|
+
fontSize
|
|
79
|
+
)
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}, [
|
|
84
|
+
ringCount,
|
|
85
|
+
getRingRadii,
|
|
86
|
+
tickLength,
|
|
87
|
+
startAngle,
|
|
88
|
+
endAngle,
|
|
89
|
+
ticks,
|
|
90
|
+
tickFormat,
|
|
91
|
+
labelOffset,
|
|
92
|
+
fontSize
|
|
93
|
+
]);
|
|
94
|
+
if (!geometry) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
const spokeStagger = GRID_SPOKE_STAGGER_S * enterStaggerScale;
|
|
98
|
+
const labelDelay = gridLabelDelay(
|
|
99
|
+
ringCount,
|
|
100
|
+
GRID_RING_STAGGER_S * enterStaggerScale
|
|
101
|
+
);
|
|
102
|
+
const labelStagger = GRID_ANGLE_LABEL_STAGGER_S * enterStaggerScale;
|
|
103
|
+
const spokes = showSpokes ? /* @__PURE__ */ jsx("g", { stroke, strokeLinecap: "round", strokeOpacity, children: geometry.map(
|
|
104
|
+
(t, i) => isStatic ? /* @__PURE__ */ jsx("line", { x1: t.a.x, x2: t.b.x, y1: t.a.y, y2: t.b.y }, t.key) : (
|
|
105
|
+
// RadarAxis: each spoke extends from its inner end outward.
|
|
106
|
+
/* @__PURE__ */ jsx(
|
|
107
|
+
m.line,
|
|
108
|
+
{
|
|
109
|
+
animate: { x2: t.b.x, y2: t.b.y },
|
|
110
|
+
initial: { x2: t.a.x, y2: t.a.y },
|
|
111
|
+
transition: transitionWithDelay(
|
|
112
|
+
enterTransition,
|
|
113
|
+
i * spokeStagger,
|
|
114
|
+
GRID_SPOKE_SPRING
|
|
115
|
+
),
|
|
116
|
+
x1: t.a.x,
|
|
117
|
+
y1: t.a.y
|
|
118
|
+
},
|
|
119
|
+
`${t.key}-${animationKey}`
|
|
120
|
+
)
|
|
121
|
+
)
|
|
122
|
+
) }) : null;
|
|
123
|
+
const labels = showLabels ? /* @__PURE__ */ jsx(
|
|
124
|
+
"g",
|
|
125
|
+
{
|
|
126
|
+
className: "font-mono tabular-nums",
|
|
127
|
+
fill: labelColor,
|
|
128
|
+
fontSize,
|
|
129
|
+
style: { fill: labelColor },
|
|
130
|
+
children: geometry.map((t, i) => {
|
|
131
|
+
const text = /* @__PURE__ */ jsx(
|
|
132
|
+
"text",
|
|
133
|
+
{
|
|
134
|
+
dominantBaseline: "central",
|
|
135
|
+
textAnchor: "middle",
|
|
136
|
+
x: t.label.x,
|
|
137
|
+
y: t.label.y,
|
|
138
|
+
children: t.text
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
if (isStatic) {
|
|
142
|
+
return /* @__PURE__ */ jsx("g", { children: text }, t.key);
|
|
143
|
+
}
|
|
144
|
+
return /* @__PURE__ */ jsx(
|
|
145
|
+
m.g,
|
|
146
|
+
{
|
|
147
|
+
animate: { opacity: 1, x: 0, y: 0 },
|
|
148
|
+
initial: { opacity: 0, x: -t.label.x, y: -t.label.y },
|
|
149
|
+
transition: {
|
|
150
|
+
opacity: {
|
|
151
|
+
duration: GRID_ANGLE_LABEL_FADE_S,
|
|
152
|
+
delay: labelDelay + i * labelStagger
|
|
153
|
+
},
|
|
154
|
+
x: GRID_SPOKE_SPRING,
|
|
155
|
+
y: GRID_SPOKE_SPRING
|
|
156
|
+
},
|
|
157
|
+
children: text
|
|
158
|
+
},
|
|
159
|
+
`${t.key}-${animationKey}`
|
|
160
|
+
);
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
) : null;
|
|
164
|
+
return /* @__PURE__ */ jsxs("g", { pointerEvents: "none", children: [
|
|
165
|
+
spokes,
|
|
166
|
+
labels
|
|
167
|
+
] });
|
|
168
|
+
});
|
|
169
|
+
RingGrid.displayName = "RingGrid";
|
|
170
|
+
var ring_grid_default = RingGrid;
|
|
171
|
+
export {
|
|
172
|
+
RING_GRID_PADDING,
|
|
173
|
+
RingGrid,
|
|
174
|
+
ring_grid_default as default
|
|
175
|
+
};
|