mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-27 22:49:20 +08:00
made selected data point more general for bar plots etc (#29582)
This commit is contained in:
17
types/plotly.js/index.d.ts
vendored
17
types/plotly.js/index.d.ts
vendored
@@ -39,8 +39,19 @@ export interface PlotScatterDataPoint {
|
||||
yaxis: LayoutAxis;
|
||||
}
|
||||
|
||||
export interface PlotDatum {
|
||||
curveNumber: number;
|
||||
data: PlotData;
|
||||
pointIndex: number;
|
||||
pointNumber: number;
|
||||
x: Datum;
|
||||
xaxis: LayoutAxis;
|
||||
y: Datum;
|
||||
yaxis: LayoutAxis;
|
||||
}
|
||||
|
||||
export interface PlotMouseEvent {
|
||||
points: PlotScatterDataPoint[];
|
||||
points: PlotDatum[];
|
||||
event: MouseEvent;
|
||||
}
|
||||
|
||||
@@ -55,10 +66,10 @@ export interface SelectionRange {
|
||||
y: number[];
|
||||
}
|
||||
|
||||
export type PlotSelectedData = Partial<PlotScatterDataPoint>;
|
||||
export type PlotSelectedData = Partial<PlotDatum>;
|
||||
|
||||
export interface PlotSelectionEvent {
|
||||
points: PlotScatterDataPoint[];
|
||||
points: PlotDatum[];
|
||||
range?: SelectionRange;
|
||||
lassoPoints?: SelectionRange;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as Plotly from 'plotly.js/lib/core';
|
||||
import { ScatterData, Layout, PlotlyHTMLElement, newPlot } from 'plotly.js/lib/core';
|
||||
import { Datum, ScatterData, Layout, PlotlyHTMLElement, newPlot } from 'plotly.js/lib/core';
|
||||
|
||||
const graphDiv = '#test';
|
||||
|
||||
@@ -336,8 +336,8 @@ function rand() {
|
||||
});
|
||||
|
||||
myPlot.on('plotly_selected', (data) => {
|
||||
const x = [] as number[];
|
||||
const y = [] as number[];
|
||||
const x = [] as Datum[];
|
||||
const y = [] as Datum[];
|
||||
const N = 1000;
|
||||
const color1 = '#7b3294';
|
||||
const color1Light = '#c2a5cf';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as Plotly from 'plotly.js';
|
||||
import { Layout, PlotData, PlotlyHTMLElement, newPlot } from 'plotly.js';
|
||||
import { Datum, Layout, PlotData, PlotlyHTMLElement, newPlot } from 'plotly.js';
|
||||
|
||||
const graphDiv = '#test';
|
||||
|
||||
@@ -446,8 +446,8 @@ function rand() {
|
||||
});
|
||||
|
||||
myPlot.on('plotly_selected', (data) => {
|
||||
const x = [] as number[];
|
||||
const y = [] as number[];
|
||||
const x = [] as Datum[];
|
||||
const y = [] as Datum[];
|
||||
const N = 1000;
|
||||
const color1 = '#7b3294';
|
||||
const color1Light = '#c2a5cf';
|
||||
|
||||
Reference in New Issue
Block a user