Skip to content

Commit 1d01e25

Browse files
authored
lax className (#2126)
1 parent da90c34 commit 1d01e25

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/mark.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import {channelDomain, createChannels, valueObject} from "./channel.js";
22
import {defined} from "./defined.js";
33
import {maybeFacetAnchor} from "./facet.js";
44
import {maybeClip, maybeNamed, maybeValue} from "./options.js";
5-
import {dataify, isDomainSort, isObject, isOptions, keyword, range, singleton} from "./options.js";
5+
import {dataify, isDomainSort, isObject, isOptions, keyword, range, singleton, string} from "./options.js";
66
import {project} from "./projection.js";
7-
import {maybeClassName, styles} from "./style.js";
7+
import {styles} from "./style.js";
88
import {basic, initializer} from "./transforms/basic.js";
99

1010
export class Mark {
@@ -72,7 +72,7 @@ export class Mark {
7272
this.marginLeft = +marginLeft;
7373
this.clip = maybeClip(clip);
7474
this.tip = maybeTip(tip);
75-
this.className = className ? maybeClassName(className) : null;
75+
this.className = string(className);
7676
// Super-faceting currently disallow position channels; in the future, we
7777
// could allow position to be specified in fx and fy in addition to (or
7878
// instead of) x and y.

test/output/classNameOnMarks.svg

+1-1
Loading

test/plots/class-name.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export async function classNameOnMarks() {
1212
marks: [
1313
Plot.barX(
1414
sales,
15-
Plot.groupY({x: "sum"}, {x: "units", y: "fruit", sort: {y: "x", reverse: true}, className: "fruitbars"})
15+
Plot.groupY({x: "sum"}, {x: "units", y: "fruit", sort: {y: "x", reverse: true}, className: "fruit units"})
1616
),
1717
Plot.ruleX([0])
1818
]

0 commit comments

Comments
 (0)