Skip to content

Commit

Permalink
fixed logarithmic scaling of differences
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrFr committed Dec 3, 2019
1 parent 0da785c commit 45de0d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion repair/js/views/common/flowsankey.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ var FlowSankeyView = BaseView.extend(
return;
}
function normalize(v){
return Math.log2(1 + v * normFactor);
var normed = Math.log2(1 + Math.abs(v) * normFactor);
if (v < 0) normed *= -1;
return normed;
}
var source = mapNode(origin),
target = (!isStock) ? mapNode(destination) : addStock();
Expand Down

0 comments on commit 45de0d8

Please sign in to comment.