It's time to open the developer tools. In the top-right corner of the browser, you will see the icon as shown in the following screenshot:
This icon opens a submenu. Click on More Tools, then click on Developer tools.
A panel will open at the bottom of the browser, containing all the developer tools at your disposal.
The option names mentioned here might differ according to the version of Chrome you are using.
For quick access to developer tools on the Mac, use alt + command + I; for Windows PCs, use Ctrl + Shift + I.
Within developer tools, you have a series of tabs (Elements, Network, Sources, and so on). These tools are extremely valuable and will allow you to inspect different aspects of your code. For more information on the Chrome developer tools, please go to this link: https://developer.chrome.com/devtools/docs/authoring-development-workflow.
Since we are going to focus on the Elements tab, click on it if it is not already selected.
You should see something similar to the preceding screenshot; it will have the following code statement:
<svg width="812" height="584">
If you click on the SVG item, you should see it expand and display the path tag. The path tag will have several numbers and characters tied to a d attribute. These numbers are control points that draw the path. We will cover how the path is drawn in the next chapter and how path tags are used to create maps in Chapter 4, Creating a Map and Chapter 5, Click-Click Boom! Applying Interactivity to Your Map.
We also want to draw your attention to how the HTML5 application loads the D3 library. Again, in the Elements tag, after the SVG tag, you should see the <script> tag pointing to D3.js and TopoJSON:
<script src="http://d3js.org/d3.v5.min.js" charset="utf-8"></script>
<script src="https://unpkg.com/[email protected]/dist/topojson.js"></script>
If you click on the path located inside the SVG tag, you will see a new panel called the CSS inspector or the styles inspector. It shows and controls all the styles that are applied to a selected element, in this case, the path element.
These three components create a D3 visualization:
- HTML5 (the SVG and path elements)
- JavaScript (the D3.js library and map code)
- CSS (the styling of the HTML5 elements)
Creating maps and visualizations using these three components will be discussed and analyzed throughout the book.