Search⌘ K

HTML

Learn to identify the role of HTML in creating simple D3 visualizations, including how to integrate CSS and JavaScript, and the importance of loading the D3.js library efficiently.

Let’s take a look at the HTML sections of the simple graph code to understand its use.

The HTML portion of the code

Here’s the HTML portion of the code:

HTML
<!DOCTYPE html>
<meta charset="utf-8">
<style>
The CSS is in here
</style>
<body>
<script src="https://d3js.org/d3.v6.min.js"></script>
<script>
The D3 JavaScript code is here
</script>
</body>

Understanding the HTML portion

It kind of looks like a wrapping for the CSS (lines 3-5) and JavaScript (lines 10-12 ...