Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/marks/area.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,17 @@ export function area(data, options) {
}

export function areaX(data, options) {
const {y = indexOf, ...rest} = maybeDenseIntervalY(options);
return new Area(data, maybeStackX(maybeIdentityX({...rest, y1: y, y2: undefined}, y === indexOf ? "x2" : "x")));
const {x, y = indexOf, fill, z = x === fill ? null : undefined, ...rest} = maybeDenseIntervalY(options);
return new Area(
data,
maybeStackX(maybeIdentityX({...rest, x, y1: y, y2: undefined, z, fill}, y === indexOf ? "x2" : "x"))
);
}

export function areaY(data, options) {
const {x = indexOf, ...rest} = maybeDenseIntervalX(options);
return new Area(data, maybeStackY(maybeIdentityY({...rest, x1: x, x2: undefined}, x === indexOf ? "y2" : "y")));
const {x = indexOf, y, fill, z = y === fill ? null : undefined, ...rest} = maybeDenseIntervalX(options);
return new Area(
data,
maybeStackY(maybeIdentityY({...rest, x1: x, x2: undefined, y, z, fill}, x === indexOf ? "y2" : "y"))
);
}
8 changes: 4 additions & 4 deletions src/marks/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ export function line(data, {x, y, ...options} = {}) {
return new Line(data, {...options, x, y});
}

export function lineX(data, {x = identity, y = indexOf, ...options} = {}) {
return new Line(data, maybeDenseIntervalY({...options, x, y}));
export function lineX(data, {x = identity, y = indexOf, stroke, z = stroke === x ? null : undefined, ...options} = {}) {
return new Line(data, maybeDenseIntervalY({...options, x, y, z, stroke}));
}

export function lineY(data, {x = indexOf, y = identity, ...options} = {}) {
return new Line(data, maybeDenseIntervalX({...options, x, y}));
export function lineY(data, {x = indexOf, y = identity, stroke, z = stroke === y ? null : undefined, ...options} = {}) {
return new Line(data, maybeDenseIntervalX({...options, x, y, z, stroke}));
}
Loading
Loading