nmrium 0.31.0 → 0.33.0-pre.1667632695
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/FooterBanner.js +17 -10
- 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/Left1DChart.js +1 -1
- package/lib/component/2d/Top1DChart.js +1 -1
- 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/BrushTracker.js +30 -21
- 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/SplitPaneWrapper.js +1 -1
- 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.d.ts +3 -1
- package/lib/component/elements/EditableColumn.js +21 -8
- 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/useActiveSpectrumStyleOptions.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 +10 -2
- 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/MoleculeHeader.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/SpectrumsPanel/base/setting/processSnapPlot.js +3 -26
- 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 +26 -45
- package/lib/component/reducer/Reducer.js +13 -12
- 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 +52 -69
- package/lib/component/reducer/actions/FiltersActions.js +15 -6
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PeaksActions.js +7 -6
- package/lib/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +28 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +13 -6
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +28 -41
- package/lib/component/reducer/actions/ZonesActions.js +11 -10
- 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/getActiveSpectrum.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrum.js +4 -0
- 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/preferencesReducer.d.ts +2 -2
- 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 +9 -8
- 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} +54 -73
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/component/workspaces/Workspace.d.ts +1 -1
- package/lib/component/workspaces/exercise.js +4 -4
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +16 -18
- package/lib/data/Filters.js +16 -18
- 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 +11 -5
- 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 +10 -20
- 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/calculateSanPlot.d.ts +8 -0
- package/lib/data/utilities/calculateSanPlot.js +31 -0
- 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/types/NMRiumGeneralPreferences.d.ts +2 -2
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +16 -9
- 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/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/Top1DChart.js +1 -1
- 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/BrushTracker.js +30 -21
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- package/lib-cjs/component/SplitPaneWrapper.js +1 -1
- 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 +21 -8
- 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/useActiveSpectrumStyleOptions.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 +10 -2
- 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/MoleculeHeader.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/SpectrumsPanel/base/setting/processSnapPlot.js +2 -25
- 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 +12 -11
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +52 -69
- package/lib-cjs/component/reducer/actions/FiltersActions.js +15 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PeaksActions.js +7 -6
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib-cjs/component/reducer/actions/RangesActions.js +28 -24
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +12 -5
- package/lib-cjs/component/reducer/actions/ToolsActions.js +28 -41
- package/lib-cjs/component/reducer/actions/ZonesActions.js +11 -10
- 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/getActiveSpectrum.js +8 -0
- 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 +8 -7
- 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} +78 -74
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/component/workspaces/exercise.js +4 -4
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +17 -35
- 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 +10 -4
- 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 +10 -20
- 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/calculateSanPlot.js +35 -0
- 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 +36 -31
- 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/data1d/filter1d/absolute.d.ts +0 -13
- package/lib/data/data1d/filter1d/absolute.js +0 -26
- 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/data1d/filter1d/absolute.js +0 -32
- 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
|
@@ -4,67 +4,86 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const debounce_1 = __importDefault(require("lodash/debounce"));
|
|
7
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
9
|
const react_1 = require("react");
|
|
9
10
|
const Spectrum2D_1 = require("../../data/data2d/Spectrum2D");
|
|
11
|
+
const contours_1 = require("../../data/data2d/Spectrum2D/contours");
|
|
10
12
|
const ChartContext_1 = require("../context/ChartContext");
|
|
11
13
|
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
14
|
+
const Alert_1 = require("../elements/popup/Alert");
|
|
12
15
|
const Reducer_1 = require("../reducer/Reducer");
|
|
13
16
|
const PathBuilder_1 = require("../utility/PathBuilder");
|
|
17
|
+
const nucleusToString_1 = __importDefault(require("../utility/nucleusToString"));
|
|
14
18
|
const scale_1 = require("./utilities/scale");
|
|
15
|
-
function
|
|
16
|
-
const { margin, width, height, xDomain, yDomain
|
|
17
|
-
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
18
|
-
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
19
|
+
function usePath(datum, contours) {
|
|
20
|
+
const { margin, width, height, xDomain, yDomain } = (0, ChartContext_1.useChartData)();
|
|
19
21
|
const { xShift, yShift } = (0, Spectrum2D_1.getShift)(datum);
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (lines.length < 1e6) {
|
|
31
|
-
for (let i = 0; i < lines.length; i += 4) {
|
|
32
|
-
pathBuilder.moveTo(_scaleX(lines[i] + xShift), _scaleY(lines[i + 1] + yShift));
|
|
33
|
-
pathBuilder.lineTo(_scaleX(lines[i + 2] + xShift), _scaleY(lines[i + 3] + yShift));
|
|
34
|
-
}
|
|
22
|
+
const _scaleX = (0, scale_1.get2DXScale)({ margin, width, xDomain });
|
|
23
|
+
const _scaleY = (0, scale_1.get2DYScale)({ margin, height, yDomain });
|
|
24
|
+
const pathBuilder = new PathBuilder_1.PathBuilder();
|
|
25
|
+
for (const element of contours) {
|
|
26
|
+
if (element.lines) {
|
|
27
|
+
const lines = element.lines;
|
|
28
|
+
if (lines.length < 1e6) {
|
|
29
|
+
for (let i = 0; i < lines.length; i += 4) {
|
|
30
|
+
pathBuilder.moveTo(_scaleX(lines[i] + xShift), _scaleY(lines[i + 1] + yShift));
|
|
31
|
+
pathBuilder.lineTo(_scaleX(lines[i + 2] + xShift), _scaleY(lines[i + 3] + yShift));
|
|
35
32
|
}
|
|
36
33
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
pathBuilder.moveTo(_scaleX(element[0].x + xShift), _scaleY(element[0].y + yShift));
|
|
37
|
+
for (let j = 1; j < element.length; j++) {
|
|
38
|
+
pathBuilder.lineTo(_scaleX(element[j].x + xShift), _scaleY(element[j].y + yShift));
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
|
-
pathBuilder.closePath();
|
|
45
|
-
return pathBuilder.toString();
|
|
46
41
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
pathBuilder.closePath();
|
|
43
|
+
return pathBuilder.toString();
|
|
44
|
+
}
|
|
45
|
+
const useContoursLevel = (datum, sign) => {
|
|
46
|
+
const { view: { zoom: { levels }, }, } = (0, ChartContext_1.useChartData)();
|
|
47
|
+
const { id, display: { contourOptions }, } = datum;
|
|
48
|
+
const defaultLevel = (0, contours_1.getDefaultContoursLevel)(contourOptions);
|
|
49
|
+
const level = levels?.[id]?.[sign];
|
|
50
|
+
return typeof level !== 'number' ? defaultLevel[sign] : level;
|
|
51
|
+
};
|
|
52
|
+
function ContoursPaths({ id: spectrumID, sign, color, datum, onTimeout, }) {
|
|
53
|
+
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
54
|
+
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
55
|
+
const level = useContoursLevel(datum, sign);
|
|
56
|
+
const contours = (0, react_1.useMemo)(() => {
|
|
57
|
+
const { contours, timeout } = (0, contours_1.drawContours)(level, datum, sign === 'negative');
|
|
58
|
+
if (timeout) {
|
|
59
|
+
onTimeout();
|
|
60
|
+
}
|
|
61
|
+
return contours;
|
|
62
|
+
}, [datum, level, onTimeout, sign]);
|
|
63
|
+
const path = usePath(datum, contours);
|
|
64
|
+
const opacity = activeSpectrum === null || spectrumID === activeSpectrum.id
|
|
65
|
+
? '1'
|
|
66
|
+
: (0, get_1.default)(preferences.current, 'general.dimmedSpectraOpacity', 0.1);
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)("path", { fill: "none", "data-test-id": "spectrum-line", stroke: color, strokeWidth: "1", opacity: opacity, d: path }));
|
|
58
68
|
}
|
|
59
69
|
function ContoursInner({ data, displayerKey }) {
|
|
60
|
-
|
|
70
|
+
const alert = (0, Alert_1.useAlert)();
|
|
71
|
+
const debounceAlert = (0, react_1.useRef)((0, debounce_1.default)(() => {
|
|
72
|
+
alert.error('Too many contour lines, only showing the first ones');
|
|
73
|
+
}, 2000));
|
|
74
|
+
function timeoutHandler() {
|
|
75
|
+
debounceAlert.current();
|
|
76
|
+
}
|
|
77
|
+
return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-2d)`, className: "contours", children: data?.map((datum) => ((0, jsx_runtime_1.jsxs)("g", { children: [datum.display.isPositiveVisible && ((0, jsx_runtime_1.jsx)(ContoursPaths, { id: datum.id, sign: "positive", datum: datum, color: datum.display.positiveColor, onTimeout: timeoutHandler })), datum.display.isNegativeVisible && ((0, jsx_runtime_1.jsx)(ContoursPaths, { id: datum.id, sign: "negative", datum: datum, color: datum.display.negativeColor, onTimeout: timeoutHandler }))] }, datum.id))) }));
|
|
61
78
|
}
|
|
62
79
|
const MemoizedContours = (0, react_1.memo)(ContoursInner);
|
|
63
80
|
function Contours() {
|
|
64
|
-
const { data: spectra, displayerKey } = (0, ChartContext_1.useChartData)();
|
|
81
|
+
const { data: spectra, displayerKey, view: { spectra: { activeTab }, }, } = (0, ChartContext_1.useChartData)();
|
|
65
82
|
const data = (0, react_1.useMemo)(() => {
|
|
66
|
-
return spectra.filter((datum) => datum.info.dimension === 2 &&
|
|
67
|
-
|
|
83
|
+
return spectra.filter((datum) => datum.info.dimension === 2 &&
|
|
84
|
+
datum.info.isFt &&
|
|
85
|
+
activeTab === (0, nucleusToString_1.default)(datum.info.nucleus));
|
|
86
|
+
}, [activeTab, spectra]);
|
|
68
87
|
return (0, jsx_runtime_1.jsx)(MemoizedContours, { ...{ data, displayerKey } });
|
|
69
88
|
}
|
|
70
89
|
exports.default = Contours;
|
|
@@ -133,10 +133,10 @@ function FooterBanner({ layout, data1D }) {
|
|
|
133
133
|
switch (trackID) {
|
|
134
134
|
case DimensionLayout_1.LAYOUT.CENTER_2D:
|
|
135
135
|
case DimensionLayout_1.LAYOUT.TOP_1D: {
|
|
136
|
-
return scaleX.invert(x
|
|
136
|
+
return scaleX.invert(x || position.x);
|
|
137
137
|
}
|
|
138
138
|
case DimensionLayout_1.LAYOUT.LEFT_1D: {
|
|
139
|
-
return scaleX.invert(x
|
|
139
|
+
return scaleX.invert(x || position.y);
|
|
140
140
|
}
|
|
141
141
|
default:
|
|
142
142
|
return 0;
|
|
@@ -66,6 +66,6 @@ function Left1DChart({ margin: marignValue = 10, data: spectrum, }) {
|
|
|
66
66
|
const mainHeight = originHeight - margin.bottom - margin.top;
|
|
67
67
|
if (!mainHeight || !height)
|
|
68
68
|
return null;
|
|
69
|
-
return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: `0 0 ${height} ${mainHeight + margin.top}`, width: height, height: mainHeight + margin.top, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `${displayerKey}clip-left`, children: (0, jsx_runtime_1.jsx)("rect", { width: height, height: mainHeight, x: "0", y: margin.top }) }) }), (0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-left)`, children: (0, jsx_runtime_1.jsx)("path", { className: "line", stroke:
|
|
69
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: `0 0 ${height} ${mainHeight + margin.top}`, width: height, height: mainHeight + margin.top, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `${displayerKey}clip-left`, children: (0, jsx_runtime_1.jsx)("rect", { width: height, height: mainHeight, x: "0", y: margin.top }) }) }), (0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-left)`, children: (0, jsx_runtime_1.jsx)("path", { className: "line", stroke: spectrum.display.color, fill: "none", d: paths }) })] }));
|
|
70
70
|
}
|
|
71
71
|
exports.default = (0, react_1.memo)(Left1DChart);
|
|
@@ -62,6 +62,6 @@ function Top1DChart({ margin: marginProps = 10, data: spectrum, }) {
|
|
|
62
62
|
if (!width || !height) {
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `${displayerKey}clip-top`, children: (0, jsx_runtime_1.jsx)("rect", { width: width - originMargin.left - originMargin.right, height: height, x: originMargin.left, y: `${0}` }) }) }), (0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-top)`, children: (0, jsx_runtime_1.jsx)("path", { className: "line", stroke:
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `${displayerKey}clip-top`, children: (0, jsx_runtime_1.jsx)("rect", { width: width - originMargin.left - originMargin.right, height: height, x: originMargin.left, y: `${0}` }) }) }), (0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-top)`, children: (0, jsx_runtime_1.jsx)("path", { className: "line", stroke: spectrum.display.color, fill: "none", strokeWidth: "1px", d: paths }) })] }));
|
|
66
66
|
}
|
|
67
67
|
exports.default = (0, react_1.memo)(Top1DChart);
|
|
@@ -41,6 +41,7 @@ const Types_1 = require("../reducer/types/Types");
|
|
|
41
41
|
const BrushXY_1 = __importStar(require("../tool/BrushXY"));
|
|
42
42
|
const CrossLinePointer_1 = __importDefault(require("../tool/CrossLinePointer"));
|
|
43
43
|
const ToolTypes_1 = require("../toolbar/ToolTypes");
|
|
44
|
+
const assert_1 = require("../utility/assert");
|
|
44
45
|
const Chart2D_1 = __importDefault(require("./Chart2D"));
|
|
45
46
|
const FooterBanner_1 = __importDefault(require("./FooterBanner"));
|
|
46
47
|
const XYLabelPointer_1 = __importDefault(require("./tools/XYLabelPointer"));
|
|
@@ -54,19 +55,15 @@ function Viewer2D({ emptyText = undefined }) {
|
|
|
54
55
|
const isVisible = info.isFt || !('isFt' in info);
|
|
55
56
|
const spectrumData = (0, react_1.useMemo)(() => {
|
|
56
57
|
const nucleuses = activeTab.split(',');
|
|
57
|
-
return nucleuses
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
acc.push(null);
|
|
67
|
-
}
|
|
68
|
-
return acc;
|
|
69
|
-
}, []);
|
|
58
|
+
return nucleuses
|
|
59
|
+
.filter((n) => activeSpectra[n]?.id)
|
|
60
|
+
.map((nucleus) => {
|
|
61
|
+
const id = activeSpectra[nucleus]?.id;
|
|
62
|
+
(0, assert_1.assert)(id, `Error in Viewer2D: id is not defined`);
|
|
63
|
+
const spectrum = data.find((datum) => datum.id === id && !datum.info.isFid);
|
|
64
|
+
(0, assert_1.assert)(spectrum, `Spectrum with id ${id} not found`);
|
|
65
|
+
return spectrum;
|
|
66
|
+
});
|
|
70
67
|
}, [activeTab, data, activeSpectra]);
|
|
71
68
|
const DIMENSION = (0, DimensionLayout_1.get2DDimensionLayout)(state);
|
|
72
69
|
const handelBrushEnd = (0, react_1.useCallback)((brushData) => {
|
|
@@ -143,7 +140,7 @@ function ViewerResponsiveWrapper(props) {
|
|
|
143
140
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
144
141
|
const { width, height, children } = props;
|
|
145
142
|
(0, react_1.useEffect)(() => {
|
|
146
|
-
dispatch({ type: Types_1.SET_DIMENSIONS,
|
|
143
|
+
dispatch({ type: Types_1.SET_DIMENSIONS, width, height });
|
|
147
144
|
}, [width, height, dispatch]);
|
|
148
145
|
return children;
|
|
149
146
|
}
|
|
@@ -93,10 +93,10 @@ function XYLabelPointer({ layout, data1D }) {
|
|
|
93
93
|
switch (trackID) {
|
|
94
94
|
case DimensionLayout_1.LAYOUT.CENTER_2D:
|
|
95
95
|
case DimensionLayout_1.LAYOUT.TOP_1D: {
|
|
96
|
-
return scaleX?.invert(x
|
|
96
|
+
return scaleX?.invert(x || position.x);
|
|
97
97
|
}
|
|
98
98
|
case DimensionLayout_1.LAYOUT.LEFT_1D: {
|
|
99
|
-
return scaleX?.invert(x
|
|
99
|
+
return scaleX?.invert(x || position.y);
|
|
100
100
|
}
|
|
101
101
|
default:
|
|
102
102
|
return 0;
|
|
@@ -37,7 +37,7 @@ function VerticalSliceChart({ margin: marignValue = 10, data, }) {
|
|
|
37
37
|
const paths = (0, react_1.useMemo)(() => {
|
|
38
38
|
if (data) {
|
|
39
39
|
const { x, re: y } = data;
|
|
40
|
-
const scaleX = (0, scale_1.get2DYScale)({ height: originHeight, margin, yDomain });
|
|
40
|
+
const scaleX = (0, scale_1.get2DYScale)({ height: originHeight, margin, yDomain }, true);
|
|
41
41
|
const scaleY = (0, SliceScale_1.getYScale)(height, y, marignValue);
|
|
42
42
|
const pathPoints = xyReduce({ x, y });
|
|
43
43
|
const pathBuilder = new PathBuilder_1.PathBuilder();
|
|
@@ -23,14 +23,11 @@ function IndicationLines({ axis, show }) {
|
|
|
23
23
|
if (nucleus !== null) {
|
|
24
24
|
const ranges = data
|
|
25
25
|
.filter((_datum) => _datum.display.isVisible && _datum.info.nucleus === nucleus)
|
|
26
|
-
.filter(Spectrum1D_1.isSpectrum1D)
|
|
27
|
-
.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
.map((
|
|
31
|
-
.filter((_signal) => SignalsKinds_1.SignalKindsToInclude.some((_kind) => _signal.kind === _kind))
|
|
32
|
-
.map((_signal) => _signal.delta))
|
|
33
|
-
.flat();
|
|
26
|
+
.filter((element) => (0, Spectrum1D_1.isSpectrum1D)(element))
|
|
27
|
+
.flatMap((_datum) => _datum.ranges.values);
|
|
28
|
+
const deltas = ranges.flatMap((_range) => _range.signals
|
|
29
|
+
.filter((_signal) => SignalsKinds_1.SignalKindsToInclude.includes(_signal.kind))
|
|
30
|
+
.map((_signal) => _signal.delta));
|
|
34
31
|
setDeltas1D(deltas);
|
|
35
32
|
}
|
|
36
33
|
else {
|
|
@@ -19,6 +19,9 @@ const initialState = {
|
|
|
19
19
|
startY: 0,
|
|
20
20
|
endY: 0,
|
|
21
21
|
};
|
|
22
|
+
function stopPageScrolling(event) {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
}
|
|
22
25
|
exports.BrushContext = (0, react_1.createContext)(initialState);
|
|
23
26
|
function BrushTracker({ children, className, style, onBrush = () => null, onZoom = () => null, onDoubleClick = () => null, onClick = () => null, noPropagation, }) {
|
|
24
27
|
const [state, dispatch] = (0, react_1.useReducer)(reducer, initialState);
|
|
@@ -41,6 +44,24 @@ function BrushTracker({ children, className, style, onBrush = () => null, onZoom
|
|
|
41
44
|
});
|
|
42
45
|
setMouseDownTime(event.timeStamp);
|
|
43
46
|
}
|
|
47
|
+
function moveCallback(event) {
|
|
48
|
+
dispatch({
|
|
49
|
+
type: 'MOVE',
|
|
50
|
+
screenX: event.screenX,
|
|
51
|
+
screenY: event.screenY,
|
|
52
|
+
clientX: event.clientX,
|
|
53
|
+
clientY: event.clientY,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function mouseUpCallback() {
|
|
57
|
+
dispatch({
|
|
58
|
+
type: 'UP',
|
|
59
|
+
});
|
|
60
|
+
window.removeEventListener('mousemove', moveCallback);
|
|
61
|
+
window.removeEventListener('mouseup', mouseUpCallback);
|
|
62
|
+
}
|
|
63
|
+
window.addEventListener('mousemove', moveCallback);
|
|
64
|
+
window.addEventListener('mouseup', mouseUpCallback);
|
|
44
65
|
return false;
|
|
45
66
|
}, [noPropagation]);
|
|
46
67
|
const clickHandler = (0, react_1.useCallback)((e) => {
|
|
@@ -80,35 +101,23 @@ function BrushTracker({ children, className, style, onBrush = () => null, onZoom
|
|
|
80
101
|
});
|
|
81
102
|
}
|
|
82
103
|
}, [onBrush, state]);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const upCallback = (0, react_1.useCallback)((event) => {
|
|
93
|
-
dispatch({
|
|
94
|
-
type: 'UP',
|
|
95
|
-
clientX: event.clientX,
|
|
96
|
-
clientY: event.clientY,
|
|
97
|
-
});
|
|
98
|
-
return false;
|
|
99
|
-
}, []);
|
|
100
|
-
return ((0, jsx_runtime_1.jsx)(exports.BrushContext.Provider, { value: state, children: (0, jsx_runtime_1.jsx)("div", { className: className, style: style, onMouseDown: mouseDownHandler, onMouseUp: upCallback, onMouseMove: moveCallback, onClick: clickHandler, onWheel: handleMouseWheel, children: children }) }));
|
|
104
|
+
return ((0, jsx_runtime_1.jsx)(exports.BrushContext.Provider, { value: state, children: (0, jsx_runtime_1.jsx)("div", { className: className, style: style, onMouseDown: mouseDownHandler, onClick: clickHandler, onWheel: handleMouseWheel, onMouseEnter: () => {
|
|
105
|
+
// disable page scrolling once the mouse over the Displayer
|
|
106
|
+
window.addEventListener('wheel', stopPageScrolling, {
|
|
107
|
+
passive: false,
|
|
108
|
+
});
|
|
109
|
+
}, onMouseLeave: () => {
|
|
110
|
+
// disable page scrolling once the mouse over the Displayer
|
|
111
|
+
window.removeEventListener('wheel', stopPageScrolling);
|
|
112
|
+
}, children: children }) }));
|
|
101
113
|
}
|
|
102
114
|
exports.BrushTracker = BrushTracker;
|
|
103
115
|
function reducer(state, action) {
|
|
104
116
|
switch (action.type) {
|
|
105
117
|
case 'UP':
|
|
106
118
|
if (state.step === 'brushing' || state.step === 'start') {
|
|
107
|
-
const { clientX, clientY } = action;
|
|
108
119
|
return {
|
|
109
120
|
...state,
|
|
110
|
-
endX: clientX - state.boundingRect.x,
|
|
111
|
-
endY: clientY - state.boundingRect.y,
|
|
112
121
|
step: state.step === 'start' ? 'initial' : 'end',
|
|
113
122
|
};
|
|
114
123
|
}
|
|
@@ -33,7 +33,7 @@ function KeysListenerTracker() {
|
|
|
33
33
|
return displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && data && data.length > 0;
|
|
34
34
|
}, [data, displayerMode]);
|
|
35
35
|
const deleteHandler = (0, react_1.useCallback)(async (sourceData) => {
|
|
36
|
-
const { type, extra: { id }, } = sourceData;
|
|
36
|
+
const { type, extra: { id, zone, spectrumID, colKey }, } = sourceData;
|
|
37
37
|
switch (type) {
|
|
38
38
|
case index_1.HighlightEventSource.INTEGRAL: {
|
|
39
39
|
dispatch({
|
|
@@ -85,7 +85,6 @@ function KeysListenerTracker() {
|
|
|
85
85
|
text: 'Yes, for all spectra',
|
|
86
86
|
handler: async () => {
|
|
87
87
|
const hideLoading = await alert.showLoading('Delete all spectra exclusive zones in progress');
|
|
88
|
-
const { zone } = sourceData.extra;
|
|
89
88
|
dispatch({
|
|
90
89
|
type: Types_1.DELETE_EXCLUSION_ZONE,
|
|
91
90
|
payload: {
|
|
@@ -99,7 +98,6 @@ function KeysListenerTracker() {
|
|
|
99
98
|
text: 'Yes',
|
|
100
99
|
handler: async () => {
|
|
101
100
|
const hideLoading = await alert.showLoading('Delete exclusive zone in progress');
|
|
102
|
-
const { spectrumID, zone } = sourceData.extra;
|
|
103
101
|
dispatch({
|
|
104
102
|
type: Types_1.DELETE_EXCLUSION_ZONE,
|
|
105
103
|
payload: {
|
|
@@ -121,7 +119,7 @@ function KeysListenerTracker() {
|
|
|
121
119
|
case index_1.HighlightEventSource.MULTIPLE_ANALYSIS_ZONE: {
|
|
122
120
|
dispatch({
|
|
123
121
|
type: Types_1.DELETE_ANALYZE_SPECTRA_RANGE,
|
|
124
|
-
colKey
|
|
122
|
+
colKey,
|
|
125
123
|
});
|
|
126
124
|
// remove keys from the highlighted list after delete
|
|
127
125
|
remove();
|
|
@@ -268,7 +266,7 @@ function KeysListenerTracker() {
|
|
|
268
266
|
break;
|
|
269
267
|
case 's':
|
|
270
268
|
if (isToolVisible('exportAs')) {
|
|
271
|
-
|
|
269
|
+
saveAsJSONHandler();
|
|
272
270
|
e.preventDefault();
|
|
273
271
|
}
|
|
274
272
|
break;
|
|
@@ -290,8 +288,9 @@ function KeysListenerTracker() {
|
|
|
290
288
|
}
|
|
291
289
|
}
|
|
292
290
|
}
|
|
293
|
-
catch (
|
|
294
|
-
|
|
291
|
+
catch (error) {
|
|
292
|
+
reportError(error);
|
|
293
|
+
alert.error(error.message);
|
|
295
294
|
}
|
|
296
295
|
}, [
|
|
297
296
|
alert,
|
|
@@ -307,16 +306,9 @@ function KeysListenerTracker() {
|
|
|
307
306
|
saveAsJSONHandler,
|
|
308
307
|
saveToClipboardHandler,
|
|
309
308
|
]);
|
|
310
|
-
function checkNotInputField(e) {
|
|
311
|
-
const tags = ['input', 'textarea'];
|
|
312
|
-
const tagName = e.composedPath()[0].tagName.toLowerCase();
|
|
313
|
-
if (!tags.includes(tagName))
|
|
314
|
-
return true;
|
|
315
|
-
return false;
|
|
316
|
-
}
|
|
317
309
|
const handleOnKeyDown = (0, react_1.useCallback)((e) => {
|
|
318
310
|
if (checkNotInputField(e) && overDisplayer) {
|
|
319
|
-
const num = Number(e.code.
|
|
311
|
+
const num = Number(e.code.slice(-1)) || 0;
|
|
320
312
|
if (num > 0) {
|
|
321
313
|
keysPreferencesListenerHandler(e, num);
|
|
322
314
|
}
|
|
@@ -342,4 +334,11 @@ function KeysListenerTracker() {
|
|
|
342
334
|
}, [handleOnKeyDown]);
|
|
343
335
|
return null;
|
|
344
336
|
}
|
|
337
|
+
function checkNotInputField(e) {
|
|
338
|
+
const tags = ['input', 'textarea'];
|
|
339
|
+
const tagName = e.composedPath()[0].tagName.toLowerCase();
|
|
340
|
+
if (!tags.includes(tagName))
|
|
341
|
+
return true;
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
345
344
|
exports.default = KeysListenerTracker;
|
|
@@ -58,7 +58,7 @@ const Constants_1 = require("./reducer/core/Constants");
|
|
|
58
58
|
const preferencesReducer_1 = __importStar(require("./reducer/preferences/preferencesReducer"));
|
|
59
59
|
const Types_1 = require("./reducer/types/Types");
|
|
60
60
|
const ToolBar_1 = __importDefault(require("./toolbar/ToolBar"));
|
|
61
|
-
const
|
|
61
|
+
const export_1 = require("./utility/export");
|
|
62
62
|
const viewerContainerStyle = (0, react_1.css) `
|
|
63
63
|
border: 0.55px #e6e6e6 solid;
|
|
64
64
|
display: flex;
|
|
@@ -135,15 +135,15 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, preferences = de
|
|
|
135
135
|
});
|
|
136
136
|
const [state, dispatch] = (0, react_2.useReducer)(Reducer_1.spectrumReducer, Reducer_1.initialState, Reducer_1.initState);
|
|
137
137
|
const [preferencesState, dispatchPreferences] = (0, react_2.useReducer)(preferencesReducer_1.default, preferencesReducer_1.preferencesInitialState, preferencesReducer_1.initPreferencesState);
|
|
138
|
-
const { displayerMode, data: spectraData } = state;
|
|
138
|
+
const { displayerMode, data: spectraData, actionType, view } = state;
|
|
139
139
|
(0, react_2.useEffect)(() => {
|
|
140
|
-
if ((0, IgnoreActions_1.default)(
|
|
140
|
+
if ((0, IgnoreActions_1.default)(actionType)) {
|
|
141
141
|
handleDataChange.current?.((0, SpectraManager_1.toJSON)(state, 'onDataChange'));
|
|
142
142
|
}
|
|
143
|
-
}, [state]);
|
|
143
|
+
}, [actionType, state]);
|
|
144
144
|
(0, react_2.useEffect)(() => {
|
|
145
|
-
handleViewChange.current?.(
|
|
146
|
-
}, [
|
|
145
|
+
handleViewChange.current?.(view);
|
|
146
|
+
}, [view]);
|
|
147
147
|
const dispatchMiddleWare = (0, react_2.useMemo)(() => {
|
|
148
148
|
return (0, Reducer_1.dispatchMiddleware)(dispatch);
|
|
149
149
|
}, []);
|
|
@@ -162,7 +162,7 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, preferences = de
|
|
|
162
162
|
}, [preferences, workspace]);
|
|
163
163
|
(0, react_2.useImperativeHandle)(innerRef, () => ({
|
|
164
164
|
getSpectraViewerAsBlob: () => {
|
|
165
|
-
return rootRef?.current ? (0,
|
|
165
|
+
return rootRef?.current ? (0, export_1.getBlob)(rootRef.current, 'nmrSVG') : null;
|
|
166
166
|
},
|
|
167
167
|
}), []);
|
|
168
168
|
(0, react_2.useEffect)(() => {
|
|
@@ -7,6 +7,6 @@ const PreferencesContext_1 = require("./context/PreferencesContext");
|
|
|
7
7
|
function SplitPaneWrapper({ children }) {
|
|
8
8
|
const { current } = (0, PreferencesContext_1.usePreferences)();
|
|
9
9
|
const { hidePanelOnLoad = false, initialPanelWidth = '560px' } = current?.display?.general || {};
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.SplitPane, {
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.SplitPane, { initialSize: initialPanelWidth, direction: "horizontal", controlledSide: "end", initialClosed: hidePanelOnLoad ? true : 600, children: children }, hidePanelOnLoad ? 'true' : 'false'));
|
|
11
11
|
}
|
|
12
12
|
exports.SplitPaneWrapper = SplitPaneWrapper;
|
|
@@ -19,13 +19,13 @@ function initAssignment(action) {
|
|
|
19
19
|
}
|
|
20
20
|
exports.default = initAssignment;
|
|
21
21
|
function setRangesAssignments(state, ranges) {
|
|
22
|
-
const diaIDRecords =
|
|
23
|
-
|
|
22
|
+
const diaIDRecords = [];
|
|
23
|
+
for (const { id, diaIDs, signals } of ranges.values) {
|
|
24
|
+
diaIDRecords.push({ id, diaIDs: diaIDs || [] });
|
|
24
25
|
for (const signal of signals) {
|
|
25
|
-
|
|
26
|
+
diaIDRecords.push({ id: signal.id, diaIDs: signal.diaIDs || [] });
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
}, []);
|
|
28
|
+
}
|
|
29
29
|
for (const { id, diaIDs } of diaIDRecords) {
|
|
30
30
|
for (const diaID of diaIDs) {
|
|
31
31
|
setAssignment(state, id, 'x', diaID);
|
|
@@ -33,22 +33,22 @@ function setRangesAssignments(state, ranges) {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
function setZonesAssignments(state, zones) {
|
|
36
|
-
const diaIDRecords = zones.values.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
36
|
+
const diaIDRecords = zones.values.flatMap(({ id, x, y, signals }) => {
|
|
37
|
+
const diaIDRecords = signals.map((signal) => ({
|
|
38
|
+
id: signal.id,
|
|
39
|
+
diaIDs: { x: signal.x.diaIDs || [], y: signal.y.diaIDs || [] },
|
|
40
|
+
}));
|
|
41
|
+
return [
|
|
42
|
+
{ id, diaIDs: { x: x.diaIDs || [], y: y.diaIDs || [] } },
|
|
43
|
+
...diaIDRecords,
|
|
44
|
+
];
|
|
45
|
+
});
|
|
46
46
|
for (const { id, diaIDs } of diaIDRecords) {
|
|
47
|
-
['x', 'y']
|
|
47
|
+
for (const axis of ['x', 'y']) {
|
|
48
48
|
for (const diaID of diaIDs[axis]) {
|
|
49
49
|
setAssignment(state, id, axis, diaID);
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
function setAssignment(state, id, axis, diaID) {
|
|
@@ -9,7 +9,7 @@ const react_1 = require("react");
|
|
|
9
9
|
const AssignmentsContext_1 = require("./AssignmentsContext");
|
|
10
10
|
const AssignmentsReducer_1 = __importDefault(require("./AssignmentsReducer"));
|
|
11
11
|
function AssignmentProvider(props) {
|
|
12
|
-
const { spectraData: spectra } = props;
|
|
12
|
+
const { spectraData: spectra, children } = props;
|
|
13
13
|
const [data, dispatch] = (0, react_1.useReducer)(AssignmentsReducer_1.default, AssignmentsContext_1.assignmentState);
|
|
14
14
|
const state = (0, react_1.useMemo)(() => ({ data, dispatch }), [data]);
|
|
15
15
|
(0, react_1.useEffect)(() => {
|
|
@@ -20,6 +20,6 @@ function AssignmentProvider(props) {
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
}, [spectra]);
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(AssignmentsContext_1.assignmentContext.Provider, { value: state, children:
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(AssignmentsContext_1.assignmentContext.Provider, { value: state, children: children }));
|
|
24
24
|
}
|
|
25
25
|
exports.AssignmentProvider = AssignmentProvider;
|
|
@@ -28,12 +28,9 @@ exports.usePreferences = usePreferences;
|
|
|
28
28
|
function useWorkspacesList() {
|
|
29
29
|
const { workspaces } = usePreferences();
|
|
30
30
|
return (0, react_1.useMemo)(() => {
|
|
31
|
-
const currentWorkspaces = Object.keys(workspaces)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
return acc;
|
|
36
|
-
}, []);
|
|
31
|
+
const currentWorkspaces = Object.keys(workspaces)
|
|
32
|
+
.filter((k) => !workspaces_1.default[k])
|
|
33
|
+
.map((key) => ({ key, label: workspaces[key].label }));
|
|
37
34
|
return [...preferencesReducer_1.WORKSPACES, ...currentWorkspaces];
|
|
38
35
|
}, [workspaces]);
|
|
39
36
|
}
|
|
@@ -134,7 +134,7 @@ function Button(props) {
|
|
|
134
134
|
}
|
|
135
135
|
function ThemeButton(props) {
|
|
136
136
|
const { colorTheme, ...buttonProps } = props;
|
|
137
|
-
const { base, shade, tint } = colorPalettes[
|
|
137
|
+
const { base, shade, tint } = colorPalettes[colorTheme];
|
|
138
138
|
const { color = { base: shade, hover: 'white' }, backgroundColor = {
|
|
139
139
|
base,
|
|
140
140
|
hover: shade,
|
|
@@ -10,6 +10,6 @@ function CheckBoxCell(props) {
|
|
|
10
10
|
const { name, ...otherProps } = props;
|
|
11
11
|
return ((0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { style: {
|
|
12
12
|
container: { display: 'block', margin: '0 auto', width: 'fit-content' },
|
|
13
|
-
}, name:
|
|
13
|
+
}, name: name, ...otherProps }, name));
|
|
14
14
|
}
|
|
15
15
|
exports.CheckBoxCell = CheckBoxCell;
|
|
@@ -57,11 +57,11 @@ function ContextMenu({ context }, ref) {
|
|
|
57
57
|
(0, react_2.useEffect)(() => {
|
|
58
58
|
root.current = document.createElement('div');
|
|
59
59
|
if (elementsWrapperRef) {
|
|
60
|
-
elementsWrapperRef.
|
|
60
|
+
elementsWrapperRef.append(root.current);
|
|
61
61
|
}
|
|
62
62
|
return () => {
|
|
63
63
|
if (root.current && elementsWrapperRef) {
|
|
64
|
-
|
|
64
|
+
root.current.remove();
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}, [elementsWrapperRef]);
|