mirror of
https://github.com/apache/superset.git
synced 2024-09-06 13:57:40 -04:00
remove power units from sankey diagram
This commit is contained in:
parent
167fb64d0c
commit
0e2c0ce858
@ -18,10 +18,7 @@ function sankeyVis(slice) {
|
|||||||
var width = slice.width() - margin.left - margin.right;
|
var width = slice.width() - margin.left - margin.right;
|
||||||
var height = slice.height() - margin.top - margin.bottom;
|
var height = slice.height() - margin.top - margin.bottom;
|
||||||
|
|
||||||
var formatNumber = d3.format(",.0f"),
|
var formatNumber = d3.format(",.0f");
|
||||||
format = function (d) {
|
|
||||||
return formatNumber(d) + " TWh";
|
|
||||||
};
|
|
||||||
|
|
||||||
var svg = div.append("svg")
|
var svg = div.append("svg")
|
||||||
.attr("width", width + margin.left + margin.right)
|
.attr("width", width + margin.left + margin.right)
|
||||||
@ -70,7 +67,7 @@ function sankeyVis(slice) {
|
|||||||
|
|
||||||
link.append("title")
|
link.append("title")
|
||||||
.text(function (d) {
|
.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")
|
var node = svg.append("g").selectAll(".node")
|
||||||
@ -103,7 +100,7 @@ function sankeyVis(slice) {
|
|||||||
})
|
})
|
||||||
.append("title")
|
.append("title")
|
||||||
.text(function (d) {
|
.text(function (d) {
|
||||||
return d.name + "\n" + format(d.value);
|
return d.name + "\n" + formatNumber(d.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
node.append("text")
|
node.append("text")
|
||||||
|
Loading…
Reference in New Issue
Block a user