I'm learning D3 and have come across an issue using the select operator.
Specifically, why does the following code add the <p>
element outside the body, instead of inside it?
var pData1 = d3.select(body).select(p).data([1]).enter().append(p);
I am using a totally blank HTML file with just <head>
and <body>
tags to test.
<html lang=en>
<head>
<title><!-- Insert your title here --></title>
<script type=text/javascript src=d3.min.js></script>
</head>
<body>
</body>
</html>