@@ -265,14 +265,17 @@ export interface LegendTitleClickEvent {
265265 fullLayout : Partial < Layout > ;
266266}
267267
268- /** Payload for `plotly_react`, emitted after a `Plotly.react` call that left the config unchanged. */
268+ /**
269+ * Payload for `plotly_react`. The event does not fire if the call changed the config.
270+ * The `config` and `layout` values are `undefined` if the `Plotly.react` call omitted them.
271+ */
269272export interface PlotReactEvent {
270273 /** User-supplied config object. */
271- config : Partial < Config > ;
274+ config : Partial < Config > | undefined ;
272275 /** User-supplied data array. */
273276 data : Data [ ] ;
274277 /** User-supplied layout object. */
275- layout : Partial < Layout > ;
278+ layout : Partial < Layout > | undefined ;
276279}
277280
278281/** Payload for `plotly_buttonclicked`, emitted when a button of an updatemenu is clicked. */
@@ -336,8 +339,8 @@ export interface WebGLContextLostEvent {
336339
337340/** Point payload for `plotly_sunburstclick`. Treemap and icicle traces emit the same point shape. */
338341export interface SunburstPlotDatum {
339- /** Color value associated with the sector. */
340- color : number ;
342+ /** Color value associated with the sector. Present only if the trace sets `marker.colors`. */
343+ color ? : number | undefined ;
341344 /** Index of the trace producing this sector. */
342345 curveNumber : number ;
343346 /** The trace this sector belongs to. */
@@ -346,14 +349,14 @@ export interface SunburstPlotDatum {
346349 entry : string ;
347350 /** Fully-resolved trace data. */
348351 fullData : Data ;
349- /** Hover text shown for this sector. */
350- hovertext : string ;
351- /** Hierarchical id of the sector. */
352- id : string ;
353- /** Display label of the sector. */
354- label : string ;
355- /** Parent sector id. */
356- parent : string ;
352+ /** Hover text shown for this sector. Present only if the trace sets `hovertext`. */
353+ hovertext ? : string | undefined ;
354+ /** Hierarchical id of the sector. Present only if the trace sets `ids`. */
355+ id ? : string | undefined ;
356+ /** Display label of the sector. Present only if the trace sets `labels`. */
357+ label ? : string | undefined ;
358+ /** Parent sector id. Absent on the root sector. */
359+ parent ? : string | undefined ;
357360 /** Percentage of the immediate entry sector this sector represents. */
358361 percentEntry : number ;
359362 /** Percentage of the parent sector this sector represents. */
@@ -364,8 +367,8 @@ export interface SunburstPlotDatum {
364367 pointNumber : number ;
365368 /** Root sector id. */
366369 root : string ;
367- /** Numeric value of the sector. */
368- value : number ;
370+ /** Numeric value of the sector. Present only if the trace sets `values`. */
371+ value ? : number | undefined ;
369372}
370373
371374/** Point payload for `plotly_treemapclick`. Same shape as `SunburstPlotDatum`. */
@@ -432,34 +435,37 @@ export interface PlotlyHTMLElement extends HTMLElement {
432435 /** Subscribe to per-frame animation events. */
433436 on ( event : 'plotly_animatingframe' , callback : ( event : FrameAnimationEvent ) => void ) : void ;
434437 /** Subscribe to legend click events; return `false` to suppress default toggle. */
435- on ( event : 'plotly_legendclick' | 'plotly_legenddoubleclick' , callback : ( event : LegendClickEvent ) => boolean ) : void ;
438+ on (
439+ event : 'plotly_legendclick' | 'plotly_legenddoubleclick' ,
440+ callback : ( event : LegendClickEvent ) => boolean | void
441+ ) : void ;
436442 /** Subscribe to legend title click events; return `false` to suppress default behavior. */
437443 on (
438444 event : 'plotly_legendtitleclick' | 'plotly_legendtitledoubleclick' ,
439- callback : ( event : LegendTitleClickEvent ) => boolean
445+ callback : ( event : LegendTitleClickEvent ) => boolean | void
440446 ) : void ;
441447 /** Subscribe to react events. */
442448 on ( event : 'plotly_react' , callback : ( event : PlotReactEvent ) => void ) : void ;
443449 /** Subscribe to updatemenu button click events. */
444450 on ( event : 'plotly_buttonclicked' , callback : ( event : ButtonClickedEvent ) => void ) : void ;
445451 /** Subscribe to pre-hover events; return `false` to cancel the hover. */
446- on ( event : 'plotly_beforehover' , callback : ( event : MouseEvent ) => boolean ) : void ;
452+ on ( event : 'plotly_beforehover' , callback : ( event : MouseEvent ) => boolean | void ) : void ;
447453 /** Subscribe to slider change events. */
448454 on ( event : 'plotly_sliderchange' , callback : ( event : SliderChangeEvent ) => void ) : void ;
449455 /** Subscribe to slider end-of-interaction events. */
450456 on ( event : 'plotly_sliderend' , callback : ( event : SliderEndEvent ) => void ) : void ;
451457 /** Subscribe to slider start-of-interaction events. */
452458 on ( event : 'plotly_sliderstart' , callback : ( event : SliderStartEvent ) => void ) : void ;
453- /** Subscribe to sunburst sector click events. */
454- on ( event : 'plotly_sunburstclick' , callback : ( event : SunburstClickEvent ) => void ) : void ;
455- /** Subscribe to treemap sector click events. */
456- on ( event : 'plotly_treemapclick' , callback : ( event : TreemapClickEvent ) => void ) : void ;
457- /** Subscribe to icicle sector click events. */
458- on ( event : 'plotly_icicleclick' , callback : ( event : IcicleClickEvent ) => void ) : void ;
459+ /** Subscribe to sunburst sector click events; return `false` to suppress the default zoom . */
460+ on ( event : 'plotly_sunburstclick' , callback : ( event : SunburstClickEvent ) => boolean | void ) : void ;
461+ /** Subscribe to treemap sector click events; return `false` to suppress the default zoom . */
462+ on ( event : 'plotly_treemapclick' , callback : ( event : TreemapClickEvent ) => boolean | void ) : void ;
463+ /** Subscribe to icicle sector click events; return `false` to suppress the default zoom . */
464+ on ( event : 'plotly_icicleclick' , callback : ( event : IcicleClickEvent ) => boolean | void ) : void ;
459465 /** Subscribe to generic plotly events (low-level catch-all). */
460466 on ( event : 'plotly_event' , callback : ( data : any ) => void ) : void ;
461467 /** Subscribe to pre-plot events; return `false` to cancel plotting. */
462- on ( event : 'plotly_beforeplot' , callback : ( event : BeforePlotEvent ) => boolean ) : void ;
468+ on ( event : 'plotly_beforeplot' , callback : ( event : BeforePlotEvent ) => boolean | void ) : void ;
463469 /** Subscribe to bare lifecycle events that carry no payload. */
464470 on (
465471 event :
0 commit comments