D3.js quantize.invertExtent() Function Last Updated : 19 Aug, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The quantize.invertExtent() function is used to return the extent of values that are present in the domain [x0, x1] for corresponding values that are in the range. Syntax: quantile.invertExtent(value); Parameters: This function takes a single parameter that is given above and described below. value: It is a number that corresponds to the domain values. Return Value: This function returns the extent of the values in the domain. Example 1: HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" path1tent="width=device-width, initial-scale=1.0" /> <title>Geeks for geeks</title> <script src="https://d3js.org/d3.v4.min.js"> </script> <script src="https://d3js.org/d3-color.v1.min.js"> </script> <script src= "https://d3js.org/d3-interpolate.v1.min.js"> </script> <script src= "https://d3js.org/d3-scale-chromatic.v1.min.js"> </script> <style> body { line-height: 5px; text-align: center; } h2 { color: green; } h3 { line-height: 10px; } </style> </head> <body> <h2>Geeks for geeks</h2> <p>quantize.invertExtent() Function </p> <script> var object = d3.scaleQuantize() // Value from 10 to 100 decides // which value to output .domain([10, 100]) // This should be a number range. .range([11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12]); document.write("<br/>") document.write("<h3>This is floating " + "number so: " + object.invertExtent(14.44) + "</h3>"); document.write("<h3>" + object.invertExtent(14) + "</h3>"); document.write("<h3>" + object.invertExtent(15) + "</h3>"); </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" /> <title>Geeks for geeks</title> <script src="https://d3js.org/d3.v4.min.js"> </script> <script src="https://d3js.org/d3-color.v1.min.js"> </script> <script src= "https://d3js.org/d3-interpolate.v1.min.js"> </script> <script src= "https://d3js.org/d3-scale-chromatic.v1.min.js"> </script> <style> body { line-height: 5px; text-align: center; } h2 { color: green; } h3 { line-height: 10px; } </style> </head> <body> <h2>Geeks for geeks</h2> <p>quantize.invertExtent() Function </p> <script> var object = d3.scaleQuantize() // Value from 1 to 10 decides // which value to output .domain([1, 10]) .range([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); document.write("<br/>"); document.write("<h3>" + object.invertExtent(1) + "</h3>"); document.write("<h3>" + object.invertExtent(2) + "</h3>"); document.write("<h3>" + object.invertExtent(3) + "</h3>"); document.write("<h3>" + object.invertExtent(4) + "</h3>"); document.write("<h3>" + object.invertExtent(5) + "</h3>"); document.write("<h3>" + object.invertExtent(6) + "</h3>"); document.write("<h3>" + object.invertExtent(7) + "</h3>"); document.write("<h3>" + object.invertExtent(8) + "</h3>"); document.write("<h3>" + object.invertExtent(9) + "</h3>"); document.write("<h3>" + object.invertExtent(10) + "</h3>"); </script> </body> </html> Output: Comment More infoAdvertise with us Next Article D3.js pow.invert() Function T tarun007 Follow Improve Article Tags : JavaScript Web Technologies D3.js Similar Reads D3.js quantile.invertExtent() Function The quantile.invertExtent() function in d3.js is used to return the extent of the values that are present in the specified domain for the corresponding value in the range. Syntax: quantile.invertExtent( value ) Parameters: This function accepts a single parameter as given above and described below: 2 min read D3.js threshold.invertExtent() Function The threshold.invertExtent() function in d3.js is used to return the extent of the values in the specified domain. Syntax: threshold.invertExtent(value); Parameters: This function accepts a single parameter as given above and described below: value: This parameter takes a value from the given range. 2 min read D3.js quantize() Function The d3.quantize function is used to generate uniformly spaced samples of interpolator and return them. It is useful in generating a particular number of samples from a given interpolator. Syntax: d3.quantize(interpolator, n); Parameters: It takes the following two parameters. interpolator: It is the 1 min read D3.js transform.invertX() Function The transform.invertX() Function in D3.js is used to get the inverse transformation of the specified x-coordinate, (x - tx) / k.Syntax:transform.invertX(x)Parameters: This function accepts the following parameter as mentioned above and described below:x: This parameter is the x-coordinate.Return Val 3 min read D3.js pow.invert() Function The pow.invert() function is used to return a value from the domain when given a value from the range. This inversion is useful for interaction such as determining the data value that corresponds to the position of the mouse. Syntax: pow.invert( value ) Parameters: This function accepts only one par 2 min read D3.js log.invert() Function The log.invert() function returns a value from the domain when a value from the range is given. This inversion is useful for interaction such as determining the data value that corresponds to the position of the mouse. Syntax: log.invert(value); Parameters: This function accepts only one parameter a 1 min read Like