D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
enjalot
Full window
Github gist
category10
Built with
blockbuilder.org
<!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>
https://d3js.org/d3.v4.min.js