VOOZH about

URL: https://www.geeksforgeeks.org/javascript/d3-js-delaunay-trianglepolygons-method/

⇱ D3.js Delaunay.trianglePolygons() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

D3.js Delaunay.trianglePolygons() Method

Last Updated : 23 Jul, 2025

D3.js is a strong JavaScript framework for data visualization, and one of its modules, Delaunay, supports Delaunay triangulation. The Delaunay.trianglePolygons() Method returns an iterable over the polygons for each triangle, in order.

Syntax:

Delaunay.trianglePolygons()

Parameters:

This method takes no parameters.

Return Value:

This method returns an Iterable over the polygons.

Example 1: The below code example shows the use of the Delaunay.trianglePolygons() method.

Output:

👁 resize-1709472822368222932Screenshot202403031859001-(1)

Example 2: The below code uses the d3.Delaunay.trianglePolygons() method to render the individual triangles of a Delaunay triangulation on a canvas.

Comment
Article Tags: