Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bounds = d3Geo.geoBounds(sampleFeature);
bounds = d3Geo.geoBounds(sampleExtendedFeature1);
bounds = d3Geo.geoBounds(sampleExtendedFeature2);
bounds = d3Geo.geoBounds(sampleFeatureCollection);
bounds = d3Geo.geoBounds(sampleExtendedFeatureCollection);
// geoCentroid(...) =======================================================
let centroid: [number, number] = d3Geo.geoCentroid(samplePolygon);
centroid = d3Geo.geoCentroid(sampleSphere);
centroid = d3Geo.geoCentroid(sampleGeometryCollection);
centroid = d3Geo.geoCentroid(sampleExtendedGeometryCollection);
centroid = d3Geo.geoCentroid(sampleFeature);
centroid = d3Geo.geoCentroid(sampleExtendedFeature1);
centroid = d3Geo.geoCentroid(sampleExtendedFeature2);
centroid = d3Geo.geoCentroid(sampleFeatureCollection);
centroid = d3Geo.geoCentroid(sampleExtendedFeatureCollection);
// geoContains(...) =======================================================
let contained: boolean = d3Geo.geoContains(samplePolygon, [0, 0]);
contained = d3Geo.geoContains(sampleSphere, [0, 0]);
contained = d3Geo.geoContains(sampleGeometryCollection, [0, 0]);
contained = d3Geo.geoContains(sampleExtendedGeometryCollection, [0, 0]);
contained = d3Geo.geoContains(sampleFeature, [0, 0]);
contained = d3Geo.geoContains(sampleExtendedFeature1, [0, 0]);
contained = d3Geo.geoContains(sampleExtendedFeature2, [0, 0]);
contained = d3Geo.geoContains(sampleFeatureCollection, [0, 0]);
contained = d3Geo.geoContains(sampleExtendedFeatureCollection, [0, 0]);
// geoDistance(...) =======================================================
bounds = d3Geo.geoBounds(sampleExtendedFeature1);
bounds = d3Geo.geoBounds(sampleExtendedFeature2);
bounds = d3Geo.geoBounds(sampleFeatureCollection);
bounds = d3Geo.geoBounds(sampleExtendedFeatureCollection);
// geoCentroid(...) =======================================================
let centroid: [number, number] = d3Geo.geoCentroid(samplePolygon);
centroid = d3Geo.geoCentroid(sampleSphere);
centroid = d3Geo.geoCentroid(sampleGeometryCollection);
centroid = d3Geo.geoCentroid(sampleExtendedGeometryCollection);
centroid = d3Geo.geoCentroid(sampleFeature);
centroid = d3Geo.geoCentroid(sampleExtendedFeature1);
centroid = d3Geo.geoCentroid(sampleExtendedFeature2);
centroid = d3Geo.geoCentroid(sampleFeatureCollection);
centroid = d3Geo.geoCentroid(sampleExtendedFeatureCollection);
// geoContains(...) =======================================================
let contained: boolean = d3Geo.geoContains(samplePolygon, [0, 0]);
contained = d3Geo.geoContains(sampleSphere, [0, 0]);
contained = d3Geo.geoContains(sampleGeometryCollection, [0, 0]);
contained = d3Geo.geoContains(sampleExtendedGeometryCollection, [0, 0]);
contained = d3Geo.geoContains(sampleFeature, [0, 0]);
contained = d3Geo.geoContains(sampleExtendedFeature1, [0, 0]);
contained = d3Geo.geoContains(sampleExtendedFeature2, [0, 0]);
contained = d3Geo.geoContains(sampleFeatureCollection, [0, 0]);
contained = d3Geo.geoContains(sampleExtendedFeatureCollection, [0, 0]);
// geoDistance(...) =======================================================
const distance: number = d3Geo.geoDistance([54, 2], [53, 1]);
export default function chamberlin(p0, p1, p2) { // TODO order matters!
var c = centroid({type: "MultiPoint", coordinates: [p0, p1, p2]}),
R = [-c[0], -c[1]],
r = rotation(R),
f = chamberlinRaw(pointRadians(r(p0)), pointRadians(r(p1)), pointRadians(r(p2)));
f.invert = solve2d(f);
var p = projection(f).rotate(R),
center = p.center;
delete p.rotate;
p.center = function(_) {
return arguments.length ? center(r(_)) : r.invert(center());
};
return p
.clipAngle(90);
}
geoCentroidByName(this: View, name: string) {
return geoCentroid(this.geoFeatureByName(name));
},
geoDistance(p1: any, p2: any) {
geoCentroid(feature: ExtendedFeature) {
return geoCentroid(feature);
},
geoCentroidByName(this: View, name: string) {
var faceProjection = function(face) {
var c = geoCentroid({ type: "MultiPoint", coordinates: face }),
rotate = [-c[0], -c[1], 30];
if (abs(c[1]) == 90) {
rotate = [0, -c[1], -30];
}
return projection(leeRaw)
.scale(1)
.translate([0, 0])
.rotate(rotate);
};
faceProjection = faceProjection || function(face) {
var c = centroid({type: "MultiPoint", coordinates: face});
return projection(collignonK).translate([0, 0]).scale(1).rotate(c[1] > 0 ? [-c[0], 0] : [180 - c[0], 180]);
};
polyhedron.forEach(function(face) {
face.centroid = centroid({ type: "MultiPoint", coordinates: face });
});
faceProjection = faceProjection || function(face) {
var c = centroid({type: "MultiPoint", coordinates: face});
return gnomonic().scale(1).translate([0, 0]).rotate([-c[0], -c[1]]);
};