block by enjalot cd38320d88e41cd2a8d21c1e2eb5b938

category10

Full Screen

Built with blockbuilder.org

index.html

<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  <script src="https://d3js.org/d3.v4.min.js"></script>
  <link href="https://fonts.googleapis.com/css?family=Droid+Sans+Mono" rel="stylesheet">
  <style>
    body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
  </style>
</head>

<body>
  <script>
    var s = "category10"
    var color = d3.scaleOrdinal(d3.schemeCategory10)
    var svg = d3.select("body").append("svg")
      .attr("width", 960)
      .attr("height", 500)

    svg.append("text")
      .attr("y", 250)
      .attr("x", 480)
      .style("text-anchor", "middle")
      .style("font-size", 100)
      //.style("font-family", "Droid Sans Mono, Courier, monospace")
    .style("font-family", "Courier, monospace")
    .selectAll("tspan").data(s.split(''))
    	.enter()
      .append("tspan")
      .text(function(d) { return d})
      .style("fill", function(d,i) { return color(i) })

  </script>
</body>