VOOZH about

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

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


  • Courses
  • Tutorials
  • Interview Prep

D3.js Delaunay.find() Method

Last Updated : 28 Apr, 2025

D3.js is a strong JavaScript framework for data visualization, and one of its modules, Delaunay, supports Delaunay triangulation. The delaunay.find() method returns the index of the input point that is closest to the specified point (x, y).

Syntax:

 delaunay.find(x, y[, i])

Parameters:

  • x: The x-coordinate of the point where you want to find the index point.
  • y: The y-coordinate of the point where you want to find the index point.
  • i (optional): It is an optional parameter indicating a starting triangle index for the search. If provided, the search begins from the specified triangle index.

Return Value:

The index of the Delaunay triangle contains the specified point (x, y).

Example: This example shows the use of delaunay.find() method.

Output:

👁 MicrosoftTeams-image-(3)-(1)

Comment
Article Tags: