Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump d3-scale and use ESModule imports #7245

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
//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();

Check warning on line 140 in src/plugins/timeConductor/ConductorAxis.vue

View check run for this annotation

Codecov / codecov/patch

src/plugins/timeConductor/ConductorAxis.vue#L140

Added line #L140 was not covered by tests
}

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
Loading