nmrium 0.61.1-pre.1740490937 → 0.61.1-pre.1740909008
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/lib/component/1d/FooterBanner.d.ts.map +1 -1
- package/lib/component/1d/FooterBanner.js +8 -5
- package/lib/component/1d/FooterBanner.js.map +1 -1
- package/lib/component/1d/SVGContent1D.js +1 -1
- package/lib/component/1d/SVGContent1D.js.map +1 -1
- package/lib/component/1d/XAxis1D.d.ts +0 -2
- package/lib/component/1d/XAxis1D.d.ts.map +1 -1
- package/lib/component/1d/XAxis1D.js +15 -46
- package/lib/component/1d/XAxis1D.js.map +1 -1
- package/lib/component/1d-2d/components/SVGRootContainer.d.ts +4 -4
- package/lib/component/1d-2d/components/SVGRootContainer.d.ts.map +1 -1
- package/lib/component/1d-2d/components/SVGRootContainer.js +9 -6
- package/lib/component/1d-2d/components/SVGRootContainer.js.map +1 -1
- package/lib/component/2d/XAxis.d.ts +0 -1
- package/lib/component/2d/XAxis.d.ts.map +1 -1
- package/lib/component/2d/XAxis.js +7 -13
- package/lib/component/2d/XAxis.js.map +1 -1
- package/lib/component/2d/YAxis.d.ts +0 -1
- package/lib/component/2d/YAxis.d.ts.map +1 -1
- package/lib/component/2d/YAxis.js +8 -16
- package/lib/component/2d/YAxis.js.map +1 -1
- package/lib/component/2d/utilities/scale.d.ts.map +1 -1
- package/lib/component/2d/utilities/scale.js +3 -2
- package/lib/component/2d/utilities/scale.js.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js +43 -36
- package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
- package/lib/component/elements/ActionButtons.js +1 -1
- package/lib/component/elements/ActionButtons.js.map +1 -1
- package/lib/component/elements/D3Axis.d.ts +20 -0
- package/lib/component/elements/D3Axis.d.ts.map +1 -0
- package/lib/component/elements/D3Axis.js +76 -0
- package/lib/component/elements/D3Axis.js.map +1 -0
- package/lib/component/elements/DraggableDialog.js +1 -1
- package/lib/component/elements/DraggableDialog.js.map +1 -1
- package/lib/component/elements/EditableColumn.js +3 -3
- package/lib/component/elements/EditableColumn.js.map +1 -1
- package/lib/component/elements/Footer.d.ts +5 -0
- package/lib/component/elements/Footer.d.ts.map +1 -1
- package/lib/component/elements/Footer.js +5 -4
- package/lib/component/elements/Footer.js.map +1 -1
- package/lib/component/elements/NumberInput2.d.ts +1 -1
- package/lib/component/elements/NumberInput2.d.ts.map +1 -1
- package/lib/component/elements/NumberInput2.js.map +1 -1
- package/lib/component/elements/Select2.js +1 -1
- package/lib/component/elements/Select2.js.map +1 -1
- package/lib/component/elements/TabTitle.js +1 -1
- package/lib/component/elements/TabTitle.js.map +1 -1
- package/lib/component/elements/dropDownButton/DropDownButton.js +2 -2
- package/lib/component/elements/dropDownButton/DropDownButton.js.map +1 -1
- package/lib/component/elements/export/ExportContent.d.ts +1 -1
- package/lib/component/elements/export/ExportContent.d.ts.map +1 -1
- package/lib/component/elements/export/ExportContent.js +9 -9
- package/lib/component/elements/export/ExportContent.js.map +1 -1
- package/lib/component/elements/export/ExportManager.d.ts.map +1 -1
- package/lib/component/elements/export/ExportManager.js +4 -6
- package/lib/component/elements/export/ExportManager.js.map +1 -1
- package/lib/component/elements/export/ExportOptionsModal.js +1 -1
- package/lib/component/elements/export/ExportOptionsModal.js.map +1 -1
- package/lib/component/elements/export/ExportSettingsProvider.d.ts +3 -1
- package/lib/component/elements/export/ExportSettingsProvider.d.ts.map +1 -1
- package/lib/component/elements/export/ExportSettingsProvider.js +4 -2
- package/lib/component/elements/export/ExportSettingsProvider.js.map +1 -1
- package/lib/component/elements/export/utilities/exportOptionValidationSchema.d.ts +2 -2
- package/lib/component/header/SimpleBaseLineCorrectionOptionsPanel.js +1 -1
- package/lib/component/header/SimpleBaseLineCorrectionOptionsPanel.js.map +1 -1
- package/lib/component/header/SimplePhaseCorrectionOptionsPanel.js +1 -1
- package/lib/component/header/SimplePhaseCorrectionOptionsPanel.js.map +1 -1
- package/lib/component/header/SimplePhaseCorrectionTwoDimensionsPanel.js +1 -1
- package/lib/component/header/SimplePhaseCorrectionTwoDimensionsPanel.js.map +1 -1
- package/lib/component/hooks/useExport.d.ts +3 -7
- package/lib/component/hooks/useExport.d.ts.map +1 -1
- package/lib/component/hooks/useExport.js +3 -6
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/hooks/useSaveSettings.js +1 -1
- package/lib/component/hooks/useSaveSettings.js.map +1 -1
- package/lib/component/main/NMRiumViewer.d.ts.map +1 -1
- package/lib/component/main/NMRiumViewer.js +5 -2
- package/lib/component/main/NMRiumViewer.js.map +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js.map +1 -1
- package/lib/component/modal/editRange/forms/components/InfoBlock.js +1 -1
- package/lib/component/modal/editRange/forms/components/InfoBlock.js.map +1 -1
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js +1 -1
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js.map +1 -1
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +3 -3
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js.map +1 -1
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +1 -1
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js.map +1 -1
- package/lib/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib/component/modal/editZone/EditZoneModal.js.map +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js.map +1 -1
- package/lib/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib/component/modal/setting/WorkspaceItem.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +2 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/ExportTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ExportTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.js +2 -2
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js +2 -2
- package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/SpectraColorsTabContent.js +2 -2
- package/lib/component/modal/setting/settings-tabs/SpectraColorsTabContent.js.map +1 -1
- package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
- package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js.map +1 -1
- package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +2 -2
- package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js.map +1 -1
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.d.ts.map +1 -1
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js.map +1 -1
- package/lib/component/panels/PanelsBar.js +1 -1
- package/lib/component/panels/PanelsBar.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js +2 -2
- package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js.map +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +2 -2
- package/lib/component/panels/databasePanel/DatabaseTable.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/BaseLineCorrectionOptionsPanel.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/BaseLineCorrectionOptionsPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/FilterActionButtons.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/FilterActionButtons.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/PhaseCorrectionOptionsPanel.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/PhaseCorrectionOptionsPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/PhaseCorrectionTwoDimensionsOptionsPanel.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/PhaseCorrectionTwoDimensionsOptionsPanel.js.map +1 -1
- package/lib/component/panels/informationPanel/InformationEditionModal.js +3 -3
- package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/AnalysisChart.js +1 -1
- package/lib/component/panels/multipleAnalysisPanel/AnalysisChart.js.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/base/AnalysisColumnHeader.js +1 -1
- package/lib/component/panels/multipleAnalysisPanel/base/AnalysisColumnHeader.js.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.js +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.js.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.js +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.js.map +1 -1
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js.map +1 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js.map +1 -1
- package/lib/component/utility/export.d.ts +6 -6
- package/lib/component/utility/export.d.ts.map +1 -1
- package/lib/component/utility/export.js +23 -18
- package/lib/component/utility/export.js.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +10 -10
- package/src/component/1d/FooterBanner.tsx +17 -13
- package/src/component/1d/SVGContent1D.tsx +1 -1
- package/src/component/1d/XAxis1D.tsx +31 -78
- package/src/component/1d-2d/components/SVGRootContainer.tsx +29 -9
- package/src/component/2d/XAxis.tsx +22 -28
- package/src/component/2d/YAxis.tsx +17 -26
- package/src/component/2d/utilities/scale.ts +9 -2
- package/src/component/EventsTrackers/BrushTracker.tsx +51 -43
- package/src/component/elements/ActionButtons.tsx +1 -1
- package/src/component/elements/D3Axis.tsx +219 -0
- package/src/component/elements/DraggableDialog.tsx +1 -1
- package/src/component/elements/EditableColumn.tsx +3 -3
- package/src/component/elements/Footer.tsx +21 -4
- package/src/component/elements/NumberInput2.tsx +4 -1
- package/src/component/elements/Select2.tsx +1 -1
- package/src/component/elements/TabTitle.tsx +1 -1
- package/src/component/elements/dropDownButton/DropDownButton.tsx +2 -2
- package/src/component/elements/export/ExportContent.tsx +16 -10
- package/src/component/elements/export/ExportManager.tsx +4 -7
- package/src/component/elements/export/ExportOptionsModal.tsx +1 -1
- package/src/component/elements/export/ExportSettingsProvider.tsx +8 -5
- package/src/component/header/SimpleBaseLineCorrectionOptionsPanel.tsx +1 -1
- package/src/component/header/SimplePhaseCorrectionOptionsPanel.tsx +1 -1
- package/src/component/header/SimplePhaseCorrectionTwoDimensionsPanel.tsx +1 -1
- package/src/component/hooks/useExport.tsx +3 -20
- package/src/component/hooks/useSaveSettings.tsx +1 -1
- package/src/component/main/NMRiumViewer.tsx +10 -2
- package/src/component/modal/editRange/EditRangeModal.tsx +1 -1
- package/src/component/modal/editRange/forms/components/InfoBlock.tsx +1 -1
- package/src/component/modal/editRange/forms/components/NewSignalTab.tsx +1 -1
- package/src/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.tsx +4 -4
- package/src/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.tsx +2 -2
- package/src/component/modal/editZone/EditZoneModal.tsx +1 -1
- package/src/component/modal/setting/GeneralSettings.tsx +3 -3
- package/src/component/modal/setting/WorkspaceItem.tsx +3 -3
- package/src/component/modal/setting/settings-tabs/DatabasesTabContent.tsx +10 -10
- package/src/component/modal/setting/settings-tabs/ExportTabContent.tsx +1 -1
- package/src/component/modal/setting/settings-tabs/ExternalAPIsTabContent.tsx +6 -6
- package/src/component/modal/setting/settings-tabs/InfoBlockTabContent.tsx +6 -6
- package/src/component/modal/setting/settings-tabs/NucleiTabContent.tsx +6 -6
- package/src/component/modal/setting/settings-tabs/SpectraColorsTabContent.tsx +6 -6
- package/src/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.tsx +2 -2
- package/src/component/panels/MatrixGenerationPanel/FiltersOptions.tsx +5 -5
- package/src/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.tsx +2 -2
- package/src/component/panels/PanelsBar.tsx +1 -1
- package/src/component/panels/RangesPanel/TableColumns/ActionsColumn.tsx +1 -1
- package/src/component/panels/SpectraPanel/base/SpectraColumnsManager.tsx +5 -5
- package/src/component/panels/ZonesPanel/TableColumns/ActionsColumn.tsx +1 -1
- package/src/component/panels/databasePanel/DatabaseTable.tsx +4 -4
- package/src/component/panels/filtersPanel/Filters/BaseLineCorrectionOptionsPanel.tsx +2 -2
- package/src/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.tsx +2 -2
- package/src/component/panels/filtersPanel/Filters/FilterActionButtons.tsx +4 -4
- package/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx +2 -2
- package/src/component/panels/filtersPanel/Filters/PhaseCorrectionOptionsPanel.tsx +2 -2
- package/src/component/panels/filtersPanel/Filters/PhaseCorrectionTwoDimensionsOptionsPanel.tsx +2 -2
- package/src/component/panels/informationPanel/InformationEditionModal.tsx +6 -6
- package/src/component/panels/multipleAnalysisPanel/AnalysisChart.tsx +8 -1
- package/src/component/panels/multipleAnalysisPanel/base/AnalysisColumnHeader.tsx +1 -1
- package/src/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.tsx +4 -4
- package/src/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.tsx +4 -4
- package/src/component/panels/predictionPanel/PredictionSimpleOptions.tsx +2 -2
- package/src/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.tsx +3 -3
- package/src/component/utility/export.ts +36 -44
- package/src/versionInfo.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterBanner.d.ts","sourceRoot":"","sources":["../../../src/component/1d/FooterBanner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FooterBanner.d.ts","sourceRoot":"","sources":["../../../src/component/1d/FooterBanner.tsx"],"names":[],"mappings":"AAiLA,MAAM,CAAC,OAAO,UAAU,YAAY,4CAgBnC"}
|
|
@@ -17,11 +17,14 @@ import { useInsetOptions } from './inset/InsetProvider.js';
|
|
|
17
17
|
const FlexInfoItem = styled(InfoItem) `
|
|
18
18
|
align-items: center;
|
|
19
19
|
`;
|
|
20
|
+
const InfoBlock = styled(InfoItem) `
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
`;
|
|
20
23
|
const Separator = styled.div `
|
|
21
24
|
border-left: 2px solid gray;
|
|
22
|
-
margin: 0
|
|
25
|
+
margin: 0 10px;
|
|
23
26
|
width: 1px;
|
|
24
|
-
height:
|
|
27
|
+
height: 10px;
|
|
25
28
|
`;
|
|
26
29
|
function FooterBannerInner({ margin, width, height, activeSpectrum, spectrum, activeTab, }) {
|
|
27
30
|
const position = useMouseTracker();
|
|
@@ -55,9 +58,9 @@ function FooterBannerInner({ margin, width, height, activeSpectrum, spectrum, ac
|
|
|
55
58
|
return 1;
|
|
56
59
|
}
|
|
57
60
|
const isBrushing = step === 'brushing' && mouseButton === 'main';
|
|
58
|
-
return (_jsxs(FooterContainer, { children: [_jsx(BsCursor, {}), _jsxs(
|
|
59
|
-
spectrum?.info?.originFrequency).toPrecision(5) })] })), isBrushing && (_jsxs(
|
|
60
|
-
100).toFixed(2), "%"] })] }))] })), activeSpectrum && (_jsxs(FlexInfoItem, { children: [_jsx(Separator, {}), _jsx(IoPulseSharp, {}), _jsxs(
|
|
61
|
+
return (_jsxs(FooterContainer, { children: [_jsx(BsCursor, {}), _jsxs(InfoBlock, { children: [_jsx(InfoItem.Label, { children: " \uD835\uDEC5: " }), _jsx(InfoItem.Value, { children: format(scaleX().invert(position.x)) }), _jsx(InfoItem.Unit, { children: "ppm" }), activeSpectrum && spectrum?.info?.originFrequency && (_jsxs(_Fragment, { children: [_jsxs(InfoItem.Value, { children: ["\u00A0(", format(scaleX().invert(position.x) * spectrum?.info?.originFrequency, 'hz')] }), _jsx(InfoItem.Unit, { children: "Hz" }), _jsx(InfoItem.Value, { children: ") " }), _jsxs(InfoItem, { children: [_jsx("span", { children: "," }), _jsx(InfoItem.Label, { children: " Index: " }), _jsx(InfoItem.Value, { children: getXIndex(position.x) })] })] }))] }), isBrushing && (_jsxs(FlexInfoItem, { autoHide: true, display: "flex", children: [_jsx(InfoItem.Label, { children: " \u0394ppm: " }), _jsx(InfoItem.Value, { children: (scaleX().invert(startX) - scaleX().invert(endX)).toPrecision(6) })] })), activeSpectrum && (_jsxs(FlexInfoItem, { autoHide: true, display: "flex", hideThreshold: 750, children: [spectrum?.info?.originFrequency && isBrushing && (_jsxs(InfoBlock, { children: [_jsx(InfoItem.Label, { children: " \u0394Hz: " }), _jsx(InfoItem.Value, { children: ((scaleX().invert(startX) - scaleX().invert(endX)) *
|
|
62
|
+
spectrum?.info?.originFrequency).toPrecision(5) })] })), isBrushing && (_jsxs(InfoBlock, { children: [_jsx(InfoItem.Label, { children: " ratio :" }), _jsxs(InfoItem.Value, { children: [((getYValue(startX) / (getYValue(endX) || Number.MIN_VALUE)) *
|
|
63
|
+
100).toFixed(2), "%"] })] }))] })), activeSpectrum && (_jsxs(FlexInfoItem, { display: "flex", autoHide: true, hideThreshold: 550, children: [_jsx(Separator, {}), _jsx(IoPulseSharp, {}), _jsxs(InfoBlock, { children: [_jsx(InfoItem.Label, { children: "Intensity: " }), _jsx(InfoItem.Value, { style: { minWidth: 80 }, children: format(getYValue(position.x)) })] })] }))] }));
|
|
61
64
|
}
|
|
62
65
|
const MemoizedFooterBanner = memo(FooterBannerInner);
|
|
63
66
|
export default function FooterBanner() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterBanner.js","sourceRoot":"","sources":["../../../src/component/1d/FooterBanner.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,WAAW,MAAM,yB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,CAAC,CAAC,GACf,IACP,IACC,CAChB,IACe,CACnB,CAAC;AACJ,CAAC;AAED,MAAM,oBAAoB,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAErD,MAAM,CAAC,OAAO,UAAU,YAAY;IAClC,MAAM,EACJ,MAAM,EACN,KAAK,EACL,MAAM,EACN,IAAI,EAAE,EACJ,OAAO,EAAE,EAAE,SAAS,EAAE,GACvB,GACF,GAAG,YAAY,EAAE,CAAC;IACnB,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAC3C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAe,CAAC;IACjD,OAAO,CACL,KAAC,oBAAoB,IACb,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,GAChE,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -20,6 +20,6 @@ import Ranges from './ranges/Ranges.js';
|
|
|
20
20
|
import RangesIntegrals from './ranges/RangesIntegrals.js';
|
|
21
21
|
import BaseLineZones from './tool/BaseLineZones.js';
|
|
22
22
|
export function SVGContent1D() {
|
|
23
|
-
return (_jsxs("g", { children: [_jsxs(ClipPathContainer, { children: [_jsx(LinesSeries, {}), _jsx(ApodizationLine, {}), _jsx(IntegralsSeries, {}), _jsx(Peaks, { peaksSource: "peaks" }), _jsx(RangesIntegrals, {}), _jsx(Ranges, {}), _jsx(Peaks, { peaksSource: "ranges" }), _jsx(MultiplicityTrees, {}), _jsx(JGraph, {}), _jsx(MultiAnalysisRanges, {}), _jsx(BaseLineZones, {}), _jsx(ExclusionZonesAnnotations, {}), _jsx(DatabaseElements, {}), _jsx(PeaksShapes, {}), _jsx(Stocsy, {}), _jsx(Boxplot, {}), _jsx(SpectraTracker, {}), _jsx(SpectrumInfoBlock, {}), _jsx(SimilarityTree, {})] }), _jsx("g", { className: "container", style: { pointerEvents: 'none' }, children: _jsx(XAxis1D, {
|
|
23
|
+
return (_jsxs("g", { children: [_jsxs(ClipPathContainer, { children: [_jsx(LinesSeries, {}), _jsx(ApodizationLine, {}), _jsx(IntegralsSeries, {}), _jsx(Peaks, { peaksSource: "peaks" }), _jsx(RangesIntegrals, {}), _jsx(Ranges, {}), _jsx(Peaks, { peaksSource: "ranges" }), _jsx(MultiplicityTrees, {}), _jsx(JGraph, {}), _jsx(MultiAnalysisRanges, {}), _jsx(BaseLineZones, {}), _jsx(ExclusionZonesAnnotations, {}), _jsx(DatabaseElements, {}), _jsx(PeaksShapes, {}), _jsx(Stocsy, {}), _jsx(Boxplot, {}), _jsx(SpectraTracker, {}), _jsx(SpectrumInfoBlock, {}), _jsx(SimilarityTree, {})] }), _jsx("g", { className: "container", style: { pointerEvents: 'none' }, children: _jsx(XAxis1D, {}) })] }));
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=SVGContent1D.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SVGContent1D.js","sourceRoot":"","sources":["../../../src/component/1d/SVGContent1D.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,iBAAiB,MAAM,0CAA0C,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,yBAAyB,MAAM,gCAAgC,CAAC;AACvE,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,mBAAmB,M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EAEpB,YAAG,SAAS,EAAC,WAAW,EAAC,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,YACvD,KAAC,OAAO,KAAG,GACT,IACF,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XAxis1D.d.ts","sourceRoot":"","sources":["../../../src/component/1d/XAxis1D.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"XAxis1D.d.ts","sourceRoot":"","sources":["../../../src/component/1d/XAxis1D.tsx"],"names":[],"mappings":"AAUA,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,UAAU,kDAuCxC"}
|
|
@@ -1,55 +1,24 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useEffect, useRef } from 'react';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useRef } from 'react';
|
|
3
|
+
import { useLinearPrimaryTicks } from 'react-d3-utils';
|
|
5
4
|
import { useChartData } from '../context/ChartContext.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useScaleChecked } from '../context/ScaleContext.js';
|
|
6
|
+
import { D3Axis } from '../elements/D3Axis.js';
|
|
7
|
+
import { useCheckExportStatus } from '../hooks/useViewportSize.js';
|
|
8
8
|
import { useInsetOptions } from './inset/InsetProvider.js';
|
|
9
|
-
const GridGroup = styled.g `
|
|
10
|
-
user-select: none;
|
|
11
|
-
|
|
12
|
-
line {
|
|
13
|
-
stroke: rgb(104 104 104);
|
|
14
|
-
stroke-opacity: 0.2;
|
|
15
|
-
shape-rendering: crispedges;
|
|
16
|
-
stroke-dasharray: 3;
|
|
17
|
-
stroke-width: 1;
|
|
18
|
-
user-select: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
path {
|
|
22
|
-
stroke-width: 0;
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
25
9
|
export function XAxis1D(props) {
|
|
26
|
-
const {
|
|
27
|
-
const {
|
|
28
|
-
const { scaleX } =
|
|
10
|
+
const { label: labelProp } = props;
|
|
11
|
+
const { height, width, margin, mode } = useChartData();
|
|
12
|
+
const { scaleX } = useScaleChecked();
|
|
29
13
|
const isInset = useInsetOptions();
|
|
30
|
-
const
|
|
31
|
-
const refGrid = useRef(null);
|
|
14
|
+
const isExportingProcessStart = useCheckExportStatus();
|
|
32
15
|
const label = labelProp || (mode === 'RTL' ? 'δ [ppm]' : 'time [s]');
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.axisBottom(scaleX().domain(xDomain))
|
|
38
|
-
.ticks(8)
|
|
39
|
-
.tickFormat(d3.format('0'));
|
|
40
|
-
const grid = d3
|
|
41
|
-
.axisBottom(scaleX().domain(xDomain))
|
|
42
|
-
.ticks(50)
|
|
43
|
-
.tickSize(-(height - margin.top - margin.bottom))
|
|
44
|
-
.tickFormat(() => '');
|
|
45
|
-
// @ts-expect-error This line of code is actually well typed ...
|
|
46
|
-
d3.select(refAxis.current).call(xAxis);
|
|
47
|
-
// @ts-expect-error This line of code is actually well typed ...
|
|
48
|
-
d3.select(refGrid.current).call(grid);
|
|
49
|
-
}, [height, margin.bottom, margin.top, scaleX, show, xDomain]);
|
|
50
|
-
if (!width || !height || !scaleX) {
|
|
16
|
+
const refAxis = useRef(null);
|
|
17
|
+
const scale = useMemo(() => scaleX(null), [scaleX]);
|
|
18
|
+
const { ticks, scale: ticksScale } = useLinearPrimaryTicks(scale, 'horizontal', refAxis);
|
|
19
|
+
if (!width || !height) {
|
|
51
20
|
return null;
|
|
52
21
|
}
|
|
53
|
-
return (
|
|
22
|
+
return (_jsx(D3Axis, { ref: refAxis, transform: `translate(0,${height - margin.bottom})`, scale: ticksScale, axisPosition: "bottom", gridSize: height - margin.top - margin.bottom, ticks: ticks, showGrid: !isExportingProcessStart, children: !isInset && (_jsx("text", { fill: "#000", x: width - 10, y: "30", dy: "0.70em", textAnchor: "end", children: label })) }));
|
|
54
23
|
}
|
|
55
24
|
//# sourceMappingURL=XAxis1D.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XAxis1D.js","sourceRoot":"","sources":["../../../src/component/1d/XAxis1D.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"XAxis1D.js","sourceRoot":"","sources":["../../../src/component/1d/XAxis1D.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAM3D,MAAM,UAAU,OAAO,CAAC,KAAiB;IACvC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACnC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,EAAE,CAAC;IACvD,MAAM,EAAE,MAAM,EAAE,GAAG,eAAe,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,eAAe,EAAE,CAAC;IAClC,MAAM,uBAAuB,GAAG,oBAAoB,EAAE,CAAC;IAEvD,MAAM,KAAK,GAAG,SAAS,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAErE,MAAM,OAAO,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAE1C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACpD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,qBAAqB,CACxD,KAAK,EACL,YAAY,EACZ,OAAO,CACR,CAAC;IAEF,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAC,MAAM,IACL,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,eAAe,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,EACnD,KAAK,EAAE,UAAU,EACjB,YAAY,EAAC,QAAQ,EACrB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,EAC7C,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,uBAAuB,YAEjC,CAAC,OAAO,IAAI,CACX,eAAM,IAAI,EAAC,MAAM,EAAC,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,QAAQ,EAAC,UAAU,EAAC,KAAK,YACjE,KAAK,GACD,CACR,GACM,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
interface SVGRootContainerProps {
|
|
1
|
+
import type { ReactNode, SVGAttributes } from 'react';
|
|
2
|
+
interface SVGRootContainerProps extends SVGAttributes<SVGSVGElement> {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
enableBoxBorder?: boolean;
|
|
5
5
|
id?: string;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
8
|
}
|
|
9
9
|
export declare function SVGRootContainer(props: SVGRootContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SVGRootContainer.d.ts","sourceRoot":"","sources":["../../../../src/component/1d-2d/components/SVGRootContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SVGRootContainer.d.ts","sourceRoot":"","sources":["../../../../src/component/1d-2d/components/SVGRootContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAMtD,UAAU,qBAAsB,SAAQ,aAAa,CAAC,aAAa,CAAC;IAClE,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CA0E5D"}
|
|
@@ -3,14 +3,17 @@ import { useInsetOptions } from '../../1d/inset/InsetProvider.js';
|
|
|
3
3
|
import { useChartData } from '../../context/ChartContext.js';
|
|
4
4
|
import { usePreferences } from '../../context/PreferencesContext.js';
|
|
5
5
|
export function SVGRootContainer(props) {
|
|
6
|
-
const { children, enableBoxBorder = false, id = 'nmrSVG', x, y } = props;
|
|
6
|
+
const { children, enableBoxBorder = false, id = 'nmrSVG', x, y, width: externalWidth, height: externalHeight, viewBox: externalViewBox, ...otherProps } = props;
|
|
7
7
|
const { current: { general: { spectraRendering }, }, } = usePreferences();
|
|
8
|
-
const { width, height, margin, displayerKey } = useChartData();
|
|
8
|
+
const { width: baseWidth, height: baseHeight, margin, displayerKey, } = useChartData();
|
|
9
9
|
const { id: insetKey = 'primary' } = useInsetOptions() || {};
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
const width = externalWidth ?? baseWidth;
|
|
11
|
+
const height = externalHeight ?? baseHeight;
|
|
12
|
+
const innerWidth = baseWidth - margin.left - margin.right;
|
|
13
|
+
const innerHeight = baseHeight - margin.top - margin.bottom;
|
|
14
|
+
const viewBox = externalViewBox ?? `0 0 ${width} ${height}`;
|
|
15
|
+
return (_jsxs("svg", { id: id, x: x, y: y, width: width, height: height, viewBox: viewBox, fontFamily: "Arial, Helvetica, sans-serif", shapeRendering: spectraRendering, style: {
|
|
13
16
|
position: 'absolute',
|
|
14
|
-
}, children: [_jsx("defs", { children: _jsx("clipPath", { id: `${displayerKey}clip-chart-${insetKey}`, children: _jsx("rect", { width: innerWidth, height: innerHeight, x: margin.left, y: margin.top }) }) }), enableBoxBorder && (_jsx("rect", { width: innerWidth, height: innerHeight, x: margin.left, y: margin.top, stroke: "black", strokeWidth: "1", fill: "transparent" })), children] }));
|
|
17
|
+
}, ...otherProps, children: [_jsx("defs", { children: _jsx("clipPath", { id: `${displayerKey}clip-chart-${insetKey}`, children: _jsx("rect", { width: innerWidth, height: innerHeight, x: margin.left, y: margin.top }) }) }), enableBoxBorder && (_jsx("rect", { width: innerWidth, height: innerHeight, x: margin.left, y: margin.top, stroke: "black", strokeWidth: "1", fill: "transparent" })), children] }));
|
|
15
18
|
}
|
|
16
19
|
//# sourceMappingURL=SVGRootContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SVGRootContainer.js","sourceRoot":"","sources":["../../../../src/component/1d-2d/components/SVGRootContainer.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAUrE,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IAC3D,MAAM,
|
|
1
|
+
{"version":3,"file":"SVGRootContainer.js","sourceRoot":"","sources":["../../../../src/component/1d-2d/components/SVGRootContainer.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B,UAAU,EAAC,8BAA8B,EACzC,cAAc,EAAE,gBAAgB,EAChC,KAAK,EAAE;YACL,QAAQ,EAAE,UAAU;SACrB,KACG,UAAU,aAEd,yBACE,mBAAU,EAAE,EAAE,GAAG,YAAY,cAAc,QAAQ,EAAE,YACnD,eACE,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,WAAW,EACnB,CAAC,EAAE,MAAM,CAAC,IAAI,EACd,CAAC,EAAE,MAAM,CAAC,GAAG,GACb,GACO,GACN,EAEN,eAAe,IAAI,CAClB,eACE,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,WAAW,EACnB,CAAC,EAAE,MAAM,CAAC,IAAI,EACd,CAAC,EAAE,MAAM,CAAC,GAAG,EACb,MAAM,EAAC,OAAO,EACd,WAAW,EAAC,GAAG,EACf,IAAI,EAAC,aAAa,GAClB,CACH,EAEA,QAAQ,IACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XAxis.d.ts","sourceRoot":"","sources":["../../../src/component/2d/XAxis.tsx"],"names":[],"mappings":"AAYA,UAAU,UAAU;IAClB,
|
|
1
|
+
{"version":3,"file":"XAxis.d.ts","sourceRoot":"","sources":["../../../src/component/2d/XAxis.tsx"],"names":[],"mappings":"AAYA,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,iBAAS,KAAK,CAAC,KAAK,EAAE,UAAU,kDAkC/B;;AAED,wBAA2B"}
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useRef } from 'react';
|
|
3
|
+
import { useLinearPrimaryTicks } from 'react-d3-utils';
|
|
4
4
|
import { useChartData } from '../context/ChartContext.js';
|
|
5
|
-
import {
|
|
5
|
+
import { D3Axis } from '../elements/D3Axis.js';
|
|
6
6
|
import useSpectrum from '../hooks/useSpectrum.js';
|
|
7
7
|
import { useScale2DX } from './utilities/scale.js';
|
|
8
8
|
const defaultMargin = { right: 100, top: 0, left: 0, bottom: 0 };
|
|
9
9
|
function XAxis(props) {
|
|
10
|
-
const {
|
|
10
|
+
const { margin: marginProps = defaultMargin } = props;
|
|
11
11
|
const { height, width, margin } = useChartData();
|
|
12
12
|
const spectrum = useSpectrum();
|
|
13
13
|
const scaleX = useScale2DX();
|
|
14
14
|
const refAxis = useRef(null);
|
|
15
|
-
|
|
16
|
-
if (!show)
|
|
17
|
-
return;
|
|
18
|
-
const xAxis = d3.axisBottom(scaleX).ticks(8).tickFormat(d3.format('0'));
|
|
19
|
-
// @ts-expect-error actually well typed
|
|
20
|
-
d3.select(refAxis.current).call(xAxis);
|
|
21
|
-
}, [height, margin, scaleX, show, spectrum, width]);
|
|
15
|
+
const { ticks, scale: ticksScale } = useLinearPrimaryTicks(scaleX, 'horizontal', refAxis);
|
|
22
16
|
if (!width || !height) {
|
|
23
17
|
return null;
|
|
24
18
|
}
|
|
25
|
-
return (_jsx(
|
|
19
|
+
return (_jsx(D3Axis, { ref: refAxis, transform: `translate(0,${height - (margin.bottom + marginProps.bottom)})`, scale: ticksScale, axisPosition: "bottom", ticks: ticks, children: _jsx("text", { fill: "#000", x: width - 60, y: "20", dy: "0.71em", textAnchor: "end", children: spectrum?.info?.isFid ? 'Time [sec]' : 'δ [ppm]' }) }));
|
|
26
20
|
}
|
|
27
21
|
export default memo(XAxis);
|
|
28
22
|
//# sourceMappingURL=XAxis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XAxis.js","sourceRoot":"","sources":["../../../src/component/2d/XAxis.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"XAxis.js","sourceRoot":"","sources":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EZ,eAAM,IAAI,EAAC,MAAM,EAAC,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,QAAQ,EAAC,UAAU,EAAC,KAAK,YACjE,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,GAC5C,GACA,CACV,CAAC;AACJ,CAAC;AAED,eAAe,IAAI,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YAxis.d.ts","sourceRoot":"","sources":["../../../src/component/2d/YAxis.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"YAxis.d.ts","sourceRoot":"","sources":["../../../src/component/2d/YAxis.tsx"],"names":[],"mappings":"AAUA,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,iBAAS,KAAK,CAAC,KAAK,EAAE,UAAU,kDAsC/B;;AAED,wBAA2B"}
|
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { memo, useRef } from 'react';
|
|
3
|
+
import { useLinearPrimaryTicks } from 'react-d3-utils';
|
|
4
4
|
import { useChartData } from '../context/ChartContext.js';
|
|
5
|
-
import {
|
|
6
|
-
import useSpectrum from '../hooks/useSpectrum.js';
|
|
5
|
+
import { D3Axis } from '../elements/D3Axis.js';
|
|
7
6
|
import { useScale2DY } from './utilities/scale.js';
|
|
8
7
|
const defaultMargin = { right: 50, top: 0, bottom: 0, left: 0 };
|
|
9
8
|
function YAxis(props) {
|
|
10
|
-
const {
|
|
11
|
-
const
|
|
12
|
-
const { yDomain, width, height } = useChartData();
|
|
9
|
+
const { label = '', margin: marginProps = defaultMargin } = props;
|
|
10
|
+
const { width, height } = useChartData();
|
|
13
11
|
const scaleY = useScale2DY();
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
if (!show || !yDomain)
|
|
17
|
-
return;
|
|
18
|
-
const axis = d3.axisRight(scaleY).ticks(8).tickFormat(d3.format('0'));
|
|
19
|
-
// @ts-expect-error well typed
|
|
20
|
-
d3.select(refAxis.current).call(axis);
|
|
21
|
-
}, [spectrum, yDomain, show, scaleY]);
|
|
12
|
+
const refAxis = useRef(null);
|
|
13
|
+
const { ticks, scale: ticksScale } = useLinearPrimaryTicks(scaleY, 'vertical', refAxis);
|
|
22
14
|
if (!width || !height) {
|
|
23
15
|
return null;
|
|
24
16
|
}
|
|
25
|
-
return (_jsx(
|
|
17
|
+
return (_jsx(D3Axis, { ref: refAxis, transform: `translate(${width - marginProps.right})`, scale: ticksScale, axisPosition: "right", ticks: ticks, children: _jsx("text", { fill: "#000", x: -marginProps.top, y: -(marginProps.right - 5), dy: "0.71em", transform: "rotate(-90)", textAnchor: "end", children: label }) }));
|
|
26
18
|
}
|
|
27
19
|
export default memo(YAxis);
|
|
28
20
|
//# sourceMappingURL=YAxis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YAxis.js","sourceRoot":"","sources":["../../../src/component/2d/YAxis.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"YAxis.js","sourceRoot":"","sources":["../../../src/component/2d/YAxis.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE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ities/scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../../src/component/2d/utilities/scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAKhD,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED,iBAAS,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,OAAO,yDAO/D;AAED,iBAAS,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,yDAMrC;AAED,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,iBAAS,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,UAAQ,yDAQ7D;AAED,iBAAS,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,yDAMrC;AAED,UAAU,SAAS;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,UAAU,UAAU;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,EAAE,MAAM,EAAE,MAAM,qEAmBjE;AAED,iBAAS,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAK,yDAElE;AAED,iBAAS,gBAAgB,CACvB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,yDAIvB;AAED,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAeD,iBAAS,cAAc,CACrB,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,gBAAgB,EACtB,OAAO,GAAE,kBAAuB,yDASjC;AAED,OAAO,EACL,WAAW,EACX,cAAc,EACd,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,gBAAgB,GACjB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { scaleLinear } from 'd3';
|
|
2
|
+
import { useMemo } from 'react';
|
|
2
3
|
import { useChartData } from '../../context/ChartContext.js';
|
|
3
4
|
import { LAYOUT } from './DimensionLayout.js';
|
|
4
5
|
function get2DXScale(options, reverse) {
|
|
@@ -11,7 +12,7 @@ function get2DXScale(options, reverse) {
|
|
|
11
12
|
}
|
|
12
13
|
function useScale2DX(reverse) {
|
|
13
14
|
const { width, margin, xDomain, mode } = useChartData();
|
|
14
|
-
return get2DXScale({ width, margin, xDomain, mode }, reverse);
|
|
15
|
+
return useMemo(() => get2DXScale({ width, margin, xDomain, mode }, reverse), [margin, mode, reverse, width, xDomain]);
|
|
15
16
|
}
|
|
16
17
|
function get2DYScale(options, reverse = false) {
|
|
17
18
|
const { height, margin, yDomain } = options;
|
|
@@ -21,7 +22,7 @@ function get2DYScale(options, reverse = false) {
|
|
|
21
22
|
}
|
|
22
23
|
function useScale2DY(reverse) {
|
|
23
24
|
const { height, margin, yDomain } = useChartData();
|
|
24
|
-
return get2DYScale({ height, margin, yDomain }, reverse);
|
|
25
|
+
return useMemo(() => get2DYScale({ height, margin, yDomain }, reverse), [height, margin, reverse, yDomain]);
|
|
25
26
|
}
|
|
26
27
|
function get1DXScale(props, layout) {
|
|
27
28
|
if (!['TOP_1D', 'LEFT_1D'].includes(layout)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.js","sourceRoot":"","sources":["../../../../src/component/2d/utilities/scale.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"scale.js","sourceRoot":"","sources":["../../../../src/component/2d/utilities/scale.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAI7D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAS9C,SAAS,WAAW,CAAC,OAAwB,EAAE,OAAiB;IAC9D,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACjD,MAAM,UAAU,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC;IACpE,MAAM,KAAK,GAAG,UAAU;QACtB,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC;QACrC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC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,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAExD,UAAU,iBAAiB;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,EACV,OAAO,EACP,MAAmB,EACnB,aAA0B,EAC1B,OAAoB,EACpB,aAAa,GACd,EAAE,iBAAiB,2CA2JnB"}
|
|
@@ -34,7 +34,33 @@ export function BrushTracker({ children, className, style, onBrushEnd, onBrush,
|
|
|
34
34
|
const clickCountRef = useRef(0);
|
|
35
35
|
const timeoutRef = useRef(null);
|
|
36
36
|
const lastPointRef = useRef(0);
|
|
37
|
+
const isDraggingRef = useRef(false);
|
|
38
|
+
const clickHandler = useCallback((event, targetElement) => {
|
|
39
|
+
const boundingRect = targetElement.getBoundingClientRect();
|
|
40
|
+
const x = event.clientX - boundingRect.x;
|
|
41
|
+
const y = event.clientY - boundingRect.y;
|
|
42
|
+
// Clear timeout
|
|
43
|
+
if (timeoutRef.current) {
|
|
44
|
+
clearTimeout(timeoutRef.current);
|
|
45
|
+
timeoutRef.current = null;
|
|
46
|
+
}
|
|
47
|
+
// Count clicks
|
|
48
|
+
clickCountRef.current += 1;
|
|
49
|
+
// Set a timeout to distinguish between single and double clicks
|
|
50
|
+
timeoutRef.current = setTimeout(() => {
|
|
51
|
+
if (clickCountRef.current === 1) {
|
|
52
|
+
onClick({ ...event, x, y });
|
|
53
|
+
}
|
|
54
|
+
else if (clickCountRef.current === 2) {
|
|
55
|
+
onDoubleClick({ ...event, x, y });
|
|
56
|
+
}
|
|
57
|
+
// Reset the click count
|
|
58
|
+
clickCountRef.current = 0;
|
|
59
|
+
}, 200);
|
|
60
|
+
}, [onClick, onDoubleClick]);
|
|
37
61
|
const pointerDownHandler = useCallback((event) => {
|
|
62
|
+
const targetElement = event.currentTarget;
|
|
63
|
+
isDraggingRef.current = false; // Reset dragging flag
|
|
38
64
|
//check that the right or left mouse button pressed
|
|
39
65
|
if ([0, 2].includes(event.button)) {
|
|
40
66
|
if (noPropagation) {
|
|
@@ -55,7 +81,7 @@ export function BrushTracker({ children, className, style, onBrushEnd, onBrush,
|
|
|
55
81
|
});
|
|
56
82
|
}
|
|
57
83
|
function moveCallback(event) {
|
|
58
|
-
// event
|
|
84
|
+
isDraggingRef.current = true; // set flag to true to skip click event if the user dragged the mouse
|
|
59
85
|
dispatch({
|
|
60
86
|
type: 'MOVE',
|
|
61
87
|
payload: {
|
|
@@ -67,39 +93,24 @@ export function BrushTracker({ children, className, style, onBrushEnd, onBrush,
|
|
|
67
93
|
});
|
|
68
94
|
}
|
|
69
95
|
function upCallback() {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
96
|
+
if (isDraggingRef.current) {
|
|
97
|
+
dispatch({
|
|
98
|
+
type: 'UP',
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
dispatch({
|
|
103
|
+
type: 'DONE',
|
|
104
|
+
});
|
|
105
|
+
clickHandler(event, targetElement);
|
|
106
|
+
}
|
|
73
107
|
globalThis.removeEventListener('pointermove', moveCallback);
|
|
74
108
|
globalThis.removeEventListener('pointerup', upCallback);
|
|
75
109
|
}
|
|
76
110
|
globalThis.addEventListener('pointermove', moveCallback);
|
|
77
111
|
globalThis.addEventListener('pointerup', upCallback);
|
|
78
112
|
return false;
|
|
79
|
-
}, [noPropagation]);
|
|
80
|
-
const clickHandler = useCallback((e) => {
|
|
81
|
-
const boundingRect = e.currentTarget.getBoundingClientRect();
|
|
82
|
-
const x = e.clientX - boundingRect.x;
|
|
83
|
-
const y = e.clientY - boundingRect.y;
|
|
84
|
-
// Clear timeout
|
|
85
|
-
if (timeoutRef.current) {
|
|
86
|
-
clearTimeout(timeoutRef.current);
|
|
87
|
-
timeoutRef.current = null;
|
|
88
|
-
}
|
|
89
|
-
// Count clicks
|
|
90
|
-
clickCountRef.current += 1;
|
|
91
|
-
// Set a timeout to distinguish between single and double clicks
|
|
92
|
-
timeoutRef.current = setTimeout(() => {
|
|
93
|
-
if (clickCountRef.current === 1) {
|
|
94
|
-
onClick({ ...e, x, y });
|
|
95
|
-
}
|
|
96
|
-
else if (clickCountRef.current === 2) {
|
|
97
|
-
onDoubleClick({ ...e, x, y });
|
|
98
|
-
}
|
|
99
|
-
// Reset the click count
|
|
100
|
-
clickCountRef.current = 0;
|
|
101
|
-
}, 200);
|
|
102
|
-
}, [onClick, onDoubleClick]);
|
|
113
|
+
}, [clickHandler, noPropagation]);
|
|
103
114
|
const handleMouseWheel = useCallback((event) => {
|
|
104
115
|
const boundingRect = event.currentTarget.getBoundingClientRect();
|
|
105
116
|
const x = event.clientX - boundingRect.x;
|
|
@@ -122,7 +133,7 @@ export function BrushTracker({ children, className, style, onBrushEnd, onBrush,
|
|
|
122
133
|
});
|
|
123
134
|
}
|
|
124
135
|
}, [onBrush, onBrushEnd, state]);
|
|
125
|
-
return (_jsx(BrushContext.Provider, { value: state, children: _jsx("div", { className: className, style: { ...style, touchAction: 'none' }, onPointerDown: pointerDownHandler,
|
|
136
|
+
return (_jsx(BrushContext.Provider, { value: state, children: _jsx("div", { className: className, style: { ...style, touchAction: 'none' }, onPointerDown: pointerDownHandler, onWheel: handleMouseWheel, onMouseEnter: () => {
|
|
126
137
|
// disable page scrolling once the mouse over the Displayer
|
|
127
138
|
window.addEventListener('wheel', stopPageScrolling, {
|
|
128
139
|
passive: false,
|
|
@@ -176,13 +187,9 @@ function reducer(state, action) {
|
|
|
176
187
|
}
|
|
177
188
|
return state;
|
|
178
189
|
case 'DONE':
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
step: 'initial',
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
return state;
|
|
190
|
+
return {
|
|
191
|
+
...initialState,
|
|
192
|
+
};
|
|
186
193
|
default:
|
|
187
194
|
return state;
|
|
188
195
|
}
|