Skip to content

Instantly share code, notes, and snippets.

@max-l
Last active December 13, 2018 01:06

Revisions

  1. max-l revised this gist Dec 13, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,6 @@
    var td = tr.selectAll("td")
    .data(d => d.da)
    .enter().append("td")
    .text(d => d);
    .text(d => '+'+d);
    </script>
    </body>
  2. max-l revised this gist Dec 13, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,6 @@
    var td = tr.selectAll("td")
    .data(d => d.da)
    .enter().append("td")
    .text(function(d) { return d; });
    .text(d => d);
    </script>
    </body>
  3. max-l revised this gist Dec 13, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@
    .enter().append("tr").text(d => d.r)

    var td = tr.selectAll("td")
    .data(function(d) { return d.da; })
    .data(d => d.da)
    .enter().append("td")
    .text(function(d) { return d; });
    </script>
  4. max-l revised this gist Dec 13, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -11,8 +11,8 @@
    <script>

    var matrix2 = [
    {r:"r1", d: [11975, 5871, 8916, 2868]},
    {r:"r2", d: [1951, 10048, 2060, 6171]},
    {r:"r1", da: [11975, 5871, 8916, 2868]},
    {r:"r2", da: [1951, 10048, 2060, 6171]},
    ];

    var tr = d3.select("body")
    @@ -22,7 +22,7 @@
    .enter().append("tr").text(d => d.r)

    var td = tr.selectAll("td")
    .data(function(d) { return d.d; })
    .data(function(d) { return d.da; })
    .enter().append("td")
    .text(function(d) { return d; });
    </script>
  5. max-l revised this gist Dec 13, 2018. No changes.
  6. max-l revised this gist Dec 13, 2018. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -10,19 +10,19 @@
    <body>
    <script>

    var matrix = [
    var matrix2 = [
    {r:"r1", d: [11975, 5871, 8916, 2868]},
    {r:"r1", d: [1951, 10048, 2060, 6171]},
    {r:"r2", d: [1951, 10048, 2060, 6171]},
    ];

    var tr = d3.select("body")
    .append("table")
    .selectAll("tr")
    .data(matrix)
    .enter().append("tr");
    .data(matrix2)
    .enter().append("tr").text(d => d.r)

    var td = tr.selectAll("td")
    .data(function(d) { return d; })
    .data(function(d) { return d.d; })
    .enter().append("td")
    .text(function(d) { return d; });
    </script>
  7. max-l created this gist Dec 13, 2018.
    1 change: 1 addition & 0 deletions .block
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    license: mit
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Built with [blockbuilder.org](http://blockbuilder.org)
    29 changes: 29 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    <!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 matrix = [
    {r:"r1", d: [11975, 5871, 8916, 2868]},
    {r:"r1", d: [1951, 10048, 2060, 6171]},
    ];

    var tr = d3.select("body")
    .append("table")
    .selectAll("tr")
    .data(matrix)
    .enter().append("tr");

    var td = tr.selectAll("td")
    .data(function(d) { return d; })
    .enter().append("td")
    .text(function(d) { return d; });
    </script>
    </body>