d3.polygonCentroid()

d3.polygonCentroid(polygon) <> Returns the centroid of the specified polygon.

d3.polygonArea()

d3.polygonArea(polygon) <> 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.

d3.pie()

d3.pie() Constructs a new pie generator with the default settings.

d3.permute()

d3.permute(array, indexes) Returns a permutation of the specified array using the specified array of indexes. The returned array contains the corresponding element in array for each index in indexes, in order. For example, permute(["a", "b", "c"], [1, 2, 0]) returns ["b", "c", "a"]. It is acceptable for the array of indexes to be a different length from the array of elements, and for indexes to be duplicated or omitted. This method can also be used to extract the values from an object into an

d3.path()

d3.path() Constructs a new path serializer that implements CanvasPathMethods.

d3.partition()

d3.partition() Creates a new partition layout with the default settings.

d3.pairs()

d3.pairs(array) For each adjacent pair of elements in the specified array, returns a new array of tuples of element i and element i - 1. For example: d3.pairs([1, 2, 3, 4]); // returns [[1, 2], [2, 3], [3, 4]] If the specified array has fewer than two elements, returns the empty array.

d3.packSiblings()

d3.packSiblings(circles) Packs the specified array of circles, each of which must have a circle.r property specifying the circle’s radius. Assigns the following properties to each circle: circle.x - the x-coordinate of the circle’s center circle.y - the y-coordinate of the circle’s center The circles are positioned according to the front-chain packing algorithm by Wang et al.

d3.packEnclose()

d3.packEnclose(circles) Computes the smallest circle that encloses the specified array of circles, each of which must have a circle.r property specifying the circle’s radius, and circle.x and circle.y properties specifying the circle’s center. The enclosing circle is computed using Welzl’s algorithm adapted to enclose circles rather than points. (See also Apollonius’ Problem.)

d3.pack()

d3.pack() Creates a new pack layout with the default settings.