nmrium 0.32.0 → 0.33.0-pre.1667755480
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/Chart1D.js +1 -1
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/XAxis.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
- package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
- package/lib/component/1d/integral/IntegralIndicator.js +27 -0
- package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
- package/lib/component/1d/integral/IntegralResizable.js +69 -0
- package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
- package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib/component/1d/ranges/Range.js +27 -50
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +2 -2
- package/lib/component/2d/Contours.js +61 -42
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Viewer2D.js +11 -14
- package/lib/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib/component/2d/zones/IndicationLines.js +5 -8
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- package/lib/component/assignment/actions/initAssignment.js +17 -17
- package/lib/component/assignment/index.js +2 -2
- package/lib/component/context/PreferencesContext.js +3 -6
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/CheckBoxCell.js +1 -1
- package/lib/component/elements/ContextMenu.js +2 -2
- package/lib/component/elements/EditableColumn.js +3 -5
- package/lib/component/elements/GroupPane.d.ts +12 -0
- package/lib/component/elements/GroupPane.js +14 -0
- package/lib/component/elements/Input.js +7 -4
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/Label.js +1 -2
- package/lib/component/elements/MolecularFormulaInput.js +2 -0
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
- package/lib/component/elements/ReactTable/ReactTable.js +72 -38
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib/component/elements/accordion/Accordion.js +2 -2
- package/lib/component/elements/draggble/useDraggable.js +1 -3
- package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColorPicker.js +5 -8
- package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib/component/elements/formik/FormikForm.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.js +12 -20
- package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.js +13 -10
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
- package/lib/component/elements/formik/FormikSlider.js +8 -11
- package/lib/component/elements/formik/FormikTextarea.js +1 -1
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib/component/elements/popup/Alert/Provider.js +7 -7
- package/lib/component/elements/popup/Alert/index.d.ts +3 -4
- package/lib/component/elements/popup/Alert/index.js +3 -4
- package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib/component/elements/popup/Modal/Provider.js +16 -31
- package/lib/component/elements/popup/Modal/index.d.ts +4 -5
- package/lib/component/elements/popup/Modal/index.js +4 -5
- package/lib/component/header/Header.js +1 -1
- package/lib/component/hooks/useCombinedRefs.js +2 -2
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +9 -6
- package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib/component/hooks/usePanelPreferences.js +9 -7
- package/lib/component/loader/DropZone.js +4 -4
- package/lib/component/modal/AlignSpectraModal.js +1 -1
- package/lib/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +2 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib/component/modal/PredictSpectraModal.js +5 -5
- package/lib/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib/component/modal/setting/GeneralSettings.js +11 -14
- package/lib/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
- package/lib/component/modal/setting/WorkspaceItem.js +36 -48
- package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
- package/lib/component/modal/setting/settingsValidation.js +14 -12
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib/component/panels/InformationPanel.js +52 -56
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +3 -3
- package/lib/component/reducer/Reducer.d.ts +40 -14
- package/lib/component/reducer/Reducer.js +12 -11
- package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/DomainActions.js +49 -67
- package/lib/component/reducer/actions/FiltersActions.js +3 -3
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PreferencesActions.js +18 -37
- package/lib/component/reducer/actions/RangesActions.js +14 -12
- package/lib/component/reducer/actions/SpectrumsActions.js +10 -4
- package/lib/component/reducer/actions/ToolsActions.js +20 -35
- package/lib/component/reducer/actions/ZonesActions.js +2 -2
- package/lib/component/reducer/core/Constants.js +1 -1
- package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib/component/reducer/helper/getSpectrum.js +3 -5
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
- package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib/component/tool/BrushX.js +3 -3
- package/lib/component/tool/BrushXY.js +5 -5
- package/lib/component/tool/CrossLinePointer.js +3 -3
- package/lib/component/toolbar/BasicToolBar.js +1 -1
- package/lib/component/utility/Evaluate.js +2 -2
- package/lib/component/utility/FileUtility.d.ts +2 -9
- package/lib/component/utility/FileUtility.js +11 -28
- package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
- package/lib/component/utility/GroupByInfoKey.js +11 -13
- package/lib/component/utility/PathBuilder.js +1 -1
- package/lib/component/utility/PreferencesHelper.js +2 -3
- package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
- package/lib/component/utility/{Export.js → export.js} +53 -78
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/data/Filters.d.ts +16 -17
- package/lib/data/Filters.js +16 -17
- package/lib/data/FiltersManager.js +4 -3
- package/lib/data/PredictionManager.js +8 -10
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/SpectraManager.js +25 -60
- package/lib/data/data1d/MultipleAnalysis.js +74 -70
- package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
- package/lib/data/data1d/Spectrum1D/index.js +24 -25
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib/data/data1d/database.js +45 -28
- package/lib/data/data1d/filter1d/apodization.js +2 -1
- package/lib/data/data1d/filter1d/fft.js +24 -7
- package/lib/data/data1d/filter1d/phaseCorrection.js +2 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +7 -18
- package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
- package/lib/data/data2d/Spectrum2D/contours.js +132 -0
- package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
- package/lib/data/data2d/Spectrum2D/index.js +10 -11
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/index.d.ts +12 -13
- package/lib/data/types/data2d/Data2D.d.ts +2 -0
- package/lib/data/types/data2d/Datum2D.d.ts +0 -1
- package/lib/data/types/data2d/index.d.ts +8 -9
- package/lib/data/utilities/RangeUtilities.js +13 -9
- package/lib/data/utilities/ZoneUtilities.js +17 -13
- package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib/data/utilities/generateChar.js +8 -6
- package/lib/data/utilities/getAtom.js +1 -1
- package/lib/data/utilities/getAtomsFromMF.js +2 -2
- package/lib/data/utilities/getColor.js +3 -3
- package/lib/data/utilities/getSum.js +6 -3
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/LinesSeries.js +1 -1
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/XAxis.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
- package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
- package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib-cjs/component/1d/ranges/Range.js +27 -50
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +2 -2
- package/lib-cjs/component/2d/Contours.js +60 -41
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Viewer2D.js +11 -14
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
- package/lib-cjs/component/assignment/index.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +3 -6
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
- package/lib-cjs/component/elements/ContextMenu.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +3 -5
- package/lib-cjs/component/elements/GroupPane.js +18 -0
- package/lib-cjs/component/elements/Input.js +7 -4
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/Label.js +1 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
- package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
- package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
- package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
- package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
- package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
- package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
- package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
- package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +14 -11
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
- package/lib-cjs/component/loader/DropZone.js +4 -4
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
- package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
- package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib-cjs/component/panels/InformationPanel.js +51 -55
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
- package/lib-cjs/component/reducer/Reducer.js +11 -10
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +49 -67
- package/lib-cjs/component/reducer/actions/FiltersActions.js +3 -3
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +18 -37
- package/lib-cjs/component/reducer/actions/RangesActions.js +14 -12
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +9 -3
- package/lib-cjs/component/reducer/actions/ToolsActions.js +20 -35
- package/lib-cjs/component/reducer/actions/ZonesActions.js +2 -2
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
- package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib-cjs/component/tool/BrushX.js +3 -3
- package/lib-cjs/component/tool/BrushXY.js +5 -5
- package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
- package/lib-cjs/component/toolbar/BasicToolBar.js +1 -1
- package/lib-cjs/component/utility/Evaluate.js +2 -2
- package/lib-cjs/component/utility/FileUtility.js +11 -29
- package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
- package/lib-cjs/component/utility/PathBuilder.js +1 -1
- package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
- package/lib-cjs/component/utility/{Export.js → export.js} +77 -79
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/data/Filters.js +17 -33
- package/lib-cjs/data/FiltersManager.js +4 -3
- package/lib-cjs/data/PredictionManager.js +8 -10
- package/lib-cjs/data/SpectraManager.js +26 -62
- package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib-cjs/data/data1d/database.js +45 -28
- package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
- package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +2 -2
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +7 -18
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
- package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
- package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib-cjs/data/utilities/generateChar.js +8 -6
- package/lib-cjs/data/utilities/getAtom.js +1 -1
- package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
- package/lib-cjs/data/utilities/getColor.js +3 -3
- package/lib-cjs/data/utilities/getSum.js +6 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +30 -26
- package/lib/component/1d/IntegralResizable.js +0 -72
- package/lib/component/elements/popup/helpers.d.ts +0 -1
- package/lib/component/elements/popup/helpers.js +0 -9
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
- package/lib/data/data1d/Data1DManager.d.ts +0 -3
- package/lib/data/data1d/Data1DManager.js +0 -98
- package/lib/data/data2d/Data2DManager.d.ts +0 -3
- package/lib/data/data2d/Data2DManager.js +0 -34
- package/lib/data/types/data2d/Contour.d.ts +0 -4
- package/lib/data/types/data2d/Contour.js +0 -1
- package/lib/data/types/data2d/Contours.d.ts +0 -2
- package/lib/data/types/data2d/Contours.js +0 -1
- package/lib-cjs/component/1d/IntegralResizable.js +0 -77
- package/lib-cjs/component/elements/popup/helpers.js +0 -13
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
- package/lib-cjs/data/data1d/Data1DManager.js +0 -104
- package/lib-cjs/data/data2d/Data2DManager.js +0 -40
- package/lib-cjs/data/types/data2d/Contour.js +0 -2
- package/lib-cjs/data/types/data2d/Contours.js +0 -2
|
@@ -240,9 +240,9 @@ function handleSaveEditedZone(draft, action) {
|
|
|
240
240
|
const zoneIndex = getZoneIndex(state, index, editedRowData.id);
|
|
241
241
|
draft.data[index].zones.values[zoneIndex] = editedRowData;
|
|
242
242
|
if (editedRowData.signals) {
|
|
243
|
-
editedRowData.signals
|
|
243
|
+
for (const signal of editedRowData.signals) {
|
|
244
244
|
(0, nmr_correlation_1.setPathLength)(draft.correlations.values, signal.id, signal.j?.pathLength);
|
|
245
|
-
}
|
|
245
|
+
}
|
|
246
246
|
}
|
|
247
247
|
handleOnChangeZonesData(draft);
|
|
248
248
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
function getClosestNumber(array = [], goal = 0) {
|
|
4
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
4
5
|
const closest = array.reduce((prev, curr) => {
|
|
5
6
|
return Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev;
|
|
6
|
-
});
|
|
7
|
+
}, Number.POSITIVE_INFINITY);
|
|
7
8
|
return closest;
|
|
8
9
|
}
|
|
9
10
|
exports.default = getClosestNumber;
|
|
@@ -18,12 +18,12 @@ function wheelZoom(event, domain, zoomOptions = {}) {
|
|
|
18
18
|
}
|
|
19
19
|
exports.wheelZoom = wheelZoom;
|
|
20
20
|
function setZoom(draft, options = {}) {
|
|
21
|
-
const { height, margin } = draft;
|
|
22
|
-
const activeSpectrum =
|
|
21
|
+
const { height, margin, view, originDomain, yDomains } = draft;
|
|
22
|
+
const activeSpectrum = view.spectra.activeSpectra[view.spectra.activeTab];
|
|
23
23
|
const { scale = 1, spectrumID = null } = options;
|
|
24
24
|
if (activeSpectrum === null && spectrumID === null) {
|
|
25
|
-
const { shareYDomain, yDomain, yDomains } =
|
|
26
|
-
draft.yDomains = Object.keys(
|
|
25
|
+
const { shareYDomain, yDomain, yDomains } = originDomain;
|
|
26
|
+
draft.yDomains = Object.fromEntries(Object.keys(yDomains).map((id) => {
|
|
27
27
|
const _scale = (0, d3_1.scaleLinear)(shareYDomain ? yDomain : yDomains[id], [
|
|
28
28
|
height - margin.bottom,
|
|
29
29
|
margin.top,
|
|
@@ -32,18 +32,19 @@ function setZoom(draft, options = {}) {
|
|
|
32
32
|
const maxPoint = Math.max(Math.abs(max), Math.abs(min));
|
|
33
33
|
const scalePoint = maxPoint === max ? 0 : min;
|
|
34
34
|
const t = d3_1.zoomIdentity
|
|
35
|
-
.translate(0, Math.sign(scalePoint) >= 0
|
|
35
|
+
.translate(0, Math.sign(scalePoint) >= 0
|
|
36
|
+
? _scale(scalePoint)
|
|
37
|
+
: _scale(scalePoint))
|
|
36
38
|
.scale(scale)
|
|
37
39
|
.translate(0, -_scale(0));
|
|
38
40
|
const newYDomain = t.rescaleY(_scale).domain();
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, {});
|
|
41
|
+
return [id, newYDomain];
|
|
42
|
+
}));
|
|
42
43
|
}
|
|
43
44
|
else {
|
|
44
45
|
const spectrumId = spectrumID || activeSpectrum?.id;
|
|
45
46
|
if (spectrumId) {
|
|
46
|
-
const _scale = (0, d3_1.scaleLinear)(
|
|
47
|
+
const _scale = (0, d3_1.scaleLinear)(originDomain.yDomains[spectrumId], [
|
|
47
48
|
height - margin.bottom,
|
|
48
49
|
margin.top,
|
|
49
50
|
]);
|
|
@@ -53,7 +54,7 @@ function setZoom(draft, options = {}) {
|
|
|
53
54
|
.translate(0, -_scale(0));
|
|
54
55
|
const yDomain = t.rescaleY(_scale).domain();
|
|
55
56
|
draft.yDomains = {
|
|
56
|
-
...
|
|
57
|
+
...yDomains,
|
|
57
58
|
[spectrumId]: yDomain,
|
|
58
59
|
};
|
|
59
60
|
}
|
|
@@ -3,11 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getSpectrum = void 0;
|
|
4
4
|
function getSpectrum(state, value) {
|
|
5
5
|
const activeSpectrum = state.view.spectra.activeSpectra[state.view.spectra.activeTab];
|
|
6
|
-
if (value === undefined) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return state.data[index];
|
|
10
|
-
}
|
|
6
|
+
if (value === undefined && activeSpectrum?.id) {
|
|
7
|
+
const index = activeSpectrum.index;
|
|
8
|
+
return state.data[index];
|
|
11
9
|
}
|
|
12
10
|
if (typeof value === 'number') {
|
|
13
11
|
return state.data[value] || undefined;
|
|
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getStrongestPeak = void 0;
|
|
4
4
|
const d3_1 = require("d3");
|
|
5
5
|
function getStrongestPeak(draft) {
|
|
6
|
-
const { data } = draft;
|
|
7
6
|
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
8
7
|
if (activeSpectrum) {
|
|
9
|
-
const activeData = data[activeSpectrum?.index].data;
|
|
8
|
+
const activeData = draft.data[activeSpectrum?.index].data;
|
|
10
9
|
const strongestPeakValue = (0, d3_1.max)(activeData.re);
|
|
11
|
-
const index = activeData.re.
|
|
10
|
+
const index = activeData.re.indexOf(strongestPeakValue);
|
|
12
11
|
return {
|
|
13
12
|
xValue: activeData.x[index],
|
|
14
13
|
yValue: strongestPeakValue,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.removeWorkspace = void 0;
|
|
4
|
-
const immer_1 = require("immer");
|
|
5
4
|
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
6
5
|
const filterObject_1 = require("../utilities/filterObject");
|
|
7
6
|
function removeWorkspace(draft, action) {
|
|
@@ -10,15 +9,9 @@ function removeWorkspace(draft, action) {
|
|
|
10
9
|
draft.workspace.current = 'default';
|
|
11
10
|
}
|
|
12
11
|
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
acc[key] = storedWorkspaces[key];
|
|
17
|
-
}
|
|
18
|
-
return acc;
|
|
19
|
-
}, {});
|
|
20
|
-
draft.workspaces = workspaces;
|
|
21
|
-
localData.workspaces = (0, filterObject_1.filterObject)(workspaces);
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
13
|
+
delete draft.workspaces[workspace];
|
|
14
|
+
localData.workspaces = (0, filterObject_1.filterObject)(draft.workspaces);
|
|
22
15
|
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
23
16
|
}
|
|
24
17
|
exports.removeWorkspace = removeWorkspace;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.setPreferences = void 0;
|
|
7
|
-
const merge_1 = __importDefault(require("lodash/merge"));
|
|
8
4
|
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
9
5
|
const getActiveWorkspace_1 = require("../utilities/getActiveWorkspace");
|
|
10
6
|
const mapNucleiFormatting_1 = require("../utilities/mapNucleiFormatting");
|
|
11
7
|
function setPreferences(draft, action) {
|
|
12
8
|
if (action.payload) {
|
|
13
|
-
let
|
|
14
|
-
let { general, formatting, display, databases } = action.payload;
|
|
9
|
+
let { general = {}, formatting, display, databases } = action.payload;
|
|
15
10
|
formatting = (0, mapNucleiFormatting_1.mapNucleiFormatting)(formatting);
|
|
16
11
|
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
17
12
|
localData.currentWorkspace = draft.workspace.current;
|
|
@@ -26,13 +21,14 @@ function setPreferences(draft, action) {
|
|
|
26
21
|
},
|
|
27
22
|
};
|
|
28
23
|
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
const currentWorkspacePreferences = (0, getActiveWorkspace_1.getActiveWorkspace)(draft);
|
|
25
|
+
draft.workspaces[draft.workspace.current] = {
|
|
26
|
+
...currentWorkspacePreferences,
|
|
31
27
|
general,
|
|
32
28
|
formatting,
|
|
33
29
|
databases,
|
|
34
30
|
display,
|
|
35
|
-
}
|
|
31
|
+
};
|
|
36
32
|
}
|
|
37
33
|
}
|
|
38
34
|
exports.setPreferences = setPreferences;
|
|
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.mapNucleiFormatting = void 0;
|
|
4
4
|
function mapNucleiFormatting(formatting) {
|
|
5
5
|
const { nuclei, ...res } = formatting;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
return {
|
|
7
|
+
nuclei: Object.fromEntries(Object.keys(nuclei).map((key) => [
|
|
8
|
+
nuclei[key].name.trim().toLowerCase(),
|
|
9
|
+
nuclei[key],
|
|
10
|
+
])),
|
|
11
|
+
...res,
|
|
12
|
+
};
|
|
11
13
|
}
|
|
12
14
|
exports.mapNucleiFormatting = mapNucleiFormatting;
|
|
@@ -13,7 +13,7 @@ const styles = {
|
|
|
13
13
|
left: '0px',
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
|
-
const allowTools = [
|
|
16
|
+
const allowTools = new Set([
|
|
17
17
|
ToolTypes_1.options.zoom.id,
|
|
18
18
|
ToolTypes_1.options.zeroFilling.id,
|
|
19
19
|
ToolTypes_1.options.peakPicking.id,
|
|
@@ -22,11 +22,11 @@ const allowTools = [
|
|
|
22
22
|
ToolTypes_1.options.baselineCorrection.id,
|
|
23
23
|
ToolTypes_1.options.rangePicking.id,
|
|
24
24
|
ToolTypes_1.options.exclusionZones.id,
|
|
25
|
-
];
|
|
25
|
+
]);
|
|
26
26
|
function BrushX() {
|
|
27
27
|
const { width, height, toolOptions: { selectedTool }, } = (0, ChartContext_1.useChartData)();
|
|
28
28
|
const { startX, endX, step } = (0, react_1.useContext)(BrushTracker_1.BrushContext);
|
|
29
|
-
if (!allowTools.
|
|
29
|
+
if (!allowTools.has(selectedTool) || step !== 'brushing')
|
|
30
30
|
return null;
|
|
31
31
|
const scale = (endX - startX) / width;
|
|
32
32
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
@@ -15,7 +15,7 @@ const styles = {
|
|
|
15
15
|
zoom: '100%',
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
|
-
const allowTools = [
|
|
18
|
+
const allowTools = new Set([
|
|
19
19
|
ToolTypes_1.options.zoom.id,
|
|
20
20
|
ToolTypes_1.options.apodization.id,
|
|
21
21
|
ToolTypes_1.options.zeroFilling.id,
|
|
@@ -30,7 +30,7 @@ const allowTools = [
|
|
|
30
30
|
ToolTypes_1.options.multipleSpectraAnalysis.id,
|
|
31
31
|
ToolTypes_1.options.exclusionZones.id,
|
|
32
32
|
ToolTypes_1.options.databaseRangesSelection.id,
|
|
33
|
-
];
|
|
33
|
+
]);
|
|
34
34
|
exports.BRUSH_TYPE = {
|
|
35
35
|
X: 1,
|
|
36
36
|
Y: 2,
|
|
@@ -43,7 +43,7 @@ const defaultDimensionBorder = {
|
|
|
43
43
|
function BrushXY({ brushType = exports.BRUSH_TYPE.XY, dimensionBorder = defaultDimensionBorder, width: widthProps, height: heightProps, }) {
|
|
44
44
|
let { width, height, toolOptions: { selectedTool }, } = (0, ChartContext_1.useChartData)();
|
|
45
45
|
let { startX, endX, startY, endY, step } = (0, react_1.useContext)(BrushTracker_1.BrushContext);
|
|
46
|
-
if (!allowTools.
|
|
46
|
+
if (!allowTools.has(selectedTool) ||
|
|
47
47
|
step !== 'brushing' ||
|
|
48
48
|
!dimensionBorder ||
|
|
49
49
|
(dimensionBorder.startX && startX < dimensionBorder.startX) ||
|
|
@@ -58,8 +58,8 @@ function BrushXY({ brushType = exports.BRUSH_TYPE.XY, dimensionBorder = defaultD
|
|
|
58
58
|
: endY < dimensionBorder.startY))) {
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
|
-
width = widthProps
|
|
62
|
-
height = heightProps
|
|
61
|
+
width = widthProps || width;
|
|
62
|
+
height = heightProps || height;
|
|
63
63
|
endX =
|
|
64
64
|
dimensionBorder.endX && endX > dimensionBorder.endX
|
|
65
65
|
? dimensionBorder.endX
|
|
@@ -15,7 +15,7 @@ const styles = {
|
|
|
15
15
|
willChange: 'transform',
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
|
-
const allowTools = [
|
|
18
|
+
const allowTools = new Set([
|
|
19
19
|
ToolTypes_1.options.zoom.id,
|
|
20
20
|
ToolTypes_1.options.apodization.id,
|
|
21
21
|
ToolTypes_1.options.equalizer.id,
|
|
@@ -28,12 +28,12 @@ const allowTools = [
|
|
|
28
28
|
ToolTypes_1.options.multipleSpectraAnalysis.id,
|
|
29
29
|
ToolTypes_1.options.exclusionZones.id,
|
|
30
30
|
ToolTypes_1.options.databaseRangesSelection.id,
|
|
31
|
-
];
|
|
31
|
+
]);
|
|
32
32
|
function CrossLinePointer() {
|
|
33
33
|
const { height, width, margin, toolOptions: { selectedTool }, } = (0, ChartContext_1.useChartData)();
|
|
34
34
|
let position = (0, react_1.useContext)(MouseTracker_1.MouseContext);
|
|
35
35
|
const brushState = (0, react_1.useContext)(BrushTracker_1.BrushContext);
|
|
36
|
-
if (!allowTools.
|
|
36
|
+
if (!allowTools.has(selectedTool) ||
|
|
37
37
|
brushState.step === 'brushing' ||
|
|
38
38
|
!position ||
|
|
39
39
|
position.x > width - margin.right ||
|
|
@@ -129,7 +129,7 @@ function BasicToolBarInner({ info, verticalAlign, ftCounter, fidCounter, activeS
|
|
|
129
129
|
void saveAsPNGHandler();
|
|
130
130
|
break;
|
|
131
131
|
case 'json':
|
|
132
|
-
|
|
132
|
+
saveAsJSONHandler();
|
|
133
133
|
break;
|
|
134
134
|
case 'advance_save':
|
|
135
135
|
void saveAsHandler();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFileSignature = exports.extractFileMetaFromPath = exports.getFileName = exports.getFileExtension = exports.loadFile = exports.
|
|
3
|
+
exports.getFileSignature = exports.extractFileMetaFromPath = exports.getFileName = exports.getFileExtension = exports.loadFile = exports.loadFiles = exports.FILES_SIGNATURES = exports.FILES_TYPES = void 0;
|
|
4
4
|
exports.FILES_TYPES = {
|
|
5
5
|
MOL: 'mol',
|
|
6
6
|
NMRIUM: 'nmrium',
|
|
@@ -15,15 +15,14 @@ exports.FILES_SIGNATURES = {
|
|
|
15
15
|
ZIP: '504b0304',
|
|
16
16
|
};
|
|
17
17
|
function getFileSignature(fileArrayBuffer) {
|
|
18
|
-
return new Uint8Array(fileArrayBuffer)
|
|
19
|
-
.slice(0, 4)
|
|
20
|
-
.reduce((acc, byte) => (acc += byte.toString(16).padStart(2, '0')), '');
|
|
18
|
+
return Array.from(new Uint8Array(fileArrayBuffer).slice(0, 4), (byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
21
19
|
}
|
|
22
20
|
exports.getFileSignature = getFileSignature;
|
|
23
|
-
async function loadFile(file, options = {
|
|
21
|
+
async function loadFile(file, options = {}) {
|
|
22
|
+
const { asBuffer = false } = options;
|
|
24
23
|
const response = await fetch(file);
|
|
25
24
|
checkStatus(response);
|
|
26
|
-
const data =
|
|
25
|
+
const data = asBuffer ? response.arrayBuffer() : response.text();
|
|
27
26
|
return data;
|
|
28
27
|
}
|
|
29
28
|
exports.loadFile = loadFile;
|
|
@@ -38,11 +37,11 @@ function getFileExtension(name) {
|
|
|
38
37
|
}
|
|
39
38
|
exports.getFileExtension = getFileExtension;
|
|
40
39
|
function getFileName(name) {
|
|
41
|
-
return name.
|
|
40
|
+
return name.slice(0, Math.max(0, name.lastIndexOf('.')));
|
|
42
41
|
}
|
|
43
42
|
exports.getFileName = getFileName;
|
|
44
43
|
function extractFileMetaFromPath(path) {
|
|
45
|
-
const meta = path.replace(/^.*[
|
|
44
|
+
const meta = path.replace(/^.*[/\\]/, '').split('.');
|
|
46
45
|
return { name: meta[0].toLowerCase(), extension: meta[1].toLowerCase() };
|
|
47
46
|
}
|
|
48
47
|
exports.extractFileMetaFromPath = extractFileMetaFromPath;
|
|
@@ -57,16 +56,16 @@ function loadFiles(acceptedFiles, options = {}) {
|
|
|
57
56
|
return Promise.all([].map.call(acceptedFiles, (file) => {
|
|
58
57
|
return new Promise((resolve, reject) => {
|
|
59
58
|
const reader = new FileReader();
|
|
60
|
-
reader.
|
|
61
|
-
reader.
|
|
62
|
-
reader.
|
|
59
|
+
reader.addEventListener('abort', (e) => reject(e));
|
|
60
|
+
reader.addEventListener('error', (e) => reject(e));
|
|
61
|
+
reader.addEventListener('load', () => {
|
|
63
62
|
if (reader.result) {
|
|
64
63
|
const binary = reader.result;
|
|
65
64
|
const name = getFileName(file.name);
|
|
66
65
|
const extension = getFileExtension(file.name);
|
|
67
66
|
resolve({ binary, name, extension });
|
|
68
67
|
}
|
|
69
|
-
};
|
|
68
|
+
});
|
|
70
69
|
if (options.asBuffer) {
|
|
71
70
|
reader.readAsArrayBuffer(file);
|
|
72
71
|
}
|
|
@@ -77,20 +76,3 @@ function loadFiles(acceptedFiles, options = {}) {
|
|
|
77
76
|
}));
|
|
78
77
|
}
|
|
79
78
|
exports.loadFiles = loadFiles;
|
|
80
|
-
async function loadFilesFromZip(files, options = {}) {
|
|
81
|
-
const result = [];
|
|
82
|
-
for (const file of files) {
|
|
83
|
-
try {
|
|
84
|
-
const binary = await file.async(options.asBuffer ? 'uint8array' : 'text');
|
|
85
|
-
const name = getFileName(file.name);
|
|
86
|
-
const extension = getFileExtension(file.name);
|
|
87
|
-
result.push({ binary, name, extension });
|
|
88
|
-
}
|
|
89
|
-
catch (e) {
|
|
90
|
-
// eslint-disable-next-line no-console
|
|
91
|
-
console.error(e);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
|
-
exports.loadFilesFromZip = loadFilesFromZip;
|
|
@@ -2,29 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
function getNucleusSum(input) {
|
|
4
4
|
const nucleus = input.split(',');
|
|
5
|
-
|
|
5
|
+
let output = 0;
|
|
6
|
+
for (const i of nucleus) {
|
|
6
7
|
const additions = nucleus.length === 2 ? 100 : 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
output += Number(i.replace(/\D/g, '')) + additions;
|
|
9
|
+
}
|
|
10
|
+
return output;
|
|
10
11
|
}
|
|
11
12
|
function GroupByInfoKey(key) {
|
|
12
13
|
return (array, orderByNucleus = false) => {
|
|
13
|
-
const unorderedGroup =
|
|
14
|
+
const unorderedGroup = {};
|
|
15
|
+
for (const obj of array) {
|
|
14
16
|
const value = obj.info[key];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}, {});
|
|
17
|
+
unorderedGroup[value] = (unorderedGroup[value] || []).concat(obj);
|
|
18
|
+
}
|
|
18
19
|
if (!orderByNucleus) {
|
|
19
20
|
return unorderedGroup;
|
|
20
21
|
}
|
|
21
22
|
else {
|
|
22
|
-
return Object.keys(unorderedGroup)
|
|
23
|
+
return Object.fromEntries(Object.keys(unorderedGroup)
|
|
23
24
|
.sort((a, b) => getNucleusSum(a) - getNucleusSum(b))
|
|
24
|
-
.
|
|
25
|
-
acc[key] = unorderedGroup[key];
|
|
26
|
-
return acc;
|
|
27
|
-
}, {});
|
|
25
|
+
.map((key) => [key, unorderedGroup[key]]));
|
|
28
26
|
}
|
|
29
27
|
};
|
|
30
28
|
}
|
|
@@ -4,9 +4,8 @@ exports.GetPreference = void 0;
|
|
|
4
4
|
const LocalStorage_1 = require("./LocalStorage");
|
|
5
5
|
function GetPreference(preferences, key) {
|
|
6
6
|
const localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
7
|
-
const val = (0, LocalStorage_1.getValue)(preferences, `formatting.panels.[${key}]`)
|
|
8
|
-
|
|
9
|
-
: (0, LocalStorage_1.getValue)(localData, `formatting.panels.[${key}]`);
|
|
7
|
+
const val = (0, LocalStorage_1.getValue)(preferences, `formatting.panels.[${key}]`) ||
|
|
8
|
+
(0, LocalStorage_1.getValue)(localData, `formatting.panels.[${key}]`);
|
|
10
9
|
return val;
|
|
11
10
|
}
|
|
12
11
|
exports.GetPreference = GetPreference;
|