VOOZH about

URL: https://www.geeksforgeeks.org/javascript/d3-js-zip-function/

โ‡ฑ D3.js zip() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

D3.js zip() Function

Last Updated : 10 Apr, 2023

The zip() function in D3.js is used to form a matrix from an array given as a parameter. It helps to visualize data. D3.js stands for Data-Driven Documents.

Syntax:

d3.zip(arraysโ€ฆ)

Parameters:  This function accepts a single parameter as mentioned above and described below:

  • arrays:  This parameter holds the series of arrays.

Return Value: It returns the array of arrays.

Below examples illustrate the zip() function in D3.js:

Example 1:

Output:

๐Ÿ‘ Image

Example 2: When nothing is given in the parameter an empty array is returned by the zip function.

Output:

๐Ÿ‘ Image

Comment
Article Tags: