Last active
December 19, 2017 03:21
-
-
Save joao-parana/eb60a0255f502b945bb26ab244d682a0 to your computer and use it in GitHub Desktop.
Exemplo simples com select
This file contains hidden or 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> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="description" content="SOMA 01 - Hello World"> | |
<title>SOMA 01 - Hello World</title> | |
</head> | |
<body> | |
<div id="page"></div> | |
<script src="https://d3js.org/d3.v4.min.js" charset="utf-8"></script> | |
<script> | |
d3.select('div#page') | |
.append('h1') | |
.text('Alô mundo ! Este é o primeiro App que usa o D3.js'); | |
d3.selectAll('div').style('background-color', 'lightblue'); | |
d3.selectAll("div").style('background-color', function (d, i) { | |
return (i % 2 === 0) ? "lightblue" : "lightgray"; | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment