Skip to content

Commit c785266

Browse files
feat: upgrade NMRium to beta version 0.61
1 parent c1be9ab commit c785266

9 files changed

Lines changed: 631 additions & 2861 deletions

File tree

package-lock.json

Lines changed: 290 additions & 1699 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
"@blueprintjs/icons": "^5.19.1",
1717
"@emotion/react": "^11.14.0",
1818
"fifo-logger": "^1.0.0",
19-
"filelist-utils": "^1.11.1",
20-
"nmr-load-save": "^0.37.0",
21-
"nmr-processing": "^12.12.0",
22-
"nmrium": "^0.59.0",
19+
"filelist-utils": "^1.11.3",
20+
"nmr-load-save": "^3.1.2",
21+
"nmr-processing": "^16.0.1",
22+
"nmrium": "^0.60.1-pre.1741337420",
2323
"react-science": "^14.0.0",
2424
"vite-plugin-pwa": "^0.21.1"
2525
},
@@ -63,4 +63,4 @@
6363
"typescript": "^5.8.2",
6464
"vite": "^6.2.1"
6565
}
66-
}
66+
}

src/NMRiumWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { NMRiumData, NMRiumRefAPI, NMRiumChangeCb } from 'nmrium';
22
import { NMRium } from 'nmrium';
3-
import type { CSSProperties} from 'react';
3+
import type { CSSProperties } from 'react';
44
import { useEffect, useState, useCallback, useRef } from 'react';
55
import { RootLayout } from 'react-science/ui';
66

src/demo/NMRiumWrapperDemo.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @jsxImportSource @emotion/react */
22
import { css } from '@emotion/react';
33
import type { NMRiumData } from 'nmrium';
4-
import Button from 'nmrium/lib/component/elements/Button';
4+
import { Button } from 'react-science/ui';
55

66
import NMRiumWrapper from '../NMRiumWrapper';
77
import events from '../events';
@@ -27,7 +27,7 @@ export default function NMRiumWrapperDemo() {
2727
return (
2828
<div css={styles.container}>
2929
<div id="header" css={styles.header}>
30-
<Button.Done
30+
<Button
3131
style={{ marginRight: '10px' }}
3232
onClick={() => {
3333
events.trigger('load', {
@@ -37,9 +37,9 @@ export default function NMRiumWrapperDemo() {
3737
}}
3838
>
3939
Test load from json
40-
</Button.Done>
40+
</Button>
4141

42-
<Button.Done
42+
<Button
4343
style={{ marginRight: '10px' }}
4444
onClick={() => {
4545
events.trigger('load', {
@@ -56,9 +56,9 @@ export default function NMRiumWrapperDemo() {
5656
}}
5757
>
5858
Test Load from URLS
59-
</Button.Done>
59+
</Button>
6060

61-
<Button.Done
61+
<Button
6262
style={{ marginRight: '10px' }}
6363
onClick={() => {
6464
events.trigger('load', {
@@ -70,8 +70,8 @@ export default function NMRiumWrapperDemo() {
7070
}}
7171
>
7272
Test Load URL without extension
73-
</Button.Done>
74-
<Button.Done
73+
</Button>
74+
<Button
7575
style={{ marginRight: '10px' }}
7676
onClick={() => {
7777
void loadFilesFromURLs([
@@ -88,8 +88,8 @@ export default function NMRiumWrapperDemo() {
8888
}}
8989
>
9090
Test Load Files
91-
</Button.Done>
92-
<Button.Done
91+
</Button>
92+
<Button
9393
className="logger-btn"
9494
onClick={() => {
9595
void loadFilesFromURLs(['../data/sample-with-error.zip']).then(
@@ -104,7 +104,7 @@ export default function NMRiumWrapperDemo() {
104104
}}
105105
>
106106
Test Logger
107-
</Button.Done>
107+
</Button>
108108
</div>
109109

110110
<NMRiumWrapper />

src/events/types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import type { NMRiumData, NMRiumState } from 'nmrium';
2-
import type { BlobObject } from 'nmrium/lib/component/utility/export';
32

3+
interface BlobObject {
4+
blob: Blob;
5+
width: number;
6+
height: number;
7+
}
48
type EventType =
59
| 'load'
610
| 'data-change'

src/hooks/useLoadSpectra.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
import { FifoLogger } from 'fifo-logger';
22
import { fileCollectionFromFiles } from 'filelist-utils';
3-
import type {
4-
NmriumState,
5-
ParsingOptions,
6-
ViewState
7-
} from 'nmr-load-save';
8-
import {
9-
read,
10-
readFromWebSource,
11-
CURRENT_EXPORT_VERSION
12-
} from 'nmr-load-save';
3+
import type { NmriumState, ParsingOptions, ViewState } from 'nmr-load-save';
4+
import { read, readFromWebSource, CURRENT_EXPORT_VERSION } from 'nmr-load-save';
135
import { useCallback, useMemo, useState } from 'react';
146

157
import events from '../events';

src/utilities/isArrayOfString.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
export function isArrayOfString(data: any[]) {
32
return data.every((url) => typeof url === 'string');
43
}

src/workspaces/nmrxiv.ts

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export function getNmrXivWorkspace(hidePanelOnLoad = false): InnerWorkspace {
1414
},
1515
display: {
1616
general: {
17-
experimentalFeatures: { display: true },
17+
experimentalFeatures: {
18+
display: true,
19+
visible: true,
20+
},
1821
hidePanelOnLoad,
1922
hideHelp: true,
2023
hideLogs: true,
@@ -23,13 +26,29 @@ export function getNmrXivWorkspace(hidePanelOnLoad = false): InnerWorkspace {
2326
},
2427

2528
panels: {
26-
spectraPanel: { display: true, open: true },
27-
informationPanel: { display: true, open: false },
28-
rangesPanel: { display: true, open: false },
29-
structuresPanel: { display: true, open: false },
30-
processingsPanel: { display: true, open: false },
31-
zonesPanel: { display: true, open: false },
32-
summaryPanel: { display: true, open: false },
29+
spectraPanel: { display: true, visible: true, open: true },
30+
informationPanel: { display: true, visible: true, open: false },
31+
rangesPanel: { display: true, visible: true, open: false },
32+
structuresPanel: { display: true, visible: true, open: false },
33+
processingsPanel: { display: true, visible: true, open: false },
34+
zonesPanel: { display: true, visible: true, open: false },
35+
summaryPanel: { display: true, visible: true, open: false },
36+
automaticAssignmentPanel: {
37+
display: false,
38+
visible: true,
39+
open: false,
40+
},
41+
simulationPanel: { display: false, visible: true, open: false },
42+
predictionPanel: { display: false, visible: true, open: false },
43+
peaksPanel: { display: false, visible: true, open: false },
44+
multipleSpectraAnalysisPanel: {
45+
display: false,
46+
visible: true,
47+
open: false,
48+
},
49+
matrixGenerationPanel: { display: false, visible: true, open: false },
50+
integralsPanel: { display: false, visible: true, open: false },
51+
databasePanel: { display: false, visible: true, open: false },
3352
},
3453
toolBarButtons: {
3554
baselineCorrection: true,

0 commit comments

Comments
 (0)