Skip to content

Commit 20cd6b0

Browse files
authored
refactor: remove full d3 dependency (#3735)
Reduce the number of dependencies by only installing the `d3-*` that we use.
1 parent ce43d72 commit 20cd6b0

17 files changed

Lines changed: 29 additions & 501 deletions

File tree

‎package-lock.json‎

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

‎package.json‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@
7272
"cheminfo-font": "^1.13.1",
7373
"cheminfo-types": "^1.8.1",
7474
"clipboard-polyfill": "^4.1.1",
75-
"d3": "^7.9.0",
75+
"d3-array": "^3.2.4",
76+
"d3-scale": "^4.0.2",
77+
"d3-zoom": "^3.0.0",
7678
"dlv": "^1.1.3",
7779
"eventemitter3": "^5.0.1",
7880
"fifo-logger": "^2.0.1",
@@ -116,7 +118,9 @@
116118
"@blueprintjs/select": "^6.0.5",
117119
"@playwright/test": "^1.55.1",
118120
"@simbathesailor/use-what-changed": "^2.0.0",
119-
"@types/d3": "^7.4.3",
121+
"@types/d3-array": "^3.2.2",
122+
"@types/d3-scale": "^4.0.9",
123+
"@types/d3-zoom": "^3.0.8",
120124
"@types/dlv": "^1.1.5",
121125
"@types/lodash": "^4.17.20",
122126
"@types/node": "^24.5.2",

‎src/component/1d/database/DatabaseSpectrum.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Spectrum1D } from '@zakodium/nmrium-core';
2-
import { extent } from 'd3';
2+
import { extent } from 'd3-array';
33
import throttle from 'lodash/throttle.js';
44
import { useCallback, useContext, useEffect, useRef, useState } from 'react';
55

‎src/component/1d/database/ResurrectedDatabaseRanges.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Spectrum1D } from '@zakodium/nmrium-core';
2-
import { extent } from 'd3';
2+
import { extent } from 'd3-array';
33
import { rangesToXY } from 'nmr-processing';
44

55
import { useChartData } from '../../context/ChartContext.js';

‎src/component/1d/jCouplingGraph/JGraph.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Signal1D } from '@zakodium/nmr-types';
22
import type { Spectrum1D } from '@zakodium/nmrium-core';
3-
import { scaleLinear } from 'd3';
3+
import { scaleLinear } from 'd3-scale';
44
import { memo, useMemo } from 'react';
55

66
import type { CouplingLink } from '../../../data/data1d/Spectrum1D/generateJGraphData.js';

‎src/component/1d/jCouplingGraph/JGraphContext.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ScaleLinear } from 'd3';
1+
import type { ScaleLinear } from 'd3-scale';
22
import { createContext, useContext } from 'react';
33

44
interface JGraphState {

‎src/component/1d/jCouplingGraph/JGraphVerticalAxis.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ScaleLinear } from 'd3';
1+
import type { ScaleLinear } from 'd3-scale';
22
import { useRef } from 'react';
33
import { useLinearPrimaryTicks } from 'react-d3-utils';
44

‎src/component/1d/matrix/Boxplot.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { NumberArray } from 'cheminfo-types';
2-
import { extent } from 'd3';
2+
import { extent } from 'd3-array';
33
import { xFindClosestIndex } from 'ml-spectra-processing';
44
import { matrixToBoxPlot } from 'nmr-processing';
55
import type { CSSProperties } from 'react';

‎src/component/1d/matrix/Stocsy.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { extent } from 'd3';
1+
import { extent } from 'd3-array';
22
import { xFindClosestIndex } from 'ml-spectra-processing';
33
import { matrixToStocsy } from 'nmr-processing';
44
import { useMemo } from 'react';

‎src/component/1d/utilities/scale.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { scaleLinear } from 'd3';
1+
import { scaleLinear } from 'd3-scale';
22
import { useCallback } from 'react';
33

44
import { useChartData } from '../../context/ChartContext.js';

0 commit comments

Comments
 (0)