MCPcopy Index your code
hub / github.com/microsoft/SandDance / geoMethod

Function geoMethod

docs/app/js/sanddance-app.js:142867–142876  ·  view source on GitHub ↗
(methodName, globalMethod)

Source from the content-addressed store, hash-verified

142865 };
142866}
142867function geoMethod(methodName, globalMethod) {
142868 return function(projection, geojson, group) {
142869 if (projection) {
142870 // projection defined, use it
142871 const p = getScale(projection, (group || this).context);
142872 return p && p.path[methodName](geojson);
142873 } else // projection undefined, use global method
142874 return globalMethod(geojson);
142875 };
142876}
142877const geoArea = geoMethod("area", (0, _d3Geo.geoArea));
142878const geoBounds = geoMethod("bounds", (0, _d3Geo.geoBounds));
142879const geoCentroid = geoMethod("centroid", (0, _d3Geo.geoCentroid));

Callers 1

sanddance-app.jsFile · 0.70

Calls 1

getScaleFunction · 0.70

Tested by

no test coverage detected