HTML

Understand the HTML portion of the simple graph code.

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:

Press + to interact
<!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). ...