diff --git a/src/component/1d/LinesSeries.tsx b/src/component/1d/LinesSeries.tsx index f01cbc16c..59b18e595 100644 --- a/src/component/1d/LinesSeries.tsx +++ b/src/component/1d/LinesSeries.tsx @@ -10,6 +10,7 @@ import { useVerticalAlign } from '../hooks/useVerticalAlign.js'; import { useVisibleSpectra1D } from '../hooks/use_visible_spectra_1d.ts'; import Line from './Line.js'; +import { SpectrumLabel } from './SpectrumLabel.tsx'; import { useInsetOptions } from './inset/InsetProvider.js'; const BOX_SIZE = 10; @@ -31,6 +32,7 @@ function LinesSeries() { {spectra.map((d, i) => ( + diff --git a/src/component/1d/SpectrumLabel.tsx b/src/component/1d/SpectrumLabel.tsx new file mode 100644 index 000000000..420f46ec6 --- /dev/null +++ b/src/component/1d/SpectrumLabel.tsx @@ -0,0 +1,59 @@ +import type { Spectrum, SpectrumLabelField } from '@zakodium/nmrium-core'; +import { SVGStyledText } from 'react-science/ui'; + +import { useChartData } from '../context/ChartContext.tsx'; +import { usePreferences } from '../context/PreferencesContext.tsx'; +import { useScaleChecked } from '../context/ScaleContext.tsx'; +import { useVerticalAlign } from '../hooks/useVerticalAlign.ts'; +import { getValueByPath } from '../utility/getValueByPath.ts'; + +export function SpectrumLabel({ + index, + spectrum, +}: { + index: number; + spectrum: Spectrum; +}) { + const { spectraBottomMargin, shiftY } = useScaleChecked(); + const { + height, + margin, + toolOptions: { selectedTool }, + } = useChartData(); + const { current } = usePreferences(); + const verticalAlign = useVerticalAlign(); + const { fields, visible, valueStyle } = current.spectraLabel; + + if ( + verticalAlign !== 'stack' || + selectedTool !== 'zoom' || + !Array.isArray(fields) || + fields.length === 0 || + !visible + ) { + return null; + } + + const innerHeight = height - margin.bottom - spectraBottomMargin; + const label = getSpectrumLabel(fields, spectrum); + + return ( + + {label} + + ); +} + +function getSpectrumLabel( + fields: SpectrumLabelField[], + spectrum: Spectrum, +): string { + return fields + .filter((field) => field.visible) + .map((field) => getValueByPath(spectrum, field.jpath, field.format)) + .join(', '); +} diff --git a/src/component/1d/peaks/usePeakShapesPath.ts b/src/component/1d/peaks/usePeakShapesPath.ts index 530f7cad2..5e368624c 100644 --- a/src/component/1d/peaks/usePeakShapesPath.ts +++ b/src/component/1d/peaks/usePeakShapesPath.ts @@ -43,7 +43,7 @@ export function usePeakShapesPath(spectrum: Spectrum1D) { const { peaks } = options; pathSeries = peaksToXY(peaks, { frequency, - nbPoints: width, + nbPoints: Math.ceil(width), from: xDomain[0], to: xDomain[1], }); diff --git a/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.tsx b/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.tsx index 2bd74d90f..923f1a70d 100644 --- a/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.tsx +++ b/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.tsx @@ -16,6 +16,7 @@ import { ImportFiltersTab } from './tabs/import_filters_tab.js'; import { NucleiTab } from './tabs/nuclei_tab.js'; import { PanelsTab } from './tabs/panels_tab.js'; import { SpectraColorsTab } from './tabs/spectra_colors_tab.tsx'; +import { SpectraLabelTab } from './tabs/spectra_label_tab.tsx'; import { TitleBlockTab } from './tabs/title_block_tab.js'; import { ToolsTab } from './tabs/tools_tab.tsx'; import { @@ -107,6 +108,12 @@ export const GeneralSettingsDialogBody = withForm({ panel={} /> + } + /> + {isExperimentalEnabled && ( { + const { Section, AppField } = form; + + return ( + <> +
+ + {({ Checkbox }) => } + +
+ + + +
+ +
+ + ); + }, +}); + +type Field = z.input; +function getEmptyField(): Field { + return { + format: '', + jpath: '', + visible: true, + uuid: crypto.randomUUID(), + }; +} +const TableFields = withForm({ + defaultValues: defaultGeneralSettingsFormValues, + render: function Fields({ form }) { + const { Field } = form; + const fields = useField({ + form, + name: 'spectraLabel.fields', + mode: 'array', + }); + const { removeValue, setValue, pushValue, name, store } = fields; + + const [autoFocus, setAutoFocus] = useState(''); + function onAddField() { + const value = getEmptyField(); + pushValue(value, { dontRunListeners: true }); + setAutoFocus(value.uuid); + } + + const { data } = useChartData(); + const { datalist } = useMemo(() => getSpectraObjectPaths(data), [data]); + + const onDeleteAt = useCallback( + (index: number) => { + removeValue(index); + }, + [removeValue], + ); + + const columns = useMemo(() => { + const columnHelper = createTableColumnHelper(); + return [ + columnHelper.display({ + id: 'dnd', + header: '', + meta: { + tdStyle: { textAlign: 'center' }, + }, + cell: () => , + }), + columnHelper.accessor('jpath', { + header: 'Field', + cell: ({ row: { index, original } }) => ( + + {(field) => ( + setAutoFocus('')} + /> + )} + + ), + }), + columnHelper.accessor('format', { + header: 'Format', + cell: ({ row: { index } }) => ( + + {(field) => } + + ), + }), + columnHelper.accessor('visible', { + header: 'Visible', + meta: { + tdStyle: { textAlign: 'center' }, + }, + cell: ({ row: { index } }) => ( + + {(field) => } + + ), + }), + columnHelper.display({ + id: 'actions', + header: '', + meta: { + thStyle: { + width: '60px', + }, + }, + cell: ({ row: { index } }) => { + return ( + + onDeleteAt(index)} + > + + + + ); + }, + }), + ]; + }, [Field, autoFocus, datalist, name, onDeleteAt]); + + const onRowOrderChanged = useCallback( + (value: Field[]) => { + setValue(value); + }, + [setValue], + ); + + const fieldsData = useStore(store, (s) => s.value); + + return ( + + Add Field + + } + > + + + ); + }, +}); + +function getRowId(row: Field) { + return row.uuid; +} + +const TableDragRowHandlerStyled = styled(TableDragRowHandler)` + margin: 0 2px; +`; diff --git a/src/component/modal/setting/tanstack_general_settings/validation.ts b/src/component/modal/setting/tanstack_general_settings/validation.ts index 4fbe414f9..dc05c06d6 100644 --- a/src/component/modal/setting/tanstack_general_settings/validation.ts +++ b/src/component/modal/setting/tanstack_general_settings/validation.ts @@ -16,6 +16,7 @@ import { nmrLoadersValidation } from './validation/import_filters_tab_validation import { nucleiValidation } from './validation/nuclei_tab_validation.js'; import { displayPanelsValidation } from './validation/panels_tab_validation.js'; import { spectraColorsTabValidation } from './validation/spectra_colors_tab_validation.ts'; +import { spectraLabelTabValidation } from './validation/spectra_label_tab_validation.ts'; import { infoBlockTabValidation } from './validation/title_block_tab_validation.js'; import { toolBarButtonsValidation } from './validation/tools_tab_validation.ts'; @@ -45,6 +46,7 @@ export const workspaceValidation = z.object({ export: exportPreferencesValidation, peaksLabel: peaksLabelValidation, axis: axisValidation, + spectraLabel: spectraLabelTabValidation, }); export const defaultGeneralSettingsFormValues: z.input< diff --git a/src/component/modal/setting/tanstack_general_settings/validation/spectra_label_tab_validation.ts b/src/component/modal/setting/tanstack_general_settings/validation/spectra_label_tab_validation.ts new file mode 100644 index 000000000..54278203f --- /dev/null +++ b/src/component/modal/setting/tanstack_general_settings/validation/spectra_label_tab_validation.ts @@ -0,0 +1,24 @@ +import { svgTextStyleFieldsSchema } from 'react-science/ui'; +import { z } from 'zod'; + +import { jpathCodec, withUUID } from './utils.ts'; + +const spectraLabelFieldTabValidation = z.object({ + format: z.string(), + jpath: jpathCodec, + visible: z.boolean(), +}); + +export const spectraLabelFieldTabValidationWithUUID = withUUID( + spectraLabelFieldTabValidation, +); + +const spectraLabelFieldsTabValidation = z.array( + spectraLabelFieldTabValidationWithUUID, +); + +export const spectraLabelTabValidation = z.object({ + visible: z.boolean(), + fields: spectraLabelFieldsTabValidation, + valueStyle: svgTextStyleFieldsSchema.optional(), +}); diff --git a/src/component/panels/SpectraPanel/SpectraPanelHeader.tsx b/src/component/panels/SpectraPanel/SpectraPanelHeader.tsx index b5761e764..e956c29a2 100644 --- a/src/component/panels/SpectraPanel/SpectraPanelHeader.tsx +++ b/src/component/panels/SpectraPanel/SpectraPanelHeader.tsx @@ -7,7 +7,7 @@ import { SvgNmrResetScale, SvgNmrSameTop } from 'cheminfo-font'; import { memo, useCallback } from 'react'; import { FaCreativeCommonsSamplingPlus } from 'react-icons/fa'; import { IoColorPaletteOutline } from 'react-icons/io5'; -import { MdFormatColorFill } from 'react-icons/md'; +import { MdFormatColorFill, MdOutlineFormatColorText } from 'react-icons/md'; import { useChartData } from '../../context/ChartContext.js'; import { useDispatch } from '../../context/DispatchContext.js'; @@ -18,6 +18,7 @@ import { useActiveSpectra } from '../../hooks/useActiveSpectra.js'; import useSpectrum from '../../hooks/useSpectrum.js'; import { useToggleSpectraVisibility } from '../../hooks/useToggleSpectraVisibility.js'; import type { DisplayerMode } from '../../reducer/Reducer.js'; +import { booleanToString } from '../../utility/booleanToString.ts'; import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus.js'; import type { ToolbarItemProps } from '../header/DefaultPanelHeader.js'; import DefaultPanelHeader from '../header/DefaultPanelHeader.js'; @@ -59,7 +60,8 @@ function SpectraPanelHeaderInner({ const toaster = useToaster(); const dispatch = useDispatch(); const { - current: { spectraColors }, + current: { spectraColors, spectraLabel }, + dispatch: dispatchPreferences, } = usePreferences(); const handleDelete = useCallback(() => { @@ -116,6 +118,14 @@ function SpectraPanelHeaderInner({ payload: {}, }); } + + function toggleSpectraLabelHandler() { + dispatchPreferences({ + type: 'TOGGLE_SPECTRA_LABEL', + payload: {}, + }); + } + const hasActiveSpectra = activeSpectra && activeSpectra?.length > 0; const spectraLengthPerTab = getSpectraByNucleus(activeTab, data)?.length; const { getToggleVisibilityButtons } = useToggleSpectraVisibility( @@ -168,6 +178,12 @@ function SpectraPanelHeaderInner({ tooltip: 'Distinct spectra recoloring', onClick: distinctReColorSpectraHandler, }, + { + icon: , + tooltip: `${booleanToString(!spectraLabel.visible)} spectra label`, + active: spectraLabel.visible, + onClick: toggleSpectraLabelHandler, + }, ]); return ( diff --git a/src/component/panels/SpectraPanel/SpectraPreferences.tsx b/src/component/panels/SpectraPanel/SpectraPreferences.tsx index de80bc876..3cf502301 100644 --- a/src/component/panels/SpectraPanel/SpectraPreferences.tsx +++ b/src/component/panels/SpectraPanel/SpectraPreferences.tsx @@ -129,6 +129,7 @@ function SpectraPreferences(props: object, ref: Ref) { jpath: [], label: '', visible: true, + format: '', }, ...columns.slice(index), ]; diff --git a/src/component/panels/SpectraPanel/SpectraTable.tsx b/src/component/panels/SpectraPanel/SpectraTable.tsx index fc2f625c5..089df7585 100644 --- a/src/component/panels/SpectraPanel/SpectraTable.tsx +++ b/src/component/panels/SpectraPanel/SpectraTable.tsx @@ -7,7 +7,6 @@ import type { Spectrum, StateMolecule, } from '@zakodium/nmrium-core'; -import dlv from 'dlv'; import type { CSSProperties, MouseEvent } from 'react'; import { useCallback, useMemo, useState } from 'react'; import { FaCopy, FaFileExport, FaRegTrashAlt } from 'react-icons/fa'; @@ -28,6 +27,8 @@ import type { Column } from '../../elements/ReactTable/ReactTable.js'; import ReactTable from '../../elements/ReactTable/ReactTable.js'; import { usePanelPreferences } from '../../hooks/usePanelPreferences.js'; import ExportAsJcampModal from '../../modal/ExportAsJcampModal.js'; +import { getValueByPath } from '../../utility/getValueByPath.ts'; +import { pathToString } from '../../utility/pathToString.ts'; import { saveAs } from '../../utility/save_as.js'; import { RenderAsHTML } from './base/RenderAsHTML.js'; @@ -298,7 +299,7 @@ export function SpectraTable(props: SpectraTableProps) { ); for (const col of visibleColumns) { const name = (col as PredefinedTableColumn)?.name; - const path = (col as JpathTableColumn)?.jpath; + const { jpath, format } = col as JpathTableColumn; if (name && COLUMNS[name]) { columns.push({ @@ -307,7 +308,7 @@ export function SpectraTable(props: SpectraTableProps) { id: name, }); } else { - const pathString = pathToString(path); + const pathString = pathToString(jpath); let style: CSSProperties = columnStyle; let cellRender: Column['Cell'] | null = null; if (pathString === 'info.name') { @@ -327,7 +328,7 @@ export function SpectraTable(props: SpectraTableProps) { const cell: Column = { Header: () => , - accessor: (row) => getValue(row, path), + accessor: (row) => getValueByPath(row, jpath, format), ...(cellRender && { Cell: cellRender }), id: `${index}`, style, @@ -439,25 +440,3 @@ function convertSpectrumToText(spectrum: Spectrum) { } return lines.join('\n'); } - -function pathToString(path: string[]) { - return Array.isArray(path) ? path.join('.') : ''; -} - -function getValue(row: any, path: any) { - const value = dlv(row, path, ''); - const pathString = pathToString(path); - - if ( - Array.isArray(value) && - ['info.baseFrequency', 'info.originFrequency'].includes(pathString) - ) { - return value[0]; - } - - if (Array.isArray(value)) { - return value.join(','); - } - - return value; -} diff --git a/src/component/panels/SpectraPanel/base/SpectraColumnsManager.tsx b/src/component/panels/SpectraPanel/base/SpectraColumnsManager.tsx index ea0c8074f..f309a477b 100644 --- a/src/component/panels/SpectraPanel/base/SpectraColumnsManager.tsx +++ b/src/component/panels/SpectraPanel/base/SpectraColumnsManager.tsx @@ -105,6 +105,23 @@ export function SpectraColumnsManager({ ); }, }, + { + Header: 'Format', + style: { padding: 0 }, + Cell: ({ row }: CellProps) => { + const column: any = row.original; + const name = getObjectKey(nucleus, row.index, 'format'); + return ( + + ); + }, + }, { Header: 'Visible', style: { width: '30px', textAlign: 'center' }, diff --git a/src/component/reducer/preferences/actions/toggleSpectraLabel.ts b/src/component/reducer/preferences/actions/toggleSpectraLabel.ts new file mode 100644 index 000000000..e9007825a --- /dev/null +++ b/src/component/reducer/preferences/actions/toggleSpectraLabel.ts @@ -0,0 +1,19 @@ +import type { Draft } from 'immer'; + +import type { + PreferencesState, + ToggleSpectraLabelAction, +} from '../preferencesReducer.js'; +import { getActiveWorkspace } from '../utilities/getActiveWorkspace.js'; + +export function toggleSpectraLabel( + draft: Draft, + action: ToggleSpectraLabelAction, +) { + const { value } = action.payload; + const currentWorkspace = getActiveWorkspace(draft); + if (!currentWorkspace) return; + + currentWorkspace.spectraLabel.visible = + value ?? !currentWorkspace.spectraLabel.visible; +} diff --git a/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts b/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts index af9b45943..4bb5f7d31 100644 --- a/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +++ b/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts @@ -33,21 +33,25 @@ const getSpectraDefaultValues = ( label: 'Spectrum Name', jpath: ['info', 'name'], visible: true, + format: '', }, { label: 'Solvent', jpath: ['info', 'solvent'], visible: true, + format: '', }, { jpath: ['info', 'pulseSequence'], label: 'Pulse', visible: true, + format: '', }, { jpath: ['info', 'experiment'], label: 'Experiment', visible: true, + format: '', }, { name: 'color', @@ -57,7 +61,6 @@ const getSpectraDefaultValues = ( }, ], }; - return getPreferences(preferences, nucleus); }; diff --git a/src/component/reducer/preferences/preferencesReducer.ts b/src/component/reducer/preferences/preferencesReducer.ts index b64085525..c635a6823 100644 --- a/src/component/reducer/preferences/preferencesReducer.ts +++ b/src/component/reducer/preferences/preferencesReducer.ts @@ -57,6 +57,7 @@ import { setWorkspace } from './actions/setWorkspace.js'; import { toggleInformationBlock } from './actions/toggleInformationBlock.js'; import { toggleOpenSplitPanel } from './actions/toggleOpenSplitPanel.js'; import { togglePanel } from './actions/togglePanel.js'; +import { toggleSpectraLabel } from './actions/toggleSpectraLabel.ts'; import { mapWorkspaces } from './utilities/mapWorkspaces.js'; const LOCAL_STORAGE_SETTINGS_KEY = 'nmr-general-settings'; @@ -91,6 +92,10 @@ export type SetPanelsPreferencesAction = ActionType< 'SET_PANELS_PREFERENCES', { key: keyof PanelsPreferences; value: any } >; +export type ToggleSpectraLabelAction = ActionType< + 'TOGGLE_SPECTRA_LABEL', + { value?: boolean } +>; export type SetWorkspaceAction = ActionType< 'SET_WORKSPACE', @@ -196,6 +201,7 @@ export type PreferencesActions = | InitPreferencesAction | SetPreferencesAction | SetPanelsPreferencesAction + | ToggleSpectraLabelAction | SetWorkspaceAction | WorkspaceAction | AddWorkspaceAction @@ -345,7 +351,8 @@ function innerPreferencesReducer( return changeDefaultMoleculeSettings(draft, action); case 'TOGGLE_SPLIT_PANEL': return toggleOpenSplitPanel(draft, action); - + case 'TOGGLE_SPECTRA_LABEL': + return toggleSpectraLabel(draft, action); default: return draft; } diff --git a/src/component/utility/getValueByPath.ts b/src/component/utility/getValueByPath.ts new file mode 100644 index 000000000..fa9c65172 --- /dev/null +++ b/src/component/utility/getValueByPath.ts @@ -0,0 +1,26 @@ +import dlv from 'dlv'; + +import { formatNumber } from './formatNumber.ts'; +import { pathToString } from './pathToString.ts'; + +function formatValue(value: any, format = '') { + if (format.trim()) { + return formatNumber(value, format); + } + return value; +} + +export function getValueByPath(obj: any, path: string[], format = ' ') { + const value = dlv(obj, path, ''); + const pathString = pathToString(path); + + if (Array.isArray(value)) { + if (['info.baseFrequency', 'info.originFrequency'].includes(pathString)) { + return formatValue(value[0], format); + } + + return value.map((v: any) => formatValue(v, format)).join(','); + } + + return formatValue(value, format); +} diff --git a/src/component/utility/pathToString.ts b/src/component/utility/pathToString.ts new file mode 100644 index 000000000..bbd6d604b --- /dev/null +++ b/src/component/utility/pathToString.ts @@ -0,0 +1,3 @@ +export function pathToString(path: string[]) { + return Array.isArray(path) ? path.join('.') : ''; +} diff --git a/src/component/workspaces/prediction.ts b/src/component/workspaces/prediction.ts index e8e95285c..f822b592b 100644 --- a/src/component/workspaces/prediction.ts +++ b/src/component/workspaces/prediction.ts @@ -78,27 +78,32 @@ export const prediction: InnerWorkspace = { label: 'Spectrum Name', jpath: ['info', 'name'], visible: true, + format: '', }, { label: 'Frequency', description: 'frequency', jpath: ['info', 'baseFrequency'], visible: true, + format: '', }, { label: 'Solvent', jpath: ['info', 'solvent'], visible: false, + format: '', }, { jpath: ['info', 'pulseSequence'], label: 'Pulse', visible: true, + format: '', }, { jpath: ['info', 'experiment'], label: 'Experiment', visible: true, + format: '', }, { name: 'color', @@ -120,27 +125,32 @@ export const prediction: InnerWorkspace = { label: 'Spectrum Name', jpath: ['info', 'name'], visible: true, + format: '', }, { label: 'Frequency', description: 'frequency', jpath: ['info', 'baseFrequency'], visible: true, + format: '', }, { label: 'Solvent', jpath: ['info', 'solvent'], visible: false, + format: '', }, { jpath: ['info', 'pulseSequence'], label: 'Pulse', visible: true, + format: '', }, { jpath: ['info', 'experiment'], label: 'Experiment', visible: true, + format: '', }, { name: 'color', @@ -162,27 +172,32 @@ export const prediction: InnerWorkspace = { label: 'Spectrum Name', jpath: ['info', 'name'], visible: true, + format: '', }, { label: 'Frequency', description: 'frequency', jpath: ['info', 'baseFrequency'], visible: true, + format: '', }, { label: 'Solvent', jpath: ['info', 'solvent'], visible: false, + format: '', }, { jpath: ['info', 'pulseSequence'], label: 'Pulse', visible: true, + format: '', }, { jpath: ['info', 'experiment'], label: 'Experiment', visible: true, + format: '', }, { name: 'color', @@ -204,27 +219,32 @@ export const prediction: InnerWorkspace = { label: 'Spectrum Name', jpath: ['info', 'name'], visible: true, + format: '', }, { label: 'Frequency', description: 'frequency', jpath: ['info', 'baseFrequency'], visible: true, + format: '', }, { label: 'Solvent', jpath: ['info', 'solvent'], visible: false, + format: '', }, { jpath: ['info', 'pulseSequence'], label: 'Pulse', visible: true, + format: '', }, { jpath: ['info', 'experiment'], label: 'Experiment', visible: true, + format: '', }, { name: 'color', diff --git a/src/component/workspaces/simulation.ts b/src/component/workspaces/simulation.ts index fb005d8dc..5b3ae9406 100644 --- a/src/component/workspaces/simulation.ts +++ b/src/component/workspaces/simulation.ts @@ -55,17 +55,20 @@ export const simulation: InnerWorkspace = { label: 'Spectrum Name', jpath: ['info', 'name'], visible: true, + format: '', }, { label: 'Frequency', description: 'frequency', jpath: ['info', 'originFrequency'], visible: true, + format: '', }, { jpath: ['info', 'nucleus'], label: 'Experiment', visible: true, + format: '', }, { name: 'color', diff --git a/src/component/workspaces/workspaceDefaultProperties.ts b/src/component/workspaces/workspaceDefaultProperties.ts index 365b9bd6d..5749a4744 100644 --- a/src/component/workspaces/workspaceDefaultProperties.ts +++ b/src/component/workspaces/workspaceDefaultProperties.ts @@ -352,4 +352,12 @@ export const workspaceDefaultProperties: RequiredWorkspacePreferences = { }, }, }, + spectraLabel: { + visible: true, + fields: [{ jpath: ['info', 'name'], visible: true, format: '' }], + valueStyle: { + fontSize: 12, + fill: 'black', + }, + }, }; diff --git a/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts b/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts index 2f9042ef3..939f9fca6 100644 --- a/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +++ b/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts @@ -10,7 +10,7 @@ const defaultPeakPickingOptions: Omit< 'frequency' > = { minMaxRatio: 1, - shape: { kind: 'lorentzian' }, + shape: { kind: 'pseudoVoigt', mu: 0.5 }, realTopDetection: true, maxCriteria: true, smoothY: true, diff --git a/src/data/data1d/Spectrum1D/ranges/detectSignals.ts b/src/data/data1d/Spectrum1D/ranges/detectSignals.ts index f4bf987e3..72ee4da08 100644 --- a/src/data/data1d/Spectrum1D/ranges/detectSignals.ts +++ b/src/data/data1d/Spectrum1D/ranges/detectSignals.ts @@ -35,6 +35,7 @@ export default function detectSignals( from, frequency, broadRatio: 0.0025, + shape: { kind: 'pseudoVoigt', mu: 0.5 }, smoothY: true, }, ranges: {