JSFiddle - React, Tailwind, and code Playground

HTML

<p id="json1"></p>
<p id="json2"></p>

JavaScript

//GeoJSON polygon object
var poly = {
    "type": "Polygon", 
    "coordinates": [
        [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
    ]
}

//a stream transform that applies the simple translate [20,5]:
var transform = d3.geo.transform({
    point:function(x,y){this.stream.point(x+20,y+5)}
}) 

//a path generator with the transform applied using the projection() method
var path1 = d3.geo.path().projection(transform);

//++ Question: what if i want to apply a transform after applying a standard geographic projection? It seems like projection.stream(listener) is the right approach, but what should the listener argument be?
var proj = d3.geo.equirectangular();

//my best guess throws an errror
var path2 = transform.stream(proj.stream());

t1 = d3.select("p#json1");
t2 = d3.select("p#json2");

t1.text(path1(poly))
t2.text(path2(poly))