Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@types/d3-polygon
Advanced tools
npm install --save @types/d3-polygon
This package contains type definitions for d3-polygon (https://github.com/d3/d3-polygon/).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-polygon/v1.
// Last module patch version validated against: 1.0.6
/**
* Returns the signed area of the specified polygon. If the vertices of the polygon are in counterclockwise order
* (assuming a coordinate system where the origin <0,0> is in the top-left corner), the returned area is positive;
* otherwise it is negative, or zero.
*
* @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
*/
export function polygonArea(polygon: Array<[number, number]>): number;
/**
* Returns the centroid of the specified polygon.
*
* @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
*/
export function polygonCentroid(polygon: Array<[number, number]>): [number, number];
/**
* Returns the convex hull of the specified points using Andrew’s monotone chain algorithm.
* The returned hull is represented as an array containing a subset of the input points arranged in
* counterclockwise order. Returns null if points has fewer than three elements.
*
* @param points Array of coordinates <x0, y0>, <x1, y1> and so on.
*/
export function polygonHull(points: Array<[number, number]>): Array<[number, number]> | null;
/**
* Returns true if and only if the specified point is inside the specified polygon.
*
* @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
* @param point Coordinates of point <x, y>.
*/
export function polygonContains(polygon: Array<[number, number]>, point: [number, number]): boolean;
/**
* Returns the length of the perimeter of the specified polygon.
*
* @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
*/
export function polygonLength(polygon: Array<[number, number]>): number;
These definitions were written by Tom Wanzek, Alex Ford, Boris Yankov, and Nathan Bierema.
FAQs
TypeScript definitions for d3-polygon
The npm package @types/d3-polygon receives a total of 1,478,529 weekly downloads. As such, @types/d3-polygon popularity was classified as popular.
We found that @types/d3-polygon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.