The following HTML page is all you need to start playing around with the D3 library! The script tag is where you will add your JavaScript code. You can always store your JavaScript in a separate file. Note that the D3 library is included directly from the d3js.org website. When using JavaScript libraries you can either download the library and keep a copy in your local file system or just reference the file on the website directly like it is shown below.
This is important if you are very new to JavaScript. The next step in moving forward with D3 is to make sure you understand how to use JavaScript modules. I recommend reading Chapter 10 of Eloquent JavaScript{add link}, in order to get up to speed with this concept if it is unfarmiliar. Like most JavaScript libraries, D3 is used by creating objects from the modules it contains.
If you wish to keep your JavaScript in a separate file, simply include the source in your html page; i.e.
< script src="yourScript.js" >< /script >
However, note that it is important to place a script tag after any dependencies it might have. In this instance, make sure the script tag that references your local JavaScript file is included after the script tag that includes the D3 library.