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

[KED-2144] Scrolling on Kedro-Viz throws errors when pipeline is empty #342

Merged
merged 8 commits into from
Jan 11, 2021
5 changes: 5 additions & 0 deletions src/components/flowchart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ export class FlowChart extends Component {
[width + margin + metaSidebarWidth / scale, height + margin]
]);

// Ensure valid x and y values before performing zoom operations
if (!isFinite(x) || !isFinite(y) || isNaN(x) || isNaN(y)) {
return;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey do you mind moving this up to the top of the function (immediately after line 202)?

// Transform the <g> that wraps the chart
this.el.wrapper.attr('transform', event.transform);

Expand Down