Skip to content

Commit

Permalink
lax className (#2126)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock authored Aug 7, 2024
1 parent da90c34 commit 1d01e25
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/mark.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import {channelDomain, createChannels, valueObject} from "./channel.js";
import {defined} from "./defined.js";
import {maybeFacetAnchor} from "./facet.js";
import {maybeClip, maybeNamed, maybeValue} from "./options.js";
import {dataify, isDomainSort, isObject, isOptions, keyword, range, singleton} from "./options.js";
import {dataify, isDomainSort, isObject, isOptions, keyword, range, singleton, string} from "./options.js";
import {project} from "./projection.js";
import {maybeClassName, styles} from "./style.js";
import {styles} from "./style.js";
import {basic, initializer} from "./transforms/basic.js";

export class Mark {
Expand Down Expand Up @@ -72,7 +72,7 @@ export class Mark {
this.marginLeft = +marginLeft;
this.clip = maybeClip(clip);
this.tip = maybeTip(tip);
this.className = className ? maybeClassName(className) : null;
this.className = string(className);
// Super-faceting currently disallow position channels; in the future, we
// could allow position to be specified in fx and fy in addition to (or
// instead of) x and y.
Expand Down
2 changes: 1 addition & 1 deletion test/output/classNameOnMarks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/plots/class-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function classNameOnMarks() {
marks: [
Plot.barX(
sales,
Plot.groupY({x: "sum"}, {x: "units", y: "fruit", sort: {y: "x", reverse: true}, className: "fruitbars"})
Plot.groupY({x: "sum"}, {x: "units", y: "fruit", sort: {y: "x", reverse: true}, className: "fruit units"})
),
Plot.ruleX([0])
]
Expand Down

0 comments on commit 1d01e25

Please sign in to comment.