Setting up traditional HTML components

In order to understand the power and flexibility of D3, it would make sense to first understand an example of leveraging HTML without it.

Adding a new paragraph the traditional way

Adding a new paragraph to the body of the HTML page is pretty straightforward. All that is necessary is to include two <p> tags with with the appropriate name of the paragraph, as seen in the following script:

<!DOCTYPE html> 
<html> 
<head> 
<script src="d3.js" charset="utf-8"></script>  
  <meta charset="utf-8"> 
  <meta name="viewport" content="width=device-width"> 
  <title>First Example</title> 
</head> 
<body> 
<p>This is our first example</p> 
</body> 
</html>  

Besides adding a new paragraph, we also changed the title of this page to First Example ...

Get Practical Business Intelligence now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.