@tetrascience-npm/tetrascience-react-ui 0.7.0-beta.107.1 → 0.7.0-beta.128.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 +2 -2
- 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 +2 -0
- package/dist/components/charts/Chromatogram/boundaryMarkers.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/boundaryMarkers.js +34 -0
- package/dist/components/charts/Chromatogram/boundaryMarkers.js.map +1 -0
- package/dist/components/charts/{ChromatogramChart → Chromatogram}/constants.cjs +1 -1
- package/dist/components/charts/Chromatogram/constants.cjs.map +1 -0
- package/dist/components/charts/{ChromatogramChart → Chromatogram}/constants.js +11 -5
- package/dist/components/charts/Chromatogram/constants.js.map +1 -0
- package/dist/components/charts/Chromatogram/dataProcessing.cjs +2 -0
- package/dist/components/charts/Chromatogram/dataProcessing.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/dataProcessing.js +90 -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 +2 -0
- package/dist/components/charts/Chromatogram/regionOverlays.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/regionOverlays.js +26 -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 +2 -0
- package/dist/components/charts/StackedChromatogram/transforms.cjs.map +1 -0
- package/dist/components/charts/StackedChromatogram/transforms.js +31 -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 +1210 -132
- package/dist/index.js +694 -639
- 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 -227
- 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 -73
- package/dist/components/charts/ChromatogramChart/annotations.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.cjs +0 -2
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.js +0 -34
- 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 +0 -2
- package/dist/components/charts/ChromatogramChart/dataProcessing.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/dataProcessing.js +0 -79
- 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/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/{ChromatogramChart → Chromatogram}/peakDetection.cjs +0 -0
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/peakDetection.js +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),x=require("plotly.js-dist"),o=require("react"),D=require("../ChartTooltip/ChartTooltip.cjs"),H=require("../../../hooks/use-element-size.cjs"),L=require("../../../hooks/use-plotly-theme.cjs"),T=require("../../../lib/utils.cjs"),W=require("../../../utils/colors.cjs"),_=({dataSeries:i,width:s,height:b,title:z="Dot Plot",xTitle:h,yTitle:d,variant:C="default",markerSize:g=8})=>{const l=o.useRef(null),t=L.usePlotlyTheme(),{bindTooltip:R,tooltipElement:S}=D.useChartTooltip({xLabel:h,yLabel:d}),[j,v]=H.useElementSize(),r=s??v.width,n=b??v.height,q=r>0&&n>0,A=s===void 0,B=b===void 0,c=o.useRef({width:r,height:n});c.current={width:r,height:n};const m=o.useRef(!1),u=o.useRef({width:0,height:0}),M=o.useMemo(()=>Array.isArray(i)?i:[i],[i]),a=W.CHART_COLORS,y=o.useMemo(()=>["circle","square","diamond","triangle-up","triangle-down","star"],[]),P=o.useMemo(()=>M.map((e,f)=>C==="default"?{...e,color:e.color||a[0],symbol:"circle",size:e.size||g}:{...e,color:e.color||a[f%a.length],symbol:e.symbol||y[f%y.length],size:e.size||g}),[M,C,g,a,y]),p=t.gridColor,k=o.useMemo(()=>P.map(e=>({type:"scatter",x:e.x,y:e.y,mode:"markers",name:e.name,marker:{color:e.color,size:e.size,symbol:e.symbol,line:{color:t.paperBg,width:1}},hoverinfo:"none"})),[P,t]),w=o.useMemo(()=>({tickcolor:t.tickColor,ticklen:12,tickwidth:1,ticks:"outside",tickfont:{size:16,color:t.textColor,family:"Inter, sans-serif",weight:400},linecolor:t.lineColor,linewidth:1,position:0,zeroline:!1}),[t]),E=o.useMemo(()=>({text:z,x:.5,y:.95,xanchor:"center",yanchor:"top",font:{size:32,weight:600,family:"Inter, sans-serif",color:t.textColor,lineheight:1.2,standoff:30}}),[z,t]);return o.useEffect(()=>{if(!l.current||!q)return;const e={width:c.current.width,height:c.current.height,font:{family:"Inter, sans-serif"},title:E,margin:{l:80,r:40,b:96,t:80,pad:0},showlegend:!0,legend:{x:.5,y:0,xanchor:"center",yanchor:"bottom",yref:"container",orientation:"h",font:{size:13,color:t.legendColor,family:"Inter, sans-serif",weight:500,lineheight:18}},xaxis:{title:{text:h,font:{size:16,color:t.textSecondary,family:"Inter, sans-serif",weight:400},standoff:15},gridcolor:p,automargin:!0,...w},yaxis:{title:{text:d,font:{size:16,color:t.textSecondary,family:"Inter, sans-serif",weight:400},standoff:15},gridcolor:p,automargin:!0,...w},paper_bgcolor:t.paperBg,plot_bgcolor:t.plotBg},f={responsive:!1,displayModeBar:!1,displaylogo:!1};x.newPlot(l.current,k,e,f),R(l.current);const I=l.current;return m.current=!0,u.current={...c.current},()=>{I&&(x.purge(I),m.current=!1)}},[q,h,d,k,E,w,p,t,R]),o.useEffect(()=>{const e=l.current;!e||!m.current||r<=0||n<=0||u.current.width===r&&u.current.height===n||(u.current={width:r,height:n},x.relayout(e,{width:r,height:n}).catch(()=>{}))},[r,n]),O.jsxs("div",{ref:j,className:T.cn("dotplot-container relative",A&&"w-full",B&&"h-full"),style:s===void 0?void 0:{width:s},children:[O.jsx("div",{ref:l,style:{width:"100%",height:"100%",margin:"0"}}),S]})};exports.DotPlot=_;
|
|
2
|
-
//# sourceMappingURL=DotPlot.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotPlot.cjs","sources":["../../../../src/components/charts/DotPlot/DotPlot.tsx"],"sourcesContent":["import Plotly from \"plotly.js-dist\";\nimport React, { useEffect, useRef, useMemo } from \"react\";\n\nimport { useChartTooltip } from \"../ChartTooltip\";\n\nimport { useElementSize } from \"@/hooks/use-element-size\";\nimport { usePlotlyTheme } from \"@/hooks/use-plotly-theme\";\nimport { cn } from \"@/lib/utils\";\nimport { CHART_COLORS } from \"@/utils/colors\";\n\ntype MarkerSymbol =\n | \"circle\"\n | \"square\"\n | \"diamond\"\n | \"triangle-up\"\n | \"triangle-down\"\n | \"star\";\n\ninterface DotPlotDataSeries {\n x: number[];\n y: number[];\n name: string;\n color?: string;\n symbol?: MarkerSymbol;\n size?: number;\n}\n\ntype DotPlotVariant = \"default\" | \"stacked\";\n\ntype DotPlotProps = {\n dataSeries: DotPlotDataSeries | DotPlotDataSeries[];\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 title?: string;\n xTitle?: string;\n yTitle?: string;\n variant?: DotPlotVariant;\n markerSize?: number;\n};\n\nconst DotPlot: React.FC<DotPlotProps> = ({\n dataSeries,\n width,\n height,\n title = \"Dot Plot\",\n xTitle,\n yTitle,\n variant = \"default\",\n markerSize = 8,\n}) => {\n const plotRef = useRef<HTMLDivElement>(null);\n const theme = usePlotlyTheme();\n const { bindTooltip, tooltipElement } = useChartTooltip({ xLabel: xTitle, yLabel: yTitle });\n\n // Omitted width/height → fill the container and track its measured size;\n // explicit pixel values override. See AreaGraph for the reference pattern.\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 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 seriesArray = useMemo(\n () => (Array.isArray(dataSeries) ? dataSeries : [dataSeries]),\n [dataSeries],\n );\n\n const defaultColors = CHART_COLORS;\n\n const defaultSymbols: MarkerSymbol[] = useMemo(\n () => [\n \"circle\",\n \"square\",\n \"diamond\",\n \"triangle-up\",\n \"triangle-down\",\n \"star\",\n ],\n [],\n );\n\n const seriesWithColors = useMemo(() => {\n return seriesArray.map((series, index) => {\n if (variant === \"default\") {\n // Default variant: all circles, use first color or series color\n return {\n ...series,\n color: series.color || defaultColors[0],\n symbol: \"circle\" as MarkerSymbol,\n size: series.size || markerSize,\n };\n } else {\n // Stacked variant: different symbols and colors for each series\n return {\n ...series,\n color: series.color || defaultColors[index % defaultColors.length],\n symbol:\n series.symbol || defaultSymbols[index % defaultSymbols.length],\n size: series.size || markerSize,\n };\n }\n });\n }, [seriesArray, variant, markerSize, defaultColors, defaultSymbols]);\n\n const gridColor = theme.gridColor;\n\n const plotData = useMemo(\n () =>\n seriesWithColors.map((series) => ({\n type: \"scatter\" as const,\n x: series.x,\n y: series.y,\n mode: \"markers\" as const,\n name: series.name,\n marker: {\n color: series.color,\n size: series.size,\n symbol: series.symbol,\n line: {\n color: theme.paperBg,\n width: 1,\n },\n },\n hoverinfo: \"none\" as const,\n })),\n [seriesWithColors, theme],\n );\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 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 [title, theme],\n );\n\n useEffect(() => {\n if (!plotRef.current || !hasSize) return;\n\n const layout = {\n width: sizeRef.current.width,\n height: sizeRef.current.height,\n font: {\n family: \"Inter, sans-serif\",\n },\n title: titleOptions,\n // Bottom margin reserves room for tick labels, the x-axis title, and the\n // container-anchored bottom legend stacked beneath them.\n margin: { l: 80, r: 40, b: 96, t: 80, pad: 0 },\n showlegend: true,\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 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: gridColor,\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: gridColor,\n automargin: true,\n ...tickOptions,\n },\n paper_bgcolor: theme.paperBg,\n plot_bgcolor: theme.plotBg,\n };\n\n const config = {\n // Sizing is driven from the measured container; disable Plotly's own\n // window-resize responsiveness (it can't see container resizes).\n responsive: false,\n displayModeBar: false,\n displaylogo: false,\n };\n\n Plotly.newPlot(plotRef.current, plotData, 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 return () => {\n if (plotElement) {\n Plotly.purge(plotElement);\n plotInitedRef.current = false;\n }\n };\n }, [hasSize, xTitle, yTitle, plotData, titleOptions, tickOptions, gridColor, theme, bindTooltip]);\n\n // Resize in place when the measured/overridden size changes — cheaper than\n // 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(\"dotplot-container relative\", fillWidth && \"w-full\", fillHeight && \"h-full\")}\n style={width === undefined ? undefined : { width }}\n >\n <div\n ref={plotRef}\n style={{\n width: \"100%\",\n height: \"100%\",\n margin: \"0\",\n }}\n />\n {tooltipElement}\n </div>\n );\n};\n\nexport { DotPlot };\nexport type { DotPlotDataSeries, DotPlotProps, DotPlotVariant, MarkerSymbol };\n"],"names":["DotPlot","dataSeries","width","height","title","xTitle","yTitle","variant","markerSize","plotRef","useRef","theme","usePlotlyTheme","bindTooltip","tooltipElement","useChartTooltip","containerRef","measured","useElementSize","resolvedWidth","resolvedHeight","hasSize","fillWidth","fillHeight","sizeRef","plotInitedRef","appliedSizeRef","seriesArray","useMemo","defaultColors","CHART_COLORS","defaultSymbols","seriesWithColors","series","index","gridColor","plotData","tickOptions","titleOptions","useEffect","layout","config","Plotly","plotElement","jsxs","cn","jsx"],"mappings":"+XAgDMA,EAAkC,CAAC,CACvC,WAAAC,EACA,MAAAC,EACA,OAAAC,EACA,MAAAC,EAAQ,WACR,OAAAC,EACA,OAAAC,EACA,QAAAC,EAAU,UACV,WAAAC,EAAa,CACf,IAAM,CACJ,MAAMC,EAAUC,EAAAA,OAAuB,IAAI,EACrCC,EAAQC,EAAAA,eAAA,EACR,CAAE,YAAAC,EAAa,eAAAC,CAAA,EAAmBC,EAAAA,gBAAgB,CAAE,OAAQV,EAAQ,OAAQC,EAAQ,EAIpF,CAACU,EAAcC,CAAQ,EAAIC,iBAAA,EAC3BC,EAAgBjB,GAASe,EAAS,MAClCG,EAAiBjB,GAAUc,EAAS,OACpCI,EAAUF,EAAgB,GAAKC,EAAiB,EAGhDE,EAAYpB,IAAU,OACtBqB,E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3
|
-
import { useRef as u, useMemo as i, useEffect as D } from "react";
|
|
4
|
-
import { useChartTooltip as S } from "../ChartTooltip/ChartTooltip.js";
|
|
5
|
-
import { useElementSize as q } from "../../../hooks/use-element-size.js";
|
|
6
|
-
import { usePlotlyTheme as N } from "../../../hooks/use-plotly-theme.js";
|
|
7
|
-
import { cn as F } from "../../../lib/utils.js";
|
|
8
|
-
import { CHART_COLORS as G } from "../../../utils/colors.js";
|
|
9
|
-
const Z = ({
|
|
10
|
-
dataSeries: l,
|
|
11
|
-
width: c,
|
|
12
|
-
height: b,
|
|
13
|
-
title: C = "Dot Plot",
|
|
14
|
-
xTitle: d,
|
|
15
|
-
yTitle: m,
|
|
16
|
-
variant: v = "default",
|
|
17
|
-
markerSize: g = 8
|
|
18
|
-
}) => {
|
|
19
|
-
const n = u(null), o = N(), { bindTooltip: R, tooltipElement: H } = S({ xLabel: d, yLabel: m }), [L, k] = q(), e = c ?? k.width, r = b ?? k.height, I = e > 0 && r > 0, W = c === void 0, _ = b === void 0, s = u({ width: e, height: r });
|
|
20
|
-
s.current = { width: e, height: r };
|
|
21
|
-
const p = u(!1), a = u({ width: 0, height: 0 }), E = i(
|
|
22
|
-
() => Array.isArray(l) ? l : [l],
|
|
23
|
-
[l]
|
|
24
|
-
), f = G, y = i(
|
|
25
|
-
() => [
|
|
26
|
-
"circle",
|
|
27
|
-
"square",
|
|
28
|
-
"diamond",
|
|
29
|
-
"triangle-up",
|
|
30
|
-
"triangle-down",
|
|
31
|
-
"star"
|
|
32
|
-
],
|
|
33
|
-
[]
|
|
34
|
-
), P = i(() => E.map((t, h) => v === "default" ? {
|
|
35
|
-
...t,
|
|
36
|
-
color: t.color || f[0],
|
|
37
|
-
symbol: "circle",
|
|
38
|
-
size: t.size || g
|
|
39
|
-
} : {
|
|
40
|
-
...t,
|
|
41
|
-
color: t.color || f[h % f.length],
|
|
42
|
-
symbol: t.symbol || y[h % y.length],
|
|
43
|
-
size: t.size || g
|
|
44
|
-
}), [E, v, g, f, y]), w = o.gridColor, A = i(
|
|
45
|
-
() => P.map((t) => ({
|
|
46
|
-
type: "scatter",
|
|
47
|
-
x: t.x,
|
|
48
|
-
y: t.y,
|
|
49
|
-
mode: "markers",
|
|
50
|
-
name: t.name,
|
|
51
|
-
marker: {
|
|
52
|
-
color: t.color,
|
|
53
|
-
size: t.size,
|
|
54
|
-
symbol: t.symbol,
|
|
55
|
-
line: {
|
|
56
|
-
color: o.paperBg,
|
|
57
|
-
width: 1
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
hoverinfo: "none"
|
|
61
|
-
})),
|
|
62
|
-
[P, o]
|
|
63
|
-
), x = i(
|
|
64
|
-
() => ({
|
|
65
|
-
tickcolor: o.tickColor,
|
|
66
|
-
ticklen: 12,
|
|
67
|
-
tickwidth: 1,
|
|
68
|
-
ticks: "outside",
|
|
69
|
-
tickfont: {
|
|
70
|
-
size: 16,
|
|
71
|
-
color: o.textColor,
|
|
72
|
-
family: "Inter, sans-serif",
|
|
73
|
-
weight: 400
|
|
74
|
-
},
|
|
75
|
-
linecolor: o.lineColor,
|
|
76
|
-
linewidth: 1,
|
|
77
|
-
position: 0,
|
|
78
|
-
zeroline: !1
|
|
79
|
-
}),
|
|
80
|
-
[o]
|
|
81
|
-
), B = i(
|
|
82
|
-
() => ({
|
|
83
|
-
text: C,
|
|
84
|
-
x: 0.5,
|
|
85
|
-
y: 0.95,
|
|
86
|
-
xanchor: "center",
|
|
87
|
-
yanchor: "top",
|
|
88
|
-
font: {
|
|
89
|
-
size: 32,
|
|
90
|
-
weight: 600,
|
|
91
|
-
family: "Inter, sans-serif",
|
|
92
|
-
color: o.textColor,
|
|
93
|
-
lineheight: 1.2,
|
|
94
|
-
standoff: 30
|
|
95
|
-
}
|
|
96
|
-
}),
|
|
97
|
-
[C, o]
|
|
98
|
-
);
|
|
99
|
-
return D(() => {
|
|
100
|
-
if (!n.current || !I) return;
|
|
101
|
-
const t = {
|
|
102
|
-
width: s.current.width,
|
|
103
|
-
height: s.current.height,
|
|
104
|
-
font: {
|
|
105
|
-
family: "Inter, sans-serif"
|
|
106
|
-
},
|
|
107
|
-
title: B,
|
|
108
|
-
// Bottom margin reserves room for tick labels, the x-axis title, and the
|
|
109
|
-
// container-anchored bottom legend stacked beneath them.
|
|
110
|
-
margin: { l: 80, r: 40, b: 96, t: 80, pad: 0 },
|
|
111
|
-
showlegend: !0,
|
|
112
|
-
legend: {
|
|
113
|
-
// Anchor to the bottom of the container (not the plot area) so the
|
|
114
|
-
// legend always clears the x-axis tick labels + title — a paper-relative
|
|
115
|
-
// fractional offset collapses into the ticks at small heights (SW-2157).
|
|
116
|
-
x: 0.5,
|
|
117
|
-
y: 0,
|
|
118
|
-
xanchor: "center",
|
|
119
|
-
yanchor: "bottom",
|
|
120
|
-
yref: "container",
|
|
121
|
-
orientation: "h",
|
|
122
|
-
font: {
|
|
123
|
-
size: 13,
|
|
124
|
-
color: o.legendColor,
|
|
125
|
-
family: "Inter, sans-serif",
|
|
126
|
-
weight: 500,
|
|
127
|
-
lineheight: 18
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
xaxis: {
|
|
131
|
-
title: {
|
|
132
|
-
text: d,
|
|
133
|
-
font: {
|
|
134
|
-
size: 16,
|
|
135
|
-
color: o.textSecondary,
|
|
136
|
-
family: "Inter, sans-serif",
|
|
137
|
-
weight: 400
|
|
138
|
-
},
|
|
139
|
-
standoff: 15
|
|
140
|
-
},
|
|
141
|
-
gridcolor: w,
|
|
142
|
-
// Reserve space for tick labels + the axis title so the bottom legend
|
|
143
|
-
// can't overlap them at small sizes (SW-2157).
|
|
144
|
-
automargin: !0,
|
|
145
|
-
...x
|
|
146
|
-
},
|
|
147
|
-
yaxis: {
|
|
148
|
-
title: {
|
|
149
|
-
text: m,
|
|
150
|
-
font: {
|
|
151
|
-
size: 16,
|
|
152
|
-
color: o.textSecondary,
|
|
153
|
-
family: "Inter, sans-serif",
|
|
154
|
-
weight: 400
|
|
155
|
-
},
|
|
156
|
-
standoff: 15
|
|
157
|
-
},
|
|
158
|
-
gridcolor: w,
|
|
159
|
-
automargin: !0,
|
|
160
|
-
...x
|
|
161
|
-
},
|
|
162
|
-
paper_bgcolor: o.paperBg,
|
|
163
|
-
plot_bgcolor: o.plotBg
|
|
164
|
-
}, h = {
|
|
165
|
-
// Sizing is driven from the measured container; disable Plotly's own
|
|
166
|
-
// window-resize responsiveness (it can't see container resizes).
|
|
167
|
-
responsive: !1,
|
|
168
|
-
displayModeBar: !1,
|
|
169
|
-
displaylogo: !1
|
|
170
|
-
};
|
|
171
|
-
z.newPlot(n.current, A, t, h), R(n.current);
|
|
172
|
-
const O = n.current;
|
|
173
|
-
return p.current = !0, a.current = { ...s.current }, () => {
|
|
174
|
-
O && (z.purge(O), p.current = !1);
|
|
175
|
-
};
|
|
176
|
-
}, [I, d, m, A, B, x, w, o, R]), D(() => {
|
|
177
|
-
const t = n.current;
|
|
178
|
-
!t || !p.current || e <= 0 || r <= 0 || a.current.width === e && a.current.height === r || (a.current = { width: e, height: r }, z.relayout(t, { width: e, height: r }).catch(
|
|
179
|
-
() => {
|
|
180
|
-
}
|
|
181
|
-
));
|
|
182
|
-
}, [e, r]), /* @__PURE__ */ j(
|
|
183
|
-
"div",
|
|
184
|
-
{
|
|
185
|
-
ref: L,
|
|
186
|
-
className: F("dotplot-container relative", W && "w-full", _ && "h-full"),
|
|
187
|
-
style: c === void 0 ? void 0 : { width: c },
|
|
188
|
-
children: [
|
|
189
|
-
/* @__PURE__ */ M(
|
|
190
|
-
"div",
|
|
191
|
-
{
|
|
192
|
-
ref: n,
|
|
193
|
-
style: {
|
|
194
|
-
width: "100%",
|
|
195
|
-
height: "100%",
|
|
196
|
-
margin: "0"
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
),
|
|
200
|
-
H
|
|
201
|
-
]
|
|
202
|
-
}
|
|
203
|
-
);
|
|
204
|
-
};
|
|
205
|
-
export {
|
|
206
|
-
Z as DotPlot
|
|
207
|
-
};
|
|
208
|
-
//# sourceMappingURL=DotPlot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotPlot.js","sources":["../../../../src/components/charts/DotPlot/DotPlot.tsx"],"sourcesContent":["import Plotly from \"plotly.js-dist\";\nimport React, { useEffect, useRef, useMemo } from \"react\";\n\nimport { useChartTooltip } from \"../ChartTooltip\";\n\nimport { useElementSize } from \"@/hooks/use-element-size\";\nimport { usePlotlyTheme } from \"@/hooks/use-plotly-theme\";\nimport { cn } from \"@/lib/utils\";\nimport { CHART_COLORS } from \"@/utils/colors\";\n\ntype MarkerSymbol =\n | \"circle\"\n | \"square\"\n | \"diamond\"\n | \"triangle-up\"\n | \"triangle-down\"\n | \"star\";\n\ninterface DotPlotDataSeries {\n x: number[];\n y: number[];\n name: string;\n color?: string;\n symbol?: MarkerSymbol;\n size?: number;\n}\n\ntype DotPlotVariant = \"default\" | \"stacked\";\n\ntype DotPlotProps = {\n dataSeries: DotPlotDataSeries | DotPlotDataSeries[];\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 title?: string;\n xTitle?: string;\n yTitle?: string;\n variant?: DotPlotVariant;\n markerSize?: number;\n};\n\nconst DotPlot: React.FC<DotPlotProps> = ({\n dataSeries,\n width,\n height,\n title = \"Dot Plot\",\n xTitle,\n yTitle,\n variant = \"default\",\n markerSize = 8,\n}) => {\n const plotRef = useRef<HTMLDivElement>(null);\n const theme = usePlotlyTheme();\n const { bindTooltip, tooltipElement } = useChartTooltip({ xLabel: xTitle, yLabel: yTitle });\n\n // Omitted width/height → fill the container and track its measured size;\n // explicit pixel values override. See AreaGraph for the reference pattern.\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 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 seriesArray = useMemo(\n () => (Array.isArray(dataSeries) ? dataSeries : [dataSeries]),\n [dataSeries],\n );\n\n const defaultColors = CHART_COLORS;\n\n const defaultSymbols: MarkerSymbol[] = useMemo(\n () => [\n \"circle\",\n \"square\",\n \"diamond\",\n \"triangle-up\",\n \"triangle-down\",\n \"star\",\n ],\n [],\n );\n\n const seriesWithColors = useMemo(() => {\n return seriesArray.map((series, index) => {\n if (variant === \"default\") {\n // Default variant: all circles, use first color or series color\n return {\n ...series,\n color: series.color || defaultColors[0],\n symbol: \"circle\" as MarkerSymbol,\n size: series.size || markerSize,\n };\n } else {\n // Stacked variant: different symbols and colors for each series\n return {\n ...series,\n color: series.color || defaultColors[index % defaultColors.length],\n symbol:\n series.symbol || defaultSymbols[index % defaultSymbols.length],\n size: series.size || markerSize,\n };\n }\n });\n }, [seriesArray, variant, markerSize, defaultColors, defaultSymbols]);\n\n const gridColor = theme.gridColor;\n\n const plotData = useMemo(\n () =>\n seriesWithColors.map((series) => ({\n type: \"scatter\" as const,\n x: series.x,\n y: series.y,\n mode: \"markers\" as const,\n name: series.name,\n marker: {\n color: series.color,\n size: series.size,\n symbol: series.symbol,\n line: {\n color: theme.paperBg,\n width: 1,\n },\n },\n hoverinfo: \"none\" as const,\n })),\n [seriesWithColors, theme],\n );\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 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 [title, theme],\n );\n\n useEffect(() => {\n if (!plotRef.current || !hasSize) return;\n\n const layout = {\n width: sizeRef.current.width,\n height: sizeRef.current.height,\n font: {\n family: \"Inter, sans-serif\",\n },\n title: titleOptions,\n // Bottom margin reserves room for tick labels, the x-axis title, and the\n // container-anchored bottom legend stacked beneath them.\n margin: { l: 80, r: 40, b: 96, t: 80, pad: 0 },\n showlegend: true,\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 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: gridColor,\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: gridColor,\n automargin: true,\n ...tickOptions,\n },\n paper_bgcolor: theme.paperBg,\n plot_bgcolor: theme.plotBg,\n };\n\n const config = {\n // Sizing is driven from the measured container; disable Plotly's own\n // window-resize responsiveness (it can't see container resizes).\n responsive: false,\n displayModeBar: false,\n displaylogo: false,\n };\n\n Plotly.newPlot(plotRef.current, plotData, 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 return () => {\n if (plotElement) {\n Plotly.purge(plotElement);\n plotInitedRef.current = false;\n }\n };\n }, [hasSize, xTitle, yTitle, plotData, titleOptions, tickOptions, gridColor, theme, bindTooltip]);\n\n // Resize in place when the measured/overridden size changes — cheaper than\n // 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(\"dotplot-container relative\", fillWidth && \"w-full\", fillHeight && \"h-full\")}\n style={width === undefined ? undefined : { width }}\n >\n <div\n ref={plotRef}\n style={{\n width: \"100%\",\n height: \"100%\",\n margin: \"0\",\n }}\n />\n {tooltipElement}\n </div>\n );\n};\n\nexport { DotPlot };\nexport type { DotPlotDataSeries, DotPlotProps, DotPlotVariant, MarkerSymbol };\n"],"names":["DotPlot","dataSeries","width","height","title","xTitle","yTitle","variant","markerSize","plotRef","useRef","theme","usePlotlyTheme","bindTooltip","tooltipElement","useChartTooltip","containerRef","measured","useElementSize","resolvedWidth","resolvedHeight","hasSize","fillWidth","fillHeight","sizeRef","plotInitedRef","appliedSizeRef","seriesArray","useMemo","defaultColors","CHART_COLORS","defaultSymbols","seriesWithColors","series","index","gridColor","plotData","tickOptions","titleOptions","useEffect","layout","config","Plotly","plotElement","jsxs","cn","jsx"],"mappings":";;;;;;;;AAgDA,MAAMA,IAAkC,CAAC;AAAA,EACvC,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,YAAAC,IAAa;AACf,MAAM;AACJ,QAAMC,IAAUC,EAAuB,IAAI,GACrCC,IAAQC,EAAA,GACR,EAAE,aAAAC,GAAa,gBAAAC,EAAA,IAAmBC,EAAgB,EAAE,QAAQV,GAAQ,QAAQC,GAAQ,GAIpF,CAACU,GAAcC,CAAQ,IAAIC,EAAA,GAC3BC,IAAgBjB,KAASe,EAAS,OAClCG,IAAiBjB,KAAUc,EAAS,QACpCI,IAAUF,IAAgB,KAAKC,IAAiB,GAGhDE,IAAYpB,MAAU,QACtBqB,IAAapB,MAAW,QACxBqB,IAAUd,EAAO,EAAE,OAAOS,GAAe,QAAQC,GAAgB;AACvE,EAAAI,EAAQ,UAAU,EAAE,OAAOL,GAAe,QAAQC,EAAA;AAClD,QAAMK,IAAgBf,EAAO,EAAK,GAG5BgB,IAAiBhB,EAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,GAC/CiB,IAAcC;AAAA,IAClB,MAAO,MAAM,QAAQ3B,CAAU,IAAIA,IAAa,CAACA,CAAU;AAAA,IAC3D,CAACA,CAAU;AAAA,EAAA,GAGP4B,IAAgBC,GAEhBC,IAAiCH;AAAA,IACrC,MAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEF,CAAA;AAAA,EAAC,GAGGI,IAAmBJ,EAAQ,MACxBD,EAAY,IAAI,CAACM,GAAQC,MAC1B3B,MAAY,YAEP;AAA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MAAU,SAAY,SAAY,EAAE,OAAAA,EAAA;AAAA,MAE3C,UAAA;AAAA,QAAA,gBAAA4C;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAKrC;AAAA,YACL,OAAO;AAAA,cACL,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,QAAQ;AAAA,YAAA;AAAA,UACV;AAAA,QAAA;AAAA,QAEDK;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react/jsx-runtime"),H=require("react"),V=require("../PlateMap/PlateMap.cjs");function $(e){if(!e||e.length===0)return[];const n=Math.max(...e.map(t=>t.length));return e.map(t=>{if(t.length===n)return t;const l=[...t];for(;l.length<n;)l.push(0);return l})}const x=({data:e,xLabels:n,yLabels:t,title:l,xTitle:u,yTitle:s,colorscale:i,width:g=800,height:h=600,showScale:m=!0,precision:p=0,zmin:f,zmax:M,valueUnit:w=""})=>{const o=e?$(e):void 0,S=o?.length??t?.length??16,R=o?.[0]?.length??n?.length??24,v=H.useMemo(()=>{if(!o)return;const C="ABCDEFGHIJKLMNOPQRSTUVWXYZ",c=[];for(let r=0;r<o.length;r++)for(let a=0;a<o[r].length;a++){const D=t?.[r]?.toString()??C[r]??`R${r+1}`,P=n?.[a]?.toString()??String(a+1),j=`${D}${P}`;c.push({wellId:j,values:{Value:o[r][a]}})}return c},[o,n,t]),d=i;return q.jsx(V.PlateMap,{data:v,plateFormat:"custom",rows:S,columns:R,title:l,xTitle:u,yTitle:s,xLabels:n,yLabels:t,colorScale:d,valueMin:f,valueMax:M,showColorBar:m,width:g,height:h,layerConfigs:[{id:"Value",valueUnit:w}],precision:p})};exports.Heatmap=x;
|
|
2
|
-
//# sourceMappingURL=Heatmap.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Heatmap.cjs","sources":["../../../../src/components/charts/Heatmap/Heatmap.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nimport { PlateMap } from \"../PlateMap\";\n\nimport type { ColorScale, WellData } from \"../PlateMap\";\n\n/**\n * Props for the Heatmap component\n * @deprecated Use PlateMap component instead. Heatmap is now a wrapper around PlateMap for backward compatibility.\n */\ninterface HeatmapProps {\n /** 2D array of numeric values */\n data?: number[][];\n /** Custom x-axis labels (column labels) */\n xLabels?: string[] | number[];\n /** Custom y-axis labels (row labels) */\n yLabels?: string[] | number[];\n /** Chart title */\n title?: string;\n /** X-axis title */\n xTitle?: string;\n /** Y-axis title */\n yTitle?: string;\n /** Color scale - string name or array of [position, color] pairs */\n colorscale?: string | Array<[number, string]>;\n /** Chart width in pixels */\n width?: number;\n /** Chart height in pixels */\n height?: number;\n /** Show color scale legend */\n showScale?: boolean;\n /** Number of decimal places for values */\n precision?: number;\n /** Minimum value for color scale */\n zmin?: number;\n /** Maximum value for color scale */\n zmax?: number;\n /** Value unit suffix */\n valueUnit?: string;\n}\n\n/**\n * Heatmap component for 2D data visualization\n * @deprecated Use PlateMap component instead. This component is now a wrapper around PlateMap for backward compatibility.\n *\n * @example\n * ```tsx\n * <Heatmap\n * data={[[1, 2, 3], [4, 5, 6]]}\n * xLabels={['A', 'B', 'C']}\n * yLabels={['Row 1', 'Row 2']}\n * title=\"My Heatmap\"\n * />\n * ```\n */\n/**\n * Normalize jagged 2D array to consistent width (backward compatibility)\n */\nfunction normalizeData(data: number[][]): number[][] {\n if (!data || data.length === 0) return [];\n\n const maxLength = Math.max(...data.map((row) => row.length));\n\n return data.map((row) => {\n if (row.length === maxLength) return row;\n\n const newRow = [...row];\n while (newRow.length < maxLength) {\n newRow.push(0);\n }\n return newRow;\n });\n}\n\nconst Heatmap: React.FC<HeatmapProps> = ({\n data,\n xLabels,\n yLabels,\n title,\n xTitle,\n yTitle,\n colorscale,\n width = 800,\n height = 600,\n showScale = true,\n precision = 0,\n zmin,\n zmax,\n valueUnit = \"\",\n}) => {\n // Normalize jagged arrays to consistent width (backward compatibility)\n const normalizedData = data ? normalizeData(data) : undefined;\n\n // Determine rows and columns from normalized data or labels\n const rows = normalizedData?.length ?? (yLabels?.length ?? 16);\n const columns = normalizedData?.[0]?.length ?? (xLabels?.length ?? 24);\n\n // Convert 2D array to WellData format for PlateMap\n const wellData: WellData[] | undefined = useMemo(() => {\n if (!normalizedData) return;\n\n const defaultRows = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n const wells: WellData[] = [];\n\n for (let r = 0; r < normalizedData.length; r++) {\n for (let c = 0; c < normalizedData[r].length; c++) {\n const rowLabel = yLabels?.[r]?.toString() ?? defaultRows[r] ?? `R${r + 1}`;\n const colLabel = xLabels?.[c]?.toString() ?? String(c + 1);\n const wellId = `${rowLabel}${colLabel}`;\n wells.push({ wellId, values: { Value: normalizedData[r][c] } });\n }\n }\n return wells;\n }, [normalizedData, xLabels, yLabels]);\n\n // Pass colorscale directly - PlateMap's ColorScale type supports both string and array formats\n const plateMapColorScale: ColorScale | undefined = colorscale;\n\n return (\n <PlateMap\n data={wellData}\n plateFormat=\"custom\"\n rows={rows}\n columns={columns}\n title={title}\n xTitle={xTitle}\n yTitle={yTitle}\n xLabels={xLabels}\n yLabels={yLabels}\n colorScale={plateMapColorScale}\n valueMin={zmin}\n valueMax={zmax}\n showColorBar={showScale}\n width={width}\n height={height}\n layerConfigs={[{ id: \"Value\", valueUnit }]}\n precision={precision}\n />\n );\n};\n\nexport { Heatmap };\nexport type { HeatmapProps };\n"],"names":["normalizeData","data","maxLength","row","newRow","Heatmap","xLabels","yLabels","title","xTitle","yTitle","colorscale","width","height","showScale","precision","zmin","zmax","valueUnit","normalizedData","rows","columns","wellData","useMemo","defaultRows","wells","c","rowLabel","colLabel","wellId","plateMapColorScale","jsx","PlateMap"],"mappings":"8KA0DA,SAASA,EAAcC,EAA8B,CACnD,GAAI,CAACA,GAAQA,EAAK,SAAW,QAAU,CAAA,EAEvC,MAAMC,EAAY,KAAK,IAAI,GAAG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AAA,IAACC,EAAAA,SAAA,CACC,KAAMV,EACN,YAAY,SACZ,KAAAF,EACA,QAAAC,EACA,MAAAb,EACA,OAAAC,EACA,OAAAC,EACA,QAAAJ,EACA,QAAAC,EACA,WAAYuB,EACZ,SAAUd,EACV,SAAUC,EACV,aAAcH,EACd,MAAAF,EACA,OAAAC,EACA,aAAc,CAAC,CAAE,GAAI,QAAS,UAAAK,EAAW,EACzC,UAAAH,CAAA,CAAA,CAGN"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as x } from "react";
|
|
3
|
-
import { PlateMap as z } from "../PlateMap/PlateMap.js";
|
|
4
|
-
function B(o) {
|
|
5
|
-
if (!o || o.length === 0) return [];
|
|
6
|
-
const e = Math.max(...o.map((t) => t.length));
|
|
7
|
-
return o.map((t) => {
|
|
8
|
-
if (t.length === e) return t;
|
|
9
|
-
const r = [...t];
|
|
10
|
-
for (; r.length < e; )
|
|
11
|
-
r.push(0);
|
|
12
|
-
return r;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
const j = ({
|
|
16
|
-
data: o,
|
|
17
|
-
xLabels: e,
|
|
18
|
-
yLabels: t,
|
|
19
|
-
title: r,
|
|
20
|
-
xTitle: u,
|
|
21
|
-
yTitle: s,
|
|
22
|
-
colorscale: i,
|
|
23
|
-
width: m = 800,
|
|
24
|
-
height: h = 600,
|
|
25
|
-
showScale: g = !0,
|
|
26
|
-
precision: p = 0,
|
|
27
|
-
zmin: f,
|
|
28
|
-
zmax: w,
|
|
29
|
-
valueUnit: M = ""
|
|
30
|
-
}) => {
|
|
31
|
-
const n = o ? B(o) : void 0, S = n?.length ?? t?.length ?? 16, C = n?.[0]?.length ?? e?.length ?? 24, v = x(() => {
|
|
32
|
-
if (!n) return;
|
|
33
|
-
const D = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", c = [];
|
|
34
|
-
for (let l = 0; l < n.length; l++)
|
|
35
|
-
for (let a = 0; a < n[l].length; a++) {
|
|
36
|
-
const R = t?.[l]?.toString() ?? D[l] ?? `R${l + 1}`, V = e?.[a]?.toString() ?? String(a + 1), $ = `${R}${V}`;
|
|
37
|
-
c.push({ wellId: $, values: { Value: n[l][a] } });
|
|
38
|
-
}
|
|
39
|
-
return c;
|
|
40
|
-
}, [n, e, t]);
|
|
41
|
-
return /* @__PURE__ */ d(
|
|
42
|
-
z,
|
|
43
|
-
{
|
|
44
|
-
data: v,
|
|
45
|
-
plateFormat: "custom",
|
|
46
|
-
rows: S,
|
|
47
|
-
columns: C,
|
|
48
|
-
title: r,
|
|
49
|
-
xTitle: u,
|
|
50
|
-
yTitle: s,
|
|
51
|
-
xLabels: e,
|
|
52
|
-
yLabels: t,
|
|
53
|
-
colorScale: i,
|
|
54
|
-
valueMin: f,
|
|
55
|
-
valueMax: w,
|
|
56
|
-
showColorBar: g,
|
|
57
|
-
width: m,
|
|
58
|
-
height: h,
|
|
59
|
-
layerConfigs: [{ id: "Value", valueUnit: M }],
|
|
60
|
-
precision: p
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
};
|
|
64
|
-
export {
|
|
65
|
-
j as Heatmap
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=Heatmap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Heatmap.js","sources":["../../../../src/components/charts/Heatmap/Heatmap.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nimport { PlateMap } from \"../PlateMap\";\n\nimport type { ColorScale, WellData } from \"../PlateMap\";\n\n/**\n * Props for the Heatmap component\n * @deprecated Use PlateMap component instead. Heatmap is now a wrapper around PlateMap for backward compatibility.\n */\ninterface HeatmapProps {\n /** 2D array of numeric values */\n data?: number[][];\n /** Custom x-axis labels (column labels) */\n xLabels?: string[] | number[];\n /** Custom y-axis labels (row labels) */\n yLabels?: string[] | number[];\n /** Chart title */\n title?: string;\n /** X-axis title */\n xTitle?: string;\n /** Y-axis title */\n yTitle?: string;\n /** Color scale - string name or array of [position, color] pairs */\n colorscale?: string | Array<[number, string]>;\n /** Chart width in pixels */\n width?: number;\n /** Chart height in pixels */\n height?: number;\n /** Show color scale legend */\n showScale?: boolean;\n /** Number of decimal places for values */\n precision?: number;\n /** Minimum value for color scale */\n zmin?: number;\n /** Maximum value for color scale */\n zmax?: number;\n /** Value unit suffix */\n valueUnit?: string;\n}\n\n/**\n * Heatmap component for 2D data visualization\n * @deprecated Use PlateMap component instead. This component is now a wrapper around PlateMap for backward compatibility.\n *\n * @example\n * ```tsx\n * <Heatmap\n * data={[[1, 2, 3], [4, 5, 6]]}\n * xLabels={['A', 'B', 'C']}\n * yLabels={['Row 1', 'Row 2']}\n * title=\"My Heatmap\"\n * />\n * ```\n */\n/**\n * Normalize jagged 2D array to consistent width (backward compatibility)\n */\nfunction normalizeData(data: number[][]): number[][] {\n if (!data || data.length === 0) return [];\n\n const maxLength = Math.max(...data.map((row) => row.length));\n\n return data.map((row) => {\n if (row.length === maxLength) return row;\n\n const newRow = [...row];\n while (newRow.length < maxLength) {\n newRow.push(0);\n }\n return newRow;\n });\n}\n\nconst Heatmap: React.FC<HeatmapProps> = ({\n data,\n xLabels,\n yLabels,\n title,\n xTitle,\n yTitle,\n colorscale,\n width = 800,\n height = 600,\n showScale = true,\n precision = 0,\n zmin,\n zmax,\n valueUnit = \"\",\n}) => {\n // Normalize jagged arrays to consistent width (backward compatibility)\n const normalizedData = data ? normalizeData(data) : undefined;\n\n // Determine rows and columns from normalized data or labels\n const rows = normalizedData?.length ?? (yLabels?.length ?? 16);\n const columns = normalizedData?.[0]?.length ?? (xLabels?.length ?? 24);\n\n // Convert 2D array to WellData format for PlateMap\n const wellData: WellData[] | undefined = useMemo(() => {\n if (!normalizedData) return;\n\n const defaultRows = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n const wells: WellData[] = [];\n\n for (let r = 0; r < normalizedData.length; r++) {\n for (let c = 0; c < normalizedData[r].length; c++) {\n const rowLabel = yLabels?.[r]?.toString() ?? defaultRows[r] ?? `R${r + 1}`;\n const colLabel = xLabels?.[c]?.toString() ?? String(c + 1);\n const wellId = `${rowLabel}${colLabel}`;\n wells.push({ wellId, values: { Value: normalizedData[r][c] } });\n }\n }\n return wells;\n }, [normalizedData, xLabels, yLabels]);\n\n // Pass colorscale directly - PlateMap's ColorScale type supports both string and array formats\n const plateMapColorScale: ColorScale | undefined = colorscale;\n\n return (\n <PlateMap\n data={wellData}\n plateFormat=\"custom\"\n rows={rows}\n columns={columns}\n title={title}\n xTitle={xTitle}\n yTitle={yTitle}\n xLabels={xLabels}\n yLabels={yLabels}\n colorScale={plateMapColorScale}\n valueMin={zmin}\n valueMax={zmax}\n showColorBar={showScale}\n width={width}\n height={height}\n layerConfigs={[{ id: \"Value\", valueUnit }]}\n precision={precision}\n />\n );\n};\n\nexport { Heatmap };\nexport type { HeatmapProps };\n"],"names":["normalizeData","data","maxLength","row","newRow","Heatmap","xLabels","yLabels","title","xTitle","yTitle","colorscale","width","height","showScale","precision","zmin","zmax","valueUnit","normalizedData","rows","columns","wellData","useMemo","defaultRows","wells","r","c","rowLabel","colLabel","wellId","jsx","PlateMap"],"mappings":";;;AA0DA,SAASA,EAAcC,GAA8B;AACnD,MAAI,CAACA,KAAQA,EAAK,WAAW,UAAU,CAAA;AAEvC,QAAMC,IAAY,KAAK,IAAI,GAAGD,EAAK,IAAI,CAACE,MAAQA,EAAI,MAAM,CAAC;AAE3D,SAAOF,EAAK,IAAI,CAACE,MAAQ;AACvB,QAAIA,EAAI,WAAWD,EAAW,QAAOC;AAErC,UAAMC,IAAS,CAAC,GAAGD,CAAG;AACtB,WAAOC,EAAO,SAASF;AACrB,MAAAE,EAAO,KAAK,CAAC;AAEf,WAAOA;AAAA,EACT,CAAC;AACH;AAEA,MAAMC,IAAkC,CAAC;AAAA,EACvC,MAAAJ;AAAA,EACA,SAAAK;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QA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AAcH;AAAA,MACd,OAAAF;AAAA,MACA,QAAAC;AAAA,MACA,cAAc,CAAC,EAAE,IAAI,SAAS,WAAAK,GAAW;AAAA,MACzC,WAAAH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),z=require("plotly.js-dist"),o=require("react"),B=require("../ChartTooltip/ChartTooltip.cjs"),Y=require("../../../hooks/use-element-size.cjs"),H=require("../../../hooks/use-plotly-theme.cjs"),W=require("../../../lib/utils.cjs"),D=require("../../../utils/colors.cjs"),F=60,J=30,K=({dataSeries:a,width:C,height:L,xRange:k,yRange:m,variant:d="lines",xTitle:E,yTitle:_,title:p,xTickText:y})=>{const u=o.useRef(null),r=H.usePlotlyTheme(),{bindTooltip:N,tooltipElement:G}=B.useChartTooltip({xLabel:E,yLabel:_}),[T,P]=Y.useElementSize(),l=C??P.width,c=L??P.height,q=l>0&&c>0,U=C===void 0,V=L===void 0,M=o.useRef({width:l,height:c});M.current={width:l,height:c};const I=o.useRef(!1),w=o.useRef({width:0,height:0}),{yMin:A,yMax:R}=o.useMemo(()=>{let t=Number.MAX_VALUE,e=Number.MIN_VALUE,s=Number.MAX_VALUE,n=Number.MIN_VALUE;a.forEach(f=>{f.x.forEach(g=>{t=Math.min(t,g),e=Math.max(e,g)}),f.y.forEach(g=>{s=Math.min(s,g),n=Math.max(n,g)})});const i=(e-t)*.1,b=(n-s)*.1;return{xMin:t-i,xMax:e+i,yMin:s-b,yMax:n+b}},[a]),h=o.useMemo(()=>m||[A,R],[m,A,R]),O=o.useMemo(()=>{const t=h[1]-h[0];let e=Math.pow(10,Math.floor(Math.log10(t)));t/e>10&&(e=e*2),t/e<4&&(e=e/2);const s=[];let n=Math.ceil(h[0]/e)*e;for(;n<=h[1];)s.push(n),n+=e;return s},[h]),x=o.useMemo(()=>[...new Set(a.flatMap(t=>t.x))].sort((t,e)=>t-e),[a]),S=!!y&&y.length===x.length,X=o.useMemo(()=>{switch(d){case"lines+markers":case"lines+markers+error_bars":return"lines+markers";default:return"lines"}},[d]),v=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||!q)return;const t=a.map((i,b)=>{const f=D.seriesColor(b,i.color);return{x:i.x,y:i.y,type:"scatter",mode:X,name:i.name,hoverinfo:"none",line:{color:f,width:1.5},marker:d==="lines"?{opacity:0}:{color:f,size:8,symbol:i.symbol||"triangle-up"},error_y:d==="lines+markers+error_bars"?i.error_y||{type:"data",array:i.y.map(()=>10),visible:!0,color:f,thickness:1,width:5}:void 0}}),e={...p?{title:{text:p,font:{size:32,family:"Inter, sans-serif",color:r.textColor}}}:{},width:M.current.width,height:M.current.height,margin:{l:80,r:30,b:96,t:p?F:J,pad:10},paper_bgcolor:r.paperBg,plot_bgcolor:r.plotBg,font:{family:"Inter, sans-serif"},dragmode:!1,xaxis:{title:{text:E,font:{size:16,color:r.textSecondary,family:"Inter, sans-serif",weight:400},standoff:32},gridcolor:r.gridColor,range:k,autorange:!k,tickmode:"array",tickvals:x,ticktext:S?y:x.map(String),showgrid:!0,automargin:!0,...v},yaxis:{title:{text:_,font:{size:16,color:r.textSecondary,family:"Inter, sans-serif",weight:400},standoff:30},gridcolor:r.gridColor,range:m,autorange:!m,tickmode:"array",tickvals:O,showgrid:!0,automargin:!0,...v},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:!0},s={responsive:!1,displayModeBar:!1,displaylogo:!1};z.newPlot(u.current,t,e,s),N(u.current);const n=u.current;return I.current=!0,w.current={...M.current},()=>{n&&(z.purge(n),I.current=!1)}},[a,q,k,m,E,_,p,X,v,x,O,S,y,h,d,r,N]),o.useEffect(()=>{const t=u.current;!t||!I.current||l<=0||c<=0||w.current.width===l&&w.current.height===c||(w.current={width:l,height:c},z.relayout(t,{width:l,height:c}).catch(()=>{}))},[l,c]),j.jsxs("div",{ref:T,className:W.cn("relative",U&&"w-full",V&&"h-full"),children:[j.jsx("div",{ref:u,style:{width:"100%",height:"100%"}}),G]})};exports.LineGraph=K;
|
|
2
|
-
//# sourceMappingURL=LineGraph.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LineGraph.cjs","sources":["../../../../src/components/charts/LineGraph/LineGraph.tsx"],"sourcesContent":["import Plotly from \"plotly.js-dist\";\nimport React, { useEffect, useRef, useMemo } from \"react\";\n\nimport { 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\ntype MarkerSymbol =\n | \"circle\"\n | \"circle-open\"\n | \"circle-dot\"\n | \"circle-open-dot\"\n | \"square\"\n | \"square-open\"\n | \"square-dot\"\n | \"square-open-dot\"\n | \"diamond\"\n | \"diamond-open\"\n | \"diamond-dot\"\n | \"diamond-open-dot\"\n | \"cross\"\n | \"cross-open\"\n | \"cross-dot\"\n | \"cross-open-dot\"\n | \"x\"\n | \"x-open\"\n | \"x-dot\"\n | \"x-open-dot\"\n | \"triangle-up\"\n | \"triangle-up-open\"\n | \"triangle-up-dot\"\n | \"triangle-up-open-dot\"\n | \"triangle-down\"\n | \"triangle-down-open\"\n | \"triangle-down-dot\"\n | \"triangle-down-open-dot\"\n | \"triangle-left\"\n | \"triangle-left-open\"\n | \"triangle-left-dot\"\n | \"triangle-left-open-dot\"\n | \"triangle-right\"\n | \"triangle-right-open\"\n | \"triangle-right-dot\"\n | \"triangle-right-open-dot\"\n | \"triangle-ne\"\n | \"triangle-ne-open\"\n | \"triangle-ne-dot\"\n | \"triangle-ne-open-dot\"\n | \"triangle-se\"\n | \"triangle-se-open\"\n | \"triangle-se-dot\"\n | \"triangle-se-open-dot\"\n | \"triangle-sw\"\n | \"triangle-sw-open\"\n | \"triangle-sw-dot\"\n | \"triangle-sw-open-dot\"\n | \"triangle-nw\"\n | \"triangle-nw-open\"\n | \"triangle-nw-dot\"\n | \"triangle-nw-open-dot\"\n | \"pentagon\"\n | \"pentagon-open\"\n | \"pentagon-dot\"\n | \"pentagon-open-dot\"\n | \"hexagon\"\n | \"hexagon-open\"\n | \"hexagon-dot\"\n | \"hexagon-open-dot\"\n | \"hexagon2\"\n | \"hexagon2-open\"\n | \"hexagon2-dot\"\n | \"hexagon2-open-dot\"\n | \"octagon\"\n | \"octagon-open\"\n | \"octagon-dot\"\n | \"octagon-open-dot\"\n | \"star\"\n | \"star-open\"\n | \"star-dot\"\n | \"star-open-dot\"\n | \"hexagram\"\n | \"hexagram-open\"\n | \"hexagram-dot\"\n | \"hexagram-open-dot\"\n | \"star-triangle-up\"\n | \"star-triangle-up-open\"\n | \"star-triangle-up-dot\"\n | \"star-triangle-up-open-dot\"\n | \"star-triangle-down\"\n | \"star-triangle-down-open\"\n | \"star-triangle-down-dot\"\n | \"star-triangle-down-open-dot\"\n | \"star-square\"\n | \"star-square-open\"\n | \"star-square-dot\"\n | \"star-square-open-dot\"\n | \"star-diamond\"\n | \"star-diamond-open\"\n | \"star-diamond-dot\"\n | \"star-diamond-open-dot\"\n | \"diamond-tall\"\n | \"diamond-tall-open\"\n | \"diamond-tall-dot\"\n | \"diamond-tall-open-dot\"\n | \"diamond-wide\"\n | \"diamond-wide-open\"\n | \"diamond-wide-dot\"\n | \"diamond-wide-open-dot\"\n | \"hourglass\"\n | \"hourglass-open\"\n | \"bowtie\"\n | \"bowtie-open\"\n | \"circle-cross\"\n | \"circle-cross-open\"\n | \"circle-x\"\n | \"circle-x-open\"\n | \"square-cross\"\n | \"square-cross-open\"\n | \"square-x\"\n | \"square-x-open\"\n | \"diamond-cross\"\n | \"diamond-cross-open\"\n | \"diamond-x\"\n | \"diamond-x-open\"\n | \"cross-thin\"\n | \"cross-thin-open\"\n | \"x-thin\"\n | \"x-thin-open\"\n | \"asterisk\"\n | \"asterisk-open\"\n | \"hash\"\n | \"hash-open\"\n | \"hash-dot\"\n | \"hash-open-dot\"\n | \"y-up\"\n | \"y-up-open\"\n | \"y-down\"\n | \"y-down-open\"\n | \"y-left\"\n | \"y-left-open\"\n | \"y-right\"\n | \"y-right-open\"\n | \"line-ew\"\n | \"line-ew-open\"\n | \"line-ns\"\n | \"line-ns-open\"\n | \"line-ne\"\n | \"line-ne-open\"\n | \"line-nw\"\n | \"line-nw-open\"\n | \"arrow\"\n | \"arrow-open\"\n | \"arrow-wide\"\n | \"arrow-wide-open\";\n\ninterface LineDataSeries {\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 symbol?: MarkerSymbol;\n error_y?: {\n type: \"data\";\n array: number[];\n visible: boolean;\n };\n}\n\ntype LineGraphVariant = \"lines\" | \"lines+markers\" | \"lines+markers+error_bars\";\n\n/** Top margin reserving room for the 32px title; reduced when no title is set */\nconst TITLE_MARGIN_TOP = 60;\nconst NO_TITLE_MARGIN_TOP = 30;\n\ntype LineGraphProps = {\n dataSeries: LineDataSeries[];\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?: LineGraphVariant;\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 line 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 LineGraph: React.FC<LineGraphProps> = ({\n dataSeries,\n width,\n height,\n xRange,\n yRange,\n variant = \"lines\",\n xTitle,\n yTitle,\n title,\n xTickText,\n}) => {\n const plotRef = useRef<HTMLDivElement>(null);\n const theme = usePlotlyTheme();\n const { bindTooltip, tooltipElement } = useChartTooltip({ xLabel: xTitle, yLabel: yTitle });\n\n // Omitted width/height → fill the container and track its measured size;\n // explicit pixel values override. See AreaGraph for the reference pattern.\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 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\n const { 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: minY - yPadding,\n yMax: maxY + yPadding,\n };\n }, [dataSeries]);\n\n const effectiveYRange = useMemo(\n () => yRange || [yMin, yMax],\n [yRange, yMin, yMax],\n );\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 const xTicks = 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 === xTicks.length;\n\n const mode = useMemo((): \"lines\" | \"lines+markers\" => {\n switch (variant) {\n case \"lines+markers\":\n case \"lines+markers+error_bars\":\n return \"lines+markers\";\n default:\n return \"lines\";\n }\n }, [variant]);\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 useEffect(() => {\n if (!plotRef.current || !hasSize) return;\n\n const plotData = 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: mode,\n name: series.name,\n hoverinfo: \"none\" as const,\n line: {\n color,\n width: 1.5,\n },\n marker:\n variant === \"lines\"\n ? { opacity: 0 }\n : {\n color,\n size: 8,\n symbol: series.symbol || \"triangle-up\",\n },\n error_y:\n variant === \"lines+markers+error_bars\"\n ? series.error_y || {\n type: \"data\" as const,\n array: series.y.map(() => 10),\n visible: true,\n color,\n thickness: 1,\n width: 5,\n }\n : undefined,\n };\n });\n\n const layout = {\n ...(title\n ? {\n title: {\n text: title,\n font: {\n size: 32,\n family: \"Inter, sans-serif\",\n color: theme.textColor,\n },\n },\n }\n : {}),\n width: sizeRef.current.width,\n height: sizeRef.current.height,\n margin: {\n l: 80,\n r: 30,\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: 10,\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: 32,\n },\n gridcolor: theme.gridColor,\n range: xRange,\n autorange: !xRange,\n tickmode: \"array\" as const,\n tickvals: xTicks,\n ticktext: useCategoricalX ? xTickText : xTicks.map(String),\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: 30,\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: 16,\n color: theme.legendColor,\n family: \"Inter, sans-serif\",\n weight: 500,\n },\n },\n showlegend: true,\n };\n\n const config = {\n // Sizing is driven from the measured container; disable Plotly's own\n // window-resize responsiveness (it can't see container resizes).\n responsive: false,\n displayModeBar: false,\n displaylogo: false,\n };\n\n Plotly.newPlot(plotRef.current, plotData, 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 return () => {\n if (plotElement) {\n Plotly.purge(plotElement);\n plotInitedRef.current = false;\n }\n };\n }, [dataSeries, hasSize, xRange, yRange, xTitle, yTitle, title, mode, tickOptions, xTicks, yTicks, useCategoricalX, xTickText, effectiveYRange, variant, theme, bindTooltip]);\n\n // Resize in place when the measured/overridden size changes — cheaper than\n // 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 ref={containerRef} className={cn(\"relative\", fillWidth && \"w-full\", fillHeight && \"h-full\")}>\n <div ref={plotRef} style={{ width: \"100%\", height: \"100%\" }} />\n {tooltipElement}\n </div>\n );\n};\n\nexport { LineGraph };\nexport type { LineDataSeries, LineGraphVariant, LineGraphProps, MarkerSymbol };\n"],"names":["TITLE_MARGIN_TOP","NO_TITLE_MARGIN_TOP","LineGraph","dataSeries","width","height","xRange","yRange","variant","xTitle","yTitle","title","xTickText","plotRef","useRef","theme","usePlotlyTheme","bindTooltip","tooltipElement","useChartTooltip","containerRef","measured","useElementSize","resolvedWidth","resolvedHeight","hasSize","fillWidth","fillHeight","sizeRef","plotInitedRef","appliedSizeRef","yMin","yMax","useMemo","minX","maxX","minY","maxY","series","x","y","xPadding","yPadding","effectiveYRange","yTicks","range","step","ticks","current","xTicks","s","a","b","useCategoricalX","mode","tickOptions","useEffect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