This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import d3 from 'd3'; | |
export const fitProjection = (projection, data, box, center) => { | |
// get the bounding box for the data - might be more efficient approaches | |
let left = Infinity; | |
let bottom = -Infinity; | |
let right = -Infinity; | |
let top = Infinity; | |
// reset projection | |
projection.scale(1).translate([0, 0]); |