Skip to content

Commit 97cb783

Browse files
ozyxunlikelyzero
andauthored
chore: bump d3-scale and use ESModule imports (#7245)
Co-authored-by: John Hill <[email protected]>
1 parent 39a3161 commit 97cb783

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

.webpack/webpack.common.js

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ const config = {
7171
bourbon: 'bourbon.scss',
7272
'plotly-basic': 'plotly.js-basic-dist',
7373
'plotly-gl2d': 'plotly.js-gl2d-dist',
74-
'd3-scale': path.join(projectRootDir, 'node_modules/d3-scale/dist/d3-scale.min.js'),
7574
printj: path.join(projectRootDir, 'node_modules/printj/dist/printj.min.js'),
7675
styles: path.join(projectRootDir, 'src/styles'),
7776
MCT: path.join(projectRootDir, 'src/MCT'),

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"cspell": "7.3.8",
2222
"css-loader": "6.8.1",
2323
"d3-axis": "3.0.0",
24-
"d3-scale": "3.3.0",
24+
"d3-scale": "4.0.2",
2525
"d3-selection": "3.0.0",
2626
"eslint": "8.54.0",
2727
"eslint-config-prettier": "9.0.0",

src/plugins/imagery/components/ImageryTimeView.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</template>
2828

2929
<script>
30-
import * as d3Scale from 'd3-scale';
30+
import { scaleLinear, scaleUtc } from 'd3-scale';
3131
import _ from 'lodash';
3232
import mount from 'utils/mount';
3333

@@ -220,10 +220,10 @@ export default {
220220
}
221221

222222
if (timeSystem.isUTCBased) {
223-
this.xScale = d3Scale.scaleUtc();
223+
this.xScale = scaleUtc();
224224
this.xScale.domain([new Date(this.viewBounds.start), new Date(this.viewBounds.end)]);
225225
} else {
226-
this.xScale = d3Scale.scaleLinear();
226+
this.xScale = scaleLinear();
227227
this.xScale.domain([this.viewBounds.start, this.viewBounds.end]);
228228
}
229229

src/plugins/plan/components/PlanView.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
</template>
5454

5555
<script>
56-
import * as d3Scale from 'd3-scale';
56+
import { scaleLinear, scaleUtc } from 'd3-scale';
5757

5858
import SwimLane from '@/ui/components/swim-lane/SwimLane.vue';
5959

@@ -342,10 +342,10 @@ export default {
342342
}
343343

344344
if (timeSystem.isUTCBased) {
345-
this.xScale = d3Scale.scaleUtc();
345+
this.xScale = scaleUtc();
346346
this.xScale.domain([new Date(this.viewBounds.start), new Date(this.viewBounds.end)]);
347347
} else {
348-
this.xScale = d3Scale.scaleLinear();
348+
this.xScale = scaleLinear();
349349
this.xScale.domain([this.viewBounds.start, this.viewBounds.end]);
350350
}
351351

src/plugins/timeConductor/ConductorAxis.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<script>
2929
import * as d3Axis from 'd3-axis';
30-
import * as d3Scale from 'd3-scale';
30+
import { scaleLinear, scaleUtc } from 'd3-scale';
3131
import * as d3Selection from 'd3-selection';
3232

3333
import { TIME_CONTEXT_EVENTS } from '../../api/time/constants';
@@ -135,9 +135,9 @@ export default {
135135
//The D3 scale used depends on the type of time system as d3
136136
// supports UTC out of the box.
137137
if (timeSystem.isUTCBased) {
138-
this.xScale = d3Scale.scaleUtc();
138+
this.xScale = scaleUtc();
139139
} else {
140-
this.xScale = d3Scale.scaleLinear();
140+
this.xScale = scaleLinear();
141141
}
142142

143143
this.xAxis.scale(this.xScale);

src/ui/components/TimeSystemAxis.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<script>
2929
import * as d3Axis from 'd3-axis';
30-
import * as d3Scale from 'd3-scale';
30+
import { scaleLinear, scaleUtc } from 'd3-scale';
3131
import * as d3Selection from 'd3-selection';
3232

3333
import utcMultiTimeFormat from '@/plugins/timeConductor/utcMultiTimeFormat';
@@ -155,10 +155,10 @@ export default {
155155
}
156156

157157
if (timeSystem.isUTCBased) {
158-
this.xScale = d3Scale.scaleUtc();
158+
this.xScale = scaleUtc();
159159
this.xScale.domain([new Date(bounds.start), new Date(bounds.end)]);
160160
} else {
161-
this.xScale = d3Scale.scaleLinear();
161+
this.xScale = scaleLinear();
162162
this.xScale.domain([bounds.start, bounds.end]);
163163
}
164164

0 commit comments

Comments
 (0)