Is there a way to use d3.max
or d3.min
to find the maximum or minimum of a specific column in a multidimensional javascript array?
var arr = new Array();
for(var i=0;i<10;i++){
arr.push([i,Math.random()]);
}
From this code I'd like to do something like d3.max(arr[*][1])
(with a wildcard, or otherwise) to get the maximum value of the second column, but specifying an index seems to require designating a row first, and then a column, which seems to limit the d3.max
routine to row operations only.
I know I can code a separate function to extract this information, but am wondering if there is something built into the D3 API or in Javascript that will do this.