Skip to content

channel label override #1838

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 27, 2023
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 @@ -46,9 +46,9 @@ export class Mark {
Object.entries(channels)
.map(([name, channel]) => {
if (isOptions(channel.value)) {
// apply scale overrides
const {value, scale = channel.scale} = channel.value;
channel = {...channel, scale, value};
// apply scale and label overrides
const {value, label = channel.label, scale = channel.scale} = channel.value;
channel = {...channel, label, scale, value};
}
if (data === singleton && typeof channel.value === "string") {
// convert field names to singleton values for decoration marks (e.g., frame)
Expand Down
2 changes: 1 addition & 1 deletion test/plots/tip-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export async function tipFormatPairedLabel() {
}

export async function tipFormatPairedLabelChannel() {
return tip({length: 1}, {x1: Object.assign([0], {label: "Low"}), x2: Object.assign([1], {label: "High"})});
return tip({length: 1}, {x1: {value: [0], label: "Low"}, x2: {value: [1], label: "High"}});
}

export async function tipFormatPairedLabelScale() {
Expand Down