This bl.ock follows in the footsteps of this block with orthographic labels.
It uses a quick demo of a module that takes a path or selection with paths, overlays it on a projection, converts the path's coordinates to geographic coordinates and then into geojson.
It uses a few methods:
geoCentroid([longitude,latitude])
The geographic centroid to apply to the non-geographic path. Aligns with 0,0 in the non-geographic coordinate space.
geoScale(value)
Sets the scale of the geographic projection which the non-geographic path is overlain ontop of before getting the geographic coordinates. Lower values result in larger features.
pathScale(value)
Sets the scaling value of the non-geographic path. Smaller values result in smaller features.
selection(selection)
Takes a d3 selection, extracts their paths and creates geojson from the paths.
path(path)
Takes a path and creates geojson from the path.
features()
Returns features generated from the selection/path
featureCollection()
Returns a featureCollection generated from the selection/path
https://d3js.org/d3.v4.min.js
https://d3js.org/topojson.v1.min.js