Skip to content

Commit

Permalink
Add center point to stack layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
jheer committed May 7, 2013
1 parent 70167da commit 720754f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/data/stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ vg.data.stack = function() {
params = ["offset", "order"],
output = {
"y0": "y2",
"y1": "y"
"y1": "y",
"cy": "cy"
};

function stack(data) {
var out_y0 = output["y0"],
out_y1 = output["y1"];
out_y1 = output["y1"],
out_cy = output["cy"];

layout.out(function(d, y0, y) {
if (d.datum) {
d.datum[out_y0] = y0;
d.datum[out_y1] = y + y0;
d.datum[out_cy] = y0 + y/2;
}
})(stacks(data));

Expand Down
7 changes: 5 additions & 2 deletions vega.js
Original file line number Diff line number Diff line change
Expand Up @@ -3035,17 +3035,20 @@ function vg_load_http(url, callback) {
params = ["offset", "order"],
output = {
"y0": "y2",
"y1": "y"
"y1": "y",
"cy": "cy"
};

function stack(data) {
var out_y0 = output["y0"],
out_y1 = output["y1"];
out_y1 = output["y1"],
out_cy = output["cy"];

layout.out(function(d, y0, y) {
if (d.datum) {
d.datum[out_y0] = y0;
d.datum[out_y1] = y + y0;
d.datum[out_cy] = y0 + y/2;
}
})(stacks(data));

Expand Down
Loading

0 comments on commit 720754f

Please sign in to comment.