generated from vannizhang/react-redux-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
55 lines (54 loc) · 1.94 KB
/
types.ts
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
export type BottomAxisOptions = {
/**
* Indicate number of ticks that should be renderder, this only works with Scale Linear, for Scale Band, use `tickValues` option
* If not provided, d3 will try to render as many ticks as possible
*/
numberOfTicks?: number;
/**
* if true, create grid lines by setting the tick size to your chart height
*/
showGridLines?: boolean;
/**
* Specified values to be used for ticks rather than using the scale’s automatic tick generator.
* By default, D3 shows ticks for all items in the data on the x-axis.
* Pass an array of tick values or an array of keys of the input data to override that behavior
* and only render ticks for items that have their keys in `tickValuesOnXAxis`.
*/
tickValues?: (string | number)[];
/**
* if true, rotate the label text to provide more space
*/
shouldRotateTextLabels?: boolean;
/**
* custom format function mapping a value from the axis Domain to a formatted string for display purposes.
* @param domainValue original domain value
* @param index
* @returns formatted string
*/
tickFormatFunction?: (
domainValue: number | string,
index?: number
) => string;
};
export type LeftAxisOptions = {
/**
* Indicate number of ticks that should be renderder.
* If not provided, d3 will try to render as many ticks as possible
*/
numberOfTicks?: number;
/**
* if true, create grid lines by setting the tick size to your chart width
*/
showGridLines?: boolean;
/**
* if true, hide left axis
*/
shouldHide?: boolean;
/**
* custom format function mapping a value from the axis Domain to a formatted string for display purposes.
* @param domainValue original domain value
* @param index
* @returns formatted string
*/
tickFormatFunction?: (domainValue: number, index?: number) => string;
};