From 5e19dd4a56517aa203539acbc53cb492e7601035 Mon Sep 17 00:00:00 2001 From: Michael Adams <36059111+mtadams007@users.noreply.github.com> Date: Wed, 23 Oct 2019 00:53:35 +0200 Subject: [PATCH] plotly.js - add plotly types for indicator chart (#39185) --- types/plotly.js/index.d.ts | 60 +++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 249d1d86c2..f07aa5b803 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -13,6 +13,7 @@ // Josh Miles // Pramod Mathai // Takafumi Yamaguchi +// Michael Adams // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -498,9 +499,9 @@ export type DataTransform = Partial; export type ScatterData = PlotData; // Bar Scatter export interface PlotData { - type: 'bar' | 'box' | 'candlestick' | 'choropleth' | 'contour' | 'heatmap' | 'histogram' | 'mesh3d' | - 'ohlc' | 'parcoords' | 'pie' | 'pointcloud' | 'scatter' | 'scatter3d' | 'scattergeo' | 'scattergl' | - 'scatterpolar' | 'scatterternary' | 'surface'; + type: 'bar' | 'box' | 'candlestick' | 'choropleth' | 'contour' | 'heatmap' | 'histogram' | 'indicator' | 'mesh3d' | + 'ohlc' | 'parcoords' | 'pie' | 'pointcloud' | 'scatter' | 'scatter3d' | 'scattergeo' | 'scattergl' | + 'scatterpolar' | 'scatterternary' | 'surface'; x: Datum[] | Datum[][] | TypedArray; y: Datum[] | Datum[][] | TypedArray; z: Datum[] | Datum[][] | Datum[][][] | TypedArray; @@ -530,7 +531,8 @@ export interface PlotData { 'marker.showscale': boolean; 'marker.line': Partial; 'marker.colorbar': {}; // TODO - mode: 'lines' | 'markers' | 'text' | 'lines+markers' | 'text+markers' | 'text+lines' | 'text+lines+markers' | 'none'; + mode: 'lines' | 'markers' | 'text' | 'lines+markers' | 'text+markers' | 'text+lines' | 'text+lines+markers' | 'none' + | 'gauge' | 'number' | 'delta' | 'number+delta' | 'gauge+number' | 'gauge+number+delta' | 'gauge+delta'; hoveron: 'points' | 'fills'; hoverinfo: 'all' | 'name' | 'none' | 'skip' | 'text' | 'x' | 'x+text' | 'x+name' | @@ -556,6 +558,55 @@ export interface PlotData { stackgroup: string; connectgaps: boolean; visible: boolean | 'legendonly'; + delta: { + reference: number; + position: 'top' | 'bottom' | 'left' | 'right'; + relative: boolean + valueformat: string + increasing: { + symbol: string; + color: Color; + } + decreasing: { + symbol: string; + color: Color; + } + }; + gauge: { + shape: 'angular' | 'bullet' + bar: { + color: Color + line: { + color: Color + width: number + } + thickness: number + } + bgcolor: Color + bordercolor: Color + borderwidth: number + axis: { + range: number[] + visible: boolean + } + threshold: { + line: { + color: Color + width: number + } + value: number + } + }; + number: { + valueformat: string + font: { + family: string + size: number + color: Color + } + prefix: string + suffix: string + }; transforms: DataTransform[]; orientation: 'v' | 'h'; width: number | number[]; @@ -571,6 +622,7 @@ export interface PlotData { end: number | string; size: number | string; }; + value: number; values: Datum[]; labels: Datum[]; hole: number;