const links = linksData.map((d) => Object.assign({}, d)); const nodes = nodesData.map((d) => Object.assign({}, d)); const containerRect = container.getBoundingClientRect(); const height = containerRect.height; const width = containerRect.width;