Skip to content

Commit

Permalink
chore: bump d3-scale and use ESModule imports (#7245)
Browse files Browse the repository at this point in the history
Co-authored-by: John Hill <john.c.hill@nasa.gov>
  • Loading branch information
ozyx and unlikelyzero authored Nov 28, 2023
1 parent 39a3161 commit 97cb783
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion .webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const config = {
bourbon: 'bourbon.scss',
'plotly-basic': 'plotly.js-basic-dist',
'plotly-gl2d': 'plotly.js-gl2d-dist',
'd3-scale': path.join(projectRootDir, 'node_modules/d3-scale/dist/d3-scale.min.js'),
printj: path.join(projectRootDir, 'node_modules/printj/dist/printj.min.js'),
styles: path.join(projectRootDir, 'src/styles'),
MCT: path.join(projectRootDir, 'src/MCT'),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"cspell": "7.3.8",
"css-loader": "6.8.1",
"d3-axis": "3.0.0",
"d3-scale": "3.3.0",
"d3-scale": "4.0.2",
"d3-selection": "3.0.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/imagery/components/ImageryTimeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</template>

<script>
import * as d3Scale from 'd3-scale';
import { scaleLinear, scaleUtc } from 'd3-scale';
import _ from 'lodash';
import mount from 'utils/mount';

Expand Down Expand Up @@ -220,10 +220,10 @@ export default {
}

if (timeSystem.isUTCBased) {
this.xScale = d3Scale.scaleUtc();
this.xScale = scaleUtc();
this.xScale.domain([new Date(this.viewBounds.start), new Date(this.viewBounds.end)]);
} else {
this.xScale = d3Scale.scaleLinear();
this.xScale = scaleLinear();
this.xScale.domain([this.viewBounds.start, this.viewBounds.end]);
}

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/plan/components/PlanView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</template>

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

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

Expand Down Expand Up @@ -342,10 +342,10 @@ export default {
}

if (timeSystem.isUTCBased) {
this.xScale = d3Scale.scaleUtc();
this.xScale = scaleUtc();
this.xScale.domain([new Date(this.viewBounds.start), new Date(this.viewBounds.end)]);
} else {
this.xScale = d3Scale.scaleLinear();
this.xScale = scaleLinear();
this.xScale.domain([this.viewBounds.start, this.viewBounds.end]);
}

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/timeConductor/ConductorAxis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<script>
import * as d3Axis from 'd3-axis';
import * as d3Scale from 'd3-scale';
import { scaleLinear, scaleUtc } from 'd3-scale';
import * as d3Selection from 'd3-selection';

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

this.xAxis.scale(this.xScale);
Expand Down
6 changes: 3 additions & 3 deletions src/ui/components/TimeSystemAxis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<script>
import * as d3Axis from 'd3-axis';
import * as d3Scale from 'd3-scale';
import { scaleLinear, scaleUtc } from 'd3-scale';
import * as d3Selection from 'd3-selection';

import utcMultiTimeFormat from '@/plugins/timeConductor/utcMultiTimeFormat';
Expand Down Expand Up @@ -155,10 +155,10 @@ export default {
}

if (timeSystem.isUTCBased) {
this.xScale = d3Scale.scaleUtc();
this.xScale = scaleUtc();
this.xScale.domain([new Date(bounds.start), new Date(bounds.end)]);
} else {
this.xScale = d3Scale.scaleLinear();
this.xScale = scaleLinear();
this.xScale.domain([bounds.start, bounds.end]);
}

Expand Down

0 comments on commit 97cb783

Please sign in to comment.