MCPcopy
hub / github.com/zcreativelabs/react-simple-maps / getCoords

Function getCoords

src/utils.js:3–7  ·  view source on GitHub ↗
(w, h, t)

Source from the content-addressed store, hash-verified

1import { feature, mesh } from "topojson-client"
2
3export function getCoords(w, h, t) {
4 const xOffset = (w * t.k - w) / 2
5 const yOffset = (h * t.k - h) / 2
6 return [w / 2 - (xOffset + t.x) / t.k, h / 2 - (yOffset + t.y) / t.k]
7}
8
9export function fetchGeographies(url) {
10 return fetch(url)

Callers 2

handleZoomStartFunction · 0.90
handleZoomEndFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…