From 5b98aceaf1b756c021af76b43b7cabf9f16790aa Mon Sep 17 00:00:00 2001 From: Drew Diamantoukos Date: Mon, 23 Apr 2018 13:28:24 -0400 Subject: [PATCH 1/4] Adding pointcloud type for Plotly scatter type and sizemax for Marker --- types/plotly.js/index.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 9fbbeaa92f..12fe6e8e39 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.35 +// Type definitions for plotly.js 1.36 // Project: https://plot.ly/javascript/ // Definitions by: Chris Gervang // Martin Duparc @@ -6,6 +6,7 @@ // taoqf // Dadstart // Jared Szechy +// Drew Diamantoukos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -354,7 +355,7 @@ export type Color = string | Array | Array Date: Mon, 23 Apr 2018 13:38:15 -0400 Subject: [PATCH 2/4] Added xy field for ScatterData, which is used by pointcloud --- types/plotly.js/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 12fe6e8e39..6b405d3e53 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -359,6 +359,7 @@ export interface ScatterData { x: Datum[] | Datum[][]; y: Datum[] | Datum[][]; z: Datum[] | Datum[][] | Datum[][][]; + xy: Float32Array; xaxis: string; yaxis: string; text: string | string[]; From 96cc727dd738f5e44cb84c08aba0185bdfc06d98 Mon Sep 17 00:00:00 2001 From: Drew Diamantoukos Date: Fri, 25 May 2018 14:39:25 -0400 Subject: [PATCH 3/4] 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 c4cd97b0ba..47ac596cca 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 @@ -411,10 +411,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[]; @@ -426,8 +426,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 { From 53147ce8f477feb6cbe31f23e60957cbf91cfb8e Mon Sep 17 00:00:00 2001 From: Drew Diamantoukos Date: Fri, 29 Jun 2018 10:29:57 -0400 Subject: [PATCH 4/4] Added 'null' to possible Datum type --- types/plotly.js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 854960025d..39ecb64d37 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -355,7 +355,7 @@ export interface ModeBarButton { // Data -export type Datum = string | number | Date; +export type Datum = string | number | Date | null; export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array; export type Dash = 'solid' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot';