Skip to content

lax className #2126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2024
Merged
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
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