categoricalAxisConfig.class.d.ts 3.01 KB
Newer Older
David Anderson's avatar
David Anderson committed
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
import { DataPoint } from '../../classes/datapoint.class';
import { CategoricalAxis } from '../../implementations/axis/categoricalAxis.class';
import { BaseAxisConfig } from './baseAxisConfig.class';
import { Orientation } from "../../types/orientation.type";
import { AxisLabel } from "../../types/axisLabel.type";
export declare class CategoricalAxisConfig<T extends string | number = string> extends BaseAxisConfig {
    /**
     * The class object that implements this config. This should never be touched outside of GistCharts
     *
     * @memberof CategoricalAxisConfig
     */
    implementation: CategoricalAxis<T>;
    explicitCategories: Array<T> | undefined;
    /**
     * How long in pixels should the tick marks be?
     *
     * @type {number}
     * @memberof CategoricalAxisConfig
     */
    tickLength: number;
    /**
     * How much space should be around the tick labels ( both before and after )
     *
     * @type {number}
     * @memberof CategoricalAxisConfig
     */
    tickPad: number;
    /**
     *  The minimum category size for the axis in pixels
     *
     * @type {(number | undefined)}
     * @memberof CategoricalAxisConfig
     */
    minCategorySize: number | undefined;
    /**
     *  The maximum category size for the axis in pixels
     *
     * @type {(number | undefined)}
     * @memberof CategoricalAxisConfig
     */
    maxCategorySize: number | undefined;
    getCategorySize: ((cat: T) => number) | undefined;
    /**
     * Tells the axis how to get the value property of a charts data point
     *
     * @param {DataPoint} dp
     * @returns {T}
     * @memberof BaseAxisConfig
     */
    getValue(dp: DataPoint): T;
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
    /**
     * Determins the amount of pading between bands
     * Will be treated as a number of pixels when set to 1 or higher
     * Will be treated as a perctange when less than 1
     *
     * @type {number}
     * @memberof CategoricalAxisConfig
     */
    innerPadding: number;
    /**
     * Determins the amount of pading before first category and after last
     * Will be treated as a number of pixels when set to 1 or higher
     * Will be treated as a perctange when less than 1
     *
     * @type {number}
     * @memberof CategoricalAxisConfig
     */
    outerPadding: number;
    /**
     * Sets inner padding and outer padding to the same value
     *
     * @param {number} x
     * @memberof CategoricalAxisConfig
     */
    setPadding(x: number): void;
76
77
78
79
80
81
82
83
84
85
    /**
     * Tells the axis where to draw its label for the category.
     * 'center' ( default ) is in the middle of the category.
     * 'start' will draw it where the band begins.
     * 'stop' willd draw it where the band ends.
     *
     * @type {('center' | 'stop' | 'start')}
     * @memberof CategoricalAxisConfig
     */
    tickLabelPosition: 'center' | 'stop' | 'start';
David Anderson's avatar
David Anderson committed
86
87
88
89
90
91
    getAxisLabels(): Array<AxisLabel>;
    /**
     * Used to sort the categories. By Default sort will be alpha numeric
     * @param a
     * @param b
     */
David Anderson's avatar
David Anderson committed
92
    sortValues(a: T, b: T): 1 | 0 | -1;
David Anderson's avatar
David Anderson committed
93
94
    constructor(orientation: Orientation);
}