d3-process-control
v0.1.1
Published
d3 utility to apply nelsons rules of process control to a set of data
Downloads
4
Readme
d3-process-control
d3 utility to apply nelsons rules of process control to a set of data.
Installing
If you use NPM, npm install d3-process-control
. Otherwise, download the latest release.
API Example
var data = [{
name: 'foo',
val: 3
} ...];
var control = d3.d3_process_control()
.std(5)
.mean(1)
.rule({
'gt_one_std': {
size: 1,
rule: function(data, mean, std) {
// data is an array of size (1 in this case)
// returning true marks the data point with the attribute gt_one_std
return (data[0] - mean) > std;
}
}
})
.value(function(d) { return d.val; });
svg.selectAll('rect')
.data(data)
.enter()
...
.call(control);
License
MIT