Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering SVG

You're reading from   Mastering SVG Ace web animations, visualizations, and vector graphics with HTML, CSS, and JavaScript

Arrow left icon
Product type Paperback
Published in Sep 2018
Publisher Packt
ISBN-13 9781788626743
Length 312 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Rob Larsen Rob Larsen
Author Profile Icon Rob Larsen
Rob Larsen
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Introducing Scalable Vector Graphics FREE CHAPTER 2. Getting Started with Authoring SVG 3. Digging Deeper with SVG Authoring 4. Using SVG in HTML 5. Working with SVG and CSS 6. JavaScript and SVG 7. Common JavaScript Libraries and SVG 8. SVG Animation and Visualizations 9. Helper Libraries Snap.svg and SVG.js 10. Working with D3.js 11. Tools to Optimize Your SVG 12. Other Books You May Enjoy

Getting started with D3


The D3 API can take some getting used to. The examples in this chapter will strive to illustrate some of the basic concepts as well as dive deeper as we move forward to show some of the best that D3 has to offer. 

Before we can do any of that, you need to get D3 into your page. To do so, you can use npm to install it into your project folder:

npm install d3

Once you've got it installed, you can link to the minified D3 source from your document using a script tag:

<script src="node_modules/d3/dist/d3.min.js"></script>

If you'd prefer not to use npm, it's also available to be linked to from d3js.org directly:

<scriptsrc="https://d3js.org/d3.v5.js"></script>

Additionally, if you want a local copy, you can clone the project from GitHub ( https://github.com/d3/d3)), or download the project from d3js.org and then organize your files in any way you like. 

Once you've got the project installed, you're ready to start to explore the D3 API.

 

 

The following example...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime