Skip to content

Commit ca0ba62

Browse files
authored
tuple area shorthand (#786)
1 parent 92735b3 commit ca0ba62

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/marks/area.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {area as shapeArea, create} from "d3";
22
import {Curve} from "../curve.js";
33
import {Mark} from "../plot.js";
4-
import {indexOf, maybeZ} from "../options.js";
4+
import {first, indexOf, maybeZ, second} from "../options.js";
55
import {applyDirectStyles, applyIndirectStyles, applyTransform, applyGroupedChannelStyles, groupIndex} from "../style.js";
66
import {maybeIdentityX, maybeIdentityY} from "../transforms/identity.js";
77
import {maybeStackX, maybeStackY} from "../transforms/stack.js";
@@ -56,6 +56,7 @@ export class Area extends Mark {
5656
}
5757

5858
export function area(data, options) {
59+
if (options === undefined) return areaY(data, {x: first, y: second});
5960
return new Area(data, options);
6061
}
6162

0 commit comments

Comments
 (0)