D3.js quantileSorted() Method
With the help of d3.quantileSorted() method, we can get the quantile value of the given array of sorted values by using p as a probability in this method.
Parameter: This function has the following parameter as mentioned above and described below:
- array: It is an array of values which is passed as parameter.
- p: It is the quartile range value.
Return Value: It returns the p-quantile of the given sorted array of elements.
Note: To execute the below examples you have to install the d3 library by using this command prompt we have to execute the following command.
npm install d3
Example 1: Filename: index.js
In this example we can see that by using d3.quantileSorted() method, we are able to get the p-quantile value from the given sorted values of an array by using this method.
Example 2: Filename: index.js
Note: The above program will compile and run by using the following command: