stack · Salebarn/plot@f6ef585 · GitHub
Skip to content

Commit f6ef585

Browse files
committed
stack
1 parent a161246 commit f6ef585

7 files changed

Lines changed: 1869 additions & 8 deletions

File tree

src/index.js

Lines changed: 1 addition & 0 deletions

src/mark.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,12 @@ export class Mark {
8080

8181
// TODO Type coercion?
8282
function Channel(data, {scale, type, value}) {
83-
let label;
84-
if (typeof value === "function") {
85-
label = value.label;
86-
value = Array.from(data, value);
87-
} else {
88-
value = arrayify(value);
89-
}
90-
return {scale, type, value, label};
83+
return {
84+
scale,
85+
type,
86+
value: typeof value === "function" ? Array.from(data, value) : arrayify(value),
87+
label: value ? value.label : undefined
88+
};
9189
}
9290

9391
// This allows transforms to behave equivalently to channels.

src/transforms/stack.js

Lines changed: 42 additions & 0 deletions

0 commit comments

Comments
 (0)