Skip to content

Commit f1ec8fe

Browse files
committed
update types
1 parent 9f2bbf9 commit f1ec8fe

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/types/core/events.d.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ export interface PlotDatum {
6565
x: Datum;
6666
/** Axis the point's x is plotted against. */
6767
xaxis: LayoutAxis;
68+
/** Point center x position in pixels from the graph div's top-left corner */
69+
xPixel?: number;
6870
/** y coordinate of the point. */
6971
y: Datum;
7072
/** Axis the point's y is plotted against. */
7173
yaxis: LayoutAxis;
74+
/** Point center y position in pixels from the graph div's top-left corner */
75+
yPixel?: number;
7276
/** Resolved hover/display text for the point. */
7377
text: string;
7478
}
@@ -104,9 +108,10 @@ export interface PlotMouseEvent {
104108
points: PlotDatum[];
105109
/** The original DOM mouse event. */
106110
event: MouseEvent;
107-
/** x and y pixel position of the mouse */
108-
xPixel: number;
109-
yPixel: number;
111+
/** Cursor x position in pixels from the graph div's top-left corner */
112+
xPixel?: number;
113+
/** Cursor y position in pixels from the graph div's top-left corner */
114+
yPixel?: number;
110115
}
111116

112117
/** Payload for `plotly_hover` — augments `PlotMouseEvent` with axis values. */

0 commit comments

Comments
 (0)