Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/smartin85/d3-czip

Generates a collection from multiple arrays
https://github.com/smartin85/d3-czip

array arrays collection collections d3-czip d3-module d3-plugin d3-zip

Last synced: 6 days ago
JSON representation

Generates a collection from multiple arrays

Awesome Lists containing this project

README

        

# d3-czip
[![BSD 3-Clause License][license-image]][license-url]
[![Build Status][azure-pipeline-image]][azure-pipeline-url]
[![NPM version][npm-image]][npm-url]
[![npm downloads][downloads-image]][npm-url]
[![Dependency Status][daviddm-image]][daviddm-url]
[![Coverage percentage][coveralls-image]][coveralls-url]

[![Buy me a coffee][buy-me-a-coffee-image]][buy-me-a-coffee-url]

Generates a collection from multiple arrays

## Installing

If you use NPM, `npm install --save d3-czip`.
Otherwise, download the [latest release](https://github.com/smartin85/d3-czip/releases/latest).

```html

var w = 960,
h = 500,
svg = d3.select("#chart")
.append("svg")
.attr("width",w)
.attr("height",h),
data = {
x: [100, 200, 300, 400, 500, 600, 700, 800],
y: [50, 150, 80, 200, 300, 120, 350, 210],
r: [50, 10, 30, 20, 60, 15, 40, 25],
c: ['red', 'blue', 'green', 'yellow', 'cyan', 'coral', 'black', 'grey']
};

svg.selectAll("circle")
.data(d3.czip(data))
.enter()
.append("circle")
.attr("cx", function(d) { return d.x; })
.attr("cy", function(d) { return d.y; })
.attr("r", function(d) { return d.r; })
.attr("fill", function(d) { return d.c; });

```

## API Reference

# d3.czip(objWithArrays);

Creates a collection of the arrays.

[license-image]: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
[license-url]: LICENSE

[npm-image]: https://badge.fury.io/js/d3-czip.svg
[npm-url]: https://npmjs.org/package/d3-czip

[downloads-image]: https://img.shields.io/npm/dt/d3-czip.svg

[azure-pipeline-image]: https://dev.azure.com/smartin85/d3-czip/_apis/build/status/smartin85.d3-czip?branchName=master
[azure-pipeline-url]: https://dev.azure.com/smartin85/d3-czip/_build/latest?definitionId=4&branchName=master

[daviddm-image]: https://david-dm.org/smartin85/d3-czip.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/smartin85/d3-czip

[coveralls-image]: https://coveralls.io/repos/smartin85/d3-czip/badge.svg
[coveralls-url]: https://coveralls.io/r/smartin85/d3-czip

[buy-me-a-coffee-image]: https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png
[buy-me-a-coffee-url]: https://www.buymeacoffee.com/smartin