更新时间:2021-07-16 17:37:04
封面
Title Page
Copyright and Credits
D3.js Quick Start Guide
Packt Upsell
Why subscribe?
Packt.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Getting Started with D3.js
What is SVG?
What makes D3 so special?
This book's approach to learning
A preview of each build
Using SVG to create images using code
Building an interactive scatter plot
Making a basic scatter plot interactive
Creating a bar graph using a data file
Animating SVG elements to create an interactive pie chart
Using physics to create a force-directed graph
Mapping
Setting up
Summary
Using SVG to Create Images Using Code
Base tag
Basic elements
Positioning an element
Styling an element
Important SVG elements
Circle
Line
Rectangle
Ellipse
Polygon
Polyline
Text
Group
Bezier curves
Cubic Bezier curves
Smooth cubic Bezier curves
Quadratic Bezier curve
Smooth quadratic Bezier curve
Drawing a path
Arcs
Documentation
Building an Interactive Scatter Plot
Adding a link to the D3 library
Adding an<svg>tag and sizing it with D3
Creating some fake data for our app
Adding SVG circles and styling them
Creating a linear scale
Attaching data to visual elements
Use data attached to a visual element to affect its appearance
Creating a time scale
Parsing and formatting times
Setting dynamic domains
Dynamically generating SVG elements
Creating axes
Displaying data in a table
Making a Basic Scatter Plot Interactive
Creating a click handler
Removing data
Dragging an element
Updating data after a drag
Creating a zoom behavior that scales elements
Updating axes when zooming and panning
Updating click points after a transform
Avoiding redrawing the entire screen during rendering
Hiding elements beyond an axis
Creating a Bar Graph Using a Data File
Setting up our application
Creating an external file to hold our data
Making an AJAX request
Writing the basic code
Handling file access
Using AJAX data to create SVG elements
Adjusting the height and the width of the bars
Adjusting the horizontal and the vertical placement of the bars
Making the width of the bars dynamic
Changing the color of the bar based on data
Adding axes
Animating SVG Elements to Create an Interactive Pie Chart
Setting up the application
Create data/configuration variables
Creating an ordinal scale