summaryrefslogtreecommitdiff
path: root/themes/blowfish/assets/lib/mermaid/diagrams/xychart/chartBuilder/interfaces.d.ts
blob: bbf7194f2a9a7577307d5f25bff29e996e1f9fc9 (plain)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
export interface XYChartAxisThemeConfig {
    titleColor: string;
    labelColor: string;
    tickColor: string;
    axisLineColor: string;
}
export interface XYChartThemeConfig {
    backgroundColor: string;
    titleColor: string;
    xAxisLabelColor: string;
    xAxisTitleColor: string;
    xAxisTickColor: string;
    xAxisLineColor: string;
    yAxisLabelColor: string;
    yAxisTitleColor: string;
    yAxisTickColor: string;
    yAxisLineColor: string;
    plotColorPalette: string;
}
export interface ChartComponent {
    calculateSpace(availableSpace: Dimension): Dimension;
    setBoundingBoxXY(point: Point): void;
    getDrawableElements(): DrawableElem[];
}
export type SimplePlotDataType = [string, number][];
export interface LinePlotData {
    type: 'line';
    strokeFill: string;
    strokeWidth: number;
    data: SimplePlotDataType;
}
export interface BarPlotData {
    type: 'bar';
    fill: string;
    data: SimplePlotDataType;
}
export type PlotData = LinePlotData | BarPlotData;
export declare function isBarPlot(data: PlotData): data is BarPlotData;
export interface BandAxisDataType {
    type: 'band';
    title: string;
    categories: string[];
}
export interface LinearAxisDataType {
    type: 'linear';
    title: string;
    min: number;
    max: number;
}
export type AxisDataType = LinearAxisDataType | BandAxisDataType;
export declare function isBandAxisData(data: AxisDataType): data is BandAxisDataType;
export declare function isLinearAxisData(data: AxisDataType): data is LinearAxisDataType;
/**
 * For now we are keeping this configs as we are removing the required fields while generating the config.type.ts file
 * we should remove `XYChartAxisConfig` and `XYChartConfig` after we started using required fields
 */
export interface XYChartAxisConfig {
    showLabel: boolean;
    labelFontSize: number;
    labelPadding: number;
    showTitle: boolean;
    titleFontSize: number;
    titlePadding: number;
    showTick: boolean;
    tickLength: number;
    tickWidth: number;
    showAxisLine: boolean;
    axisLineWidth: number;
}
export interface XYChartConfig {
    width: number;
    height: number;
    titleFontSize: number;
    titlePadding: number;
    showTitle: boolean;
    xAxis: XYChartAxisConfig;
    yAxis: XYChartAxisConfig;
    chartOrientation: 'vertical' | 'horizontal';
    plotReservedSpacePercent: number;
}
export interface XYChartData {
    xAxis: AxisDataType;
    yAxis: AxisDataType;
    title: string;
    plots: PlotData[];
}
export interface Dimension {
    width: number;
    height: number;
}
export interface BoundingRect extends Point, Dimension {
}
export interface Point {
    x: number;
    y: number;
}
export type TextHorizontalPos = 'left' | 'center' | 'right';
export type TextVerticalPos = 'top' | 'middle';
export interface RectElem extends Point {
    width: number;
    height: number;
    fill: string;
    strokeWidth: number;
    strokeFill: string;
}
export interface TextElem extends Point {
    text: string;
    fill: string;
    verticalPos: TextVerticalPos;
    horizontalPos: TextHorizontalPos;
    fontSize: number;
    rotation: number;
}
export interface PathElem {
    path: string;
    fill?: string;
    strokeWidth: number;
    strokeFill: string;
}
export type DrawableElem = {
    groupTexts: string[];
    type: 'rect';
    data: RectElem[];
} | {
    groupTexts: string[];
    type: 'text';
    data: TextElem[];
} | {
    groupTexts: string[];
    type: 'path';
    data: PathElem[];
};