@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,66 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file SankeyNode.tsx
|
|
5
|
+
* @output Renders node indicators with optional glow
|
|
6
|
+
* @position Visual layer — node bars that labels sit on
|
|
7
|
+
*
|
|
8
|
+
* Reads nodeColor from chart context. When set, all nodes use that color.
|
|
9
|
+
* Otherwise, uses each node's individual oklch color from data.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import {useSankey} from './SankeyContext';
|
|
13
|
+
|
|
14
|
+
export interface SankeyNodeProps {
|
|
15
|
+
/** Whether to show the glow effect behind nodes (default: true) */
|
|
16
|
+
glow?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function oklch(c: [number, number, number], alpha: number): string {
|
|
20
|
+
return `oklch(${c[0]} ${c[1]} ${c[2]} / ${alpha})`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Renders all node indicators in the Sankey chart.
|
|
25
|
+
*
|
|
26
|
+
* Color comes from the chart's `nodeColor` prop (global override)
|
|
27
|
+
* or each node's individual color from data.
|
|
28
|
+
*/
|
|
29
|
+
export function SankeyNode({glow = true}: SankeyNodeProps) {
|
|
30
|
+
const {nodes, nodeColor} = useSankey();
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<g>
|
|
34
|
+
{nodes.map(node => {
|
|
35
|
+
const fill = nodeColor || oklch(node.color, 0.9);
|
|
36
|
+
const glowFill = nodeColor || oklch(node.color, 0.12);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<g key={node.id}>
|
|
40
|
+
{glow && (
|
|
41
|
+
<rect
|
|
42
|
+
x={node.x - 3}
|
|
43
|
+
y={node.y - 1}
|
|
44
|
+
width={node.width + 6}
|
|
45
|
+
height={node.height + 2}
|
|
46
|
+
rx={4}
|
|
47
|
+
fill={glowFill}
|
|
48
|
+
opacity={nodeColor ? 0.12 : 1}
|
|
49
|
+
/>
|
|
50
|
+
)}
|
|
51
|
+
<rect
|
|
52
|
+
x={node.x}
|
|
53
|
+
y={node.y}
|
|
54
|
+
width={node.width}
|
|
55
|
+
height={node.height}
|
|
56
|
+
rx={1.5}
|
|
57
|
+
fill={fill}
|
|
58
|
+
/>
|
|
59
|
+
</g>
|
|
60
|
+
);
|
|
61
|
+
})}
|
|
62
|
+
</g>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
SankeyNode.displayName = 'SankeyNode';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
export {SankeyChart, type SankeyChartProps} from './SankeyChart';
|
|
4
|
+
export {
|
|
5
|
+
SankeyLink,
|
|
6
|
+
type SankeyLinkProps,
|
|
7
|
+
type SankeyLinkColor,
|
|
8
|
+
} from './SankeyLink';
|
|
9
|
+
export {SankeyNode, type SankeyNodeProps} from './SankeyNode';
|
|
10
|
+
export {SankeyLabel, type SankeyLabelProps} from './SankeyLabel';
|
|
11
|
+
export {SankeyGrid, type SankeyGridProps} from './SankeyGrid';
|
|
12
|
+
export {useSankey} from './SankeyContext';
|
|
13
|
+
export type {
|
|
14
|
+
SankeyNodeDatum,
|
|
15
|
+
SankeyLinkDatum,
|
|
16
|
+
SankeyColumn,
|
|
17
|
+
SankeyColumnDef,
|
|
18
|
+
SankeyNodeLayout,
|
|
19
|
+
SankeyLinkLayout,
|
|
20
|
+
SankeyColumnLayout,
|
|
21
|
+
SankeyContext,
|
|
22
|
+
} from './types';
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file layout.ts
|
|
5
|
+
* @output Pure layout algorithm — computes node and link positions
|
|
6
|
+
* @position Core logic; consumed by SankeyChart during render
|
|
7
|
+
*
|
|
8
|
+
* Accepts columns as either string[][] (simple) or SankeyColumnDef[]
|
|
9
|
+
* (with labels). Reserves margin for labels and column headers.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type {
|
|
13
|
+
SankeyNodeDatum,
|
|
14
|
+
SankeyLinkDatum,
|
|
15
|
+
SankeyColumn,
|
|
16
|
+
SankeyColumnDef,
|
|
17
|
+
SankeyNodeLayout,
|
|
18
|
+
SankeyLinkLayout,
|
|
19
|
+
SankeyColumnLayout,
|
|
20
|
+
} from './types';
|
|
21
|
+
|
|
22
|
+
const DEFAULT_PALETTE: Array<[number, number, number]> = [
|
|
23
|
+
[0.65, 0.2, 270],
|
|
24
|
+
[0.6, 0.17, 235],
|
|
25
|
+
[0.62, 0.16, 190],
|
|
26
|
+
[0.64, 0.18, 155],
|
|
27
|
+
[0.58, 0.15, 40],
|
|
28
|
+
[0.55, 0.14, 350],
|
|
29
|
+
[0.54, 0.15, 20],
|
|
30
|
+
[0.56, 0.13, 300],
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
export interface LayoutOptions {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
nodeWidth?: number;
|
|
37
|
+
nodeGap?: number;
|
|
38
|
+
labelMargin?: number;
|
|
39
|
+
columns?: SankeyColumn[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Normalize column input to the rich format */
|
|
43
|
+
function normalizeColumns(cols: SankeyColumn[]): SankeyColumnDef[] {
|
|
44
|
+
return cols.map(c => (Array.isArray(c) ? {ids: c} : c));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function autoColumns(
|
|
48
|
+
nodes: SankeyNodeDatum[],
|
|
49
|
+
links: SankeyLinkDatum[],
|
|
50
|
+
): SankeyColumnDef[] {
|
|
51
|
+
const inDegree = new Map<string, number>();
|
|
52
|
+
const outEdges = new Map<string, string[]>();
|
|
53
|
+
nodes.forEach(n => {
|
|
54
|
+
inDegree.set(n.id, 0);
|
|
55
|
+
outEdges.set(n.id, []);
|
|
56
|
+
});
|
|
57
|
+
links.forEach(l => {
|
|
58
|
+
inDegree.set(l.target, (inDegree.get(l.target) || 0) + 1);
|
|
59
|
+
outEdges.get(l.source)?.push(l.target);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const colMap = new Map<string, number>();
|
|
63
|
+
const queue: string[] = [];
|
|
64
|
+
nodes.forEach(n => {
|
|
65
|
+
if (inDegree.get(n.id) === 0) {
|
|
66
|
+
queue.push(n.id);
|
|
67
|
+
colMap.set(n.id, 0);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
while (queue.length) {
|
|
72
|
+
const id = queue.shift();
|
|
73
|
+
if (id == null) {
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
const col = colMap.get(id) ?? 0;
|
|
77
|
+
for (const tgt of outEdges.get(id) || []) {
|
|
78
|
+
const newCol = col + 1;
|
|
79
|
+
colMap.set(tgt, Math.max(colMap.get(tgt) || 0, newCol));
|
|
80
|
+
inDegree.set(tgt, (inDegree.get(tgt) || 0) - 1);
|
|
81
|
+
if (inDegree.get(tgt) === 0) {
|
|
82
|
+
queue.push(tgt);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const maxCol = Math.max(...Array.from(colMap.values()), 0);
|
|
88
|
+
const columns: SankeyColumnDef[] = Array.from({length: maxCol + 1}, () => ({
|
|
89
|
+
ids: [] as string[],
|
|
90
|
+
}));
|
|
91
|
+
nodes.forEach(n => {
|
|
92
|
+
columns[colMap.get(n.id) || 0].ids.push(n.id);
|
|
93
|
+
});
|
|
94
|
+
return columns;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface LayoutResult {
|
|
98
|
+
nodes: SankeyNodeLayout[];
|
|
99
|
+
links: SankeyLinkLayout[];
|
|
100
|
+
columns: SankeyColumnLayout[];
|
|
101
|
+
valueScale: number;
|
|
102
|
+
maxValue: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function computeLayout(
|
|
106
|
+
nodes: SankeyNodeDatum[],
|
|
107
|
+
links: SankeyLinkDatum[],
|
|
108
|
+
options: LayoutOptions,
|
|
109
|
+
): LayoutResult {
|
|
110
|
+
const {
|
|
111
|
+
width,
|
|
112
|
+
height,
|
|
113
|
+
nodeWidth = 20,
|
|
114
|
+
nodeGap = 14,
|
|
115
|
+
labelMargin = 28,
|
|
116
|
+
} = options;
|
|
117
|
+
|
|
118
|
+
const colDefs = options.columns
|
|
119
|
+
? normalizeColumns(options.columns)
|
|
120
|
+
: autoColumns(nodes, links);
|
|
121
|
+
const colCount = colDefs.length;
|
|
122
|
+
const hasHeaders = colDefs.some(c => c.label);
|
|
123
|
+
const headerMargin = hasHeaders ? 20 : 0;
|
|
124
|
+
|
|
125
|
+
const nodeMap = new Map<string, SankeyNodeDatum>();
|
|
126
|
+
nodes.forEach(n => nodeMap.set(n.id, n));
|
|
127
|
+
|
|
128
|
+
// Usable height after reserving space for labels and headers
|
|
129
|
+
const usableHeight = height - labelMargin - 16 - headerMargin;
|
|
130
|
+
|
|
131
|
+
// Scale based on largest column
|
|
132
|
+
let maxColValue = 0;
|
|
133
|
+
colDefs.forEach(col => {
|
|
134
|
+
const total = col.ids.reduce(
|
|
135
|
+
(s, id) => s + (nodeMap.get(id)?.value || 0),
|
|
136
|
+
0,
|
|
137
|
+
);
|
|
138
|
+
if (total > maxColValue) {
|
|
139
|
+
maxColValue = total;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const maxNodes = Math.max(...colDefs.map(c => c.ids.length));
|
|
144
|
+
const valueScale = (usableHeight - (maxNodes - 1) * nodeGap) / maxColValue;
|
|
145
|
+
const colSpacing = colCount > 1 ? (width - nodeWidth) / (colCount - 1) : 0;
|
|
146
|
+
|
|
147
|
+
const columnLayouts: SankeyColumnLayout[] = [];
|
|
148
|
+
const layoutNodes = new Map<string, SankeyNodeLayout>();
|
|
149
|
+
let colorIdx = 0;
|
|
150
|
+
|
|
151
|
+
colDefs.forEach((col, ci) => {
|
|
152
|
+
const x = ci * colSpacing;
|
|
153
|
+
columnLayouts.push({x, label: col.label, ids: col.ids});
|
|
154
|
+
|
|
155
|
+
const totalH = col.ids.reduce(
|
|
156
|
+
(s, id) => s + (nodeMap.get(id)?.value || 0) * valueScale,
|
|
157
|
+
0,
|
|
158
|
+
);
|
|
159
|
+
const totalGap = (col.ids.length - 1) * nodeGap;
|
|
160
|
+
let y = labelMargin + (usableHeight - totalH - totalGap) / 2;
|
|
161
|
+
|
|
162
|
+
col.ids.forEach(id => {
|
|
163
|
+
const node = nodeMap.get(id);
|
|
164
|
+
if (!node) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const h = node.value * valueScale;
|
|
168
|
+
const color =
|
|
169
|
+
node.color || DEFAULT_PALETTE[colorIdx % DEFAULT_PALETTE.length];
|
|
170
|
+
colorIdx++;
|
|
171
|
+
|
|
172
|
+
layoutNodes.set(id, {
|
|
173
|
+
id,
|
|
174
|
+
label: node.label,
|
|
175
|
+
value: node.value,
|
|
176
|
+
color,
|
|
177
|
+
x,
|
|
178
|
+
y,
|
|
179
|
+
width: nodeWidth,
|
|
180
|
+
height: h,
|
|
181
|
+
column: ci,
|
|
182
|
+
_sourceOffset: 0,
|
|
183
|
+
_targetOffset: 0,
|
|
184
|
+
});
|
|
185
|
+
y += h + nodeGap;
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
const layoutLinks: SankeyLinkLayout[] = links.flatMap(link => {
|
|
190
|
+
const src = layoutNodes.get(link.source);
|
|
191
|
+
const tgt = layoutNodes.get(link.target);
|
|
192
|
+
if (!src || !tgt) {
|
|
193
|
+
return [];
|
|
194
|
+
}
|
|
195
|
+
const lh = link.value * valueScale;
|
|
196
|
+
const sourceY = src.y + src._sourceOffset;
|
|
197
|
+
const targetY = tgt.y + tgt._targetOffset;
|
|
198
|
+
src._sourceOffset += lh;
|
|
199
|
+
tgt._targetOffset += lh;
|
|
200
|
+
return [
|
|
201
|
+
{
|
|
202
|
+
source: src,
|
|
203
|
+
target: tgt,
|
|
204
|
+
value: link.value,
|
|
205
|
+
height: lh,
|
|
206
|
+
sourceY,
|
|
207
|
+
targetY,
|
|
208
|
+
},
|
|
209
|
+
];
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
return {
|
|
213
|
+
nodes: Array.from(layoutNodes.values()),
|
|
214
|
+
links: layoutLinks,
|
|
215
|
+
columns: columnLayouts,
|
|
216
|
+
valueScale,
|
|
217
|
+
maxValue: maxColValue,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file types.ts
|
|
5
|
+
* @output Sankey chart types — nodes, links, layout, and context
|
|
6
|
+
* @position Foundation types consumed by all Sankey sub-components
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** A node in the Sankey diagram */
|
|
10
|
+
export interface SankeyNodeDatum {
|
|
11
|
+
/** Unique identifier */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Display label */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Total value flowing through this node */
|
|
16
|
+
value: number;
|
|
17
|
+
/** Color in oklch format [lightness, chroma, hue] */
|
|
18
|
+
color?: [number, number, number];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** A link (flow) between two nodes */
|
|
22
|
+
export interface SankeyLinkDatum {
|
|
23
|
+
/** Source node ID */
|
|
24
|
+
source: string;
|
|
25
|
+
/** Target node ID */
|
|
26
|
+
target: string;
|
|
27
|
+
/** Flow value */
|
|
28
|
+
value: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Column definition.
|
|
33
|
+
* Simple form: string[] (just node IDs).
|
|
34
|
+
* Rich form: object with IDs, optional label, and type.
|
|
35
|
+
*/
|
|
36
|
+
export interface SankeyColumnDef {
|
|
37
|
+
/** Node IDs in this column */
|
|
38
|
+
ids: string[];
|
|
39
|
+
/** Column header label (rendered below the column) */
|
|
40
|
+
label?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Columns can be simple string arrays or rich definitions */
|
|
44
|
+
export type SankeyColumn = string[] | SankeyColumnDef;
|
|
45
|
+
|
|
46
|
+
/** Computed layout position for a node */
|
|
47
|
+
export interface SankeyNodeLayout {
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
value: number;
|
|
51
|
+
color: [number, number, number];
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
column: number;
|
|
57
|
+
_sourceOffset: number;
|
|
58
|
+
_targetOffset: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Computed layout position for a link */
|
|
62
|
+
export interface SankeyLinkLayout {
|
|
63
|
+
source: SankeyNodeLayout;
|
|
64
|
+
target: SankeyNodeLayout;
|
|
65
|
+
value: number;
|
|
66
|
+
height: number;
|
|
67
|
+
sourceY: number;
|
|
68
|
+
targetY: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Resolved column info exposed to children */
|
|
72
|
+
export interface SankeyColumnLayout {
|
|
73
|
+
/** X position of this column */
|
|
74
|
+
x: number;
|
|
75
|
+
/** Column header label (if provided) */
|
|
76
|
+
label?: string;
|
|
77
|
+
/** Node IDs in this column */
|
|
78
|
+
ids: string[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Context provided by SankeyChart to children */
|
|
82
|
+
export interface SankeyContext {
|
|
83
|
+
nodes: SankeyNodeLayout[];
|
|
84
|
+
links: SankeyLinkLayout[];
|
|
85
|
+
columns: SankeyColumnLayout[];
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
valueScale: number;
|
|
89
|
+
maxValue: number;
|
|
90
|
+
nodeWidth: number;
|
|
91
|
+
/** Global node color override (CSS string) — when set, all nodes use this color */
|
|
92
|
+
nodeColor?: string;
|
|
93
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CalendarEvent.ts
|
|
5
|
+
* @input ISO event definitions and PlainDate/Instant primitives
|
|
6
|
+
* @output Calendar event types and event construction helpers
|
|
7
|
+
* @position Public schedule event model; consumed by Schedule and views
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
plainDateFromISO,
|
|
12
|
+
type ISODateString,
|
|
13
|
+
type PlainDate,
|
|
14
|
+
} from '@astryxdesign/core/utils';
|
|
15
|
+
import type {TokenColor} from '@astryxdesign/core/Token';
|
|
16
|
+
import type {Instant} from './types';
|
|
17
|
+
|
|
18
|
+
const DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
19
|
+
|
|
20
|
+
export type ScheduleEventColor = Exclude<TokenColor, 'default'>;
|
|
21
|
+
|
|
22
|
+
export interface ScheduleCategory {
|
|
23
|
+
label: string;
|
|
24
|
+
color: ScheduleEventColor;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface CalendarEventBase {
|
|
28
|
+
id: string;
|
|
29
|
+
title: string;
|
|
30
|
+
category?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface CalendarDayEvent extends CalendarEventBase {
|
|
34
|
+
start: PlainDate;
|
|
35
|
+
end: PlainDate;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface CalendarInstantEvent extends CalendarEventBase {
|
|
39
|
+
start: Instant;
|
|
40
|
+
end: Instant;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type CalendarEvent = CalendarDayEvent | CalendarInstantEvent;
|
|
44
|
+
|
|
45
|
+
export function createEventFromISO({
|
|
46
|
+
id,
|
|
47
|
+
title,
|
|
48
|
+
category,
|
|
49
|
+
start,
|
|
50
|
+
end,
|
|
51
|
+
}: {
|
|
52
|
+
id: string;
|
|
53
|
+
title: string;
|
|
54
|
+
category?: CalendarEvent['category'];
|
|
55
|
+
start: string;
|
|
56
|
+
end: string;
|
|
57
|
+
}): CalendarEvent {
|
|
58
|
+
if (DATE_ONLY_RE.test(start) && DATE_ONLY_RE.test(end)) {
|
|
59
|
+
return {
|
|
60
|
+
id,
|
|
61
|
+
title,
|
|
62
|
+
category,
|
|
63
|
+
start: plainDateFromISO(start as ISODateString),
|
|
64
|
+
end: plainDateFromISO(end as ISODateString),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
id,
|
|
69
|
+
title,
|
|
70
|
+
category,
|
|
71
|
+
start: Date.parse(start) as Instant,
|
|
72
|
+
end: Date.parse(end) as Instant,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file DayView.tsx
|
|
7
|
+
* @input Schedule context and day view options
|
|
8
|
+
* @output Single-day time-grid schedule view factory
|
|
9
|
+
* @position Concrete schedule view; exported as createScheduleDayView
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
DATE_FORMAT_WITH_WEEKDAY,
|
|
14
|
+
plainDateAddDays,
|
|
15
|
+
plainDateFormat,
|
|
16
|
+
} from '@astryxdesign/core/utils';
|
|
17
|
+
import {enumerateDates, getScheduleRangeFromDates} from './dateMath';
|
|
18
|
+
import {useScheduleContext} from './context';
|
|
19
|
+
import {ScheduleMonthTitle, ScheduleFrame} from './shared';
|
|
20
|
+
import {TimeGridView} from './TimeGridView';
|
|
21
|
+
import {scheduleRangeToZonedDateTimeRange} from './zonedDateTime';
|
|
22
|
+
import type {
|
|
23
|
+
PlainDate,
|
|
24
|
+
ScheduleView,
|
|
25
|
+
ScheduleViewComponentProps,
|
|
26
|
+
} from './types';
|
|
27
|
+
|
|
28
|
+
export interface ScheduleDayViewOptions {
|
|
29
|
+
minHour?: number;
|
|
30
|
+
maxHour?: number;
|
|
31
|
+
hourHeight?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function ScheduleDayView({
|
|
35
|
+
options,
|
|
36
|
+
}: ScheduleViewComponentProps<ScheduleDayViewOptions>) {
|
|
37
|
+
const {events, date, focusDate, timezoneID, range, isLoading} =
|
|
38
|
+
useScheduleContext();
|
|
39
|
+
const {minHour = 0, maxHour = 24, hourHeight = 100} = options;
|
|
40
|
+
const rangeDate = date.toPlainDate();
|
|
41
|
+
const days = enumerateDates(range.startDate, range.endDate);
|
|
42
|
+
const titleLabel = plainDateFormat(rangeDate, DATE_FORMAT_WITH_WEEKDAY);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<ScheduleFrame
|
|
46
|
+
title={<ScheduleMonthTitle date={rangeDate} timezoneID={timezoneID} />}
|
|
47
|
+
titleLabel={titleLabel}
|
|
48
|
+
isLoading={isLoading}>
|
|
49
|
+
<TimeGridView
|
|
50
|
+
days={days}
|
|
51
|
+
events={events}
|
|
52
|
+
focusDate={focusDate.toPlainDate()}
|
|
53
|
+
timezoneID={timezoneID}
|
|
54
|
+
minHour={minHour}
|
|
55
|
+
maxHour={maxHour}
|
|
56
|
+
hourHeight={hourHeight}
|
|
57
|
+
/>
|
|
58
|
+
</ScheduleFrame>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function createScheduleDayView({
|
|
63
|
+
minHour = 0,
|
|
64
|
+
maxHour = 24,
|
|
65
|
+
hourHeight = 100,
|
|
66
|
+
}: ScheduleDayViewOptions = {}): ScheduleView<ScheduleDayViewOptions> {
|
|
67
|
+
return {
|
|
68
|
+
component: ScheduleDayView,
|
|
69
|
+
options: {minHour, maxHour, hourHeight},
|
|
70
|
+
getDateRange: date => {
|
|
71
|
+
const range = getDayDateRange({
|
|
72
|
+
date: date.toPlainDate(),
|
|
73
|
+
timezoneID: date.timezoneID,
|
|
74
|
+
});
|
|
75
|
+
return scheduleRangeToZonedDateTimeRange(range, date.timezoneID);
|
|
76
|
+
},
|
|
77
|
+
getPreviousDateRange: date => {
|
|
78
|
+
const range = getDayDateRange({
|
|
79
|
+
date: plainDateAddDays(date.toPlainDate(), -1),
|
|
80
|
+
timezoneID: date.timezoneID,
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
label: 'Previous day',
|
|
84
|
+
range: scheduleRangeToZonedDateTimeRange(range, date.timezoneID),
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
getNextDateRange: date => {
|
|
88
|
+
const range = getDayDateRange({
|
|
89
|
+
date: plainDateAddDays(date.toPlainDate(), 1),
|
|
90
|
+
timezoneID: date.timezoneID,
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
label: 'Next day',
|
|
94
|
+
range: scheduleRangeToZonedDateTimeRange(range, date.timezoneID),
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function getDayDateRange({
|
|
101
|
+
date,
|
|
102
|
+
timezoneID,
|
|
103
|
+
}: {
|
|
104
|
+
date: PlainDate;
|
|
105
|
+
timezoneID: string;
|
|
106
|
+
}) {
|
|
107
|
+
return getScheduleRangeFromDates({
|
|
108
|
+
startDate: date,
|
|
109
|
+
endDate: plainDateAddDays(date, 1),
|
|
110
|
+
timezoneID,
|
|
111
|
+
});
|
|
112
|
+
}
|