Downloading D3
Start by creating a new folder for your project. Within that folder, I recommend creating a sub-folder called d3. Then download the latest version of d3.v3.js into that sub-folder. As of this writing, the current version of D3 is 3.4.2.
Creating Project Folder
Creating the project folder and html file(index.html) within this project folder. Project folder structure like this:
project-folder/
d3/
d3.v3.js
d3.v3.min.js (optional)
index.html
Now write html code in html file(index.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 Test</title>
<script type="text/javascript" src="d3/d3.v3.js"></script>
</head>
<body>
<script type="text/javascript">
// Your beautiful D3 code will go here
</script>
</body>
</html>
You can run the file by clicking on html file. It open in web browser. If you use external data source than use local server like MAMP and see result in http://localhost:8888/.