Skip to content

Commit 5a2fcf2

Browse files
Filmbostock
andauthored
pass fontVariant to the axis label (#1827)
* pass fontVariant to the axis label closes #1821 * Update test/plots/axis-labels.ts --------- Co-authored-by: Mike Bostock <[email protected]>
1 parent 111cdf7 commit 5a2fcf2

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

src/marks/axis.js

+2
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ function labelOptions(
488488
fontFamily,
489489
fontSize,
490490
fontStyle,
491+
fontVariant,
491492
fontWeight,
492493
monospace,
493494
pointerEvents,
@@ -508,6 +509,7 @@ function labelOptions(
508509
fontFamily,
509510
fontSize,
510511
fontStyle,
512+
fontVariant,
511513
fontWeight,
512514
monospace,
513515
pointerEvents,

test/output/axisLabelFontVariant.svg

+33
Loading

test/plots/axis-labels.ts

+7
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ export async function axisLabelBothReverse() {
5252
});
5353
}
5454

55+
export async function axisLabelFontVariant() {
56+
return Plot.plot({
57+
x: {domain: "abcde"},
58+
marks: [Plot.axisX({label: "Letter", fontVariant: "small-caps"})]
59+
});
60+
}
61+
5562
export async function axisLabelVaryingFill() {
5663
return Plot.plot({
5764
x: {domain: "ABCDEF"},

0 commit comments

Comments
 (0)