Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ export class OriginDestinationComponent implements OnInit, OnDestroy {
.append("svg")
.classed("main-origin-destination-container", true)
.attr("id", "main-origin-destination-container")
.attr("width", width)
.attr("height", height)
.attr("width", "100%")
.attr("height", "100%")
.attr("viewBox", `0 0 ${width} ${height}`);

const container = document.getElementById("main-origin-destination-container");
Expand Down Expand Up @@ -331,10 +331,13 @@ export class OriginDestinationComponent implements OnInit, OnDestroy {
},
onViewboxChanged: (viewboxProperties) => {
const svg = d3.select("#main-origin-destination-container");
svg.attr(
"viewBox",
`${viewboxProperties.panZoomLeft} ${viewboxProperties.panZoomTop} ${viewboxProperties.panZoomWidth} ${viewboxProperties.panZoomHeight}`,
);
svg
.attr(
"viewBox",
`${viewboxProperties.panZoomLeft} ${viewboxProperties.panZoomTop} ${viewboxProperties.panZoomWidth} ${viewboxProperties.panZoomHeight}`,
)
.attr("width", "100%")
.attr("height", "100%");
Comment on lines +338 to +340
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting width and height to '100%' on every viewbox change is redundant since these attributes don't change. Consider removing lines 339-340 from the onViewboxChanged callback as the dimensions are already set during initialization (lines 135-136).

Suggested change
)
.attr("width", "100%")
.attr("height", "100%");
);

Copilot uses AI. Check for mistakes.
},
onStartMultiSelect: () => {},
updateMultiSelect: () => {},
Expand Down