If you have two existing transform objects, it would be great if you could append one to another after constructing. This is required for better transform reuse.
Example (zoom with a center point):
import d3Transform from 'd3-transform';
const zoomTransform = d3Transform().scale(1.5);
// The 'x' and 'y' are calculated from the bounding box.
const originForwardTransform= d3Transform().translate([ x, y ]);
const originBackwardTransform= d3Transform().translate([ -x, -y ]);
// Notice the order.
const zoomCenteredTransform = d3Transform()
.concat(originForwardTransform)
.concat(zoomTransform)
.concat(originBackwardTransform);
If you have two existing transform objects, it would be great if you could append one to another after constructing. This is required for better transform reuse.
Example (zoom with a center point):