@tetrascience-npm/tetrascience-react-ui 0.7.0-beta.108.1 → 0.7.0-beta.129.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dist/components/ai/chain-of-thought.cjs +1 -1
- package/dist/components/ai/chain-of-thought.cjs.map +1 -1
- package/dist/components/ai/chain-of-thought.js +1 -1
- package/dist/components/ai/chain-of-thought.js.map +1 -1
- package/dist/components/ai/confirmation.cjs +1 -1
- package/dist/components/ai/confirmation.cjs.map +1 -1
- package/dist/components/ai/confirmation.js +1 -1
- package/dist/components/ai/confirmation.js.map +1 -1
- package/dist/components/ai/context.cjs +1 -1
- package/dist/components/ai/context.cjs.map +1 -1
- package/dist/components/ai/context.js +36 -35
- package/dist/components/ai/context.js.map +1 -1
- package/dist/components/ai/message.cjs +1 -1
- package/dist/components/ai/message.cjs.map +1 -1
- package/dist/components/ai/message.js +68 -68
- package/dist/components/ai/message.js.map +1 -1
- package/dist/components/ai/prompt-input.cjs +1 -1
- package/dist/components/ai/prompt-input.cjs.map +1 -1
- package/dist/components/ai/prompt-input.js +4 -2
- package/dist/components/ai/prompt-input.js.map +1 -1
- package/dist/components/ai/queue.cjs +1 -1
- package/dist/components/ai/queue.cjs.map +1 -1
- package/dist/components/ai/queue.js +9 -9
- package/dist/components/ai/queue.js.map +1 -1
- package/dist/components/ai/reasoning.cjs +1 -1
- package/dist/components/ai/reasoning.cjs.map +1 -1
- package/dist/components/ai/reasoning.js +67 -67
- package/dist/components/ai/reasoning.js.map +1 -1
- package/dist/components/ai/stream-status.cjs +1 -1
- package/dist/components/ai/stream-status.cjs.map +1 -1
- package/dist/components/ai/stream-status.js +41 -39
- package/dist/components/ai/stream-status.js.map +1 -1
- package/dist/components/ai/streamdown-code-plugin.cjs +2 -0
- package/dist/components/ai/streamdown-code-plugin.cjs.map +1 -0
- package/dist/components/ai/streamdown-code-plugin.js +42 -0
- package/dist/components/ai/streamdown-code-plugin.js.map +1 -0
- package/dist/components/ai/streamdown-plugins.cjs +2 -0
- package/dist/components/ai/streamdown-plugins.cjs.map +1 -0
- package/dist/components/ai/streamdown-plugins.js +14 -0
- package/dist/components/ai/streamdown-plugins.js.map +1 -0
- package/dist/components/ai/task.cjs +1 -1
- package/dist/components/ai/task.cjs.map +1 -1
- package/dist/components/ai/task.js +18 -11
- package/dist/components/ai/task.js.map +1 -1
- package/dist/components/ai/tool.cjs +1 -1
- package/dist/components/ai/tool.cjs.map +1 -1
- package/dist/components/ai/tool.js +51 -55
- package/dist/components/ai/tool.js.map +1 -1
- package/dist/components/ai/use-streamdown-plugins.cjs +2 -0
- package/dist/components/ai/use-streamdown-plugins.cjs.map +1 -0
- package/dist/components/ai/use-streamdown-plugins.js +25 -0
- package/dist/components/ai/use-streamdown-plugins.js.map +1 -0
- package/dist/components/charts/AreaPlot/AreaPlot.cjs +2 -0
- package/dist/components/charts/AreaPlot/AreaPlot.cjs.map +1 -0
- package/dist/components/charts/AreaPlot/AreaPlot.js +270 -0
- package/dist/components/charts/AreaPlot/AreaPlot.js.map +1 -0
- package/dist/components/charts/BarChart/BarChart.cjs +2 -0
- package/dist/components/charts/BarChart/BarChart.cjs.map +1 -0
- package/dist/components/charts/BarChart/BarChart.js +219 -0
- package/dist/components/charts/BarChart/BarChart.js.map +1 -0
- package/dist/components/charts/BoxPlot/BoxPlot.cjs +2 -0
- package/dist/components/charts/BoxPlot/BoxPlot.cjs.map +1 -0
- package/dist/components/charts/{Boxplot/Boxplot.js → BoxPlot/BoxPlot.js} +78 -79
- package/dist/components/charts/BoxPlot/BoxPlot.js.map +1 -0
- package/dist/components/charts/ChartTooltip/ChartTooltip.cjs +1 -1
- package/dist/components/charts/ChartTooltip/ChartTooltip.cjs.map +1 -1
- package/dist/components/charts/ChartTooltip/ChartTooltip.js +22 -22
- package/dist/components/charts/ChartTooltip/ChartTooltip.js.map +1 -1
- package/dist/components/charts/Chromatogram/Chromatogram.cjs +1 -1
- package/dist/components/charts/Chromatogram/Chromatogram.cjs.map +1 -1
- package/dist/components/charts/Chromatogram/Chromatogram.js +232 -170
- package/dist/components/charts/Chromatogram/Chromatogram.js.map +1 -1
- package/dist/components/charts/Chromatogram/annotations.cjs +2 -0
- package/dist/components/charts/Chromatogram/annotations.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/annotations.js +137 -0
- package/dist/components/charts/Chromatogram/annotations.js.map +1 -0
- package/dist/components/charts/Chromatogram/boundaryMarkers.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/boundaryMarkers.js.map +1 -0
- package/dist/components/charts/Chromatogram/constants.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/constants.js.map +1 -0
- package/dist/components/charts/Chromatogram/dataProcessing.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/dataProcessing.js.map +1 -0
- package/dist/components/charts/Chromatogram/peakDetection.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/peakDetection.js.map +1 -0
- package/dist/components/charts/Chromatogram/plotBuilder.cjs +2 -0
- package/dist/components/charts/Chromatogram/plotBuilder.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/plotBuilder.js +216 -0
- package/dist/components/charts/Chromatogram/plotBuilder.js.map +1 -0
- package/dist/components/charts/Chromatogram/regionOverlays.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/regionOverlays.js.map +1 -0
- package/dist/components/charts/Electropherogram/Electropherogram.cjs +2 -0
- package/dist/components/charts/Electropherogram/Electropherogram.cjs.map +1 -0
- package/dist/components/charts/Electropherogram/Electropherogram.js +180 -0
- package/dist/components/charts/Electropherogram/Electropherogram.js.map +1 -0
- package/dist/components/charts/Histogram/Histogram.cjs +1 -1
- package/dist/components/charts/Histogram/Histogram.cjs.map +1 -1
- package/dist/components/charts/Histogram/Histogram.js +107 -108
- package/dist/components/charts/Histogram/Histogram.js.map +1 -1
- package/dist/components/charts/LinePlot/LinePlot.cjs +2 -0
- package/dist/components/charts/LinePlot/LinePlot.cjs.map +1 -0
- package/dist/components/charts/LinePlot/LinePlot.js +224 -0
- package/dist/components/charts/LinePlot/LinePlot.js.map +1 -0
- package/dist/components/charts/PieChart/PieChart.cjs +1 -1
- package/dist/components/charts/PieChart/PieChart.cjs.map +1 -1
- package/dist/components/charts/PieChart/PieChart.js +62 -61
- package/dist/components/charts/PieChart/PieChart.js.map +1 -1
- package/dist/components/charts/PlateMap/PlateMap.cjs +1 -1
- package/dist/components/charts/PlateMap/PlateMap.cjs.map +1 -1
- package/dist/components/charts/PlateMap/PlateMap.js +246 -242
- package/dist/components/charts/PlateMap/PlateMap.js.map +1 -1
- package/dist/components/charts/ScatterPlot/ScatterPlot.cjs +2 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.cjs.map +1 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +252 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.js.map +1 -0
- package/dist/components/charts/ScatterPlotInteractive/ScatterPlotInteractive.cjs +2 -0
- package/dist/components/charts/ScatterPlotInteractive/ScatterPlotInteractive.cjs.map +1 -0
- package/dist/components/charts/ScatterPlotInteractive/ScatterPlotInteractive.js +215 -0
- package/dist/components/charts/ScatterPlotInteractive/ScatterPlotInteractive.js.map +1 -0
- package/dist/components/charts/ScatterPlotInteractive/constants.cjs +2 -0
- package/dist/components/charts/ScatterPlotInteractive/constants.cjs.map +1 -0
- package/dist/components/charts/ScatterPlotInteractive/constants.js +38 -0
- package/dist/components/charts/ScatterPlotInteractive/constants.js.map +1 -0
- package/dist/components/charts/ScatterPlotInteractive/utils.cjs +2 -0
- package/dist/components/charts/ScatterPlotInteractive/utils.cjs.map +1 -0
- package/dist/components/charts/ScatterPlotInteractive/utils.js +261 -0
- package/dist/components/charts/ScatterPlotInteractive/utils.js.map +1 -0
- package/dist/components/charts/StackedChromatogram/StackedChromatogram.cjs +2 -0
- package/dist/components/charts/StackedChromatogram/StackedChromatogram.cjs.map +1 -0
- package/dist/components/charts/StackedChromatogram/StackedChromatogram.js +40 -0
- package/dist/components/charts/StackedChromatogram/StackedChromatogram.js.map +1 -0
- package/dist/components/charts/StackedChromatogram/transforms.cjs.map +1 -0
- package/dist/components/charts/StackedChromatogram/transforms.js.map +1 -0
- package/dist/components/charts/plotly-loader.cjs +2 -0
- package/dist/components/charts/plotly-loader.cjs.map +1 -0
- package/dist/components/charts/plotly-loader.js +22 -0
- package/dist/components/charts/plotly-loader.js.map +1 -0
- package/dist/components/composed/AssistantLayout/AssistantLayout.cjs +2 -0
- package/dist/components/composed/AssistantLayout/AssistantLayout.cjs.map +1 -0
- package/dist/components/composed/AssistantLayout/AssistantLayout.js +142 -0
- package/dist/components/composed/AssistantLayout/AssistantLayout.js.map +1 -0
- package/dist/components/composed/AssistantLayout/dockLayout.cjs +2 -0
- package/dist/components/composed/AssistantLayout/dockLayout.cjs.map +1 -0
- package/dist/components/composed/AssistantLayout/dockLayout.js +10 -0
- package/dist/components/composed/AssistantLayout/dockLayout.js.map +1 -0
- package/dist/components/composed/Chat/Chat.cjs +1 -1
- package/dist/components/composed/Chat/Chat.cjs.map +1 -1
- package/dist/components/composed/Chat/Chat.js +23 -23
- package/dist/components/composed/Chat/Chat.js.map +1 -1
- package/dist/components/composed/ConfirmDialog/ConfirmDialog.cjs +1 -1
- package/dist/components/composed/ConfirmDialog/ConfirmDialog.cjs.map +1 -1
- package/dist/components/composed/ConfirmDialog/ConfirmDialog.js +33 -29
- package/dist/components/composed/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/components/composed/DataAppShell/CollapseButton.cjs +2 -0
- package/dist/components/composed/DataAppShell/CollapseButton.cjs.map +1 -0
- package/dist/components/composed/DataAppShell/CollapseButton.js +42 -0
- package/dist/components/composed/DataAppShell/CollapseButton.js.map +1 -0
- package/dist/components/composed/DataAppShell/DataAppShell.cjs +1 -1
- package/dist/components/composed/DataAppShell/DataAppShell.cjs.map +1 -1
- package/dist/components/composed/DataAppShell/DataAppShell.js +349 -313
- package/dist/components/composed/DataAppShell/DataAppShell.js.map +1 -1
- package/dist/components/composed/DataAppShell/PrimaryNav.cjs +2 -0
- package/dist/components/composed/DataAppShell/PrimaryNav.cjs.map +1 -0
- package/dist/components/composed/DataAppShell/PrimaryNav.js +268 -0
- package/dist/components/composed/DataAppShell/PrimaryNav.js.map +1 -0
- package/dist/components/composed/DataAppShell/RightPanel.cjs +2 -0
- package/dist/components/composed/DataAppShell/RightPanel.cjs.map +1 -0
- package/dist/components/composed/DataAppShell/RightPanel.js +282 -0
- package/dist/components/composed/DataAppShell/RightPanel.js.map +1 -0
- package/dist/components/composed/DataAppShell/SecondaryNav.cjs +2 -0
- package/dist/components/composed/DataAppShell/SecondaryNav.cjs.map +1 -0
- package/dist/components/composed/DataAppShell/SecondaryNav.js +364 -0
- package/dist/components/composed/DataAppShell/SecondaryNav.js.map +1 -0
- package/dist/components/composed/DataAppShell/ShellContext.cjs +2 -0
- package/dist/components/composed/DataAppShell/ShellContext.cjs.map +1 -0
- package/dist/components/composed/DataAppShell/ShellContext.js +23 -0
- package/dist/components/composed/DataAppShell/ShellContext.js.map +1 -0
- package/dist/components/composed/MoleculeStructure/MoleculeStructure.cjs +2 -0
- package/dist/components/composed/MoleculeStructure/MoleculeStructure.cjs.map +1 -0
- package/dist/components/composed/MoleculeStructure/MoleculeStructure.js +87 -0
- package/dist/components/composed/MoleculeStructure/MoleculeStructure.js.map +1 -0
- package/dist/components/composed/MoleculeStructure/rdkit-loader.cjs +2 -0
- package/dist/components/composed/MoleculeStructure/rdkit-loader.cjs.map +1 -0
- package/dist/components/composed/MoleculeStructure/rdkit-loader.js +89 -0
- package/dist/components/composed/MoleculeStructure/rdkit-loader.js.map +1 -0
- package/dist/components/composed/MoleculeStructure/use-rdkit.cjs +2 -0
- package/dist/components/composed/MoleculeStructure/use-rdkit.cjs.map +1 -0
- package/dist/components/composed/MoleculeStructure/use-rdkit.js +19 -0
- package/dist/components/composed/MoleculeStructure/use-rdkit.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.js +17 -17
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.js +33 -33
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.js +7 -7
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.js +1 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellLegend.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/WellLegend.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellLegend.js +24 -12
- package/dist/components/composed/PlateMapEditor/WellLegend.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellManifestTable.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/WellManifestTable.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellManifestTable.js +1 -1
- package/dist/components/composed/PlateMapEditor/WellManifestTable.js.map +1 -1
- package/dist/components/composed/TdpSearch/components/DefaultFilters.cjs +1 -1
- package/dist/components/composed/TdpSearch/components/DefaultFilters.cjs.map +1 -1
- package/dist/components/composed/TdpSearch/components/DefaultFilters.js +3 -3
- package/dist/components/composed/TdpSearch/components/DefaultFilters.js.map +1 -1
- package/dist/components/composed/TopBar/TopBar.cjs +2 -0
- package/dist/components/composed/TopBar/TopBar.cjs.map +1 -0
- package/dist/components/composed/TopBar/TopBar.js +56 -0
- package/dist/components/composed/TopBar/TopBar.js.map +1 -0
- package/dist/components/composed/UserMenu/UserMenu.cjs +2 -0
- package/dist/components/composed/UserMenu/UserMenu.cjs.map +1 -0
- package/dist/components/composed/UserMenu/UserMenu.js +99 -0
- package/dist/components/composed/UserMenu/UserMenu.js.map +1 -0
- package/dist/components/composed/tdp-link.cjs +1 -1
- package/dist/components/composed/tdp-link.cjs.map +1 -1
- package/dist/components/composed/tdp-link.js +5 -5
- package/dist/components/composed/tdp-link.js.map +1 -1
- package/dist/components/ui/alert.cjs +1 -1
- package/dist/components/ui/alert.cjs.map +1 -1
- package/dist/components/ui/alert.js +12 -12
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/badge.cjs +1 -1
- package/dist/components/ui/badge.cjs.map +1 -1
- package/dist/components/ui/badge.js +14 -14
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/banner.cjs +1 -1
- package/dist/components/ui/banner.cjs.map +1 -1
- package/dist/components/ui/banner.js +17 -17
- package/dist/components/ui/banner.js.map +1 -1
- package/dist/components/ui/button.cjs +1 -1
- package/dist/components/ui/button.cjs.map +1 -1
- package/dist/components/ui/button.js +16 -16
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.cjs +1 -1
- package/dist/components/ui/calendar.cjs.map +1 -1
- package/dist/components/ui/calendar.js +3 -3
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/code-block.cjs +3 -3
- package/dist/components/ui/code-block.cjs.map +1 -1
- package/dist/components/ui/code-block.js +136 -118
- package/dist/components/ui/code-block.js.map +1 -1
- package/dist/components/ui/code-editor.cjs +1 -1
- package/dist/components/ui/code-editor.cjs.map +1 -1
- package/dist/components/ui/code-editor.js +14 -12
- package/dist/components/ui/code-editor.js.map +1 -1
- package/dist/components/ui/combobox.cjs +1 -1
- package/dist/components/ui/combobox.cjs.map +1 -1
- package/dist/components/ui/combobox.js +33 -29
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.cjs +1 -1
- package/dist/components/ui/command.cjs.map +1 -1
- package/dist/components/ui/command.js +81 -77
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.cjs +1 -1
- package/dist/components/ui/context-menu.cjs.map +1 -1
- package/dist/components/ui/context-menu.js +13 -13
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/data-table/data-table-column-toggle.cjs +1 -1
- package/dist/components/ui/data-table/data-table-column-toggle.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table-column-toggle.js +70 -62
- package/dist/components/ui/data-table/data-table-column-toggle.js.map +1 -1
- package/dist/components/ui/data-table/data-table-filter.cjs +1 -1
- package/dist/components/ui/data-table/data-table-filter.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table-filter.js +24 -23
- package/dist/components/ui/data-table/data-table-filter.js.map +1 -1
- package/dist/components/ui/data-table/data-table-group.cjs +1 -1
- package/dist/components/ui/data-table/data-table-group.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table-group.js +17 -16
- package/dist/components/ui/data-table/data-table-group.js.map +1 -1
- package/dist/components/ui/data-table/data-table-pagination.cjs +1 -1
- package/dist/components/ui/data-table/data-table-pagination.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table-pagination.js +15 -15
- package/dist/components/ui/data-table/data-table-pagination.js.map +1 -1
- package/dist/components/ui/data-table/data-table.cjs +1 -1
- package/dist/components/ui/data-table/data-table.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table.js +191 -190
- package/dist/components/ui/data-table/data-table.js.map +1 -1
- package/dist/components/ui/dialog.cjs +1 -1
- package/dist/components/ui/dialog.cjs.map +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu.cjs +1 -1
- package/dist/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/components/ui/dropdown-menu.js +12 -4
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/hover-card.cjs +1 -1
- package/dist/components/ui/hover-card.cjs.map +1 -1
- package/dist/components/ui/hover-card.js +3 -3
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/item.cjs +1 -1
- package/dist/components/ui/item.cjs.map +1 -1
- package/dist/components/ui/item.js +44 -36
- package/dist/components/ui/item.js.map +1 -1
- package/dist/components/ui/menubar.cjs +1 -1
- package/dist/components/ui/menubar.cjs.map +1 -1
- package/dist/components/ui/menubar.js +2 -2
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.cjs +1 -1
- package/dist/components/ui/navigation-menu.cjs.map +1 -1
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/popover.cjs +1 -1
- package/dist/components/ui/popover.cjs.map +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/scroll-area.cjs +1 -1
- package/dist/components/ui/scroll-area.cjs.map +1 -1
- package/dist/components/ui/scroll-area.js +1 -0
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.cjs +1 -1
- package/dist/components/ui/select.cjs.map +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/sheet.cjs +1 -1
- package/dist/components/ui/sheet.cjs.map +1 -1
- package/dist/components/ui/sheet.js +5 -5
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.cjs +1 -1
- package/dist/components/ui/sidebar.cjs.map +1 -1
- package/dist/components/ui/sidebar.js +2 -2
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/slider.cjs +1 -1
- package/dist/components/ui/slider.cjs.map +1 -1
- package/dist/components/ui/slider.js +10 -9
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonner.cjs +1 -1
- package/dist/components/ui/sonner.cjs.map +1 -1
- package/dist/components/ui/sonner.js +25 -10
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/ui/table.cjs +1 -1
- package/dist/components/ui/table.cjs.map +1 -1
- package/dist/components/ui/table.js +1 -0
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.cjs +1 -1
- package/dist/components/ui/tabs.cjs.map +1 -1
- package/dist/components/ui/tabs.js +18 -18
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/tetra-molecule-icon.cjs +2 -0
- package/dist/components/ui/tetra-molecule-icon.cjs.map +1 -0
- package/dist/components/ui/tetra-molecule-icon.js +49 -0
- package/dist/components/ui/tetra-molecule-icon.js.map +1 -0
- package/dist/components/ui/toggle-group.cjs +1 -1
- package/dist/components/ui/toggle-group.cjs.map +1 -1
- package/dist/components/ui/toggle-group.js +35 -31
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/hooks/use-plotly-theme.cjs +1 -1
- package/dist/hooks/use-plotly-theme.cjs.map +1 -1
- package/dist/hooks/use-plotly-theme.js +4 -3
- package/dist/hooks/use-plotly-theme.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1073 -136
- package/dist/index.js +698 -647
- package/dist/index.js.map +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/lib/shiki.cjs +2 -0
- package/dist/lib/shiki.cjs.map +1 -0
- package/dist/lib/shiki.js +72 -0
- package/dist/lib/shiki.js.map +1 -0
- package/package.json +23 -12
- package/dist/components/charts/AreaGraph/AreaGraph.cjs +0 -2
- package/dist/components/charts/AreaGraph/AreaGraph.cjs.map +0 -1
- package/dist/components/charts/AreaGraph/AreaGraph.js +0 -271
- package/dist/components/charts/AreaGraph/AreaGraph.js.map +0 -1
- package/dist/components/charts/BarGraph/BarGraph.cjs +0 -2
- package/dist/components/charts/BarGraph/BarGraph.cjs.map +0 -1
- package/dist/components/charts/BarGraph/BarGraph.js +0 -220
- package/dist/components/charts/BarGraph/BarGraph.js.map +0 -1
- package/dist/components/charts/Boxplot/Boxplot.cjs +0 -2
- package/dist/components/charts/Boxplot/Boxplot.cjs.map +0 -1
- package/dist/components/charts/Boxplot/Boxplot.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs +0 -2
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.js +0 -241
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/annotations.cjs +0 -2
- package/dist/components/charts/ChromatogramChart/annotations.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/annotations.js +0 -136
- package/dist/components/charts/ChromatogramChart/annotations.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/constants.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/constants.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/dataProcessing.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/dataProcessing.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/peakDetection.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/peakDetection.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/plotBuilder.cjs +0 -2
- package/dist/components/charts/ChromatogramChart/plotBuilder.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/plotBuilder.js +0 -207
- package/dist/components/charts/ChromatogramChart/plotBuilder.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/regionOverlays.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/regionOverlays.js.map +0 -1
- package/dist/components/charts/DotPlot/DotPlot.cjs +0 -2
- package/dist/components/charts/DotPlot/DotPlot.cjs.map +0 -1
- package/dist/components/charts/DotPlot/DotPlot.js +0 -208
- package/dist/components/charts/DotPlot/DotPlot.js.map +0 -1
- package/dist/components/charts/Heatmap/Heatmap.cjs +0 -2
- package/dist/components/charts/Heatmap/Heatmap.cjs.map +0 -1
- package/dist/components/charts/Heatmap/Heatmap.js +0 -67
- package/dist/components/charts/Heatmap/Heatmap.js.map +0 -1
- package/dist/components/charts/LineGraph/LineGraph.cjs +0 -2
- package/dist/components/charts/LineGraph/LineGraph.cjs.map +0 -1
- package/dist/components/charts/LineGraph/LineGraph.js +0 -225
- package/dist/components/charts/LineGraph/LineGraph.js.map +0 -1
- package/dist/components/charts/ScatterGraph/ScatterGraph.cjs +0 -2
- package/dist/components/charts/ScatterGraph/ScatterGraph.cjs.map +0 -1
- package/dist/components/charts/ScatterGraph/ScatterGraph.js +0 -234
- package/dist/components/charts/ScatterGraph/ScatterGraph.js.map +0 -1
- package/dist/components/charts/StackedChromatogramChart/StackedChromatogramChart.cjs +0 -2
- package/dist/components/charts/StackedChromatogramChart/StackedChromatogramChart.cjs.map +0 -1
- package/dist/components/charts/StackedChromatogramChart/StackedChromatogramChart.js +0 -40
- package/dist/components/charts/StackedChromatogramChart/StackedChromatogramChart.js.map +0 -1
- package/dist/components/charts/StackedChromatogramChart/transforms.cjs.map +0 -1
- package/dist/components/charts/StackedChromatogramChart/transforms.js.map +0 -1
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/boundaryMarkers.cjs +0 -0
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/boundaryMarkers.js +0 -0
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/constants.cjs +0 -0
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/constants.js +0 -0
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/dataProcessing.cjs +0 -0
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/dataProcessing.js +0 -0
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/peakDetection.cjs +0 -0
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/peakDetection.js +0 -0
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/regionOverlays.cjs +0 -0
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/regionOverlays.js +0 -0
- /package/dist/components/charts/{StackedChromatogramChart → StackedChromatogram}/transforms.cjs +0 -0
- /package/dist/components/charts/{StackedChromatogramChart → StackedChromatogram}/transforms.js +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var m=Object.create;var s=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var y=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of d(e))!C.call(t,n)&&n!==o&&s(t,n,{get:()=>e[n],enumerable:!(r=h(e,n))||r.enumerable});return t};var a=(t,e,o)=>(o=t!=null?m(f(t)):{},y(e||!t||!t.__esModule?s(o,"default",{value:t,enumerable:!0}):o,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=new Map([["bash",()=>import("@shikijs/langs/bash")],["javascript",()=>import("@shikijs/langs/javascript")],["json",()=>import("@shikijs/langs/json")],["markdown",()=>import("@shikijs/langs/markdown")],["python",()=>import("@shikijs/langs/python")],["sql",()=>import("@shikijs/langs/sql")],["tsx",()=>import("@shikijs/langs/tsx")],["typescript",()=>import("@shikijs/langs/typescript")],["yaml",()=>import("@shikijs/langs/yaml")]]),c=new Map([["sh","bash"],["shell","bash"],["shellscript","bash"],["zsh","bash"],["js","javascript"],["jsx","tsx"],["md","markdown"],["py","python"],["ts","typescript"],["yml","yaml"]]);function p(t){const e=t.trim().toLowerCase(),o=c.get(e)??e;return i.has(o)?o:null}function L(){return[...i.keys()]}function k(t,e,o=[]){const r=t.trim().toLowerCase();i.set(r,e);for(const n of o)c.set(n.trim().toLowerCase(),r)}let l=null;const g=new Map;function w(){return l??=Promise.all([import("shiki/core"),import("shiki/engine/javascript"),import("@shikijs/themes/github-light"),import("@shikijs/themes/github-dark")]).then(([t,e,o,r])=>t.createHighlighterCore({engine:e.createJavaScriptRegexEngine({forgiving:!0}),langs:[],themes:[o.default,r.default]})),l}async function v(t){const e=p(t),o=await w();if(e){let r=g.get(e);if(!r){const n=i.get(e);r=n?n().then(u=>o.loadLanguage(...u.default)):Promise.resolve(),g.set(e,r)}await r}return{highlighter:o,lang:e??"text"}}exports.getCodeBlockHighlighter=v;exports.getSupportedCodeBlockLanguages=L;exports.registerCodeBlockLanguage=k;exports.resolveCodeBlockLanguage=p;
|
|
2
|
+
//# sourceMappingURL=shiki.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shiki.cjs","sources":["../../src/lib/shiki.ts"],"sourcesContent":["/**\n * Shared slim Shiki setup (SW-2007).\n *\n * Importing `createHighlighter` from \"shiki\" pulls the full bundle — ~200\n * grammars, each its own module — which balloons consumer builds (~9k\n * modules) and can OOM Vite's default heap. This module uses `shiki/core`\n * with an explicit language set instead: the engine, themes, and grammars\n * all arrive through dynamic imports, so they land in lazy chunks and only\n * the languages listed here are ever pulled into a build.\n *\n * Consumers can extend the set at runtime with `registerCodeBlockLanguage`.\n */\nimport type { HighlighterCore, LanguageRegistration } from \"shiki/core\";\n\ntype LanguageLoader = () => Promise<{ default: LanguageRegistration[] }>;\n\n// Default grammars, chosen for scientific data-app content. Keys are the\n// canonical ids requested via `lang`; aliases map onto them below.\nconst languageLoaders = new Map<string, LanguageLoader>([\n [\"bash\", () => import(\"@shikijs/langs/bash\")],\n [\"javascript\", () => import(\"@shikijs/langs/javascript\")],\n [\"json\", () => import(\"@shikijs/langs/json\")],\n [\"markdown\", () => import(\"@shikijs/langs/markdown\")],\n [\"python\", () => import(\"@shikijs/langs/python\")],\n [\"sql\", () => import(\"@shikijs/langs/sql\")],\n [\"tsx\", () => import(\"@shikijs/langs/tsx\")],\n [\"typescript\", () => import(\"@shikijs/langs/typescript\")],\n [\"yaml\", () => import(\"@shikijs/langs/yaml\")],\n]);\n\nconst languageAliases = new Map<string, string>([\n [\"sh\", \"bash\"],\n [\"shell\", \"bash\"],\n [\"shellscript\", \"bash\"],\n [\"zsh\", \"bash\"],\n [\"js\", \"javascript\"],\n [\"jsx\", \"tsx\"],\n [\"md\", \"markdown\"],\n [\"py\", \"python\"],\n [\"ts\", \"typescript\"],\n [\"yml\", \"yaml\"],\n]);\n\n/**\n * Resolve a requested language to a registered canonical id, or null when\n * the language isn't in the set (callers fall back to plaintext).\n */\nexport function resolveCodeBlockLanguage(language: string): string | null {\n const normalized = language.trim().toLowerCase();\n const canonical = languageAliases.get(normalized) ?? normalized;\n return languageLoaders.has(canonical) ? canonical : null;\n}\n\n/** Canonical ids of every language the slim highlighter can load. */\nexport function getSupportedCodeBlockLanguages(): string[] {\n return [...languageLoaders.keys()];\n}\n\n/**\n * Register an additional grammar for `CodeBlock`/`MessageResponse` code\n * highlighting, e.g.:\n *\n * ```ts\n * registerCodeBlockLanguage(\"rust\", () => import(\"@shikijs/langs/rust\"), [\"rs\"]);\n * ```\n *\n * The loader stays a dynamic import, so added grammars are also code-split.\n */\nexport function registerCodeBlockLanguage(\n language: string,\n loader: LanguageLoader,\n aliases: string[] = [],\n): void {\n const canonical = language.trim().toLowerCase();\n languageLoaders.set(canonical, loader);\n for (const alias of aliases) {\n languageAliases.set(alias.trim().toLowerCase(), canonical);\n }\n}\n\n// One shared highlighter core; grammars are loaded into it on demand.\nlet corePromise: Promise<HighlighterCore> | null = null;\nconst loadedLanguages = new Map<string, Promise<void>>();\n\nfunction getHighlighterCore(): Promise<HighlighterCore> {\n corePromise ??= Promise.all([\n import(\"shiki/core\"),\n import(\"shiki/engine/javascript\"),\n import(\"@shikijs/themes/github-light\"),\n import(\"@shikijs/themes/github-dark\"),\n ]).then(([core, engine, githubLight, githubDark]) =>\n core.createHighlighterCore({\n // The JS regex engine avoids shipping the oniguruma WASM asset;\n // `forgiving` skips the few grammar rules it can't translate.\n engine: engine.createJavaScriptRegexEngine({ forgiving: true }),\n langs: [],\n themes: [githubLight.default, githubDark.default],\n }),\n );\n return corePromise;\n}\n\n/**\n * Get the shared highlighter with the requested language loaded. `lang` is\n * the id to pass to `codeToTokens` — the canonical id when supported,\n * otherwise \"text\" (plaintext needs no grammar).\n */\nexport async function getCodeBlockHighlighter(\n language: string,\n): Promise<{ highlighter: HighlighterCore; lang: string }> {\n const canonical = resolveCodeBlockLanguage(language);\n const highlighter = await getHighlighterCore();\n if (canonical) {\n let pending = loadedLanguages.get(canonical);\n if (!pending) {\n const loader = languageLoaders.get(canonical);\n pending = loader\n ? loader().then((grammar) => highlighter.loadLanguage(...grammar.default))\n : Promise.resolve();\n loadedLanguages.set(canonical, pending);\n }\n await pending;\n }\n return { highlighter, lang: canonical ?? \"text\" };\n}\n"],"names":["languageLoaders","languageAliases","resolveCodeBlockLanguage","language","normalized","canonical","getSupportedCodeBlockLanguages","registerCodeBlockLanguage","loader","aliases","alias","corePromise","loadedLanguages","getHighlighterCore","core","engine","githubLight","githubDark","getCodeBlockHighlighter","highlighter","pending","grammar"],"mappings":"2hBAkBA,MAAMA,MAAsB,IAA4B,CACtD,CAAC,OAAQ,IAAM,OAAO,qBAAqB,CAAC,EAC5C,CAAC,aAAc,IAAM,OAAO,2BAA2B,CAAC,EACxD,CAAC,OAAQ,IAAM,OAAO,qBAAqB,CAAC,EAC5C,CAAC,WAAY,IAAM,OAAO,yBAAyB,CAAC,EACpD,CAAC,SAAU,IAAM,OAAO,uBAAuB,CAAC,EAChD,CAAC,MAAO,IAAM,OAAO,oBAAoB,CAAC,EAC1C,CAAC,MAAO,IAAM,OAAO,oBAAoB,CAAC,EAC1C,CAAC,aAAc,IAAM,OAAO,2BAA2B,CAAC,EACxD,CAAC,OAAQ,IAAM,OAAO,qBAAqB,CAAC,CAC9C,CAAC,EAEKC,MAAsB,IAAoB,CAC9C,CAAC,KAAM,MAAM,EACb,CAAC,QAAS,MA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CACZ,MAAMZ,EAASR,EAAgB,IAAIK,CAAS,EAC5Ce,EAAUZ,EACNA,EAAA,EAAS,KAAMa,GAAYF,EAAY,aAAa,GAAGE,EAAQ,OAAO,CAAC,EACvE,QAAQ,QAAA,EACZT,EAAgB,IAAIP,EAAWe,CAAO,CACxC,CACA,MAAMA,CACR,CACA,MAAO,CAAE,YAAAD,EAAa,KAAMd,GAAa,MAAA,CAC3C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const r = /* @__PURE__ */ new Map([
|
|
2
|
+
["bash", () => import("@shikijs/langs/bash")],
|
|
3
|
+
["javascript", () => import("@shikijs/langs/javascript")],
|
|
4
|
+
["json", () => import("@shikijs/langs/json")],
|
|
5
|
+
["markdown", () => import("@shikijs/langs/markdown")],
|
|
6
|
+
["python", () => import("@shikijs/langs/python")],
|
|
7
|
+
["sql", () => import("@shikijs/langs/sql")],
|
|
8
|
+
["tsx", () => import("@shikijs/langs/tsx")],
|
|
9
|
+
["typescript", () => import("@shikijs/langs/typescript")],
|
|
10
|
+
["yaml", () => import("@shikijs/langs/yaml")]
|
|
11
|
+
]), l = /* @__PURE__ */ new Map([
|
|
12
|
+
["sh", "bash"],
|
|
13
|
+
["shell", "bash"],
|
|
14
|
+
["shellscript", "bash"],
|
|
15
|
+
["zsh", "bash"],
|
|
16
|
+
["js", "javascript"],
|
|
17
|
+
["jsx", "tsx"],
|
|
18
|
+
["md", "markdown"],
|
|
19
|
+
["py", "python"],
|
|
20
|
+
["ts", "typescript"],
|
|
21
|
+
["yml", "yaml"]
|
|
22
|
+
]);
|
|
23
|
+
function c(a) {
|
|
24
|
+
const e = a.trim().toLowerCase(), t = l.get(e) ?? e;
|
|
25
|
+
return r.has(t) ? t : null;
|
|
26
|
+
}
|
|
27
|
+
function m() {
|
|
28
|
+
return [...r.keys()];
|
|
29
|
+
}
|
|
30
|
+
function h(a, e, t = []) {
|
|
31
|
+
const o = a.trim().toLowerCase();
|
|
32
|
+
r.set(o, e);
|
|
33
|
+
for (const n of t)
|
|
34
|
+
l.set(n.trim().toLowerCase(), o);
|
|
35
|
+
}
|
|
36
|
+
let i = null;
|
|
37
|
+
const s = /* @__PURE__ */ new Map();
|
|
38
|
+
function p() {
|
|
39
|
+
return i ??= Promise.all([
|
|
40
|
+
import("shiki/core"),
|
|
41
|
+
import("shiki/engine/javascript"),
|
|
42
|
+
import("@shikijs/themes/github-light"),
|
|
43
|
+
import("@shikijs/themes/github-dark")
|
|
44
|
+
]).then(
|
|
45
|
+
([a, e, t, o]) => a.createHighlighterCore({
|
|
46
|
+
// The JS regex engine avoids shipping the oniguruma WASM asset;
|
|
47
|
+
// `forgiving` skips the few grammar rules it can't translate.
|
|
48
|
+
engine: e.createJavaScriptRegexEngine({ forgiving: !0 }),
|
|
49
|
+
langs: [],
|
|
50
|
+
themes: [t.default, o.default]
|
|
51
|
+
})
|
|
52
|
+
), i;
|
|
53
|
+
}
|
|
54
|
+
async function u(a) {
|
|
55
|
+
const e = c(a), t = await p();
|
|
56
|
+
if (e) {
|
|
57
|
+
let o = s.get(e);
|
|
58
|
+
if (!o) {
|
|
59
|
+
const n = r.get(e);
|
|
60
|
+
o = n ? n().then((g) => t.loadLanguage(...g.default)) : Promise.resolve(), s.set(e, o);
|
|
61
|
+
}
|
|
62
|
+
await o;
|
|
63
|
+
}
|
|
64
|
+
return { highlighter: t, lang: e ?? "text" };
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
u as getCodeBlockHighlighter,
|
|
68
|
+
m as getSupportedCodeBlockLanguages,
|
|
69
|
+
h as registerCodeBlockLanguage,
|
|
70
|
+
c as resolveCodeBlockLanguage
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=shiki.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shiki.js","sources":["../../src/lib/shiki.ts"],"sourcesContent":["/**\n * Shared slim Shiki setup (SW-2007).\n *\n * Importing `createHighlighter` from \"shiki\" pulls the full bundle — ~200\n * grammars, each its own module — which balloons consumer builds (~9k\n * modules) and can OOM Vite's default heap. This module uses `shiki/core`\n * with an explicit language set instead: the engine, themes, and grammars\n * all arrive through dynamic imports, so they land in lazy chunks and only\n * the languages listed here are ever pulled into a build.\n *\n * Consumers can extend the set at runtime with `registerCodeBlockLanguage`.\n */\nimport type { HighlighterCore, LanguageRegistration } from \"shiki/core\";\n\ntype LanguageLoader = () => Promise<{ default: LanguageRegistration[] }>;\n\n// Default grammars, chosen for scientific data-app content. Keys are the\n// canonical ids requested via `lang`; aliases map onto them below.\nconst languageLoaders = new Map<string, LanguageLoader>([\n [\"bash\", () => import(\"@shikijs/langs/bash\")],\n [\"javascript\", () => import(\"@shikijs/langs/javascript\")],\n [\"json\", () => import(\"@shikijs/langs/json\")],\n [\"markdown\", () => import(\"@shikijs/langs/markdown\")],\n [\"python\", () => import(\"@shikijs/langs/python\")],\n [\"sql\", () => import(\"@shikijs/langs/sql\")],\n [\"tsx\", () => import(\"@shikijs/langs/tsx\")],\n [\"typescript\", () => import(\"@shikijs/langs/typescript\")],\n [\"yaml\", () => import(\"@shikijs/langs/yaml\")],\n]);\n\nconst languageAliases = new Map<string, string>([\n [\"sh\", \"bash\"],\n [\"shell\", \"bash\"],\n [\"shellscript\", \"bash\"],\n [\"zsh\", \"bash\"],\n [\"js\", \"javascript\"],\n [\"jsx\", \"tsx\"],\n [\"md\", \"markdown\"],\n [\"py\", \"python\"],\n [\"ts\", \"typescript\"],\n [\"yml\", \"yaml\"],\n]);\n\n/**\n * Resolve a requested language to a registered canonical id, or null when\n * the language isn't in the set (callers fall back to plaintext).\n */\nexport function resolveCodeBlockLanguage(language: string): string | null {\n const normalized = language.trim().toLowerCase();\n const canonical = languageAliases.get(normalized) ?? normalized;\n return languageLoaders.has(canonical) ? canonical : null;\n}\n\n/** Canonical ids of every language the slim highlighter can load. */\nexport function getSupportedCodeBlockLanguages(): string[] {\n return [...languageLoaders.keys()];\n}\n\n/**\n * Register an additional grammar for `CodeBlock`/`MessageResponse` code\n * highlighting, e.g.:\n *\n * ```ts\n * registerCodeBlockLanguage(\"rust\", () => import(\"@shikijs/langs/rust\"), [\"rs\"]);\n * ```\n *\n * The loader stays a dynamic import, so added grammars are also code-split.\n */\nexport function registerCodeBlockLanguage(\n language: string,\n loader: LanguageLoader,\n aliases: string[] = [],\n): void {\n const canonical = language.trim().toLowerCase();\n languageLoaders.set(canonical, loader);\n for (const alias of aliases) {\n languageAliases.set(alias.trim().toLowerCase(), canonical);\n }\n}\n\n// One shared highlighter core; grammars are loaded into it on demand.\nlet corePromise: Promise<HighlighterCore> | null = null;\nconst loadedLanguages = new Map<string, Promise<void>>();\n\nfunction getHighlighterCore(): Promise<HighlighterCore> {\n corePromise ??= Promise.all([\n import(\"shiki/core\"),\n import(\"shiki/engine/javascript\"),\n import(\"@shikijs/themes/github-light\"),\n import(\"@shikijs/themes/github-dark\"),\n ]).then(([core, engine, githubLight, githubDark]) =>\n core.createHighlighterCore({\n // The JS regex engine avoids shipping the oniguruma WASM asset;\n // `forgiving` skips the few grammar rules it can't translate.\n engine: engine.createJavaScriptRegexEngine({ forgiving: true }),\n langs: [],\n themes: [githubLight.default, githubDark.default],\n }),\n );\n return corePromise;\n}\n\n/**\n * Get the shared highlighter with the requested language loaded. `lang` is\n * the id to pass to `codeToTokens` — the canonical id when supported,\n * otherwise \"text\" (plaintext needs no grammar).\n */\nexport async function getCodeBlockHighlighter(\n language: string,\n): Promise<{ highlighter: HighlighterCore; lang: string }> {\n const canonical = resolveCodeBlockLanguage(language);\n const highlighter = await getHighlighterCore();\n if (canonical) {\n let pending = loadedLanguages.get(canonical);\n if (!pending) {\n const loader = languageLoaders.get(canonical);\n pending = loader\n ? loader().then((grammar) => highlighter.loadLanguage(...grammar.default))\n : Promise.resolve();\n loadedLanguages.set(canonical, pending);\n }\n await pending;\n }\n return { highlighter, lang: canonical ?? \"text\" };\n}\n"],"names":["languageLoaders","languageAliases","resolveCodeBlockLanguage","language","normalized","canonical","getSupportedCodeBlockLanguages","registerCodeBlockLanguage","loader","aliases","alias","corePromise","loadedLanguages","getHighlighterCore","core","engine","githubLight","githubDark","getCodeBlockHighlighter","highlighter","pending","grammar"],"mappings":"AAkBA,MAAMA,wBAAsB,IAA4B;AAAA,EACtD,CAAC,QAAQ,MAAM,OAAO,qBAAqB,CAAC;AAAA,EAC5C,CAAC,cAAc,MAAM,OAAO,2BAA2B,CAAC;AAAA,EACxD,CAAC,QAAQ,MAAM,OAAO,qBAAqB,CAAC;AAAA,EAC5C,CAAC,YAAY,MAAM,OAAO,yBAAyB,CAAC;AAAA,EACpD,CAAC,UAAU,MAAM,OAAO,uBAAuB,CAAC;AAAA,EAChD,CAAC,OAAO,MAAM,OAAO,oBAAoB,CAAC;AAAA,EAC1C,CAAC,OAAO,MAAM,OAAO,oBAAoB,CAAC;AAAA,EAC1C,CAAC,cAAc,MAAM,OAAO,2BAA2B,CAAC;AAAA,EACxD,CAAC,QAAQ,MAAM,OAAO,qBAAqB,CAAC;AAC9C,CAAC,GAEKC,wBAAsB,IAAoB;AAAA,EAC9C,CAAC,MAAM,MAAM;AAAA,EACb,CAAC,SAAS,MAAM;AAAA,EAChB,CAAC,eAAe,MAAM;AAAA,EACtB,CAAC,OAAO,MAAM;AAAA,EACd,CAAC,MAAM,YAAY;AAAA,EACnB,CAAC,OAAO,KAAK;AAAA,EACb,CAAC,MAAM,UAAU;AAAA,EACjB,CAAC,MAAM,QAAQ;AAAA,EACf,CAAC,MAAM,YAAY;AAAA,EACnB,CAAC,OAAO,MAAM;AAChB,CAAC;AAMM,SAASC,EAAyBC,GAAiC;AACxE,QAAMC,IAAaD,EAAS,KAAA,EAAO,YAAA,GAC7BE,IAAYJ,EAAgB,IAAIG,CAAU,KAAKA;AACrD,SAAOJ,EAAgB,IAAIK,CAAS,IAAIA,IAAY;AACtD;AAGO,SAASC,IAA2C;AACzD,SAAO,CAAC,GAAGN,EAAgB,MAAM;AACnC;AAYO,SAASO,EACdJ,GACAK,GACAC,IAAoB,C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ui",
|
|
3
|
-
"version": "0.7.0-beta.
|
|
3
|
+
"version": "0.7.0-beta.129.1",
|
|
4
4
|
"description": "TetraScience React UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "TetraScience",
|
|
@@ -113,10 +113,9 @@
|
|
|
113
113
|
"@fontsource-variable/inter": "^5.2.8",
|
|
114
114
|
"@monaco-editor/react": "^4.7.0",
|
|
115
115
|
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
|
116
|
+
"@shikijs/langs": "^4.0.2",
|
|
117
|
+
"@shikijs/themes": "^4.0.2",
|
|
116
118
|
"@streamdown/cjk": "^1.0.3",
|
|
117
|
-
"@streamdown/code": "^1.1.1",
|
|
118
|
-
"@streamdown/math": "^1.0.2",
|
|
119
|
-
"@streamdown/mermaid": "^1.0.2",
|
|
120
119
|
"@tanstack/react-table": "^8.21.3",
|
|
121
120
|
"@tetrascience-npm/ts-connectors-sdk": "^3.2.0",
|
|
122
121
|
"@xyflow/react": "^12.6.4",
|
|
@@ -129,14 +128,10 @@
|
|
|
129
128
|
"lucide-react": "^0.577.0",
|
|
130
129
|
"monaco-editor": "^0.52.2",
|
|
131
130
|
"motion": "^12.38.0",
|
|
132
|
-
"plotly.js": "^3.0.1",
|
|
133
|
-
"plotly.js-dist": "^2.35.2",
|
|
134
131
|
"radix-ui": "^1.4.3",
|
|
135
132
|
"react-day-picker": "^9.14.0",
|
|
136
133
|
"react-markdown": "^10.1.0",
|
|
137
|
-
"react-plotly.js": "^2.6.0",
|
|
138
134
|
"react-resizable-panels": "^4.7.1",
|
|
139
|
-
"react-syntax-highlighter": "^15.6.1",
|
|
140
135
|
"rehype-raw": "^7.0.0",
|
|
141
136
|
"remark-gfm": "^4.0.1",
|
|
142
137
|
"shiki": "^4.0.2",
|
|
@@ -149,6 +144,10 @@
|
|
|
149
144
|
"peerDependencies": {
|
|
150
145
|
"@aws-sdk/client-athena": "^3.0.0",
|
|
151
146
|
"@databricks/sql": "^1.0.0",
|
|
147
|
+
"@rdkit/rdkit": "2025.3.4-1.0.0",
|
|
148
|
+
"@streamdown/math": "^1.0.2",
|
|
149
|
+
"@streamdown/mermaid": "^1.0.2",
|
|
150
|
+
"plotly.js-dist": "^2.35.2",
|
|
152
151
|
"react": "^19.0.0",
|
|
153
152
|
"react-dom": "^19.0.0",
|
|
154
153
|
"snowflake-sdk": "^2.0.0"
|
|
@@ -160,19 +159,30 @@
|
|
|
160
159
|
"@databricks/sql": {
|
|
161
160
|
"optional": true
|
|
162
161
|
},
|
|
162
|
+
"@rdkit/rdkit": {
|
|
163
|
+
"optional": true
|
|
164
|
+
},
|
|
165
|
+
"@streamdown/math": {
|
|
166
|
+
"optional": true
|
|
167
|
+
},
|
|
168
|
+
"@streamdown/mermaid": {
|
|
169
|
+
"optional": true
|
|
170
|
+
},
|
|
171
|
+
"plotly.js-dist": {
|
|
172
|
+
"optional": true
|
|
173
|
+
},
|
|
163
174
|
"snowflake-sdk": {
|
|
164
175
|
"optional": true
|
|
165
176
|
}
|
|
166
177
|
},
|
|
167
178
|
"devDependencies": {
|
|
168
179
|
"@aws-sdk/client-athena": "^3.975.0",
|
|
169
|
-
"@aws-sdk/client-s3": "^3.985.0",
|
|
170
|
-
"@aws-sdk/s3-request-presigner": "^3.985.0",
|
|
171
180
|
"@commitlint/cli": "^20.5.0",
|
|
172
181
|
"@commitlint/config-conventional": "^20.5.0",
|
|
173
182
|
"@databricks/sql": "^1.12.0",
|
|
174
183
|
"@eslint/js": "^9.9.0",
|
|
175
184
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
185
|
+
"@rdkit/rdkit": "2025.3.4-1.0.0",
|
|
176
186
|
"@semantic-release/changelog": "^6.0.3",
|
|
177
187
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
178
188
|
"@semantic-release/git": "^10.0.1",
|
|
@@ -187,6 +197,8 @@
|
|
|
187
197
|
"@storybook/addon-vitest": "^10.4.6",
|
|
188
198
|
"@storybook/builder-vite": "^10.4.6",
|
|
189
199
|
"@storybook/react-vite": "^10.4.6",
|
|
200
|
+
"@streamdown/math": "^1.0.2",
|
|
201
|
+
"@streamdown/mermaid": "^1.0.2",
|
|
190
202
|
"@tailwindcss/vite": "^4.2.2",
|
|
191
203
|
"@types/eslint-plugin-jsx-a11y": "^6",
|
|
192
204
|
"@types/jsdom": "^27",
|
|
@@ -194,8 +206,6 @@
|
|
|
194
206
|
"@types/plotly.js": "^3.0.0",
|
|
195
207
|
"@types/react": "^19.0.0",
|
|
196
208
|
"@types/react-dom": "^19.0.0",
|
|
197
|
-
"@types/react-plotly.js": "^2.6.3",
|
|
198
|
-
"@types/react-syntax-highlighter": "^15",
|
|
199
209
|
"@vercel/node": "^5.4.5",
|
|
200
210
|
"@vitejs/plugin-react": "^4.3.1",
|
|
201
211
|
"@vitest/browser": "^3",
|
|
@@ -216,6 +226,7 @@
|
|
|
216
226
|
"jsdom": "^28.1.0",
|
|
217
227
|
"lint-staged": "^15.2.0",
|
|
218
228
|
"playwright": "^1.58.2",
|
|
229
|
+
"plotly.js-dist": "^2.35.2",
|
|
219
230
|
"prettier": "^3.8.1",
|
|
220
231
|
"react": "^19.0.0",
|
|
221
232
|
"react-dom": "^19.0.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),L=require("plotly.js-dist"),n=require("react"),Z=require("../ChartTooltip/ChartTooltip.cjs"),$=require("../../../hooks/use-element-size.cjs"),ee=require("../../../hooks/use-plotly-theme.cjs"),te=require("../../../lib/utils.cjs"),W=require("../../../utils/colors.cjs"),oe=require("../ChartTooltip/lines.cjs"),re=80,ne=40,ie=({dataSeries:s,width:N,height:q,xRange:p,yRange:y,variant:w="normal",xTitle:v,yTitle:b,title:M,xTickText:x})=>{const m=n.useRef(null),r=ee.usePlotlyTheme(),[D,P]=$.useElementSize(),a=N??P.width,u=q??P.height,R=a>0&&u>0,F=N===void 0,J=q===void 0,k=n.useRef({width:a,height:u});k.current={width:a,height:u};const z=n.useRef(!1),E=n.useRef({width:0,height:0}),{bindTooltip:O,tooltipElement:K}=Z.useChartTooltip({getLines:t=>oe.chartTooltipLines(t.map(e=>typeof e.customdata=="number"?{...e,y:e.customdata}:e),{xLabel:v,yLabel:b})}),{xMin:X,xMax:T,yMin:V,yMax:Y}=n.useMemo(()=>{let t=Number.MAX_VALUE,e=Number.MIN_VALUE,i=Number.MAX_VALUE,o=Number.MIN_VALUE;s.forEach(h=>{h.x.forEach(f=>{t=Math.min(t,f),e=Math.max(e,f)}),h.y.forEach(f=>{i=Math.min(i,f),o=Math.max(o,f)})});const l=(e-t)*.1,c=(o-i)*.1;return{xMin:t-l,xMax:e+l,yMin:w==="stacked"?0:i-c,yMax:o+c}},[s,w]),d=n.useMemo(()=>p||[X,T],[p,X,T]),g=n.useMemo(()=>y||[V,Y],[y,V,Y]),j=n.useMemo(()=>{const t=d[1]-d[0];let e=Math.pow(10,Math.floor(Math.log10(t)));t/e>10&&(e=e*2),t/e<4&&(e=e/2);const i=[];let o=Math.ceil(d[0]/e)*e;for(;o<=d[1];)i.push(o),o+=e;return i},[d]),G=n.useMemo(()=>{const t=g[1]-g[0];let e=Math.pow(10,Math.floor(Math.log10(t)));t/e>10&&(e=e*2),t/e<4&&(e=e/2);const i=[];let o=Math.ceil(g[0]/e)*e;for(;o<=g[1];)i.push(o),o+=e;return i},[g]),I=n.useMemo(()=>[...new Set(s.flatMap(t=>t.x))].sort((t,e)=>t-e),[s]),C=!!x&&x.length===I.length,A=n.useMemo(()=>({tickcolor:r.tickColor,ticklen:12,tickwidth:1,ticks:"outside",tickfont:{size:16,color:r.textColor,family:"Inter, sans-serif",weight:400},linecolor:r.lineColor,linewidth:1,position:0,zeroline:!1}),[r]),_=n.useMemo(()=>M?{text:M,x:.5,y:.95,xanchor:"center",yanchor:"top",font:{size:32,weight:600,family:"Inter, sans-serif",color:r.textColor,lineheight:1.2,standoff:30}}:void 0,[M,r]);return n.useEffect(()=>{if(!m.current||!R)return;let t;if(w==="stacked"){const l=new Array(s[0]?.x.length||0).fill(0);t=s.map((c,h)=>{const f=c.y.map((Q,B)=>{const H=l[B]+Q;return l[B]=H,H}),U=W.seriesColor(h,c.color);return{x:c.x,y:f,customdata:c.y,type:"scatter",mode:"lines",name:c.name,hoverinfo:"none",fill:h===0?"tozeroy":"tonexty",fillcolor:U,line:{color:U,width:2}}})}else t=s.map((l,c)=>{const h=W.seriesColor(c,l.color);return{x:l.x,y:l.y,type:"scatter",mode:"lines",name:l.name,hoverinfo:"none",fill:l.fill||"tozeroy",fillcolor:h,line:{color:h,width:2}}});const e={width:k.current.width,height:k.current.height,..._?{title:_}:{},margin:{l:80,r:40,b:96,t:M?re:ne,pad:0},paper_bgcolor:r.paperBg,plot_bgcolor:r.plotBg,font:{family:"Inter, sans-serif"},dragmode:!1,xaxis:{title:{text:v,font:{size:16,color:r.textSecondary,family:"Inter, sans-serif",weight:400},standoff:15},gridcolor:r.gridColor,range:p,autorange:!p,tickmode:"array",tickvals:C?I:j,...C?{ticktext:x}:{},showgrid:!0,automargin:!0,...A},yaxis:{title:{text:b,font:{size:16,color:r.textSecondary,family:"Inter, sans-serif",weight:400},standoff:15},gridcolor:r.gridColor,range:y,autorange:!y,tickmode:"array",tickvals:G,showgrid:!0,automargin:!0,...A},legend:{x:.5,y:0,xanchor:"center",yanchor:"bottom",yref:"container",orientation:"h",font:{size:13,color:r.legendColor,family:"Inter, sans-serif",weight:500,lineheight:18}},showlegend:!0},i={responsive:!1,displayModeBar:!1,displaylogo:!1};L.newPlot(m.current,t,e,i),O(m.current);const o=m.current;return z.current=!0,E.current={...k.current},()=>{o&&(L.purge(o),z.current=!1)}},[s,R,p,y,d,g,w,v,b,M,_,A,j,G,I,C,x,r,O]),n.useEffect(()=>{const t=m.current;!t||!z.current||a<=0||u<=0||E.current.width===a&&E.current.height===u||(E.current={width:a,height:u},L.relayout(t,{width:a,height:u}).catch(()=>{}))},[a,u]),S.jsxs("div",{ref:D,className:te.cn("area-graph-container relative",F&&"w-full",J&&"h-full"),children:[S.jsx("div",{ref:m,style:{width:"100%",height:"100%"}}),K]})};exports.AreaGraph=ie;
|
|
2
|
-
//# sourceMappingURL=AreaGraph.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AreaGraph.cjs","sources":["../../../../src/components/charts/AreaGraph/AreaGraph.tsx"],"sourcesContent":["import Plotly from \"plotly.js-dist\";\nimport React, { useEffect, useRef, useMemo } from \"react\";\n\nimport { chartTooltipLines, useChartTooltip } from \"../ChartTooltip\";\n\nimport { useElementSize } from \"@/hooks/use-element-size\";\nimport { usePlotlyTheme } from \"@/hooks/use-plotly-theme\";\nimport { cn } from \"@/lib/utils\";\nimport { seriesColor } from \"@/utils/colors\";\n\ninterface AreaDataSeries {\n x: number[];\n y: number[];\n name: string;\n /** Optional color override (auto-assigned from CHART_COLORS if not provided) */\n color?: string;\n fill?: \"tozeroy\" | \"tonexty\" | \"toself\";\n}\n\ntype AreaGraphVariant = \"normal\" | \"stacked\";\n\n/** Top margin reserving room for the 32px title; reduced when no title is set */\nconst TITLE_MARGIN_TOP = 80;\nconst NO_TITLE_MARGIN_TOP = 40;\n\ninterface AreaGraphProps {\n dataSeries: AreaDataSeries[];\n /**\n * Fixed width in pixels. When omitted, the chart fills its container and\n * tracks the container's width via a `ResizeObserver`.\n */\n width?: number;\n /**\n * Fixed height in pixels. When omitted, the chart fills its container and\n * tracks the container's height via a `ResizeObserver`.\n */\n height?: number;\n xRange?: [number, number];\n yRange?: [number, number];\n variant?: AreaGraphVariant;\n xTitle?: string;\n yTitle?: string;\n title?: string;\n /**\n * Categorical labels for the x-axis ticks. When provided, the x data values\n * still drive area positioning but the displayed tick labels match these\n * strings in order (e.g. [\"Mon\", \"Tue\", …]). Should align 1:1 with the\n * unique, ordered x values across all series.\n */\n xTickText?: string[];\n}\n\nconst AreaGraph: React.FC<AreaGraphProps> = ({\n dataSeries,\n width,\n height,\n xRange,\n yRange,\n variant = \"normal\",\n xTitle,\n yTitle,\n title,\n xTickText,\n}) => {\n const plotRef = useRef<HTMLDivElement>(null);\n const theme = usePlotlyTheme();\n\n // When width/height are omitted the chart fills its container; otherwise the\n // explicit pixel size wins. The container is measured either way (cheap) but\n // only used as the resolved size for the omitted dimension(s).\n const [containerRef, measured] = useElementSize<HTMLDivElement>();\n const resolvedWidth = width ?? measured.width;\n const resolvedHeight = height ?? measured.height;\n const hasSize = resolvedWidth > 0 && resolvedHeight > 0;\n // Fill is per-dimension: omit width to fill the container width, omit height\n // to fill its height (so e.g. a fixed width with a container-driven height works).\n const fillWidth = width === undefined;\n const fillHeight = height === undefined;\n\n // Hold the latest resolved size in a ref so the newPlot effect can read it\n // without listing it as a dependency — size changes are handled by a\n // separate relayout effect rather than by tearing down and recreating the plot.\n const sizeRef = useRef({ width: resolvedWidth, height: resolvedHeight });\n sizeRef.current = { width: resolvedWidth, height: resolvedHeight };\n const plotInitedRef = useRef(false);\n // Size last applied to the plot, so the resize effect can skip a redundant\n // relayout right after newPlot already drew at that size.\n const appliedSizeRef = useRef({ width: 0, height: 0 });\n const { bindTooltip, tooltipElement } = useChartTooltip({\n // Stacked traces carry the original series values as customdata;\n // display those instead of the cumulative stack heights\n getLines: (points) =>\n chartTooltipLines(\n points.map((point) =>\n typeof point.customdata === \"number\"\n ? { ...point, y: point.customdata }\n : point,\n ),\n { xLabel: xTitle, yLabel: yTitle },\n ),\n });\n\n const { xMin, xMax, yMin, yMax } = useMemo(() => {\n let minX = Number.MAX_VALUE;\n let maxX = Number.MIN_VALUE;\n let minY = Number.MAX_VALUE;\n let maxY = Number.MIN_VALUE;\n\n dataSeries.forEach((series) => {\n series.x.forEach((x) => {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n });\n series.y.forEach((y) => {\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n });\n });\n\n const xPadding = (maxX - minX) * 0.1;\n const yPadding = (maxY - minY) * 0.1;\n\n return {\n xMin: minX - xPadding,\n xMax: maxX + xPadding,\n yMin: variant === \"stacked\" ? 0 : minY - yPadding,\n yMax: maxY + yPadding,\n };\n }, [dataSeries, variant]);\n\n const effectiveXRange = useMemo(\n () => xRange || [xMin, xMax],\n [xRange, xMin, xMax],\n );\n const effectiveYRange = useMemo(\n () => yRange || [yMin, yMax],\n [yRange, yMin, yMax],\n );\n\n const xTicks = useMemo(() => {\n const range = effectiveXRange[1] - effectiveXRange[0];\n let step = Math.pow(10, Math.floor(Math.log10(range)));\n\n if (range / step > 10) step = step * 2;\n if (range / step < 4) step = step / 2;\n\n const ticks = [];\n let current = Math.ceil(effectiveXRange[0] / step) * step;\n while (current <= effectiveXRange[1]) {\n ticks.push(current);\n current += step;\n }\n return ticks;\n }, [effectiveXRange]);\n\n const yTicks = useMemo(() => {\n const range = effectiveYRange[1] - effectiveYRange[0];\n let step = Math.pow(10, Math.floor(Math.log10(range)));\n\n if (range / step > 10) step = step * 2;\n if (range / step < 4) step = step / 2;\n\n const ticks = [];\n let current = Math.ceil(effectiveYRange[0] / step) * step;\n while (current <= effectiveYRange[1]) {\n ticks.push(current);\n current += step;\n }\n return ticks;\n }, [effectiveYRange]);\n\n // When categorical labels are supplied, ticks must sit on the actual data\n // x-positions rather than the computed nice-step values above. Sorted\n // ascending so labels map deterministically to x regardless of series order.\n const xDataValues = useMemo(\n () => [...new Set(dataSeries.flatMap((s) => s.x))].sort((a, b) => a - b),\n [dataSeries],\n );\n\n // Only apply categorical labels when they align 1:1 with the tick positions;\n // a mismatch would silently mis-label ticks, so fall back to numeric ticks.\n const useCategoricalX = !!xTickText && xTickText.length === xDataValues.length;\n\n const tickOptions = useMemo(\n () => ({\n tickcolor: theme.tickColor,\n ticklen: 12,\n tickwidth: 1,\n ticks: \"outside\" as const,\n tickfont: {\n size: 16,\n color: theme.textColor,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n linecolor: theme.lineColor,\n linewidth: 1,\n position: 0,\n zeroline: false,\n }),\n [theme],\n );\n\n const titleOptions = useMemo(\n () =>\n title\n ? {\n text: title,\n x: 0.5,\n y: 0.95,\n xanchor: \"center\" as const,\n yanchor: \"top\" as const,\n font: {\n size: 32,\n weight: 600,\n family: \"Inter, sans-serif\",\n color: theme.textColor,\n lineheight: 1.2,\n standoff: 30,\n },\n }\n : undefined,\n [title, theme],\n );\n\n useEffect(() => {\n if (!plotRef.current || !hasSize) return;\n\n let data;\n\n if (variant === \"stacked\") {\n // For stacked mode, we need to calculate cumulative values\n const cumulativeY = new Array(dataSeries[0]?.x.length || 0).fill(0);\n\n data = dataSeries.map((series, index) => {\n // Calculate cumulative values for this series\n const stackedY = series.y.map((value, i) => {\n const result = cumulativeY[i] + value;\n cumulativeY[i] = result;\n return result;\n });\n\n const color = seriesColor(index, series.color);\n return {\n x: series.x,\n y: stackedY,\n // Tooltips report the series' own values, not the stacked sums\n customdata: series.y,\n type: \"scatter\" as const,\n mode: \"lines\" as const,\n name: series.name,\n hoverinfo: \"none\" as const,\n fill: index === 0 ? (\"tozeroy\" as const) : (\"tonexty\" as const),\n fillcolor: color,\n line: {\n color,\n width: 2,\n },\n };\n });\n } else {\n // Normal mode - each area fills independently from zero\n data = dataSeries.map((series, index) => {\n const color = seriesColor(index, series.color);\n return {\n x: series.x,\n y: series.y,\n type: \"scatter\" as const,\n mode: \"lines\" as const,\n name: series.name,\n hoverinfo: \"none\" as const,\n fill: series.fill || (\"tozeroy\" as const),\n fillcolor: color,\n line: {\n color,\n width: 2,\n },\n };\n });\n }\n\n const layout = {\n width: sizeRef.current.width,\n height: sizeRef.current.height,\n ...(titleOptions ? { title: titleOptions } : {}),\n margin: {\n l: 80,\n r: 40,\n // Reserve room for tick labels, the x-axis title, and the\n // container-anchored bottom legend stacked beneath them.\n b: 96,\n t: title ? TITLE_MARGIN_TOP : NO_TITLE_MARGIN_TOP,\n pad: 0,\n },\n paper_bgcolor: theme.paperBg,\n plot_bgcolor: theme.plotBg,\n font: {\n family: \"Inter, sans-serif\",\n },\n dragmode: false as const,\n xaxis: {\n title: {\n text: xTitle,\n font: {\n size: 16,\n color: theme.textSecondary,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n standoff: 15,\n },\n gridcolor: theme.gridColor,\n range: xRange,\n autorange: !xRange,\n tickmode: \"array\" as const,\n tickvals: useCategoricalX ? xDataValues : xTicks,\n ...(useCategoricalX ? { ticktext: xTickText } : {}),\n showgrid: true,\n // Reserve space for tick labels + the axis title so the bottom legend\n // can't overlap them at small sizes (SW-2157).\n automargin: true,\n ...tickOptions,\n },\n yaxis: {\n title: {\n text: yTitle,\n font: {\n size: 16,\n color: theme.textSecondary,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n standoff: 15,\n },\n gridcolor: theme.gridColor,\n range: yRange,\n autorange: !yRange,\n tickmode: \"array\" as const,\n tickvals: yTicks,\n showgrid: true,\n automargin: true,\n ...tickOptions,\n },\n legend: {\n // Anchor to the bottom of the container (not the plot area) so the\n // legend always clears the x-axis tick labels + title — a paper-relative\n // fractional offset collapses into the ticks at small heights (SW-2157).\n x: 0.5,\n y: 0,\n xanchor: \"center\" as const,\n yanchor: \"bottom\" as const,\n yref: \"container\" as const,\n orientation: \"h\" as const,\n font: {\n size: 13,\n color: theme.legendColor,\n family: \"Inter, sans-serif\",\n weight: 500,\n lineheight: 18,\n },\n },\n showlegend: true,\n };\n\n const config = {\n // We drive sizing explicitly from the measured container, so Plotly's own\n // window-resize responsiveness is disabled (it can't see container resizes).\n responsive: false,\n displayModeBar: false,\n displaylogo: false,\n };\n\n Plotly.newPlot(plotRef.current, data, layout, config);\n bindTooltip(plotRef.current);\n\n // Capture ref value for cleanup\n const plotElement = plotRef.current;\n plotInitedRef.current = true;\n appliedSizeRef.current = { ...sizeRef.current };\n\n // Cleanup function\n return () => {\n if (plotElement) {\n Plotly.purge(plotElement);\n plotInitedRef.current = false;\n }\n };\n }, [dataSeries, hasSize, xRange, yRange, effectiveXRange, effectiveYRange, variant, xTitle, yTitle, title, titleOptions, tickOptions, xTicks, yTicks, xDataValues, useCategoricalX, xTickText, theme, bindTooltip]);\n\n // Resize in place when the measured/overridden size changes — far cheaper\n // than recreating the plot (and it preserves tooltip/event bindings).\n useEffect(() => {\n const plotElement = plotRef.current;\n if (!plotElement || !plotInitedRef.current || resolvedWidth <= 0 || resolvedHeight <= 0) {\n return;\n }\n // newPlot already drew at the current size; skip the redundant relayout\n // (it would queue an automargin redraw that can reject if we unmount first).\n if (\n appliedSizeRef.current.width === resolvedWidth &&\n appliedSizeRef.current.height === resolvedHeight\n ) {\n return;\n }\n appliedSizeRef.current = { width: resolvedWidth, height: resolvedHeight };\n // Swallow rejections from a relayout that races an unmount/purge.\n void Plotly.relayout(plotElement, { width: resolvedWidth, height: resolvedHeight }).catch(\n () => {},\n );\n }, [resolvedWidth, resolvedHeight]);\n\n return (\n <div\n ref={containerRef}\n className={cn(\"area-graph-container relative\", fillWidth && \"w-full\", fillHeight && \"h-full\")}\n >\n <div ref={plotRef} style={{ width: \"100%\", height: \"100%\" }} />\n {tooltipElement}\n </div>\n );\n};\n\nexport { AreaGraph };\nexport type { AreaDataSeries, AreaGraphVariant, AreaGraphProps };\n"],"names":["TITLE_MARGIN_TOP","NO_TITLE_MARGIN_TOP","AreaGraph","dataSeries","width","height","xRange","yRange","variant","xTitle","yTitle","title","xTickText","plotRef","useRef","theme","usePlotlyTheme","containerRef","measured","useElementSize","resolvedWidth","resolvedHeight","hasSize","fillWidth","fillHeight","sizeRef","plotInitedRef","appliedSizeRef","bindTooltip","tooltipElement","useChartTooltip","points","chartTooltipLines","point","xMin","xMax","yMin","yMax","useMemo","minX","maxX","minY","maxY","series","x","y","xPadding","yPadding","effectiveXRange","effectiveYRange","xTicks","range","step","ticks","current","yTicks","xDataValues","s","a","b","useCategoricalX","tickOptions","titleOptions","useEffect","data","cumulativeY","index","stackedY","value","i","result","color","seriesColor","layout","config","Plotly","plotElement","jsxs","cn","jsx"],"mappings":"yaAsBMA,GAAmB,GACnBC,GAAsB,GA6BtBC,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EpDsD,EAAO,SAASC,EAAa,CAAE,MAAOxD,EAAe,OAAQC,CAAA,CAAgB,EAAE,MAClF,IAAM,CAAC,CAAA,EAEX,EAAG,CAACD,EAAeC,CAAc,CAAC,EAGhCwD,EAAAA,KAAC,MAAA,CACC,IAAK5D,EACL,UAAW6D,GAAAA,GAAG,gCAAiCvD,GAAa,SAAUC,GAAc,QAAQ,EAE5F,SAAA,CAAAuD,EAAAA,IAAC,MAAA,CAAI,IAAKlE,EAAS,MAAO,CAAE,MAAO,OAAQ,OAAQ,MAAA,CAAO,CAAG,EAC5DgB,CAAA,CAAA,CAAA,CAGP"}
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import { jsxs as S, jsx as tt } from "react/jsx-runtime";
|
|
2
|
-
import N from "plotly.js-dist";
|
|
3
|
-
import { useRef as E, useMemo as f, useEffect as q } from "react";
|
|
4
|
-
import { useChartTooltip as ot } from "../ChartTooltip/ChartTooltip.js";
|
|
5
|
-
import { useElementSize as et } from "../../../hooks/use-element-size.js";
|
|
6
|
-
import { usePlotlyTheme as rt } from "../../../hooks/use-plotly-theme.js";
|
|
7
|
-
import { cn as nt } from "../../../lib/utils.js";
|
|
8
|
-
import { seriesColor as F } from "../../../utils/colors.js";
|
|
9
|
-
import { chartTooltipLines as it } from "../ChartTooltip/lines.js";
|
|
10
|
-
const lt = 80, ct = 40, yt = ({
|
|
11
|
-
dataSeries: c,
|
|
12
|
-
width: P,
|
|
13
|
-
height: X,
|
|
14
|
-
xRange: p,
|
|
15
|
-
yRange: y,
|
|
16
|
-
variant: M = "normal",
|
|
17
|
-
xTitle: I,
|
|
18
|
-
yTitle: b,
|
|
19
|
-
title: w,
|
|
20
|
-
xTickText: x
|
|
21
|
-
}) => {
|
|
22
|
-
const u = E(null), r = rt(), [J, O] = et(), a = P ?? O.width, s = X ?? O.height, V = a > 0 && s > 0, K = P === void 0, Q = X === void 0, k = E({ width: a, height: s });
|
|
23
|
-
k.current = { width: a, height: s };
|
|
24
|
-
const z = E(!1), v = E({ width: 0, height: 0 }), { bindTooltip: Y, tooltipElement: Z } = ot({
|
|
25
|
-
// Stacked traces carry the original series values as customdata;
|
|
26
|
-
// display those instead of the cumulative stack heights
|
|
27
|
-
getLines: (o) => it(
|
|
28
|
-
o.map(
|
|
29
|
-
(t) => typeof t.customdata == "number" ? { ...t, y: t.customdata } : t
|
|
30
|
-
),
|
|
31
|
-
{ xLabel: I, yLabel: b }
|
|
32
|
-
)
|
|
33
|
-
}), { xMin: U, xMax: B, yMin: G, yMax: j } = f(() => {
|
|
34
|
-
let o = Number.MAX_VALUE, t = Number.MIN_VALUE, n = Number.MAX_VALUE, e = Number.MIN_VALUE;
|
|
35
|
-
c.forEach((h) => {
|
|
36
|
-
h.x.forEach((m) => {
|
|
37
|
-
o = Math.min(o, m), t = Math.max(t, m);
|
|
38
|
-
}), h.y.forEach((m) => {
|
|
39
|
-
n = Math.min(n, m), e = Math.max(e, m);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
const i = (t - o) * 0.1, l = (e - n) * 0.1;
|
|
43
|
-
return {
|
|
44
|
-
xMin: o - i,
|
|
45
|
-
xMax: t + i,
|
|
46
|
-
yMin: M === "stacked" ? 0 : n - l,
|
|
47
|
-
yMax: e + l
|
|
48
|
-
};
|
|
49
|
-
}, [c, M]), d = f(
|
|
50
|
-
() => p || [U, B],
|
|
51
|
-
[p, U, B]
|
|
52
|
-
), g = f(
|
|
53
|
-
() => y || [G, j],
|
|
54
|
-
[y, G, j]
|
|
55
|
-
), H = f(() => {
|
|
56
|
-
const o = d[1] - d[0];
|
|
57
|
-
let t = Math.pow(10, Math.floor(Math.log10(o)));
|
|
58
|
-
o / t > 10 && (t = t * 2), o / t < 4 && (t = t / 2);
|
|
59
|
-
const n = [];
|
|
60
|
-
let e = Math.ceil(d[0] / t) * t;
|
|
61
|
-
for (; e <= d[1]; )
|
|
62
|
-
n.push(e), e += t;
|
|
63
|
-
return n;
|
|
64
|
-
}, [d]), R = f(() => {
|
|
65
|
-
const o = g[1] - g[0];
|
|
66
|
-
let t = Math.pow(10, Math.floor(Math.log10(o)));
|
|
67
|
-
o / t > 10 && (t = t * 2), o / t < 4 && (t = t / 2);
|
|
68
|
-
const n = [];
|
|
69
|
-
let e = Math.ceil(g[0] / t) * t;
|
|
70
|
-
for (; e <= g[1]; )
|
|
71
|
-
n.push(e), e += t;
|
|
72
|
-
return n;
|
|
73
|
-
}, [g]), _ = f(
|
|
74
|
-
() => [...new Set(c.flatMap((o) => o.x))].sort((o, t) => o - t),
|
|
75
|
-
[c]
|
|
76
|
-
), A = !!x && x.length === _.length, C = f(
|
|
77
|
-
() => ({
|
|
78
|
-
tickcolor: r.tickColor,
|
|
79
|
-
ticklen: 12,
|
|
80
|
-
tickwidth: 1,
|
|
81
|
-
ticks: "outside",
|
|
82
|
-
tickfont: {
|
|
83
|
-
size: 16,
|
|
84
|
-
color: r.textColor,
|
|
85
|
-
family: "Inter, sans-serif",
|
|
86
|
-
weight: 400
|
|
87
|
-
},
|
|
88
|
-
linecolor: r.lineColor,
|
|
89
|
-
linewidth: 1,
|
|
90
|
-
position: 0,
|
|
91
|
-
zeroline: !1
|
|
92
|
-
}),
|
|
93
|
-
[r]
|
|
94
|
-
), L = f(
|
|
95
|
-
() => w ? {
|
|
96
|
-
text: w,
|
|
97
|
-
x: 0.5,
|
|
98
|
-
y: 0.95,
|
|
99
|
-
xanchor: "center",
|
|
100
|
-
yanchor: "top",
|
|
101
|
-
font: {
|
|
102
|
-
size: 32,
|
|
103
|
-
weight: 600,
|
|
104
|
-
family: "Inter, sans-serif",
|
|
105
|
-
color: r.textColor,
|
|
106
|
-
lineheight: 1.2,
|
|
107
|
-
standoff: 30
|
|
108
|
-
}
|
|
109
|
-
} : void 0,
|
|
110
|
-
[w, r]
|
|
111
|
-
);
|
|
112
|
-
return q(() => {
|
|
113
|
-
if (!u.current || !V) return;
|
|
114
|
-
let o;
|
|
115
|
-
if (M === "stacked") {
|
|
116
|
-
const i = new Array(c[0]?.x.length || 0).fill(0);
|
|
117
|
-
o = c.map((l, h) => {
|
|
118
|
-
const m = l.y.map(($, W) => {
|
|
119
|
-
const D = i[W] + $;
|
|
120
|
-
return i[W] = D, D;
|
|
121
|
-
}), T = F(h, l.color);
|
|
122
|
-
return {
|
|
123
|
-
x: l.x,
|
|
124
|
-
y: m,
|
|
125
|
-
// Tooltips report the series' own values, not the stacked sums
|
|
126
|
-
customdata: l.y,
|
|
127
|
-
type: "scatter",
|
|
128
|
-
mode: "lines",
|
|
129
|
-
name: l.name,
|
|
130
|
-
hoverinfo: "none",
|
|
131
|
-
fill: h === 0 ? "tozeroy" : "tonexty",
|
|
132
|
-
fillcolor: T,
|
|
133
|
-
line: {
|
|
134
|
-
color: T,
|
|
135
|
-
width: 2
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
});
|
|
139
|
-
} else
|
|
140
|
-
o = c.map((i, l) => {
|
|
141
|
-
const h = F(l, i.color);
|
|
142
|
-
return {
|
|
143
|
-
x: i.x,
|
|
144
|
-
y: i.y,
|
|
145
|
-
type: "scatter",
|
|
146
|
-
mode: "lines",
|
|
147
|
-
name: i.name,
|
|
148
|
-
hoverinfo: "none",
|
|
149
|
-
fill: i.fill || "tozeroy",
|
|
150
|
-
fillcolor: h,
|
|
151
|
-
line: {
|
|
152
|
-
color: h,
|
|
153
|
-
width: 2
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
});
|
|
157
|
-
const t = {
|
|
158
|
-
width: k.current.width,
|
|
159
|
-
height: k.current.height,
|
|
160
|
-
...L ? { title: L } : {},
|
|
161
|
-
margin: {
|
|
162
|
-
l: 80,
|
|
163
|
-
r: 40,
|
|
164
|
-
// Reserve room for tick labels, the x-axis title, and the
|
|
165
|
-
// container-anchored bottom legend stacked beneath them.
|
|
166
|
-
b: 96,
|
|
167
|
-
t: w ? lt : ct,
|
|
168
|
-
pad: 0
|
|
169
|
-
},
|
|
170
|
-
paper_bgcolor: r.paperBg,
|
|
171
|
-
plot_bgcolor: r.plotBg,
|
|
172
|
-
font: {
|
|
173
|
-
family: "Inter, sans-serif"
|
|
174
|
-
},
|
|
175
|
-
dragmode: !1,
|
|
176
|
-
xaxis: {
|
|
177
|
-
title: {
|
|
178
|
-
text: I,
|
|
179
|
-
font: {
|
|
180
|
-
size: 16,
|
|
181
|
-
color: r.textSecondary,
|
|
182
|
-
family: "Inter, sans-serif",
|
|
183
|
-
weight: 400
|
|
184
|
-
},
|
|
185
|
-
standoff: 15
|
|
186
|
-
},
|
|
187
|
-
gridcolor: r.gridColor,
|
|
188
|
-
range: p,
|
|
189
|
-
autorange: !p,
|
|
190
|
-
tickmode: "array",
|
|
191
|
-
tickvals: A ? _ : H,
|
|
192
|
-
...A ? { ticktext: x } : {},
|
|
193
|
-
showgrid: !0,
|
|
194
|
-
// Reserve space for tick labels + the axis title so the bottom legend
|
|
195
|
-
// can't overlap them at small sizes (SW-2157).
|
|
196
|
-
automargin: !0,
|
|
197
|
-
...C
|
|
198
|
-
},
|
|
199
|
-
yaxis: {
|
|
200
|
-
title: {
|
|
201
|
-
text: b,
|
|
202
|
-
font: {
|
|
203
|
-
size: 16,
|
|
204
|
-
color: r.textSecondary,
|
|
205
|
-
family: "Inter, sans-serif",
|
|
206
|
-
weight: 400
|
|
207
|
-
},
|
|
208
|
-
standoff: 15
|
|
209
|
-
},
|
|
210
|
-
gridcolor: r.gridColor,
|
|
211
|
-
range: y,
|
|
212
|
-
autorange: !y,
|
|
213
|
-
tickmode: "array",
|
|
214
|
-
tickvals: R,
|
|
215
|
-
showgrid: !0,
|
|
216
|
-
automargin: !0,
|
|
217
|
-
...C
|
|
218
|
-
},
|
|
219
|
-
legend: {
|
|
220
|
-
// Anchor to the bottom of the container (not the plot area) so the
|
|
221
|
-
// legend always clears the x-axis tick labels + title — a paper-relative
|
|
222
|
-
// fractional offset collapses into the ticks at small heights (SW-2157).
|
|
223
|
-
x: 0.5,
|
|
224
|
-
y: 0,
|
|
225
|
-
xanchor: "center",
|
|
226
|
-
yanchor: "bottom",
|
|
227
|
-
yref: "container",
|
|
228
|
-
orientation: "h",
|
|
229
|
-
font: {
|
|
230
|
-
size: 13,
|
|
231
|
-
color: r.legendColor,
|
|
232
|
-
family: "Inter, sans-serif",
|
|
233
|
-
weight: 500,
|
|
234
|
-
lineheight: 18
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
showlegend: !0
|
|
238
|
-
}, n = {
|
|
239
|
-
// We drive sizing explicitly from the measured container, so Plotly's own
|
|
240
|
-
// window-resize responsiveness is disabled (it can't see container resizes).
|
|
241
|
-
responsive: !1,
|
|
242
|
-
displayModeBar: !1,
|
|
243
|
-
displaylogo: !1
|
|
244
|
-
};
|
|
245
|
-
N.newPlot(u.current, o, t, n), Y(u.current);
|
|
246
|
-
const e = u.current;
|
|
247
|
-
return z.current = !0, v.current = { ...k.current }, () => {
|
|
248
|
-
e && (N.purge(e), z.current = !1);
|
|
249
|
-
};
|
|
250
|
-
}, [c, V, p, y, d, g, M, I, b, w, L, C, H, R, _, A, x, r, Y]), q(() => {
|
|
251
|
-
const o = u.current;
|
|
252
|
-
!o || !z.current || a <= 0 || s <= 0 || v.current.width === a && v.current.height === s || (v.current = { width: a, height: s }, N.relayout(o, { width: a, height: s }).catch(
|
|
253
|
-
() => {
|
|
254
|
-
}
|
|
255
|
-
));
|
|
256
|
-
}, [a, s]), /* @__PURE__ */ S(
|
|
257
|
-
"div",
|
|
258
|
-
{
|
|
259
|
-
ref: J,
|
|
260
|
-
className: nt("area-graph-container relative", K && "w-full", Q && "h-full"),
|
|
261
|
-
children: [
|
|
262
|
-
/* @__PURE__ */ tt("div", { ref: u, style: { width: "100%", height: "100%" } }),
|
|
263
|
-
Z
|
|
264
|
-
]
|
|
265
|
-
}
|
|
266
|
-
);
|
|
267
|
-
};
|
|
268
|
-
export {
|
|
269
|
-
yt as AreaGraph
|
|
270
|
-
};
|
|
271
|
-
//# sourceMappingURL=AreaGraph.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AreaGraph.js","sources":["../../../../src/components/charts/AreaGraph/AreaGraph.tsx"],"sourcesContent":["import Plotly from \"plotly.js-dist\";\nimport React, { useEffect, useRef, useMemo } from \"react\";\n\nimport { chartTooltipLines, useChartTooltip } from \"../ChartTooltip\";\n\nimport { useElementSize } from \"@/hooks/use-element-size\";\nimport { usePlotlyTheme } from \"@/hooks/use-plotly-theme\";\nimport { cn } from \"@/lib/utils\";\nimport { seriesColor } from \"@/utils/colors\";\n\ninterface AreaDataSeries {\n x: number[];\n y: number[];\n name: string;\n /** Optional color override (auto-assigned from CHART_COLORS if not provided) */\n color?: string;\n fill?: \"tozeroy\" | \"tonexty\" | \"toself\";\n}\n\ntype AreaGraphVariant = \"normal\" | \"stacked\";\n\n/** Top margin reserving room for the 32px title; reduced when no title is set */\nconst TITLE_MARGIN_TOP = 80;\nconst NO_TITLE_MARGIN_TOP = 40;\n\ninterface AreaGraphProps {\n dataSeries: AreaDataSeries[];\n /**\n * Fixed width in pixels. When omitted, the chart fills its container and\n * tracks the container's width via a `ResizeObserver`.\n */\n width?: number;\n /**\n * Fixed height in pixels. When omitted, the chart fills its container and\n * tracks the container's height via a `ResizeObserver`.\n */\n height?: number;\n xRange?: [number, number];\n yRange?: [number, number];\n variant?: AreaGraphVariant;\n xTitle?: string;\n yTitle?: string;\n title?: string;\n /**\n * Categorical labels for the x-axis ticks. When provided, the x data values\n * still drive area positioning but the displayed tick labels match these\n * strings in order (e.g. [\"Mon\", \"Tue\", …]). Should align 1:1 with the\n * unique, ordered x values across all series.\n */\n xTickText?: string[];\n}\n\nconst AreaGraph: React.FC<AreaGraphProps> = ({\n dataSeries,\n width,\n height,\n xRange,\n yRange,\n variant = \"normal\",\n xTitle,\n yTitle,\n title,\n xTickText,\n}) => {\n const plotRef = useRef<HTMLDivElement>(null);\n const theme = usePlotlyTheme();\n\n // When width/height are omitted the chart fills its container; otherwise the\n // explicit pixel size wins. The container is measured either way (cheap) but\n // only used as the resolved size for the omitted dimension(s).\n const [containerRef, measured] = useElementSize<HTMLDivElement>();\n const resolvedWidth = width ?? measured.width;\n const resolvedHeight = height ?? measured.height;\n const hasSize = resolvedWidth > 0 && resolvedHeight > 0;\n // Fill is per-dimension: omit width to fill the container width, omit height\n // to fill its height (so e.g. a fixed width with a container-driven height works).\n const fillWidth = width === undefined;\n const fillHeight = height === undefined;\n\n // Hold the latest resolved size in a ref so the newPlot effect can read it\n // without listing it as a dependency — size changes are handled by a\n // separate relayout effect rather than by tearing down and recreating the plot.\n const sizeRef = useRef({ width: resolvedWidth, height: resolvedHeight });\n sizeRef.current = { width: resolvedWidth, height: resolvedHeight };\n const plotInitedRef = useRef(false);\n // Size last applied to the plot, so the resize effect can skip a redundant\n // relayout right after newPlot already drew at that size.\n const appliedSizeRef = useRef({ width: 0, height: 0 });\n const { bindTooltip, tooltipElement } = useChartTooltip({\n // Stacked traces carry the original series values as customdata;\n // display those instead of the cumulative stack heights\n getLines: (points) =>\n chartTooltipLines(\n points.map((point) =>\n typeof point.customdata === \"number\"\n ? { ...point, y: point.customdata }\n : point,\n ),\n { xLabel: xTitle, yLabel: yTitle },\n ),\n });\n\n const { xMin, xMax, yMin, yMax } = useMemo(() => {\n let minX = Number.MAX_VALUE;\n let maxX = Number.MIN_VALUE;\n let minY = Number.MAX_VALUE;\n let maxY = Number.MIN_VALUE;\n\n dataSeries.forEach((series) => {\n series.x.forEach((x) => {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n });\n series.y.forEach((y) => {\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n });\n });\n\n const xPadding = (maxX - minX) * 0.1;\n const yPadding = (maxY - minY) * 0.1;\n\n return {\n xMin: minX - xPadding,\n xMax: maxX + xPadding,\n yMin: variant === \"stacked\" ? 0 : minY - yPadding,\n yMax: maxY + yPadding,\n };\n }, [dataSeries, variant]);\n\n const effectiveXRange = useMemo(\n () => xRange || [xMin, xMax],\n [xRange, xMin, xMax],\n );\n const effectiveYRange = useMemo(\n () => yRange || [yMin, yMax],\n [yRange, yMin, yMax],\n );\n\n const xTicks = useMemo(() => {\n const range = effectiveXRange[1] - effectiveXRange[0];\n let step = Math.pow(10, Math.floor(Math.log10(range)));\n\n if (range / step > 10) step = step * 2;\n if (range / step < 4) step = step / 2;\n\n const ticks = [];\n let current = Math.ceil(effectiveXRange[0] / step) * step;\n while (current <= effectiveXRange[1]) {\n ticks.push(current);\n current += step;\n }\n return ticks;\n }, [effectiveXRange]);\n\n const yTicks = useMemo(() => {\n const range = effectiveYRange[1] - effectiveYRange[0];\n let step = Math.pow(10, Math.floor(Math.log10(range)));\n\n if (range / step > 10) step = step * 2;\n if (range / step < 4) step = step / 2;\n\n const ticks = [];\n let current = Math.ceil(effectiveYRange[0] / step) * step;\n while (current <= effectiveYRange[1]) {\n ticks.push(current);\n current += step;\n }\n return ticks;\n }, [effectiveYRange]);\n\n // When categorical labels are supplied, ticks must sit on the actual data\n // x-positions rather than the computed nice-step values above. Sorted\n // ascending so labels map deterministically to x regardless of series order.\n const xDataValues = useMemo(\n () => [...new Set(dataSeries.flatMap((s) => s.x))].sort((a, b) => a - b),\n [dataSeries],\n );\n\n // Only apply categorical labels when they align 1:1 with the tick positions;\n // a mismatch would silently mis-label ticks, so fall back to numeric ticks.\n const useCategoricalX = !!xTickText && xTickText.length === xDataValues.length;\n\n const tickOptions = useMemo(\n () => ({\n tickcolor: theme.tickColor,\n ticklen: 12,\n tickwidth: 1,\n ticks: \"outside\" as const,\n tickfont: {\n size: 16,\n color: theme.textColor,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n linecolor: theme.lineColor,\n linewidth: 1,\n position: 0,\n zeroline: false,\n }),\n [theme],\n );\n\n const titleOptions = useMemo(\n () =>\n title\n ? {\n text: title,\n x: 0.5,\n y: 0.95,\n xanchor: \"center\" as const,\n yanchor: \"top\" as const,\n font: {\n size: 32,\n weight: 600,\n family: \"Inter, sans-serif\",\n color: theme.textColor,\n lineheight: 1.2,\n standoff: 30,\n },\n }\n : undefined,\n [title, theme],\n );\n\n useEffect(() => {\n if (!plotRef.current || !hasSize) return;\n\n let data;\n\n if (variant === \"stacked\") {\n // For stacked mode, we need to calculate cumulative values\n const cumulativeY = new Array(dataSeries[0]?.x.length || 0).fill(0);\n\n data = dataSeries.map((series, index) => {\n // Calculate cumulative values for this series\n const stackedY = series.y.map((value, i) => {\n const result = cumulativeY[i] + value;\n cumulativeY[i] = result;\n return result;\n });\n\n const color = seriesColor(index, series.color);\n return {\n x: series.x,\n y: stackedY,\n // Tooltips report the series' own values, not the stacked sums\n customdata: series.y,\n type: \"scatter\" as const,\n mode: \"lines\" as const,\n name: series.name,\n hoverinfo: \"none\" as const,\n fill: index === 0 ? (\"tozeroy\" as const) : (\"tonexty\" as const),\n fillcolor: color,\n line: {\n color,\n width: 2,\n },\n };\n });\n } else {\n // Normal mode - each area fills independently from zero\n data = dataSeries.map((series, index) => {\n const color = seriesColor(index, series.color);\n return {\n x: series.x,\n y: series.y,\n type: \"scatter\" as const,\n mode: \"lines\" as const,\n name: series.name,\n hoverinfo: \"none\" as const,\n fill: series.fill || (\"tozeroy\" as const),\n fillcolor: color,\n line: {\n color,\n width: 2,\n },\n };\n });\n }\n\n const layout = {\n width: sizeRef.current.width,\n height: sizeRef.current.height,\n ...(titleOptions ? { title: titleOptions } : {}),\n margin: {\n l: 80,\n r: 40,\n // Reserve room for tick labels, the x-axis title, and the\n // container-anchored bottom legend stacked beneath them.\n b: 96,\n t: title ? TITLE_MARGIN_TOP : NO_TITLE_MARGIN_TOP,\n pad: 0,\n },\n paper_bgcolor: theme.paperBg,\n plot_bgcolor: theme.plotBg,\n font: {\n family: \"Inter, sans-serif\",\n },\n dragmode: false as const,\n xaxis: {\n title: {\n text: xTitle,\n font: {\n size: 16,\n color: theme.textSecondary,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n standoff: 15,\n },\n gridcolor: theme.gridColor,\n range: xRange,\n autorange: !xRange,\n tickmode: \"array\" as const,\n tickvals: useCategoricalX ? xDataValues : xTicks,\n ...(useCategoricalX ? { ticktext: xTickText } : {}),\n showgrid: true,\n // Reserve space for tick labels + the axis title so the bottom legend\n // can't overlap them at small sizes (SW-2157).\n automargin: true,\n ...tickOptions,\n },\n yaxis: {\n title: {\n text: yTitle,\n font: {\n size: 16,\n color: theme.textSecondary,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n standoff: 15,\n },\n gridcolor: theme.gridColor,\n range: yRange,\n autorange: !yRange,\n tickmode: \"array\" as const,\n tickvals: yTicks,\n showgrid: true,\n automargin: true,\n ...tickOptions,\n },\n legend: {\n // Anchor to the bottom of the container (not the plot area) so the\n // legend always clears the x-axis tick labels + title — a paper-relative\n // fractional offset collapses into the ticks at small heights (SW-2157).\n x: 0.5,\n y: 0,\n xanchor: \"center\" as const,\n yanchor: \"bottom\" as const,\n yref: \"container\" as const,\n orientation: \"h\" as const,\n font: {\n size: 13,\n color: theme.legendColor,\n family: \"Inter, sans-serif\",\n weight: 500,\n lineheight: 18,\n },\n },\n showlegend: true,\n };\n\n const config = {\n // We drive sizing explicitly from the measured container, so Plotly's own\n // window-resize responsiveness is disabled (it can't see container resizes).\n responsive: false,\n displayModeBar: false,\n displaylogo: false,\n };\n\n Plotly.newPlot(plotRef.current, data, layout, config);\n bindTooltip(plotRef.current);\n\n // Capture ref value for cleanup\n const plotElement = plotRef.current;\n plotInitedRef.current = true;\n appliedSizeRef.current = { ...sizeRef.current };\n\n // Cleanup function\n return () => {\n if (plotElement) {\n Plotly.purge(plotElement);\n plotInitedRef.current = false;\n }\n };\n }, [dataSeries, hasSize, xRange, yRange, effectiveXRange, effectiveYRange, variant, xTitle, yTitle, title, titleOptions, tickOptions, xTicks, yTicks, xDataValues, useCategoricalX, xTickText, theme, bindTooltip]);\n\n // Resize in place when the measured/overridden size changes — far cheaper\n // than recreating the plot (and it preserves tooltip/event bindings).\n useEffect(() => {\n const plotElement = plotRef.current;\n if (!plotElement || !plotInitedRef.current || resolvedWidth <= 0 || resolvedHeight <= 0) {\n return;\n }\n // newPlot already drew at the current size; skip the redundant relayout\n // (it would queue an automargin redraw that can reject if we unmount first).\n if (\n appliedSizeRef.current.width === resolvedWidth &&\n appliedSizeRef.current.height === resolvedHeight\n ) {\n return;\n }\n appliedSizeRef.current = { width: resolvedWidth, height: resolvedHeight };\n // Swallow rejections from a relayout that races an unmount/purge.\n void Plotly.relayout(plotElement, { width: resolvedWidth, height: resolvedHeight }).catch(\n () => {},\n );\n }, [resolvedWidth, resolvedHeight]);\n\n return (\n <div\n ref={containerRef}\n className={cn(\"area-graph-container relative\", fillWidth && \"w-full\", fillHeight && \"h-full\")}\n >\n <div ref={plotRef} style={{ width: \"100%\", height: \"100%\" }} />\n {tooltipElement}\n </div>\n );\n};\n\nexport { AreaGraph };\nexport type { AreaDataSeries, AreaGraphVariant, AreaGraphProps };\n"],"names":["TITLE_MARGIN_TOP","NO_TITLE_MARGIN_TOP","AreaGraph","dataSeries","width","height","xRange","yRange","variant","xTitle","yTitle","title","xTickText","plotRef","useRef","theme","usePlotlyTheme","containerRef","measured","useElementSize","resolvedWidth","resolvedHeight","hasSize","fillWidth","fillHeight","sizeRef","plotInitedRef","appliedSizeRef","bindTooltip","tooltipElement","useChartTooltip","points","chartTooltipLines","point","xMin","xMax","yMin","yMax","useMemo","minX","maxX","minY","maxY","series","x","y","xPadding","yPadding","effectiveXRange","effectiveYRange","xTicks","range","step","ticks","current","yTicks","xDataValues","s","a","b","useCategoricalX","tickOptions","titleOptions","useEffect","data","cumulativeY","index","stackedY","value","i","result","color","seriesColor","layout","config","Plotly","plotElement","jsxs","cn","jsx"],"mappings":";;;;;;;;;AAsBA,MAAMA,KAAmB,IACnBC,KAAsB,IA6BtBC,KAAsC,CAAC;AAAA,EAC3C,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,QAAAC;AAAA,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AAW6D,GAAG,iCAAiCvD,KAAa,UAAUC,KAAc,QAAQ;AAAA,MAE5F,UAAA;AAAA,QAAA,gBAAAuD,GAAC,OAAA,EAAI,KAAKlE,GAAS,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAA,EAAO,CAAG;AAAA,QAC5DgB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react/jsx-runtime"),_=require("plotly.js-dist"),o=require("react"),Y=require("../ChartTooltip/ChartTooltip.cjs"),H=require("../../../hooks/use-element-size.cjs"),W=require("../../../hooks/use-plotly-theme.cjs"),D=require("../../../lib/utils.cjs"),F=require("../../../utils/colors.cjs"),J=60,K=30,Q=({dataSeries:a,width:z,height:C,xRange:x,yRange:h,variant:g="group",xTitle:b,yTitle:k,title:m,barWidth:N=24,xTickText:p})=>{const u=o.useRef(null),r=W.usePlotlyTheme(),{bindTooltip:P,tooltipElement:T}=Y.useChartTooltip({xLabel:b,yLabel:k}),[U,q]=H.useElementSize(),s=z??q.width,c=C??q.height,A=s>0&&c>0,V=z===void 0,S=C===void 0,y=o.useRef({width:s,height:c});y.current={width:s,height:c};const E=o.useRef(!1),M=o.useRef({width:0,height:0}),{yMin:L,yMax:R}=o.useMemo(()=>{let t=Number.MAX_VALUE,e=Number.MIN_VALUE,i=Number.MAX_VALUE,n=Number.MIN_VALUE;a.forEach(j=>{j.x.forEach(d=>{t=Math.min(t,d),e=Math.max(e,d)}),j.y.forEach(d=>{i=Math.min(i,d),n=Math.max(n,d)})});const l=(e-t)*.1,w=(n-i)*.1;return{xMin:t-l,xMax:e+l,yMin:g==="stack"?0:i-w,yMax:n+w}},[a,g]),f=o.useMemo(()=>h||[L,R],[h,L,R]),v=o.useMemo(()=>[...new Set(a.flatMap(t=>t.x))].sort((t,e)=>t-e),[a]),B=!!p&&p.length===v.length,O=o.useMemo(()=>{const t=f[1]-f[0];let e=Math.pow(10,Math.floor(Math.log10(t)));t/e>10&&(e=e*2),t/e<4&&(e=e/2);const i=[];let n=Math.ceil(f[0]/e)*e;for(;n<=f[1];)i.push(n),n+=e;return i},[f]),X=o.useMemo(()=>{switch(g){case"stack":return"stack";case"overlay":return"overlay";default:return"group"}},[g]),I=o.useMemo(()=>({tickcolor:r.tickColor,ticklen:12,tickwidth:1,ticks:"outside",tickfont:{size:16,color:r.textColor,family:"Inter, sans-serif",weight:400},linecolor:r.lineColor,linewidth:1,position:0,zeroline:!1}),[r]);return o.useEffect(()=>{if(!u.current||!A)return;const t=a.map((l,w)=>({x:l.x,y:l.y,type:"bar",name:l.name,hoverinfo:"none",marker:{color:F.seriesColor(w,l.color)},width:N,error_y:l.error_y})),e={...m?{title:{text:m,font:{size:32,family:"Inter, sans-serif",color:r.textColor}}}:{},width:y.current.width,height:y.current.height,margin:{l:80,r:30,b:96,t:m?J:K,pad:0},paper_bgcolor:r.paperBg,plot_bgcolor:r.plotBg,font:{family:"Inter, sans-serif"},barmode:X,bargap:.15,dragmode:!1,xaxis:{title:{text:b,font:{size:16,color:r.textSecondary,family:"Inter, sans-serif",weight:400},standoff:32},gridcolor:r.gridColor,range:x,autorange:!x,tickmode:"array",tickvals:v,...B?{ticktext:p}:{},showgrid:!0,automargin:!0,...I},yaxis:{title:{text:k,font:{size:16,color:r.textSecondary,family:"Inter, sans-serif",weight:400},standoff:30},gridcolor:r.gridColor,range:h,autorange:!h,tickmode:"array",tickvals:O,showgrid:!0,automargin:!0,...I},legend:{x:.5,y:0,xanchor:"center",yanchor:"bottom",yref:"container",orientation:"h",font:{size:16,color:r.legendColor,family:"Inter, sans-serif",weight:500}},showlegend:a.length>1},i={responsive:!1,displayModeBar:!1,displaylogo:!1};_.newPlot(u.current,t,e,i),P(u.current);const n=u.current;return E.current=!0,M.current={...y.current},()=>{n&&(_.purge(n),E.current=!1)}},[a,A,x,h,b,k,m,N,X,I,v,O,B,p,r,P]),o.useEffect(()=>{const t=u.current;!t||!E.current||s<=0||c<=0||M.current.width===s&&M.current.height===c||(M.current={width:s,height:c},_.relayout(t,{width:s,height:c}).catch(()=>{}))},[s,c]),G.jsxs("div",{ref:U,className:D.cn("bar-graph-container relative",V&&"w-full",S&&"h-full"),children:[G.jsx("div",{ref:u,style:{width:"100%",height:"100%"}}),T]})};exports.BarGraph=Q;
|
|
2
|
-
//# sourceMappingURL=BarGraph.cjs.map
|