Skip to content

Commit

Permalink
remove power units from sankey diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
williaster committed Mar 31, 2016
1 parent 167fb64 commit 0e2c0ce
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions caravel/assets/visualizations/sankey.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ function sankeyVis(slice) {
var width = slice.width() - margin.left - margin.right;
var height = slice.height() - margin.top - margin.bottom;

var formatNumber = d3.format(",.0f"),
format = function (d) {
return formatNumber(d) + " TWh";
};
var formatNumber = d3.format(",.0f");

var svg = div.append("svg")
.attr("width", width + margin.left + margin.right)
Expand Down Expand Up @@ -70,7 +67,7 @@ function sankeyVis(slice) {

link.append("title")
.text(function (d) {
return d.source.name + " → " + d.target.name + "\n" + format(d.value);
return d.source.name + " → " + d.target.name + "\n" + formatNumber(d.value);
});

var node = svg.append("g").selectAll(".node")
Expand Down Expand Up @@ -103,7 +100,7 @@ function sankeyVis(slice) {
})
.append("title")
.text(function (d) {
return d.name + "\n" + format(d.value);
return d.name + "\n" + formatNumber(d.value);
});

node.append("text")
Expand Down

0 comments on commit 0e2c0ce

Please sign in to comment.