MCPcopy Create free account
hub / github.com/jipegit/OSXAuditor / stack

Function stack

d3-3.2.8/d3.js:5890–5911  ·  view source on GitHub ↗
(data, index)

Source from the content-addressed store, hash-verified

5888 d3.layout.stack = function() {
5889 var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY;
5890 function stack(data, index) {
5891 var series = data.map(function(d, i) {
5892 return values.call(stack, d, i);
5893 });
5894 var points = series.map(function(d) {
5895 return d.map(function(v, i) {
5896 return [ x.call(stack, v, i), y.call(stack, v, i) ];
5897 });
5898 });
5899 var orders = order.call(stack, points, index);
5900 series = d3.permute(series, orders);
5901 points = d3.permute(points, orders);
5902 var offsets = offset.call(stack, points, index);
5903 var n = series.length, m = series[0].length, i, j, o;
5904 for (j = 0; j < m; ++j) {
5905 out.call(stack, series[0][j], o = offsets[j], points[0][j][1]);
5906 for (i = 1; i < n; ++i) {
5907 out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]);
5908 }
5909 }
5910 return data;
5911 }
5912 stack.values = function(x) {
5913 if (!arguments.length) return values;
5914 values = x;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected