D3.js voronoi.y() Function
Last Updated :
14 Oct, 2020
The voronoi.y() function is used to set the y-coordinate accessor. If y is not specified then this function returns the current y-coordinate accessor to the Voronoi generator function.
Syntax:
d3.voronoi.y([y]);
Parameters: This function takes one parameter as given above and described below:
- y: It is the value for the y-coordinate accessor.
Return Value: This function does not return anything.
Note: Please create a data.csv file. The data for the file is given in the below code.
Below given are a few examples of the Voronoi.y() function.
Example 1:
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="
width=device-width, initial-scale=1.0">
<script type="text/javascript"
src="https://d3js.org/d3.v4.min.js">
</script>
<script src="https://d3js.org/d3-voronoi.v1.min.js">
</script>
</head>
<body>
<h1 style="color:green">GeeksforGeeks</h1>
<h3 style="color:green">voronoi.y()</h3>
<script>
d3