/
types2.ts
88 lines (77 loc) · 2.16 KB
/
types2.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
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
import { Field } from '@grafana/data';
import * as common from '@grafana/schema';
// import { SeriesMapping, XYSeriesConfig } from './panelcfg.gen';
// // panel save model
// export interface XYSeriesConfig {
// name?: {
// fixed?: string; // (if explicitly defined in manual mode)
// /*
// replace?: {
// // default: 'field'
// source: 'field' | 'frame';
// // default: whatever is matched for y field
// matcher: common.MatcherConfig;
// // default: 'displayName'
// prop: 'displayName' | 'name' | 'query' | 'target';
// // similar to renameByRegex & RenameByRegexTransformerOptions
// // default: '(.*)'
// regex: string;
// // default: '$1'
// rename: string;
// }
// */
// }
// // required in manual mode (can match same frame multiple times)
// frame?: {
// matcher: common.MatcherConfig;
// };
// x?: {
// matcher: common.MatcherConfig;
// };
// y?: {
// matcher: common.MatcherConfig;
// };
// color?: {
// matcher: common.MatcherConfig;
// };
// size?: {
// matcher: common.MatcherConfig;
// };
// }
// materialized series (internal)
export interface XYSeries {
showPoints: common.VisibilityMode;
showLine: boolean;
lineWidth: number;
lineStyle: common.LineStyle;
name: {
// extracted from fieldConfig + overrides of y field
value: string;
};
x: {
field: Field;
};
y: {
field: Field;
};
color: {
field?: Field;
// fixed value extracted from fieldConfig + overrides of y field
fixed?: string;
};
size: {
field?: Field;
// extracted from fieldConfig + overrides of size field
min?: number;
max?: number;
// fixed value extracted from fieldConfig + overrides of y field
fixed?: number;
};
// remaining unmapped fields in this frame (for showing remaining fields in tooltip)
_rest: Field[];
}
// export interface Options extends common.OptionsWithLegend, common.OptionsWithTooltip {
// // source: 'annotations' | 'series', // maybe render directly from annotations (exemplars)
// mapping: SeriesMapping;
// series: XYSeriesConfig[]; // uses series[0] in auto mode to generate
// }