@@ 6740-6751 (lines=12) @@ | ||
6737 | "default": d3_layout_stackOrderDefault |
|
6738 | }); |
|
6739 | var d3_layout_stackOffsets = d3.map({ |
|
6740 | silhouette: function(data) { |
|
6741 | var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = []; |
|
6742 | for (j = 0; j < m; ++j) { |
|
6743 | for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; |
|
6744 | if (o > max) max = o; |
|
6745 | sums.push(o); |
|
6746 | } |
|
6747 | for (j = 0; j < m; ++j) { |
|
6748 | y0[j] = (max - sums[j]) / 2; |
|
6749 | } |
|
6750 | return y0; |
|
6751 | }, |
|
6752 | wiggle: function(data) { |
|
6753 | var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = []; |
|
6754 | y0[0] = o = o0 = 0; |
|
@@ 6769-6777 (lines=9) @@ | ||
6766 | for (j = 0; j < m; ++j) y0[j] -= o0; |
|
6767 | return y0; |
|
6768 | }, |
|
6769 | expand: function(data) { |
|
6770 | var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = []; |
|
6771 | for (j = 0; j < m; ++j) { |
|
6772 | for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; |
|
6773 | if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k; |
|
6774 | } |
|
6775 | for (j = 0; j < m; ++j) y0[j] = 0; |
|
6776 | return y0; |
|
6777 | }, |
|
6778 | zero: d3_layout_stackOffsetZero |
|
6779 | }); |
|
6780 | function d3_layout_stackOrderDefault(data) { |