nmrium 0.24.1 → 0.27.0
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 +3 -2
- package/lib/component/1d/FooterBanner.js +1 -1
- package/lib/component/1d/Integral.d.ts +2 -1
- package/lib/component/1d/Integral.js +5 -12
- package/lib/component/1d/IntegralResizable.d.ts +2 -1
- package/lib/component/1d/IntegralResizable.js +21 -16
- package/lib/component/1d/IntegralsSeries.js +3 -3
- package/lib/component/1d/Line.d.ts +2 -2
- package/lib/component/1d/PeakAnnotation.js +5 -4
- package/lib/component/1d/database/DatabaseElements.d.ts +3 -0
- package/lib/component/1d/database/DatabaseElements.js +18 -0
- package/lib/component/1d/database/DatabaseSpectrum.d.ts +3 -0
- package/lib/component/1d/database/DatabaseSpectrum.js +58 -0
- package/lib/component/1d/{ResurrectedDatabaseRanges.d.ts → database/ResurrectedDatabaseRanges.d.ts} +0 -0
- package/lib/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
- package/lib/component/1d/jCouplingGraph/JGraph.js +4 -10
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +36 -32
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +5 -5
- package/lib/component/1d/ranges/Range.d.ts +2 -1
- package/lib/component/1d/ranges/Range.js +38 -39
- package/lib/component/1d/ranges/Ranges.js +6 -3
- package/lib/component/1d/tool/XLabelPointer.js +1 -1
- package/lib/component/2d/Chart2D.js +2 -1
- package/lib/component/2d/Contours.js +4 -1
- package/lib/component/2d/FooterBanner.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +1 -1
- package/lib/component/2d/tools/slicing/HorizontalSliceChart.d.ts +2 -2
- package/lib/component/2d/tools/slicing/SliceScale.d.ts +1 -1
- package/lib/component/2d/tools/slicing/VerticalSliceChart.d.ts +2 -2
- package/lib/component/2d/zones/Signal.js +8 -8
- package/lib/component/2d/zones/Zone.js +3 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +11 -5
- package/lib/component/NMRium.d.ts +5 -1
- package/lib/component/NMRium.js +28 -32
- package/lib/component/SplitPaneWrapper.d.ts +4 -0
- package/lib/component/SplitPaneWrapper.js +8 -0
- package/lib/component/assignment/AssignmentsContext.d.ts +35 -0
- package/lib/component/assignment/AssignmentsContext.js +83 -0
- package/lib/component/assignment/AssignmentsReducer.d.ts +32 -0
- package/lib/component/assignment/AssignmentsReducer.js +39 -0
- package/lib/component/assignment/actions/initAssignment.d.ts +5 -0
- package/lib/component/assignment/actions/initAssignment.js +62 -0
- package/lib/component/assignment/actions/removeAssignment.d.ts +16 -0
- package/lib/component/assignment/actions/removeAssignment.js +24 -0
- package/lib/component/assignment/actions/setActiveAssignment.d.ts +10 -0
- package/lib/component/assignment/actions/setActiveAssignment.js +8 -0
- package/lib/component/assignment/actions/toggleAssignment.d.ts +7 -0
- package/lib/component/assignment/actions/toggleAssignment.js +44 -0
- package/lib/component/assignment/index.d.ts +0 -18
- package/lib/component/assignment/index.js +12 -266
- package/lib/component/assignment/utilities/filterForIDsWithAssignment.d.ts +2 -0
- package/lib/component/assignment/utilities/filterForIDsWithAssignment.js +3 -0
- package/lib/component/context/GlobalContext.d.ts +15 -3
- package/lib/component/context/GlobalContext.js +1 -1
- package/lib/component/context/PreferencesContext.d.ts +15 -12
- package/lib/component/context/PreferencesContext.js +1 -1
- package/lib/component/elements/ActionButtons.d.ts +10 -0
- package/lib/component/elements/ActionButtons.js +14 -0
- package/lib/component/elements/Button.d.ts +30 -5
- package/lib/component/elements/Button.js +151 -4
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/ContextMenu.d.ts +8 -3
- package/lib/component/elements/ContextMenu.js +6 -6
- package/lib/component/elements/EditableColumn.d.ts +3 -2
- package/lib/component/elements/EditableColumn.js +27 -20
- package/lib/component/elements/Input.d.ts +9 -1
- package/lib/component/elements/Input.js +18 -5
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +5 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +38 -10
- package/lib/component/elements/ReactTable/ReactTable.d.ts +3 -1
- package/lib/component/elements/ReactTable/ReactTable.js +7 -2
- package/lib/component/elements/ReactTable/Style.d.ts +1 -3
- package/lib/component/elements/ReactTable/Style.js +1 -7
- package/lib/component/elements/Select.d.ts +1 -0
- package/lib/component/elements/Select.js +21 -15
- package/lib/component/elements/ToggleButton.d.ts +2 -1
- package/lib/component/elements/ToggleButton.js +2 -2
- package/lib/component/elements/ToolTip/ToolTip.js +3 -2
- package/lib/component/elements/draggble/SVGDraggable.d.ts +17 -0
- package/lib/component/elements/draggble/SVGDraggable.js +33 -0
- package/lib/component/elements/draggble/useDraggable.d.ts +22 -0
- package/lib/component/elements/draggble/useDraggable.js +70 -0
- package/lib/component/elements/formik/FormikColorPicker.d.ts +1 -0
- package/lib/component/elements/formik/FormikColorPicker.js +10 -7
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +5 -4
- package/lib/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +1 -0
- package/lib/component/elements/formik/FormikInput.js +6 -3
- package/lib/component/elements/formik/FormikSlider.d.ts +1 -0
- package/lib/component/elements/formik/FormikSlider.js +6 -3
- package/lib/component/elements/popup/Alert/Provider.js +1 -1
- package/lib/component/elements/resizer/DivResizer.d.ts +2 -0
- package/lib/component/elements/resizer/DivResizer.js +62 -0
- package/lib/component/elements/resizer/Resizer.d.ts +20 -0
- package/lib/component/elements/resizer/Resizer.js +12 -0
- package/lib/component/elements/resizer/SVGResizer.d.ts +2 -0
- package/lib/component/elements/resizer/SVGResizer.js +42 -0
- package/lib/component/elements/resizer/useResizer.d.ts +11 -0
- package/lib/component/elements/resizer/useResizer.js +65 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.js +4 -15
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib/component/header/RangesPickingOptionPanel.js +3 -16
- package/lib/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib/component/header/Zones2DOptionPanel.js +3 -14
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +11 -9
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +3 -0
- package/lib/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +1 -10
- package/lib/component/hooks/usePanelPreferences.d.ts +7 -0
- package/lib/component/hooks/usePanelPreferences.js +54 -0
- package/lib/component/hooks/useXYReduce.d.ts +2 -2
- package/lib/component/loader/DefaultSpinnerComponent.d.ts +3 -1
- package/lib/component/loader/DefaultSpinnerComponent.js +2 -2
- package/lib/component/loader/DropZone.js +1 -0
- package/lib/component/loader/SpinnerContext.d.ts +3 -3
- package/lib/component/loader/SpinnerContext.js +2 -2
- package/lib/component/modal/AlignSpectraModal.js +2 -1
- package/lib/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib/component/modal/LoadJCAMPModal.js +7 -6
- package/lib/component/modal/ModalStyle.js +4 -26
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -4
- package/lib/component/modal/MoleculeStructureEditorModal.js +24 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib/component/modal/PredictSpectraModal.js +2 -7
- package/lib/component/modal/SaveAsModal.d.ts +1 -1
- package/lib/component/modal/SaveAsModal.js +2 -1
- package/lib/component/modal/editRange/EditRangeModal.js +6 -5
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +3 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +12 -9
- package/lib/component/modal/setting/DatabasesTabContent.d.ts +6 -0
- package/lib/component/modal/setting/DatabasesTabContent.js +75 -0
- package/lib/component/modal/setting/DisplayTabContent.js +11 -7
- package/lib/component/modal/setting/FormattingTabContent.js +20 -14
- package/lib/component/modal/setting/GeneralSettings.js +4 -1
- package/lib/component/modal/setting/settingsValidation.d.ts +56 -0
- package/lib/component/modal/setting/settingsValidation.js +46 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +6 -4
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +4 -3
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +13 -6
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.d.ts +10 -0
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +65 -0
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +0 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -11
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +26 -74
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +8 -0
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +38 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +21 -7
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +31 -11
- package/lib/component/panels/MoleculesPanel/Utilities.js +61 -68
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +55 -60
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -1
- package/lib/component/panels/Panels.js +2 -3
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +3 -3
- package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +29 -82
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +18 -25
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +16 -10
- package/lib/component/panels/RangesPanel/RangesPanel.js +5 -11
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +55 -66
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +11 -6
- package/lib/component/panels/RangesPanel/RangesTable.js +3 -7
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.js +15 -14
- package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.d.ts +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +16 -9
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +13 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +14 -0
- package/lib/component/panels/RangesPanel/TableColumns/format.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +5 -18
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.d.ts +18 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.js +18 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +7 -68
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +7 -68
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +6 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +51 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +5 -7
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +4 -8
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +5 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +5 -9
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +4 -4
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +4 -8
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +20 -84
- package/lib/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +7 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +22 -22
- package/lib/component/panels/databasePanel/DatabasePanel.js +73 -40
- package/lib/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib/component/panels/databasePanel/DatabaseTable.js +23 -11
- package/lib/component/panels/databasePanel/useDatabases.d.ts +5 -0
- package/lib/component/panels/databasePanel/useDatabases.js +10 -0
- package/lib/component/panels/extra/placeholder/NoTableData.d.ts +3 -1
- package/lib/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +3 -3
- package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts +13 -0
- package/lib/component/panels/extra/preferences/NucleusPreferences.js +22 -0
- package/lib/component/panels/extra/preferences/PreferencesContainer.d.ts +6 -0
- package/lib/component/panels/extra/preferences/PreferencesContainer.js +10 -0
- package/lib/component/panels/extra/preferences/PreferencesGroup.d.ts +7 -0
- package/lib/component/panels/extra/preferences/PreferencesGroup.js +21 -0
- package/lib/component/panels/header/SpectraAutomaticPickingButton.d.ts +2 -0
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +30 -0
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib/component/reducer/Reducer.d.ts +360 -45
- package/lib/component/reducer/Reducer.js +9 -2
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +9 -0
- package/lib/component/reducer/actions/AssignmentsActions.js +18 -0
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -1
- package/lib/component/reducer/actions/LoadActions.js +11 -6
- package/lib/component/reducer/actions/MoleculeActions.d.ts +4 -2
- package/lib/component/reducer/actions/MoleculeActions.js +15 -3
- package/lib/component/reducer/actions/PreferencesActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +1 -1
- package/lib/component/reducer/preferences/actions/addWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +19 -0
- package/lib/component/reducer/preferences/actions/initPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/initPreferences.js +60 -0
- package/lib/component/reducer/preferences/actions/removeWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +20 -0
- package/lib/component/reducer/preferences/actions/resetPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/resetPreferences.js +14 -0
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +13 -0
- package/lib/component/reducer/preferences/actions/setPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setPreferences.js +34 -0
- package/lib/component/reducer/preferences/actions/setWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setWorkspace.js +8 -0
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +7 -0
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +55 -0
- package/lib/component/reducer/{preferencesReducer.d.ts → preferences/preferencesReducer.d.ts} +132 -15
- package/lib/component/reducer/preferences/preferencesReducer.js +80 -0
- package/lib/component/reducer/preferences/utilites/checkKeysExists.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/checkKeysExists.js +14 -0
- package/lib/component/reducer/preferences/utilites/filterObject.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/filterObject.js +7 -0
- package/lib/component/reducer/preferences/utilites/flatObject.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/flatObject.js +9 -0
- package/lib/component/reducer/preferences/utilites/getActiveWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/utilites/getActiveWorkspace.js +3 -0
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.d.ts +2 -0
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +4 -0
- package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.d.ts +5 -0
- package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.js +8 -0
- package/lib/component/reducer/types/Types.d.ts +3 -0
- package/lib/component/reducer/types/Types.js +3 -0
- package/lib/component/tool/FloatMoleculeStructures/ActionsButton.d.ts +4 -0
- package/lib/component/tool/FloatMoleculeStructures/ActionsButton.js +7 -0
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +14 -0
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +43 -0
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +15 -0
- package/lib/component/tool/FloatMoleculeStructures/index.js +28 -0
- package/lib/component/utility/Export.d.ts +3 -3
- package/lib/component/utility/Export.js +16 -9
- package/lib/component/utility/PathBuilder.js +2 -1
- package/lib/component/utility/formatNumber.d.ts +3 -0
- package/lib/component/utility/formatNumber.js +10 -0
- package/lib/component/utility/getUniqueNuclei.d.ts +1 -0
- package/lib/component/utility/getUniqueNuclei.js +10 -0
- package/lib/component/workspaces/Workspace.d.ts +74 -5
- package/lib/component/workspaces/basic.js +17 -10
- package/lib/component/workspaces/embedded.d.ts +2 -0
- package/lib/component/workspaces/embedded.js +32 -0
- package/lib/component/workspaces/exercise.js +2 -0
- package/lib/component/workspaces/index.d.ts +1 -0
- package/lib/component/workspaces/index.js +2 -1
- package/lib/component/workspaces/prediction.js +2 -0
- package/lib/component/workspaces/process1D.js +2 -0
- package/lib/data/SpectraManager.js +23 -15
- package/lib/data/data1d/Data1DManager.d.ts +1 -1
- package/lib/data/data1d/Data1DManager.js +6 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +10 -0
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
- package/lib/data/data1d/Spectrum1D/toJSON.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib/data/data1d/database.d.ts +9 -15
- package/lib/data/data1d/database.js +15 -20
- package/lib/data/data1d/filter1d/absolute.d.ts +3 -2
- package/lib/data/data1d/filter1d/autoPhaseCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/centerMean.d.ts +3 -2
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +3 -2
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +3 -2
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +1 -4
- package/lib/data/data1d/filter1d/exclusionZones.js +4 -4
- package/lib/data/data1d/filter1d/fft.d.ts +3 -2
- package/lib/data/data1d/filter1d/fft.js +2 -2
- package/lib/data/data1d/filter1d/fromTo.d.ts +3 -2
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +3 -2
- package/lib/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib/data/data1d/filter1d/pareto.d.ts +3 -2
- package/lib/data/data1d/filter1d/pareto.js +2 -2
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/shiftX.d.ts +2 -1
- package/lib/data/data1d/filter1d/standardDeviation.d.ts +3 -2
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +3 -2
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Data2DManager.d.ts +1 -1
- package/lib/data/data2d/Data2DManager.js +6 -1
- package/lib/data/data2d/Spectrum2D/toJSON.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/toJSON.js +1 -0
- package/lib/data/data2d/filter2d/shiftX.d.ts +4 -3
- package/lib/data/data2d/filter2d/shiftX.js +2 -2
- package/lib/data/data2d/filter2d/shiftY.d.ts +4 -3
- package/lib/data/data2d/filter2d/shiftY.js +2 -2
- package/lib/data/molecules/Molecule.d.ts +3 -3
- package/lib/data/molecules/Molecule.js +7 -1
- package/lib/data/molecules/MoleculeManager.d.ts +4 -1
- package/lib/data/molecules/MoleculeManager.js +33 -2
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/Data1D.d.ts +3 -3
- package/lib/data/types/data1d/Info1D.d.ts +1 -0
- package/lib/data/types/data2d/Signal2DAxisData.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -2
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/Integral.js +5 -12
- package/lib-cjs/component/1d/IntegralResizable.js +20 -15
- package/lib-cjs/component/1d/IntegralsSeries.js +3 -3
- package/lib-cjs/component/1d/PeakAnnotation.js +5 -4
- package/lib-cjs/component/1d/database/DatabaseElements.js +23 -0
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +60 -0
- package/lib-cjs/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +4 -10
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +35 -31
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +6 -6
- package/lib-cjs/component/1d/ranges/Range.js +40 -41
- package/lib-cjs/component/1d/ranges/Ranges.js +6 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/2d/Chart2D.js +2 -1
- package/lib-cjs/component/2d/Contours.js +4 -1
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/zones/Signal.js +9 -9
- package/lib-cjs/component/2d/zones/Zone.js +4 -4
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +12 -6
- package/lib-cjs/component/NMRium.js +27 -31
- package/lib-cjs/component/SplitPaneWrapper.js +12 -0
- package/lib-cjs/component/assignment/AssignmentsContext.js +88 -0
- package/lib-cjs/component/assignment/AssignmentsReducer.js +45 -0
- package/lib-cjs/component/assignment/actions/initAssignment.js +65 -0
- package/lib-cjs/component/assignment/actions/removeAssignment.js +29 -0
- package/lib-cjs/component/assignment/actions/setActiveAssignment.js +11 -0
- package/lib-cjs/component/assignment/actions/toggleAssignment.js +47 -0
- package/lib-cjs/component/assignment/index.js +15 -269
- package/lib-cjs/component/assignment/utilities/filterForIDsWithAssignment.js +7 -0
- package/lib-cjs/component/context/GlobalContext.js +1 -1
- package/lib-cjs/component/context/PreferencesContext.js +1 -1
- package/lib-cjs/component/elements/ActionButtons.js +20 -0
- package/lib-cjs/component/elements/Button.js +150 -4
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/ContextMenu.js +6 -6
- package/lib-cjs/component/elements/EditableColumn.js +27 -20
- package/lib-cjs/component/elements/Input.js +18 -5
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +42 -14
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +7 -2
- package/lib-cjs/component/elements/ReactTable/Style.js +1 -9
- package/lib-cjs/component/elements/Select.js +20 -14
- package/lib-cjs/component/elements/ToggleButton.js +2 -2
- package/lib-cjs/component/elements/ToolTip/ToolTip.js +3 -2
- package/lib-cjs/component/elements/draggble/SVGDraggable.js +39 -0
- package/lib-cjs/component/elements/draggble/useDraggable.js +73 -0
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +10 -7
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +6 -3
- package/lib-cjs/component/elements/formik/FormikSlider.js +6 -3
- package/lib-cjs/component/elements/popup/Alert/Provider.js +1 -1
- package/lib-cjs/component/elements/resizer/DivResizer.js +68 -0
- package/lib-cjs/component/elements/resizer/Resizer.js +18 -0
- package/lib-cjs/component/elements/resizer/SVGResizer.js +48 -0
- package/lib-cjs/component/elements/resizer/useResizer.js +71 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +3 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +2 -15
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib-cjs/component/header/Zones2DOptionPanel.js +2 -13
- package/lib-cjs/component/hooks/useExport.js +11 -9
- package/lib-cjs/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +2 -12
- package/lib-cjs/component/hooks/usePanelPreferences.js +62 -0
- package/lib-cjs/component/loader/DefaultSpinnerComponent.js +2 -2
- package/lib-cjs/component/loader/DropZone.js +1 -0
- package/lib-cjs/component/loader/SpinnerContext.js +2 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +2 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib-cjs/component/modal/LoadJCAMPModal.js +7 -6
- package/lib-cjs/component/modal/ModalStyle.js +4 -26
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +29 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +2 -7
- package/lib-cjs/component/modal/SaveAsModal.js +2 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +6 -5
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +12 -9
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +80 -0
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +11 -7
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +19 -13
- package/lib-cjs/component/modal/setting/GeneralSettings.js +4 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +72 -0
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +6 -4
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +13 -6
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +72 -0
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -11
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +24 -72
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +44 -0
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +21 -7
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +61 -68
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +55 -60
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/Panels.js +2 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -4
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +27 -80
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +18 -48
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +17 -11
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +6 -12
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +53 -64
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +3 -7
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +18 -17
- package/lib-cjs/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +16 -0
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -16
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/PlotChart.js +21 -0
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +10 -68
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +10 -68
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +55 -0
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +4 -4
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +18 -82
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +23 -23
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +72 -39
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +22 -10
- package/lib-cjs/component/panels/databasePanel/useDatabases.js +14 -0
- package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +3 -3
- package/lib-cjs/component/panels/extra/preferences/NucleusPreferences.js +29 -0
- package/lib-cjs/component/panels/extra/preferences/PreferencesContainer.js +14 -0
- package/lib-cjs/component/panels/extra/preferences/PreferencesGroup.js +25 -0
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +37 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib-cjs/component/reducer/Reducer.js +9 -2
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +21 -0
- package/lib-cjs/component/reducer/actions/LoadActions.js +10 -5
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +17 -3
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -1
- package/lib-cjs/component/reducer/actions/ToolsActions.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +26 -0
- package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +67 -0
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +24 -0
- package/lib-cjs/component/reducer/preferences/actions/resetPreferences.js +18 -0
- package/lib-cjs/component/reducer/preferences/actions/setPanelsPreferences.js +17 -0
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +38 -0
- package/lib-cjs/component/reducer/preferences/actions/setWorkspace.js +12 -0
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +62 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +87 -0
- package/lib-cjs/component/reducer/preferences/utilites/checkKeysExists.js +18 -0
- package/lib-cjs/component/reducer/preferences/utilites/filterObject.js +11 -0
- package/lib-cjs/component/reducer/preferences/utilites/flatObject.js +13 -0
- package/lib-cjs/component/reducer/preferences/utilites/getActiveWorkspace.js +7 -0
- package/lib-cjs/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +11 -0
- package/lib-cjs/component/reducer/preferences/utilites/mapNucleiFormatting.js +12 -0
- package/lib-cjs/component/reducer/types/Types.js +6 -3
- package/lib-cjs/component/tool/FloatMoleculeStructures/ActionsButton.js +13 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +50 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +36 -0
- package/lib-cjs/component/utility/Export.js +16 -9
- package/lib-cjs/component/utility/PathBuilder.js +2 -1
- package/lib-cjs/component/utility/formatNumber.js +17 -0
- package/lib-cjs/component/utility/getUniqueNuclei.js +14 -0
- package/lib-cjs/component/workspaces/basic.js +17 -10
- package/lib-cjs/component/workspaces/embedded.js +35 -0
- package/lib-cjs/component/workspaces/exercise.js +2 -0
- package/lib-cjs/component/workspaces/index.js +2 -1
- package/lib-cjs/component/workspaces/prediction.js +2 -0
- package/lib-cjs/component/workspaces/process1D.js +2 -0
- package/lib-cjs/data/SpectraManager.js +23 -15
- package/lib-cjs/data/data1d/Data1DManager.js +6 -1
- package/lib-cjs/data/data1d/Spectrum1D/convertDataToFloat64Array.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib-cjs/data/data1d/database.js +15 -21
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +4 -4
- package/lib-cjs/data/data1d/filter1d/fft.js +2 -2
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib-cjs/data/data1d/filter1d/pareto.js +2 -2
- package/lib-cjs/data/data1d/filter1d/shiftX.js +2 -2
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Data2DManager.js +6 -1
- package/lib-cjs/data/data2d/Spectrum2D/toJSON.js +1 -0
- package/lib-cjs/data/data2d/filter2d/shiftX.js +4 -4
- package/lib-cjs/data/data2d/filter2d/shiftY.js +4 -4
- package/lib-cjs/data/molecules/Molecule.js +7 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +37 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +49 -48
- package/lib/component/1d/Resizable.d.ts +0 -12
- package/lib/component/1d/Resizable.js +0 -105
- package/lib/component/panels/extra/preferences/defaultValues.d.ts +0 -54
- package/lib/component/panels/extra/preferences/defaultValues.js +0 -54
- package/lib/component/reducer/preferencesReducer.js +0 -272
- package/lib/component/utility/FormatNumber.d.ts +0 -6
- package/lib-cjs/component/1d/Resizable.js +0 -110
- package/lib-cjs/component/panels/extra/preferences/defaultValues.js +0 -61
- package/lib-cjs/component/reducer/preferencesReducer.js +0 -279
|
@@ -6,8 +6,9 @@ const react_1 = require("@emotion/react");
|
|
|
6
6
|
const react_2 = require("react");
|
|
7
7
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
8
8
|
const highlight_1 = require("../highlight");
|
|
9
|
+
const usePanelPreferences_1 = require("../hooks/usePanelPreferences");
|
|
9
10
|
const Types_1 = require("../reducer/types/Types");
|
|
10
|
-
const
|
|
11
|
+
const formatNumber_1 = require("../utility/formatNumber");
|
|
11
12
|
const styles = (0, react_1.css) `
|
|
12
13
|
input {
|
|
13
14
|
-webkit-user-select: text; /* Safari 3.1+ */
|
|
@@ -51,7 +52,7 @@ value, color, isActive, nucleus, }) {
|
|
|
51
52
|
const [isSelected, setIsSelected] = (0, react_2.useState)(false);
|
|
52
53
|
const [_value, setValue] = (0, react_2.useState)(value);
|
|
53
54
|
const [containerSize, setContainerSize] = (0, react_2.useState)({ width: 0, height: 0 });
|
|
54
|
-
const
|
|
55
|
+
const { deltaPPM } = (0, usePanelPreferences_1.usePanelPreferences)('peaks', nucleus);
|
|
55
56
|
const highlight = (0, highlight_1.useHighlight)([id], {
|
|
56
57
|
type: highlight_1.HighlightedSource.PEAK,
|
|
57
58
|
extra: { id },
|
|
@@ -103,8 +104,8 @@ value, color, isActive, nucleus, }) {
|
|
|
103
104
|
const handleOnMouseLeaveNotation = (0, react_2.useCallback)(() => {
|
|
104
105
|
highlight.hide();
|
|
105
106
|
}, [highlight]);
|
|
106
|
-
const newValue = (0, react_2.useMemo)(() => (isSelected ? value :
|
|
107
|
-
const oldValue = (0, react_2.useMemo)(() => (isSelected ? _value :
|
|
107
|
+
const newValue = (0, react_2.useMemo)(() => (isSelected ? value : (0, formatNumber_1.formatNumber)(value, deltaPPM.format)), [deltaPPM.format, isSelected, value]);
|
|
108
|
+
const oldValue = (0, react_2.useMemo)(() => (isSelected ? _value : (0, formatNumber_1.formatNumber)(_value, deltaPPM.format)), [_value, deltaPPM.format, isSelected]);
|
|
108
109
|
return ((0, jsx_runtime_1.jsxs)("g", { css: styles, id: id, style: { outline: 'none' }, transform: `translate(${x}, ${y})`, onMouseEnter: handleOnEnterNotation, onMouseLeave: handleOnMouseLeaveNotation, children: [(0, jsx_runtime_1.jsx)("line", { x1: "0", x2: "0", y1: sign === -1 ? 10 : 0, y2: sign === -1 ? 28 : -18, stroke: color, strokeWidth: highlight.isActive ? '7px' : '1px' }), (0, jsx_runtime_1.jsx)("text", { ref: refText, className: "peaks-text", x: "0", y: sign === -1 ? 28 : -12, dy: "0", dx: "0.35em", fill: "transparent", fontSize: "10px", fontWeight: "100", style: {
|
|
109
110
|
position: 'absolute',
|
|
110
111
|
}, children: newValue }), (0, jsx_runtime_1.jsx)("foreignObject", { x: "0", y: sign === -1 ? 16 : -22, dy: "0.1em", dx: "0.35em", width: containerSize.width + 20, height: "40px", "data-no-export": "true", children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const highlight_1 = require("../../highlight");
|
|
8
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
9
|
+
const DatabaseSpectrum_1 = __importDefault(require("./DatabaseSpectrum"));
|
|
10
|
+
const ResurrectedDatabaseRanges_1 = __importDefault(require("./ResurrectedDatabaseRanges"));
|
|
11
|
+
function DatabaseElements() {
|
|
12
|
+
const { highlight } = (0, highlight_1.useHighlightData)();
|
|
13
|
+
const { previewJcamp } = (0, usePanelPreferences_1.usePanelPreferences)('database');
|
|
14
|
+
const { jcampURL } = highlight?.sourceData?.extra || {};
|
|
15
|
+
if (highlight.sourceData?.type !== highlight_1.HighlightedSource.DATABASE) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
if (previewJcamp && jcampURL) {
|
|
19
|
+
return (0, jsx_runtime_1.jsx)(DatabaseSpectrum_1.default, {});
|
|
20
|
+
}
|
|
21
|
+
return (0, jsx_runtime_1.jsx)(ResurrectedDatabaseRanges_1.default, {});
|
|
22
|
+
}
|
|
23
|
+
exports.default = DatabaseElements;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const SpectraManager_1 = require("../../../data/SpectraManager");
|
|
6
|
+
const ChartContext_1 = require("../../context/ChartContext");
|
|
7
|
+
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
8
|
+
const Alert_1 = require("../../elements/popup/Alert");
|
|
9
|
+
const highlight_1 = require("../../highlight");
|
|
10
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
11
|
+
const SpinnerContext_1 = require("../../loader/SpinnerContext");
|
|
12
|
+
const FileUtility_1 = require("../../utility/FileUtility");
|
|
13
|
+
const scale_1 = require("../utilities/scale");
|
|
14
|
+
function DatabaseSpectrum() {
|
|
15
|
+
const { displayerKey, height, verticalAlign, yDomain, margin } = (0, ChartContext_1.useChartData)();
|
|
16
|
+
const [path, setPath] = (0, react_1.useState)();
|
|
17
|
+
const [isLoading, setLoading] = (0, react_1.useState)(false);
|
|
18
|
+
const { highlight } = (0, highlight_1.useHighlightData)();
|
|
19
|
+
const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
|
|
20
|
+
const alert = (0, Alert_1.useAlert)();
|
|
21
|
+
const { color, marginBottom } = (0, usePanelPreferences_1.usePanelPreferences)('database');
|
|
22
|
+
const { jcampURL: jcampRelativeURL, baseURL } = highlight?.sourceData?.extra || [];
|
|
23
|
+
const getSpinner = (0, react_1.useContext)(SpinnerContext_1.spinnerContext);
|
|
24
|
+
const scaleY = (0, react_1.useCallback)(() => (0, scale_1.getYScale)({
|
|
25
|
+
height: height,
|
|
26
|
+
margin: { top: margin.top, bottom: margin.bottom + marginBottom },
|
|
27
|
+
verticalAlign,
|
|
28
|
+
yDomain,
|
|
29
|
+
}), [height, margin, marginBottom, verticalAlign, yDomain]);
|
|
30
|
+
(0, react_1.useEffect)(() => {
|
|
31
|
+
void (async () => {
|
|
32
|
+
try {
|
|
33
|
+
setLoading(true);
|
|
34
|
+
const jcampURL = new URL(jcampRelativeURL, baseURL);
|
|
35
|
+
const result = await (0, FileUtility_1.loadFile)(jcampURL);
|
|
36
|
+
const spectra = [];
|
|
37
|
+
(0, SpectraManager_1.addJcamp)(spectra, result, {}, {});
|
|
38
|
+
setLoading(false);
|
|
39
|
+
const spectrum = spectra?.[0] || null;
|
|
40
|
+
if (spectrum) {
|
|
41
|
+
const { x, re: y } = spectrum?.data;
|
|
42
|
+
let path = `M ${scaleX()(x[0])} ${scaleY()(y[0])} `;
|
|
43
|
+
path += x.slice(1).reduce((accumulator, point, i) => {
|
|
44
|
+
accumulator += ` L ${scaleX()(point)} ${scaleY()(y[i + 1])}`;
|
|
45
|
+
return accumulator;
|
|
46
|
+
}, '');
|
|
47
|
+
setPath(path);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
alert.error('Failed to Load spectrum');
|
|
52
|
+
}
|
|
53
|
+
})();
|
|
54
|
+
}, [alert, baseURL, jcampRelativeURL, scaleX, scaleY]);
|
|
55
|
+
if (highlight.sourceData?.type !== highlight_1.HighlightedSource.DATABASE) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return isLoading ? ((0, jsx_runtime_1.jsx)("foreignObject", { width: "100%", height: "100%", children: getSpinner('Load Jcamp ....') })) : ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, className: "database-spectrum", children: (0, jsx_runtime_1.jsx)("path", { stroke: color, fill: "none", d: path }) }));
|
|
59
|
+
}
|
|
60
|
+
exports.default = DatabaseSpectrum;
|
package/lib-cjs/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js}
RENAMED
|
@@ -6,22 +6,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const d3_1 = require("d3");
|
|
8
8
|
const nmr_processing_1 = require("nmr-processing");
|
|
9
|
-
const ChartContext_1 = require("
|
|
10
|
-
const ScaleContext_1 = require("
|
|
11
|
-
const highlight_1 = require("
|
|
12
|
-
const
|
|
13
|
-
const
|
|
9
|
+
const ChartContext_1 = require("../../context/ChartContext");
|
|
10
|
+
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
11
|
+
const highlight_1 = require("../../highlight");
|
|
12
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
13
|
+
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
14
|
+
const scale_1 = require("../utilities/scale");
|
|
14
15
|
const emptyData = { info: { originFrequency: 400 } };
|
|
15
16
|
function ResurrectedDatabaseRanges() {
|
|
16
17
|
const { displayerKey, verticalAlign, height, margin } = (0, ChartContext_1.useChartData)();
|
|
17
18
|
const { info } = (0, useSpectrum_1.default)(emptyData);
|
|
18
19
|
const { highlight } = (0, highlight_1.useHighlightData)();
|
|
19
20
|
const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
|
|
21
|
+
const { color, marginBottom } = (0, usePanelPreferences_1.usePanelPreferences)('database');
|
|
20
22
|
if (highlight.sourceData?.type !== highlight_1.HighlightedSource.DATABASE) {
|
|
21
23
|
return null;
|
|
22
24
|
}
|
|
23
25
|
const fullHeight = height - margin.bottom;
|
|
24
26
|
const blockHight = fullHeight / 4;
|
|
27
|
+
const translateY = fullHeight - blockHight - marginBottom;
|
|
25
28
|
const { ranges } = highlight.sourceData.extra || [];
|
|
26
29
|
let yDomain = [0, 0];
|
|
27
30
|
const spectra = ranges.map((range) => {
|
|
@@ -57,6 +60,6 @@ function ResurrectedDatabaseRanges() {
|
|
|
57
60
|
}, []);
|
|
58
61
|
return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, className: "resurrected-database-ranges", width: "100%", height: "100%", children: paths.map(({ path, from, to }, index) => (
|
|
59
62
|
// eslint-disable-next-line react/no-array-index-key
|
|
60
|
-
(0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("g", { transform: `translate(${scaleX()(to)},0)`, children: (0, jsx_runtime_1.jsx)("rect", { x: "0", width: Math.abs(scaleX()(to) - scaleX()(from)), height: "100%", fill: "#ff6f0057" }) }), (0, jsx_runtime_1.jsx)("path", { transform: `translate(0,${
|
|
63
|
+
(0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("g", { transform: `translate(${scaleX()(to)},0)`, children: (0, jsx_runtime_1.jsx)("rect", { x: "0", width: Math.abs(scaleX()(to) - scaleX()(from)), height: "100%", fill: "#ff6f0057" }) }), (0, jsx_runtime_1.jsx)("path", { transform: `translate(0,${translateY})`, stroke: color, fill: "none", d: path })] }, `${index}`))) }));
|
|
61
64
|
}
|
|
62
65
|
exports.default = ResurrectedDatabaseRanges;
|
|
@@ -5,13 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const d3_1 = require("d3");
|
|
8
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
9
8
|
const react_1 = require("react");
|
|
10
9
|
const generateJGraphData_1 = __importDefault(require("../../../data/data1d/Spectrum1D/generateJGraphData"));
|
|
11
10
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
12
|
-
const
|
|
11
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
13
12
|
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
14
|
-
const defaultValues_1 = require("../../panels/extra/preferences/defaultValues");
|
|
15
13
|
const JGraphContext_1 = require("./JGraphContext");
|
|
16
14
|
const JGraphVerticalAxis_1 = require("./JGraphVerticalAxis");
|
|
17
15
|
const JsCouplingLinks_1 = __importDefault(require("./JsCouplingLinks"));
|
|
@@ -24,19 +22,15 @@ function InnerJGraph(props) {
|
|
|
24
22
|
const emptyData = { ranges: {} };
|
|
25
23
|
const MemoizedJGraph = (0, react_1.memo)(InnerJGraph);
|
|
26
24
|
function JGraph() {
|
|
27
|
-
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
28
25
|
const { height, toolOptions: { data: { showJGraph }, }, activeTab, } = (0, ChartContext_1.useChartData)();
|
|
26
|
+
const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
|
|
29
27
|
const graphHeight = height / 4;
|
|
30
28
|
const { ranges } = (0, useSpectrum_1.default)(emptyData);
|
|
31
|
-
const
|
|
32
|
-
const _preferences = (0, get_1.default)(preferences.current, `formatting.panels.ranges.[${activeTab}]`) || (0, defaultValues_1.getRangeDefaultValues)(activeTab);
|
|
33
|
-
return _preferences.jGraphTolerance;
|
|
34
|
-
}, [activeTab, preferences]);
|
|
35
|
-
const { signals, jCouplingMax: maxValue, links, } = (0, react_1.useMemo)(() => (0, generateJGraphData_1.default)(ranges.values, jGraphTolerance) || {
|
|
29
|
+
const { signals, jCouplingMax: maxValue, links, } = (0, react_1.useMemo)(() => (0, generateJGraphData_1.default)(ranges.values, rangesPreferences.jGraphTolerance) || {
|
|
36
30
|
signals: [],
|
|
37
31
|
jCouplingMax: 0,
|
|
38
32
|
links: [],
|
|
39
|
-
}, [jGraphTolerance, ranges.values]);
|
|
33
|
+
}, [rangesPreferences.jGraphTolerance, ranges.values]);
|
|
40
34
|
const scaleY = (0, react_1.useMemo)(() => {
|
|
41
35
|
const maxRange = maxValue + maxValue * 0.1;
|
|
42
36
|
return (0, d3_1.scaleLinear)().range([graphHeight, 0]).domain([0, maxRange]);
|
|
@@ -8,53 +8,57 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const react_2 = require("react");
|
|
10
10
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
11
|
+
const GlobalContext_1 = require("../../context/GlobalContext");
|
|
11
12
|
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
12
13
|
const DeleteButton_1 = __importDefault(require("../../elements/DeleteButton"));
|
|
14
|
+
const Resizer_1 = __importDefault(require("../../elements/resizer/Resizer"));
|
|
13
15
|
const highlight_1 = require("../../highlight");
|
|
14
16
|
const Types_1 = require("../../reducer/types/Types");
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@-moz-document url-prefix() {
|
|
19
|
-
pointer-events: fill;
|
|
20
|
-
}
|
|
21
|
-
user-select: 'none';
|
|
22
|
-
-webkit-user-select: none; /* Chrome all / Safari all */
|
|
23
|
-
-moz-user-select: none; /* Firefox all */
|
|
17
|
+
const styles = {
|
|
18
|
+
common: (0, react_1.css) `
|
|
19
|
+
pointer-events: bounding-box;
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
21
|
+
@-moz-document url-prefix() {
|
|
22
|
+
pointer-events: fill;
|
|
23
|
+
}
|
|
24
|
+
`,
|
|
25
|
+
hover: (0, react_1.css) `
|
|
26
|
+
.delete-button {
|
|
27
|
+
visibility: hidden;
|
|
28
|
+
}
|
|
29
|
+
`,
|
|
30
|
+
Highlighted: (0, react_1.css) `
|
|
31
|
+
.range-area {
|
|
32
|
+
height: 100%;
|
|
33
|
+
fill: #ff6f0057;
|
|
34
|
+
}
|
|
35
|
+
.delete-button {
|
|
36
|
+
visibility: visible;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
`,
|
|
40
|
+
};
|
|
44
41
|
function AnalysisRange({ rangeData, columnKey }) {
|
|
45
|
-
const { from, to } = rangeData;
|
|
46
42
|
const highlight = (0, highlight_1.useHighlight)([columnKey]);
|
|
47
43
|
const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
|
|
48
44
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
45
|
+
const { viewerRef } = (0, GlobalContext_1.useGlobal)();
|
|
49
46
|
const deleteHandler = (0, react_2.useCallback)(() => {
|
|
50
47
|
dispatch({ type: Types_1.DELETE_ANALYZE_SPECTRA_RANGE, colKey: columnKey });
|
|
51
48
|
}, [columnKey, dispatch]);
|
|
52
|
-
const
|
|
49
|
+
const resizeEndHandler = (0, react_2.useCallback)((resized) => {
|
|
53
50
|
dispatch({
|
|
54
51
|
type: Types_1.RESIZE_ANALYZE_SPECTRA_RANGE,
|
|
55
52
|
payload: { ...rangeData, ...resized, columnKey },
|
|
56
53
|
});
|
|
57
54
|
}, [columnKey, dispatch, rangeData]);
|
|
58
|
-
|
|
55
|
+
const from = scaleX()(rangeData.from);
|
|
56
|
+
const to = scaleX()(rangeData.to);
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)("g", { ...highlight.onHover, children: (0, jsx_runtime_1.jsx)(Resizer_1.default, { tag: "svg", onEnd: resizeEndHandler, initialPosition: { x2: from, x1: to }, parentElement: viewerRef, children: ({ x1, x2 }, isActive) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,25)`, css: [
|
|
58
|
+
styles.common,
|
|
59
|
+
highlight.isActive || isActive
|
|
60
|
+
? styles.Highlighted
|
|
61
|
+
: styles.hover,
|
|
62
|
+
], children: [(0, jsx_runtime_1.jsx)("rect", { x: "0", width: x2 - x1, height: "6", className: "range-area", fill: "green" }), (0, jsx_runtime_1.jsx)("text", { textAnchor: "middle", x: (x2 - x1) / 2, y: "-5", fontSize: "12", fill: "red", fontWeight: "bolder", fillOpacity: highlight.isActive ? 1 : 0.6, children: columnKey })] }), (0, jsx_runtime_1.jsx)(DeleteButton_1.default, { x: -20, y: 10, onDelete: deleteHandler })] })) }, `${columnKey}_${to}_${from}`) }));
|
|
59
63
|
}
|
|
60
64
|
exports.default = AnalysisRange;
|
|
@@ -7,7 +7,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
9
|
const react_1 = require("react");
|
|
10
|
-
const
|
|
10
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
11
11
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
12
12
|
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
13
13
|
const highlight_1 = require("../../highlight");
|
|
@@ -23,7 +23,7 @@ const styles = {
|
|
|
23
23
|
strokeWidth: 1,
|
|
24
24
|
};
|
|
25
25
|
function extractID(assignment) {
|
|
26
|
-
return [assignment.id].concat(assignment.assigned
|
|
26
|
+
return [assignment.id].concat(assignment.assigned?.x || []);
|
|
27
27
|
}
|
|
28
28
|
function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
|
|
29
29
|
distance: 10,
|
|
@@ -31,7 +31,7 @@ function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
|
|
|
31
31
|
}, }) {
|
|
32
32
|
const { scaleX, scaleY } = (0, ScaleContext_1.useScaleChecked)();
|
|
33
33
|
const { data: spectraData, activeSpectrum, toolOptions: { selectedTool }, width, } = (0, ChartContext_1.useChartData)();
|
|
34
|
-
const assignment = (0,
|
|
34
|
+
const assignment = (0, AssignmentsContext_1.useAssignment)(signal.id);
|
|
35
35
|
const highlight = (0, highlight_1.useHighlight)(extractID(assignment), {
|
|
36
36
|
type: highlight_1.HighlightedSource.SIGNAL,
|
|
37
37
|
extra: extractID(assignment),
|
|
@@ -174,11 +174,11 @@ function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
|
|
|
174
174
|
? { ...styles, opacity: 1, strokeWidth: 1.5 }
|
|
175
175
|
: styles, ...{
|
|
176
176
|
onMouseEnter: () => {
|
|
177
|
-
assignment.
|
|
177
|
+
assignment.show('x');
|
|
178
178
|
highlight.show();
|
|
179
179
|
},
|
|
180
180
|
onMouseLeave: () => {
|
|
181
|
-
assignment.
|
|
181
|
+
assignment.hide();
|
|
182
182
|
highlight.hide();
|
|
183
183
|
},
|
|
184
184
|
}, ...{
|
|
@@ -189,7 +189,7 @@ function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
|
|
|
189
189
|
: (e) => {
|
|
190
190
|
if (e.shiftKey) {
|
|
191
191
|
e.stopPropagation();
|
|
192
|
-
assignment.
|
|
192
|
+
assignment.setActive('x');
|
|
193
193
|
}
|
|
194
194
|
},
|
|
195
195
|
}, children: multiplicityTree }));
|
|
@@ -8,13 +8,16 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const react_2 = require("react");
|
|
10
10
|
const RangeUtilities_1 = require("../../../data/utilities/RangeUtilities");
|
|
11
|
-
const
|
|
11
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
12
|
+
const filterForIDsWithAssignment_1 = require("../../assignment/utilities/filterForIDsWithAssignment");
|
|
12
13
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
14
|
+
const GlobalContext_1 = require("../../context/GlobalContext");
|
|
13
15
|
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
16
|
+
const Resizer_1 = __importDefault(require("../../elements/resizer/Resizer"));
|
|
14
17
|
const highlight_1 = require("../../highlight");
|
|
15
18
|
const Types_1 = require("../../reducer/types/Types");
|
|
16
19
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
17
|
-
const
|
|
20
|
+
const formatNumber_1 = require("../../utility/formatNumber");
|
|
18
21
|
const MultiplicityTree_1 = __importDefault(require("../multiplicityTree/MultiplicityTree"));
|
|
19
22
|
const TempMultiplicityTree_1 = __importDefault(require("../multiplicityTree/TempMultiplicityTree"));
|
|
20
23
|
const stylesOnHover = (0, react_1.css) `
|
|
@@ -45,25 +48,16 @@ const stylesHighlighted = (0, react_1.css) `
|
|
|
45
48
|
cursor: pointer;
|
|
46
49
|
}
|
|
47
50
|
`;
|
|
48
|
-
function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode, }) {
|
|
49
|
-
const {
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
from: rangeFrom,
|
|
55
|
-
to: rangeTo,
|
|
56
|
-
});
|
|
51
|
+
function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode, relativeFormat, }) {
|
|
52
|
+
const { viewerRef } = (0, GlobalContext_1.useGlobal)();
|
|
53
|
+
const { id, integration, signals } = rangeData;
|
|
54
|
+
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
55
|
+
const assignmentRange = (0, AssignmentsContext_1.useAssignment)(id);
|
|
56
|
+
const highlightRange = (0, highlight_1.useHighlight)([assignmentRange.id].concat(assignmentRange.assigned?.x || []).concat((0, filterForIDsWithAssignment_1.filterForIDsWithAssignment)(assignmentData, signals.map((_signal) => _signal.id))), { type: highlight_1.HighlightedSource.RANGE, extra: { id } });
|
|
57
57
|
const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
|
|
58
58
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
59
59
|
const [reduceOpacity, setReduceOpacity] = (0, react_2.useState)(false);
|
|
60
60
|
const [isBlockedByEditing, setIsBlockedByEditing] = (0, react_2.useState)(false);
|
|
61
|
-
(0, react_2.useEffect)(() => {
|
|
62
|
-
setRangeBoundary({
|
|
63
|
-
from: rangeFrom,
|
|
64
|
-
to: rangeTo,
|
|
65
|
-
});
|
|
66
|
-
}, [rangeFrom, rangeTo]);
|
|
67
61
|
(0, react_2.useEffect)(() => {
|
|
68
62
|
if (selectedTool && selectedTool === ToolTypes_1.options.editRange.id) {
|
|
69
63
|
setIsBlockedByEditing(true);
|
|
@@ -75,46 +69,51 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode,
|
|
|
75
69
|
(0, react_2.useEffect)(() => {
|
|
76
70
|
setReduceOpacity(!(0, RangeUtilities_1.checkRangeKind)(rangeData));
|
|
77
71
|
}, [rangeData]);
|
|
78
|
-
const handleOnStopResizing = (0, react_2.useCallback)((
|
|
72
|
+
const handleOnStopResizing = (0, react_2.useCallback)((position) => {
|
|
79
73
|
dispatch({
|
|
80
74
|
type: Types_1.RESIZE_RANGE,
|
|
81
|
-
data: {
|
|
75
|
+
data: {
|
|
76
|
+
...rangeData,
|
|
77
|
+
from: scaleX().invert(position.x2),
|
|
78
|
+
to: scaleX().invert(position.x1),
|
|
79
|
+
},
|
|
82
80
|
});
|
|
83
|
-
}, [dispatch, rangeData]);
|
|
81
|
+
}, [dispatch, rangeData, scaleX]);
|
|
84
82
|
const mouseEnterHandler = (0, react_2.useCallback)(() => {
|
|
85
|
-
assignmentRange.
|
|
83
|
+
assignmentRange.show('x');
|
|
86
84
|
highlightRange.show();
|
|
87
85
|
}, [assignmentRange, highlightRange]);
|
|
88
86
|
const mouseLeaveHandler = (0, react_2.useCallback)(() => {
|
|
89
|
-
assignmentRange.
|
|
87
|
+
assignmentRange.hide();
|
|
90
88
|
highlightRange.hide();
|
|
91
89
|
}, [assignmentRange, highlightRange]);
|
|
92
90
|
const assignHandler = (0, react_2.useCallback)((e) => {
|
|
93
91
|
if (selectedTool === ToolTypes_1.options.rangesPicking.id &&
|
|
94
92
|
e.shiftKey &&
|
|
95
93
|
!isBlockedByEditing) {
|
|
96
|
-
assignmentRange.
|
|
94
|
+
assignmentRange.setActive('x');
|
|
97
95
|
}
|
|
98
96
|
}, [assignmentRange, isBlockedByEditing, selectedTool]);
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
}, [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
97
|
+
const from = scaleX()(rangeData.from);
|
|
98
|
+
const to = scaleX()(rangeData.to);
|
|
99
|
+
return ((0, jsx_runtime_1.jsxs)("g", { "data-test-id": "range", style: { outline: 'none' }, onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, onClick: assignHandler, children: [(0, jsx_runtime_1.jsx)(Resizer_1.default, { tag: "svg", initialPosition: { x1: to, x2: from }, onEnd: handleOnStopResizing, parentElement: viewerRef, children: ({ x1, x2 }, isActive) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,10)`, css: isBlockedByEditing ||
|
|
100
|
+
highlightRange.isActive ||
|
|
101
|
+
assignmentRange.isActive ||
|
|
102
|
+
isActive
|
|
103
|
+
? stylesHighlighted
|
|
104
|
+
: stylesOnHover, children: [(0, jsx_runtime_1.jsx)("rect", { x: "0", width: x2 - x1, height: "6", className: "range-area", fill: "green", fillOpacity: !reduceOpacity ||
|
|
105
|
+
highlightRange.isActive ||
|
|
106
|
+
assignmentRange.isActive
|
|
107
|
+
? 1
|
|
108
|
+
: 0.4 }), (0, jsx_runtime_1.jsx)("text", { textAnchor: "middle", x: (x2 - x1) / 2, y: "20", fontSize: "10", fill: "red", fillOpacity: !reduceOpacity ||
|
|
109
|
+
highlightRange.isActive ||
|
|
110
|
+
assignmentRange.isActive
|
|
111
|
+
? 1
|
|
112
|
+
: 0.6, children: integration !== undefined
|
|
113
|
+
? (0, formatNumber_1.formatNumber)(integration, relativeFormat)
|
|
114
|
+
: '' })] })) }, `${id}_${to}_${from}`), startEditMode ? ((0, jsx_runtime_1.jsx)(TempMultiplicityTree_1.default, {})) : (showMultiplicityTrees &&
|
|
116
115
|
signals &&
|
|
117
116
|
signals.length > 0 &&
|
|
118
|
-
signals.map((_signal) => ((0, jsx_runtime_1.jsx)(MultiplicityTree_1.default, { rangeFrom: from, rangeTo: to, signal: _signal }, _signal.id))))] }, id));
|
|
117
|
+
signals.map((_signal) => ((0, jsx_runtime_1.jsx)(MultiplicityTree_1.default, { rangeFrom: rangeData.from, rangeTo: rangeData.to, signal: _signal }, _signal.id))))] }, id));
|
|
119
118
|
}
|
|
120
119
|
exports.default = Range;
|
|
@@ -6,17 +6,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
9
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
9
10
|
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
10
11
|
const Range_1 = __importDefault(require("./Range"));
|
|
11
12
|
const RangeIntegral_1 = __importDefault(require("./RangeIntegral"));
|
|
12
|
-
function RangesInner({ ranges, displayerKey, selectedTool, editRangeID, showMultiplicityTrees, showRangesIntegrals, }) {
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, children: ranges?.values?.map((range) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Range_1.default, { rangeData: range, selectedTool: selectedTool, showMultiplicityTrees: showMultiplicityTrees, startEditMode: editRangeID && editRangeID === range.id ? true : false }), showRangesIntegrals && (0, jsx_runtime_1.jsx)(RangeIntegral_1.default, { range: range })] }, range.id))) }));
|
|
13
|
+
function RangesInner({ ranges, displayerKey, selectedTool, editRangeID, showMultiplicityTrees, showRangesIntegrals, relativeFormat, }) {
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, children: ranges?.values?.map((range) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Range_1.default, { rangeData: range, selectedTool: selectedTool, showMultiplicityTrees: showMultiplicityTrees, startEditMode: editRangeID && editRangeID === range.id ? true : false, relativeFormat: relativeFormat }), showRangesIntegrals && (0, jsx_runtime_1.jsx)(RangeIntegral_1.default, { range: range })] }, range.id))) }));
|
|
14
15
|
}
|
|
15
16
|
const MemoizedRanges = (0, react_1.memo)(RangesInner);
|
|
16
17
|
const empyData = { ranges: {} };
|
|
17
18
|
function Ranges() {
|
|
18
|
-
const { displayerKey, toolOptions: { selectedTool, data: { tempRange, showMultiplicityTrees, showRangesIntegrals }, }, } = (0, ChartContext_1.useChartData)();
|
|
19
|
+
const { displayerKey, toolOptions: { selectedTool, data: { tempRange, showMultiplicityTrees, showRangesIntegrals }, }, activeTab, } = (0, ChartContext_1.useChartData)();
|
|
19
20
|
const { ranges } = (0, useSpectrum_1.default)(empyData);
|
|
21
|
+
const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
|
|
20
22
|
return ((0, jsx_runtime_1.jsx)(MemoizedRanges, { ...{
|
|
21
23
|
ranges,
|
|
22
24
|
showMultiplicityTrees,
|
|
@@ -24,6 +26,7 @@ function Ranges() {
|
|
|
24
26
|
selectedTool,
|
|
25
27
|
displayerKey,
|
|
26
28
|
editRangeID: tempRange?.id || '',
|
|
29
|
+
relativeFormat: rangesPreferences.relative.format,
|
|
27
30
|
} }));
|
|
28
31
|
}
|
|
29
32
|
exports.default = Ranges;
|
|
@@ -6,7 +6,7 @@ const BrushTracker_1 = require("../../EventsTrackers/BrushTracker");
|
|
|
6
6
|
const MouseTracker_1 = require("../../EventsTrackers/MouseTracker");
|
|
7
7
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
8
8
|
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
9
|
-
const
|
|
9
|
+
const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
|
|
10
10
|
const style = {
|
|
11
11
|
cursor: 'crosshair',
|
|
12
12
|
transformOrigin: 'bottom right',
|
|
@@ -28,7 +28,7 @@ function XLabelPointer() {
|
|
|
28
28
|
: null;
|
|
29
29
|
return spectrumData;
|
|
30
30
|
}, [activeSpectrum, data]);
|
|
31
|
-
const format = (0,
|
|
31
|
+
const format = (0, useFormatNumberByNucleus_1.useFormatNumberByNucleus)(activeSpectrumData?.info.nucleus);
|
|
32
32
|
const getXValue = (0, react_1.useCallback)((xVal) => {
|
|
33
33
|
if (activeSpectrumData) {
|
|
34
34
|
const xInvert = scaleX().invert(xVal);
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const ChartContext_1 = require("../context/ChartContext");
|
|
9
|
+
const FloatMoleculeStructures_1 = __importDefault(require("../tool/FloatMoleculeStructures"));
|
|
9
10
|
const Contours_1 = __importDefault(require("./Contours"));
|
|
10
11
|
const Left1DChart_1 = __importDefault(require("./Left1DChart"));
|
|
11
12
|
const Top1DChart_1 = __importDefault(require("./Top1DChart"));
|
|
@@ -14,7 +15,7 @@ const YAxis_1 = __importDefault(require("./YAxis"));
|
|
|
14
15
|
const IndicationLines_1 = __importDefault(require("./zones/IndicationLines"));
|
|
15
16
|
const Zones_1 = __importDefault(require("./zones/Zones"));
|
|
16
17
|
function chart2DInner({ spectra, width, height, margin, displayerKey, }) {
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, id: "nmrSVG", children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `${displayerKey}clip-chart-2d`, children: (0, jsx_runtime_1.jsx)("rect", { width: width - margin.left - margin.right, height: height - margin.top - margin.bottom, x: margin.left, y: margin.top }) }) }), (0, jsx_runtime_1.jsx)("rect", { width: width - margin.left - margin.right, height: height - margin.top - margin.bottom, x: margin.left, y: margin.top, stroke: "black", strokeWidth: "1", fill: "transparent" }), spectra?.[0] && (0, jsx_runtime_1.jsx)(Top1DChart_1.default, { data: spectra[0] }), spectra?.[1] && (0, jsx_runtime_1.jsx)(Left1DChart_1.default, { data: spectra[1] }), (0, jsx_runtime_1.jsx)(Contours_1.default, {}), (0, jsx_runtime_1.jsx)(Zones_1.default, {}), (0, jsx_runtime_1.jsx)(IndicationLines_1.default, { axis: "X", show: true }), (0, jsx_runtime_1.jsx)(IndicationLines_1.default, { axis: "Y", show: true }), (0, jsx_runtime_1.jsxs)("g", { className: "container", style: { pointerEvents: 'none' }, children: [(0, jsx_runtime_1.jsx)(XAxis_1.default, {}), (0, jsx_runtime_1.jsx)(YAxis_1.default, {})] })] }));
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, id: "nmrSVG", children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `${displayerKey}clip-chart-2d`, children: (0, jsx_runtime_1.jsx)("rect", { width: width - margin.left - margin.right, height: height - margin.top - margin.bottom, x: margin.left, y: margin.top }) }) }), (0, jsx_runtime_1.jsx)("rect", { width: width - margin.left - margin.right, height: height - margin.top - margin.bottom, x: margin.left, y: margin.top, stroke: "black", strokeWidth: "1", fill: "transparent" }), spectra?.[0] && (0, jsx_runtime_1.jsx)(Top1DChart_1.default, { data: spectra[0] }), spectra?.[1] && (0, jsx_runtime_1.jsx)(Left1DChart_1.default, { data: spectra[1] }), (0, jsx_runtime_1.jsx)(Contours_1.default, {}), (0, jsx_runtime_1.jsx)(Zones_1.default, {}), (0, jsx_runtime_1.jsx)(IndicationLines_1.default, { axis: "X", show: true }), (0, jsx_runtime_1.jsx)(IndicationLines_1.default, { axis: "Y", show: true }), (0, jsx_runtime_1.jsxs)("g", { className: "container", style: { pointerEvents: 'none' }, children: [(0, jsx_runtime_1.jsx)(XAxis_1.default, {}), (0, jsx_runtime_1.jsx)(YAxis_1.default, {})] }), (0, jsx_runtime_1.jsx)(FloatMoleculeStructures_1.default, {})] }));
|
|
18
19
|
}
|
|
19
20
|
const MemoizedChart2D = (0, react_1.memo)(chart2DInner);
|
|
20
21
|
function Chart2D({ spectra }) {
|
|
@@ -49,11 +49,14 @@ function ContoursPaths({ id: spectrumID, sign, color, datum, }) {
|
|
|
49
49
|
const data = (0, react_1.useMemo)(() => {
|
|
50
50
|
return (0, get_1.default)(contours, `${spectrumID}.${sign}`, []);
|
|
51
51
|
}, [contours, sign, spectrumID]);
|
|
52
|
+
const path = buildContourPath(data);
|
|
53
|
+
if (!path)
|
|
54
|
+
return null;
|
|
52
55
|
return ((0, jsx_runtime_1.jsx)("path", { fill: "none", "data-test-id": "spectrum-line", stroke: color, strokeWidth: "1", style: {
|
|
53
56
|
opacity: isActive
|
|
54
57
|
? 1
|
|
55
58
|
: (0, get_1.default)(preferences.current, 'controllers.dimmedSpectraTransparency', 0.1),
|
|
56
|
-
}, d:
|
|
59
|
+
}, d: path }));
|
|
57
60
|
}
|
|
58
61
|
function ContoursInner({ data, displayerKey }) {
|
|
59
62
|
return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-2d)`, className: "contours", children: data?.map((datum, index) => ((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 })), datum.display.isNegativeVisible && ((0, jsx_runtime_1.jsx)(ContoursPaths, { id: datum.id, sign: "negative", datum: datum, color: datum.display.negativeColor }))] }, `${datum.id + index}`))) }));
|
|
@@ -10,8 +10,8 @@ const get1DDataXY_1 = require("../../data/data1d/Spectrum1D/get1DDataXY");
|
|
|
10
10
|
const BrushTracker_1 = require("../EventsTrackers/BrushTracker");
|
|
11
11
|
const MouseTracker_1 = require("../EventsTrackers/MouseTracker");
|
|
12
12
|
const ChartContext_1 = require("../context/ChartContext");
|
|
13
|
+
const useFormatNumberByNucleus_1 = require("../hooks/useFormatNumberByNucleus");
|
|
13
14
|
const ToolTypes_1 = require("../toolbar/ToolTypes");
|
|
14
|
-
const FormatNumber_1 = require("../utility/FormatNumber");
|
|
15
15
|
const DimensionLayout_1 = require("./utilities/DimensionLayout");
|
|
16
16
|
const scale_1 = require("./utilities/scale");
|
|
17
17
|
const styles = (0, react_1.css) `
|
|
@@ -58,7 +58,7 @@ function FooterBanner({ layout, data1D }) {
|
|
|
58
58
|
startY: position.y,
|
|
59
59
|
});
|
|
60
60
|
const nucleuses = activeTab.split(',');
|
|
61
|
-
const [formatX, formatY] = (0,
|
|
61
|
+
const [formatX, formatY] = (0, useFormatNumberByNucleus_1.useFormatNumberByNucleus)(nucleuses);
|
|
62
62
|
const scaleX = (0, react_2.useMemo)(() => {
|
|
63
63
|
if (!data1D || data1D.length === 0) {
|
|
64
64
|
return (0, scale_1.get2DXScale)({ width, margin, xDomain });
|
|
@@ -5,7 +5,7 @@ const react_1 = require("react");
|
|
|
5
5
|
const BrushTracker_1 = require("../../EventsTrackers/BrushTracker");
|
|
6
6
|
const MouseTracker_1 = require("../../EventsTrackers/MouseTracker");
|
|
7
7
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
8
|
-
const
|
|
8
|
+
const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
|
|
9
9
|
const DimensionLayout_1 = require("../utilities/DimensionLayout");
|
|
10
10
|
const scale_1 = require("../utilities/scale");
|
|
11
11
|
const style = {
|
|
@@ -31,7 +31,7 @@ function XYLabelPointer({ layout, data1D }) {
|
|
|
31
31
|
startY: position.y,
|
|
32
32
|
});
|
|
33
33
|
const nucleuses = activeTab.split(',');
|
|
34
|
-
const [formatX, formatY] = (0,
|
|
34
|
+
const [formatX, formatY] = (0, useFormatNumberByNucleus_1.useFormatNumberByNucleus)(nucleuses);
|
|
35
35
|
const scaleX = (0, react_1.useMemo)(() => {
|
|
36
36
|
if (!activeSpectrum || !data1D || data1D.length === 0) {
|
|
37
37
|
return (0, scale_1.get2DXScale)({ width, margin, xDomain });
|