-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.layouts.d.ts
More file actions
88 lines (88 loc) · 3.11 KB
/
core.layouts.d.ts
File metadata and controls
88 lines (88 loc) · 3.11 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
declare namespace _default {
/**
* Register a box to a chart.
* A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.
* @param {Chart} chart - the chart to use
* @param {LayoutItem} item - the item to add to be laid out
*/
function addBox(chart: import("./core.controller.js").default, item: LayoutItem): void;
/**
* Remove a layoutItem from a chart
* @param {Chart} chart - the chart to remove the box from
* @param {LayoutItem} layoutItem - the item to remove from the layout
*/
function removeBox(chart: import("./core.controller.js").default, layoutItem: LayoutItem): void;
/**
* Sets (or updates) options on the given `item`.
* @param {Chart} chart - the chart in which the item lives (or will be added to)
* @param {LayoutItem} item - the item to configure with the given options
* @param {object} options - the new item options.
*/
function configure(chart: import("./core.controller.js").default, item: LayoutItem, options: any): void;
/**
* Fits boxes of the given chart into the given size by having each box measure itself
* then running a fitting algorithm
* @param {Chart} chart - the chart
* @param {number} width - the width to fit into
* @param {number} height - the height to fit into
* @param {number} minPadding - minimum padding required for each side of chart area
*/
function update(chart: import("./core.controller.js").default, width: number, height: number, minPadding: number): void;
}
export default _default;
export type Chart = import('./core.controller.js').default;
export type LayoutItem = {
/**
* - The position of the item in the chart layout. Possible values are
* 'left', 'top', 'right', 'bottom', and 'chartArea'
*/
position: string;
/**
* - The weight used to sort the item. Higher weights are further away from the chart area
*/
weight: number;
/**
* - if true, and the item is horizontal, then push vertical boxes down
*/
fullSize: boolean;
/**
* - returns true if the layout item is horizontal (ie. top or bottom)
*/
isHorizontal: Function;
/**
* - Takes two parameters: width and height. Returns size of item
*/
update: Function;
/**
* - Draws the element
*/
draw: Function;
/**
* - Returns an object with padding on the edges
*/
getPadding?: Function;
/**
* - Width of item. Must be valid after update()
*/
width: number;
/**
* - Height of item. Must be valid after update()
*/
height: number;
/**
* - Left edge of the item. Set by layout system and cannot be used in update
*/
left: number;
/**
* - Top edge of the item. Set by layout system and cannot be used in update
*/
top: number;
/**
* - Right edge of the item. Set by layout system and cannot be used in update
*/
right: number;
/**
* - Bottom edge of the item. Set by layout system and cannot be used in update
*/
bottom: number;
};