The d3.cross() function in D3.js is used to return the cartesian product of the given two arrays A and B.
Parameters: This function accepts two parameters which are mentioned above and described below:
- Array1: This is the first array whose elements are going to be performed cartesian product with array2.
- Array2: This is the second array whose elements are going to be performed cartesian product with array1.
Return Value: It returns the cartesian product array of two-element each of two given array.
Below programs illustrate the d3.cross() function in D3.js.
[[10, 1], [10, 2], [10, 3], [20, 1], [20, 2], [20, 3], [30, 1], [30, 2], [30, 3]]
[[A, a], [A, b], [A, c], [B, a], [B, b], [B, c], [C, a], [C, b], [C, c]]
- How to get the function name inside a function in PHP ?
- CSS | rgb() Function
- PHP | Ds\Set last() Function
- PHP | Ds\Set first() Function
- PHP | Ds\Set add() Function
- PHP | Ds\Map xor() Function
- PHP | end() Function
- CSS | var() Function
- D3.js | d3.mean() function
- CSS | hsl() Function
- p5.js | sq() function
- D3.js | d3.sum() function
- p5.js | nf() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.