D3.js pow.range() Function Last Updated : 23 Aug, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The pow.range() function in d3.js is used to set the scale's range to the specified array of values that must contain two or more than two values. The elements in the range can be number or string. Syntax: pow.range([range]); Parameters: This function takes a single parameter that is given above and described below. [range]: This is an array that contains the range for the domain specified. Return Values: This function does not return any value. Example 1: html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" path1tent= "width=device-width,initial-scale=1.0" /> <script src="https://d3js.org/d3.v4.min.js"> </script> </head> <body> <script> var pow = d3.scalePow() // Setting domain for the scale. .domain([-10, 10]) // Range of numbers .range([10, 20, 30, 40, 50, 60]) .exponent(2); console.log("The range of this is " + "[10,20,30,40,50,60]: "); console.log("pow(-4): " + pow(-4)); console.log("pow(4): " + pow(4)); console.log("pow(2.4): " + pow(2.4)); </script> </body> </html> Output: Example 2: html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" path1tent= "width=device-width,initial-scale=1.0" /> <script src="https://d3js.org/d3.v4.min.js"> </script> </head> <body> <script> var pow = d3.scalePow() // Setting domain for the scale. .domain([-10, 10]) // Range of colors .range(["red", "blue", "green", "white"]) .exponent(2); console.log("The range of this is" + " [red,blue,green,white]: "); console.log("pow(-4): " + pow(-4)); console.log("pow(4): " + pow(4)); console.log("pow(2.4): " + pow(2.4)); </script> </body> </html> Output: Comment More infoAdvertise with us Next Article D3.js pow.rangeRound() Function T tarun007 Follow Improve Article Tags : JavaScript Web Technologies D3.js Similar Reads D3.js log.range() Function The log.range() function sets the range of the log scale to the specified array of values that must contain two or more than two values. The elements in the range can be number or string. Syntax: log.range([range]); Parameters: This function takes a single parameter that is given above and described 1 min read D3.js pow.rangeRound() Function The pow.rangeRound() function is used set the range of the scale to the specified array of values along with this it internally sets the interpolator to interpolatorRound. Syntax: pow.rangeRound([range]); Parameters: This function takes a single parameter that is given above and described below. [ra 2 min read D3.js | d3.range() function The d3.range() function in D3.js is used to return an array containing an arithmetic progression starting from the start parameter and iterated over a sequence of uniformly-spaced numeric value called a step and ends with a stop parameter.Syntax:Â Â d3.range(start, stop, step) Parameters: This functi 2 min read D3.js ordinal.range() Function The ordinal.range() function in d3.js is used to set the range for the ordinal scale. If in the range there are less number of elements as compared to domain the values then the scale reuse values of the specified range from starting. Syntax: ordinal.range([range]); Parameters: This function takes o 2 min read D3.js band.range() Function The band.range() function in D3.js library is used to set the range of the scale to the specified two-element array of numbers. The default value of the range is [0, 1]. Syntax: band.range([range]); Parameters: This function accepts single parameters as given above and described below. range: This p 2 min read D3.js pow.ticks() Function The pow.ticks() function is used to return the count values from the scaleâs domain. The values returned by ticks() lies in the domain. If the count is not given as a parameter then by default it is set to 10. Syntax: pow.ticks([count]); Parameters: This function accepts a single parameter as mentio 2 min read Like