Skip to content

Instantly share code, notes, and snippets.

@joao-parana

joao-parana/index.html

Last active Dec 19, 2017
Embed
What would you like to do?
Exemplo simples com select
<!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