Last active
October 10, 2017 13:56
-
-
Save AlainRo/a5a4f9fd26f45a25ce924492253f8bef to your computer and use it in GitHub Desktop.
d3js Exercice 3 - svg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment