@diamondlightsource/davidia 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/AnyPlot.d.ts +17 -0
- package/dist/AnyPlot.d.ts.map +1 -0
- package/dist/AspectConfigModal.d.ts +22 -0
- package/dist/AspectConfigModal.d.ts.map +1 -0
- package/dist/AxialSelectionConfig.d.ts +22 -0
- package/dist/AxialSelectionConfig.d.ts.map +1 -0
- package/dist/AxisConfigModal.d.ts +57 -0
- package/dist/AxisConfigModal.d.ts.map +1 -0
- package/dist/BatonConfigModal.d.ts +9 -0
- package/dist/BatonConfigModal.d.ts.map +1 -0
- package/dist/ClearSelectionsBtn.d.ts +21 -0
- package/dist/ClearSelectionsBtn.d.ts.map +1 -0
- package/dist/ConnectedPlot.d.ts +23 -0
- package/dist/ConnectedPlot.d.ts.map +1 -0
- package/dist/DomainConfig.d.ts +31 -0
- package/dist/DomainConfig.d.ts.map +1 -0
- package/dist/GlyphTypeToggle.d.ts +23 -0
- package/dist/GlyphTypeToggle.d.ts.map +1 -0
- package/dist/HeatmapPlot.d.ts +35 -0
- package/dist/HeatmapPlot.d.ts.map +1 -0
- package/dist/ImagePlot.d.ts +37 -0
- package/dist/ImagePlot.d.ts.map +1 -0
- package/dist/InteractionModeToggle.d.ts +22 -0
- package/dist/InteractionModeToggle.d.ts.map +1 -0
- package/dist/LabelledInput.d.ts +35 -0
- package/dist/LabelledInput.d.ts.map +1 -0
- package/dist/LineConfig.d.ts +37 -0
- package/dist/LineConfig.d.ts.map +1 -0
- package/dist/LineKeyDropdown.d.ts +23 -0
- package/dist/LineKeyDropdown.d.ts.map +1 -0
- package/dist/LinePlot.d.ts +65 -0
- package/dist/LinePlot.d.ts.map +1 -0
- package/dist/LinearSelectionConfig.d.ts +22 -0
- package/dist/LinearSelectionConfig.d.ts.map +1 -0
- package/dist/Modal.d.ts +26 -0
- package/dist/Modal.d.ts.map +1 -0
- package/dist/Modeless.d.ts +23 -0
- package/dist/Modeless.d.ts.map +1 -0
- package/dist/MulticlickSelectionTool.d.ts +50 -0
- package/dist/MulticlickSelectionTool.d.ts.map +1 -0
- package/dist/PlotCustomizationContext.d.ts +131 -0
- package/dist/PlotCustomizationContext.d.ts.map +1 -0
- package/dist/PlotToolbar.d.ts +17 -0
- package/dist/PlotToolbar.d.ts.map +1 -0
- package/dist/PolygonalSelectionConfig.d.ts +22 -0
- package/dist/PolygonalSelectionConfig.d.ts.map +1 -0
- package/dist/RectangularSelectionConfig.d.ts +22 -0
- package/dist/RectangularSelectionConfig.d.ts.map +1 -0
- package/dist/ScatterPlot.d.ts +42 -0
- package/dist/ScatterPlot.d.ts.map +1 -0
- package/dist/SelectionComponent.d.ts +25 -0
- package/dist/SelectionComponent.d.ts.map +1 -0
- package/dist/SelectionConfig.d.ts +52 -0
- package/dist/SelectionConfig.d.ts.map +1 -0
- package/dist/SelectionConfigComponents.d.ts +69 -0
- package/dist/SelectionConfigComponents.d.ts.map +1 -0
- package/dist/SelectionIDDropdown.d.ts +23 -0
- package/dist/SelectionIDDropdown.d.ts.map +1 -0
- package/dist/SelectionTypeDropdown.d.ts +23 -0
- package/dist/SelectionTypeDropdown.d.ts.map +1 -0
- package/dist/SurfacePlot.d.ts +46 -0
- package/dist/SurfacePlot.d.ts.map +1 -0
- package/dist/TableDisplay.d.ts +37 -0
- package/dist/TableDisplay.d.ts.map +1 -0
- package/dist/index.d.ts +36 -762
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2230 -2212
- package/dist/models.d.ts +70 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/selections/AxialSelection.d.ts +22 -0
- package/dist/selections/AxialSelection.d.ts.map +1 -0
- package/dist/selections/BaseSelection.d.ts +24 -0
- package/dist/selections/BaseSelection.d.ts.map +1 -0
- package/dist/selections/CircularSectorialSelection.d.ts +17 -0
- package/dist/selections/CircularSectorialSelection.d.ts.map +1 -0
- package/dist/selections/CircularSelection.d.ts +15 -0
- package/dist/selections/CircularSelection.d.ts.map +1 -0
- package/dist/selections/EllipticalSelection.d.ts +15 -0
- package/dist/selections/EllipticalSelection.d.ts.map +1 -0
- package/dist/selections/LinearSelection.d.ts +20 -0
- package/dist/selections/LinearSelection.d.ts.map +1 -0
- package/dist/selections/OrientableSelection.d.ts +14 -0
- package/dist/selections/OrientableSelection.d.ts.map +1 -0
- package/dist/selections/PolygonalSelection.d.ts +22 -0
- package/dist/selections/PolygonalSelection.d.ts.map +1 -0
- package/dist/selections/RectangularSelection.d.ts +19 -0
- package/dist/selections/RectangularSelection.d.ts.map +1 -0
- package/dist/selections/utils.d.ts +223 -0
- package/dist/selections/utils.d.ts.map +1 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/setupTests.d.ts.map +1 -0
- package/dist/shapes/DvdAxisBox.d.ts +15 -0
- package/dist/shapes/DvdAxisBox.d.ts.map +1 -0
- package/dist/shapes/DvdDragHandle.d.ts +18 -0
- package/dist/shapes/DvdDragHandle.d.ts.map +1 -0
- package/dist/shapes/DvdPolyline.d.ts +15 -0
- package/dist/shapes/DvdPolyline.d.ts.map +1 -0
- package/dist/utils.d.ts +170 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.test.d.ts +2 -0
- package/dist/utils.test.d.ts.map +1 -0
- package/package.json +44 -36
- /package/dist/{style.css → index.css} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,762 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
export
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export declare function AnyToolbar(props: PropsWithChildren<AnyToolbarProps>): false | JSX_2.Element;
|
|
38
|
-
|
|
39
|
-
export declare interface AnyToolbarProps {
|
|
40
|
-
/** Inner child to add to plot toolbar */
|
|
41
|
-
extraChildren?: React.ReactNode;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { Aspect }
|
|
45
|
-
|
|
46
|
-
/** Class to select part of an axis */
|
|
47
|
-
export declare class AxialSelection extends BaseSelection {
|
|
48
|
-
readonly defaultColour = "#882255";
|
|
49
|
-
/** length in dimension */
|
|
50
|
-
length: number;
|
|
51
|
-
/** dimension (x=0, y=1) */
|
|
52
|
-
dimension: number;
|
|
53
|
-
constructor(start: [number, number], length: number, dimension: number);
|
|
54
|
-
_getPoint(fraction?: number): Vector3;
|
|
55
|
-
getPoints(): Vector3[];
|
|
56
|
-
toString(): string;
|
|
57
|
-
static clicks(): number[];
|
|
58
|
-
static isShape(s: AxialSelection | SelectionBase): s is AxialSelection;
|
|
59
|
-
_setFromPoints(points: Vector3[]): void;
|
|
60
|
-
static createFromPoints(points: Vector3[], dimension: number): AxialSelection;
|
|
61
|
-
static createFromSelection(s: AxialSelection): AxialSelection;
|
|
62
|
-
onHandleChange(i: number, pos: [number | undefined, number | undefined]): AxialSelection;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export { AxisScaleType }
|
|
66
|
-
|
|
67
|
-
/** Base class for all selections */
|
|
68
|
-
export declare class BaseSelection implements SelectionBase {
|
|
69
|
-
id: string;
|
|
70
|
-
name: string;
|
|
71
|
-
defaultColour: string;
|
|
72
|
-
colour?: string;
|
|
73
|
-
alpha: number;
|
|
74
|
-
fixed: boolean;
|
|
75
|
-
start: [number, number];
|
|
76
|
-
asDashed?: boolean;
|
|
77
|
-
/** Vector3 copy of start coordinate */
|
|
78
|
-
vStart: Vector3;
|
|
79
|
-
constructor(start: [number, number]);
|
|
80
|
-
toString(): string;
|
|
81
|
-
setStart(i: number, v: number): void;
|
|
82
|
-
getPoints(): Vector3[];
|
|
83
|
-
setProperties(other: BaseSelection): void;
|
|
84
|
-
static createFromSelection(s: BaseSelection): BaseSelection;
|
|
85
|
-
onHandleChange(i: number, pos: [number | undefined, number | undefined], d?: boolean): BaseSelection;
|
|
86
|
-
static isShape(s: BaseSelection | SelectionBase): s is BaseSelection;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Baton props
|
|
91
|
-
*/
|
|
92
|
-
export declare interface BatonProps {
|
|
93
|
-
/** The universally unique identifier (uuid) of the client */
|
|
94
|
-
uuid: string;
|
|
95
|
-
/** The uuid of the current baton holder */
|
|
96
|
-
batonUuid: string;
|
|
97
|
-
/** The other uuids */
|
|
98
|
-
others: string[];
|
|
99
|
-
/** If client holds baton */
|
|
100
|
-
hasBaton: boolean;
|
|
101
|
-
/** Handles baton request */
|
|
102
|
-
requestBaton: () => void;
|
|
103
|
-
/** Handle passing baton to client with given uuid */
|
|
104
|
-
offerBaton: (s: string) => void;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/** Class to select a circular sector */
|
|
108
|
-
export declare class CircularSectorialSelection extends BaseSelection {
|
|
109
|
-
readonly defaultColour = "#117733";
|
|
110
|
-
/** inner and outer radii */
|
|
111
|
-
radii: [number, number];
|
|
112
|
-
/** start and end angles (radians) */
|
|
113
|
-
angles: [number, number];
|
|
114
|
-
constructor(start: [number, number], radii: [number, number], angles: [number, number]);
|
|
115
|
-
static clicks(): number[];
|
|
116
|
-
static isShape(s: CircularSectorialSelection | SelectionBase): s is CircularSectorialSelection;
|
|
117
|
-
static createFromPoints(points: Vector3[]): CircularSectorialSelection;
|
|
118
|
-
static createFromSelection(s: CircularSectorialSelection): CircularSectorialSelection;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/** Class to select a circle */
|
|
122
|
-
export declare class CircularSelection extends BaseSelection {
|
|
123
|
-
readonly defaultColour = "#332288";
|
|
124
|
-
/** radius of circle */
|
|
125
|
-
radius: number;
|
|
126
|
-
constructor(start: [number, number], radius: number);
|
|
127
|
-
static clicks(): number[];
|
|
128
|
-
static isShape(s: CircularSelection | SelectionBase): s is CircularSelection;
|
|
129
|
-
static createFromPoints(points: Vector3[]): CircularSelection;
|
|
130
|
-
static createFromSelection(s: CircularSelection): CircularSelection;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export { ColorMap }
|
|
134
|
-
|
|
135
|
-
export { ColorScaleType }
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
*
|
|
139
|
-
* Renders a connected plot
|
|
140
|
-
* @param {ConnectedPlotProps} props - component props
|
|
141
|
-
* @returns {JSX.Element} The rendered component
|
|
142
|
-
*/
|
|
143
|
-
export declare function ConnectedPlot({ plotId, hostname, port, uuid, }: ConnectedPlotProps): JSX_2.Element;
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Props for the `ConnectedPlot` component
|
|
147
|
-
*/
|
|
148
|
-
export declare interface ConnectedPlotProps {
|
|
149
|
-
/** The plot ID */
|
|
150
|
-
plotId: string;
|
|
151
|
-
/** The hostname */
|
|
152
|
-
hostname?: string;
|
|
153
|
-
/** The port */
|
|
154
|
-
port?: string;
|
|
155
|
-
/** The universally unique identifier */
|
|
156
|
-
uuid: string;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export { Domain }
|
|
160
|
-
|
|
161
|
-
/** Class to select an ellipse */
|
|
162
|
-
export declare class EllipticalSelection extends OrientableSelection {
|
|
163
|
-
readonly defaultColour = "#999933";
|
|
164
|
-
/** lengths of major and minor semi-axes */
|
|
165
|
-
semiAxes: [number, number];
|
|
166
|
-
constructor(start: [number, number], semiAxes: [number, number], angle?: number);
|
|
167
|
-
static clicks(): number[];
|
|
168
|
-
static isShape(s: EllipticalSelection | SelectionBase): s is EllipticalSelection;
|
|
169
|
-
static createFromPoints(points: Vector3[]): EllipticalSelection;
|
|
170
|
-
static createFromSelection(s: EllipticalSelection): EllipticalSelection;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export { GlyphType }
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Function called when drag handles are moved
|
|
177
|
-
*/
|
|
178
|
-
export declare type HandleChangeFunction = (
|
|
179
|
-
/** Number of drag handle */
|
|
180
|
-
i: number,
|
|
181
|
-
/** Position of handle */
|
|
182
|
-
pos: [number | undefined, number | undefined],
|
|
183
|
-
/** If true, then is dragging */
|
|
184
|
-
d?: boolean) => SelectionBase;
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Represent heatmap data
|
|
188
|
-
*/
|
|
189
|
-
export declare interface HeatmapData extends ImageData_2 {
|
|
190
|
-
/** extent of scale for pixel values */
|
|
191
|
-
domain?: Domain;
|
|
192
|
-
/** heatmap scale type */
|
|
193
|
-
heatmapScale?: ColorScaleType;
|
|
194
|
-
/** colour map */
|
|
195
|
-
colourMap?: ColorMap;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* A heatmap plot
|
|
200
|
-
* @param {HeatmapPlotProps} props - The component props
|
|
201
|
-
* @returns {JSX.Element} The rendered component
|
|
202
|
-
*/
|
|
203
|
-
export declare function HeatmapPlot(props: HeatmapPlotProps): JSX_2.Element;
|
|
204
|
-
|
|
205
|
-
declare type HeatmapPlotCustomizationProps = Omit<HeatmapPlotProps, 'values'>;
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Props for `HeatmapPlot` component
|
|
209
|
-
*/
|
|
210
|
-
export declare interface HeatmapPlotProps extends PlotBaseProps, HeatmapData {
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Represent image data
|
|
215
|
-
*/
|
|
216
|
-
declare interface ImageData_2 {
|
|
217
|
-
/** pixel values */
|
|
218
|
-
values: NDT;
|
|
219
|
-
/** aspect ratio */
|
|
220
|
-
aspect?: Aspect;
|
|
221
|
-
}
|
|
222
|
-
export { ImageData_2 as ImageData }
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Render an image plot.
|
|
226
|
-
* @param {ImagePlotProps} props - The component props.
|
|
227
|
-
* @returns {JSX.Element} The rendered component.
|
|
228
|
-
*/
|
|
229
|
-
export declare function ImagePlot(props: ImagePlotProps): JSX_2.Element;
|
|
230
|
-
|
|
231
|
-
declare type ImagePlotCustomizationProps = Omit<ImagePlotProps, 'values'>;
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Props for the `ImagePlot` component
|
|
235
|
-
*/
|
|
236
|
-
export declare interface ImagePlotProps extends PlotBaseProps, ImageData_2 {
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export declare enum InteractionModeType {
|
|
240
|
-
panAndWheelZoom = "panAndWheelZoom",
|
|
241
|
-
selectToZoom = "selectToZoom",
|
|
242
|
-
selectRegion = "selectRegion"
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/** Class to select a line */
|
|
246
|
-
export declare class LinearSelection extends OrientableSelection {
|
|
247
|
-
readonly defaultColour = "#44aa99";
|
|
248
|
-
/** length of line */
|
|
249
|
-
length: number;
|
|
250
|
-
constructor(start?: [number, number], length?: number, angle?: number);
|
|
251
|
-
_getPoint(fraction?: number): Vector3;
|
|
252
|
-
getPoints(): Vector3[];
|
|
253
|
-
toString(): string;
|
|
254
|
-
static clicks(): number[];
|
|
255
|
-
static isShape(s: LinearSelection | SelectionBase): s is LinearSelection;
|
|
256
|
-
_setFromPoints(points: Vector3[]): void;
|
|
257
|
-
static createFromPoints(points: Vector3[]): LinearSelection;
|
|
258
|
-
static createFromSelection(s: LinearSelection): LinearSelection;
|
|
259
|
-
onHandleChange(i: number, pos: [number | undefined, number | undefined]): LinearSelection;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Represent line data
|
|
264
|
-
*/
|
|
265
|
-
export declare interface LineData {
|
|
266
|
-
/** The object key */
|
|
267
|
-
key: string;
|
|
268
|
-
/** Line parameters */
|
|
269
|
-
lineParams: LineParams;
|
|
270
|
-
/** x coordinates */
|
|
271
|
-
x: NDT;
|
|
272
|
-
/** x data domain */
|
|
273
|
-
xDomain: Domain;
|
|
274
|
-
/** y coordinates */
|
|
275
|
-
y: NDT;
|
|
276
|
-
/** y data domain */
|
|
277
|
-
yDomain: Domain;
|
|
278
|
-
/** Line uses default generated x-axis values */
|
|
279
|
-
defaultIndices?: boolean;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Represent line parameters
|
|
284
|
-
*/
|
|
285
|
-
export declare interface LineParams {
|
|
286
|
-
/** The line name */
|
|
287
|
-
name: string;
|
|
288
|
-
/** The line colour */
|
|
289
|
-
colour?: string;
|
|
290
|
-
/** If line is visible */
|
|
291
|
-
lineOn: boolean;
|
|
292
|
-
/** The size of the data points (optional) */
|
|
293
|
-
pointSize?: number;
|
|
294
|
-
/** The type of glyph */
|
|
295
|
-
glyphType: GlyphType;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Render a line plot.
|
|
300
|
-
* @param {LinePlotProps} props - The component props.
|
|
301
|
-
* @returns {JSX.Element} The rendered component.
|
|
302
|
-
*/
|
|
303
|
-
export declare function LinePlot(props: LinePlotProps): JSX_2.Element;
|
|
304
|
-
|
|
305
|
-
declare type LinePlotCustomizationProps = Omit<LinePlotProps, 'lineData'>;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Props for the `LinePlot` component.
|
|
309
|
-
*/
|
|
310
|
-
export declare interface LinePlotProps extends PlotBaseProps {
|
|
311
|
-
/** The line data */
|
|
312
|
-
lineData: LineData[];
|
|
313
|
-
/** The x data domain */
|
|
314
|
-
xDomain?: Domain;
|
|
315
|
-
/** The y data domain */
|
|
316
|
-
yDomain?: Domain;
|
|
317
|
-
/** Handles updating line params */
|
|
318
|
-
updateLineParams?: (key: string, params: LineParams) => void;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/** ndarray of a typed array */
|
|
322
|
-
export declare type NDT = NdArray<TypedArray>;
|
|
323
|
-
|
|
324
|
-
/** Superclass for all orientable selections */
|
|
325
|
-
export declare class OrientableSelection extends BaseSelection {
|
|
326
|
-
/** angle of selection (radians) */
|
|
327
|
-
angle: number;
|
|
328
|
-
protected transform: Matrix3;
|
|
329
|
-
protected invTransform: Matrix3;
|
|
330
|
-
constructor(start: [number, number], angle?: number);
|
|
331
|
-
setAngle(angle: number): void;
|
|
332
|
-
static isShape(s: OrientableSelection | SelectionBase): s is OrientableSelection;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Props for selections, baton and configuration in a plot component
|
|
337
|
-
*/
|
|
338
|
-
export declare interface PlotBaseProps extends PlotSelectionProps {
|
|
339
|
-
/** The plot configuration */
|
|
340
|
-
plotConfig: PlotConfig;
|
|
341
|
-
/**
|
|
342
|
-
* Children to customize the toolbar. If undefined then use default toolbar, if null, disable toolbar,
|
|
343
|
-
* otherwise use given children
|
|
344
|
-
*/
|
|
345
|
-
customToolbarChildren?: React.ReactNode;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Represent plot configuration
|
|
350
|
-
*/
|
|
351
|
-
export declare interface PlotConfig {
|
|
352
|
-
/** The label for the x-axis */
|
|
353
|
-
xLabel?: string;
|
|
354
|
-
/** The label for the y-axis */
|
|
355
|
-
yLabel?: string;
|
|
356
|
-
/** The x-axis scale type */
|
|
357
|
-
xScale?: AxisScaleType;
|
|
358
|
-
/** The y-axis scale type */
|
|
359
|
-
yScale?: AxisScaleType;
|
|
360
|
-
/** The x-axis values */
|
|
361
|
-
xValues?: NDT;
|
|
362
|
-
/** The y-axis values */
|
|
363
|
-
yValues?: NDT;
|
|
364
|
-
/** The plot title */
|
|
365
|
-
title?: string;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
export declare function PlotCustomizationContextProvider(props: PropsWithChildren<AnyPlotCustomizationProps>): JSX_2.Element;
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Value for a `PlotCustomization` context.
|
|
372
|
-
*/
|
|
373
|
-
export declare interface PlotCustomizationContextValue {
|
|
374
|
-
/** If the grid should be shown */
|
|
375
|
-
showGrid: boolean;
|
|
376
|
-
/** Toggles the grid */
|
|
377
|
-
toggleShowGrid: () => void;
|
|
378
|
-
/** The title */
|
|
379
|
-
title: string;
|
|
380
|
-
/** A function that sets the title */
|
|
381
|
-
setTitle: (t: string) => void;
|
|
382
|
-
/** The mode */
|
|
383
|
-
mode: InteractionModeType;
|
|
384
|
-
/** An optional function that sets the mode */
|
|
385
|
-
setMode: (m: InteractionModeType) => void;
|
|
386
|
-
/** A domain value for the x-axis */
|
|
387
|
-
xDomain: Domain;
|
|
388
|
-
/** A custom domain value for the x-axis */
|
|
389
|
-
xCustomDomain: CustomDomain;
|
|
390
|
-
/** A function that sets the custom domain value for the x-axis */
|
|
391
|
-
setXCustomDomain: (d: CustomDomain) => void;
|
|
392
|
-
/** The label for the x-axis */
|
|
393
|
-
xLabel: string;
|
|
394
|
-
/** A function that sets the label for the x-axis */
|
|
395
|
-
setXLabel: (l: string) => void;
|
|
396
|
-
/** An axis scale type for the x-axis */
|
|
397
|
-
xScaleType: AxisScaleType;
|
|
398
|
-
/** An optional function that sets the axis scale type for the x-axis */
|
|
399
|
-
setXScaleType: (s: AxisScaleType) => void;
|
|
400
|
-
/** A domain value for the y-axis */
|
|
401
|
-
yDomain: Domain;
|
|
402
|
-
/** A custom domain value for the y-axis */
|
|
403
|
-
yCustomDomain: CustomDomain;
|
|
404
|
-
/** A function that sets the custom domain value for the y-axis */
|
|
405
|
-
setYCustomDomain: (d: CustomDomain) => void;
|
|
406
|
-
/** The label for the y-axis */
|
|
407
|
-
yLabel: string;
|
|
408
|
-
/** A function that sets the label for the y-axis */
|
|
409
|
-
setYLabel: (l: string) => void;
|
|
410
|
-
/** The baton properties */
|
|
411
|
-
batonProps: BatonProps;
|
|
412
|
-
/** An axis scale type for the y-axis */
|
|
413
|
-
yScaleType: AxisScaleType;
|
|
414
|
-
/** A function that sets the axis scale type for the y-axis */
|
|
415
|
-
setYScaleType: (s: AxisScaleType) => void;
|
|
416
|
-
/** An aspect value */
|
|
417
|
-
aspect: Aspect;
|
|
418
|
-
/** A function that sets the aspect value */
|
|
419
|
-
setAspect: (a: Aspect) => void;
|
|
420
|
-
/** Selection upper limit (on current type) */
|
|
421
|
-
selectionMax: number;
|
|
422
|
-
/** A selection type */
|
|
423
|
-
selectionType: SelectionType;
|
|
424
|
-
/** A function that sets the selection type */
|
|
425
|
-
setSelectionType: (s: SelectionType) => void;
|
|
426
|
-
/** A domain value for the d-axis */
|
|
427
|
-
dDomain: Domain;
|
|
428
|
-
/** A custom domain value for the d-axis */
|
|
429
|
-
dCustomDomain: CustomDomain;
|
|
430
|
-
/** A function that sets the custom domain value for the d-axis */
|
|
431
|
-
setDCustomDomain: (d: CustomDomain) => void;
|
|
432
|
-
/** A color scale type for the d-axis */
|
|
433
|
-
dScaleType: ColorScaleType;
|
|
434
|
-
/** A function that sets the color scale type for the d-axis */
|
|
435
|
-
setDScaleType: (s: ColorScaleType) => void;
|
|
436
|
-
/** A color map */
|
|
437
|
-
colourMap: ColorMap;
|
|
438
|
-
/** A function that sets the color map */
|
|
439
|
-
setColourMap: (c: ColorMap) => void;
|
|
440
|
-
/** Whether to invert the color map */
|
|
441
|
-
invertColourMap: boolean;
|
|
442
|
-
/** A function that toggles the color map inversion */
|
|
443
|
-
toggleInvertColourMap: () => void;
|
|
444
|
-
/** Selection options */
|
|
445
|
-
selectionOptions?: SelectionOptions;
|
|
446
|
-
/** Selections */
|
|
447
|
-
selections: SelectionBase[];
|
|
448
|
-
/** A function that sets the selections */
|
|
449
|
-
setSelections: (s: SelectionBase[]) => void;
|
|
450
|
-
/** A function that updates the selections */
|
|
451
|
-
updateSelection: SelectionHandler;
|
|
452
|
-
/** Map of line parameters */
|
|
453
|
-
allLineParams: Map<string, LineParams>;
|
|
454
|
-
/** Set line parameters */
|
|
455
|
-
setAllLineParams: (params: Map<string, LineParams>) => void;
|
|
456
|
-
/** A function to update parameters in a line */
|
|
457
|
-
updateLineParams: (key: string, params: LineParams) => void;
|
|
458
|
-
/** current line key */
|
|
459
|
-
currentLineKey: string | null;
|
|
460
|
-
/** A function that sets current line key */
|
|
461
|
-
setCurrentLineKey: (k: string) => void;
|
|
462
|
-
/** The size of scatter data points. */
|
|
463
|
-
scatterPointSize: number;
|
|
464
|
-
/** A function that updates the selections */
|
|
465
|
-
setScatterPointSize: (p: number) => void;
|
|
466
|
-
/** Whether to show points on surface */
|
|
467
|
-
showPoints: boolean;
|
|
468
|
-
/** A function that toggles the points */
|
|
469
|
-
toggleShowPoints: () => void;
|
|
470
|
-
/** Get heatmap histogram */
|
|
471
|
-
histogramGetter?: () => HistogramParams;
|
|
472
|
-
/** Update heatmap histogram getter */
|
|
473
|
-
updateHistogramGetter: (getter: () => HistogramParams) => void;
|
|
474
|
-
/** Can select */
|
|
475
|
-
canSelect: boolean;
|
|
476
|
-
/** Type of plot */
|
|
477
|
-
plotType: PlotType;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* Props for selections (and baton) in a plot component
|
|
482
|
-
*/
|
|
483
|
-
export declare interface PlotSelectionProps {
|
|
484
|
-
/** Handles adding selection (set null to disable editing) */
|
|
485
|
-
updateSelection?: SelectionHandler | null;
|
|
486
|
-
/** The selections */
|
|
487
|
-
selections?: SelectionBase[];
|
|
488
|
-
/** The baton props */
|
|
489
|
-
batonProps?: BatonProps;
|
|
490
|
-
/** Selections event listener */
|
|
491
|
-
selectionsListener?: SelectionsEventListener;
|
|
492
|
-
/** Selection type options and limits (0 = limitless) */
|
|
493
|
-
selectionOptions?: SelectionOptions;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Render a plot toolbar.
|
|
498
|
-
* @param {Props} props - inner children
|
|
499
|
-
* @returns {JSX.Element} The rendered component.
|
|
500
|
-
*/
|
|
501
|
-
export declare function PlotToolbar(props: PropsWithChildren): JSX.Element;
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* Plot type available
|
|
505
|
-
*/
|
|
506
|
-
export declare type PlotType = 'Line' | 'Heatmap' | 'Image' | 'Scatter' | 'Surface';
|
|
507
|
-
|
|
508
|
-
/** Class to select a polygon */
|
|
509
|
-
export declare class PolygonalSelection extends BaseSelection {
|
|
510
|
-
readonly defaultOpenColour = "#88ccee";
|
|
511
|
-
readonly defaultClosedColour = "#ffa07a";
|
|
512
|
-
readonly defaultColour = "#88ccee";
|
|
513
|
-
/** array of point coordinates */
|
|
514
|
-
points: [number, number][];
|
|
515
|
-
/** if true, polygon is closed by joining last and first point */
|
|
516
|
-
closed: boolean;
|
|
517
|
-
constructor(points: [number, number][], closed?: boolean);
|
|
518
|
-
getPoints(): Vector3[];
|
|
519
|
-
getPoint(i: number): Vector3 | null;
|
|
520
|
-
static clicks(): number[];
|
|
521
|
-
static isShape(s: PolygonalSelection | SelectionBase): s is PolygonalSelection;
|
|
522
|
-
static createFromPoints(closed: boolean, points: Vector3[]): PolygonalSelection;
|
|
523
|
-
static createFromSelection(s: PolygonalSelection): PolygonalSelection;
|
|
524
|
-
onHandleChange(i: number, pos: [number | undefined, number | undefined]): PolygonalSelection;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
/** Class to select a rectangle */
|
|
528
|
-
export declare class RectangularSelection extends OrientableSelection {
|
|
529
|
-
readonly defaultColour = "#ddcc77";
|
|
530
|
-
/** lengths of major and minor sides */
|
|
531
|
-
lengths: [number, number];
|
|
532
|
-
constructor(start: [number, number], lengths: [number, number], angle?: number);
|
|
533
|
-
getPoints(): Vector3[];
|
|
534
|
-
getPoint(i: number): Vector3 | null;
|
|
535
|
-
toString(): string;
|
|
536
|
-
static clicks(): number[];
|
|
537
|
-
static isShape(s: RectangularSelection | SelectionBase): s is RectangularSelection;
|
|
538
|
-
static createFromPoints(axesFlipped: [boolean, boolean], points: Vector3[]): RectangularSelection;
|
|
539
|
-
static createFromSelection(s: RectangularSelection): RectangularSelection;
|
|
540
|
-
onHandleChange(i: number, pos: [number | undefined, number | undefined]): RectangularSelection;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
export { ScaleType }
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* Represent scatter data.
|
|
547
|
-
*/
|
|
548
|
-
declare interface ScatterData {
|
|
549
|
-
/** The x values for the scatter plot */
|
|
550
|
-
x: NDT;
|
|
551
|
-
/** The y values for the scatter plot */
|
|
552
|
-
y: NDT;
|
|
553
|
-
/** The values at each point in the scatter plot */
|
|
554
|
-
pointValues: NDT;
|
|
555
|
-
/** The domain of the z axis */
|
|
556
|
-
domain?: Domain;
|
|
557
|
-
/** The size of the data points */
|
|
558
|
-
pointSize?: number;
|
|
559
|
-
/** The colour map (optional) */
|
|
560
|
-
colourMap?: ColorMap;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
* Render a scatter plot.
|
|
565
|
-
* @param {ScatterPlotProps} props - The component props.
|
|
566
|
-
* @returns {JSX.Element} The rendered component.
|
|
567
|
-
*/
|
|
568
|
-
export declare function ScatterPlot(props: ScatterPlotProps): JSX_2.Element;
|
|
569
|
-
|
|
570
|
-
declare type ScatterPlotCustomizationProps = Omit<ScatterPlotProps, 'pointValues' | 'x' | 'y'>;
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
* Props for the `ScatterPlotProps` component.
|
|
574
|
-
*/
|
|
575
|
-
export declare interface ScatterPlotProps extends PlotBaseProps, ScatterData {
|
|
576
|
-
/** Function to update data point size */
|
|
577
|
-
setPointSize?: (p: number) => void;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
/**
|
|
581
|
-
* Base for Selection
|
|
582
|
-
*/
|
|
583
|
-
export declare interface SelectionBase {
|
|
584
|
-
/** identity */
|
|
585
|
-
readonly id: string;
|
|
586
|
-
/** name */
|
|
587
|
-
name: string;
|
|
588
|
-
/** default colour */
|
|
589
|
-
defaultColour: string;
|
|
590
|
-
/** outline colour */
|
|
591
|
-
colour?: string;
|
|
592
|
-
/** opacity [0,1] */
|
|
593
|
-
alpha: number;
|
|
594
|
-
/** if true, not moveable */
|
|
595
|
-
fixed: boolean;
|
|
596
|
-
/** start (or centre) point coordinate */
|
|
597
|
-
start: [number, number];
|
|
598
|
-
/** if true, outline is dashed */
|
|
599
|
-
asDashed?: boolean;
|
|
600
|
-
/** set start */
|
|
601
|
-
setStart: (i: number, v: number) => void;
|
|
602
|
-
/** retrieve points */
|
|
603
|
-
getPoints: () => Vector3[];
|
|
604
|
-
/** callback for drag handle movements */
|
|
605
|
-
onHandleChange: HandleChangeFunction;
|
|
606
|
-
/** string representation */
|
|
607
|
-
toString: () => string;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
/**
|
|
611
|
-
* Selection handler
|
|
612
|
-
* @returns ID of changed selection
|
|
613
|
-
*/
|
|
614
|
-
export declare type SelectionHandler = (selection: SelectionBase | null,
|
|
615
|
-
/** if true, selection is being dragged */
|
|
616
|
-
dragging?: boolean,
|
|
617
|
-
/** if true, remove selection */
|
|
618
|
-
clear?: boolean) => string | null;
|
|
619
|
-
|
|
620
|
-
declare type SelectionOptions = {
|
|
621
|
-
[K in SelectionType]?: number;
|
|
622
|
-
};
|
|
623
|
-
|
|
624
|
-
/**
|
|
625
|
-
* Selections event listener
|
|
626
|
-
*/
|
|
627
|
-
export declare type SelectionsEventListener = (type: SelectionsEventType,
|
|
628
|
-
/** if true, selection is being dragged */
|
|
629
|
-
dragging: boolean,
|
|
630
|
-
/** can be undefined for removing all selections */
|
|
631
|
-
selection?: SelectionBase) => void;
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* Selections event type
|
|
635
|
-
*/
|
|
636
|
-
export declare enum SelectionsEventType {
|
|
637
|
-
created = "created",
|
|
638
|
-
removed = "removed",
|
|
639
|
-
updated = "updated"
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
/**
|
|
643
|
-
* Supported types of selections
|
|
644
|
-
*/
|
|
645
|
-
export declare enum SelectionType {
|
|
646
|
-
line = "line",
|
|
647
|
-
rectangle = "rectangle",
|
|
648
|
-
polyline = "polyline",
|
|
649
|
-
polygon = "polygon",
|
|
650
|
-
circle = "circle",
|
|
651
|
-
ellipse = "ellipse",
|
|
652
|
-
sector = "sector",
|
|
653
|
-
horizontalAxis = "horizontalAxis",
|
|
654
|
-
verticalAxis = "verticalAxis",
|
|
655
|
-
unknown = "unknown"
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
/**
|
|
659
|
-
* Represent surface data
|
|
660
|
-
*/
|
|
661
|
-
export declare interface SurfaceData {
|
|
662
|
-
/** The height values for the surface */
|
|
663
|
-
heightValues: NDT;
|
|
664
|
-
/** The domain of the surface data */
|
|
665
|
-
domain?: Domain;
|
|
666
|
-
/** The colour scale type */
|
|
667
|
-
surfaceScale?: ColorScaleType;
|
|
668
|
-
/** The colour map (optional) */
|
|
669
|
-
colourMap?: ColorMap;
|
|
670
|
-
/** Show points if true */
|
|
671
|
-
showPoints?: boolean;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* Render a surface plot.
|
|
676
|
-
* @param {SurfacePlotProps} props - The component props.
|
|
677
|
-
* @returns {JSX.Element} The rendered component.
|
|
678
|
-
*/
|
|
679
|
-
export declare function SurfacePlot(props: SurfacePlotProps): JSX_2.Element;
|
|
680
|
-
|
|
681
|
-
declare type SurfacePlotCustomizationProps = Omit<SurfacePlotProps, 'heightValues'>;
|
|
682
|
-
|
|
683
|
-
/**
|
|
684
|
-
* Props for the `SurfacePlot` component.
|
|
685
|
-
*/
|
|
686
|
-
export declare interface SurfacePlotProps extends SurfaceData {
|
|
687
|
-
/** The baton props */
|
|
688
|
-
batonProps?: BatonProps;
|
|
689
|
-
/** The plot configuration */
|
|
690
|
-
plotConfig: PlotConfig;
|
|
691
|
-
/**
|
|
692
|
-
* Children to customize the toolbar. If undefined then use default toolbar, if null, disable toolbar,
|
|
693
|
-
* otherwise use given children
|
|
694
|
-
*/
|
|
695
|
-
customToolbarChildren?: React.ReactNode;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
/** Represent table data */
|
|
699
|
-
declare interface TableData {
|
|
700
|
-
/** The cell values */
|
|
701
|
-
cellValues: NDT;
|
|
702
|
-
/** The cell width */
|
|
703
|
-
cellWidth: number;
|
|
704
|
-
/** The parameters for the table display (optional) */
|
|
705
|
-
displayParams?: TableDisplayParams;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
/**
|
|
709
|
-
* Render a table display.
|
|
710
|
-
* @param {TableDisplayProps} props - The component props.
|
|
711
|
-
* @returns {JSX.Element} The rendered component.
|
|
712
|
-
*/
|
|
713
|
-
export declare function TableDisplay(props: TableDisplayProps): JSX_2.Element;
|
|
714
|
-
|
|
715
|
-
/**
|
|
716
|
-
* Parameters for `TableDisplay`.
|
|
717
|
-
*/
|
|
718
|
-
export declare interface TableDisplayParams {
|
|
719
|
-
/** The table display type (optional) */
|
|
720
|
-
displayType?: TableDisplayType;
|
|
721
|
-
/** The number of digits to display for each data value (optional) */
|
|
722
|
-
numberDigits?: number;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
* Props for the `TableDisplay` component.
|
|
727
|
-
*/
|
|
728
|
-
export declare interface TableDisplayProps extends TableData {
|
|
729
|
-
/** The baton props */
|
|
730
|
-
batonProps?: BatonProps;
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
/** Number represent in table */
|
|
734
|
-
export declare type TableDisplayType = 'scientific' | 'standard';
|
|
735
|
-
|
|
736
|
-
/**
|
|
737
|
-
* @returns context for customizing a plot
|
|
738
|
-
*/
|
|
739
|
-
export declare function usePlotCustomizationContext(): PlotCustomizationContextValue;
|
|
740
|
-
|
|
741
|
-
/**
|
|
742
|
-
* Custom hook to handle selection changes
|
|
743
|
-
* @param initSelections initial selections
|
|
744
|
-
* @param listener event listener
|
|
745
|
-
* @returns selections, selections setter, new selection reference, updateSelection, canSelect, enableSelect
|
|
746
|
-
*/
|
|
747
|
-
export declare function useSelections(initSelections?: SelectionBase[], listener?: SelectionsEventListener): {
|
|
748
|
-
selections: SelectionBase[];
|
|
749
|
-
setSelections: Dispatch<SetStateAction<SelectionBase[]>>;
|
|
750
|
-
isNewSelection: MutableRefObject<boolean>;
|
|
751
|
-
updateSelection: SelectionHandler;
|
|
752
|
-
canSelect: boolean;
|
|
753
|
-
enableSelect: Dispatch<SetStateAction<boolean>>;
|
|
754
|
-
};
|
|
755
|
-
|
|
756
|
-
export { }
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
declare namespace DomainConfig {
|
|
760
|
-
var displayName: string;
|
|
761
|
-
}
|
|
762
|
-
|
|
1
|
+
export type { PlotConfig, BatonProps, NDT, PlotBaseProps, PlotSelectionProps, } from './models';
|
|
2
|
+
export { default as AnyPlot } from './AnyPlot';
|
|
3
|
+
export type { AnyPlotProps, AnyPlotVisProps } from './AnyPlot';
|
|
4
|
+
export { default as ConnectedPlot } from './ConnectedPlot';
|
|
5
|
+
export type { ConnectedPlotProps } from './ConnectedPlot';
|
|
6
|
+
export { default as HeatmapPlot } from './HeatmapPlot';
|
|
7
|
+
export type { HeatmapData, HeatmapPlotProps } from './HeatmapPlot';
|
|
8
|
+
export { default as ImagePlot } from './ImagePlot';
|
|
9
|
+
export type { ImageData, ImagePlotProps } from './ImagePlot';
|
|
10
|
+
export { default as LinePlot } from './LinePlot';
|
|
11
|
+
export type { LineData, LineParams, LinePlotProps } from './LinePlot';
|
|
12
|
+
export { PlotCustomizationContextProvider, usePlotCustomizationContext, } from './PlotCustomizationContext';
|
|
13
|
+
export type { AnyPlotCustomizationProps, PlotCustomizationContextValue, PlotType, } from './PlotCustomizationContext';
|
|
14
|
+
export { default as PlotToolbar, AnyToolbar } from './PlotToolbar';
|
|
15
|
+
export type { AnyToolbarProps } from './PlotToolbar';
|
|
16
|
+
export { default as ScatterPlot } from './ScatterPlot';
|
|
17
|
+
export type { ScatterPlotProps } from './ScatterPlot';
|
|
18
|
+
export { default as SurfacePlot } from './SurfacePlot';
|
|
19
|
+
export type { SurfaceData, SurfacePlotProps } from './SurfacePlot';
|
|
20
|
+
export { default as TableDisplay } from './TableDisplay';
|
|
21
|
+
export type { TableDisplayType, TableDisplayParams, TableDisplayProps, } from './TableDisplay';
|
|
22
|
+
export { InteractionModeType } from './utils';
|
|
23
|
+
export { default as AxialSelection } from './selections/AxialSelection';
|
|
24
|
+
export { default as BaseSelection } from './selections/BaseSelection';
|
|
25
|
+
export { default as CircularSectorialSelection } from './selections/CircularSectorialSelection';
|
|
26
|
+
export { default as CircularSelection } from './selections/CircularSelection';
|
|
27
|
+
export { default as EllipticalSelection } from './selections/EllipticalSelection';
|
|
28
|
+
export { default as LinearSelection } from './selections/LinearSelection';
|
|
29
|
+
export { default as OrientableSelection } from './selections/OrientableSelection';
|
|
30
|
+
export { default as PolygonalSelection } from './selections/PolygonalSelection';
|
|
31
|
+
export { default as RectangularSelection } from './selections/RectangularSelection';
|
|
32
|
+
export { SelectionType, useSelections } from './selections/utils';
|
|
33
|
+
export type { HandleChangeFunction, SelectionBase, SelectionHandler, SelectionsEventListener, SelectionsEventType, } from './selections/utils';
|
|
34
|
+
export { GlyphType, ScaleType } from '@h5web/lib';
|
|
35
|
+
export type { Aspect, AxisScaleType, ColorMap, ColorScaleType, Domain, } from '@h5web/lib';
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|