Skip to content

Commit

Permalink
prevent JS error on too many nodes layout abort
Browse files Browse the repository at this point in the history
  • Loading branch information
davkal committed Sep 7, 2015
1 parent 1881d16 commit 20d5abe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/app/scripts/charts/nodes-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,12 @@ const NodesChart = React.createClass({

debug('graph layout took ' + timedLayouter.time + 'ms');

// adjust layout based on viewport
// layout was aborted
if (!graph) {
return;
}

// adjust layout based on viewport
const xFactor = (props.width - MARGINS.left - MARGINS.right) / graph.width;
const yFactor = props.height / graph.height;
const zoomFactor = Math.min(xFactor, yFactor);
Expand Down

0 comments on commit 20d5abe

Please sign in to comment.