nmrium 1.12.0 → 2.0.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/database/DatabaseSpectrum.d.ts.map +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js.map +1 -1
- package/lib/component/1d-2d/components/SpectrumInfoBlock.d.ts.map +1 -1
- package/lib/component/1d-2d/components/SpectrumInfoBlock.js +3 -17
- package/lib/component/1d-2d/components/SpectrumInfoBlock.js.map +1 -1
- package/lib/component/2d/ft/Contours.d.ts.map +1 -1
- package/lib/component/2d/ft/Contours.js +10 -12
- package/lib/component/2d/ft/Contours.js.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.js +1 -1
- package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
- package/lib/component/hooks/reduce2DSpectrum.d.ts +4 -0
- package/lib/component/hooks/reduce2DSpectrum.d.ts.map +1 -0
- package/lib/component/hooks/reduce2DSpectrum.js +60 -0
- package/lib/component/hooks/reduce2DSpectrum.js.map +1 -0
- package/lib/component/hooks/use2DReducer.d.ts +14 -0
- package/lib/component/hooks/use2DReducer.d.ts.map +1 -0
- package/lib/component/hooks/use2DReducer.js +30 -0
- package/lib/component/hooks/use2DReducer.js.map +1 -0
- package/lib/component/hooks/useCreateNmriumZip.d.ts +3 -0
- package/lib/component/hooks/useCreateNmriumZip.d.ts.map +1 -0
- package/lib/component/hooks/useCreateNmriumZip.js +28 -0
- package/lib/component/hooks/useCreateNmriumZip.js.map +1 -0
- package/lib/component/hooks/useExport.d.ts +8 -5
- package/lib/component/hooks/useExport.d.ts.map +1 -1
- package/lib/component/hooks/useExport.js +4 -21
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/loader/useLoadFiles.d.ts.map +1 -1
- package/lib/component/loader/useLoadFiles.js +4 -5
- package/lib/component/loader/useLoadFiles.js.map +1 -1
- package/lib/component/main/InnerNMRium.d.ts.map +1 -1
- package/lib/component/main/InnerNMRium.js +2 -2
- package/lib/component/main/InnerNMRium.js.map +1 -1
- package/lib/component/main/NMRium.d.ts +48 -3
- package/lib/component/main/NMRium.d.ts.map +1 -1
- package/lib/component/main/NMRium.js.map +1 -1
- package/lib/component/main/NMRiumRefAPI.d.ts +2 -0
- package/lib/component/main/NMRiumRefAPI.d.ts.map +1 -1
- package/lib/component/main/NMRiumRefAPI.js +4 -1
- package/lib/component/main/NMRiumRefAPI.js.map +1 -1
- package/lib/component/main/NMRiumStateProvider.d.ts +5 -2
- package/lib/component/main/NMRiumStateProvider.d.ts.map +1 -1
- package/lib/component/main/NMRiumStateProvider.js +36 -30
- package/lib/component/main/NMRiumStateProvider.js.map +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +4 -4
- package/lib/component/modal/LoadJCAMPModal.js.map +1 -1
- package/lib/component/modal/setting/general_settings.d.ts.map +1 -1
- package/lib/component/modal/setting/general_settings.js +3 -3
- package/lib/component/modal/setting/general_settings.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts +4 -2
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js +46 -29
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js +10 -2
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +1353 -6
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js +43 -32
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.d.ts +1353 -6
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.js +88 -83
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts +466 -0
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.js +59 -0
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js +32 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.js +80 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js +37 -9
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.js +58 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.js +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.js +65 -112
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.js +3 -3
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.js +142 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.js +112 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.js +38 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table.d.ts +68 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table.js +133 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.d.ts +10 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.js +31 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.d.ts +71 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.js +67 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/{utils/checkUniqueByKey.d.ts → validation/check_unique_by_key.d.ts} +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/check_unique_by_key.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/{utils/checkUniqueByKey.js → validation/check_unique_by_key.js} +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/check_unique_by_key.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.d.ts +11 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.js +20 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.d.ts +32 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.js +11 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.d.ts +2 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.js +3 -6
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.d.ts +12 -4
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.js +4 -3
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.d.ts +20 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.js +12 -4
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.d.ts +54 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.js +22 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.d.ts +55 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.js +18 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.d.ts +32 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.js +34 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/utils.d.ts +13 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/utils.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/utils.js +20 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/utils.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts +255 -39
- package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation.js +16 -27
- package/lib/component/modal/setting/tanstack_general_settings/validation.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js +27 -0
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.js +3 -2
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.d.ts +2 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.js +8 -3
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js.map +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts.map +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +2 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js +26 -33
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js.map +1 -1
- package/lib/component/reducer/Reducer.d.ts.map +1 -1
- package/lib/component/reducer/Reducer.js +1 -3
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +2 -4
- package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.js +14 -5
- package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
- package/lib/component/reducer/actions/LoadAction.d.ts +1 -4
- package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -1
- package/lib/component/reducer/actions/LoadAction.js +8 -17
- package/lib/component/reducer/actions/LoadAction.js.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.js +3 -0
- package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.d.ts +5 -1
- package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.js +4 -2
- package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
- package/lib/component/reducer/preferences/actions/applyGeneralPreferences.d.ts.map +1 -1
- package/lib/component/reducer/preferences/actions/applyGeneralPreferences.js.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -3
- package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +9 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
- package/lib/data/PredictionManager.d.ts.map +1 -1
- package/lib/data/PredictionManager.js +3 -0
- package/lib/data/PredictionManager.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/contours.d.ts +7 -6
- package/lib/data/data2d/Spectrum2D/contours.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/contours.js +22 -6
- package/lib/data/data2d/Spectrum2D/contours.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -10
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
- package/lib/data/molecules/Molecule.d.ts +5 -1
- package/lib/data/molecules/Molecule.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.js +9 -7
- package/lib/data/molecules/Molecule.js.map +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +0 -6
- package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
- package/lib/data/molecules/MoleculeManager.js +25 -25
- package/lib/data/molecules/MoleculeManager.js.map +1 -1
- package/lib/versionInfo.d.ts.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib/versionInfo.js.map +1 -1
- package/package.json +30 -29
- package/src/component/1d/database/DatabaseSpectrum.tsx +3 -1
- package/src/component/1d-2d/components/SpectrumInfoBlock.tsx +10 -22
- package/src/component/2d/ft/Contours.tsx +14 -27
- package/src/component/elements/ActionsButtonsPopover.tsx +1 -1
- package/src/component/hooks/reduce2DSpectrum.ts +98 -0
- package/src/component/hooks/use2DReducer.tsx +56 -0
- package/src/component/hooks/useCreateNmriumZip.ts +37 -0
- package/src/component/hooks/useExport.tsx +16 -31
- package/src/component/loader/useLoadFiles.ts +6 -10
- package/src/component/main/InnerNMRium.tsx +4 -2
- package/src/component/main/NMRium.tsx +50 -2
- package/src/component/main/NMRiumRefAPI.ts +7 -1
- package/src/component/main/NMRiumStateProvider.tsx +57 -35
- package/src/component/modal/LoadJCAMPModal.tsx +4 -4
- package/src/component/modal/setting/general_settings.tsx +4 -3
- package/src/component/modal/setting/tanstack_general_settings/general_settings.tsx +80 -54
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.tsx +48 -1
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.tsx +75 -68
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.tsx +165 -184
- package/src/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.ts +95 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.tsx +81 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/database_tab.tsx +210 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.tsx +48 -8
- package/src/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.tsx +150 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/general_tab.tsx +3 -3
- package/src/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.tsx +164 -233
- package/src/component/modal/setting/tanstack_general_settings/tabs/panels_tab.tsx +10 -10
- package/src/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.tsx +352 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.tsx +248 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/tools_tab.tsx +155 -0
- package/src/component/modal/setting/tanstack_general_settings/ui/table.tsx +163 -0
- package/src/component/modal/setting/tanstack_general_settings/ui/table_section.tsx +52 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.ts +73 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.ts +23 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.ts +12 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.ts +4 -6
- package/src/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.ts +11 -8
- package/src/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.ts +17 -9
- package/src/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.ts +29 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.ts +26 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.ts +34 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/utils.ts +30 -0
- package/src/component/modal/setting/tanstack_general_settings/validation.ts +16 -31
- package/src/component/panels/MoleculesPanel/MoleculeStructure.tsx +35 -0
- package/src/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.tsx +3 -2
- package/src/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.tsx +12 -4
- package/src/component/panels/SpectraPanel/base/setting/SpectrumSetting.tsx +1 -1
- package/src/component/panels/databasePanel/DatabasePanel.tsx +6 -4
- package/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx +34 -49
- package/src/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.tsx +1 -1
- package/src/component/reducer/Reducer.ts +1 -3
- package/src/component/reducer/actions/FiltersActions.ts +16 -10
- package/src/component/reducer/actions/LoadAction.ts +12 -27
- package/src/component/reducer/actions/MoleculeActions.ts +3 -0
- package/src/component/reducer/actions/SpectraActions.ts +14 -6
- package/src/component/reducer/actions/ToolsActions.ts +3 -1
- package/src/component/reducer/preferences/actions/applyGeneralPreferences.ts +1 -2
- package/src/component/reducer/preferences/preferencesReducer.ts +4 -4
- package/src/component/workspaces/workspaceDefaultProperties.ts +9 -0
- package/src/data/PredictionManager.ts +3 -0
- package/src/data/data2d/Spectrum2D/contours.ts +28 -12
- package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +1 -17
- package/src/data/molecules/Molecule.ts +17 -7
- package/src/data/molecules/MoleculeManager.ts +31 -29
- package/src/versionInfo.ts +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/utils/checkUniqueByKey.d.ts.map +0 -1
- package/lib/component/modal/setting/tanstack_general_settings/utils/checkUniqueByKey.js.map +0 -1
- /package/src/component/modal/setting/tanstack_general_settings/{utils/checkUniqueByKey.ts → validation/check_unique_by_key.ts} +0 -0
|
@@ -14,6 +14,10 @@ export interface MoleculeBoundingRect {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT: MoleculeBoundingRect;
|
|
16
16
|
export type MoleculesView = Record<string, MoleculeView>;
|
|
17
|
-
|
|
17
|
+
type InitializeMoleculeOptions = {
|
|
18
|
+
text: string;
|
|
19
|
+
} & Omit<Partial<StateMolecule>, 'molfile'>;
|
|
20
|
+
export declare function initMolecule(options: InitializeMoleculeOptions): StateMoleculeExtended;
|
|
18
21
|
export declare function toJSON(molecule: StateMoleculeExtended): StateMolecule;
|
|
22
|
+
export {};
|
|
19
23
|
//# sourceMappingURL=Molecule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Molecule.d.ts","sourceRoot":"","sources":["../../../src/data/molecules/Molecule.ts"],"names":[],"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AAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,eAAO,MAAM,0CAA0C,EAAE,oBAMtD,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAEzD,KAAK,yBAAyB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CACtD,OAAO,CAAC,aAAa,CAAC,EACtB,SAAS,CACV,CAAC;AAEF,wBAAgB,YAAY,CAC1B,OAAO,EAAE,yBAAyB,GACjC,qBAAqB,CAwBvB;AAED,wBAAgB,MAAM,CAAC,QAAQ,EAAE,qBAAqB,GAAG,aAAa,CASrE"}
|
|
@@ -6,12 +6,14 @@ export const DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT = {
|
|
|
6
6
|
width: 130,
|
|
7
7
|
height: 120,
|
|
8
8
|
};
|
|
9
|
-
export function initMolecule(options
|
|
10
|
-
const id =
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
export function initMolecule(options) {
|
|
10
|
+
const { id = crypto.randomUUID(), label = 'p#', text } = options;
|
|
11
|
+
const molecule = Molecule.fromText(text);
|
|
12
|
+
if (!molecule) {
|
|
13
|
+
throw new Error('Failed to parse SMILES or molfile. Please paste a valid format');
|
|
14
|
+
}
|
|
15
|
+
const molfile = molecule.toMolfileV3();
|
|
16
|
+
const mfInfo = molecule.getMolecularFormula();
|
|
15
17
|
return {
|
|
16
18
|
id,
|
|
17
19
|
molfile,
|
|
@@ -20,7 +22,7 @@ export function initMolecule(options = {}) {
|
|
|
20
22
|
mf: mfInfo.formula,
|
|
21
23
|
em: mfInfo.absoluteWeight,
|
|
22
24
|
mw: mfInfo.relativeWeight,
|
|
23
|
-
svg:
|
|
25
|
+
svg: molecule.toSVG(50, 50),
|
|
24
26
|
atoms: getAtomsFromMF(mfInfo.formula),
|
|
25
27
|
};
|
|
26
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Molecule.js","sourceRoot":"","sources":["../../../src/data/molecules/Molecule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAoB5D,MAAM,CAAC,MAAM,0CAA0C,GACrD;IACE,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"Molecule.js","sourceRoot":"","sources":["../../../src/data/molecules/Molecule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAoB5D,MAAM,CAAC,MAAM,0CAA0C,GACrD;IACE,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;CACZ,CAAC;AASJ,MAAM,UAAU,YAAY,CAC1B,OAAkC;IAElC,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,KAAK,GAAG,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEjE,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEzC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,mBAAmB,EAAE,CAAC;IAE9C,OAAO;QACL,EAAE;QACF,OAAO;QACP,KAAK;QACL,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,EAAE,EAAE,MAAM,CAAC,OAAO;QAClB,EAAE,EAAE,MAAM,CAAC,cAAc;QACzB,EAAE,EAAE,MAAM,CAAC,cAAc;QACzB,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC;QAC3B,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC;KACtC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,QAA+B;IACpD,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;IAElD,OAAO;QACL,OAAO;QACP,KAAK;QACL,EAAE;QACF,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -10,12 +10,6 @@ export declare function setMolfile(molecules: StateMoleculeExtended[], currentMo
|
|
|
10
10
|
export declare function extractNumber(value: string): string | null;
|
|
11
11
|
export declare function extractLabelsNumbers(molecules: Array<Pick<StateMolecule, 'label'>>): number[];
|
|
12
12
|
export declare const parseErrorMessage = "Failed to parse SMILES or molfile. Please paste a valid format";
|
|
13
|
-
/**
|
|
14
|
-
* We will extract the molecule(s) from the text.
|
|
15
|
-
* Because a molfile is actually a SDF we can just call 'readSDF' method
|
|
16
|
-
* @param text - text containing one or several molecules in SMILES, molfile or SDF format
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
13
|
export declare function getMolecules(text?: string): StateMolecule[];
|
|
20
14
|
export {};
|
|
21
15
|
//# sourceMappingURL=MoleculeManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoleculeManager.d.ts","sourceRoot":"","sources":["../../../src/data/molecules/MoleculeManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAI3D,wBAAgB,QAAQ,CACtB,IAAI,EAAE,aAAa,EAAE,EACrB,iBAAiB,GAAE,aAAa,EAAO,
|
|
1
|
+
{"version":3,"file":"MoleculeManager.d.ts","sourceRoot":"","sources":["../../../src/data/molecules/MoleculeManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAI3D,wBAAgB,QAAQ,CACtB,IAAI,EAAE,aAAa,EAAE,EACrB,iBAAiB,GAAE,aAAa,EAAO,2BA0BxC;AAED,UAAU,iBAAiB;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,wBAAgB,UAAU,CACxB,SAAS,EAAE,qBAAqB,EAAE,EAClC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,iBAAiB,QAc3B;AAED,wBAAgB,UAAU,CACxB,SAAS,EAAE,qBAAqB,EAAE,EAClC,eAAe,EAAE,aAAa,QAY/B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,iBAE1C;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,YAU/C;AAcD,eAAO,MAAM,iBAAiB,mEACoC,CAAC;AA0CnE,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,mBAQzC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readSDF
|
|
1
|
+
import { readSDF } from '@zakodium/nmrium-core-plugins';
|
|
2
2
|
import { Molecule } from 'openchemlib';
|
|
3
3
|
import { initMolecule } from './Molecule.js';
|
|
4
4
|
//TODO: Move molecule initialization to nmrium-core and log an error if the molecule cannot be parsed.
|
|
@@ -6,18 +6,19 @@ export function fromJSON(mols, reservedMolecules = []) {
|
|
|
6
6
|
const reservedNumbers = extractLabelsNumbers(reservedMolecules.concat(mols));
|
|
7
7
|
const molecules = [];
|
|
8
8
|
for (const mol of mols) {
|
|
9
|
-
const
|
|
10
|
-
const atomCount = molecule.getAllAtoms();
|
|
11
|
-
if (atomCount === 0) {
|
|
12
|
-
continue;
|
|
13
|
-
}
|
|
9
|
+
const { molfile, label = `P${getLabelNumber(reservedNumbers)}`, id, ...others } = mol;
|
|
14
10
|
const moleculeOverride = {
|
|
15
|
-
...
|
|
16
|
-
|
|
17
|
-
label
|
|
18
|
-
id
|
|
11
|
+
...others,
|
|
12
|
+
text: molfile,
|
|
13
|
+
label,
|
|
14
|
+
id,
|
|
19
15
|
};
|
|
20
|
-
|
|
16
|
+
try {
|
|
17
|
+
molecules.push(initMolecule(moleculeOverride));
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
21
22
|
}
|
|
22
23
|
return molecules;
|
|
23
24
|
}
|
|
@@ -26,9 +27,8 @@ export function addMolfile(molecules, molfile, options) {
|
|
|
26
27
|
const reservedNumbers = extractLabelsNumbers(molecules);
|
|
27
28
|
// try to parse molfile
|
|
28
29
|
// this will throw if the molecule can not be parsed !
|
|
29
|
-
const molecule = Molecule.fromMolfile(molfile);
|
|
30
30
|
molecules.push(initMolecule({
|
|
31
|
-
|
|
31
|
+
text: molfile,
|
|
32
32
|
label: label ?? `P${getLabelNumber(reservedNumbers)}`,
|
|
33
33
|
id,
|
|
34
34
|
}));
|
|
@@ -37,9 +37,8 @@ export function setMolfile(molecules, currentMolecule) {
|
|
|
37
37
|
const { molfile, id, label } = currentMolecule;
|
|
38
38
|
// try to parse molfile
|
|
39
39
|
// this will throw if the molecule can not be parsed !
|
|
40
|
-
const molecule = Molecule.fromMolfile(molfile);
|
|
41
40
|
const _mol = initMolecule({
|
|
42
|
-
|
|
41
|
+
text: molfile,
|
|
43
42
|
id,
|
|
44
43
|
label,
|
|
45
44
|
});
|
|
@@ -92,20 +91,21 @@ function validateMolecules(molecules) {
|
|
|
92
91
|
* @param text - text containing one or several molecules in SMILES, molfile or SDF format
|
|
93
92
|
* @returns
|
|
94
93
|
*/
|
|
95
|
-
|
|
96
|
-
if (!text?.trim()) {
|
|
97
|
-
throw new Error(parseErrorMessage);
|
|
98
|
-
}
|
|
99
|
-
// parse SDF
|
|
100
|
-
let molecules = [];
|
|
101
|
-
const parse = /v[23]000/i.test(text) ? readSDF : readSMILES;
|
|
94
|
+
function parseSDF(text) {
|
|
102
95
|
try {
|
|
103
|
-
molecules =
|
|
96
|
+
const molecules = readSDF(text);
|
|
97
|
+
validateMolecules(molecules);
|
|
98
|
+
return molecules;
|
|
104
99
|
}
|
|
105
100
|
catch (error) {
|
|
106
101
|
throw new Error(parseErrorMessage, { cause: error });
|
|
107
102
|
}
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
}
|
|
104
|
+
export function getMolecules(text) {
|
|
105
|
+
if (!text?.trim()) {
|
|
106
|
+
throw new Error(parseErrorMessage);
|
|
107
|
+
}
|
|
108
|
+
const isSDF = /v[23]000/i.test(text);
|
|
109
|
+
return isSDF ? parseSDF(text) : [initMolecule({ text })];
|
|
110
110
|
}
|
|
111
111
|
//# sourceMappingURL=MoleculeManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoleculeManager.js","sourceRoot":"","sources":["../../../src/data/molecules/MoleculeManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"MoleculeManager.js","sourceRoot":"","sources":["../../../src/data/molecules/MoleculeManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,sGAAsG;AACtG,MAAM,UAAU,QAAQ,CACtB,IAAqB,EACrB,oBAAqC,EAAE;IAEvC,MAAM,eAAe,GAAG,oBAAoB,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AC3D,CAAC"}
|
package/lib/versionInfo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionInfo.d.ts","sourceRoot":"","sources":["../src/versionInfo.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"versionInfo.d.ts","sourceRoot":"","sources":["../src/versionInfo.ts"],"names":[],"mappings":";;;AAAA,wBAAqC"}
|
package/lib/versionInfo.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default { version: '
|
|
1
|
+
export default { version: 'v2.0.0' };
|
|
2
2
|
//# sourceMappingURL=versionInfo.js.map
|
package/lib/versionInfo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionInfo.js","sourceRoot":"","sources":["../src/versionInfo.ts"],"names":[],"mappings":"AAAA,eAAe,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"versionInfo.js","sourceRoot":"","sources":["../src/versionInfo.ts"],"names":[],"mappings":"AAAA,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nmrium",
|
|
3
3
|
"description": "React component to display and process nuclear magnetic resonance (NMR) spectra.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"clean-lib": "rimraf lib",
|
|
27
27
|
"cspell": "cspell lint \"**/*.tsx\"",
|
|
28
28
|
"dev": "vite --host localhost --port 3000 --open",
|
|
29
|
-
"eslint": "eslint . --cache",
|
|
29
|
+
"eslint": "eslint . --cache --max-warnings=150",
|
|
30
30
|
"eslint-fix": "node --run eslint -- --fix",
|
|
31
31
|
"install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
|
|
32
32
|
"knip": "knip",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"stylelint-fix": "node --run stylelint -- --fix",
|
|
43
43
|
"test": "node --run test-only && node --run check-types && node --run eslint && node --run prettier && node --run stylelint && node --run knip && node --run build-no-minify && node --run test-e2e",
|
|
44
44
|
"test-only": "vitest run --coverage",
|
|
45
|
-
"test-e2e": "playwright test --project
|
|
45
|
+
"test-e2e": "playwright test --project=chromium",
|
|
46
46
|
"test-e2e-server": "serve -l tcp://localhost:3000 build"
|
|
47
47
|
},
|
|
48
48
|
"bugs": {
|
|
@@ -63,18 +63,19 @@
|
|
|
63
63
|
"nmr-correlation": "2.3.3"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@atlaskit/pragmatic-drag-and-drop": "^1.7.
|
|
66
|
+
"@atlaskit/pragmatic-drag-and-drop": "^1.7.9",
|
|
67
67
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
68
68
|
"@emotion/react": "^11.14.0",
|
|
69
69
|
"@emotion/styled": "^11.14.1",
|
|
70
70
|
"@hookform/resolvers": "^5.2.2",
|
|
71
71
|
"@tanstack/react-form": "^1.28.3",
|
|
72
|
-
"@
|
|
73
|
-
"@zakodium/
|
|
74
|
-
"@zakodium/nmrium-core
|
|
72
|
+
"@tanstack/react-table": "^8.21.3",
|
|
73
|
+
"@zakodium/nmr-types": "^0.5.3",
|
|
74
|
+
"@zakodium/nmrium-core": "^0.7.1",
|
|
75
|
+
"@zakodium/nmrium-core-plugins": "^0.7.1",
|
|
75
76
|
"@zakodium/pdnd-esm": "^1.0.2",
|
|
76
|
-
"@zip.js/zip.js": "^2.8.
|
|
77
|
-
"cheminfo-font": "^1.
|
|
77
|
+
"@zip.js/zip.js": "^2.8.22",
|
|
78
|
+
"cheminfo-font": "^1.20.0",
|
|
78
79
|
"cheminfo-types": "^1.10.0",
|
|
79
80
|
"clipboard-polyfill": "^4.1.1",
|
|
80
81
|
"d3-array": "^3.2.4",
|
|
@@ -83,46 +84,46 @@
|
|
|
83
84
|
"dlv": "^1.1.3",
|
|
84
85
|
"eventemitter3": "^5.0.4",
|
|
85
86
|
"fifo-logger": "^2.0.1",
|
|
86
|
-
"file-collection": "^6.6.
|
|
87
|
+
"file-collection": "^6.6.1",
|
|
87
88
|
"file-saver": "^2.0.5",
|
|
88
89
|
"get-jpaths": "^1.4.0",
|
|
89
90
|
"immer": "^11.1.4",
|
|
90
91
|
"lodash": "^4.17.23",
|
|
91
|
-
"mf-parser": "^3.
|
|
92
|
+
"mf-parser": "^3.7.0",
|
|
92
93
|
"ml-array-mean": "^1.1.6",
|
|
93
94
|
"ml-array-median": "^1.1.6",
|
|
94
95
|
"ml-conrec": "^5.0.3",
|
|
95
96
|
"ml-gsd": "^13.1.1",
|
|
96
97
|
"ml-signal-processing": "^2.2.0",
|
|
97
|
-
"ml-spectra-processing": "^14.
|
|
98
|
+
"ml-spectra-processing": "^14.21.0",
|
|
98
99
|
"ml-tree-similarity": "^2.2.0",
|
|
99
100
|
"nmr-correlation": "2.3.3",
|
|
100
|
-
"nmr-processing": "^22.
|
|
101
|
+
"nmr-processing": "^22.5.2",
|
|
101
102
|
"numeral": "^2.0.6",
|
|
102
103
|
"openchemlib": "^9.20.0",
|
|
103
|
-
"openchemlib-utils": "^8.
|
|
104
|
+
"openchemlib-utils": "^8.13.1",
|
|
104
105
|
"papaparse": "^5.5.3",
|
|
105
106
|
"react-d3-utils": "^3.1.2",
|
|
106
107
|
"react-dropzone": "^15.0.0",
|
|
107
108
|
"react-error-boundary": "^6.1.1",
|
|
108
|
-
"react-hook-form": "^7.71.
|
|
109
|
-
"react-icons": "^5.
|
|
109
|
+
"react-hook-form": "^7.71.2",
|
|
110
|
+
"react-icons": "^5.6.0",
|
|
110
111
|
"react-inspector": "^9.0.0",
|
|
111
112
|
"react-mf": "^3.1.1",
|
|
112
|
-
"react-ocl": "^8.
|
|
113
|
+
"react-ocl": "^8.6.0",
|
|
113
114
|
"react-ocl-nmr": "^4.1.1",
|
|
114
115
|
"react-plot": "^3.1.2",
|
|
115
116
|
"react-rnd": "^10.5.2",
|
|
116
|
-
"react-science": "^19.
|
|
117
|
+
"react-science": "^19.10.1",
|
|
117
118
|
"react-table": "^7.8.0",
|
|
118
119
|
"smart-array-filter": "^5.0.0",
|
|
119
120
|
"yup": "^1.7.1",
|
|
120
121
|
"zod": "^4.3.6"
|
|
121
122
|
},
|
|
122
123
|
"devDependencies": {
|
|
123
|
-
"@blueprintjs/core": "^6.
|
|
124
|
-
"@blueprintjs/icons": "^6.
|
|
125
|
-
"@blueprintjs/select": "^6.1.
|
|
124
|
+
"@blueprintjs/core": "^6.9.1",
|
|
125
|
+
"@blueprintjs/icons": "^6.6.0",
|
|
126
|
+
"@blueprintjs/select": "^6.1.3",
|
|
126
127
|
"@playwright/test": "=1.57.0",
|
|
127
128
|
"@simbathesailor/use-what-changed": "^2.0.0",
|
|
128
129
|
"@types/d3-array": "^3.2.2",
|
|
@@ -130,8 +131,8 @@
|
|
|
130
131
|
"@types/d3-zoom": "^3.0.8",
|
|
131
132
|
"@types/dlv": "^1.1.5",
|
|
132
133
|
"@types/file-saver": "^2.0.7",
|
|
133
|
-
"@types/lodash": "^4.17.
|
|
134
|
-
"@types/node": "^25.
|
|
134
|
+
"@types/lodash": "^4.17.24",
|
|
135
|
+
"@types/node": "^25.3.3",
|
|
135
136
|
"@types/numeral": "^2.0.5",
|
|
136
137
|
"@types/papaparse": "^5.5.2",
|
|
137
138
|
"@types/react": "^18.3.13",
|
|
@@ -141,23 +142,23 @@
|
|
|
141
142
|
"@vitest/coverage-v8": "^4.0.18",
|
|
142
143
|
"@zakodium/tsconfig": "^1.0.2",
|
|
143
144
|
"cross-env": "^10.1.0",
|
|
144
|
-
"cspell": "^9.
|
|
145
|
+
"cspell": "^9.7.0",
|
|
145
146
|
"eslint": "^9.39.2",
|
|
146
147
|
"eslint-config-cheminfo-react": "^19.1.0",
|
|
147
148
|
"eslint-config-cheminfo-typescript": "^21.1.0",
|
|
148
|
-
"knip": "^5.
|
|
149
|
+
"knip": "^5.85.0",
|
|
149
150
|
"modern-normalize": "^3.0.1",
|
|
150
|
-
"postcss": "^8.5.
|
|
151
|
+
"postcss": "^8.5.8",
|
|
151
152
|
"postcss-styled-syntax": "^0.7.1",
|
|
152
153
|
"prettier": "^3.8.1",
|
|
153
154
|
"rc-menu": "^9.16.1",
|
|
154
155
|
"react": "^18.3.1",
|
|
155
156
|
"react-dom": "^18.3.1",
|
|
156
|
-
"react-router-dom": "^7.13.
|
|
157
|
+
"react-router-dom": "^7.13.1",
|
|
157
158
|
"rimraf": "^6.1.3",
|
|
158
159
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
159
|
-
"serve": "^14.2.
|
|
160
|
-
"stylelint": "^17.
|
|
160
|
+
"serve": "^14.2.6",
|
|
161
|
+
"stylelint": "^17.4.0",
|
|
161
162
|
"stylelint-config-standard": "^40.0.0",
|
|
162
163
|
"typescript": "~5.9.3",
|
|
163
164
|
"vite": "^7.3.1",
|
|
@@ -47,7 +47,9 @@ function DatabaseSpectrum() {
|
|
|
47
47
|
try {
|
|
48
48
|
setLoading(true);
|
|
49
49
|
const url = new URL(jcampRelativeURL, baseURL);
|
|
50
|
-
const
|
|
50
|
+
const {
|
|
51
|
+
state: { data },
|
|
52
|
+
} = await core.readFromWebSource({
|
|
51
53
|
entries: [{ relativePath: url.pathname, baseURL: url.origin }],
|
|
52
54
|
});
|
|
53
55
|
setLoading(false);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Spectrum } from '@zakodium/nmrium-core';
|
|
2
2
|
import dlv from 'dlv';
|
|
3
|
-
import type { CSSProperties } from 'react';
|
|
4
3
|
import { useState } from 'react';
|
|
5
4
|
import { useResizeObserver } from 'react-d3-utils';
|
|
6
5
|
import { BsArrowsMove } from 'react-icons/bs';
|
|
7
6
|
import { FaTimes } from 'react-icons/fa';
|
|
7
|
+
import { SVGStyledText } from 'react-science/ui';
|
|
8
8
|
|
|
9
9
|
import { useIsInset } from '../../1d/inset/InsetProvider.js';
|
|
10
10
|
import { useChartData } from '../../context/ChartContext.js';
|
|
@@ -22,22 +22,6 @@ const verticalSpace = 5;
|
|
|
22
22
|
const boxPadding = 0;
|
|
23
23
|
const dragShiftY = 24;
|
|
24
24
|
|
|
25
|
-
const styles: Record<'value' | 'label' | 'colorIndicator', CSSProperties> = {
|
|
26
|
-
label: {
|
|
27
|
-
fontSize: '11px',
|
|
28
|
-
fill: 'black',
|
|
29
|
-
fontWeight: 'bold',
|
|
30
|
-
},
|
|
31
|
-
value: {
|
|
32
|
-
fontSize: '12px',
|
|
33
|
-
fill: 'black',
|
|
34
|
-
},
|
|
35
|
-
colorIndicator: {
|
|
36
|
-
width: '10px',
|
|
37
|
-
height: '2px',
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
25
|
function getInfoValue(
|
|
42
26
|
spectrum: Spectrum,
|
|
43
27
|
field: { jpath: string[]; format: string },
|
|
@@ -81,9 +65,10 @@ function SpectrumInfoBlock() {
|
|
|
81
65
|
x: number;
|
|
82
66
|
y: number;
|
|
83
67
|
}>(coordinate);
|
|
68
|
+
|
|
84
69
|
const {
|
|
85
70
|
current: {
|
|
86
|
-
infoBlock: { visible, fields },
|
|
71
|
+
infoBlock: { visible, fields, nameStyle, valueStyle },
|
|
87
72
|
},
|
|
88
73
|
} = usePreferences();
|
|
89
74
|
|
|
@@ -95,10 +80,12 @@ function SpectrumInfoBlock() {
|
|
|
95
80
|
: infoFields?.length - (infoFields?.length % 2)
|
|
96
81
|
? 2
|
|
97
82
|
: 1) || 0);
|
|
83
|
+
|
|
98
84
|
const [
|
|
99
85
|
ref,
|
|
100
86
|
{ width: boxWidth, height: boxHeight } = { width: 0, height: 0 },
|
|
101
87
|
] = useResizeObserver();
|
|
88
|
+
|
|
102
89
|
const { onPointerDown } = useDraggable({
|
|
103
90
|
position: coordinate,
|
|
104
91
|
onChange: (dragEvent) => {
|
|
@@ -215,12 +202,13 @@ function SpectrumInfoBlock() {
|
|
|
215
202
|
space={verticalSpace}
|
|
216
203
|
key={field.jpath + field.label}
|
|
217
204
|
>
|
|
218
|
-
<
|
|
205
|
+
<SVGStyledText {...nameStyle} alignmentBaseline="middle">
|
|
219
206
|
{field.label} :
|
|
220
|
-
</
|
|
221
|
-
|
|
207
|
+
</SVGStyledText>
|
|
208
|
+
|
|
209
|
+
<SVGStyledText {...valueStyle} alignmentBaseline="middle">
|
|
222
210
|
{getInfoValue(spectrum, field)}
|
|
223
|
-
</
|
|
211
|
+
</SVGStyledText>
|
|
224
212
|
</SVGGroup>
|
|
225
213
|
);
|
|
226
214
|
})}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Spectrum2D } from '@zakodium/nmrium-core';
|
|
2
1
|
import debounce from 'lodash/debounce.js';
|
|
3
2
|
import { memo, useMemo, useRef } from 'react';
|
|
4
3
|
|
|
@@ -7,27 +6,25 @@ import { drawContours } from '../../../data/data2d/Spectrum2D/contours.js';
|
|
|
7
6
|
import { useChartData } from '../../context/ChartContext.js';
|
|
8
7
|
import { usePreferences } from '../../context/PreferencesContext.js';
|
|
9
8
|
import { useToaster } from '../../context/ToasterContext.js';
|
|
9
|
+
import type { SpectrumFTData } from '../../hooks/use2DReducer.tsx';
|
|
10
|
+
import { use2DReducer } from '../../hooks/use2DReducer.tsx';
|
|
10
11
|
import { useActiveSpectrum } from '../../hooks/useActiveSpectrum.js';
|
|
11
12
|
import { PathBuilder } from '../../utility/PathBuilder.js';
|
|
12
|
-
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus.js';
|
|
13
13
|
import { useScale2DX, useScale2DY } from '../utilities/scale.js';
|
|
14
14
|
|
|
15
15
|
interface ContoursPathsProps {
|
|
16
16
|
id: string;
|
|
17
17
|
color: string;
|
|
18
18
|
sign: LevelSign;
|
|
19
|
-
spectrum:
|
|
19
|
+
spectrum: SpectrumFTData;
|
|
20
20
|
onTimeout: () => void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
interface ContoursInnerProps {
|
|
24
|
-
spectra:
|
|
24
|
+
spectra: SpectrumFTData[];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function usePath(
|
|
28
|
-
spectrum: Spectrum2D,
|
|
29
|
-
contours: ReturnType<typeof drawContours>['contours'],
|
|
30
|
-
) {
|
|
27
|
+
function usePath(contours: ReturnType<typeof drawContours>['contours']) {
|
|
31
28
|
const scaleX = useScale2DX();
|
|
32
29
|
const scaleY = useScale2DY();
|
|
33
30
|
|
|
@@ -49,11 +46,12 @@ function usePath(
|
|
|
49
46
|
return pathBuilder.toString();
|
|
50
47
|
}
|
|
51
48
|
|
|
52
|
-
const useContoursLevel = (
|
|
49
|
+
const useContoursLevel = (spectrumID: string, sign: LevelSign) => {
|
|
53
50
|
const {
|
|
54
|
-
|
|
55
|
-
} =
|
|
56
|
-
|
|
51
|
+
view: { spectraContourLevels },
|
|
52
|
+
} = useChartData();
|
|
53
|
+
const level = spectraContourLevels[spectrumID]?.[sign];
|
|
54
|
+
return level;
|
|
57
55
|
};
|
|
58
56
|
|
|
59
57
|
function ContoursPaths({
|
|
@@ -65,7 +63,7 @@ function ContoursPaths({
|
|
|
65
63
|
}: ContoursPathsProps) {
|
|
66
64
|
const activeSpectrum = useActiveSpectrum();
|
|
67
65
|
const preferences = usePreferences();
|
|
68
|
-
const level = useContoursLevel(
|
|
66
|
+
const level = useContoursLevel(spectrumID, sign);
|
|
69
67
|
|
|
70
68
|
const contours = useMemo(() => {
|
|
71
69
|
const { contours, timeout } = drawContours(
|
|
@@ -79,7 +77,7 @@ function ContoursPaths({
|
|
|
79
77
|
return contours;
|
|
80
78
|
}, [spectrum, level, onTimeout, sign]);
|
|
81
79
|
|
|
82
|
-
const path = usePath(
|
|
80
|
+
const path = usePath(contours);
|
|
83
81
|
|
|
84
82
|
const opacity =
|
|
85
83
|
activeSpectrum === null || spectrumID === activeSpectrum.id
|
|
@@ -147,18 +145,7 @@ function ContoursInner({ spectra }: ContoursInnerProps) {
|
|
|
147
145
|
const MemoizedContours = memo(ContoursInner);
|
|
148
146
|
|
|
149
147
|
export default function Contours() {
|
|
150
|
-
const
|
|
151
|
-
data: spectra,
|
|
152
|
-
displayerKey,
|
|
153
|
-
view: {
|
|
154
|
-
spectra: { activeTab },
|
|
155
|
-
},
|
|
156
|
-
} = useChartData();
|
|
157
|
-
const spectra2d = useMemo<Spectrum2D[]>(() => {
|
|
158
|
-
return getSpectraByNucleus(activeTab, spectra).filter(
|
|
159
|
-
(datum) => datum.info.isFt,
|
|
160
|
-
) as Spectrum2D[];
|
|
161
|
-
}, [activeTab, spectra]);
|
|
148
|
+
const spectra = use2DReducer();
|
|
162
149
|
|
|
163
|
-
return <MemoizedContours {
|
|
150
|
+
return <MemoizedContours spectra={spectra} />;
|
|
164
151
|
}
|
|
@@ -195,7 +195,7 @@ export function ActionsButtonsPopover(props: ActionsButtonsPopoverProps) {
|
|
|
195
195
|
enforceFocus={false}
|
|
196
196
|
onOpening={handleMouseEnter}
|
|
197
197
|
disabled={disablePopover || disabled}
|
|
198
|
-
renderTarget={({ onMouseEnter, ...otherProps }) => (
|
|
198
|
+
renderTarget={({ onMouseEnter, isOpen, ...otherProps }) => (
|
|
199
199
|
<Wrapper
|
|
200
200
|
{...targetProps}
|
|
201
201
|
{...otherProps}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { NmrData2DContent } from 'cheminfo-types';
|
|
2
|
+
|
|
3
|
+
import type { Reduce2DSpectrumOptions } from './use2DReducer.tsx';
|
|
4
|
+
|
|
5
|
+
export function reduce2DSpectrum(
|
|
6
|
+
data: NmrData2DContent,
|
|
7
|
+
options: Reduce2DSpectrumOptions = {},
|
|
8
|
+
) {
|
|
9
|
+
const {
|
|
10
|
+
minY: originalMinY,
|
|
11
|
+
minX: originalMinX,
|
|
12
|
+
maxY: originalMaxY,
|
|
13
|
+
maxX: originalMaxX,
|
|
14
|
+
z,
|
|
15
|
+
} = data;
|
|
16
|
+
const {
|
|
17
|
+
numberOfPoints = 512,
|
|
18
|
+
fromX = originalMinX,
|
|
19
|
+
fromY = originalMinY,
|
|
20
|
+
toX = originalMaxX,
|
|
21
|
+
toY = originalMaxY,
|
|
22
|
+
} = options;
|
|
23
|
+
const nbPointsY = z.length;
|
|
24
|
+
const nbPointsX = z[0]?.length || 0;
|
|
25
|
+
|
|
26
|
+
if (nbPointsX <= numberOfPoints && nbPointsY <= numberOfPoints) {
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// need to find the indices in X and Y taking care that we are not out of bounds
|
|
31
|
+
const deltaX = (originalMaxX - originalMinX) / (nbPointsX - 1);
|
|
32
|
+
const deltaY = (originalMaxY - originalMinY) / (nbPointsY - 1);
|
|
33
|
+
|
|
34
|
+
const indexFromX = Math.max(0, Math.floor((fromX - originalMinX) / deltaX));
|
|
35
|
+
const indexToX = Math.min(
|
|
36
|
+
nbPointsX - 1,
|
|
37
|
+
Math.ceil((toX - originalMinX) / deltaX),
|
|
38
|
+
);
|
|
39
|
+
const indexFromY = Math.max(0, Math.floor((fromY - originalMinY) / deltaY));
|
|
40
|
+
const indexToY = Math.min(
|
|
41
|
+
nbPointsY - 1,
|
|
42
|
+
Math.ceil((toY - originalMinY) / deltaY),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const sourceNbPointsX = indexToX - indexFromX + 1;
|
|
46
|
+
const sourceNbPointsY = indexToY - indexFromY + 1;
|
|
47
|
+
const newNbPointsX = Math.min(sourceNbPointsX, numberOfPoints);
|
|
48
|
+
const newNbPointsY = Math.min(sourceNbPointsY, numberOfPoints);
|
|
49
|
+
|
|
50
|
+
// create the result object and fill with typed arrays
|
|
51
|
+
const reducedMatrix = [];
|
|
52
|
+
for (let i = 0; i < newNbPointsY; i++) {
|
|
53
|
+
reducedMatrix.push(new Float64Array(newNbPointsX));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Fill the reducedMatrix by aggregating the original values in each rectangle.
|
|
57
|
+
// If the sum of values in the rectangle is positive, take the max; otherwise take the min.
|
|
58
|
+
|
|
59
|
+
for (let newRow = 0; newRow < newNbPointsY; newRow++) {
|
|
60
|
+
const srcRowStart =
|
|
61
|
+
indexFromY + Math.floor((newRow * sourceNbPointsY) / newNbPointsY);
|
|
62
|
+
const srcRowEnd =
|
|
63
|
+
indexFromY + Math.floor(((newRow + 1) * sourceNbPointsY) / newNbPointsY);
|
|
64
|
+
|
|
65
|
+
for (let newCol = 0; newCol < newNbPointsX; newCol++) {
|
|
66
|
+
const srcColStart =
|
|
67
|
+
indexFromX + Math.floor((newCol * sourceNbPointsX) / newNbPointsX);
|
|
68
|
+
const srcColEnd =
|
|
69
|
+
indexFromX +
|
|
70
|
+
Math.floor(((newCol + 1) * sourceNbPointsX) / newNbPointsX);
|
|
71
|
+
|
|
72
|
+
let sum = 0;
|
|
73
|
+
let min = Number.POSITIVE_INFINITY;
|
|
74
|
+
let max = Number.NEGATIVE_INFINITY;
|
|
75
|
+
|
|
76
|
+
for (let row = srcRowStart; row < srcRowEnd; row++) {
|
|
77
|
+
const rowData = z[row];
|
|
78
|
+
for (let col = srcColStart; col < srcColEnd; col++) {
|
|
79
|
+
const value = rowData[col];
|
|
80
|
+
sum += value;
|
|
81
|
+
if (value < min) min = value;
|
|
82
|
+
if (value > max) max = value;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
reducedMatrix[newRow][newCol] = sum >= 0 ? max : min;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
...data,
|
|
92
|
+
minX: originalMinX + indexFromX * deltaX,
|
|
93
|
+
maxX: originalMinX + indexToX * deltaX,
|
|
94
|
+
minY: originalMinY + indexFromY * deltaY,
|
|
95
|
+
maxY: originalMinY + indexToY * deltaY,
|
|
96
|
+
z: reducedMatrix,
|
|
97
|
+
};
|
|
98
|
+
}
|