From cb429649955a359939da022f3b74e97377d277ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Wed, 23 Aug 2023 17:00:23 +0200 Subject: [PATCH 1/2] pass fontVariant to the axis label closes #1821 --- src/marks/axis.js | 2 ++ test/output/axisLabelFontVariant.svg | 33 ++++++++++++++++++++++++++++ test/plots/axis-labels.ts | 6 +++++ 3 files changed, 41 insertions(+) create mode 100644 test/output/axisLabelFontVariant.svg diff --git a/src/marks/axis.js b/src/marks/axis.js index 6a3d51f847..9e090db33e 100644 --- a/src/marks/axis.js +++ b/src/marks/axis.js @@ -488,6 +488,7 @@ function labelOptions( fontFamily, fontSize, fontStyle, + fontVariant, fontWeight, monospace, pointerEvents, @@ -508,6 +509,7 @@ function labelOptions( fontFamily, fontSize, fontStyle, + fontVariant, fontWeight, monospace, pointerEvents, diff --git a/test/output/axisLabelFontVariant.svg b/test/output/axisLabelFontVariant.svg new file mode 100644 index 0000000000..b9bc640b1a --- /dev/null +++ b/test/output/axisLabelFontVariant.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + a + b + c + d + e + + + Letter + + \ No newline at end of file diff --git a/test/plots/axis-labels.ts b/test/plots/axis-labels.ts index fac2f941d6..edd40b6e31 100644 --- a/test/plots/axis-labels.ts +++ b/test/plots/axis-labels.ts @@ -52,6 +52,12 @@ export async function axisLabelBothReverse() { }); } +export async function axisLabelFontVariant() { + return Plot.plot({ + x: {domain: "abcde"}, + marks: [Plot.axisX({label: "Letter", fontVariant: "small-caps"})] + }); +} export async function axisLabelVaryingFill() { return Plot.plot({ x: {domain: "ABCDEF"}, From 6b62d55e45cc747cf9bc9758315ce3161826fef1 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Thu, 24 Aug 2023 12:38:11 -0400 Subject: [PATCH 2/2] Update test/plots/axis-labels.ts --- test/plots/axis-labels.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/plots/axis-labels.ts b/test/plots/axis-labels.ts index edd40b6e31..2948f8c8b1 100644 --- a/test/plots/axis-labels.ts +++ b/test/plots/axis-labels.ts @@ -58,6 +58,7 @@ export async function axisLabelFontVariant() { marks: [Plot.axisX({label: "Letter", fontVariant: "small-caps"})] }); } + export async function axisLabelVaryingFill() { return Plot.plot({ x: {domain: "ABCDEF"},