@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,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file layout.ts
|
|
3
|
+
* @output Computes scales, stacking, grouping, then delegates to each series.resolve()
|
|
4
|
+
* @position Called by Chart root — the single layout pass
|
|
5
|
+
*
|
|
6
|
+
* The layout engine does NOT know about specific mark types.
|
|
7
|
+
* It handles cross-series coordination (scales, stacking, grouping)
|
|
8
|
+
* then calls each series' own resolve() method.
|
|
9
|
+
*/
|
|
10
|
+
import { scaleLinear } from 'd3-scale';
|
|
11
|
+
import type { SeriesDef, ChartScale, ResolvedPoint } from './types';
|
|
12
|
+
export interface LayoutInput {
|
|
13
|
+
data: Record<string, unknown>[];
|
|
14
|
+
xKey: string;
|
|
15
|
+
series: SeriesDef[];
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}
|
|
19
|
+
export interface LayoutResult {
|
|
20
|
+
xScale: ChartScale;
|
|
21
|
+
yScale: ReturnType<typeof scaleLinear<number, number>>;
|
|
22
|
+
resolved: Map<string, ResolvedPoint[]>;
|
|
23
|
+
}
|
|
24
|
+
export declare function computeLayout({ data, xKey, series, width, height, }: LayoutInput): LayoutResult;
|
|
25
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/ChartV2/layout.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,EAAC,WAAW,EAAY,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,aAAa,EAEd,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;CACxC;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,KAAK,EACL,MAAM,GACP,EAAE,WAAW,GAAG,YAAY,CAqL5B"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file layout.ts
|
|
5
|
+
* @output Computes scales, stacking, grouping, then delegates to each series.resolve()
|
|
6
|
+
* @position Called by Chart root — the single layout pass
|
|
7
|
+
*
|
|
8
|
+
* The layout engine does NOT know about specific mark types.
|
|
9
|
+
* It handles cross-series coordination (scales, stacking, grouping)
|
|
10
|
+
* then calls each series' own resolve() method.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { scaleLinear, scaleBand } from 'd3-scale';
|
|
14
|
+
import { stack as d3Stack, stackOrderNone, stackOffsetNone } from 'd3-shape';
|
|
15
|
+
export function computeLayout({
|
|
16
|
+
data,
|
|
17
|
+
xKey,
|
|
18
|
+
series,
|
|
19
|
+
width,
|
|
20
|
+
height
|
|
21
|
+
}) {
|
|
22
|
+
// ─── 1. X scale ──────────────────────────────────────────────────────
|
|
23
|
+
const xValues = data.map(d => d[xKey]);
|
|
24
|
+
const isNumericX = xValues.length > 0 && xValues.every(v => typeof v === 'number');
|
|
25
|
+
let xScale;
|
|
26
|
+
if (isNumericX) {
|
|
27
|
+
const nums = xValues;
|
|
28
|
+
xScale = scaleLinear().domain([Math.min(...nums), Math.max(...nums)]).range([0, width]).nice();
|
|
29
|
+
} else {
|
|
30
|
+
xScale = scaleBand().domain(xValues.map(String)).range([0, width]).padding(0.2);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ─── 2. Y domain from all series dataKeys ────────────────────────────
|
|
34
|
+
const allKeys = new Set();
|
|
35
|
+
let includeZero = false;
|
|
36
|
+
for (const s of series) {
|
|
37
|
+
for (const k of s.dataKeys) {
|
|
38
|
+
allKeys.add(k);
|
|
39
|
+
}
|
|
40
|
+
if (s.layout.includeZero) {
|
|
41
|
+
includeZero = true;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Collect which keys are stacked together so we can compute stacked extents
|
|
46
|
+
const stackGroupKeys = new Map();
|
|
47
|
+
for (const s of series) {
|
|
48
|
+
if (s.layout.stack) {
|
|
49
|
+
const group = stackGroupKeys.get(s.layout.stack) ?? [];
|
|
50
|
+
group.push(s.dataKeys[0]);
|
|
51
|
+
stackGroupKeys.set(s.layout.stack, group);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
let yMin = Infinity,
|
|
55
|
+
yMax = -Infinity;
|
|
56
|
+
|
|
57
|
+
// For stacked series, compute the sum at each data point
|
|
58
|
+
const stackedKeys = new Set();
|
|
59
|
+
for (const [, keys] of stackGroupKeys) {
|
|
60
|
+
for (const k of keys) {
|
|
61
|
+
stackedKeys.add(k);
|
|
62
|
+
}
|
|
63
|
+
for (const d of data) {
|
|
64
|
+
let sum = 0;
|
|
65
|
+
for (const k of keys) {
|
|
66
|
+
const v = d[k];
|
|
67
|
+
if (typeof v === 'number') {
|
|
68
|
+
sum += v;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (sum > yMax) {
|
|
72
|
+
yMax = sum;
|
|
73
|
+
}
|
|
74
|
+
if (sum < yMin) {
|
|
75
|
+
yMin = sum;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// For non-stacked series, use individual values
|
|
81
|
+
for (const d of data) {
|
|
82
|
+
for (const k of allKeys) {
|
|
83
|
+
if (stackedKeys.has(k)) {
|
|
84
|
+
continue;
|
|
85
|
+
} // already handled above
|
|
86
|
+
const v = d[k];
|
|
87
|
+
if (typeof v === 'number') {
|
|
88
|
+
if (v < yMin) {
|
|
89
|
+
yMin = v;
|
|
90
|
+
}
|
|
91
|
+
if (v > yMax) {
|
|
92
|
+
yMax = v;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (includeZero) {
|
|
98
|
+
if (yMin > 0) {
|
|
99
|
+
yMin = 0;
|
|
100
|
+
}
|
|
101
|
+
if (yMax < 0) {
|
|
102
|
+
yMax = 0;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const yScale = scaleLinear().domain([yMin, yMax]).range([height, 0]).nice();
|
|
106
|
+
|
|
107
|
+
// ─── 3. Stacking ─────────────────────────────────────────────────────
|
|
108
|
+
const stackGroups = new Map();
|
|
109
|
+
for (const s of series) {
|
|
110
|
+
if (s.layout.stack) {
|
|
111
|
+
const group = stackGroups.get(s.layout.stack) ?? [];
|
|
112
|
+
group.push(s.dataKeys[0]);
|
|
113
|
+
stackGroups.set(s.layout.stack, group);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const stackedData = new Map();
|
|
117
|
+
for (const [, keys] of stackGroups) {
|
|
118
|
+
const stackGen = d3Stack().keys(keys).order(stackOrderNone).offset(stackOffsetNone);
|
|
119
|
+
const stacked = stackGen(data);
|
|
120
|
+
for (const layer of stacked) {
|
|
121
|
+
stackedData.set(layer.key, layer.map(d => ({
|
|
122
|
+
y0: d[0],
|
|
123
|
+
y1: d[1]
|
|
124
|
+
})));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// ─── 4. Bar grouping ─────────────────────────────────────────────────
|
|
129
|
+
// Bars can be grouped (side-by-side) whether or not they are stacked.
|
|
130
|
+
// For grouped stacks, each unique stack group name within the same bar
|
|
131
|
+
// group gets its own sub-band. For ungrouped non-stacked bars with a
|
|
132
|
+
// group key, each series gets its own sub-band.
|
|
133
|
+
const barGroups = new Map();
|
|
134
|
+
for (const s of series) {
|
|
135
|
+
if (s.type === 'bar' && s.layout.group) {
|
|
136
|
+
const group = barGroups.get(s.layout.group) ?? [];
|
|
137
|
+
// For grouped stacks: use the stack name as the group slot identifier
|
|
138
|
+
// so all series in the same stack share one slot.
|
|
139
|
+
const slotKey = s.layout.stack ?? s.key;
|
|
140
|
+
if (!group.includes(slotKey)) {
|
|
141
|
+
group.push(slotKey);
|
|
142
|
+
}
|
|
143
|
+
barGroups.set(s.layout.group, group);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// ─── 5. Resolve each series ──────────────────────────────────────────
|
|
148
|
+
const ctx = {
|
|
149
|
+
data,
|
|
150
|
+
xKey,
|
|
151
|
+
xScale,
|
|
152
|
+
yScale,
|
|
153
|
+
width,
|
|
154
|
+
height
|
|
155
|
+
};
|
|
156
|
+
const resolved = new Map();
|
|
157
|
+
|
|
158
|
+
// Determine which series is the topmost in each stack group
|
|
159
|
+
const stackTopKeys = new Set();
|
|
160
|
+
for (const [, keys] of stackGroups) {
|
|
161
|
+
// Last key in the stack group is rendered on top
|
|
162
|
+
if (keys.length > 0) {
|
|
163
|
+
stackTopKeys.add(keys[keys.length - 1]);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
for (const s of series) {
|
|
167
|
+
const stackOffsets = stackedData.get(s.dataKeys[0]);
|
|
168
|
+
|
|
169
|
+
// Mark whether this series is the topmost in its stack
|
|
170
|
+
if (s.layout.stack) {
|
|
171
|
+
s._isTopOfStack = stackTopKeys.has(s.dataKeys[0]);
|
|
172
|
+
} else {
|
|
173
|
+
s._isTopOfStack = true;
|
|
174
|
+
}
|
|
175
|
+
let groupInfo;
|
|
176
|
+
if (s.layout.group) {
|
|
177
|
+
const groupKeys = barGroups.get(s.layout.group);
|
|
178
|
+
if (groupKeys) {
|
|
179
|
+
// For grouped stacks, the slot key is the stack name
|
|
180
|
+
const slotKey = s.layout.stack ?? s.key;
|
|
181
|
+
groupInfo = {
|
|
182
|
+
index: groupKeys.indexOf(slotKey),
|
|
183
|
+
count: groupKeys.length
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
const points = s.resolve(ctx, stackOffsets, groupInfo);
|
|
188
|
+
resolved.set(s.key, points);
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
xScale,
|
|
192
|
+
yScale,
|
|
193
|
+
resolved
|
|
194
|
+
};
|
|
195
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file legend.ts
|
|
3
|
+
* @output Legend utility — derives legend items from series definitions
|
|
4
|
+
* @position Used by Chart to bridge series → legend items
|
|
5
|
+
*/
|
|
6
|
+
import { type SeriesDef } from './types';
|
|
7
|
+
export interface LegendItem {
|
|
8
|
+
label: string;
|
|
9
|
+
color: string;
|
|
10
|
+
/** Mark type — determines swatch shape (square for bar, line for everything else) */
|
|
11
|
+
type?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Derive legend items from series definitions.
|
|
15
|
+
* Skips utility marks and series without a color.
|
|
16
|
+
*/
|
|
17
|
+
export declare function deriveLegendItems(series: readonly SeriesDef[]): LegendItem[];
|
|
18
|
+
//# sourceMappingURL=legend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/ChartV2/legend.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAQD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,UAAU,EAAE,CAI5E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file legend.ts
|
|
5
|
+
* @output Legend utility — derives legend items from series definitions
|
|
6
|
+
* @position Used by Chart to bridge series → legend items
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { isUtilityMarkType } from "./types.js";
|
|
10
|
+
function hasLegendColor(series) {
|
|
11
|
+
return !isUtilityMarkType(series.type) && series.color != null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Derive legend items from series definitions.
|
|
16
|
+
* Skips utility marks and series without a color.
|
|
17
|
+
*/
|
|
18
|
+
export function deriveLegendItems(series) {
|
|
19
|
+
return series.filter(hasLegendColor).map(s => ({
|
|
20
|
+
label: s.label ?? s.key,
|
|
21
|
+
color: s.color,
|
|
22
|
+
type: s.type
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SeriesDef } from '../types';
|
|
2
|
+
declare const CURVES: {
|
|
3
|
+
readonly linear: import("d3-shape").CurveFactory;
|
|
4
|
+
readonly monotone: import("d3-shape").CurveFactory;
|
|
5
|
+
readonly natural: import("d3-shape").CurveFactory;
|
|
6
|
+
readonly step: import("d3-shape").CurveFactory;
|
|
7
|
+
};
|
|
8
|
+
export interface AreaOptions {
|
|
9
|
+
color?: string;
|
|
10
|
+
opacity?: number;
|
|
11
|
+
curve?: keyof typeof CURVES;
|
|
12
|
+
stack?: string;
|
|
13
|
+
gradient?: boolean;
|
|
14
|
+
stroke?: boolean;
|
|
15
|
+
label?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function area(dataKey: string, options?: AreaOptions): SeriesDef;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area.d.ts","sourceRoot":"","sources":["../../../src/ChartV2/marks/area.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAC,SAAS,EAAgB,MAAM,UAAU,CAAC;AAGvD,QAAA,MAAM,MAAM;;;;;CAKF,CAAC;AAEX,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,SAAS,CAsF1E"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file marks/area.tsx
|
|
5
|
+
* @output Area series — fill under line with stacking + gradient support
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { area as d3Area, curveLinear, curveMonotoneX, curveNatural, curveStep } from 'd3-shape';
|
|
9
|
+
import { line as d3Line } from 'd3-shape';
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const CURVES = {
|
|
12
|
+
linear: curveLinear,
|
|
13
|
+
monotone: curveMonotoneX,
|
|
14
|
+
natural: curveNatural,
|
|
15
|
+
step: curveStep
|
|
16
|
+
};
|
|
17
|
+
export function area(dataKey, options = {}) {
|
|
18
|
+
const color = options.color ?? 'var(--color-chart-1)';
|
|
19
|
+
const opacity = options.opacity ?? 0.3;
|
|
20
|
+
const curve = options.curve ?? 'monotone';
|
|
21
|
+
const gradient = options.gradient ?? false;
|
|
22
|
+
const stroke = options.stroke ?? true;
|
|
23
|
+
return {
|
|
24
|
+
type: 'area',
|
|
25
|
+
key: dataKey,
|
|
26
|
+
dataKeys: [dataKey],
|
|
27
|
+
color,
|
|
28
|
+
label: options.label ?? dataKey,
|
|
29
|
+
layout: {
|
|
30
|
+
stack: options.stack,
|
|
31
|
+
includeZero: true
|
|
32
|
+
},
|
|
33
|
+
resolve(ctx, stackOffsets) {
|
|
34
|
+
const {
|
|
35
|
+
data,
|
|
36
|
+
xKey,
|
|
37
|
+
xScale,
|
|
38
|
+
yScale
|
|
39
|
+
} = ctx;
|
|
40
|
+
const points = [];
|
|
41
|
+
for (let i = 0; i < data.length; i++) {
|
|
42
|
+
const d = data[i];
|
|
43
|
+
let px;
|
|
44
|
+
if ('bandwidth' in xScale) {
|
|
45
|
+
px = (xScale(String(d[xKey])) ?? 0) + xScale.bandwidth() / 2;
|
|
46
|
+
} else {
|
|
47
|
+
px = xScale(d[xKey]);
|
|
48
|
+
}
|
|
49
|
+
let py, py0;
|
|
50
|
+
if (stackOffsets) {
|
|
51
|
+
py = yScale(stackOffsets[i].y1);
|
|
52
|
+
py0 = yScale(stackOffsets[i].y0);
|
|
53
|
+
} else {
|
|
54
|
+
const v = typeof d[dataKey] === 'number' ? d[dataKey] : 0;
|
|
55
|
+
py = yScale(v);
|
|
56
|
+
py0 = yScale(0);
|
|
57
|
+
}
|
|
58
|
+
points.push({
|
|
59
|
+
px,
|
|
60
|
+
py,
|
|
61
|
+
py0,
|
|
62
|
+
dataIndex: i
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return points;
|
|
66
|
+
},
|
|
67
|
+
render(resolved) {
|
|
68
|
+
if (resolved.length === 0) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const curveFactory = CURVES[curve];
|
|
72
|
+
const areaGen = d3Area().x(d => d.px).y0(d => d.py0).y1(d => d.py).curve(curveFactory);
|
|
73
|
+
const pathD = areaGen(resolved) ?? '';
|
|
74
|
+
const lineGen = d3Line().x(d => d.px).y(d => d.py).curve(curveFactory);
|
|
75
|
+
const strokeD = lineGen(resolved) ?? '';
|
|
76
|
+
const gradientId = `area-grad-${dataKey}`;
|
|
77
|
+
return /*#__PURE__*/_jsxs("g", {
|
|
78
|
+
children: [gradient && /*#__PURE__*/_jsx("defs", {
|
|
79
|
+
children: /*#__PURE__*/_jsxs("linearGradient", {
|
|
80
|
+
id: gradientId,
|
|
81
|
+
x1: "0",
|
|
82
|
+
y1: "0",
|
|
83
|
+
x2: "0",
|
|
84
|
+
y2: "1",
|
|
85
|
+
children: [/*#__PURE__*/_jsx("stop", {
|
|
86
|
+
offset: "0%",
|
|
87
|
+
stopColor: color,
|
|
88
|
+
stopOpacity: opacity
|
|
89
|
+
}), /*#__PURE__*/_jsx("stop", {
|
|
90
|
+
offset: "100%",
|
|
91
|
+
stopColor: color,
|
|
92
|
+
stopOpacity: 0
|
|
93
|
+
})]
|
|
94
|
+
})
|
|
95
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
96
|
+
d: pathD,
|
|
97
|
+
fill: gradient ? `url(#${gradientId})` : color,
|
|
98
|
+
fillOpacity: gradient ? 1 : opacity,
|
|
99
|
+
stroke: "none"
|
|
100
|
+
}), stroke && /*#__PURE__*/_jsx("path", {
|
|
101
|
+
d: strokeD,
|
|
102
|
+
fill: "none",
|
|
103
|
+
stroke: color,
|
|
104
|
+
strokeWidth: 2
|
|
105
|
+
})]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"band.d.ts","sourceRoot":"","sources":["../../../src/ChartV2/marks/band.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,SAAS,EAAgB,MAAM,UAAU,CAAC;AAGvD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,CAmDpD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file marks/band.tsx
|
|
5
|
+
* @output Band (confidence interval) series
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { area as d3Area, curveMonotoneX } from 'd3-shape';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export function band(options) {
|
|
11
|
+
const color = options.color ?? 'var(--color-chart-1)';
|
|
12
|
+
const opacity = options.opacity ?? 0.15;
|
|
13
|
+
return {
|
|
14
|
+
type: 'band',
|
|
15
|
+
key: `band-${options.upper}-${options.lower}`,
|
|
16
|
+
dataKeys: [options.upper, options.lower],
|
|
17
|
+
layout: {},
|
|
18
|
+
resolve(ctx) {
|
|
19
|
+
const {
|
|
20
|
+
data,
|
|
21
|
+
xKey,
|
|
22
|
+
xScale,
|
|
23
|
+
yScale
|
|
24
|
+
} = ctx;
|
|
25
|
+
const points = [];
|
|
26
|
+
for (let i = 0; i < data.length; i++) {
|
|
27
|
+
const d = data[i];
|
|
28
|
+
let px;
|
|
29
|
+
if ('bandwidth' in xScale) {
|
|
30
|
+
px = (xScale(String(d[xKey])) ?? 0) + xScale.bandwidth() / 2;
|
|
31
|
+
} else {
|
|
32
|
+
px = xScale(d[xKey]);
|
|
33
|
+
}
|
|
34
|
+
const upper = typeof d[options.upper] === 'number' ? d[options.upper] : 0;
|
|
35
|
+
const lower = typeof d[options.lower] === 'number' ? d[options.lower] : 0;
|
|
36
|
+
points.push({
|
|
37
|
+
px,
|
|
38
|
+
py: yScale(upper),
|
|
39
|
+
py0: yScale(lower),
|
|
40
|
+
dataIndex: i
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return points;
|
|
44
|
+
},
|
|
45
|
+
render(resolved) {
|
|
46
|
+
if (resolved.length === 0) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const areaGen = d3Area().x(d => d.px).y0(d => d.py0).y1(d => d.py).curve(curveMonotoneX);
|
|
50
|
+
const pathD = areaGen(resolved) ?? '';
|
|
51
|
+
return /*#__PURE__*/_jsx("path", {
|
|
52
|
+
d: pathD,
|
|
53
|
+
fill: color,
|
|
54
|
+
fillOpacity: opacity,
|
|
55
|
+
stroke: "none"
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file marks/bar.tsx
|
|
3
|
+
* @output Bar series — self-contained resolve + render
|
|
4
|
+
* @position Standalone mark; chart root calls resolve() then render()
|
|
5
|
+
*/
|
|
6
|
+
import type { SeriesDef } from '../types';
|
|
7
|
+
export type ColorAccessor = string | ((datum: Record<string, unknown>, index: number) => string);
|
|
8
|
+
export interface BarOptions {
|
|
9
|
+
color?: ColorAccessor;
|
|
10
|
+
opacity?: number;
|
|
11
|
+
radius?: number;
|
|
12
|
+
stack?: string;
|
|
13
|
+
group?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function bar(dataKey: string, options?: BarOptions): SeriesDef;
|
|
17
|
+
//# sourceMappingURL=bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar.d.ts","sourceRoot":"","sources":["../../../src/ChartV2/marks/bar.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAgB,MAAM,UAAU,CAAC;AAGvD,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;AAEhE,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAgDD,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,SAAS,CAwFxE"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file marks/bar.tsx
|
|
6
|
+
* @output Bar series — self-contained resolve + render
|
|
7
|
+
* @position Standalone mark; chart root calls resolve() then render()
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Build an SVG path for a rectangle with only the top corners rounded.
|
|
12
|
+
* When `r` is 0, produces a simple rect path with no curves.
|
|
13
|
+
*/
|
|
14
|
+
function roundedTopRect(x, y, w, h, r) {
|
|
15
|
+
// Clamp radius to half the smaller dimension
|
|
16
|
+
const cr = Math.min(r, w / 2, h / 2);
|
|
17
|
+
if (cr <= 0) {
|
|
18
|
+
return `M${x},${y + h}V${y}H${x + w}V${y + h}Z`;
|
|
19
|
+
}
|
|
20
|
+
return `M${x},${y + h}` + `V${y + cr}Q${x},${y} ${x + cr},${y}` + `H${x + w - cr}Q${x + w},${y} ${x + w},${y + cr}` + `V${y + h}Z`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Build an SVG path for a rectangle with only the bottom corners rounded.
|
|
25
|
+
*/
|
|
26
|
+
function roundedBottomRect(x, y, w, h, r) {
|
|
27
|
+
const cr = Math.min(r, w / 2, h / 2);
|
|
28
|
+
if (cr <= 0) {
|
|
29
|
+
return `M${x},${y}V${y + h}H${x + w}V${y}Z`;
|
|
30
|
+
}
|
|
31
|
+
return `M${x},${y}` + `V${y + h - cr}Q${x},${y + h} ${x + cr},${y + h}` + `H${x + w - cr}Q${x + w},${y + h} ${x + w},${y + h - cr}` + `V${y}Z`;
|
|
32
|
+
}
|
|
33
|
+
export function bar(dataKey, options = {}) {
|
|
34
|
+
const color = options.color ?? 'var(--color-chart-1)';
|
|
35
|
+
const opacity = options.opacity ?? 1;
|
|
36
|
+
const radius = options.radius ?? 4;
|
|
37
|
+
let barWidth = 0;
|
|
38
|
+
let barOffset = 0;
|
|
39
|
+
const seriesDef = {
|
|
40
|
+
type: 'bar',
|
|
41
|
+
key: dataKey,
|
|
42
|
+
dataKeys: [dataKey],
|
|
43
|
+
color: typeof color === 'string' ? color : undefined,
|
|
44
|
+
label: options.label ?? dataKey,
|
|
45
|
+
layout: {
|
|
46
|
+
stack: options.stack,
|
|
47
|
+
group: options.group,
|
|
48
|
+
includeZero: true
|
|
49
|
+
},
|
|
50
|
+
resolve(ctx, stackOffsets, groupInfo) {
|
|
51
|
+
const {
|
|
52
|
+
data,
|
|
53
|
+
xKey,
|
|
54
|
+
xScale,
|
|
55
|
+
yScale
|
|
56
|
+
} = ctx;
|
|
57
|
+
if (!('bandwidth' in xScale)) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
const bandScale = xScale;
|
|
61
|
+
const bw = bandScale.bandwidth();
|
|
62
|
+
if (groupInfo) {
|
|
63
|
+
const gutter = bw * 0.05;
|
|
64
|
+
const totalGutters = gutter * (groupInfo.count - 1);
|
|
65
|
+
barWidth = (bw - totalGutters) / groupInfo.count;
|
|
66
|
+
barOffset = groupInfo.index * (barWidth + gutter);
|
|
67
|
+
} else {
|
|
68
|
+
barWidth = bw;
|
|
69
|
+
barOffset = 0;
|
|
70
|
+
}
|
|
71
|
+
const points = [];
|
|
72
|
+
for (let i = 0; i < data.length; i++) {
|
|
73
|
+
const d = data[i];
|
|
74
|
+
const xBase = bandScale(String(d[xKey])) ?? 0;
|
|
75
|
+
const px = xBase + barOffset + barWidth / 2;
|
|
76
|
+
let py;
|
|
77
|
+
let py0;
|
|
78
|
+
if (stackOffsets) {
|
|
79
|
+
py = yScale(stackOffsets[i].y1);
|
|
80
|
+
py0 = yScale(stackOffsets[i].y0);
|
|
81
|
+
} else {
|
|
82
|
+
const v = typeof d[dataKey] === 'number' ? d[dataKey] : 0;
|
|
83
|
+
py = yScale(v);
|
|
84
|
+
py0 = yScale(0);
|
|
85
|
+
}
|
|
86
|
+
points.push({
|
|
87
|
+
px,
|
|
88
|
+
py,
|
|
89
|
+
py0,
|
|
90
|
+
dataIndex: i
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return points;
|
|
94
|
+
},
|
|
95
|
+
render(resolved, ctx) {
|
|
96
|
+
const {
|
|
97
|
+
data
|
|
98
|
+
} = ctx;
|
|
99
|
+
const isTop = seriesDef._isTopOfStack !== false;
|
|
100
|
+
const r = isTop ? radius : 0;
|
|
101
|
+
return /*#__PURE__*/_jsx("g", {
|
|
102
|
+
opacity: opacity,
|
|
103
|
+
children: resolved.map((p, i) => {
|
|
104
|
+
const d = data[p.dataIndex];
|
|
105
|
+
const fill = typeof color === 'function' ? color(d, p.dataIndex) : color;
|
|
106
|
+
const x = p.px - barWidth / 2;
|
|
107
|
+
const y = Math.min(p.py, p.py0);
|
|
108
|
+
const h = Math.max(0, Math.abs(p.py0 - p.py));
|
|
109
|
+
const growsUp = p.py <= p.py0;
|
|
110
|
+
const d_attr = growsUp ? roundedTopRect(x, y, barWidth, h, r) : roundedBottomRect(x, y, barWidth, h, r);
|
|
111
|
+
return /*#__PURE__*/_jsx("path", {
|
|
112
|
+
d: d_attr,
|
|
113
|
+
fill: fill
|
|
114
|
+
}, i);
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
return seriesDef;
|
|
120
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file marks/candlestick.tsx
|
|
3
|
+
* @output Candlestick (OHLC) series
|
|
4
|
+
*/
|
|
5
|
+
import type { SeriesDef } from '../types';
|
|
6
|
+
export interface CandlestickOptions {
|
|
7
|
+
open: string;
|
|
8
|
+
high: string;
|
|
9
|
+
low: string;
|
|
10
|
+
close: string;
|
|
11
|
+
upColor?: string;
|
|
12
|
+
downColor?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function candlestick(options: CandlestickOptions): SeriesDef;
|
|
15
|
+
//# sourceMappingURL=candlestick.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candlestick.d.ts","sourceRoot":"","sources":["../../../src/ChartV2/marks/candlestick.tsx"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAgB,MAAM,UAAU,CAAC;AAGvD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,CAsFlE"}
|