-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Should we expose a multi-line format helper? You can do it yourself but it’s a bit verbose:
tickFormat(x, i, X) {
const format1 = (x) => x.toLocaleString("it", { day: "numeric" });
const format2 = (x) => x.toLocaleString("it", { month: "short" });
const f1 = format1(x);
const f2 = format2(x);
return i > 0 && f2 === format2(X[i - 1]) ? f1 : [f1, f2].join("\n");
}
Maybe:
tickFormat: Plot.formatConditional({ day: "numeric" }, { month: "short" })
But, you’d also need a way to pass in the locale, perhaps the template.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request