Skip to content

Commit

Permalink
adding bail out for empty sankey graph
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Doyle committed Nov 14, 2019
1 parent a0b02fc commit b9550a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/netsage_sankey.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ export class NetSageSankey extends MetricsPanelCtrl {

// get sankey graph from data
var graph = ctrl.createSankeyGraphFromData(sankeyData);

//render sankey
ctrl.renderSankey(graph);
}
Expand Down Expand Up @@ -477,6 +477,11 @@ export class NetSageSankey extends MetricsPanelCtrl {

// make sankey chart
renderSankey(graph) {

if (graph.links.length == 0 || graph.nodes.length == 0){
return;
}

var ctrl = this;
d3.select('#' + ctrl.containerDivId).selectAll('g').remove();

Expand Down

0 comments on commit b9550a0

Please sign in to comment.