Built with blockbuilder.org
Last active
December 13, 2018 01:06
-
-
Save max-l/b49fa3d68febea58002b411e6308502f to your computer and use it in GitHub Desktop.
select and grouping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<style> | |
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } | |
</style> | |
</head> | |
<body> | |
<script> | |
var matrix2 = [ | |
{r:"r1", da: [11975, 5871, 8916, 2868]}, | |
{r:"r2", da: [1951, 10048, 2060, 6171]}, | |
]; | |
var tr = d3.select("body") | |
.append("table") | |
.selectAll("tr") | |
.data(matrix2) | |
.enter().append("tr").text(d => d.r) | |
var td = tr.selectAll("td") | |
.data(d => d.da) | |
.enter().append("td") | |
.text(d => '+'+d); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment