@types/d3-polygon
TypeScript definitions for D3JS d3-polygon module
Last updated 9 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @types/d3-polygon 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/d3-polygon

Summary

This package contains type definitions for d3-polygon (https://github.com/d3/d3-polygon/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-polygon.

index.d.ts

// Last module patch version validated against: 3.0.1

/**
 * 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;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:37 GMT
  • Dependencies: none

Credits

These definitions were written by Tom Wanzek, Alex Ford, Boris Yankov, and Nathan Bierema.

Current Tags

  • 3.0.2                                ...           latest (2 years ago)
  • 1.0.7                                ...           ts2.0 (7 years ago)
  • 1.0.7                                ...           ts2.1 (7 years ago)
  • 1.0.7                                ...           ts2.2 (7 years ago)
  • 1.0.7                                ...           ts2.3 (7 years ago)
  • 1.0.7                                ...           ts2.4 (7 years ago)
  • 1.0.7                                ...           ts2.5 (7 years ago)
  • 1.0.7                                ...           ts2.6 (7 years ago)
  • 1.0.7                                ...           ts2.7 (7 years ago)
  • 1.0.7                                ...           ts2.8 (7 years ago)
  • 1.0.7                                ...           ts2.9 (7 years ago)
  • 1.0.7                                ...           ts3.0 (7 years ago)
  • 1.0.7                                ...           ts3.1 (7 years ago)
  • 2.0.0                                ...           ts3.2 (6 years ago)
  • 2.0.0                                ...           ts3.3 (6 years ago)
  • 2.0.0                                ...           ts3.4 (6 years ago)
  • 2.0.0                                ...           ts3.5 (6 years ago)
  • 3.0.0                                ...           ts3.6 (5 years ago)
  • 3.0.0                                ...           ts3.7 (5 years ago)
  • 3.0.0                                ...           ts3.8 (5 years ago)
  • 3.0.0                                ...           ts3.9 (5 years ago)
  • 3.0.0                                ...           ts4.0 (5 years ago)
  • 3.0.0                                ...           ts4.1 (5 years ago)
  • 3.0.0                                ...           ts4.2 (5 years ago)
  • 3.0.0                                ...           ts4.3 (5 years ago)
  • 3.0.0                                ...           ts4.4 (5 years ago)
  • 3.0.2                                ...           ts4.5 (2 years ago)
  • 3.0.2                                ...           ts4.6 (2 years ago)
  • 3.0.2                                ...           ts4.7 (2 years ago)
  • 3.0.2                                ...           ts4.8 (2 years ago)
  • 3.0.2                                ...           ts4.9 (2 years ago)
  • 3.0.2                                ...           ts5.0 (2 years ago)
  • 3.0.2                                ...           ts5.1 (2 years ago)
  • 3.0.2                                ...           ts5.2 (2 years ago)
  • 3.0.2                                ...           ts5.3 (2 years ago)
  • 3.0.2                                ...           ts5.4 (2 years ago)
  • 3.0.2                                ...           ts5.5 (2 years ago)
  • 3.0.2                                ...           ts5.6 (2 years ago)
  • 3.0.2                                ...           ts5.7 (2 years ago)
  • 3.0.2                                ...           ts5.8 (2 years ago)
  • 3.0.2                                ...           ts5.9 (2 years ago)

17 Versions

  • 1.0.10                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 3.0.2                                ...           2 years ago
  • 1.0.9                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 3.0.1                                ...           2 years ago
  • 2.0.1                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 1.0.8                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.7                                ...           7 years ago
  • 1.0.6                                ...           8 years ago
  • 1.0.5                                ...           9 years ago
  • 1.0.4                                ...           10 years ago
  • 0.0.3                                ...           10 years ago
  • 0.0.2                                ...           10 years ago
  • 0.0.1                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |