Skip to content

Instantly share code, notes, and snippets.

@AlainRo
Last active October 10, 2017 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlainRo/a5a4f9fd26f45a25ce924492253f8bef to your computer and use it in GitHub Desktop.
Save AlainRo/a5a4f9fd26f45a25ce924492253f8bef to your computer and use it in GitHub Desktop.
d3js Exercice 3 - svg

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment