D3.js Quick Start Guide
Matthew Huntington更新时间:2021-07-16 17:37:04
最新章节:Leave a review - let other readers know what you think封面
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
Summary
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
Summary
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
Summary
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
Summary
Animating SVG Elements to Create an Interactive Pie Chart
Setting up the application
Create data/configuration variables
Creating an ordinal scale
Creating the color scale to map labels to colors
Setting up the SVG
Adding paths for each pie segment
Generating an arc creating function
Formatting the data for the arc
Adjusting the position of the pie
Making a donut graph
Removing parts of the pie
Summary
Using Physics to Create a Force-Directed Graph
What is a force-directed graph?
How to set up a graph of relationships
Display
Physics
Setting up the HTML
Setting up styling for nodes and links
Setting up the SVG
Adding data for people
Adding data for relationships
Add circles to the SVG
Adding lines to the SVG
Creating a simulation
Specifying how the simulation affects visual elements
Creating forces
Summary
Mapping
Defining GeoJSON
Setting up the HTML
Using a projection
Generating a path using a projection and GeoJSON data
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
更新时间:2021-07-16 17:37:04