nmrium 0.44.1-pre.1696502379 → 0.44.1-pre.1697548860
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/ApodizationLine.js +25 -53
- package/lib/component/1d/Chart1D.js +20 -25
- package/lib/component/1d/ExclusionZoneAnnotation.js +17 -22
- package/lib/component/1d/ExclusionZonesAnnotations.js +19 -24
- package/lib/component/1d/FooterBanner.js +32 -38
- package/lib/component/1d/Line.js +15 -43
- package/lib/component/1d/LinesSeries.js +11 -16
- package/lib/component/1d/SpectraLegends.js +24 -29
- package/lib/component/1d/Viewer1D.js +74 -102
- package/lib/component/1d/XAxis.js +15 -40
- package/lib/component/1d/YAxis.js +13 -38
- package/lib/component/1d/database/DatabaseElements.js +11 -16
- package/lib/component/1d/database/DatabaseSpectrum.js +30 -35
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +25 -30
- package/lib/component/1d/integral/Integral.js +8 -13
- package/lib/component/1d/integral/IntegralIndicator.js +6 -10
- package/lib/component/1d/integral/IntegralResizable.js +23 -28
- package/lib/component/1d/integral/IntegralsSeries.js +8 -13
- package/lib/component/1d/jCouplingGraph/JGraph.js +24 -30
- package/lib/component/1d/jCouplingGraph/JGraphContext.js +5 -9
- package/lib/component/1d/jCouplingGraph/JGraphVerticalAxis.js +8 -12
- package/lib/component/1d/jCouplingGraph/JsCoupling.js +7 -10
- package/lib/component/1d/jCouplingGraph/JsCouplingLinks.js +10 -13
- package/lib/component/1d/jCouplingGraph/JsCouplings.js +10 -16
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +21 -26
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +13 -19
- package/lib/component/1d/multiplicityTree/LevelNode.js +6 -8
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +33 -40
- package/lib/component/1d/multiplicityTree/StringNode.js +5 -7
- package/lib/component/1d/multiplicityTree/TreeColors.js +1 -4
- package/lib/component/1d/multiplicityTree/TreeNodes.js +8 -10
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +7 -12
- package/lib/component/1d/peaks/PeakAnnotations.js +19 -23
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +18 -20
- package/lib/component/1d/peaks/PeakEditionManager.js +24 -55
- package/lib/component/1d/peaks/Peaks.js +24 -33
- package/lib/component/1d/peaks/PeaksShapes.js +21 -26
- package/lib/component/1d/peaks/usePeakShapesPath.js +10 -14
- package/lib/component/1d/ranges/AssignmentActionsButtons.js +5 -12
- package/lib/component/1d/ranges/Range.js +31 -36
- package/lib/component/1d/ranges/RangeIntegral.js +5 -10
- package/lib/component/1d/ranges/Ranges.js +16 -22
- package/lib/component/1d/tool/BaseLineZones.js +10 -12
- package/lib/component/1d/tool/PeakPointer.js +24 -29
- package/lib/component/1d/tool/VerticalIndicator.js +9 -11
- package/lib/component/1d/tool/XLabelPointer.js +19 -21
- package/lib/component/1d/utilities/getDecimalsCount.js +1 -5
- package/lib/component/1d/utilities/intersectionResolver.js +3 -7
- package/lib/component/1d/utilities/scale.js +15 -23
- package/lib/component/1d-2d/components/FloatMoleculeStructures/ActionsButton.js +6 -12
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +20 -27
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.js +15 -23
- package/lib/component/1d-2d/components/SpectrumInfoBlock.js +15 -20
- package/lib/component/1d-2d/tools/BrushX.js +17 -20
- package/lib/component/1d-2d/tools/BrushXY.js +29 -33
- package/lib/component/1d-2d/tools/CrossLinePointer.js +24 -26
- package/lib/component/2d/1d-tracer/HorizontalSliceChart.js +11 -13
- package/lib/component/2d/1d-tracer/Left1DChart.js +13 -38
- package/lib/component/2d/1d-tracer/Top1DChart.js +13 -38
- package/lib/component/2d/1d-tracer/VerticalSliceChart.js +11 -13
- package/lib/component/2d/Chart2D.js +17 -23
- package/lib/component/2d/FooterBanner.js +57 -59
- package/lib/component/2d/SignalDeltaLine.js +11 -13
- package/lib/component/2d/SlicingView.js +17 -22
- package/lib/component/2d/Viewer2D.js +38 -68
- package/lib/component/2d/XAxis.js +15 -43
- package/lib/component/2d/YAxis.js +15 -43
- package/lib/component/2d/fid/FidCanvas.js +19 -26
- package/lib/component/2d/fid/FidContainer.js +17 -24
- package/lib/component/2d/ft/Contours.js +34 -40
- package/lib/component/2d/ft/FTContainer.js +8 -15
- package/lib/component/2d/tools/XYLabelPointer.js +36 -38
- package/lib/component/2d/utilities/DimensionLayout.js +1 -6
- package/lib/component/2d/utilities/scale.js +18 -28
- package/lib/component/2d/zones/IndicationLines.js +19 -21
- package/lib/component/2d/zones/Signal.js +22 -27
- package/lib/component/2d/zones/SignalCrosshair.js +14 -19
- package/lib/component/2d/zones/Zone.js +23 -28
- package/lib/component/2d/zones/Zones.js +12 -18
- package/lib/component/EventsTrackers/BrushTracker.js +20 -28
- package/lib/component/EventsTrackers/KeysListenerTracker.js +54 -59
- package/lib/component/EventsTrackers/MouseTracker.js +12 -17
- package/lib/component/assignment/AssignmentsContext.js +16 -21
- package/lib/component/assignment/AssignmentsReducer.js +9 -15
- package/lib/component/assignment/actions/initAssignment.js +5 -8
- package/lib/component/assignment/actions/removeAssignment.js +2 -7
- package/lib/component/assignment/actions/setActiveAssignment.js +1 -4
- package/lib/component/assignment/actions/toggleAssignment.js +3 -6
- package/lib/component/assignment/index.js +11 -18
- package/lib/component/assignment/utilities/filterForIDsWithAssignment.js +1 -5
- package/lib/component/context/ChartContext.js +6 -10
- package/lib/component/context/DispatchContext.js +5 -9
- package/lib/component/context/GlobalContext.js +5 -9
- package/lib/component/context/KeyModifierContext.js +10 -16
- package/lib/component/context/LoaderContext.js +5 -9
- package/lib/component/context/LoggerContext.js +18 -23
- package/lib/component/context/PreferencesContext.js +11 -16
- package/lib/component/context/ScaleContext.js +7 -12
- package/lib/component/elements/ActionButtons.js +5 -11
- package/lib/component/elements/ActiveButton.js +8 -13
- package/lib/component/elements/Button.js +21 -23
- package/lib/component/elements/ButtonToolTip.js +4 -9
- package/lib/component/elements/CheckBox.js +6 -8
- package/lib/component/elements/CheckBoxCell.js +4 -11
- package/lib/component/elements/CloseButton.js +6 -11
- package/lib/component/elements/ColorInput.js +13 -15
- package/lib/component/elements/ColumnWrapper.js +3 -7
- package/lib/component/elements/ContextMenu.js +18 -20
- package/lib/component/elements/CounterLabel.js +3 -7
- package/lib/component/elements/DeleteButton.js +3 -5
- package/lib/component/elements/EditableColumn.js +14 -19
- package/lib/component/elements/GroupPane.js +3 -7
- package/lib/component/elements/Header.js +5 -9
- package/lib/component/elements/Input.js +15 -20
- package/lib/component/elements/InputRange.js +8 -10
- package/lib/component/elements/IsotopesViewer.js +3 -5
- package/lib/component/elements/Label.js +6 -12
- package/lib/component/elements/Logo.js +3 -6
- package/lib/component/elements/MenuButton.js +15 -21
- package/lib/component/elements/Message.js +6 -9
- package/lib/component/elements/MolecularFormulaInput.js +13 -19
- package/lib/component/elements/MoleculeSelection.js +14 -20
- package/lib/component/elements/NextPrev.js +20 -22
- package/lib/component/elements/NumberInput.js +8 -13
- package/lib/component/elements/PreferencesButton.js +5 -12
- package/lib/component/elements/ReactTable/Elements/EmptyDataRow.js +5 -9
- package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js +6 -8
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +14 -16
- package/lib/component/elements/ReactTable/ReactTable.js +37 -65
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +12 -14
- package/lib/component/elements/ReactTable/Style.js +3 -6
- package/lib/component/elements/ReactTable/utility/ReactTableContext.js +5 -9
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +6 -11
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +2 -7
- package/lib/component/elements/RemoveAssignmentsButton.js +7 -11
- package/lib/component/elements/SVGGroup.js +8 -12
- package/lib/component/elements/SaveButton.js +8 -13
- package/lib/component/elements/Scroller.js +11 -15
- package/lib/component/elements/Select.js +8 -10
- package/lib/component/elements/Tab/DeleteButton.js +6 -8
- package/lib/component/elements/Tab/Tab.js +6 -12
- package/lib/component/elements/Tab/Tabs.js +14 -20
- package/lib/component/elements/Table/Table.js +4 -6
- package/lib/component/elements/Table/TableBody.js +6 -8
- package/lib/component/elements/Table/TableCell.js +4 -6
- package/lib/component/elements/Table/TableHead.js +4 -6
- package/lib/component/elements/Table/TableRow.js +4 -6
- package/lib/component/elements/ToggleButton.js +9 -14
- package/lib/component/elements/ToolTip/ToolTip.js +16 -18
- package/lib/component/elements/ToolbarMenu.js +19 -22
- package/lib/component/elements/accordion/Accordion.js +15 -17
- package/lib/component/elements/accordion/AccordionItem.js +17 -20
- package/lib/component/elements/draggable/SVGDraggable.js +7 -13
- package/lib/component/elements/draggable/useDraggable.js +7 -10
- package/lib/component/elements/dropDownButton/DropDownButton.js +16 -21
- package/lib/component/elements/dropDownButton/DropDownList.js +12 -14
- package/lib/component/elements/formik/ErrorMessage.js +6 -8
- package/lib/component/elements/formik/FormikCheckBox.js +11 -16
- package/lib/component/elements/formik/FormikColorInput.js +9 -14
- package/lib/component/elements/formik/FormikColorPicker.js +9 -14
- package/lib/component/elements/formik/FormikColumnFormatField.js +14 -20
- package/lib/component/elements/formik/FormikError.js +8 -13
- package/lib/component/elements/formik/FormikErrorsSummary.js +9 -11
- package/lib/component/elements/formik/FormikInput.js +10 -15
- package/lib/component/elements/formik/FormikNumberInput.js +11 -16
- package/lib/component/elements/formik/FormikOnChange.js +8 -13
- package/lib/component/elements/formik/FormikSelect.js +12 -17
- package/lib/component/elements/formik/FormikSlider.js +10 -15
- package/lib/component/elements/formik/FormikTextarea.js +11 -16
- package/lib/component/elements/formik/Input.js +6 -11
- package/lib/component/elements/formik/SelectBox.js +8 -13
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +10 -14
- package/lib/component/elements/popup/Alert/AlertBlock.js +9 -15
- package/lib/component/elements/popup/Alert/Context.js +5 -9
- package/lib/component/elements/popup/Alert/ProgressIndicator.js +5 -8
- package/lib/component/elements/popup/Alert/Provider.js +34 -39
- package/lib/component/elements/popup/Alert/index.js +3 -14
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +7 -9
- package/lib/component/elements/popup/Modal/Context.js +5 -9
- package/lib/component/elements/popup/Modal/Modal.js +6 -8
- package/lib/component/elements/popup/Modal/ModalContent.js +9 -11
- package/lib/component/elements/popup/Modal/Provider.js +39 -44
- package/lib/component/elements/popup/Modal/index.js +4 -15
- package/lib/component/elements/popup/Transition.js +11 -14
- package/lib/component/elements/popup/Wrapper.js +15 -18
- package/lib/component/elements/popup/options.js +3 -6
- package/lib/component/elements/popup/utility.js +1 -4
- package/lib/component/elements/resizer/DivResizer.js +12 -18
- package/lib/component/elements/resizer/Resizer.js +6 -12
- package/lib/component/elements/resizer/SVGResizer.js +9 -15
- package/lib/component/elements/resizer/useResizer.js +12 -18
- package/lib/component/elements/toggle/ToggleButton.js +8 -11
- package/lib/component/elements/toggle/ToggleButtonGroup.js +15 -21
- package/lib/component/header/ApodizationOptionsPanel.js +23 -52
- package/lib/component/header/AutoPeakPickingOptionPanel.js +20 -48
- package/lib/component/header/BaseLineCorrectionPanel.js +24 -53
- package/lib/component/header/Header.js +57 -64
- package/lib/component/header/HeaderContainer.js +3 -7
- package/lib/component/header/PhaseCorrectionPanel.js +33 -39
- package/lib/component/header/RangesPickingOptionPanel.js +20 -48
- package/lib/component/header/ZeroFillingOptionsPanel.js +24 -30
- package/lib/component/header/Zones2DOptionPanel.js +17 -45
- package/lib/component/highlight/index.js +22 -28
- package/lib/component/hooks/useActiveSpectra.js +5 -9
- package/lib/component/hooks/useActiveSpectrum.js +5 -9
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +7 -11
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js +7 -11
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +9 -15
- package/lib/component/hooks/useActiveSpectrumZonesViewState.js +7 -11
- package/lib/component/hooks/useCheckExperimentalFeature.js +3 -6
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +8 -15
- package/lib/component/hooks/useCheckToolsVisibility.js +15 -22
- package/lib/component/hooks/useCombinedRefs.js +4 -7
- package/lib/component/hooks/useDatumWithSpectraStatistics.js +9 -15
- package/lib/component/hooks/useExport.js +31 -37
- package/lib/component/hooks/useFilter.js +5 -12
- package/lib/component/hooks/useFormatNumberByNucleus.js +9 -16
- package/lib/component/hooks/useIntegralPath.js +21 -24
- package/lib/component/hooks/useNucleus.js +5 -8
- package/lib/component/hooks/usePanelPreferences.js +22 -30
- package/lib/component/hooks/useResizerStatus.js +5 -9
- package/lib/component/hooks/useSaveSettings.js +19 -49
- package/lib/component/hooks/useSpectraPerNucleus.js +7 -13
- package/lib/component/hooks/useSpectrum.js +7 -10
- package/lib/component/hooks/useTableSortBy.js +11 -18
- package/lib/component/hooks/useToolsFunctions.js +29 -35
- package/lib/component/hooks/useVerticalAlign.js +5 -9
- package/lib/component/hooks/useXScale.js +6 -10
- package/lib/component/hooks/useXYReduce.js +9 -13
- package/lib/component/loader/DefaultSpinnerComponent.js +5 -8
- package/lib/component/loader/DropZone.js +36 -38
- package/lib/component/loader/NoData.js +7 -9
- package/lib/component/loader/Spinner.js +11 -16
- package/lib/component/loader/SpinnerContext.js +7 -14
- package/lib/component/main/ErrorOverlay.js +6 -12
- package/lib/component/main/InnerNMRium.js +31 -61
- package/lib/component/main/InnerNMRiumContents.js +25 -32
- package/lib/component/main/NMRium.d.ts +0 -2
- package/lib/component/main/NMRium.js +11 -19
- package/lib/component/main/NMRiumStateProvider.js +27 -33
- package/lib/component/main/SplitPaneWrapper.js +6 -10
- package/lib/component/main/StateError.js +7 -11
- package/lib/component/main/index.js +3 -21
- package/lib/component/main/types.js +1 -2
- package/lib/component/modal/AboutPredictionModal.js +9 -14
- package/lib/component/modal/AboutSpectrumSimulationModal.js +9 -14
- package/lib/component/modal/AlignSpectraModal.js +29 -57
- package/lib/component/modal/CopyClipboardModal.js +7 -12
- package/lib/component/modal/EditPeakShapeModal.js +21 -49
- package/lib/component/modal/ExportAsJcampModal.js +16 -21
- package/lib/component/modal/ImportPublicationStringModal.js +19 -47
- package/lib/component/modal/LoadJCAMPModal.js +19 -49
- package/lib/component/modal/LogsHistoryModal.js +20 -27
- package/lib/component/modal/ModalStyle.js +2 -5
- package/lib/component/modal/MoleculeStructureEditorModal.js +18 -22
- package/lib/component/modal/MultipletAnalysisModal.js +23 -29
- package/lib/component/modal/PredictSpectraModal.js +32 -39
- package/lib/component/modal/SaveAsModal.js +23 -29
- package/lib/component/modal/aboutUs/AboutUsModal.js +16 -21
- package/lib/component/modal/aboutUs/AboutUsZakodium.js +11 -17
- package/lib/component/modal/changeSum/ChangeSumModal.js +6 -9
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +20 -50
- package/lib/component/modal/changeSum/SelectMolecule.js +18 -24
- package/lib/component/modal/editRange/EditRangeModal.js +43 -48
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +25 -53
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +24 -29
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +6 -11
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +7 -11
- package/lib/component/modal/editRange/forms/components/SignalFormTab.js +7 -12
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +40 -45
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +4 -29
- package/lib/component/modal/editZone/EditPathLengthFormik.js +14 -19
- package/lib/component/modal/editZone/EditZoneModal.js +24 -29
- package/lib/component/modal/editZone/SignalFormTab.js +4 -9
- package/lib/component/modal/editZone/SignalsForm.js +20 -25
- package/lib/component/modal/editZone/validation/EditZoneValidation.js +2 -27
- package/lib/component/modal/editZone/validation/isDefaultPathLength.js +5 -10
- package/lib/component/modal/metaImportation/MetaImportationModal.js +40 -68
- package/lib/component/modal/metaImportation/index.js +11 -19
- package/lib/component/modal/metaImportation/utils/mapColumnToSelectItems.js +1 -5
- package/lib/component/modal/setting/GeneralSettings.js +56 -84
- package/lib/component/modal/setting/WorkspaceItem.js +8 -13
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +22 -27
- package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +7 -12
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +16 -21
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +8 -13
- package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +12 -17
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +30 -35
- package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +15 -20
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +6 -11
- package/lib/component/modal/setting/settingsValidation.js +20 -23
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +16 -21
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +11 -16
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +16 -23
- package/lib/component/panels/InformationPanel.js +8 -14
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +44 -73
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +38 -66
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +22 -27
- package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +12 -19
- package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +30 -37
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +42 -71
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +14 -20
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +34 -40
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +44 -50
- package/lib/component/panels/MoleculesPanel/Utilities.js +5 -13
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +39 -45
- package/lib/component/panels/MultipleSpectraAnalysisPanel/AnalysisChart.js +31 -37
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +54 -60
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +25 -30
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisCell.js +7 -9
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +12 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +18 -25
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +23 -28
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +12 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +26 -54
- package/lib/component/panels/PanelNoData.js +3 -7
- package/lib/component/panels/Panels.js +50 -57
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +54 -83
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +18 -23
- package/lib/component/panels/PeaksPanel/PeaksTable.js +42 -70
- package/lib/component/panels/PeaksPanel/PeaksToggleActions.js +5 -12
- package/lib/component/panels/RangesPanel/RangesHeader.js +36 -64
- package/lib/component/panels/RangesPanel/RangesPanel.js +45 -51
- package/lib/component/panels/RangesPanel/RangesPreferences.js +20 -25
- package/lib/component/panels/RangesPanel/RangesTable.js +16 -21
- package/lib/component/panels/RangesPanel/RangesTableRow.js +38 -43
- package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +4 -6
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +11 -16
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +7 -12
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +8 -10
- package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +4 -6
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +10 -15
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +7 -12
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +9 -14
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +8 -10
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +21 -27
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +17 -11
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +28 -34
- package/lib/component/panels/SpectrumsPanel/SpectraPreferences.js +26 -31
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +43 -50
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +10 -15
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +28 -34
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +6 -8
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +11 -14
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +17 -24
- package/lib/component/panels/SpectrumsPanel/base/SpectrumName.js +8 -12
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.js +6 -9
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +9 -14
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +7 -12
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +9 -14
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +11 -16
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +13 -18
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +5 -9
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +41 -46
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +34 -39
- package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -7
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +13 -18
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +42 -47
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +7 -9
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +20 -49
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +21 -26
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +15 -20
- package/lib/component/panels/SummaryPanel/Overview.js +13 -15
- package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +14 -20
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +14 -20
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +70 -98
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +41 -57
- package/lib/component/panels/SummaryPanel/utilities/useInView.js +8 -10
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +23 -28
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +4 -6
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +5 -10
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +14 -19
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +4 -6
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +5 -10
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +42 -71
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +21 -26
- package/lib/component/panels/ZonesPanel/ZonesTable.js +21 -26
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +32 -37
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +3 -7
- package/lib/component/panels/databasePanel/DatabasePanel.js +81 -87
- package/lib/component/panels/databasePanel/DatabasePreferences.js +19 -47
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +22 -29
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +6 -13
- package/lib/component/panels/databasePanel/DatabaseTable.js +27 -32
- package/lib/component/panels/extra/BasicPanelStyle.js +2 -5
- package/lib/component/panels/extra/placeholder/NoDataForFid.js +4 -10
- package/lib/component/panels/extra/placeholder/NoTableData.js +3 -5
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +7 -15
- package/lib/component/panels/extra/preferences/NucleusGroup.js +4 -11
- package/lib/component/panels/extra/preferences/NucleusPreferences.js +5 -12
- package/lib/component/panels/extra/preferences/PreferencesContainer.js +3 -7
- package/lib/component/panels/extra/preferences/PreferencesGroup.js +4 -8
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +5 -10
- package/lib/component/panels/extra/utilities/UseToggleStatus.js +6 -8
- package/lib/component/panels/filtersPanel/FilterPanel.js +12 -18
- package/lib/component/panels/filtersPanel/FiltersTable.js +33 -39
- package/lib/component/panels/header/DefaultPanelHeader.js +10 -17
- package/lib/component/panels/header/PanelHeader.js +3 -6
- package/lib/component/panels/header/PreferencesHeader.js +8 -13
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +15 -22
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +22 -50
- package/lib/component/panels/predictionPanel/PredictionPanel.js +40 -46
- package/lib/component/panels/predictionPanel/PredictionPreferences.js +13 -18
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +20 -48
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +31 -37
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +14 -19
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +12 -18
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +15 -22
- package/lib/component/reducer/IgnoreActions.js +1 -3
- package/lib/component/reducer/Reducer.js +29 -58
- package/lib/component/reducer/actions/AssignmentsActions.js +1 -4
- package/lib/component/reducer/actions/CorrelationsActions.js +27 -38
- package/lib/component/reducer/actions/DatabaseActions.js +14 -18
- package/lib/component/reducer/actions/DimensionsActions.js +1 -4
- package/lib/component/reducer/actions/DomainActions.js +25 -37
- package/lib/component/reducer/actions/FiltersActions.js +99 -128
- package/lib/component/reducer/actions/HistoryActions.js +4 -9
- package/lib/component/reducer/actions/IntegralsActions.js +34 -46
- package/lib/component/reducer/actions/LoadActions.js +32 -64
- package/lib/component/reducer/actions/MoleculeActions.js +26 -63
- package/lib/component/reducer/actions/PeaksActions.js +35 -49
- package/lib/component/reducer/actions/PreferencesActions.js +9 -17
- package/lib/component/reducer/actions/RangesActions.js +91 -117
- package/lib/component/reducer/actions/SpectraAnalysisAction.js +1 -4
- package/lib/component/reducer/actions/SpectrumsActions.js +63 -82
- package/lib/component/reducer/actions/ToolsActions.js +81 -129
- package/lib/component/reducer/actions/ZonesActions.js +63 -83
- package/lib/component/reducer/core/Constants.js +1 -4
- package/lib/component/reducer/helper/GetClosestNumber.js +1 -3
- package/lib/component/reducer/helper/Zoom1DManager.js +9 -13
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -7
- package/lib/component/reducer/helper/get2DRange.js +4 -7
- package/lib/component/reducer/helper/getActiveSpectra.js +1 -5
- package/lib/component/reducer/helper/getActiveSpectraAsObject.js +4 -9
- package/lib/component/reducer/helper/getActiveSpectrum.js +1 -5
- package/lib/component/reducer/helper/getRange.js +4 -9
- package/lib/component/reducer/helper/getSpectrum.js +3 -7
- package/lib/component/reducer/helper/getStrongestPeak.js +5 -9
- package/lib/component/reducer/helper/getVerticalAlign.js +1 -5
- package/lib/component/reducer/preferences/actions/addWorkspace.js +9 -16
- package/lib/component/reducer/preferences/actions/analyzeSpectra.js +15 -45
- package/lib/component/reducer/preferences/actions/applyGeneralPreferences.js +1 -5
- package/lib/component/reducer/preferences/actions/initPreferences.js +11 -15
- package/lib/component/reducer/preferences/actions/matrixGeneration.js +7 -12
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +4 -8
- package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +4 -8
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +3 -7
- package/lib/component/reducer/preferences/actions/setPreferences.js +10 -17
- package/lib/component/reducer/preferences/actions/setVerticalSplitterPosition.js +3 -7
- package/lib/component/reducer/preferences/actions/setWorkspace.js +8 -12
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -12
- package/lib/component/reducer/preferences/preferencesReducer.js +51 -58
- package/lib/component/reducer/preferences/utilities/checkKeysExists.js +4 -8
- package/lib/component/reducer/preferences/utilities/filterObject.js +1 -5
- package/lib/component/reducer/preferences/utilities/flatObject.js +1 -5
- package/lib/component/reducer/preferences/utilities/getActiveWorkspace.js +1 -5
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.js +4 -11
- package/lib/component/reducer/preferences/utilities/initWorkspace.js +4 -11
- package/lib/component/reducer/preferences/utilities/isReadOnlyWorkspace.js +1 -5
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +1 -5
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.js +4 -11
- package/lib/component/reducer/scaleReducer.js +15 -18
- package/lib/component/reducer/types/ActionType.js +1 -2
- package/lib/component/toolbar/BasicToolBar.js +52 -58
- package/lib/component/toolbar/FunctionToolBar.js +30 -36
- package/lib/component/toolbar/ToolBar.js +11 -17
- package/lib/component/toolbar/ToolTypes.js +10 -13
- package/lib/component/utility/Evaluate.js +1 -4
- package/lib/component/utility/Events.js +3 -8
- package/lib/component/utility/FileUtility.js +1 -5
- package/lib/component/utility/GroupByInfoKey.js +1 -4
- package/lib/component/utility/LocalStorage.js +15 -26
- package/lib/component/utility/PathBuilder.js +1 -5
- package/lib/component/utility/PreferencesHelper.js +5 -8
- package/lib/component/utility/assert.js +1 -5
- package/lib/component/utility/convertPathArrayToString.js +1 -5
- package/lib/component/utility/export.js +14 -27
- package/lib/component/utility/filterType.js +1 -2
- package/lib/component/utility/formatNumber.js +3 -10
- package/lib/component/utility/getSpectraByNucleus.js +3 -10
- package/lib/component/utility/getSpectraObjectPaths.js +1 -5
- package/lib/component/utility/getUniqueNuclei.js +1 -5
- package/lib/component/utility/isGoogleDocument.js +1 -5
- package/lib/component/utility/jpathToArray.js +1 -5
- package/lib/component/utility/nucleusToString.js +2 -7
- package/lib/component/utility/parseColor.js +1 -5
- package/lib/component/workspaces/assignment.js +1 -4
- package/lib/component/workspaces/basic.js +1 -4
- package/lib/component/workspaces/embedded.js +1 -4
- package/lib/component/workspaces/exercise.js +1 -4
- package/lib/component/workspaces/index.js +15 -17
- package/lib/component/workspaces/prediction.js +1 -4
- package/lib/component/workspaces/process1D.js +1 -4
- package/lib/component/workspaces/simulation.js +1 -4
- package/lib/component/workspaces/workspaceDefaultProperties.js +22 -25
- package/lib/constants.js +7 -10
- package/lib/data/PredictionManager.js +28 -37
- package/lib/data/SpectraManager.js +20 -49
- package/lib/data/constants/DefaultApodizationOptions.js +1 -4
- package/lib/data/constants/DefaultPathLengths.js +1 -3
- package/lib/data/constants/Multiplets.js +2 -5
- package/lib/data/constants/References.js +4 -8
- package/lib/data/constants/signalsKinds.js +5 -8
- package/lib/data/data1d/Spectrum1D/SumManager.js +11 -22
- package/lib/data/data1d/Spectrum1D/cloneDatum1D.js +1 -5
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +1 -5
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +3 -6
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.js +5 -9
- package/lib/data/data1d/Spectrum1D/get1DColor.js +3 -7
- package/lib/data/data1d/Spectrum1D/get1DDataXY.js +1 -5
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +10 -17
- package/lib/data/data1d/Spectrum1D/index.js +19 -45
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +23 -27
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -5
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +5 -12
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js +1 -5
- package/lib/data/data1d/Spectrum1D/isSpectrum1D.js +1 -5
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +6 -13
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +5 -12
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +3 -10
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +7 -11
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +13 -21
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +3 -6
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +9 -16
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -5
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +1 -5
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.js +4 -8
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +9 -13
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +8 -15
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +11 -15
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +5 -9
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +5 -12
- package/lib/data/data1d/database.js +16 -24
- package/lib/data/data1d/multipleSpectraAnalysis.js +22 -37
- package/lib/data/data1d/spectrumSimulation.js +5 -10
- package/lib/data/data2d/Processing2D.js +7 -11
- package/lib/data/data2d/Spectrum2D/cloneDatum2D.js +1 -5
- package/lib/data/data2d/Spectrum2D/contours.js +5 -11
- package/lib/data/data2d/Spectrum2D/get2DColor.js +3 -7
- package/lib/data/data2d/Spectrum2D/get2DSpectrumErrorValue.js +1 -5
- package/lib/data/data2d/Spectrum2D/getMissingProjection.js +5 -9
- package/lib/data/data2d/Spectrum2D/getShift.js +4 -8
- package/lib/data/data2d/Spectrum2D/getSlice.js +7 -11
- package/lib/data/data2d/Spectrum2D/index.js +9 -21
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +11 -15
- package/lib/data/data2d/Spectrum2D/isSpectrum2D.js +1 -5
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +4 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +5 -9
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +5 -9
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +3 -7
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +5 -12
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.js +1 -5
- package/lib/data/data2d/Spectrum2D/zones/updateZones.js +3 -7
- package/lib/data/defaults/13c.js +1 -3
- package/lib/data/defaults/1h.js +1 -3
- package/lib/data/defaults/default.js +5 -12
- package/lib/data/getDefaultMatrixFilters.js +3 -10
- package/lib/data/matrixGeneration.js +10 -18
- package/lib/data/molecules/Molecule.js +9 -17
- package/lib/data/molecules/MoleculeManager.js +20 -30
- package/lib/data/parseMeta/index.js +4 -14
- package/lib/data/parseMeta/isMetaFile.js +1 -5
- package/lib/data/parseMeta/linkMetaWithSpectra.js +8 -17
- package/lib/data/parseMeta/mapErrors.js +1 -5
- package/lib/data/parseMeta/parseMetaFile.js +3 -7
- package/lib/data/parseMeta/prepareKey.js +1 -5
- package/lib/data/types/common/File.js +1 -2
- package/lib/data/types/common/Info.js +1 -2
- package/lib/data/types/common/MapOptions.js +1 -2
- package/lib/data/types/common/Nucleus.js +1 -2
- package/lib/data/types/common/SignalKind.js +1 -2
- package/lib/data/types/data1d/ComplexData1D.js +1 -2
- package/lib/data/types/data1d/ExclusionZone.js +1 -2
- package/lib/data/types/data1d/MatrixOptions.js +1 -2
- package/lib/data/types/data1d/RangeDetectionResult.js +1 -2
- package/lib/data/types/data1d/index.js +1 -2
- package/lib/data/types/data2d/ContourOptions.js +1 -2
- package/lib/data/types/data2d/index.js +1 -2
- package/lib/data/utilities/Concatenation.js +3 -7
- package/lib/data/utilities/FindUtilities.js +1 -9
- package/lib/data/utilities/RangeUtilities.js +16 -31
- package/lib/data/utilities/ZoneUtilities.js +10 -21
- package/lib/data/utilities/calculateSanPlot.js +3 -7
- package/lib/data/utilities/checkModifierKeyActivated.js +1 -4
- package/lib/data/utilities/convertSpectraListToObject.js +1 -5
- package/lib/data/utilities/generateChar.js +1 -4
- package/lib/data/utilities/generateColor.js +5 -11
- package/lib/data/utilities/generateNumbersPowerOfX.js +1 -4
- package/lib/data/utilities/getAtom.js +1 -4
- package/lib/data/utilities/getAtomsFromMF.js +1 -4
- package/lib/data/utilities/getSum.js +1 -5
- package/lib/data/utilities/isInRange.js +1 -4
- package/lib/data/utilities/isNumber.js +1 -5
- package/lib/types/NMRiumDataReturn.js +1 -2
- package/lib/types/UsedColors.js +1 -2
- package/lib/utils/clipboard/clipboard.d.ts +1 -1
- package/lib/utils/clipboard/clipboard.js +5 -13
- package/lib/utils/clipboard/clipboardComponents.js +28 -36
- package/lib/utils/clipboard/clipboardHooks.js +18 -25
- package/lib/utils/clipboard/types.js +1 -2
- package/lib/utils/stringCapitalize.js +1 -5
- package/lib/versionInfo.js +1 -3
- package/package.json +2 -2
|
@@ -1,47 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
-
const nmr_processing_1 = require("nmr-processing");
|
|
31
|
-
const DefaultApodizationOptions_1 = require("../../data/constants/DefaultApodizationOptions");
|
|
32
|
-
const ChartContext_1 = require("../context/ChartContext");
|
|
33
|
-
const ScaleContext_1 = require("../context/ScaleContext");
|
|
34
|
-
const useActiveSpectrum_1 = require("../hooks/useActiveSpectrum");
|
|
35
|
-
const useSpectrum_1 = __importDefault(require("../hooks/useSpectrum"));
|
|
36
|
-
const useVerticalAlign_1 = require("../hooks/useVerticalAlign");
|
|
37
|
-
const useXYReduce_1 = __importStar(require("../hooks/useXYReduce"));
|
|
38
|
-
const PathBuilder_1 = require("../utility/PathBuilder");
|
|
39
|
-
const scale_1 = require("./utilities/scale");
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Filters, apodization } from 'nmr-processing';
|
|
3
|
+
import { defaultApodizationOptions } from '../../data/constants/DefaultApodizationOptions';
|
|
4
|
+
import { useChartData } from '../context/ChartContext';
|
|
5
|
+
import { useScaleChecked } from '../context/ScaleContext';
|
|
6
|
+
import { useActiveSpectrum } from '../hooks/useActiveSpectrum';
|
|
7
|
+
import useSpectrum from '../hooks/useSpectrum';
|
|
8
|
+
import { useVerticalAlign } from '../hooks/useVerticalAlign';
|
|
9
|
+
import useXYReduce, { XYReducerDomainAxis } from '../hooks/useXYReduce';
|
|
10
|
+
import { PathBuilder } from '../utility/PathBuilder';
|
|
11
|
+
import { getYScale } from './utilities/scale';
|
|
40
12
|
const emptyData = { data: {}, info: {} };
|
|
41
13
|
function useWindowYScale() {
|
|
42
|
-
const { height, margin, yDomains } =
|
|
43
|
-
const verticalAlign =
|
|
44
|
-
return
|
|
14
|
+
const { height, margin, yDomains } = useChartData();
|
|
15
|
+
const verticalAlign = useVerticalAlign();
|
|
16
|
+
return getYScale({
|
|
45
17
|
height,
|
|
46
18
|
margin,
|
|
47
19
|
verticalAlign,
|
|
@@ -50,22 +22,22 @@ function useWindowYScale() {
|
|
|
50
22
|
});
|
|
51
23
|
}
|
|
52
24
|
function ApodizationLine() {
|
|
53
|
-
const { toolOptions: { selectedTool, data: { apodizationOptions }, }, } =
|
|
54
|
-
const activeSpectrum =
|
|
55
|
-
const { scaleX } =
|
|
56
|
-
const spectrum = (
|
|
57
|
-
const xyReduce = (
|
|
25
|
+
const { toolOptions: { selectedTool, data: { apodizationOptions }, }, } = useChartData();
|
|
26
|
+
const activeSpectrum = useActiveSpectrum();
|
|
27
|
+
const { scaleX } = useScaleChecked();
|
|
28
|
+
const spectrum = useSpectrum({ emptyData });
|
|
29
|
+
const xyReduce = useXYReduce(XYReducerDomainAxis.XAxis);
|
|
58
30
|
const scaleY = useWindowYScale();
|
|
59
|
-
if (!activeSpectrum?.id || selectedTool !==
|
|
31
|
+
if (!activeSpectrum?.id || selectedTool !== Filters.apodization.id) {
|
|
60
32
|
return null;
|
|
61
33
|
}
|
|
62
34
|
const paths = () => {
|
|
63
|
-
const pathBuilder = new
|
|
35
|
+
const pathBuilder = new PathBuilder();
|
|
64
36
|
const { re, im = [], x } = spectrum.data;
|
|
65
|
-
const { lineBroadening, gaussBroadening, lineBroadeningCenter } = apodizationOptions ||
|
|
37
|
+
const { lineBroadening, gaussBroadening, lineBroadeningCenter } = apodizationOptions || defaultApodizationOptions;
|
|
66
38
|
const length = re.length;
|
|
67
39
|
const dw = (x[length - 1] - x[0]) / (length - 1);
|
|
68
|
-
const { windowData: y } =
|
|
40
|
+
const { windowData: y } = apodization({ re, im }, {
|
|
69
41
|
apply: false,
|
|
70
42
|
compose: {
|
|
71
43
|
length,
|
|
@@ -98,6 +70,6 @@ function ApodizationLine() {
|
|
|
98
70
|
return '';
|
|
99
71
|
}
|
|
100
72
|
};
|
|
101
|
-
return ((
|
|
73
|
+
return (_jsx("path", { "data-testid": "apodization-line", stroke: "green", fill: "none", strokeWidth: "2", d: paths() }));
|
|
102
74
|
}
|
|
103
|
-
|
|
75
|
+
export default ApodizationLine;
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const PeakEditionManager_1 = require("./peaks/PeakEditionManager");
|
|
19
|
-
const Peaks_1 = __importDefault(require("./peaks/Peaks"));
|
|
20
|
-
const PeaksShapes_1 = __importDefault(require("./peaks/PeaksShapes"));
|
|
21
|
-
const Ranges_1 = __importDefault(require("./ranges/Ranges"));
|
|
22
|
-
const BaseLineZones_1 = __importDefault(require("./tool/BaseLineZones"));
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import SpectrumInfoBlock from '../1d-2d/components/SpectrumInfoBlock';
|
|
3
|
+
import { usePreferences } from '../context/PreferencesContext';
|
|
4
|
+
import ApodizationLine from './ApodizationLine';
|
|
5
|
+
import ExclusionZonesAnnotations from './ExclusionZonesAnnotations';
|
|
6
|
+
import LinesSeries from './LinesSeries';
|
|
7
|
+
import SpectraTracker from './SpectraLegends';
|
|
8
|
+
import XAxis from './XAxis';
|
|
9
|
+
import DatabaseElements from './database/DatabaseElements';
|
|
10
|
+
import IntegralsSeries from './integral/IntegralsSeries';
|
|
11
|
+
import JGraph from './jCouplingGraph/JGraph';
|
|
12
|
+
import MultiAnalysisRanges from './multiAnalysis/MultiAnalysisRanges';
|
|
13
|
+
import { PeakEditionProvider } from './peaks/PeakEditionManager';
|
|
14
|
+
import Peaks from './peaks/Peaks';
|
|
15
|
+
import PeaksShapes from './peaks/PeaksShapes';
|
|
16
|
+
import Ranges from './ranges/Ranges';
|
|
17
|
+
import BaseLineZones from './tool/BaseLineZones';
|
|
23
18
|
function Chart1D({ mode, width, height, margin, displayerKey }) {
|
|
24
|
-
const { current: { general: { spectraRendering }, }, } =
|
|
25
|
-
return ((
|
|
19
|
+
const { current: { general: { spectraRendering }, }, } = usePreferences();
|
|
20
|
+
return (_jsx(PeakEditionProvider, { children: _jsxs("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, id: "nmrSVG", shapeRendering: spectraRendering, children: [_jsx("defs", { children: _jsx("clipPath", { id: `${displayerKey}clip-chart-1d`, children: _jsx("rect", { width: `${width - margin.left - margin.right}`, height: `${height}`, x: `${margin.left}`, y: `${0}` }) }) }), _jsx(LinesSeries, {}), _jsx(ApodizationLine, {}), _jsx(IntegralsSeries, {}), _jsx(Peaks, { peaksSource: "peaks" }), _jsx(Ranges, {}), _jsx(Peaks, { peaksSource: "ranges" }), _jsx(JGraph, {}), _jsx(MultiAnalysisRanges, {}), _jsx(BaseLineZones, {}), _jsx(ExclusionZonesAnnotations, {}), _jsx(DatabaseElements, {}), _jsx(PeaksShapes, {}), _jsx(SpectraTracker, {}), _jsx(SpectrumInfoBlock, {}), _jsx("g", { className: "container", style: { pointerEvents: 'none' }, children: _jsx(XAxis, { showGrid: true, mode: mode }) })] }) }));
|
|
26
21
|
}
|
|
27
|
-
|
|
22
|
+
export default Chart1D;
|
|
@@ -1,34 +1,29 @@
|
|
|
1
|
-
|
|
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("@emotion/react/jsx-runtime");
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
7
2
|
/** @jsxImportSource @emotion/react */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const style =
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { Filters } from 'nmr-processing';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { useScaleChecked } from '../context/ScaleContext';
|
|
7
|
+
import { HighlightEventSource, useHighlight } from '../highlight';
|
|
8
|
+
import useActiveSpectrumStyleOptions from '../hooks/useActiveSpectrumStyleOptions';
|
|
9
|
+
const style = css `
|
|
15
10
|
&:hover {
|
|
16
11
|
fill: #ff6f0057 !important;
|
|
17
12
|
}
|
|
18
13
|
`;
|
|
19
14
|
function ExclusionZoneAnnotation({ zone, color, vAlign, spectrumID, filterId, }) {
|
|
20
|
-
const { scaleX, scaleY } =
|
|
21
|
-
const type = filterId ===
|
|
22
|
-
?
|
|
23
|
-
:
|
|
24
|
-
const highlight =
|
|
15
|
+
const { scaleX, scaleY } = useScaleChecked();
|
|
16
|
+
const type = filterId === Filters.signalProcessing.id
|
|
17
|
+
? HighlightEventSource.MATRIX_GENERATION_EXCLUSION_ZONE
|
|
18
|
+
: HighlightEventSource.EXCLUSION_ZONE;
|
|
19
|
+
const highlight = useHighlight([], {
|
|
25
20
|
type,
|
|
26
21
|
extra: { zone, spectrumID },
|
|
27
22
|
});
|
|
28
|
-
const { opacity } = (
|
|
29
|
-
return ((
|
|
30
|
-
fill: filterId ===
|
|
23
|
+
const { opacity } = useActiveSpectrumStyleOptions(spectrumID);
|
|
24
|
+
return (_jsx("g", { transform: `translate(${scaleX()(zone.to)},0)`, children: _jsx("rect", { x: "0", css: style, transform: `translate(0,${scaleY()(0) - (vAlign + 5)})`, width: `${scaleX()(zone.from) - scaleX()(zone.to)}`, height: "10px", style: {
|
|
25
|
+
fill: filterId === Filters.signalProcessing.id ? 'gray' : color,
|
|
31
26
|
opacity,
|
|
32
27
|
}, ...highlight.onHover }) }, zone.id));
|
|
33
28
|
}
|
|
34
|
-
|
|
29
|
+
export default memo(ExclusionZoneAnnotation);
|
|
@@ -1,43 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const ChartContext_1 = require("../context/ChartContext");
|
|
10
|
-
const ScaleContext_1 = require("../context/ScaleContext");
|
|
11
|
-
const useSpectraPerNucleus_1 = __importDefault(require("../hooks/useSpectraPerNucleus"));
|
|
12
|
-
const ExclusionZoneAnnotation_1 = __importDefault(require("./ExclusionZoneAnnotation"));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Filters } from 'nmr-processing';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { useChartData } from '../context/ChartContext';
|
|
5
|
+
import { useScale } from '../context/ScaleContext';
|
|
6
|
+
import useSpectraByActiveNucleus from '../hooks/useSpectraPerNucleus';
|
|
7
|
+
import ExclusionZoneAnnotation from './ExclusionZoneAnnotation';
|
|
13
8
|
function ExclusionZonesAnnotationsInner({ displayerKey, xDomains, spectra, shiftY, }) {
|
|
14
|
-
return ((
|
|
9
|
+
return (_jsx("g", { className: "spectrum-exclusion-zones-group", clipPath: `url(#${displayerKey}clip-chart-1d)`, children: spectra
|
|
15
10
|
.filter((d) => d.display.isVisible && xDomains[d.id])
|
|
16
11
|
.map((d, index) => getExclusionZones(d).map((record) => {
|
|
17
12
|
return record.zones.map((zone) => {
|
|
18
|
-
return ((
|
|
13
|
+
return (_jsx(ExclusionZoneAnnotation, { spectrumID: d.id, vAlign: shiftY * index, zone: zone, filterId: record.id, color: d.display.color }, zone.id));
|
|
19
14
|
});
|
|
20
15
|
})) }));
|
|
21
16
|
}
|
|
22
|
-
const MemoizedPeakAnnotations =
|
|
17
|
+
const MemoizedPeakAnnotations = memo(ExclusionZonesAnnotationsInner);
|
|
23
18
|
function ExclusionZonesAnnotations() {
|
|
24
|
-
const { displayerKey, xDomains, displayerMode } =
|
|
25
|
-
const { shiftY } =
|
|
26
|
-
const spectra = (
|
|
19
|
+
const { displayerKey, xDomains, displayerMode } = useChartData();
|
|
20
|
+
const { shiftY } = useScale();
|
|
21
|
+
const spectra = useSpectraByActiveNucleus();
|
|
27
22
|
if (displayerMode !== '1D')
|
|
28
23
|
return null;
|
|
29
|
-
return ((
|
|
24
|
+
return (_jsx(MemoizedPeakAnnotations, { spectra: spectra, displayerKey: displayerKey, xDomains: xDomains, shiftY: shiftY }));
|
|
30
25
|
}
|
|
31
|
-
|
|
26
|
+
export default ExclusionZonesAnnotations;
|
|
32
27
|
function getExclusionZones(data) {
|
|
33
28
|
const zones = [];
|
|
34
29
|
for (const filter of data.filters) {
|
|
35
|
-
if (filter.name ===
|
|
36
|
-
zones.push({ id:
|
|
30
|
+
if (filter.name === Filters.exclusionZones.id && filter.flag) {
|
|
31
|
+
zones.push({ id: Filters.exclusionZones.id, zones: filter.value });
|
|
37
32
|
}
|
|
38
|
-
else if (filter.name ===
|
|
33
|
+
else if (filter.name === Filters.signalProcessing.id && filter.flag) {
|
|
39
34
|
zones.push({
|
|
40
|
-
id:
|
|
35
|
+
id: Filters.signalProcessing.id,
|
|
41
36
|
zones: filter.value.exclusionsZones,
|
|
42
37
|
});
|
|
43
38
|
}
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
|
|
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("@emotion/react/jsx-runtime");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
7
2
|
/** @jsxImportSource @emotion/react */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const styles =
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { BsCursor } from 'react-icons/bs';
|
|
7
|
+
import { IoPulseSharp } from 'react-icons/io5';
|
|
8
|
+
import { get1DDataXY } from '../../data/data1d/Spectrum1D/get1DDataXY';
|
|
9
|
+
import { useBrushTracker } from '../EventsTrackers/BrushTracker';
|
|
10
|
+
import { useMouseTracker } from '../EventsTrackers/MouseTracker';
|
|
11
|
+
import { useChartData } from '../context/ChartContext';
|
|
12
|
+
import { useScaleChecked } from '../context/ScaleContext';
|
|
13
|
+
import { useActiveSpectrum } from '../hooks/useActiveSpectrum';
|
|
14
|
+
import { useFormatNumberByNucleus } from '../hooks/useFormatNumberByNucleus';
|
|
15
|
+
import useSpectrum from '../hooks/useSpectrum';
|
|
16
|
+
const styles = css `
|
|
22
17
|
display: flex;
|
|
23
18
|
align-items: center;
|
|
24
19
|
pointer-events: bounding-box;
|
|
@@ -81,42 +76,41 @@ const styles = (0, react_1.css) `
|
|
|
81
76
|
}
|
|
82
77
|
`;
|
|
83
78
|
function FooterBannerInner({ margin, width, height, activeSpectrum, spectrum, activeTab, }) {
|
|
84
|
-
const position =
|
|
85
|
-
const { startX, endX, step, mouseButton } =
|
|
86
|
-
const { scaleX } =
|
|
87
|
-
const format =
|
|
79
|
+
const position = useMouseTracker();
|
|
80
|
+
const { startX, endX, step, mouseButton } = useBrushTracker();
|
|
81
|
+
const { scaleX } = useScaleChecked();
|
|
82
|
+
const format = useFormatNumberByNucleus(activeTab);
|
|
88
83
|
if (!position ||
|
|
89
84
|
position.y < margin.top ||
|
|
90
85
|
position.x < margin.left ||
|
|
91
86
|
position.x > width - margin.right ||
|
|
92
87
|
position.y > height - margin.bottom) {
|
|
93
|
-
return (
|
|
88
|
+
return _jsx("div", { css: styles });
|
|
94
89
|
}
|
|
95
90
|
function getXIndex(xPosition) {
|
|
96
91
|
if (spectrum) {
|
|
97
|
-
const data =
|
|
98
|
-
return
|
|
92
|
+
const data = get1DDataXY(spectrum);
|
|
93
|
+
return xFindClosestIndex(data.x, scaleX().invert(xPosition));
|
|
99
94
|
}
|
|
100
95
|
return 0;
|
|
101
96
|
}
|
|
102
97
|
function getYValue(xPosition) {
|
|
103
98
|
if (spectrum) {
|
|
104
|
-
const data =
|
|
99
|
+
const data = get1DDataXY(spectrum);
|
|
105
100
|
const xIndex = getXIndex(xPosition);
|
|
106
101
|
return data.y[xIndex];
|
|
107
102
|
}
|
|
108
103
|
return 1;
|
|
109
104
|
}
|
|
110
105
|
const isBrushing = step === 'brushing' && mouseButton === 'main';
|
|
111
|
-
return ((
|
|
112
|
-
spectrum?.info?.originFrequency).toPrecision(5) })] })), isBrushing && ((
|
|
113
|
-
100).toFixed(2), "%"] })] }))] })), activeSpectrum && ((
|
|
106
|
+
return (_jsxs("div", { css: styles, children: [_jsx(BsCursor, {}), _jsxs("div", { children: [_jsx("span", { className: "label", children: " \uD835\uDEC5: " }), _jsx("span", { className: "value", children: format(scaleX().invert(position.x)) }), _jsx("span", { className: "unit", children: "ppm" }), activeSpectrum && spectrum?.info?.originFrequency && (_jsxs(_Fragment, { children: [_jsxs("span", { className: "value", children: ["\u00A0(", format(scaleX().invert(position.x) * spectrum?.info?.originFrequency, 'hz')] }), _jsx("span", { className: "unit", children: "Hz" }), _jsx("span", { className: "value", children: ") " }), _jsxs("span", { className: "small-width-none", children: [_jsx("span", { children: "," }), _jsx("span", { className: "label", children: " Index: " }), _jsx("span", { className: "value", children: getXIndex(position.x) })] })] }))] }), isBrushing && (_jsxs("div", { className: "flex-row small-width-none", children: [_jsx("span", { className: "label", children: " \u0394ppm: " }), _jsx("span", { className: "value", children: (scaleX().invert(startX) - scaleX().invert(endX)).toPrecision(6) })] })), activeSpectrum && (_jsxs("div", { className: " flex-row small-width-none", children: [spectrum?.info?.originFrequency && isBrushing && (_jsxs("div", { children: [_jsx("span", { className: "label", children: " \u0394Hz: " }), _jsx("span", { className: "value", children: ((scaleX().invert(startX) - scaleX().invert(endX)) *
|
|
107
|
+
spectrum?.info?.originFrequency).toPrecision(5) })] })), isBrushing && (_jsxs("div", { children: [_jsx("span", { className: "label", children: " ratio :" }), _jsxs("span", { className: "value", children: [((getYValue(startX) / (getYValue(endX) || Number.MIN_VALUE)) *
|
|
108
|
+
100).toFixed(2), "%"] })] }))] })), activeSpectrum && (_jsxs("div", { className: "flex-row small-width-none", children: [_jsx("div", { className: "separator" }), _jsx(IoPulseSharp, {}), _jsxs("div", { children: [_jsx("span", { className: "label", children: "Intensity: " }), _jsx("span", { className: "value y-value", children: format(getYValue(position.x)) })] })] }))] }));
|
|
114
109
|
}
|
|
115
|
-
const MemoizedFooterBanner =
|
|
116
|
-
function FooterBanner() {
|
|
117
|
-
const { margin, width, height, view: { spectra: { activeTab }, }, } =
|
|
118
|
-
const activeSpectrum =
|
|
119
|
-
const spectrum = (
|
|
120
|
-
return ((
|
|
110
|
+
const MemoizedFooterBanner = memo(FooterBannerInner);
|
|
111
|
+
export default function FooterBanner() {
|
|
112
|
+
const { margin, width, height, view: { spectra: { activeTab }, }, } = useChartData();
|
|
113
|
+
const activeSpectrum = useActiveSpectrum();
|
|
114
|
+
const spectrum = useSpectrum(null);
|
|
115
|
+
return (_jsx(MemoizedFooterBanner, { margin, width, height, activeSpectrum, spectrum, activeTab }));
|
|
121
116
|
}
|
|
122
|
-
exports.default = FooterBanner;
|
package/lib/component/1d/Line.js
CHANGED
|
@@ -1,46 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
-
const react_1 = require("react");
|
|
31
|
-
const ScaleContext_1 = require("../context/ScaleContext");
|
|
32
|
-
const useActiveSpectrumStyleOptions_1 = __importDefault(require("../hooks/useActiveSpectrumStyleOptions"));
|
|
33
|
-
const useXYReduce_1 = __importStar(require("../hooks/useXYReduce"));
|
|
34
|
-
const PathBuilder_1 = require("../utility/PathBuilder");
|
|
35
|
-
const parseColor_1 = require("../utility/parseColor");
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useScaleChecked } from '../context/ScaleContext';
|
|
4
|
+
import useActiveSpectrumStyleOptions from '../hooks/useActiveSpectrumStyleOptions';
|
|
5
|
+
import useXYReduce, { XYReducerDomainAxis } from '../hooks/useXYReduce';
|
|
6
|
+
import { PathBuilder } from '../utility/PathBuilder';
|
|
7
|
+
import { parseColor } from '../utility/parseColor';
|
|
36
8
|
function Line({ data, id, display, index }) {
|
|
37
|
-
const { scaleX, scaleY, shiftY } =
|
|
38
|
-
const xyReduce = (
|
|
39
|
-
const { opacity } = (
|
|
40
|
-
const paths =
|
|
9
|
+
const { scaleX, scaleY, shiftY } = useScaleChecked();
|
|
10
|
+
const xyReduce = useXYReduce(XYReducerDomainAxis.XAxis);
|
|
11
|
+
const { opacity } = useActiveSpectrumStyleOptions(id);
|
|
12
|
+
const paths = useMemo(() => {
|
|
41
13
|
const _scaleX = scaleX();
|
|
42
14
|
const _scaleY = scaleY(id);
|
|
43
|
-
const pathBuilder = new
|
|
15
|
+
const pathBuilder = new PathBuilder();
|
|
44
16
|
if (data?.x && data?.y && _scaleX(0)) {
|
|
45
17
|
const pathPoints = xyReduce(data);
|
|
46
18
|
pathBuilder.moveTo(_scaleX(pathPoints.x[0]), _scaleY(pathPoints.y[0]));
|
|
@@ -53,7 +25,7 @@ function Line({ data, id, display, index }) {
|
|
|
53
25
|
return '';
|
|
54
26
|
}
|
|
55
27
|
}, [scaleX, scaleY, id, data, xyReduce]);
|
|
56
|
-
const { color: stroke, opacity: strokeOpacity } =
|
|
57
|
-
return ((
|
|
28
|
+
const { color: stroke, opacity: strokeOpacity } = parseColor(display?.color || 'black');
|
|
29
|
+
return (_jsx("path", { className: "line", "data-testid": "spectrum-line", stroke: stroke, fill: "none", strokeOpacity: opacity === 1 ? strokeOpacity : opacity, d: paths, transform: `translate(0,-${shiftY * index})` }, id));
|
|
58
30
|
}
|
|
59
|
-
|
|
31
|
+
export default Line;
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const get1DDataXY_1 = require("../../data/data1d/Spectrum1D/get1DDataXY");
|
|
8
|
-
const isSpectrum1D_1 = require("../../data/data1d/Spectrum1D/isSpectrum1D");
|
|
9
|
-
const ChartContext_1 = require("../context/ChartContext");
|
|
10
|
-
const useActiveSpectra_1 = require("../hooks/useActiveSpectra");
|
|
11
|
-
const Line_1 = __importDefault(require("./Line"));
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { get1DDataXY } from '../../data/data1d/Spectrum1D/get1DDataXY';
|
|
3
|
+
import { isSpectrum1D } from '../../data/data1d/Spectrum1D/isSpectrum1D';
|
|
4
|
+
import { useChartData } from '../context/ChartContext';
|
|
5
|
+
import { useActiveSpectra } from '../hooks/useActiveSpectra';
|
|
6
|
+
import Line from './Line';
|
|
12
7
|
function LinesSeries() {
|
|
13
|
-
const { data, displayerKey, xDomains } =
|
|
14
|
-
const activeSpectra =
|
|
15
|
-
const spectra = (data?.filter((d) =>
|
|
16
|
-
return ((
|
|
8
|
+
const { data, displayerKey, xDomains } = useChartData();
|
|
9
|
+
const activeSpectra = useActiveSpectra();
|
|
10
|
+
const spectra = (data?.filter((d) => isSpectrum1D(d) && d.display.isVisible && xDomains[d.id]) || []);
|
|
11
|
+
return (_jsxs("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, className: "spectrums", children: [spectra.map((d, i) => (_jsx("g", { id: d.id, children: _jsx(Line, { display: d.display, id: d.id, data: get1DDataXY(d), index: i }) }, d.id))), activeSpectra?.map((activeSpectrum) => (_jsx("use", { href: `#${activeSpectrum.id}` }, activeSpectrum.id)))] }));
|
|
17
12
|
}
|
|
18
|
-
|
|
13
|
+
export default LinesSeries;
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const ChartContext_1 = require("../context/ChartContext");
|
|
12
|
-
const ScaleContext_1 = require("../context/ScaleContext");
|
|
13
|
-
const SVGGroup_1 = require("../elements/SVGGroup");
|
|
14
|
-
const usePanelPreferences_1 = require("../hooks/usePanelPreferences");
|
|
15
|
-
const convertPathArrayToString_1 = require("../utility/convertPathArrayToString");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import lodashGet from 'lodash/get';
|
|
3
|
+
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
4
|
+
import { get1DDataXY } from '../../data/data1d/Spectrum1D/get1DDataXY';
|
|
5
|
+
import { useMouseTracker } from '../EventsTrackers/MouseTracker';
|
|
6
|
+
import { useChartData } from '../context/ChartContext';
|
|
7
|
+
import { useScale } from '../context/ScaleContext';
|
|
8
|
+
import { SVGGroup } from '../elements/SVGGroup';
|
|
9
|
+
import { usePanelPreferences } from '../hooks/usePanelPreferences';
|
|
10
|
+
import { convertPathArrayToString } from '../utility/convertPathArrayToString';
|
|
16
11
|
const styles = {
|
|
17
12
|
text: {
|
|
18
13
|
fontSize: '12px',
|
|
@@ -24,41 +19,41 @@ const styles = {
|
|
|
24
19
|
},
|
|
25
20
|
};
|
|
26
21
|
function YTracker({ datum }) {
|
|
27
|
-
const { scaleX } =
|
|
28
|
-
const position =
|
|
22
|
+
const { scaleX } = useScale();
|
|
23
|
+
const position = useMouseTracker();
|
|
29
24
|
if (!scaleX || !position) {
|
|
30
25
|
return null;
|
|
31
26
|
}
|
|
32
|
-
const xIndex =
|
|
33
|
-
return ((
|
|
27
|
+
const xIndex = xFindClosestIndex(datum.x, scaleX().invert(position.x));
|
|
28
|
+
return (_jsx("text", { style: styles.text, alignmentBaseline: "middle", children: datum.y[xIndex] }));
|
|
34
29
|
}
|
|
35
30
|
function InnerSpectraLegends({ spectra, legendsFields, }) {
|
|
36
|
-
return ((
|
|
31
|
+
return (_jsx("g", { className: "spectra-intensity-legend", children: spectra.map((spectrum, index) => (_jsxs("g", { transform: `translate(5,${20 * (index + 1)})`, children: [_jsx("rect", { style: {
|
|
37
32
|
...styles.colorIndicator,
|
|
38
33
|
fill: spectrum.display.color,
|
|
39
|
-
} }), (
|
|
34
|
+
} }), _jsx(SVGGroup, { space: 5, style: { transform: 'translate(12px,0)' }, children: legendsFields.map((field) => {
|
|
40
35
|
const predefinedField = field;
|
|
41
36
|
switch (predefinedField?.name) {
|
|
42
37
|
case 'intensity':
|
|
43
|
-
return ((
|
|
38
|
+
return (_jsxs("g", { children: [_jsx(YTracker, { datum: get1DDataXY(spectrum) }), _jsx("rect", { width: "55", height: "1", fill: "transparent" })] }, "intensity"));
|
|
44
39
|
case 'name':
|
|
45
|
-
return ((
|
|
40
|
+
return (_jsx("text", { alignmentBaseline: "middle", style: styles.text, children: spectrum.info.name }, "name"));
|
|
46
41
|
default: {
|
|
47
42
|
const jpath = field.jpath;
|
|
48
|
-
const value = (
|
|
49
|
-
return ((
|
|
43
|
+
const value = lodashGet(spectrum, jpath, '');
|
|
44
|
+
return (_jsx("text", { alignmentBaseline: "middle", style: styles.text, children: value }, convertPathArrayToString(jpath)));
|
|
50
45
|
}
|
|
51
46
|
}
|
|
52
47
|
}) })] }, spectrum.id))) }));
|
|
53
48
|
}
|
|
54
49
|
function SpectraLegends() {
|
|
55
|
-
const { data, view: { spectra: { activeTab, showLegend }, }, xDomains, } =
|
|
56
|
-
const { legendsFields } =
|
|
50
|
+
const { data, view: { spectra: { activeTab, showLegend }, }, xDomains, } = useChartData();
|
|
51
|
+
const { legendsFields } = usePanelPreferences('multipleSpectraAnalysis', activeTab);
|
|
57
52
|
if (!showLegend)
|
|
58
53
|
return null;
|
|
59
54
|
const spectra = data.filter((spectrum) => spectrum.display.isVisible &&
|
|
60
55
|
xDomains[spectrum.id] &&
|
|
61
56
|
spectrum.info.nucleus === activeTab);
|
|
62
|
-
return ((
|
|
57
|
+
return (_jsx(InnerSpectraLegends, { spectra: spectra, legendsFields: legendsFields }));
|
|
63
58
|
}
|
|
64
|
-
|
|
59
|
+
export default SpectraLegends;
|