@astryxdesign/lab 0.0.0-bootstrap.0 → 0.1.2-canary.04e71b2
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/CHANGELOG.md +67 -0
- package/LICENSE +21 -0
- package/README.md +47 -1
- package/dist/Chart/Chart.d.ts +77 -0
- package/dist/Chart/Chart.d.ts.map +1 -0
- package/dist/Chart/Chart.js +247 -0
- package/dist/Chart/ChartArea.d.ts +28 -0
- package/dist/Chart/ChartArea.d.ts.map +1 -0
- package/dist/Chart/ChartArea.js +71 -0
- package/dist/Chart/ChartAxis.d.ts +27 -0
- package/dist/Chart/ChartAxis.d.ts.map +1 -0
- package/dist/Chart/ChartAxis.js +147 -0
- package/dist/Chart/ChartBar.d.ts +19 -0
- package/dist/Chart/ChartBar.d.ts.map +1 -0
- package/dist/Chart/ChartBar.js +61 -0
- package/dist/Chart/ChartBrush.d.ts +59 -0
- package/dist/Chart/ChartBrush.d.ts.map +1 -0
- package/dist/Chart/ChartBrush.js +197 -0
- package/dist/Chart/ChartCandlestick.d.ts +50 -0
- package/dist/Chart/ChartCandlestick.d.ts.map +1 -0
- package/dist/Chart/ChartCandlestick.js +138 -0
- package/dist/Chart/ChartContext.d.ts +5 -0
- package/dist/Chart/ChartContext.d.ts.map +1 -0
- package/dist/Chart/ChartContext.js +20 -0
- package/dist/Chart/ChartDot.d.ts +18 -0
- package/dist/Chart/ChartDot.d.ts.map +1 -0
- package/dist/Chart/ChartDot.js +43 -0
- package/dist/Chart/ChartDotGL.d.ts +16 -0
- package/dist/Chart/ChartDotGL.d.ts.map +1 -0
- package/dist/Chart/ChartDotGL.js +135 -0
- package/dist/Chart/ChartDotGLInteractive.d.ts +41 -0
- package/dist/Chart/ChartDotGLInteractive.d.ts.map +1 -0
- package/dist/Chart/ChartDotGLInteractive.js +446 -0
- package/dist/Chart/ChartErrorBar.d.ts +23 -0
- package/dist/Chart/ChartErrorBar.d.ts.map +1 -0
- package/dist/Chart/ChartErrorBar.js +68 -0
- package/dist/Chart/ChartGrid.d.ts +17 -0
- package/dist/Chart/ChartGrid.d.ts.map +1 -0
- package/dist/Chart/ChartGrid.js +67 -0
- package/dist/Chart/ChartHeatmapGL.d.ts +10 -0
- package/dist/Chart/ChartHeatmapGL.d.ts.map +1 -0
- package/dist/Chart/ChartHeatmapGL.js +171 -0
- package/dist/Chart/ChartLegend.d.ts +60 -0
- package/dist/Chart/ChartLegend.d.ts.map +1 -0
- package/dist/Chart/ChartLegend.js +161 -0
- package/dist/Chart/ChartLine.d.ts +23 -0
- package/dist/Chart/ChartLine.d.ts.map +1 -0
- package/dist/Chart/ChartLine.js +64 -0
- package/dist/Chart/ChartReferenceLine.d.ts +11 -0
- package/dist/Chart/ChartReferenceLine.d.ts.map +1 -0
- package/dist/Chart/ChartReferenceLine.js +109 -0
- package/dist/Chart/ChartSelect.d.ts +9 -0
- package/dist/Chart/ChartSelect.d.ts.map +1 -0
- package/dist/Chart/ChartSelect.js +90 -0
- package/dist/Chart/ChartStreamGL.d.ts +17 -0
- package/dist/Chart/ChartStreamGL.d.ts.map +1 -0
- package/dist/Chart/ChartStreamGL.js +157 -0
- package/dist/Chart/ChartTooltip.d.ts +85 -0
- package/dist/Chart/ChartTooltip.d.ts.map +1 -0
- package/dist/Chart/ChartTooltip.js +335 -0
- package/dist/Chart/ChartZoom.d.ts +23 -0
- package/dist/Chart/ChartZoom.d.ts.map +1 -0
- package/dist/Chart/ChartZoom.js +314 -0
- package/dist/Chart/formatters.d.ts +33 -0
- package/dist/Chart/formatters.d.ts.map +1 -0
- package/dist/Chart/formatters.js +101 -0
- package/dist/Chart/getChartColors.d.ts +56 -0
- package/dist/Chart/getChartColors.d.ts.map +1 -0
- package/dist/Chart/getChartColors.js +150 -0
- package/dist/Chart/index.d.ts +29 -0
- package/dist/Chart/index.d.ts.map +1 -0
- package/dist/Chart/index.js +29 -0
- package/dist/Chart/m4.d.ts +36 -0
- package/dist/Chart/m4.d.ts.map +1 -0
- package/dist/Chart/m4.js +106 -0
- package/dist/Chart/types.d.ts +55 -0
- package/dist/Chart/types.d.ts.map +1 -0
- package/dist/Chart/types.js +1 -0
- package/dist/Chart/useChartColors.d.ts +16 -0
- package/dist/Chart/useChartColors.d.ts.map +1 -0
- package/dist/Chart/useChartColors.js +30 -0
- package/dist/Chart/useChartRange.d.ts +50 -0
- package/dist/Chart/useChartRange.d.ts.map +1 -0
- package/dist/Chart/useChartRange.js +90 -0
- package/dist/Chart/utils.d.ts +15 -0
- package/dist/Chart/utils.d.ts.map +1 -0
- package/dist/Chart/utils.js +24 -0
- package/dist/Chart/webgl.d.ts +62 -0
- package/dist/Chart/webgl.d.ts.map +1 -0
- package/dist/Chart/webgl.js +169 -0
- package/dist/ChartV2/Chart.d.ts +32 -0
- package/dist/ChartV2/Chart.d.ts.map +1 -0
- package/dist/ChartV2/Chart.js +281 -0
- package/dist/ChartV2/ChartAxis.d.ts +36 -0
- package/dist/ChartV2/ChartAxis.d.ts.map +1 -0
- package/dist/ChartV2/ChartAxis.js +161 -0
- package/dist/ChartV2/ChartGrid.d.ts +20 -0
- package/dist/ChartV2/ChartGrid.d.ts.map +1 -0
- package/dist/ChartV2/ChartGrid.js +76 -0
- package/dist/ChartV2/ChartLegend.d.ts +14 -0
- package/dist/ChartV2/ChartLegend.d.ts.map +1 -0
- package/dist/ChartV2/ChartLegend.js +54 -0
- package/dist/ChartV2/ChartSwatch.d.ts +36 -0
- package/dist/ChartV2/ChartSwatch.d.ts.map +1 -0
- package/dist/ChartV2/ChartSwatch.js +82 -0
- package/dist/ChartV2/ChartTooltip.d.ts +46 -0
- package/dist/ChartV2/ChartTooltip.d.ts.map +1 -0
- package/dist/ChartV2/ChartTooltip.js +267 -0
- package/dist/ChartV2/ChartV2Context.d.ts +4 -0
- package/dist/ChartV2/ChartV2Context.d.ts.map +1 -0
- package/dist/ChartV2/ChartV2Context.js +12 -0
- package/dist/ChartV2/index.d.ts +13 -0
- package/dist/ChartV2/index.d.ts.map +1 -0
- package/dist/ChartV2/index.js +10 -0
- package/dist/ChartV2/layout.d.ts +25 -0
- package/dist/ChartV2/layout.d.ts.map +1 -0
- package/dist/ChartV2/layout.js +195 -0
- package/dist/ChartV2/legend.d.ts +18 -0
- package/dist/ChartV2/legend.d.ts.map +1 -0
- package/dist/ChartV2/legend.js +24 -0
- package/dist/ChartV2/marks/area.d.ts +19 -0
- package/dist/ChartV2/marks/area.d.ts.map +1 -0
- package/dist/ChartV2/marks/area.js +109 -0
- package/dist/ChartV2/marks/band.d.ts +9 -0
- package/dist/ChartV2/marks/band.d.ts.map +1 -0
- package/dist/ChartV2/marks/band.js +59 -0
- package/dist/ChartV2/marks/bar.d.ts +17 -0
- package/dist/ChartV2/marks/bar.d.ts.map +1 -0
- package/dist/ChartV2/marks/bar.js +120 -0
- package/dist/ChartV2/marks/candlestick.d.ts +15 -0
- package/dist/ChartV2/marks/candlestick.d.ts.map +1 -0
- package/dist/ChartV2/marks/candlestick.js +83 -0
- package/dist/ChartV2/marks/dot.d.ts +15 -0
- package/dist/ChartV2/marks/dot.d.ts.map +1 -0
- package/dist/ChartV2/marks/dot.js +65 -0
- package/dist/ChartV2/marks/dotGL.d.ts +16 -0
- package/dist/ChartV2/marks/dotGL.d.ts.map +1 -0
- package/dist/ChartV2/marks/dotGL.js +178 -0
- package/dist/ChartV2/marks/dotGLInteractive.d.ts +30 -0
- package/dist/ChartV2/marks/dotGLInteractive.d.ts.map +1 -0
- package/dist/ChartV2/marks/dotGLInteractive.js +464 -0
- package/dist/ChartV2/marks/errorBar.d.ts +27 -0
- package/dist/ChartV2/marks/errorBar.d.ts.map +1 -0
- package/dist/ChartV2/marks/errorBar.js +87 -0
- package/dist/ChartV2/marks/heatmapGL.d.ts +23 -0
- package/dist/ChartV2/marks/heatmapGL.d.ts.map +1 -0
- package/dist/ChartV2/marks/heatmapGL.js +242 -0
- package/dist/ChartV2/marks/index.d.ts +13 -0
- package/dist/ChartV2/marks/index.d.ts.map +1 -0
- package/dist/ChartV2/marks/index.js +14 -0
- package/dist/ChartV2/marks/line.d.ts +18 -0
- package/dist/ChartV2/marks/line.d.ts.map +1 -0
- package/dist/ChartV2/marks/line.js +76 -0
- package/dist/ChartV2/marks/referenceLine.d.ts +35 -0
- package/dist/ChartV2/marks/referenceLine.d.ts.map +1 -0
- package/dist/ChartV2/marks/referenceLine.js +186 -0
- package/dist/ChartV2/marks/streamGL.d.ts +36 -0
- package/dist/ChartV2/marks/streamGL.d.ts.map +1 -0
- package/dist/ChartV2/marks/streamGL.js +204 -0
- package/dist/ChartV2/tooltip.d.ts +38 -0
- package/dist/ChartV2/tooltip.d.ts.map +1 -0
- package/dist/ChartV2/tooltip.js +54 -0
- package/dist/ChartV2/types.d.ts +115 -0
- package/dist/ChartV2/types.d.ts.map +1 -0
- package/dist/ChartV2/types.js +35 -0
- package/dist/ChatReasoning/ChatReasoning.d.ts +51 -0
- package/dist/ChatReasoning/ChatReasoning.d.ts.map +1 -0
- package/dist/ChatReasoning/ChatReasoning.js +236 -0
- package/dist/CircularProgress/CircularProgress.d.ts +101 -0
- package/dist/CircularProgress/CircularProgress.d.ts.map +1 -0
- package/dist/CircularProgress/CircularProgress.js +263 -0
- package/dist/CircularProgress/index.d.ts +6 -0
- package/dist/CircularProgress/index.d.ts.map +1 -0
- package/dist/CircularProgress/index.js +8 -0
- package/dist/CodeBlock/index.d.ts +8 -0
- package/dist/CodeBlock/index.d.ts.map +1 -0
- package/dist/CodeBlock/index.js +9 -0
- package/dist/CodeEditor/CodeEditor.d.ts +46 -0
- package/dist/CodeEditor/CodeEditor.d.ts.map +1 -0
- package/dist/CodeEditor/CodeEditor.js +396 -0
- package/dist/CodeEditor/index.d.ts +6 -0
- package/dist/CodeEditor/index.d.ts.map +1 -0
- package/dist/CodeEditor/index.js +7 -0
- package/dist/Radial/RadialArea.d.ts +25 -0
- package/dist/Radial/RadialArea.d.ts.map +1 -0
- package/dist/Radial/RadialArea.js +91 -0
- package/dist/Radial/RadialAxis.d.ts +14 -0
- package/dist/Radial/RadialAxis.d.ts.map +1 -0
- package/dist/Radial/RadialAxis.js +55 -0
- package/dist/Radial/RadialChart.d.ts +70 -0
- package/dist/Radial/RadialChart.d.ts.map +1 -0
- package/dist/Radial/RadialChart.js +174 -0
- package/dist/Radial/RadialContext.d.ts +5 -0
- package/dist/Radial/RadialContext.d.ts.map +1 -0
- package/dist/Radial/RadialContext.js +19 -0
- package/dist/Radial/RadialGrid.d.ts +14 -0
- package/dist/Radial/RadialGrid.d.ts.map +1 -0
- package/dist/Radial/RadialGrid.js +70 -0
- package/dist/Radial/RadialSlice.d.ts +23 -0
- package/dist/Radial/RadialSlice.d.ts.map +1 -0
- package/dist/Radial/RadialSlice.js +85 -0
- package/dist/Radial/RadialTooltip.d.ts +44 -0
- package/dist/Radial/RadialTooltip.d.ts.map +1 -0
- package/dist/Radial/RadialTooltip.js +284 -0
- package/dist/Radial/index.d.ts +9 -0
- package/dist/Radial/index.d.ts.map +1 -0
- package/dist/Radial/index.js +9 -0
- package/dist/Radial/types.d.ts +39 -0
- package/dist/Radial/types.d.ts.map +1 -0
- package/dist/Radial/types.js +1 -0
- package/dist/SVGIcon/SVGIcon.d.ts +87 -0
- package/dist/SVGIcon/SVGIcon.d.ts.map +1 -0
- package/dist/SVGIcon/SVGIcon.js +299 -0
- package/dist/SVGIcon/icons.d.ts +49 -0
- package/dist/SVGIcon/icons.d.ts.map +1 -0
- package/dist/SVGIcon/icons.js +326 -0
- package/dist/SVGIcon/index.d.ts +15 -0
- package/dist/SVGIcon/index.d.ts.map +1 -0
- package/dist/SVGIcon/index.js +22 -0
- package/dist/SVGIcon/pathTransforms.d.ts +35 -0
- package/dist/SVGIcon/pathTransforms.d.ts.map +1 -0
- package/dist/SVGIcon/pathTransforms.js +644 -0
- package/dist/SVGIcon/tokens.stylex.d.ts +37 -0
- package/dist/SVGIcon/tokens.stylex.d.ts.map +1 -0
- package/dist/SVGIcon/tokens.stylex.js +40 -0
- package/dist/SVGIcon/variations.stylex.d.ts +44 -0
- package/dist/SVGIcon/variations.stylex.d.ts.map +1 -0
- package/dist/SVGIcon/variations.stylex.js +119 -0
- package/dist/SVGIcon/xif-examples.d.ts +22 -0
- package/dist/SVGIcon/xif-examples.d.ts.map +1 -0
- package/dist/SVGIcon/xif-examples.js +202 -0
- package/dist/SVGIcon/xif-types.d.ts +129 -0
- package/dist/SVGIcon/xif-types.d.ts.map +1 -0
- package/dist/SVGIcon/xif-types.js +1 -0
- package/dist/Sankey/SankeyChart.d.ts +72 -0
- package/dist/Sankey/SankeyChart.d.ts.map +1 -0
- package/dist/Sankey/SankeyChart.js +162 -0
- package/dist/Sankey/SankeyContext.d.ts +5 -0
- package/dist/Sankey/SankeyContext.d.ts.map +1 -0
- package/dist/Sankey/SankeyContext.js +20 -0
- package/dist/Sankey/SankeyGrid.d.ts +20 -0
- package/dist/Sankey/SankeyGrid.d.ts.map +1 -0
- package/dist/Sankey/SankeyGrid.js +53 -0
- package/dist/Sankey/SankeyLabel.d.ts +11 -0
- package/dist/Sankey/SankeyLabel.d.ts.map +1 -0
- package/dist/Sankey/SankeyLabel.js +179 -0
- package/dist/Sankey/SankeyLink.d.ts +29 -0
- package/dist/Sankey/SankeyLink.d.ts.map +1 -0
- package/dist/Sankey/SankeyLink.js +139 -0
- package/dist/Sankey/SankeyNode.d.ts +15 -0
- package/dist/Sankey/SankeyNode.d.ts.map +1 -0
- package/dist/Sankey/SankeyNode.js +56 -0
- package/dist/Sankey/index.d.ts +8 -0
- package/dist/Sankey/index.d.ts.map +1 -0
- package/dist/Sankey/index.js +8 -0
- package/dist/Sankey/layout.d.ts +26 -0
- package/dist/Sankey/layout.d.ts.map +1 -0
- package/dist/Sankey/layout.js +157 -0
- package/dist/Sankey/types.d.ts +84 -0
- package/dist/Sankey/types.d.ts.map +1 -0
- package/dist/Sankey/types.js +1 -0
- package/dist/Schedule/CalendarEvent.d.ts +36 -0
- package/dist/Schedule/CalendarEvent.d.ts.map +1 -0
- package/dist/Schedule/CalendarEvent.js +35 -0
- package/dist/Schedule/DayView.d.ts +8 -0
- package/dist/Schedule/DayView.d.ts.map +1 -0
- package/dist/Schedule/DayView.js +105 -0
- package/dist/Schedule/ListView.d.ts +6 -0
- package/dist/Schedule/ListView.d.ts.map +1 -0
- package/dist/Schedule/ListView.js +171 -0
- package/dist/Schedule/MonthlyView.d.ts +6 -0
- package/dist/Schedule/MonthlyView.d.ts.map +1 -0
- package/dist/Schedule/MonthlyView.js +270 -0
- package/dist/Schedule/Schedule.d.ts +22 -0
- package/dist/Schedule/Schedule.d.ts.map +1 -0
- package/dist/Schedule/Schedule.js +185 -0
- package/dist/Schedule/TimeGridView.d.ts +12 -0
- package/dist/Schedule/TimeGridView.d.ts.map +1 -0
- package/dist/Schedule/TimeGridView.js +364 -0
- package/dist/Schedule/WeeklyView.d.ts +9 -0
- package/dist/Schedule/WeeklyView.d.ts.map +1 -0
- package/dist/Schedule/WeeklyView.js +112 -0
- package/dist/Schedule/context.d.ts +20 -0
- package/dist/Schedule/context.d.ts.map +1 -0
- package/dist/Schedule/context.js +19 -0
- package/dist/Schedule/dateMath.d.ts +21 -0
- package/dist/Schedule/dateMath.d.ts.map +1 -0
- package/dist/Schedule/dateMath.js +63 -0
- package/dist/Schedule/index.d.ts +19 -0
- package/dist/Schedule/index.d.ts.map +1 -0
- package/dist/Schedule/index.js +17 -0
- package/dist/Schedule/plugins/PaginationPlugin.d.ts +7 -0
- package/dist/Schedule/plugins/PaginationPlugin.d.ts.map +1 -0
- package/dist/Schedule/plugins/PaginationPlugin.js +81 -0
- package/dist/Schedule/plugins/ViewSelectorPlugin.d.ts +11 -0
- package/dist/Schedule/plugins/ViewSelectorPlugin.d.ts.map +1 -0
- package/dist/Schedule/plugins/ViewSelectorPlugin.js +78 -0
- package/dist/Schedule/plugins/index.d.ts +5 -0
- package/dist/Schedule/plugins/index.d.ts.map +1 -0
- package/dist/Schedule/plugins/index.js +14 -0
- package/dist/Schedule/shared.d.ts +923 -0
- package/dist/Schedule/shared.d.ts.map +1 -0
- package/dist/Schedule/shared.js +1325 -0
- package/dist/Schedule/types.d.ts +51 -0
- package/dist/Schedule/types.d.ts.map +1 -0
- package/dist/Schedule/types.js +1 -0
- package/dist/Schedule/useCurrentTime.d.ts +3 -0
- package/dist/Schedule/useCurrentTime.d.ts.map +1 -0
- package/dist/Schedule/useCurrentTime.js +43 -0
- package/dist/Schedule/zonedDateTime.d.ts +20 -0
- package/dist/Schedule/zonedDateTime.d.ts.map +1 -0
- package/dist/Schedule/zonedDateTime.js +31 -0
- package/dist/Stepper/Step.d.ts +120 -0
- package/dist/Stepper/Step.d.ts.map +1 -0
- package/dist/Stepper/Step.js +573 -0
- package/dist/Stepper/StepStatus.d.ts +24 -0
- package/dist/Stepper/StepStatus.d.ts.map +1 -0
- package/dist/Stepper/StepStatus.js +1 -0
- package/dist/Stepper/Stepper.d.ts +77 -0
- package/dist/Stepper/Stepper.d.ts.map +1 -0
- package/dist/Stepper/Stepper.js +104 -0
- package/dist/Stepper/StepperContext.d.ts +12 -0
- package/dist/Stepper/StepperContext.d.ts.map +1 -0
- package/dist/Stepper/StepperContext.js +24 -0
- package/dist/Stepper/index.d.ts +8 -0
- package/dist/Stepper/index.d.ts.map +1 -0
- package/dist/Stepper/index.js +7 -0
- package/dist/ThreeD/ThreeDAxis.d.ts +6 -0
- package/dist/ThreeD/ThreeDAxis.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDAxis.js +75 -0
- package/dist/ThreeD/ThreeDBar.d.ts +7 -0
- package/dist/ThreeD/ThreeDBar.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDBar.js +98 -0
- package/dist/ThreeD/ThreeDChart.d.ts +24 -0
- package/dist/ThreeD/ThreeDChart.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDChart.js +202 -0
- package/dist/ThreeD/ThreeDContext.d.ts +5 -0
- package/dist/ThreeD/ThreeDContext.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDContext.js +19 -0
- package/dist/ThreeD/ThreeDGrid.d.ts +5 -0
- package/dist/ThreeD/ThreeDGrid.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDGrid.js +55 -0
- package/dist/ThreeD/ThreeDScatter.d.ts +7 -0
- package/dist/ThreeD/ThreeDScatter.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDScatter.js +57 -0
- package/dist/ThreeD/ThreeDScatterGL.d.ts +7 -0
- package/dist/ThreeD/ThreeDScatterGL.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDScatterGL.js +243 -0
- package/dist/ThreeD/ThreeDSurface.d.ts +15 -0
- package/dist/ThreeD/ThreeDSurface.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDSurface.js +97 -0
- package/dist/ThreeD/index.d.ts +10 -0
- package/dist/ThreeD/index.d.ts.map +1 -0
- package/dist/ThreeD/index.js +10 -0
- package/dist/ThreeD/types.d.ts +57 -0
- package/dist/ThreeD/types.d.ts.map +1 -0
- package/dist/ThreeD/types.js +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/lab.css +423 -0
- package/package.json +69 -4
- package/src/Chart/Chart.tsx +312 -0
- package/src/Chart/ChartArea.doc.mjs +16 -0
- package/src/Chart/ChartArea.tsx +91 -0
- package/src/Chart/ChartAxis.tsx +186 -0
- package/src/Chart/ChartBar.doc.mjs +16 -0
- package/src/Chart/ChartBar.tsx +71 -0
- package/src/Chart/ChartBrush.tsx +237 -0
- package/src/Chart/ChartCandlestick.doc.mjs +16 -0
- package/src/Chart/ChartCandlestick.tsx +186 -0
- package/src/Chart/ChartContext.ts +23 -0
- package/src/Chart/ChartDot.doc.mjs +16 -0
- package/src/Chart/ChartDot.tsx +44 -0
- package/src/Chart/ChartDotGL.doc.mjs +16 -0
- package/src/Chart/ChartDotGL.tsx +151 -0
- package/src/Chart/ChartDotGLInteractive.doc.mjs +16 -0
- package/src/Chart/ChartDotGLInteractive.tsx +519 -0
- package/src/Chart/ChartErrorBar.tsx +84 -0
- package/src/Chart/ChartGrid.tsx +86 -0
- package/src/Chart/ChartHeatmapGL.doc.mjs +16 -0
- package/src/Chart/ChartHeatmapGL.tsx +219 -0
- package/src/Chart/ChartLegend.tsx +181 -0
- package/src/Chart/ChartLine.doc.mjs +16 -0
- package/src/Chart/ChartLine.tsx +70 -0
- package/src/Chart/ChartReferenceLine.tsx +76 -0
- package/src/Chart/ChartSelect.tsx +111 -0
- package/src/Chart/ChartStreamGL.doc.mjs +16 -0
- package/src/Chart/ChartStreamGL.tsx +189 -0
- package/src/Chart/ChartTooltip.tsx +451 -0
- package/src/Chart/ChartZoom.tsx +400 -0
- package/src/Chart/formatters.ts +95 -0
- package/src/Chart/getChartColors.ts +249 -0
- package/src/Chart/index.ts +90 -0
- package/src/Chart/m4.test.ts +66 -0
- package/src/Chart/m4.ts +128 -0
- package/src/Chart/types.ts +64 -0
- package/src/Chart/useChartColors.ts +34 -0
- package/src/Chart/useChartRange.test.ts +101 -0
- package/src/Chart/useChartRange.ts +146 -0
- package/src/Chart/utils.ts +31 -0
- package/src/Chart/webgl.ts +192 -0
- package/src/ChartV2/Chart.tsx +348 -0
- package/src/ChartV2/ChartAxis.tsx +209 -0
- package/src/ChartV2/ChartGrid.tsx +99 -0
- package/src/ChartV2/ChartLegend.tsx +69 -0
- package/src/ChartV2/ChartSwatch.doc.mjs +17 -0
- package/src/ChartV2/ChartSwatch.tsx +86 -0
- package/src/ChartV2/ChartTooltip.tsx +382 -0
- package/src/ChartV2/ChartV2.doc.mjs +16 -0
- package/src/ChartV2/ChartV2Context.ts +15 -0
- package/src/ChartV2/index.ts +62 -0
- package/src/ChartV2/layout.ts +223 -0
- package/src/ChartV2/legend.ts +32 -0
- package/src/ChartV2/marks/area.tsx +122 -0
- package/src/ChartV2/marks/band.tsx +70 -0
- package/src/ChartV2/marks/bar.tsx +159 -0
- package/src/ChartV2/marks/candlestick.tsx +106 -0
- package/src/ChartV2/marks/dot.tsx +64 -0
- package/src/ChartV2/marks/dotGL.tsx +202 -0
- package/src/ChartV2/marks/dotGLInteractive.tsx +546 -0
- package/src/ChartV2/marks/errorBar.tsx +89 -0
- package/src/ChartV2/marks/heatmapGL.tsx +299 -0
- package/src/ChartV2/marks/index.ts +14 -0
- package/src/ChartV2/marks/line.tsx +94 -0
- package/src/ChartV2/marks/referenceLine.tsx +224 -0
- package/src/ChartV2/marks/streamGL.tsx +251 -0
- package/src/ChartV2/tooltip.ts +70 -0
- package/src/ChartV2/types.ts +129 -0
- package/src/ChatReasoning/ChatReasoning.doc.mjs +16 -0
- package/src/ChatReasoning/ChatReasoning.test.tsx +56 -0
- package/src/ChatReasoning/ChatReasoning.tsx +322 -0
- package/src/CircularProgress/CircularProgress.doc.mjs +174 -0
- package/src/CircularProgress/CircularProgress.test.tsx +157 -0
- package/src/CircularProgress/CircularProgress.tsx +373 -0
- package/src/CircularProgress/index.ts +15 -0
- package/src/CodeBlock/index.ts +10 -0
- package/src/CodeEditor/CodeEditor.doc.mjs +16 -0
- package/src/CodeEditor/CodeEditor.tsx +466 -0
- package/src/CodeEditor/index.ts +8 -0
- package/src/Radial/RadialArea.tsx +103 -0
- package/src/Radial/RadialAxis.tsx +60 -0
- package/src/Radial/RadialChart.doc.mjs +16 -0
- package/src/Radial/RadialChart.tsx +219 -0
- package/src/Radial/RadialContext.ts +22 -0
- package/src/Radial/RadialGrid.tsx +81 -0
- package/src/Radial/RadialSlice.tsx +130 -0
- package/src/Radial/RadialTooltip.tsx +347 -0
- package/src/Radial/index.ts +14 -0
- package/src/Radial/types.ts +46 -0
- package/src/SVGIcon/SVGIcon.doc.mjs +16 -0
- package/src/SVGIcon/SVGIcon.tsx +406 -0
- package/src/SVGIcon/icons.ts +283 -0
- package/src/SVGIcon/index.ts +73 -0
- package/src/SVGIcon/pathTransforms.ts +612 -0
- package/src/SVGIcon/tokens.stylex.ts +53 -0
- package/src/SVGIcon/variations.stylex.ts +122 -0
- package/src/SVGIcon/xif-examples.ts +191 -0
- package/src/SVGIcon/xif-types.ts +181 -0
- package/src/Sankey/SankeyChart.doc.mjs +16 -0
- package/src/Sankey/SankeyChart.tsx +220 -0
- package/src/Sankey/SankeyContext.ts +23 -0
- package/src/Sankey/SankeyGrid.tsx +69 -0
- package/src/Sankey/SankeyLabel.tsx +234 -0
- package/src/Sankey/SankeyLink.tsx +167 -0
- package/src/Sankey/SankeyNode.tsx +66 -0
- package/src/Sankey/index.ts +22 -0
- package/src/Sankey/layout.ts +219 -0
- package/src/Sankey/types.ts +93 -0
- package/src/Schedule/CalendarEvent.ts +74 -0
- package/src/Schedule/DayView.tsx +112 -0
- package/src/Schedule/ListView.tsx +236 -0
- package/src/Schedule/MonthlyView.tsx +401 -0
- package/src/Schedule/Schedule.doc.mjs +16 -0
- package/src/Schedule/Schedule.test.tsx +405 -0
- package/src/Schedule/Schedule.tsx +307 -0
- package/src/Schedule/TimeGridView.tsx +589 -0
- package/src/Schedule/WeeklyView.tsx +130 -0
- package/src/Schedule/context.tsx +49 -0
- package/src/Schedule/dateMath.ts +112 -0
- package/src/Schedule/index.ts +61 -0
- package/src/Schedule/plugins/PaginationPlugin.tsx +98 -0
- package/src/Schedule/plugins/ViewSelectorPlugin.tsx +128 -0
- package/src/Schedule/plugins/index.tsx +20 -0
- package/src/Schedule/shared.tsx +1304 -0
- package/src/Schedule/types.ts +86 -0
- package/src/Schedule/useCurrentTime.ts +50 -0
- package/src/Schedule/zonedDateTime.ts +71 -0
- package/src/Stepper/Step.doc.mjs +17 -0
- package/src/Stepper/Step.tsx +756 -0
- package/src/Stepper/StepStatus.ts +26 -0
- package/src/Stepper/Stepper.doc.mjs +265 -0
- package/src/Stepper/Stepper.test.tsx +281 -0
- package/src/Stepper/Stepper.tsx +157 -0
- package/src/Stepper/StepperContext.ts +43 -0
- package/src/Stepper/index.ts +14 -0
- package/src/ThreeD/3DBar.doc.mjs +16 -0
- package/src/ThreeD/3DChart.doc.mjs +16 -0
- package/src/ThreeD/3DScatter.doc.mjs +16 -0
- package/src/ThreeD/3DScatterGL.doc.mjs +16 -0
- package/src/ThreeD/3DSurface.doc.mjs +16 -0
- package/src/ThreeD/ThreeDAxis.tsx +86 -0
- package/src/ThreeD/ThreeDBar.tsx +130 -0
- package/src/ThreeD/ThreeDChart.tsx +262 -0
- package/src/ThreeD/ThreeDContext.ts +22 -0
- package/src/ThreeD/ThreeDGrid.tsx +68 -0
- package/src/ThreeD/ThreeDScatter.tsx +63 -0
- package/src/ThreeD/ThreeDScatterGL.tsx +270 -0
- package/src/ThreeD/ThreeDSurface.tsx +142 -0
- package/src/ThreeD/index.ts +11 -0
- package/src/ThreeD/projection.test.ts +132 -0
- package/src/ThreeD/types.ts +62 -0
- package/src/index.ts +250 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file webgl.ts
|
|
5
|
+
* @output Shared WebGL utilities for chart components
|
|
6
|
+
* @position Internal helpers; consumed by all GL mark components
|
|
7
|
+
*
|
|
8
|
+
* Provides:
|
|
9
|
+
* - Canvas mounting outside SVG (avoids foreignObject DPR blur)
|
|
10
|
+
* - Premultiplied alpha setup (correct compositing over page)
|
|
11
|
+
* - Shader compilation helpers
|
|
12
|
+
* - Smoothstep circle fragment for crisp point sprites
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** Compile a WebGL shader, returns null on failure */
|
|
16
|
+
export function compileShader(gl, type, src) {
|
|
17
|
+
const s = gl.createShader(type);
|
|
18
|
+
if (!s) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
gl.shaderSource(s, src);
|
|
22
|
+
gl.compileShader(s);
|
|
23
|
+
if (!gl.getShaderParameter(s, gl.COMPILE_STATUS)) {
|
|
24
|
+
gl.deleteShader(s);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return s;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Link a vertex + fragment shader into a program */
|
|
31
|
+
export function createProgram(gl, vertSrc, fragSrc) {
|
|
32
|
+
const vs = compileShader(gl, gl.VERTEX_SHADER, vertSrc);
|
|
33
|
+
const fs = compileShader(gl, gl.FRAGMENT_SHADER, fragSrc);
|
|
34
|
+
if (!vs || !fs) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const p = gl.createProgram();
|
|
38
|
+
if (!p) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
gl.attachShader(p, vs);
|
|
42
|
+
gl.attachShader(p, fs);
|
|
43
|
+
gl.linkProgram(p);
|
|
44
|
+
if (!gl.getProgramParameter(p, gl.LINK_STATUS)) {
|
|
45
|
+
gl.deleteProgram(p);
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return p;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Parse hex (#RRGGBB) to [r, g, b] floats 0-1 */
|
|
52
|
+
export function hexToGL(hex) {
|
|
53
|
+
const n = parseInt(hex.replace('#', ''), 16);
|
|
54
|
+
return [(n >> 16) / 255, (n >> 8 & 0xff) / 255, (n & 0xff) / 255];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** DPR with supersampling for crisp circles */
|
|
58
|
+
export function getCanvasDPR() {
|
|
59
|
+
return (window.devicePixelRatio || 2) * 2;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Create or get a WebGL context with correct alpha settings.
|
|
64
|
+
* Uses premultiplied alpha for correct compositing over the page.
|
|
65
|
+
*/
|
|
66
|
+
export function getWebGLContext(canvas) {
|
|
67
|
+
return canvas.getContext('webgl', {
|
|
68
|
+
alpha: true,
|
|
69
|
+
premultipliedAlpha: true,
|
|
70
|
+
antialias: true
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Set up standard GL state for chart rendering:
|
|
76
|
+
* - Clear with transparent
|
|
77
|
+
* - Enable premultiplied alpha blending
|
|
78
|
+
*/
|
|
79
|
+
export function setupGLState(gl) {
|
|
80
|
+
gl.clearColor(0, 0, 0, 0);
|
|
81
|
+
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
82
|
+
gl.enable(gl.BLEND);
|
|
83
|
+
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Size a canvas for sharp rendering, accounting for DPR.
|
|
88
|
+
* Returns the DPR used.
|
|
89
|
+
*/
|
|
90
|
+
export function sizeCanvas(canvas, width, height) {
|
|
91
|
+
const dpr = getCanvasDPR();
|
|
92
|
+
canvas.width = width * dpr;
|
|
93
|
+
canvas.height = height * dpr;
|
|
94
|
+
canvas.style.width = `${width}px`;
|
|
95
|
+
canvas.style.height = `${height}px`;
|
|
96
|
+
return dpr;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Mount a canvas as an absolute-positioned sibling to an SVG element.
|
|
101
|
+
* Automatically aligns with the SVG marker's position — no manual margin
|
|
102
|
+
* offset needed. This is a Tier 1 guarantee: the canvas lands exactly
|
|
103
|
+
* where the SVG content area is, regardless of chart margins or transforms.
|
|
104
|
+
*
|
|
105
|
+
* Call from a useEffect. Returns a cleanup function.
|
|
106
|
+
*/
|
|
107
|
+
export function mountCanvasOverSVG(svgMarker, canvas, width, height) {
|
|
108
|
+
const svg = svgMarker.ownerSVGElement;
|
|
109
|
+
if (!svg) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const parent = svg.parentElement;
|
|
113
|
+
if (!parent) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (getComputedStyle(parent).position === 'static') {
|
|
117
|
+
parent.style.position = 'relative';
|
|
118
|
+
}
|
|
119
|
+
canvas.style.position = 'absolute';
|
|
120
|
+
canvas.style.pointerEvents = 'none';
|
|
121
|
+
|
|
122
|
+
// Compute offset from the SVG marker's actual screen position.
|
|
123
|
+
// The marker sits inside the chart's <g transform="translate(margin)">
|
|
124
|
+
// so its bounding rect includes the margin offset automatically.
|
|
125
|
+
// This is a Tier 1 guarantee — we derive position from the SVG, not from props.
|
|
126
|
+
const parentRect = parent.getBoundingClientRect();
|
|
127
|
+
const markerCTM = svgMarker.getScreenCTM();
|
|
128
|
+
if (markerCTM) {
|
|
129
|
+
canvas.style.left = `${markerCTM.e - parentRect.left}px`;
|
|
130
|
+
canvas.style.top = `${markerCTM.f - parentRect.top}px`;
|
|
131
|
+
} else {
|
|
132
|
+
canvas.style.left = '0';
|
|
133
|
+
canvas.style.top = '0';
|
|
134
|
+
}
|
|
135
|
+
canvas.style.width = `${width}px`;
|
|
136
|
+
canvas.style.height = `${height}px`;
|
|
137
|
+
parent.appendChild(canvas);
|
|
138
|
+
return () => {
|
|
139
|
+
if (canvas.parentElement === parent) {
|
|
140
|
+
parent.removeChild(canvas);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* GLSL fragment for premultiplied-alpha circle with smoothstep AA.
|
|
147
|
+
* Use in fragment shaders that render point sprites.
|
|
148
|
+
*
|
|
149
|
+
* Expects:
|
|
150
|
+
* - varying float v_alpha (the final alpha before edge AA)
|
|
151
|
+
* - uniform vec3 u_color
|
|
152
|
+
*
|
|
153
|
+
* Returns: gl_FragColor with premultiplied alpha
|
|
154
|
+
*/
|
|
155
|
+
export const CIRCLE_FRAG_BODY = `
|
|
156
|
+
vec2 coord = gl_PointCoord - vec2(0.5);
|
|
157
|
+
float dist = length(coord);
|
|
158
|
+
if (dist > 0.5) discard;
|
|
159
|
+
float edge = 1.0 - smoothstep(0.48, 0.5, dist);
|
|
160
|
+
float a = v_alpha * edge;
|
|
161
|
+
gl_FragColor = vec4(u_color * a, a);
|
|
162
|
+
`;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Smoothstep compensation factor for gl_PointSize.
|
|
166
|
+
* The visible circle radius is 0.48 of the point sprite (smoothstep starts there),
|
|
167
|
+
* so we scale up by 1/0.96 to match SVG circle radius exactly.
|
|
168
|
+
*/
|
|
169
|
+
export const POINT_SIZE_COMPENSATION = 1.0 / 0.96;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Chart.tsx (v2)
|
|
3
|
+
* @output Root chart — coordinates layout, rendering, and events
|
|
4
|
+
* @position Top-level; delegates everything to series configs and interaction slots
|
|
5
|
+
*
|
|
6
|
+
* The chart root has ZERO knowledge of mark types. It:
|
|
7
|
+
* 1. Runs the layout engine (scales + stacking + grouping)
|
|
8
|
+
* 2. Calls each series' resolve() and render() methods
|
|
9
|
+
* 3. Provides a single event layer for interaction children
|
|
10
|
+
*/
|
|
11
|
+
import { type ReactNode } from 'react';
|
|
12
|
+
import type { SeriesDef } from './types';
|
|
13
|
+
import type { ChartMargin } from './types';
|
|
14
|
+
import { type ChartLegendProps } from './ChartLegend';
|
|
15
|
+
import { type ChartTooltipProps } from './ChartTooltip';
|
|
16
|
+
export interface ChartProps {
|
|
17
|
+
data: Record<string, unknown>[];
|
|
18
|
+
xKey: string;
|
|
19
|
+
series: SeriesDef[];
|
|
20
|
+
height?: number;
|
|
21
|
+
margin?: Partial<ChartMargin>;
|
|
22
|
+
grid?: ReactNode;
|
|
23
|
+
axes?: ReactNode;
|
|
24
|
+
legend?: boolean | ChartLegendProps;
|
|
25
|
+
tooltip?: boolean | Omit<ChartTooltipProps, 'series'>;
|
|
26
|
+
interactions?: ReactNode;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
title?: string;
|
|
29
|
+
subtitle?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function Chart({ data, xKey, series, height, margin: marginOverride, grid, axes, legend, tooltip, interactions, children, title, subtitle, }: ChartProps): import("react").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=Chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../src/ChartV2/Chart.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,EACL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAiB,WAAW,EAAoB,MAAM,SAAS,CAAC;AAO5E,OAAO,EAAc,KAAK,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAEjE,OAAO,EAAe,KAAK,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAEpE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACtD,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAkBD,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAY,EACZ,MAAM,EAAE,cAAc,EACtB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,QAAQ,GACT,EAAE,UAAU,+BA2QZ"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Chart.tsx (v2)
|
|
5
|
+
* @output Root chart — coordinates layout, rendering, and events
|
|
6
|
+
* @position Top-level; delegates everything to series configs and interaction slots
|
|
7
|
+
*
|
|
8
|
+
* The chart root has ZERO knowledge of mark types. It:
|
|
9
|
+
* 1. Runs the layout engine (scales + stacking + grouping)
|
|
10
|
+
* 2. Calls each series' resolve() and render() methods
|
|
11
|
+
* 3. Provides a single event layer for interaction children
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { useId, useMemo, useRef, useState, useCallback, useLayoutEffect } from 'react';
|
|
15
|
+
import { computeLayout } from "./layout.js";
|
|
16
|
+
import { ChartV2Provider } from "./ChartV2Context.js";
|
|
17
|
+
import { ChartProvider } from "../Chart/ChartContext.js";
|
|
18
|
+
import { Text } from '@astryxdesign/core';
|
|
19
|
+
import { VStack, HStack } from '@astryxdesign/core';
|
|
20
|
+
import * as stylex from '@stylexjs/stylex';
|
|
21
|
+
import { ChartLegend } from "./ChartLegend.js";
|
|
22
|
+
import { deriveLegendItems } from "./legend.js";
|
|
23
|
+
import { ChartTooltip } from "./ChartTooltip.js";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
const DEFAULT_MARGIN = {
|
|
26
|
+
top: 24,
|
|
27
|
+
right: 24,
|
|
28
|
+
bottom: 32,
|
|
29
|
+
left: 48
|
|
30
|
+
};
|
|
31
|
+
export function Chart({
|
|
32
|
+
data,
|
|
33
|
+
xKey,
|
|
34
|
+
series,
|
|
35
|
+
height = 300,
|
|
36
|
+
margin: marginOverride,
|
|
37
|
+
grid,
|
|
38
|
+
axes,
|
|
39
|
+
legend,
|
|
40
|
+
tooltip,
|
|
41
|
+
interactions,
|
|
42
|
+
children,
|
|
43
|
+
title,
|
|
44
|
+
subtitle
|
|
45
|
+
}) {
|
|
46
|
+
const chartId = useId();
|
|
47
|
+
const descId = `${chartId}-desc`;
|
|
48
|
+
const containerRef = useRef(null);
|
|
49
|
+
const svgRef = useRef(null);
|
|
50
|
+
const [containerWidth, setContainerWidth] = useState(0);
|
|
51
|
+
const pointerHandlers = useRef(new Set());
|
|
52
|
+
useLayoutEffect(() => {
|
|
53
|
+
if (!containerRef.current) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const observer = new ResizeObserver(entries => {
|
|
57
|
+
const entry = entries[0];
|
|
58
|
+
if (entry) {
|
|
59
|
+
setContainerWidth(entry.contentRect.width);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
observer.observe(containerRef.current);
|
|
63
|
+
return () => observer.disconnect();
|
|
64
|
+
}, []);
|
|
65
|
+
const margin = useMemo(() => ({
|
|
66
|
+
...DEFAULT_MARGIN,
|
|
67
|
+
...marginOverride
|
|
68
|
+
}), [marginOverride]);
|
|
69
|
+
const innerWidth = Math.max(0, containerWidth - margin.left - margin.right);
|
|
70
|
+
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
71
|
+
|
|
72
|
+
// ─── Layout pass ──────────────────────────────────────────────────────
|
|
73
|
+
const layout = useMemo(() => computeLayout({
|
|
74
|
+
data,
|
|
75
|
+
xKey,
|
|
76
|
+
series,
|
|
77
|
+
width: innerWidth,
|
|
78
|
+
height: innerHeight
|
|
79
|
+
}), [data, xKey, series, innerWidth, innerHeight]);
|
|
80
|
+
const seriesCtx = useMemo(() => ({
|
|
81
|
+
data,
|
|
82
|
+
xKey,
|
|
83
|
+
xScale: layout.xScale,
|
|
84
|
+
yScale: layout.yScale,
|
|
85
|
+
width: innerWidth,
|
|
86
|
+
height: innerHeight
|
|
87
|
+
}), [data, xKey, layout, innerWidth, innerHeight]);
|
|
88
|
+
|
|
89
|
+
// ─── Event dispatch ───────────────────────────────────────────────────
|
|
90
|
+
const onPointer = useCallback(handler => {
|
|
91
|
+
pointerHandlers.current.add(handler);
|
|
92
|
+
return () => {
|
|
93
|
+
pointerHandlers.current.delete(handler);
|
|
94
|
+
};
|
|
95
|
+
}, []);
|
|
96
|
+
const dispatch = useCallback(e => {
|
|
97
|
+
for (const handler of pointerHandlers.current) {
|
|
98
|
+
handler(e);
|
|
99
|
+
}
|
|
100
|
+
}, []);
|
|
101
|
+
const handlePointerMove = useCallback(e => {
|
|
102
|
+
const svg = svgRef.current;
|
|
103
|
+
if (!svg) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const point = svg.createSVGPoint();
|
|
107
|
+
point.x = e.clientX;
|
|
108
|
+
point.y = e.clientY;
|
|
109
|
+
const ctm = e.currentTarget.getScreenCTM()?.inverse();
|
|
110
|
+
if (!ctm) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const cursor = point.matrixTransform(ctm);
|
|
114
|
+
|
|
115
|
+
// Find nearest point by x-distance only (full vertical column is the hover zone)
|
|
116
|
+
let nearest = null;
|
|
117
|
+
let bestXDist = Infinity;
|
|
118
|
+
for (const [seriesKey, points] of layout.resolved) {
|
|
119
|
+
for (const p of points) {
|
|
120
|
+
const xDist = Math.abs(p.px - cursor.x);
|
|
121
|
+
if (xDist < bestXDist) {
|
|
122
|
+
bestXDist = xDist;
|
|
123
|
+
nearest = {
|
|
124
|
+
...p,
|
|
125
|
+
seriesKey
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
dispatch({
|
|
131
|
+
x: cursor.x,
|
|
132
|
+
y: cursor.y,
|
|
133
|
+
nearest,
|
|
134
|
+
active: e.buttons > 0
|
|
135
|
+
});
|
|
136
|
+
}, [layout.resolved, dispatch]);
|
|
137
|
+
const handlePointerLeave = useCallback(() => {
|
|
138
|
+
dispatch({
|
|
139
|
+
x: -1,
|
|
140
|
+
y: -1,
|
|
141
|
+
nearest: null,
|
|
142
|
+
active: false
|
|
143
|
+
});
|
|
144
|
+
}, [dispatch]);
|
|
145
|
+
|
|
146
|
+
// ─── Context for interactions + v1 chrome ─────────────────────────────
|
|
147
|
+
const ctx = useMemo(() => ({
|
|
148
|
+
width: innerWidth,
|
|
149
|
+
height: innerHeight,
|
|
150
|
+
margin,
|
|
151
|
+
data,
|
|
152
|
+
xKey,
|
|
153
|
+
xScale: layout.xScale,
|
|
154
|
+
yScale: layout.yScale,
|
|
155
|
+
resolved: layout.resolved,
|
|
156
|
+
onPointer,
|
|
157
|
+
svgRef
|
|
158
|
+
}), [innerWidth, innerHeight, margin, data, xKey, layout, onPointer]);
|
|
159
|
+
|
|
160
|
+
// Bridge v1 context for ChartGrid/Axis compatibility
|
|
161
|
+
const v1Ctx = useMemo(() => ({
|
|
162
|
+
width: innerWidth,
|
|
163
|
+
height: innerHeight,
|
|
164
|
+
margin,
|
|
165
|
+
xKey,
|
|
166
|
+
data,
|
|
167
|
+
xScale: layout.xScale,
|
|
168
|
+
yScale: layout.yScale,
|
|
169
|
+
svgRef,
|
|
170
|
+
pointerToData: () => ({
|
|
171
|
+
x: null,
|
|
172
|
+
y: 0,
|
|
173
|
+
px: 0,
|
|
174
|
+
py: 0
|
|
175
|
+
}),
|
|
176
|
+
pixelToData: (px, py) => ({
|
|
177
|
+
x: null,
|
|
178
|
+
y: 0,
|
|
179
|
+
px,
|
|
180
|
+
py
|
|
181
|
+
})
|
|
182
|
+
}), [innerWidth, innerHeight, margin, xKey, data, layout, svgRef]);
|
|
183
|
+
|
|
184
|
+
// ─── Legend ────────────────────────────────────────────────────────────
|
|
185
|
+
const legendConfig = legend === true ? {} : legend || null;
|
|
186
|
+
const legendElement = legendConfig ? /*#__PURE__*/_jsx(ChartLegend, {
|
|
187
|
+
items: legendConfig.items ?? deriveLegendItems(series),
|
|
188
|
+
position: legendConfig.position,
|
|
189
|
+
alignment: legendConfig.alignment
|
|
190
|
+
}) : null;
|
|
191
|
+
const legendPosition = legendConfig?.position ?? 'bottom';
|
|
192
|
+
const isLegendHorizontal = legendPosition === 'start' || legendPosition === 'end';
|
|
193
|
+
|
|
194
|
+
// ─── Render ───────────────────────────────────────────────────────────
|
|
195
|
+
if (containerWidth === 0) {
|
|
196
|
+
return /*#__PURE__*/_jsx("div", {
|
|
197
|
+
ref: containerRef,
|
|
198
|
+
...{
|
|
199
|
+
className: "xh8yej3"
|
|
200
|
+
},
|
|
201
|
+
style: {
|
|
202
|
+
height
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
207
|
+
ref: containerRef,
|
|
208
|
+
...{
|
|
209
|
+
className: "xh8yej3"
|
|
210
|
+
},
|
|
211
|
+
children: [(title || subtitle) && /*#__PURE__*/_jsxs("div", {
|
|
212
|
+
...{
|
|
213
|
+
className: "x1yztbdb"
|
|
214
|
+
},
|
|
215
|
+
children: [title && /*#__PURE__*/_jsx(Text, {
|
|
216
|
+
type: "body",
|
|
217
|
+
weight: "semibold",
|
|
218
|
+
display: "block",
|
|
219
|
+
children: title
|
|
220
|
+
}), subtitle && /*#__PURE__*/_jsx(Text, {
|
|
221
|
+
type: "supporting",
|
|
222
|
+
display: "block",
|
|
223
|
+
children: subtitle
|
|
224
|
+
})]
|
|
225
|
+
}), /*#__PURE__*/_jsx(ChartV2Provider, {
|
|
226
|
+
value: ctx,
|
|
227
|
+
children: /*#__PURE__*/_jsx(ChartProvider, {
|
|
228
|
+
value: v1Ctx,
|
|
229
|
+
children: legendConfig == null ? renderSvg() : isLegendHorizontal ? /*#__PURE__*/_jsxs(HStack, {
|
|
230
|
+
gap: 4,
|
|
231
|
+
children: [legendPosition === 'start' && legendElement, /*#__PURE__*/_jsx("div", {
|
|
232
|
+
...{
|
|
233
|
+
className: "x98rzlu xeuugli xb3r6kr"
|
|
234
|
+
},
|
|
235
|
+
children: renderSvg()
|
|
236
|
+
}), legendPosition === 'end' && legendElement]
|
|
237
|
+
}) : /*#__PURE__*/_jsxs(VStack, {
|
|
238
|
+
gap: 4,
|
|
239
|
+
children: [legendPosition === 'top' && legendElement, renderSvg(), legendPosition === 'bottom' && legendElement]
|
|
240
|
+
})
|
|
241
|
+
})
|
|
242
|
+
})]
|
|
243
|
+
});
|
|
244
|
+
function renderSvg() {
|
|
245
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
246
|
+
ref: svgRef,
|
|
247
|
+
width: "100%",
|
|
248
|
+
height: height,
|
|
249
|
+
"aria-label": title ?? undefined,
|
|
250
|
+
"aria-describedby": subtitle ? descId : undefined,
|
|
251
|
+
children: [title && /*#__PURE__*/_jsx("title", {
|
|
252
|
+
children: title
|
|
253
|
+
}), subtitle && /*#__PURE__*/_jsx("desc", {
|
|
254
|
+
id: descId,
|
|
255
|
+
children: subtitle
|
|
256
|
+
}), /*#__PURE__*/_jsxs("g", {
|
|
257
|
+
transform: `translate(${margin.left},${margin.top})`,
|
|
258
|
+
children: [grid, series.map(s => {
|
|
259
|
+
const resolved = layout.resolved.get(s.key);
|
|
260
|
+
if (!resolved) {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
return /*#__PURE__*/_jsx("g", {
|
|
264
|
+
children: s.render(resolved, seriesCtx)
|
|
265
|
+
}, s.key);
|
|
266
|
+
}), axes, /*#__PURE__*/_jsx("rect", {
|
|
267
|
+
x: 0,
|
|
268
|
+
y: 0,
|
|
269
|
+
width: innerWidth,
|
|
270
|
+
height: innerHeight,
|
|
271
|
+
fill: "transparent",
|
|
272
|
+
onPointerMove: handlePointerMove,
|
|
273
|
+
onPointerLeave: handlePointerLeave
|
|
274
|
+
}), interactions, tooltip && /*#__PURE__*/_jsx(ChartTooltip, {
|
|
275
|
+
series: series,
|
|
276
|
+
...(tooltip === true ? {} : tooltip)
|
|
277
|
+
}), children]
|
|
278
|
+
})]
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface ChartAxisProps {
|
|
2
|
+
/** Which edge to render the axis on */
|
|
3
|
+
position: 'top' | 'right' | 'bottom' | 'left';
|
|
4
|
+
/** Number of ticks (approximate — d3 decides final count) */
|
|
5
|
+
tickCount?: number;
|
|
6
|
+
/** Maximum number of tick labels to show. Labels are evenly skipped when exceeded. */
|
|
7
|
+
maxTicks?: number;
|
|
8
|
+
/** Custom tick formatter */
|
|
9
|
+
tickFormat?: (value: unknown) => string;
|
|
10
|
+
/** Truncate labels to this many characters (appends "\u2026"). */
|
|
11
|
+
truncate?: number;
|
|
12
|
+
/** Enable smooth transitions for streaming (default: true) */
|
|
13
|
+
animated?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Show the axis edge line. Defaults to `true` for `position="bottom"`,
|
|
16
|
+
* `false` otherwise. Forced to `true` when `showTicks` is enabled.
|
|
17
|
+
* Pair with `<ChartGrid vertical />` and pass `showAxisLine` on the
|
|
18
|
+
* corresponding side axis to keep the visual edge grounded.
|
|
19
|
+
*/
|
|
20
|
+
showAxisLine?: boolean;
|
|
21
|
+
/** Show perpendicular tick marks at each tick label. Default: `false`. */
|
|
22
|
+
showTicks?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Chart axis. Always draws tick labels; the axis edge line and tick marks
|
|
26
|
+
* are independently toggleable. Pair with `<ChartGrid>` for grid lines.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```
|
|
30
|
+
* <ChartAxis position="bottom" /> // edge line + labels
|
|
31
|
+
* <ChartAxis position="left" /> // labels only (no edge line)
|
|
32
|
+
* <ChartAxis position="left" showAxisLine showTicks />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function ChartAxis({ position, tickCount, maxTicks, tickFormat, truncate, animated, showAxisLine, showTicks, }: ChartAxisProps): import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=ChartAxis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartAxis.d.ts","sourceRoot":"","sources":["../../src/ChartV2/ChartAxis.tsx"],"names":[],"mappings":"AAsBA,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,QAAQ,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;IACxC,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAeD;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,SAAa,EACb,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,QAAe,EACf,YAAoC,EACpC,SAAiB,GAClB,EAAE,cAAc,+BAiIhB"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file ChartAxis.tsx (v2)
|
|
5
|
+
* @output Renders an axis (top, right, bottom, left) using the chart's scales
|
|
6
|
+
* @position Child of Chart v2; reads scales from chart context
|
|
7
|
+
*
|
|
8
|
+
* The axis edge line and tick marks are independently toggleable so callers
|
|
9
|
+
* can compose: line-only, line + ticks, or line + ticks + grid (paired with
|
|
10
|
+
* `<ChartGrid>`). To stay consistent with most charts, the bottom axis
|
|
11
|
+
* draws its edge line by default and other positions don't.
|
|
12
|
+
*
|
|
13
|
+
* Ticks use CSS transitions for smooth sliding during streaming updates.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { useMemo } from 'react';
|
|
17
|
+
import * as stylex from '@stylexjs/stylex';
|
|
18
|
+
import '@astryxdesign/core/theme/tokens.stylex';
|
|
19
|
+
import { colorVars } from '@astryxdesign/core/theme/tokens.stylex';
|
|
20
|
+
import { useChart } from "../Chart/ChartContext.js";
|
|
21
|
+
import { isBandScale } from "../Chart/utils.js";
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
const TICK_SIZE = 6;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Chart axis. Always draws tick labels; the axis edge line and tick marks
|
|
27
|
+
* are independently toggleable. Pair with `<ChartGrid>` for grid lines.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```
|
|
31
|
+
* <ChartAxis position="bottom" /> // edge line + labels
|
|
32
|
+
* <ChartAxis position="left" /> // labels only (no edge line)
|
|
33
|
+
* <ChartAxis position="left" showAxisLine showTicks />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export function ChartAxis({
|
|
37
|
+
position,
|
|
38
|
+
tickCount = 5,
|
|
39
|
+
maxTicks,
|
|
40
|
+
tickFormat,
|
|
41
|
+
truncate,
|
|
42
|
+
animated = true,
|
|
43
|
+
showAxisLine = position === 'bottom',
|
|
44
|
+
showTicks = false
|
|
45
|
+
}) {
|
|
46
|
+
// Tick marks need an axis line to anchor against; force it on when ticks
|
|
47
|
+
// are enabled so the two visuals stay coherent.
|
|
48
|
+
const renderAxisLine = showAxisLine || showTicks;
|
|
49
|
+
const {
|
|
50
|
+
width,
|
|
51
|
+
height,
|
|
52
|
+
xScale,
|
|
53
|
+
yScale
|
|
54
|
+
} = useChart();
|
|
55
|
+
const isHorizontal = position === 'top' || position === 'bottom';
|
|
56
|
+
const scale = isHorizontal ? xScale : yScale;
|
|
57
|
+
const ticks = useMemo(() => {
|
|
58
|
+
let allTicks;
|
|
59
|
+
if (isBandScale(scale)) {
|
|
60
|
+
allTicks = scale.domain().map(d => ({
|
|
61
|
+
value: d,
|
|
62
|
+
offset: (scale(d) ?? 0) + scale.bandwidth() / 2
|
|
63
|
+
}));
|
|
64
|
+
} else {
|
|
65
|
+
const linearScale = scale;
|
|
66
|
+
allTicks = linearScale.ticks(tickCount).map(d => ({
|
|
67
|
+
value: d,
|
|
68
|
+
offset: linearScale(d)
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Auto-skip: show every Nth label if maxTicks is exceeded
|
|
73
|
+
if (maxTicks && allTicks.length > maxTicks) {
|
|
74
|
+
const step = Math.ceil(allTicks.length / maxTicks);
|
|
75
|
+
allTicks = allTicks.filter((_, i) => i % step === 0);
|
|
76
|
+
}
|
|
77
|
+
return allTicks;
|
|
78
|
+
}, [scale, tickCount, maxTicks]);
|
|
79
|
+
const transform = position === 'bottom' ? `translate(0,${height})` : position === 'right' ? `translate(${width},0)` : undefined;
|
|
80
|
+
|
|
81
|
+
// For the bottom axis, draw the axis line at y=0 when the domain spans
|
|
82
|
+
// negative values (so the axis line still represents zero, not the chart edge).
|
|
83
|
+
const axisLineY = (() => {
|
|
84
|
+
if (position !== 'bottom') {
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
const domain = yScale.domain();
|
|
88
|
+
if (domain[0] < 0 && domain[1] > 0) {
|
|
89
|
+
return yScale(0) - height;
|
|
90
|
+
}
|
|
91
|
+
return 0;
|
|
92
|
+
})();
|
|
93
|
+
const baseFormat = tickFormat ?? String;
|
|
94
|
+
const format = truncate ? value => {
|
|
95
|
+
const str = baseFormat(value);
|
|
96
|
+
return str.length > truncate ? str.slice(0, truncate) + '\u2026' : str;
|
|
97
|
+
} : baseFormat;
|
|
98
|
+
const tickTransition = animated ? 'transform 150ms linear, opacity 150ms ease' : undefined;
|
|
99
|
+
return /*#__PURE__*/_jsxs("g", {
|
|
100
|
+
transform: transform,
|
|
101
|
+
children: [renderAxisLine && /*#__PURE__*/_jsx("line", {
|
|
102
|
+
x1: 0,
|
|
103
|
+
x2: isHorizontal ? width : 0,
|
|
104
|
+
y1: isHorizontal ? axisLineY : 0,
|
|
105
|
+
y2: isHorizontal ? axisLineY : height,
|
|
106
|
+
...{
|
|
107
|
+
className: "x1lo1t26 xnpr05h"
|
|
108
|
+
}
|
|
109
|
+
}), ticks.map(({
|
|
110
|
+
value,
|
|
111
|
+
offset
|
|
112
|
+
}) => {
|
|
113
|
+
const label = format(value);
|
|
114
|
+
const isVisible = isHorizontal ? offset >= -10 && offset <= width + 10 : offset >= -10 && offset <= height + 10;
|
|
115
|
+
if (isHorizontal) {
|
|
116
|
+
const y = position === 'bottom' ? TICK_SIZE : -TICK_SIZE;
|
|
117
|
+
return /*#__PURE__*/_jsxs("g", {
|
|
118
|
+
style: {
|
|
119
|
+
transform: `translateX(${offset}px)`,
|
|
120
|
+
transition: tickTransition,
|
|
121
|
+
opacity: isVisible ? 1 : 0
|
|
122
|
+
},
|
|
123
|
+
children: [showTicks && /*#__PURE__*/_jsx("line", {
|
|
124
|
+
y2: y,
|
|
125
|
+
...{
|
|
126
|
+
className: "x1lo1t26 xnpr05h"
|
|
127
|
+
}
|
|
128
|
+
}), /*#__PURE__*/_jsx("text", {
|
|
129
|
+
y: position === 'bottom' ? TICK_SIZE + 12 : -(TICK_SIZE + 4),
|
|
130
|
+
textAnchor: "middle",
|
|
131
|
+
fill: "var(--color-text-secondary)",
|
|
132
|
+
fontSize: 12,
|
|
133
|
+
children: label
|
|
134
|
+
})]
|
|
135
|
+
}, label);
|
|
136
|
+
}
|
|
137
|
+
// Vertical axis
|
|
138
|
+
const x = position === 'left' ? -TICK_SIZE : TICK_SIZE;
|
|
139
|
+
return /*#__PURE__*/_jsxs("g", {
|
|
140
|
+
style: {
|
|
141
|
+
transform: `translateY(${offset}px)`,
|
|
142
|
+
transition: tickTransition,
|
|
143
|
+
opacity: isVisible ? 1 : 0
|
|
144
|
+
},
|
|
145
|
+
children: [showTicks && /*#__PURE__*/_jsx("line", {
|
|
146
|
+
x2: x,
|
|
147
|
+
...{
|
|
148
|
+
className: "x1lo1t26 xnpr05h"
|
|
149
|
+
}
|
|
150
|
+
}), /*#__PURE__*/_jsx("text", {
|
|
151
|
+
x: position === 'left' ? -(TICK_SIZE + 4) : TICK_SIZE + 4,
|
|
152
|
+
dy: "0.32em",
|
|
153
|
+
textAnchor: position === 'left' ? 'end' : 'start',
|
|
154
|
+
fill: "var(--color-text-secondary)",
|
|
155
|
+
fontSize: 12,
|
|
156
|
+
children: label
|
|
157
|
+
})]
|
|
158
|
+
}, label);
|
|
159
|
+
})]
|
|
160
|
+
});
|
|
161
|
+
}
|