Skip to content

Commit 55272d0

Browse files
authored
🤖 Merge PR DefinitelyTyped#73491 fix(@types/plotly.js): include missing definitions in 'Font' interface by @AndreFavotto
1 parent 5c24390 commit 55272d0

File tree

4 files changed

+47
-6
lines changed

4 files changed

+47
-6
lines changed

‎types/plotly.js/index.d.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,26 @@ export interface Font {
19531953
* @default normal
19541954
*/
19551955
weight: number;
1956+
/**
1957+
* Sets whether a font should be styled with a normal or italic face from its family.
1958+
* @default "normal"
1959+
*/
1960+
style: "normal" | "italic";
1961+
/**
1962+
* Sets capitalization of text. Can be used to make text appear in all-uppercase, all-lowercase, or with each word capitalized.
1963+
* @default "normal"
1964+
*/
1965+
textcase: "normal" | "word caps" | "upper" | "lower";
1966+
/**
1967+
* Sets the variant of the font.
1968+
* @default "normal"
1969+
*/
1970+
variant: "normal" | "small-caps" | "all-small-caps" | "all-petite-caps" | "petite-caps" | "unicase";
1971+
/**
1972+
* Sets the kind of decoration line(s) with text, such as an "under", "over" or "through" as well as combinations e.g. "under+over".
1973+
* @default "none"
1974+
*/
1975+
lineposition: "under" | "over" | "through" | "under+over" | "under+over+through" | "none";
19561976
}
19571977

19581978
export interface Edits {

‎types/plotly.js/test/index-tests.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ const config: Partial<Config> = {
407407
bgcolor: "#ffffff",
408408
bordercolor: "#444444",
409409
borderwidth: 1,
410-
font: { size: 15 },
410+
font: { size: 15, style: "italic" },
411411
groupclick: "togglegroup",
412412
grouptitlefont: { size: 15 },
413413
itemclick: "toggleothers",
@@ -498,7 +498,7 @@ const config: Partial<Config> = {
498498
colorbar: {
499499
title: {
500500
text: "Test",
501-
font: { size: 20, color: "#666" },
501+
font: { size: 20, color: "#666", textcase: "lower" },
502502
side: "top",
503503
},
504504
orientation: "v",
@@ -574,7 +574,7 @@ const config: Partial<Config> = {
574574
visible: true,
575575
prefix: "Date:",
576576
xanchor: "right",
577-
font: { size: 20, color: "#666" },
577+
font: { size: 20, color: "#666", variant: "all-small-caps" },
578578
},
579579
steps: [
580580
{
@@ -726,6 +726,7 @@ const config: Partial<Config> = {
726726
text: "some new title",
727727
font: {
728728
size: 1.2,
729+
lineposition: "through",
729730
},
730731
x: 0.9,
731732
pad: {

‎types/plotly.js/v2/index.d.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,6 +2003,26 @@ export interface Font {
20032003
* @default normal
20042004
*/
20052005
weight: number;
2006+
/**
2007+
* Sets whether a font should be styled with a normal or italic face from its family.
2008+
* @default "normal"
2009+
*/
2010+
style: "normal" | "italic";
2011+
/**
2012+
* Sets capitalization of text. Can be used to make text appear in all-uppercase, all-lowercase, or with each word capitalized.
2013+
* @default "normal"
2014+
*/
2015+
textcase: "normal" | "word caps" | "upper" | "lower";
2016+
/**
2017+
* Sets the variant of the font.
2018+
* @default "normal"
2019+
*/
2020+
variant: "normal" | "small-caps" | "all-small-caps" | "all-petite-caps" | "petite-caps" | "unicase";
2021+
/**
2022+
* Sets the kind of decoration line(s) with text, such as an "under", "over" or "through" as well as combinations e.g. "under+over".
2023+
* @default "none"
2024+
*/
2025+
lineposition: "under" | "over" | "through" | "under+over" | "under+over+through" | "none";
20062026
}
20072027

20082028
export interface Edits {

‎types/plotly.js/v2/test/index-tests.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ const config: Partial<Config> = {
428428
bgcolor: "#ffffff",
429429
bordercolor: "#444444",
430430
borderwidth: 1,
431-
font: { size: 15 },
431+
font: { size: 15, style: "italic" },
432432
groupclick: "togglegroup",
433433
grouptitlefont: { size: 15 },
434434
itemclick: "toggleothers",
@@ -511,7 +511,7 @@ const config: Partial<Config> = {
511511
colorbar: {
512512
title: {
513513
text: "Test",
514-
font: { size: 20, color: "#666" },
514+
font: { size: 20, color: "#666", textcase: "lower" },
515515
side: "top",
516516
},
517517
orientation: "v",
@@ -585,7 +585,7 @@ const config: Partial<Config> = {
585585
visible: true,
586586
prefix: "Date:",
587587
xanchor: "right",
588-
font: { size: 20, color: "#666" },
588+
font: { size: 20, color: "#666", lineposition: "through" },
589589
},
590590
steps: [
591591
{

0 commit comments

Comments
 (0)