From 5d98d9b7fdd5324d6bf9a352709fd025ea8d69a9 Mon Sep 17 00:00:00 2001 From: Drew Diamantoukos Date: Tue, 29 May 2018 18:59:07 -0400 Subject: [PATCH] Plotly.js: Fixing and expanding ScatterMarker types (#26038) * Adding pointcloud type for Plotly scatter type and sizemax for Marker * Added xy field for ScatterData, which is used by pointcloud * Added colorbar and gradient types to ScatterMarker. Fixed cmax/cmin being boolean when they are numbers. Allowed colorscale to be array of arrays per spec. --- types/plotly.js/index.d.ts | 71 ++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 7c2cd7b34c..689214138b 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for plotly.js 1.37 +// Type definitions for plotly.js 1.38 // Project: https://plot.ly/javascript/ // Definitions by: Chris Gervang // Martin Duparc @@ -412,10 +412,10 @@ export interface ScatterData { export interface ScatterMarker { symbol: string | string[]; // Drawing.symbolList color: Color | number[]; - colorscale: string | string[]; + colorscale: string | string[] | Array>; cauto: boolean; - cmax: boolean; - cmin: boolean; + cmax: number; + cmin: number; autocolorscale: boolean; reversescale: boolean; opacity: number | number[]; @@ -427,8 +427,67 @@ export interface ScatterMarker { sizemode: 'diameter' | 'area'; showscale: boolean; line: Partial; - colorbar: {}; // TODO - gradient: {}; // TODO + colorbar: { + thicknessmode: 'fraction' | 'pixels', + thickness: number, + lenmode: 'fraction' | 'pixels', + len: number, + x: number, + xanchor: 'left' | 'center' | 'right', + xpad: number, + y: number, + yanchor: 'top' | 'middle' | 'bottom', + ypad: number, + outlinecolor: Color, + outlinewidth: number, + bordercolor: Color, + borderwidth: Color, + bgcolor: Color, + tickmode: 'auto' | 'linear' | 'array', + nticks: number, + tick0: number | string, + dtick: number | string, + tickvals: Datum[] | Datum[][] | Datum[][][] | TypedArray, + ticktext: Datum[] | Datum[][] | Datum[][][] | TypedArray, + ticks: 'outside' | 'inside' | '', + ticklen: number, + tickwidth: number, + tickcolor: Color, + showticklabels: boolean, + tickfont: { + family: string, + size: number, + color: Color, + }, + tickangle: number, + tickformat: string, + tickformatstops: { + dtickrange: any[], + value: string, + }, + tickprefix: string, + showtickprefix: 'all' | 'first' | 'last' | 'none', + ticksuffix: string, + showticksuffix: 'all' | 'first' | 'last' | 'none', + separatethousands: boolean, + exponentformat: 'none' | 'e' | 'E' | 'power' | 'SI' | 'B', + showexponent: 'all' | 'first' | 'last' | 'none', + title: string, + titlefont: { + family: string, + size: number, + color: Color, + }, + titleside: 'right' | 'top' | 'bottom', + tickvalssrc: any, + ticktextsrc: any, + }; + gradient: { + type: 'radial' | 'horizontal' | 'vertical' | 'none', + color: Color, + typesrc: any, + colorsrc: any, + }; } export interface ScatterMarkerLine {