D3.js | d3.scaleIdentity() Function
The d3.scaleBand() function in D3.js is used to construct a new identity scale with the unit domain [0, 1] and the unit range [0, 1].
Syntax:
d3.scaleIdentity().domain(array of values).range(array of values);
Parameters: This function does not accept any parameters.
Return Value: This function returns the corresponding range for the domain’s value.
Below program illustrate the d3.scaleIdentity() function in D3.js:
Example:
<!DOCTYPE html> <html> <head> <title></title> </script> </head> <body> <script> // Calling the scaleIdentity() function var A = d3.scaleIdentity() .domain([0, 1]) .range([0, 1]); // Getting the corresponding range for // the domain value console.log(A('0')); console.log(A('1')); </script> </body> </html> |
Output:
0 1
Reference: https://devdocs.io/d3~5/d3-scale#scaleBand
Recommended Posts:
- How to call a function that return another function in JavaScript ?
- How to get the function name from within that function using JavaScript ?
- How to get the function name inside a function in PHP ?
- PHP | Ds\Set first() Function
- D3.js | d3.map.has() Function
- D3.js | d3.map.set() Function
- PHP | exp() Function
- p5.js | tan() function
- PHP | Ds\Set last() Function
- p5.js | hue() function
- p5.js | day() function
- PHP | pow( ) Function
- p5.js | value() Function
- p5.js | pow() function
- PHP | ord() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



