mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
plotly.js: Move direction from Layout to PlotData (#40889)
This commit is contained in:
2
types/plotly.js/index.d.ts
vendored
2
types/plotly.js/index.d.ts
vendored
@@ -266,7 +266,6 @@ export interface Layout {
|
||||
mapbox: {}; // TODO
|
||||
radialaxis: Partial<Axis>;
|
||||
angularaxis: {}; // TODO
|
||||
direction: 'clockwise' | 'counterclockwise';
|
||||
dragmode: 'zoom' | 'pan' | 'select' | 'lasso' | 'orbit' | 'turntable' | false;
|
||||
orientation: number;
|
||||
annotations: Array<Partial<Annotations>>;
|
||||
@@ -630,6 +629,7 @@ export interface PlotData {
|
||||
value: number;
|
||||
values: Datum[];
|
||||
labels: Datum[];
|
||||
direction: 'clockwise' | 'counterclockwise';
|
||||
hole: number;
|
||||
rotation: number;
|
||||
theta: Datum[];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as Plotly from 'plotly.js/lib/core';
|
||||
import { Datum, ScatterData, Layout, PlotlyHTMLElement, newPlot } from 'plotly.js/lib/core';
|
||||
import { Datum, ScatterData, Layout, PlotlyHTMLElement, newPlot, PlotData } from 'plotly.js/lib/core';
|
||||
|
||||
const graphDiv = '#test';
|
||||
|
||||
@@ -43,6 +43,23 @@ const graphDiv = '#test';
|
||||
Plotly.newPlot(graphDiv, data2, layout2);
|
||||
})();
|
||||
|
||||
// Plotly.newPlot (bar)
|
||||
(() => {
|
||||
const data: Array<Partial<PlotData>> = [
|
||||
{
|
||||
values: [19, 26, 55],
|
||||
labels: ['Residential', 'Non-Residential', 'Utility'],
|
||||
type: 'pie',
|
||||
direction: 'counterclockwise',
|
||||
},
|
||||
];
|
||||
const layout = {
|
||||
height: 400,
|
||||
width: 500
|
||||
};
|
||||
Plotly.newPlot('myDiv', data, layout);
|
||||
})();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user