Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Clear edge weight chart before drawing #232
Browse files Browse the repository at this point in the history
This prevents a bug where a new chart would just get drawn over
the old one.
  • Loading branch information
fedarko committed Aug 4, 2017
1 parent 6b5fbde commit a7452ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion viewer/js/xdot2cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2431,12 +2431,16 @@ function openEdgeFilteringDialog() {
var formatCount = d3.format(",.0f");
// note could probably find this inline to simplify computation time
var max = d3.max(COMPONENT_EDGE_WEIGHTS);
console.log(COMPONENT_EDGE_WEIGHTS);
//console.log(COMPONENT_EDGE_WEIGHTS);
var data = COMPONENT_EDGE_WEIGHTS.map(function(x) { return x / max; });
var margin = {top: 10, right: 30, bottom: 30, left: 30};
//for (var i = 0; i < COMPONENT_EDGE_WEIGHTS.length; i++) {
// console.log(COMPONENT_EDGE_WEIGHTS[i] + "->" + data[i]);
//}
// Remove old histogram so that it doesn't get drawn over
// Eventually we might want to consider only redrawing the histogram when
// we open up a new cc, but for now it's fine
d3.select("#edgeWeightChart *").remove();
var chartSvg = d3.select("#edgeWeightChart");
var width = +chartSvg.attr("width") - margin.left - margin.right;
var height = +chartSvg.attr("height") - margin.top - margin.bottom;
Expand Down

0 comments on commit a7452ea

Please sign in to comment.