D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
Alsaxian
Full window
Github gist
DecemberCafeChap3
Built with
blockbuilder.org
<!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> <p>Apple</p> <p id = "Lyon" class = "Rhone">Pear</p> <p class = "Rhone">Banana</p> <script> var p1 = d3.select("body").select("p") p1.style("color", "red") var p123 = d3.select("body").selectAll("p") p123.style("color", "green") d3.select("body").select("#Lyon").style("color", "brown") d3.select("body").selectAll(".Rhone").style("color", "purple") d3.select("body").append("p").text("append an element") d3.select("body").insert("p", "#Lyon").text("insert an element") var Asupprimer = d3.select("body").select("p","#Lyon") //= short: select("Lyon")!! Asupprimer.remove() </script> </body>
https://d3js.org/d3.v4.min.js