D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
geffkas
Full window
Github gist
d3js Exercice 3 - svg
d3js Exercice 3 - svg
forked from
AlainRo
's block:
d3js Exercice 3 - svg
<!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> <!-- LE BAC A SABLE DU SVG --> <body> <div> <svg width="100" height=100> <rect width="50" height="50" fill="blue"> </rect> <circle r="20" cx="50" cy= 50 fill="yellow"> </circle> </svg> </div> <script> // Exercice faire varier la couleur du rectangle sur une échelle de couleur //d3.select('rect').style('fill', 'red'); // Essayer le g // Essayer le transform: transform="translate(30) rotate(45 50 50)" </script> </body>
https://d3js.org/d3.v4.min.js