D3.js transpose() Function
The transpose() function in D3.js is used to return the transpose of a 2D array. This function helps to visualize the data and making graphs and charts.
Parameters: This function accept a single parameter as mentioned above and described below:
- Matrix: This parameter holds a matrix as a 2d array
Return value: It returns an array or the matrix.
Below given are a few examples of transpose function.
Example 1: Without using zip function to form a matrix.
Example 2: Using zip function to form a matrix.
- Google Chrome
- Internet Explorer
- Mozilla Firefox