Skip to content

Commit 3590ca2

Browse files
🤖 Merge PR DefinitelyTyped#73832 [plotly.js] Add missing hoversubplots property by @MysteryBlokHed
1 parent 87183cc commit 3590ca2

4 files changed

Lines changed: 22 additions & 2 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,15 @@ export interface Layout {
639639
hovermode: "closest" | "x" | "y" | "x unified" | "y unified" | false;
640640
hoverdistance: number;
641641
hoverlabel: Partial<HoverLabel>;
642+
/**
643+
* Determines expansion of hover effects to other subplots.
644+
* If "single" just the axis pair of the primary point is included without overlaying subplots.
645+
* If "overlaying" all subplots using the main axis and occupying the same space are included.
646+
* If "axis", also include stacked subplots using the same axis
647+
* when `hovermode` is set to "x", "x unified", "y" or "y unified".
648+
* @default "overlaying"
649+
*/
650+
hoversubplots: "single" | "overlaying" | "axis";
642651
calendar: Calendar;
643652

644653
// these are just the most common nested property updates that you might

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ const layout = {
5353
datarevision: 0,
5454
editrevision: 0,
5555
selectionrevision: 0,
56-
};
56+
hoversubplots: "overlaying",
57+
} satisfies Partial<Layout>;
5758

5859
//////////////////////////////////////////////////////////////////////
5960
// Plotly.newPlot

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,15 @@ export interface Layout {
642642
hovermode: "closest" | "x" | "y" | "x unified" | "y unified" | false;
643643
hoverdistance: number;
644644
hoverlabel: Partial<HoverLabel>;
645+
/**
646+
* Determines expansion of hover effects to other subplots.
647+
* If "single" just the axis pair of the primary point is included without overlaying subplots.
648+
* If "overlaying" all subplots using the main axis and occupying the same space are included.
649+
* If "axis", also include stacked subplots using the same axis
650+
* when `hovermode` is set to "x", "x unified", "y" or "y unified".
651+
* @default "overlaying"
652+
*/
653+
hoversubplots: "single" | "overlaying" | "axis";
645654
calendar: Calendar;
646655
"xaxis.range": [Datum, Datum];
647656
"xaxis.range[0]": Datum;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ const layout = {
4949
datarevision: 0,
5050
editrevision: 0,
5151
selectionrevision: 0,
52-
};
52+
hoversubplots: "overlaying",
53+
} satisfies Partial<Layout>;
5354

5455
//////////////////////////////////////////////////////////////////////
5556
// Plotly.newPlot

0 commit comments

Comments
 (0)