Merge pull request #17108 from chrisgervang/plotly

Additions Plotly.js Type Definition
This commit is contained in:
Nathan Shively-Sanders
2017-06-22 13:30:52 -07:00
committed by GitHub
+22 -5
View File
@@ -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 <https://github.com/chrisgervang>, Martin Duparc <https://github.com/martinduparc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -40,11 +40,27 @@ declare namespace Plotly {
'xaxis.autorange': boolean;
'yaxis.autorange': boolean;
shapes: Array<Partial<Shape>>;
legend: Partial<Legend>;
}
interface Legend {
traceorder: "grouped" | "normal" | "reversed";
x: number;
y: number;
font: Partial<Font>;
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<ScatterData> | Partial<BarData>;
// 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;