Skip to content

Commit

Permalink
feat: rename component to NMRium
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny committed Apr 2, 2021
1 parent e02a115 commit 439688c
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 29 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ from `openchemlib/full` to avoid having multiple OCL versions in your bundle.
### Use the component

```jsx
import NMRDisplayer from 'nmr-displayer';
import NMRium from 'nmr-displayer';

function MyComponent() {
return <NMRDisplayer />;
return <NMRium />;
}
```

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "nmr-displayer",
"name": "nmrium",
"version": "0.8.1",
"license": "MIT",
"main": "lib-cjs/component/NMRDisplayer.js",
"module": "lib/component/NMRDisplayer.js",
"types": "lib/component/NMRDisplayer.d.ts",
"main": "lib-cjs/component/NMRium.js",
"module": "lib/component/NMRium.js",
"types": "lib/component/NMRium.d.ts",
"files": [
"lib",
"lib-cjs"
Expand Down
8 changes: 4 additions & 4 deletions src/component/NMRDisplayer.tsx → src/component/NMRium.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export interface NMRDisplayerData {
spectra: Spectra;
}

function NMRDisplayer({
function NMRium({
data: dataProp,
onDataChange,
docsBaseUrl,
Expand Down Expand Up @@ -386,7 +386,7 @@ function NMRDisplayer({
);
}

NMRDisplayer.propTypes = {
NMRium.propTypes = {
docsBaseUrl: PropTypes.string,
onDataChange: PropTypes.func,
preferences: PropTypes.shape({
Expand Down Expand Up @@ -422,7 +422,7 @@ NMRDisplayer.propTypes = {
}),
};

NMRDisplayer.defaultProps = {
NMRium.defaultProps = {
docsBaseUrl: 'https://cheminfo.github.io/nmr-displayer/docs/v0',
onDataChange: () => null,
preferences: {
Expand Down Expand Up @@ -464,4 +464,4 @@ NMRDisplayer.defaultProps = {
},
};

export default memo(NMRDisplayer);
export default memo(NMRium);
2 changes: 1 addition & 1 deletion src/component/reducer/Reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { predictionProton } from 'nmr-processing';
import OCL from 'openchemlib/full';

import * as SpectraManager from '../../data/SpectraManager';
import { Spectra } from '../NMRDisplayer';
import { Spectra } from '../NMRium';
import { DefaultTolerance } from '../panels/SummaryPanel/CorrelationTable/Constants';
import { options } from '../toolbar/ToolTypes';

Expand Down
6 changes: 1 addition & 5 deletions src/component/reducer/actions/LoadActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import { initiateDatum1D } from '../../../data/data1d/Datum1D';
import { initiateDatum2D } from '../../../data/data2d/Datum2D';
import * as MoleculeManager from '../../../data/molecules/MoleculeManager';
import generateID from '../../../data/utilities/generateID';
import {
Molecules,
NMRDisplayerPreferences,
Spectra,
} from '../../NMRDisplayer';
import { Molecules, NMRDisplayerPreferences, Spectra } from '../../NMRium';
import { DefaultTolerance } from '../../panels/SummaryPanel/CorrelationTable/Constants';
import { State } from '../Reducer';

Expand Down
4 changes: 2 additions & 2 deletions src/demo/views/Exam.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FaRegCopy, FaCheck } from 'react-icons/fa';
import { MF } from 'react-mf';
import { StructureEditor } from 'react-ocl/full';

import NMRDisplayer from '../../component/NMRDisplayer';
import NMRium from '../../component/NMRium';
import { copyTextToClipboard } from '../../component/utility/Export.js';

let answers = JSON.parse(localStorage.getItem('nmrium-exams') || '{}');
Expand Down Expand Up @@ -220,7 +220,7 @@ export default function Exam(props) {
css={nmrContainer}
style={{ height: answerAreaVisible ? '50%' : 'calc(100% - 25px)' }}
>
<NMRDisplayer
<NMRium
data={data}
preferences={{
general: {
Expand Down
4 changes: 2 additions & 2 deletions src/demo/views/Exercise.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useState, useEffect, useCallback } from 'react';
import { MF } from 'react-mf';
import { StructureEditor } from 'react-ocl/full';

import NMRDisplayer from '../../component/NMRDisplayer';
import NMRium from '../../component/NMRium';

let answers = JSON.parse(localStorage.getItem('nmrium-exercises') || '{}');

Expand Down Expand Up @@ -169,7 +169,7 @@ export default function Exercise(props) {
<div
style={{ height: answerAreaVisible ? '50%' : 'calc(100% - 25px)' }}
>
<NMRDisplayer
<NMRium
data={data}
preferences={{
general: {
Expand Down
4 changes: 2 additions & 2 deletions src/demo/views/SingleView.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';

import NMRDisplayer from '../../component/NMRDisplayer';
import NMRium from '../../component/NMRium';

export default function SingleView(props) {
const [data, setData] = useState();
Expand Down Expand Up @@ -56,7 +56,7 @@ export default function SingleView(props) {
{path}
</p>
)}
<NMRDisplayer data={data} />
<NMRium data={data} />
</div>
);
}
4 changes: 2 additions & 2 deletions src/demo/views/Test.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';

import NMRDisplayer from '../../component/NMRDisplayer';
import NMRium from '../../component/NMRium';

async function loadData(file) {
const response = await fetch(file);
Expand Down Expand Up @@ -62,7 +62,7 @@ export default function Test(props) {
{title}
</p>
)}
<NMRDisplayer
<NMRium
data={data}
preferences={{
panels: { hidePeaksPanel: true, hideStructuresPanel: true },
Expand Down
6 changes: 3 additions & 3 deletions src/demo/views/TwoInstances.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsxImportSource @emotion/react */

import NMRDisplayer from '../../component/NMRDisplayer';
import NMRium from '../../component/NMRium';

const data1 = {
spectra: [
Expand Down Expand Up @@ -75,10 +75,10 @@ export default function TwoInstances(props) {
</p>
)}
<div style={{ flex: 1 }}>
<NMRDisplayer data={data1} key="1" />
<NMRium data={data1} key="1" />
</div>
<div style={{ flex: 1 }}>
<NMRDisplayer data={data2} key="2" />
<NMRium data={data2} key="2" />
</div>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/demo/views/View.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useEffect, useCallback } from 'react';
import { ObjectInspector } from 'react-inspector';

import NMRDisplayer from '../../component/NMRDisplayer';
import NMRium from '../../component/NMRium';

async function loadData(file) {
const response = await fetch(file);
Expand Down Expand Up @@ -113,7 +113,7 @@ export default function View(props) {
>
<div style={{ display: 'flex', flexDirection: 'row', width: '100%' }}>
<div style={{ width: isCallbackVisible ? '75%' : '100%' }}>
<NMRDisplayer data={data} onDataChange={changeHadnler} />
<NMRium data={data} onDataChange={changeHadnler} />
</div>
{process.env.NODE_ENV !== 'production' && (
<div
Expand Down

0 comments on commit 439688c

Please sign in to comment.