From a51ac28b167787694a3cd6d2daa2de6cba83c7d0 Mon Sep 17 00:00:00 2001 From: Chris Gervang Date: Sat, 10 Jun 2017 13:16:18 -0700 Subject: [PATCH 1/2] added Legend, Axis title, and Data types are Partials --- types/plotly.js/index.d.ts | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index c35811aa4d..7a631c76eb 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -40,11 +40,27 @@ declare namespace Plotly { 'xaxis.autorange': boolean; 'yaxis.autorange': boolean; shapes: Array>; + legend: Partial + } + + interface Legend { + traceorder: "grouped" | "normal" | "reversed" + x: number + y: number + font: Partial + bgcolor: string + bordercolor: string + borderwidth: number + orientation: "v" | "h" + tracegroupgap: number + xanchor: 'auto' | 'left' | 'center' | 'right' + yanchor: 'auto' | 'top' | 'middle' | 'bottom' } type AxisType = "date" | "log" | "linear"; interface Axis { + title: string showgrid: boolean; fixedrange: boolean; rangemode: "tozero" | 'normal' | 'nonnegative'; @@ -104,7 +120,7 @@ declare namespace Plotly { type Dash = 'solid' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot'; - type Data = ScatterData | BarData; + type Data = Partial | Partial; // Bar interface BarData { @@ -132,9 +148,10 @@ declare namespace Plotly { } interface ScatterMarker { - symbol: ""; // Drawing.symbolList - opacity: number; - size: number; + symbol: string | string[]; // Drawing.symbolList + color: string | string[] + opacity: number | number[]; + size: number | number[]; maxdisplayed: number; sizeref: number; sizemin: number; From 322433919ab544d32b289f33217a8978a06cd63b Mon Sep 17 00:00:00 2001 From: Chris Gervang Date: Sat, 10 Jun 2017 13:20:23 -0700 Subject: [PATCH 2/2] lint corrections and version bump --- types/plotly.js/index.d.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 7a631c76eb..04de340c22 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.22 +// Type definitions for plotly.js 1.27 // Project: https://plot.ly/javascript/ // Definitions by: Chris Gervang , Martin Duparc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -40,27 +40,27 @@ declare namespace Plotly { 'xaxis.autorange': boolean; 'yaxis.autorange': boolean; shapes: Array>; - legend: Partial + legend: Partial; } interface Legend { - traceorder: "grouped" | "normal" | "reversed" - x: number - y: number - font: Partial - bgcolor: string - bordercolor: string - borderwidth: number - orientation: "v" | "h" - tracegroupgap: number - xanchor: 'auto' | 'left' | 'center' | 'right' - yanchor: 'auto' | 'top' | 'middle' | 'bottom' + traceorder: "grouped" | "normal" | "reversed"; + x: number; + y: number; + font: Partial; + bgcolor: string; + bordercolor: string; + borderwidth: number; + orientation: "v" | "h"; + tracegroupgap: number; + xanchor: 'auto' | 'left' | 'center' | 'right'; + yanchor: 'auto' | 'top' | 'middle' | 'bottom'; } type AxisType = "date" | "log" | "linear"; interface Axis { - title: string + title: string; showgrid: boolean; fixedrange: boolean; rangemode: "tozero" | 'normal' | 'nonnegative'; @@ -149,7 +149,7 @@ declare namespace Plotly { interface ScatterMarker { symbol: string | string[]; // Drawing.symbolList - color: string | string[] + color: string | string[]; opacity: number | number[]; size: number | number[]; maxdisplayed: number;