d3-fcs

0.0.3-rc • Public • Published

d3-four color scatter

Often within a scatterplot we wish to identify multiple categories, but do not want neighbouring elements to accientally end up with the same colour.

Installing

If you use NPM, npm install d3-fcs. Otherwise, download the [latest release](https://github.com/wolfiex/d3-fcs

API Reference

Refer to the observable notebook (@wolfiex), or test file (in the test directory on the github repository)

https://observablehq.com/@wolfiex/d3-fcs-demo

fcs = require('d3-fcs')

// create an array of x,y,category for all points in the plot

var scatter = data.map(n=>{return {x:...,y:...,c:...}})

var cdict = fcs.ccat(scatter)


// plot
svg.append('circle')
    ...
    .fill(d=>cdict[d.c])

Dependents (0)

Package Sidebar

Install

npm i d3-fcs

Weekly Downloads

1

Version

0.0.3-rc

License

BSD-3-Clause

Unpacked Size

7.46 kB

Total Files

7

Last publish

Collaborators

  • wolfiex