Pre-projected geometry v getting the browser to do it (aka efficiency v flexibility)

If I use this D3 function, aren’t I still forcing the viewer’s browser to do a lot of data processing, which will worsen the performance? The point of pre-processing the data is to avoid this. Or am I overestimating the processing work involved in the d3.geoTransform() function above? Short Answer: You are overestimating the amount … Read more

How to add properties to topojson file?

Try using this: topojson -o final.json -e data.tsv \ –id-property=code_2,code -p code_2,state=name \ — topojson.json Which should output: { “type”: “Topology”, “transform”: { “scale”: [ 0.000016880209206372492, 0.000007005401010148724 ], “translate”: [ -1.8418800213354616, 51.15278777877789 ] }, “objects”: { “states”: { “type”: “GeometryCollection”, “geometries”: [ { “type”: “Polygon”, “arcs”: [ [ 0 ] ], “id”: “AK”, “properties”: { … Read more

D3.js Map with Albers Projection: How to rotate it?

Albers projections can be a bit tricky if you don’t know the underlying transformations. Unless showing the US (for which the parameters of d3.geoAlbers are defaulted to), you’ll likely need to modify the parallels, rotation, and center. Standard Parallels This is an albers projection with its parallels set to 10 and 15 .parallels([10,15]), as in … Read more