@tetrascience-npm/tetrascience-react-ui 0.7.0-beta.108.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.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
|
@@ -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,GAAGD,EAAK,IAAKE,GAAQA,EAAI,MAAM,CAAC,EAE3D,OAAOF,EAAK,IAAKE,GAAQ,CACvB,GAAIA,EAAI,SAAWD,EAAW,OAAOC,EAErC,MAAMC,EAAS,CAAC,GAAGD,CAAG,EACtB,KAAOC,EAAO,OAASF,GACrBE,EAAO,KAAK,CAAC,EAEf,OAAOA,CACT,CAAC,CACH,CAEA,MAAMC,EAAkC,CAAC,CACvC,KAAAJ,EACA,QAAAK,EACA,QAAAC,EACA,MAAAC,EACA,OAAAC,EACA,OAAAC,EACA,WAAAC,EACA,MAAAC,EAAQ,IACR,OAAAC,EAAS,IACT,UAAAC,EAAY,GACZ,UAAAC,EAAY,EACZ,KAAAC,EACA,KAAAC,EACA,UAAAC,EAAY,EACd,IAAM,CAEJ,MAAMC,EAAiBlB,EAAOD,EAAcC,CAAI,EAAI,OAG9CmB,EAAOD,GAAgB,QAAWZ,GAAS,QAAU,GACrDc,EAAUF,IAAiB,CAAC,GAAG,QAAWb,GAAS,QAAU,GAG7DgB,EAAmCC,EAAAA,QAAQ,IAAM,CACrD,GAAI,CAACJ,EAAgB,OAErB,MAAMK,EAAc,6BACdC,EAAoB,CAAA,EAE1B,QAAS,EAAI,EAAG,EAAIN,EAAe,OAAQ,IACzC,QAASO,EAAI,EAAGA,EAAIP,EAAe,CAAC,EAAE,OAAQO,IAAK,CACjD,MAAMC,EAAWpB,IAAU,CAAC,GAAG,SAAA,GAAciB,EAAY,CAAC,GAAK,IAAI,EAAI,CAAC,GAClEI,EAAWtB,IAAUoB,CAAC,GAAG,YAAc,OAAOA,EAAI,CAAC,EACnDG,EAAS,GAAGF,CAAQ,GAAGC,CAAQ,GACrCH,EAAM,KAAK,CAAE,OAAAI,EAAQ,OAAQ,CAAE,MAAOV,EAAe,CAAC,EAAEO,CAAC,CAAA,CAAE,CAAG,CAChE,CAEF,OAAOD,CACT,EAAG,CAACN,EAAgBb,EAASC,CAAO,CAAC,EAG/BuB,EAA6CnB,EAEnD,OACEoB,EAAAA,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,I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,CAAC,EAAA,EAAE,CAAG;AAAA,MAChE;AAEF,WAAOF;AAAA,EACT,GAAG,CAACN,GAAgBb,GAASC,CAAO,CAAC;AAKrC,SACE,gBAAAwB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMV;AAAA,MACN,aAAY;AAAA,MACZ,MAAAF;AAAA,MACA,SAAAC;AAAA,MACA,OAAAb;AAAA,MACA,QAAAC;AAAA,MACA,QAAAC;AAAA,MACA,SAAAJ;AAAA,MACA,SAAAC;AAAA,MACA,YAb+CI;AAAA,MAc/C,UAAUK;AAAA,MACV,UAAUC;AAAA,MACV,cAAcH;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","plotData","index","color","seriesColor","layout","config","Plotly","plotElement","jsxs","cn","jsx"],"mappings":"+XA+KMA,EAAmB,GACnBC,EAAsB,GA6BtBC,EAAsC,CAAC,CAC3C,WAAAC,EACA,MAAAC,EACA,OAAAC,EACA,OAAAC,EACA,OAAAC,EACA,QAAAC,EAAU,QACV,OAAAC,EACA,OAAAC,EACA,MAAAC,EACA,UAAAC,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,EAAgBnB,GAASiB,EAAS,MAClCG,EAAiBnB,GAAUgB,EAAS,OACpCI,EAAUF,EAAgB,GAAKC,EAAiB,EAGhDE,EAAYtB,IAAU,OACtBuB,EAAatB,IAAW,OACxBuB,EAAUd,EAAAA,OAAO,CAAE,MAAOS,EAAe,OAAQC,EAAgB,EACvEI,EAAQ,QAAU,CAAE,MAAOL,EAAe,OAAQC,CAAA,EAClD,MAAMK,EAAgBf,EAAAA,OAAO,EAAK,EAG5BgB,EAAiBhB,EAAAA,OAAO,CAAE,MAAO,EAAG,OAAQ,EAAG,EAE/C,CAAE,KAAAiB,EAAM,KA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GAAGF,EAAQ,OAAA,EAE/B,IAAM,CACPoC,IACFD,EAAO,MAAMC,CAAW,EACxBnC,EAAc,QAAU,GAE5B,CACF,EAAG,CAAC1B,EAAYsB,EAASnB,EAAQC,EAAQE,EAAQC,EAAQC,EAAO2C,EAAMC,EAAaN,EAAQL,EAAQS,EAAiBzC,EAAW+B,EAAiBnC,EAASO,EAAOE,CAAW,CAAC,EAI5KuC,EAAAA,UAAU,IAAM,CACd,MAAMQ,EAAcnD,EAAQ,QACxB,CAACmD,GAAe,CAACnC,EAAc,SAAWN,GAAiB,GAAKC,GAAkB,GAMpFM,EAAe,QAAQ,QAAUP,GACjCO,EAAe,QAAQ,SAAWN,IAIpCM,EAAe,QAAU,CAAE,MAAOP,EAAe,OAAQC,CAAA,EAEpDuC,EAAO,SAASC,EAAa,CAAE,MAAOzC,EAAe,OAAQC,CAAA,CAAgB,EAAE,MAClF,IAAM,CAAC,CAAA,EAEX,EAAG,CAACD,EAAeC,CAAc,CAAC,EAGhCyC,EAAAA,KAAC,MAAA,CAAI,IAAK7C,EAAc,UAAW8C,EAAAA,GAAG,WAAYxC,GAAa,SAAUC,GAAc,QAAQ,EAC7F,SAAA,CAAAwC,EAAAA,IAAC,MAAA,CAAI,IAAKtD,EAAS,MAAO,CAAE,MAAO,OAAQ,OAAQ,MAAA,CAAO,CAAG,EAC5DK,CAAA,EACH,CAEJ"}
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import { jsxs as W, jsx as D } from "react/jsx-runtime";
|
|
2
|
-
import C from "plotly.js-dist";
|
|
3
|
-
import { useRef as b, useMemo as m, useEffect as R } from "react";
|
|
4
|
-
import { useChartTooltip as T } from "../ChartTooltip/ChartTooltip.js";
|
|
5
|
-
import { useElementSize as q } from "../../../hooks/use-element-size.js";
|
|
6
|
-
import { usePlotlyTheme as F } from "../../../hooks/use-plotly-theme.js";
|
|
7
|
-
import { cn as J } from "../../../lib/utils.js";
|
|
8
|
-
import { seriesColor as K } from "../../../utils/colors.js";
|
|
9
|
-
const Q = 60, Z = 30, st = ({
|
|
10
|
-
dataSeries: c,
|
|
11
|
-
width: N,
|
|
12
|
-
height: L,
|
|
13
|
-
xRange: _,
|
|
14
|
-
yRange: u,
|
|
15
|
-
variant: d = "lines",
|
|
16
|
-
xTitle: E,
|
|
17
|
-
yTitle: I,
|
|
18
|
-
title: g,
|
|
19
|
-
xTickText: y
|
|
20
|
-
}) => {
|
|
21
|
-
const a = b(null), r = F(), { bindTooltip: A, tooltipElement: Y } = T({ xLabel: E, yLabel: I }), [j, P] = q(), l = N ?? P.width, s = L ?? P.height, X = l > 0 && s > 0, H = N === void 0, S = L === void 0, w = b({ width: l, height: s });
|
|
22
|
-
w.current = { width: l, height: s };
|
|
23
|
-
const v = b(!1), M = b({ width: 0, height: 0 }), { yMin: O, yMax: U } = m(() => {
|
|
24
|
-
let e = Number.MAX_VALUE, t = Number.MIN_VALUE, i = Number.MAX_VALUE, o = Number.MIN_VALUE;
|
|
25
|
-
c.forEach((f) => {
|
|
26
|
-
f.x.forEach((p) => {
|
|
27
|
-
e = Math.min(e, p), t = Math.max(t, p);
|
|
28
|
-
}), f.y.forEach((p) => {
|
|
29
|
-
i = Math.min(i, p), o = Math.max(o, p);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
const n = (t - e) * 0.1, k = (o - i) * 0.1;
|
|
33
|
-
return {
|
|
34
|
-
xMin: e - n,
|
|
35
|
-
xMax: t + n,
|
|
36
|
-
yMin: i - k,
|
|
37
|
-
yMax: o + k
|
|
38
|
-
};
|
|
39
|
-
}, [c]), h = m(
|
|
40
|
-
() => u || [O, U],
|
|
41
|
-
[u, O, U]
|
|
42
|
-
), V = m(() => {
|
|
43
|
-
const e = h[1] - h[0];
|
|
44
|
-
let t = Math.pow(10, Math.floor(Math.log10(e)));
|
|
45
|
-
e / t > 10 && (t = t * 2), e / t < 4 && (t = t / 2);
|
|
46
|
-
const i = [];
|
|
47
|
-
let o = Math.ceil(h[0] / t) * t;
|
|
48
|
-
for (; o <= h[1]; )
|
|
49
|
-
i.push(o), o += t;
|
|
50
|
-
return i;
|
|
51
|
-
}, [h]), x = m(
|
|
52
|
-
() => [...new Set(c.flatMap((e) => e.x))].sort((e, t) => e - t),
|
|
53
|
-
[c]
|
|
54
|
-
), B = !!y && y.length === x.length, G = m(() => {
|
|
55
|
-
switch (d) {
|
|
56
|
-
case "lines+markers":
|
|
57
|
-
case "lines+markers+error_bars":
|
|
58
|
-
return "lines+markers";
|
|
59
|
-
default:
|
|
60
|
-
return "lines";
|
|
61
|
-
}
|
|
62
|
-
}, [d]), z = m(
|
|
63
|
-
() => ({
|
|
64
|
-
tickcolor: r.tickColor,
|
|
65
|
-
ticklen: 12,
|
|
66
|
-
tickwidth: 1,
|
|
67
|
-
ticks: "outside",
|
|
68
|
-
tickfont: {
|
|
69
|
-
size: 16,
|
|
70
|
-
color: r.textColor,
|
|
71
|
-
family: "Inter, sans-serif",
|
|
72
|
-
weight: 400
|
|
73
|
-
},
|
|
74
|
-
linecolor: r.lineColor,
|
|
75
|
-
linewidth: 1,
|
|
76
|
-
position: 0,
|
|
77
|
-
zeroline: !1
|
|
78
|
-
}),
|
|
79
|
-
[r]
|
|
80
|
-
);
|
|
81
|
-
return R(() => {
|
|
82
|
-
if (!a.current || !X) return;
|
|
83
|
-
const e = c.map((n, k) => {
|
|
84
|
-
const f = K(k, n.color);
|
|
85
|
-
return {
|
|
86
|
-
x: n.x,
|
|
87
|
-
y: n.y,
|
|
88
|
-
type: "scatter",
|
|
89
|
-
mode: G,
|
|
90
|
-
name: n.name,
|
|
91
|
-
hoverinfo: "none",
|
|
92
|
-
line: {
|
|
93
|
-
color: f,
|
|
94
|
-
width: 1.5
|
|
95
|
-
},
|
|
96
|
-
marker: d === "lines" ? { opacity: 0 } : {
|
|
97
|
-
color: f,
|
|
98
|
-
size: 8,
|
|
99
|
-
symbol: n.symbol || "triangle-up"
|
|
100
|
-
},
|
|
101
|
-
error_y: d === "lines+markers+error_bars" ? n.error_y || {
|
|
102
|
-
type: "data",
|
|
103
|
-
array: n.y.map(() => 10),
|
|
104
|
-
visible: !0,
|
|
105
|
-
color: f,
|
|
106
|
-
thickness: 1,
|
|
107
|
-
width: 5
|
|
108
|
-
} : void 0
|
|
109
|
-
};
|
|
110
|
-
}), t = {
|
|
111
|
-
...g ? {
|
|
112
|
-
title: {
|
|
113
|
-
text: g,
|
|
114
|
-
font: {
|
|
115
|
-
size: 32,
|
|
116
|
-
family: "Inter, sans-serif",
|
|
117
|
-
color: r.textColor
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
} : {},
|
|
121
|
-
width: w.current.width,
|
|
122
|
-
height: w.current.height,
|
|
123
|
-
margin: {
|
|
124
|
-
l: 80,
|
|
125
|
-
r: 30,
|
|
126
|
-
// Reserve room for tick labels, the x-axis title, and the
|
|
127
|
-
// container-anchored bottom legend stacked beneath them.
|
|
128
|
-
b: 96,
|
|
129
|
-
t: g ? Q : Z,
|
|
130
|
-
pad: 10
|
|
131
|
-
},
|
|
132
|
-
paper_bgcolor: r.paperBg,
|
|
133
|
-
plot_bgcolor: r.plotBg,
|
|
134
|
-
font: {
|
|
135
|
-
family: "Inter, sans-serif"
|
|
136
|
-
},
|
|
137
|
-
dragmode: !1,
|
|
138
|
-
xaxis: {
|
|
139
|
-
title: {
|
|
140
|
-
text: E,
|
|
141
|
-
font: {
|
|
142
|
-
size: 16,
|
|
143
|
-
color: r.textSecondary,
|
|
144
|
-
family: "Inter, sans-serif",
|
|
145
|
-
weight: 400
|
|
146
|
-
},
|
|
147
|
-
standoff: 32
|
|
148
|
-
},
|
|
149
|
-
gridcolor: r.gridColor,
|
|
150
|
-
range: _,
|
|
151
|
-
autorange: !_,
|
|
152
|
-
tickmode: "array",
|
|
153
|
-
tickvals: x,
|
|
154
|
-
ticktext: B ? y : x.map(String),
|
|
155
|
-
showgrid: !0,
|
|
156
|
-
// Reserve space for tick labels + the axis title so the bottom legend
|
|
157
|
-
// can't overlap them at small sizes (SW-2157).
|
|
158
|
-
automargin: !0,
|
|
159
|
-
...z
|
|
160
|
-
},
|
|
161
|
-
yaxis: {
|
|
162
|
-
title: {
|
|
163
|
-
text: I,
|
|
164
|
-
font: {
|
|
165
|
-
size: 16,
|
|
166
|
-
color: r.textSecondary,
|
|
167
|
-
family: "Inter, sans-serif",
|
|
168
|
-
weight: 400
|
|
169
|
-
},
|
|
170
|
-
standoff: 30
|
|
171
|
-
},
|
|
172
|
-
gridcolor: r.gridColor,
|
|
173
|
-
range: u,
|
|
174
|
-
autorange: !u,
|
|
175
|
-
tickmode: "array",
|
|
176
|
-
tickvals: V,
|
|
177
|
-
showgrid: !0,
|
|
178
|
-
automargin: !0,
|
|
179
|
-
...z
|
|
180
|
-
},
|
|
181
|
-
legend: {
|
|
182
|
-
// Anchor to the bottom of the container (not the plot area) so the
|
|
183
|
-
// legend always clears the x-axis tick labels + title — a paper-relative
|
|
184
|
-
// fractional offset collapses into the ticks at small heights (SW-2157).
|
|
185
|
-
x: 0.5,
|
|
186
|
-
y: 0,
|
|
187
|
-
xanchor: "center",
|
|
188
|
-
yanchor: "bottom",
|
|
189
|
-
yref: "container",
|
|
190
|
-
orientation: "h",
|
|
191
|
-
font: {
|
|
192
|
-
size: 16,
|
|
193
|
-
color: r.legendColor,
|
|
194
|
-
family: "Inter, sans-serif",
|
|
195
|
-
weight: 500
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
showlegend: !0
|
|
199
|
-
}, i = {
|
|
200
|
-
// Sizing is driven from the measured container; disable Plotly's own
|
|
201
|
-
// window-resize responsiveness (it can't see container resizes).
|
|
202
|
-
responsive: !1,
|
|
203
|
-
displayModeBar: !1,
|
|
204
|
-
displaylogo: !1
|
|
205
|
-
};
|
|
206
|
-
C.newPlot(a.current, e, t, i), A(a.current);
|
|
207
|
-
const o = a.current;
|
|
208
|
-
return v.current = !0, M.current = { ...w.current }, () => {
|
|
209
|
-
o && (C.purge(o), v.current = !1);
|
|
210
|
-
};
|
|
211
|
-
}, [c, X, _, u, E, I, g, G, z, x, V, B, y, h, d, r, A]), R(() => {
|
|
212
|
-
const e = a.current;
|
|
213
|
-
!e || !v.current || l <= 0 || s <= 0 || M.current.width === l && M.current.height === s || (M.current = { width: l, height: s }, C.relayout(e, { width: l, height: s }).catch(
|
|
214
|
-
() => {
|
|
215
|
-
}
|
|
216
|
-
));
|
|
217
|
-
}, [l, s]), /* @__PURE__ */ W("div", { ref: j, className: J("relative", H && "w-full", S && "h-full"), children: [
|
|
218
|
-
/* @__PURE__ */ D("div", { ref: a, style: { width: "100%", height: "100%" } }),
|
|
219
|
-
Y
|
|
220
|
-
] });
|
|
221
|
-
};
|
|
222
|
-
export {
|
|
223
|
-
st as LineGraph
|
|
224
|
-
};
|
|
225
|
-
//# sourceMappingURL=LineGraph.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LineGraph.js","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","plotData","index","color","seriesColor","layout","config","Plotly","plotElement","jsxs","cn","jsx"],"mappings":";;;;;;;;AA+KA,MAAMA,IAAmB,IACnBC,IAAsB,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,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;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,IAAgBnB,KAASiB,EAAS,OAClCG,IAAiBnB,KAAUgB,EAAS,QACpCI,IAAUF,IAAgB,KAAKC,IAAiB,GAGhDE,IAAYtB,MAAU,QACtBuB,IAAatB,MAAW,QACxBuB,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,GAE/C,EAAE,MAAAiB,GAAM,MAAAC,EAAA,IAASC,EAAQ,MAAM;AACnC,QAAIC,IAAO,OAAO,WACdC,IAAO,OAAO,WACdC,IAAO,OAAO,WACdC,IAAO,OAAO;AAElB,IAAAlC,EAAW,QAAQ,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P,KACjCO,EAAe,QAAQ,WAAWN,MAIpCM,EAAe,UAAU,EAAE,OAAOP,GAAe,QAAQC,EAAA,GAEpDuC,EAAO,SAASC,GAAa,EAAE,OAAOzC,GAAe,QAAQC,EAAA,CAAgB,EAAE;AAAA,MAClF,MAAM;AAAA,MAAC;AAAA,IAAA;AAAA,EAEX,GAAG,CAACD,GAAeC,CAAc,CAAC,GAGhC,gBAAAyC,EAAC,OAAA,EAAI,KAAK7C,GAAc,WAAW8C,EAAG,YAAYxC,KAAa,UAAUC,KAAc,QAAQ,GAC7F,UAAA;AAAA,IAAA,gBAAAwC,EAAC,OAAA,EAAI,KAAKtD,GAAS,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAA,EAAO,CAAG;AAAA,IAC5DK;AAAA,EAAA,GACH;AAEJ;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),g=require("plotly.js-dist"),s=require("react"),Y=require("../ChartTooltip/ChartTooltip.cjs"),G=require("../../../hooks/use-element-size.cjs"),H=require("../../../hooks/use-plotly-theme.cjs"),O=require("../../../lib/utils.cjs"),W=require("../../../utils/colors.cjs"),D=({dataSeries:x,width:C,height:I,xRange:d,yRange:m,xTitle:v,yTitle:k,title:S="Scatter Plot"})=>{const u=s.useRef(null),r=H.usePlotlyTheme(),{bindTooltip:q,tooltipElement:T}=Y.useChartTooltip({xLabel:v,yLabel:k}),[U,P]=G.useElementSize(),c=C??P.width,a=I??P.height,_=c>0&&a>0,V=C===void 0,B=I===void 0,M=s.useRef({width:c,height:a});M.current={width:c,height:a};const b=s.useRef(!1),w=s.useRef({width:0,height:0}),{xMin:L,xMax:N,yMin:A,yMax:R}=s.useMemo(()=>{let o=Number.MAX_VALUE,e=Number.MIN_VALUE,n=Number.MAX_VALUE,t=Number.MIN_VALUE;x.forEach(l=>{l.x.forEach(i=>{o=Math.min(o,i),e=Math.max(e,i)}),l.y.forEach(i=>{n=Math.min(n,i),t=Math.max(t,i)})});const p=(e-o)*.1,y=(t-n)*.1;return{xMin:o-p,xMax:e+p,yMin:n-y,yMax:t+y}},[x]),h=s.useMemo(()=>d||[L,N],[d,L,N]),f=s.useMemo(()=>m||[A,R],[m,A,R]),E=s.useMemo(()=>{const o=h[1]-h[0];let e=Math.pow(10,Math.floor(Math.log10(o)));o/e>10&&(e=e*2),o/e<4&&(e=e/2);const n=[];let t=Math.ceil(h[0]/e)*e;for(;t<=h[1];)n.push(t),t+=e;return n},[h]),X=s.useMemo(()=>{const o=f[1]-f[0];let e=Math.pow(10,Math.floor(Math.log10(o)));o/e>10&&(e=e*2),o/e<4&&(e=e/2);const n=[];let t=Math.ceil(f[0]/e)*e;for(;t<=f[1];)n.push(t),t+=e;return n},[f]),z=s.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 s.useEffect(()=>{if(!u.current||!_)return;const o=x.map((l,i)=>({x:l.x,y:l.y,type:"scatter",mode:"markers",name:l.name,marker:{color:W.seriesColor(i,l.color),size:10,symbol:"circle"},hoverinfo:"none"})),e={title:{text:S,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:60,pad:10},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:32},gridcolor:r.gridColor,range:d,autorange:!d,tickmode:"array",tickvals:E,ticktext:E.map(String),showgrid:!0,automargin:!0,...z},yaxis:{title:{text:k,font:{size:16,color:r.textSecondary,family:"Inter, sans-serif",weight:400},standoff:30},gridcolor:r.gridColor,range:m,autorange:!m,tickmode:"array",tickvals:X,showgrid:!0,automargin:!0,...z},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,hovermode:"closest"},n={responsive:!1,displayModeBar:!1,displaylogo:!1};g.newPlot(u.current,o,e,n),q(u.current);const t=u.current;b.current=!0,w.current={...M.current};const p=t,y={color:r.spikeColor,width:2};return p.on("plotly_hover",l=>{const i=l.points[0];i&&g.relayout(t,{shapes:[{type:"line",xref:"x",yref:"paper",x0:i.x,x1:i.x,y0:0,y1:1,line:y,layer:"below"},{type:"line",xref:"paper",yref:"y",x0:0,x1:1,y0:i.y,y1:i.y,line:y,layer:"below"}]})}),p.on("plotly_unhover",()=>{g.relayout(t,{shapes:[]})}),()=>{t&&(g.purge(t),b.current=!1)}},[x,_,d,m,v,k,S,h,f,E,X,z,r,q]),s.useEffect(()=>{const o=u.current;!o||!b.current||c<=0||a<=0||w.current.width===c&&w.current.height===a||(w.current={width:c,height:a},g.relayout(o,{width:c,height:a}).catch(()=>{}))},[c,a]),j.jsxs("div",{ref:U,className:O.cn("relative",V&&"w-full",B&&"h-full"),children:[j.jsx("div",{ref:u,style:{width:"100%",height:"100%"}}),T]})};exports.ScatterGraph=D;
|
|
2
|
-
//# sourceMappingURL=ScatterGraph.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterGraph.cjs","sources":["../../../../src/components/charts/ScatterGraph/ScatterGraph.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\ninterface ScatterDataPoint {\n x: number;\n y: number;\n additionalInfo?: Record<string, string | number>;\n}\n\ninterface ScatterDataSeries {\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}\n\ninterface ScatterGraphProps {\n dataSeries: ScatterDataSeries[];\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 xTitle?: string;\n yTitle?: string;\n title?: string;\n}\n\nconst ScatterGraph: React.FC<ScatterGraphProps> = ({\n dataSeries,\n width,\n height,\n xRange,\n yRange,\n xTitle,\n yTitle,\n title = \"Scatter Plot\",\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 { 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: minY - yPadding,\n yMax: maxY + yPadding,\n };\n }, [dataSeries]);\n\n const effectiveXRange = useMemo(\n () => xRange || [xMin, xMax],\n [xRange, xMin, xMax],\n );\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 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 x: series.x,\n y: series.y,\n type: \"scatter\" as const,\n mode: \"markers\" as const,\n name: series.name,\n marker: {\n color: seriesColor(index, series.color),\n size: 10,\n symbol: \"circle\" as const,\n },\n hoverinfo: \"none\" as const,\n }));\n\n const layout = {\n title: {\n text: title,\n font: {\n size: 32,\n family: \"Inter, sans-serif\",\n color: theme.textColor,\n },\n },\n width: sizeRef.current.width,\n height: sizeRef.current.height,\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: 30, b: 96, t: 60, pad: 10 },\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: 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 hovermode: \"closest\" as const,\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 // Crosshair guide lines through the hovered point. Drawn as layout shapes\n // with `layer: \"below\"` so they sit behind the markers — native Plotly\n // spikelines always render on top and can't be moved behind.\n const emitter = plotElement as unknown as Plotly.PlotlyHTMLElement;\n const crosshairLine = { color: theme.spikeColor, width: 2 };\n emitter.on(\"plotly_hover\", (eventData) => {\n const point = eventData.points[0];\n if (!point) return;\n void Plotly.relayout(plotElement, {\n shapes: [\n {\n type: \"line\",\n xref: \"x\",\n yref: \"paper\",\n x0: point.x,\n x1: point.x,\n y0: 0,\n y1: 1,\n line: crosshairLine,\n layer: \"below\",\n },\n {\n type: \"line\",\n xref: \"paper\",\n yref: \"y\",\n x0: 0,\n x1: 1,\n y0: point.y,\n y1: point.y,\n line: crosshairLine,\n layer: \"below\",\n },\n ],\n });\n });\n emitter.on(\"plotly_unhover\", () => {\n void Plotly.relayout(plotElement, { shapes: [] });\n });\n\n return () => {\n if (plotElement) {\n Plotly.purge(plotElement);\n plotInitedRef.current = false;\n }\n };\n }, [dataSeries, hasSize, xRange, yRange, xTitle, yTitle, title, effectiveXRange, effectiveYRange, xTicks, yTicks, tickOptions, theme, bindTooltip]);\n\n // Resize in place when the measured/overridden size changes — cheaper than\n // recreating the plot, and it preserves the hover/crosshair 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 { ScatterGraph };\nexport type { ScatterDataPoint, ScatterDataSeries, ScatterGraphProps };\n"],"names":["ScatterGraph","dataSeries","width","height","xRange","yRange","xTitle","yTitle","title","plotRef","useRef","theme","usePlotlyTheme","bindTooltip","tooltipElement","useChartTooltip","containerRef","measured","useElementSize","resolvedWidth","resolvedHeight","hasSize","fillWidth","fillHeight","sizeRef","plotInitedRef","appliedSizeRef","xMin","xMax","yMin","yMax","useMemo","minX","maxX","minY","maxY","series","x","y","xPadding","yPadding","effectiveXRange","effectiveYRange","xTicks","range","step","ticks","current","yTicks","tickOptions","useEffect","plotData","index","seriesColor","layout","config","Plotly","plotElement","emitter","crosshairLine","eventData","point","jsxs","cn","jsx"],"mappings":"+XA2CMA,EAA4C,CAAC,CACjD,WAAAC,EACA,MAAAC,EACA,OAAAC,EACA,OAAAC,EACA,OAAAC,EACA,OAAAC,EACA,OAAAC,EACA,MAAAC,EAAQ,cACV,IAAM,CACJ,MAAMC,EAAUC,EAAAA,OAAuB,IAAI,EACrCC,EAAQC,EAAAA,eAAA,EACR,CAAE,YAAAC,EAAa,eAAAC,CAAA,EAAmBC,EAAAA,gBAAgB,CAAE,OAAQT,EAAQ,OAAQC,EAAQ,EAIpF,CAACS,EAAcC,CAAQ,EAAIC,iBAAA,EAC3BC,EAAgBjB,GAASe,EAAS,MAClCG,EAAiBjB,GAAUc,EAAS,OACpCI,EAAUF,EAAgB,GAAKC,EAAiB,EAGhDE,EAAYpB,IAAU,OACtBqB,EAAapB,IAAW,OACxBqB,EAAUd,EAAAA,OAAO,CAAE,MAAOS,EAAe,OAAQC,EAAgB,EACvEI,EAAQ,QAAU,CAAE,MAAOL,EAAe,OAAQC,CAAA,E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