// Type definitions for react-plotly.js 2.2 // Project: https://github.com/plotly/react-plotly.js#readme // Definitions by: Jon Freedman // Mitchell Grice // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as Plotly from 'plotly.js'; import * as React from 'react'; export interface Figure { data: Plotly.Data[]; layout: Partial; frames: Plotly.Frame[] | null; } export interface PlotParams { data: Plotly.Data[]; layout: Partial; frames?: Plotly.Frame[]; config?: Partial; /** * When provided, causes the plot to update only when the revision is incremented. */ revision?: number; /** * Callback executed after plot is initialized. * @param figure Object with three keys corresponding to input props: data, layout and frames. * @param graphDiv Reference to the DOM node into which the figure was rendered. */ onInitialized?: (figure: Readonly
, graphDiv: Readonly) => void; /** * Callback executed when when a plot is updated due to new data or layout, or when user interacts with a plot. * @param figure Object with three keys corresponding to input props: data, layout and frames. * @param graphDiv Reference to the DOM node into which the figure was rendered. */ onUpdate?: (figure: Readonly
, graphDiv: Readonly) => void; /** * Callback executed when component unmounts, before Plotly.purge strips the graphDiv of all private attributes. * @param figure Object with three keys corresponding to input props: data, layout and frames. * @param graphDiv Reference to the DOM node into which the figure was rendered. */ onPurge?: (figure: Readonly
, graphDiv: Readonly) => void; /** * Callback executed when a plotly.js API method rejects * @param err Error */ onError?: (err: Readonly) => void; /** * id assigned to the
into which the plot is rendered. */ divId?: string; /** * applied to the
into which the plot is rendered */ className?: string; /** * used to style the
into which the plot is rendered */ style?: React.CSSProperties; /** * Assign the graph div to window.gd for debugging */ debug?: boolean; /** * When true, adds a call to Plotly.Plot.resize() as a window.resize event handler */ useResizeHandler?: boolean; onAfterExport?: () => void; onAfterPlot?: () => void; onAnimated?: () => void; onAnimatingFrame?: (event: Readonly) => void; onAnimationInterrupted?: () => void; onAutoSize?: () => void; onBeforeExport?: () => void; onButtonClicked?: (event: Readonly) => void; onClick?: (event: Readonly) => void; onClickAnnotation?: (event: Readonly) => void; onDeselect?: () => void; onDoubleClick?: () => void; onFramework?: () => void; onHover?: (event: Readonly) => void; onLegendClick?: (event: Readonly) => boolean; onLegendDoubleClick?: (event: Readonly) => boolean; onRelayout?: (event: Readonly) => void; onRestyle?: (event: Readonly) => void; onRedraw?: () => void; onSelected?: (event: Readonly) => void; onSelecting?: (event: Readonly) => void; onSliderChange?: (event: Readonly) => void; onSliderEnd?: (event: Readonly) => void; onSliderStart?: (event: Readonly) => void; onTransitioning?: () => void; onTransitionInterrupted?: () => void; onUnhover?: (event: Readonly) => void; } export default class Plot extends React.PureComponent { }