Skip to content

Instantly share code, notes, and snippets.

@aaizemberg
Created August 3, 2019 13:18
Show Gist options
  • Save aaizemberg/61cfe07005eba3f9f55742e735c05712 to your computer and use it in GitHub Desktop.
Save aaizemberg/61cfe07005eba3f9f55742e735c05712 to your computer and use it in GitHub Desktop.
creando 3 párrafos desde d3.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<!-- cargando d3.js -->
<script src="https://d3js.org/d3.v5.min.js"></script>
<title>d3js</title>
</head>
<body>
<div id="header"></div>
<div id="vis">
</div>
<script>
/* comento esta parte
d3.select("div#header")
.append("h1")
.text("La visualizacion");
*/
var datos = ['uno','dos','tres'];
d3.select("div#vis").selectAll("p")
.data(datos)
.enter()
.append("p")
.text( function(d) { return d; } )
// .text( (d) => d )
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment