Explain what GeoJSON is
Draw path elements with GeoJSON and D3
Compare and contrast GeoJSON and TopoJSON
Convert between TopoJSON and path elements
Build map visualizations with D3
Draw nodes in a force-directed graph
Draw links in a force-directed graph
Describe what a force simulation is, and how it works
Explore different forces you can simulate with D3
Build a force-directed graph with D3
Code: http://bit.ly/2vHFCbw
d3.geoPath()
Code: http://bit.ly/2xPxVRj
Live Site: http://bit.ly/2elIvrr
TopoJSON
GeoJSON
path commands
D3
topojson
topojson.feature(object, locationOfFeatures)
TopoJSON object
Location of features to convert within object
Code: http://bit.ly/2vCILNT
path.projection([projection])
function that transforms spherical geometry data to 2D plane
N1
N2
N3
Code: http://bit.ly/2vWKsRx
d3.forceSimulation([nodes])
starts a simulation acting on nodes
simulation.nodes([newNodes])
updates a simulation to act on newNodes
d3.forceCenter([x, y])
force location (i.e. coordinates of where you'd like the force to pull nodes)
simulation.force(name[, force])
name of the force
description of the force (i.e. a function)
simulation.on(type[, listener])
d3.forceManyBody()
adds forces between all nodes in the simulation
by default, the forces are reuplsive
force.strength([newStrength])
accepts a value or callback to set a new strength
negative values are repulsive
positive values are attractive
default 'many body' strength is -30
Code: http://bit.ly/2xIeD0Y
Live Site: http://bit.ly/2evZ0l7
d3.forceLink([links])
add link forces based on the links passed in
update the links later using the .links method on the force
N1
N2
var nodes = [
n1,
n2
]
var link = [{
source: 0,
target: 1
}]
???
link.id([id])
Specify how D3 should find nodes based on source and target
N1
N2
link.distance([newDistance])
Ideal distance between nodes
N1
N2
link.strength([newStrength])
Strength is proportional to this distance
N1
Steps
Code: http://bit.ly/2x3wJO1
Live Site: http://bit.ly/2eTnJAh
d3.drag()
Code: http://bit.ly/2vXMrVD
D3 Data Dashboard