11/**
2- * Consumer-side checks for the `plotly_relayout` event payload.
2+ * Consumer-side checks for the event payload types and the `on()` overloads .
33 *
44 * Nothing here runs. See `update_api.ts`.
55 */
66
7- import type { PlotRelayoutEvent } from '../../lib/index' ;
7+ import type { PlotlyHTMLElement , PlotRelayoutEvent , TreemapPlotDatum } from '../../lib/index' ;
88
9+ declare const gd : PlotlyHTMLElement ;
910declare const event : PlotRelayoutEvent ;
1011
1112// A range value can be a number or a date string
@@ -21,3 +22,44 @@ const autosize: boolean | undefined = event.autosize;
2122
2223// @ts -expect-error unknown top-level key
2324const typo = event . titl ;
25+
26+ gd . on ( 'plotly_update' , ( event ) => {
27+ const attributes : Record < string , any > = event . data [ 0 ] ;
28+ const traces : number [ ] = event . data [ 1 ] ;
29+ const autosizeInUpdate : boolean | undefined = event . layout . autosize ;
30+ } ) ;
31+
32+ gd . on ( 'plotly_webglcontextlost' , ( event ) => {
33+ const domEvent : WebGLContextEvent = event . event ;
34+ const layer : string = event . layer ;
35+ } ) ;
36+
37+ gd . on ( 'plotly_react' , ( event ) => {
38+ const dataLength : number = event . data . length ;
39+ } ) ;
40+
41+ gd . on ( 'plotly_legendtitleclick' , ( event ) => {
42+ const legendId : string = event . legendId ;
43+ return false ;
44+ } ) ;
45+
46+ gd . on ( 'plotly_buttonclicked' , ( event ) => {
47+ const active : number = event . active ;
48+ } ) ;
49+
50+ gd . on ( 'plotly_beforehover' , ( event ) => {
51+ const x : number = event . clientX ;
52+ return true ;
53+ } ) ;
54+
55+ gd . on ( 'plotly_icicleclick' , ( event ) => {
56+ const nextLevel : string | undefined = event . nextLevel ;
57+ } ) ;
58+
59+ gd . on ( 'plotly_treemapclick' , ( event ) => {
60+ const points : TreemapPlotDatum [ ] = event . points ;
61+ } ) ;
62+
63+ gd . on ( 'plotly_animating' , ( ) => { } ) ;
64+ gd . on ( 'plotly_transitioned' , ( ) => { } ) ;
65+ gd . on ( 'plotly_exportfail' , ( ) => { } ) ;
0 commit comments