@thoughtspot/ts-chart-sdk 0.0.2-alpha.2 → 0.0.2-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -50
- package/dist/ts-chart-sdk.d.ts +940 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/main/custom-chart-context.d.ts +22 -7
- package/lib/main/custom-chart-context.d.ts.map +1 -1
- package/lib/main/custom-chart-context.js +59 -4
- package/lib/main/custom-chart-context.js.map +1 -1
- package/lib/main/custom-chart-context.spec.js +402 -5
- package/lib/main/custom-chart-context.spec.js.map +1 -1
- package/lib/main/post-message-event-bridge.js +2 -2
- package/lib/main/post-message-event-bridge.js.map +1 -1
- package/lib/main/util.spec.d.ts +2 -0
- package/lib/main/util.spec.d.ts.map +1 -0
- package/lib/main/util.spec.js +31 -0
- package/lib/main/util.spec.js.map +1 -0
- package/lib/react/use-custom-chart-context.spec.js +54 -3
- package/lib/react/use-custom-chart-context.spec.js.map +1 -1
- package/lib/test/test-conditional-formatting-utils.d.ts +5 -0
- package/lib/test/test-conditional-formatting-utils.d.ts.map +1 -0
- package/lib/test/test-conditional-formatting-utils.js +43 -0
- package/lib/test/test-conditional-formatting-utils.js.map +1 -0
- package/lib/types/answer-column.types.d.ts +57 -1
- package/lib/types/answer-column.types.d.ts.map +1 -1
- package/lib/types/answer-column.types.js +47 -0
- package/lib/types/answer-column.types.js.map +1 -1
- package/lib/types/chart-to-ts-event.types.d.ts +2 -0
- package/lib/types/chart-to-ts-event.types.d.ts.map +1 -1
- package/lib/types/chart-to-ts-event.types.js +1 -0
- package/lib/types/chart-to-ts-event.types.js.map +1 -1
- package/lib/types/common.types.d.ts +103 -4
- package/lib/types/common.types.d.ts.map +1 -1
- package/lib/types/common.types.js +15 -1
- package/lib/types/common.types.js.map +1 -1
- package/lib/types/conditional-formatting.types.d.ts +140 -0
- package/lib/types/conditional-formatting.types.d.ts.map +1 -0
- package/lib/types/conditional-formatting.types.js +60 -0
- package/lib/types/conditional-formatting.types.js.map +1 -0
- package/lib/types/configurator.types.d.ts +5 -0
- package/lib/types/configurator.types.d.ts.map +1 -1
- package/lib/types/number-formatting.types.d.ts +55 -0
- package/lib/types/number-formatting.types.d.ts.map +1 -0
- package/lib/types/number-formatting.types.js +23 -0
- package/lib/types/number-formatting.types.js.map +1 -0
- package/lib/types/ts-to-chart-event.types.d.ts +10 -5
- package/lib/types/ts-to-chart-event.types.d.ts.map +1 -1
- package/lib/types/ts-to-chart-event.types.js.map +1 -1
- package/lib/types/visual-prop.types.d.ts +21 -0
- package/lib/types/visual-prop.types.d.ts.map +1 -1
- package/lib/utils/conditional-formatting/conditional-formatting.d.ts +10 -0
- package/lib/utils/conditional-formatting/conditional-formatting.d.ts.map +1 -0
- package/lib/utils/conditional-formatting/conditional-formatting.js +103 -0
- package/lib/utils/conditional-formatting/conditional-formatting.js.map +1 -0
- package/lib/utils/conditional-formatting/conditional-formatting.spec.d.ts +2 -0
- package/lib/utils/conditional-formatting/conditional-formatting.spec.d.ts.map +1 -0
- package/lib/utils/conditional-formatting/conditional-formatting.spec.js +142 -0
- package/lib/utils/conditional-formatting/conditional-formatting.spec.js.map +1 -0
- package/lib/utils/date-formatting.d.ts +103 -0
- package/lib/utils/date-formatting.d.ts.map +1 -0
- package/lib/utils/date-formatting.js +389 -0
- package/lib/utils/date-formatting.js.map +1 -0
- package/lib/utils/date-formatting.spec.d.ts +2 -0
- package/lib/utils/date-formatting.spec.d.ts.map +1 -0
- package/lib/utils/date-formatting.spec.js +394 -0
- package/lib/utils/date-formatting.spec.js.map +1 -0
- package/lib/utils/date-utils.d.ts +6 -0
- package/lib/utils/date-utils.d.ts.map +1 -0
- package/lib/utils/date-utils.js +20 -0
- package/lib/utils/date-utils.js.map +1 -0
- package/lib/utils/date-utils.spec.d.ts +2 -0
- package/lib/utils/date-utils.spec.d.ts.map +1 -0
- package/lib/utils/date-utils.spec.js +63 -0
- package/lib/utils/date-utils.spec.js.map +1 -0
- package/lib/utils/formatting-util.d.ts +10 -0
- package/lib/utils/formatting-util.d.ts.map +1 -0
- package/lib/utils/formatting-util.js +78 -0
- package/lib/utils/formatting-util.js.map +1 -0
- package/lib/utils/formatting-util.spec.d.ts +2 -0
- package/lib/utils/formatting-util.spec.d.ts.map +1 -0
- package/lib/utils/formatting-util.spec.js +247 -0
- package/lib/utils/formatting-util.spec.js.map +1 -0
- package/package.json +6 -4
- package/src/index.ts +4 -0
- package/src/main/custom-chart-context.spec.ts +474 -9
- package/src/main/custom-chart-context.ts +246 -12
- package/src/main/post-message-event-bridge.ts +1 -1
- package/src/main/util.spec.ts +41 -0
- package/src/react/use-custom-chart-context.spec.tsx +65 -3
- package/src/test/test-conditional-formatting-utils.ts +95 -0
- package/src/types/answer-column.types.ts +102 -1
- package/src/types/chart-to-ts-event.types.ts +7 -0
- package/src/types/common.types.ts +165 -10
- package/src/types/conditional-formatting.types.ts +157 -0
- package/src/types/configurator.types.ts +21 -0
- package/src/types/number-formatting.types.ts +80 -0
- package/src/types/ts-to-chart-event.types.ts +38 -6
- package/src/types/visual-prop.types.ts +75 -1
- package/src/utils/conditional-formatting/conditional-formatting.spec.ts +469 -0
- package/src/utils/conditional-formatting/conditional-formatting.ts +229 -0
- package/src/utils/date-formatting.spec.ts +511 -0
- package/src/utils/date-formatting.ts +679 -0
- package/src/utils/date-utils.spec.ts +93 -0
- package/src/utils/date-utils.ts +69 -0
- package/src/utils/formatting-util.spec.ts +312 -0
- package/src/utils/formatting-util.ts +234 -0
|
@@ -0,0 +1,940 @@
|
|
|
1
|
+
// Generated by dts-bundle v0.7.3
|
|
2
|
+
// Dependencies for this module:
|
|
3
|
+
// ../react
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
export type Maybe<T> = T | null;
|
|
8
|
+
export type InputMaybe<T> = Maybe<T>;
|
|
9
|
+
export type Scalars = {
|
|
10
|
+
ID: string;
|
|
11
|
+
String: string;
|
|
12
|
+
Boolean: boolean;
|
|
13
|
+
Int: number;
|
|
14
|
+
Float: number;
|
|
15
|
+
FileUpload: unknown;
|
|
16
|
+
GUID: string;
|
|
17
|
+
JSON: {
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
JSONObject: unknown;
|
|
21
|
+
Long: unknown;
|
|
22
|
+
};
|
|
23
|
+
export enum CustomizableChartFeature {
|
|
24
|
+
X_AXIS_LABEL = 0,
|
|
25
|
+
X_AXIS_TITLE = 1,
|
|
26
|
+
Y_AXIS_LABEL = 2,
|
|
27
|
+
Y_AXIS_TITLE = 3,
|
|
28
|
+
TOOLTIP = 4,
|
|
29
|
+
SCATTER_CHART = 5,
|
|
30
|
+
PIE_CHART = 6,
|
|
31
|
+
LINE_CHART = 7,
|
|
32
|
+
COLUMN_CHART = 8,
|
|
33
|
+
BAR_CHART = 9,
|
|
34
|
+
AREA_CHART = 10,
|
|
35
|
+
TAIL_FEATURE = 11
|
|
36
|
+
}
|
|
37
|
+
export interface ChartConfigDimension {
|
|
38
|
+
key: string;
|
|
39
|
+
columns: ChartColumn[];
|
|
40
|
+
}
|
|
41
|
+
export interface ChartConfig {
|
|
42
|
+
key: string;
|
|
43
|
+
dimensions: ChartConfigDimension[];
|
|
44
|
+
}
|
|
45
|
+
export type DataPointsArray = {
|
|
46
|
+
columns: string[];
|
|
47
|
+
dataValue: any[][];
|
|
48
|
+
};
|
|
49
|
+
export type QueryData = {
|
|
50
|
+
data: DataPointsArray;
|
|
51
|
+
completionRatio?: number;
|
|
52
|
+
samplingRatio?: number;
|
|
53
|
+
totalRowCount: number;
|
|
54
|
+
};
|
|
55
|
+
export interface ChartModel {
|
|
56
|
+
columns: ChartColumn[];
|
|
57
|
+
data?: QueryData[];
|
|
58
|
+
sortInfo?: any;
|
|
59
|
+
visualProps?: VisualProps;
|
|
60
|
+
config: {
|
|
61
|
+
chartConfig?: ChartConfig[];
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export type SuccessValidationResponse = {
|
|
65
|
+
chartConfigEditorDefinition: ChartConfigEditorDefinition[];
|
|
66
|
+
visualPropEditorDefinition: VisualPropEditorDefinition;
|
|
67
|
+
};
|
|
68
|
+
export type ValidationResponse = {
|
|
69
|
+
isValid: boolean;
|
|
70
|
+
validationErrorMessage?: string[];
|
|
71
|
+
};
|
|
72
|
+
export type VisualProps = unknown;
|
|
73
|
+
export type TSFontFace = {
|
|
74
|
+
guid: string | null;
|
|
75
|
+
family?: string;
|
|
76
|
+
format?: string;
|
|
77
|
+
url?: string;
|
|
78
|
+
weight?: string;
|
|
79
|
+
style?: string;
|
|
80
|
+
size?: string;
|
|
81
|
+
unicodeRange?: string;
|
|
82
|
+
variant?: string;
|
|
83
|
+
stretch?: string;
|
|
84
|
+
color?: string;
|
|
85
|
+
};
|
|
86
|
+
export type ChartSdkCustomStylingConfig = {
|
|
87
|
+
appBackground?: {
|
|
88
|
+
color?: string;
|
|
89
|
+
};
|
|
90
|
+
appPanelColor?: {
|
|
91
|
+
color?: string;
|
|
92
|
+
};
|
|
93
|
+
chartColorPalettes?: Array<{
|
|
94
|
+
colors: Array<string>;
|
|
95
|
+
}>;
|
|
96
|
+
numColorPalettes?: number;
|
|
97
|
+
disableColorRotation?: boolean;
|
|
98
|
+
chartFeatureToFontGuid?: Record<CustomizableChartFeature, string>;
|
|
99
|
+
fontFaces?: Array<TSFontFace>;
|
|
100
|
+
};
|
|
101
|
+
export interface DateFormats {
|
|
102
|
+
DATE_SHORT: string;
|
|
103
|
+
DATE_SHORT_2_DIGIT_YEAR: string;
|
|
104
|
+
DATE_SHORT_WITH_HOUR: string;
|
|
105
|
+
DATE_SHORT_WITH_HOUR_WITHOUT_YEAR: string;
|
|
106
|
+
DATE_SHORT_WITH_HOUR_24: string;
|
|
107
|
+
DATE_SHORT_WITH_HOUR_24_WITHOUT_YEAR: string;
|
|
108
|
+
DATETIME_SHORT: string;
|
|
109
|
+
DATETIME_SHORT_WITHOUT_YEAR: string;
|
|
110
|
+
DATETIME_24_SHORT: string;
|
|
111
|
+
DATETIME_24_SHORT_WITH_MILLIS: string;
|
|
112
|
+
DATETIME_24_SHORT_WITH_MILLIS_WITHOUT_YEAR: string;
|
|
113
|
+
DATETIME_SHORT_WITH_SECONDS: string;
|
|
114
|
+
DATETIME_SHORT_WITH_SECONDS_WITHOUT_YEAR: string;
|
|
115
|
+
DATETIME_SHORT_WITH_MILLIS: string;
|
|
116
|
+
DATETIME_SHORT_WITH_MILLIS_WITHOUT_YEAR: string;
|
|
117
|
+
QUARTER_WITH_YEAR: string;
|
|
118
|
+
QUARTER_WITH_2_DIGIT_YEAR: string;
|
|
119
|
+
DEFAULT_TIME_FORMAT: string;
|
|
120
|
+
MONTH_WITH_YEAR: string;
|
|
121
|
+
MONTH_WITH_DAY_AND_YEAR: string;
|
|
122
|
+
MONTH_WITH_2_DIGIT_YEAR: string;
|
|
123
|
+
DAY_WITH_MONTH: string;
|
|
124
|
+
DAY_WITH_MONTH_NUM: string;
|
|
125
|
+
QUARTER: string;
|
|
126
|
+
MONTH_ONLY: string;
|
|
127
|
+
DATETIME_WITH_SHORT_OFFSET: string;
|
|
128
|
+
}
|
|
129
|
+
export type ChartSdkDateFormatsConfig = {
|
|
130
|
+
tsLocaleBasedDateFormats?: Record<string, DateFormats>;
|
|
131
|
+
tsLocaleBasedStringsFormats?: Record<string, string>;
|
|
132
|
+
tsDateConstants?: Record<string, string>;
|
|
133
|
+
tsDefinedCustomCalenders?: any;
|
|
134
|
+
defaultDataSourceId?: string;
|
|
135
|
+
};
|
|
136
|
+
export interface AppConfig {
|
|
137
|
+
styleConfig?: ChartSdkCustomStylingConfig;
|
|
138
|
+
dateFormatsConfig?: ChartSdkDateFormatsConfig;
|
|
139
|
+
appOptions?: {
|
|
140
|
+
isMobile?: boolean;
|
|
141
|
+
isPrintMode?: boolean;
|
|
142
|
+
isLiveboardContext?: boolean;
|
|
143
|
+
isDebugMode?: boolean;
|
|
144
|
+
};
|
|
145
|
+
localeOptions?: {
|
|
146
|
+
locale: string;
|
|
147
|
+
quarterStartMonth: string;
|
|
148
|
+
sessionTimezone: string;
|
|
149
|
+
};
|
|
150
|
+
appUrl?: string;
|
|
151
|
+
customCalendarConfig?: any;
|
|
152
|
+
chartAppAccessToken?: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface ChartConfigSection {
|
|
156
|
+
key: string;
|
|
157
|
+
label: string;
|
|
158
|
+
maxColumnCount?: number;
|
|
159
|
+
allowMeasureColumns?: boolean;
|
|
160
|
+
allowAttributeColumns?: boolean;
|
|
161
|
+
allowTimeSeriesColumns?: boolean;
|
|
162
|
+
allowMeasureNameColumn?: boolean;
|
|
163
|
+
allowMeasureValueColumn?: boolean;
|
|
164
|
+
}
|
|
165
|
+
export interface ChartConfigEditorDefinition {
|
|
166
|
+
key: string;
|
|
167
|
+
label?: string;
|
|
168
|
+
descriptionText?: string;
|
|
169
|
+
columnSections: ChartConfigSection[];
|
|
170
|
+
}
|
|
171
|
+
export type ConfigEditorDefinitionSetter = (currentState: ChartModel, ctx: CustomChartContext) => ChartConfigEditorDefinition[];
|
|
172
|
+
|
|
173
|
+
export interface InputValidation {
|
|
174
|
+
required?: boolean;
|
|
175
|
+
requiredError?: string;
|
|
176
|
+
regex?: string;
|
|
177
|
+
regexError?: string;
|
|
178
|
+
minLength?: number;
|
|
179
|
+
minLengthError?: string;
|
|
180
|
+
range?: string;
|
|
181
|
+
rangeError?: string;
|
|
182
|
+
}
|
|
183
|
+
export interface TextInputFormDetail {
|
|
184
|
+
type: 'text';
|
|
185
|
+
key: string;
|
|
186
|
+
label?: string;
|
|
187
|
+
password?: boolean;
|
|
188
|
+
multiline?: boolean;
|
|
189
|
+
placeholder?: string;
|
|
190
|
+
defaultValue?: string;
|
|
191
|
+
inputValidation?: InputValidation;
|
|
192
|
+
disabled?: boolean;
|
|
193
|
+
}
|
|
194
|
+
export interface NumberInputFormDetail {
|
|
195
|
+
type: 'number';
|
|
196
|
+
key: string;
|
|
197
|
+
label?: string;
|
|
198
|
+
defaultValue?: number;
|
|
199
|
+
inputValidation?: InputValidation;
|
|
200
|
+
disabled?: boolean;
|
|
201
|
+
}
|
|
202
|
+
export interface ColorPickerFormDetail {
|
|
203
|
+
type: 'colorpicker';
|
|
204
|
+
key: string;
|
|
205
|
+
label?: string;
|
|
206
|
+
selectorType?: 'FONT' | 'COLOR';
|
|
207
|
+
defaultValue?: string;
|
|
208
|
+
}
|
|
209
|
+
export interface ToggleFormDetail {
|
|
210
|
+
type: 'toggle';
|
|
211
|
+
key: string;
|
|
212
|
+
label?: string;
|
|
213
|
+
defaultValue?: boolean;
|
|
214
|
+
disabled?: boolean;
|
|
215
|
+
}
|
|
216
|
+
export interface CheckboxFormDetail {
|
|
217
|
+
type: 'checkbox';
|
|
218
|
+
key: string;
|
|
219
|
+
label?: string;
|
|
220
|
+
defaultValue?: boolean;
|
|
221
|
+
disabled?: boolean;
|
|
222
|
+
}
|
|
223
|
+
export interface RadioButtonFormDetail {
|
|
224
|
+
type: 'radio';
|
|
225
|
+
key: string;
|
|
226
|
+
label?: string;
|
|
227
|
+
defaultValue?: string;
|
|
228
|
+
values: string[];
|
|
229
|
+
disabled?: boolean;
|
|
230
|
+
}
|
|
231
|
+
export interface DropDownFormDetail {
|
|
232
|
+
type: 'dropdown';
|
|
233
|
+
key: string;
|
|
234
|
+
label?: string;
|
|
235
|
+
defaultValue?: string;
|
|
236
|
+
values: string[];
|
|
237
|
+
disabled?: boolean;
|
|
238
|
+
}
|
|
239
|
+
export interface Section {
|
|
240
|
+
type: 'section';
|
|
241
|
+
key: string;
|
|
242
|
+
label?: string;
|
|
243
|
+
children?: PropElement[];
|
|
244
|
+
alignment?: 'row' | 'column';
|
|
245
|
+
layoutType?: 'accordion' | 'tab' | 'none';
|
|
246
|
+
disabled?: boolean;
|
|
247
|
+
isAccordianExpanded?: boolean;
|
|
248
|
+
}
|
|
249
|
+
export type PropElement = Section | TextInputFormDetail | NumberInputFormDetail | ColorPickerFormDetail | ToggleFormDetail | CheckboxFormDetail | RadioButtonFormDetail | DropDownFormDetail;
|
|
250
|
+
export interface ColumnProp {
|
|
251
|
+
type: ColumnType;
|
|
252
|
+
columnSettingsDefinition: {
|
|
253
|
+
[columnId: string]: {
|
|
254
|
+
elements: PropElement[];
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
export interface VisualPropEditorDefinition {
|
|
259
|
+
elements: PropElement[];
|
|
260
|
+
columnsVizPropDefinition?: ColumnProp[];
|
|
261
|
+
}
|
|
262
|
+
export type VisualEditorDefinitionSetter = (currentState: ChartModel, ctx: CustomChartContext, activeColumnId?: string) => VisualPropEditorDefinition;
|
|
263
|
+
|
|
264
|
+
export enum ColumnType {
|
|
265
|
+
UNKNOWN = 0,
|
|
266
|
+
MEASURE = 1,
|
|
267
|
+
ATTRIBUTE = 2,
|
|
268
|
+
VIRTUAL = 3
|
|
269
|
+
}
|
|
270
|
+
export enum ChartSpecificColumnType {
|
|
271
|
+
UNKNOWN = 0,
|
|
272
|
+
MEASURE_NAMES = 1,
|
|
273
|
+
MEASURE_VALUES = 2
|
|
274
|
+
}
|
|
275
|
+
export enum DataType {
|
|
276
|
+
UNKNOWN = 0,
|
|
277
|
+
BOOL = 1,
|
|
278
|
+
CHAR = 2,
|
|
279
|
+
INT32 = 3,
|
|
280
|
+
INT64 = 4,
|
|
281
|
+
FLOAT = 5,
|
|
282
|
+
DOUBLE = 6,
|
|
283
|
+
DATE = 7,
|
|
284
|
+
DATE_TIME = 8,
|
|
285
|
+
TIME = 9,
|
|
286
|
+
MAX_TYPE = 10
|
|
287
|
+
}
|
|
288
|
+
export enum ColumnTimeBucket {
|
|
289
|
+
NO_BUCKET = 0,
|
|
290
|
+
DAILY = 1,
|
|
291
|
+
WEEKLY = 2,
|
|
292
|
+
MONTHLY = 3,
|
|
293
|
+
QUARTERLY = 4,
|
|
294
|
+
YEARLY = 5,
|
|
295
|
+
HOURLY = 6,
|
|
296
|
+
AUTO = 7,
|
|
297
|
+
HOUR_OF_DAY = 8,
|
|
298
|
+
DAY_OF_WEEK = 9,
|
|
299
|
+
DAY_OF_MONTH = 10,
|
|
300
|
+
DAY_OF_QUARTER = 11,
|
|
301
|
+
DAY_OF_YEAR = 12,
|
|
302
|
+
WEEK_OF_MONTH = 13,
|
|
303
|
+
WEEK_OF_QUARTER = 14,
|
|
304
|
+
WEEK_OF_YEAR = 15,
|
|
305
|
+
MONTH_OF_QUARTER = 16,
|
|
306
|
+
MONTH_OF_YEAR = 17,
|
|
307
|
+
QUARTER_OF_YEAR = 18
|
|
308
|
+
}
|
|
309
|
+
export enum FormatType {
|
|
310
|
+
NONE = 0,
|
|
311
|
+
PATTERN = 1,
|
|
312
|
+
PERCENTAGE = 2,
|
|
313
|
+
CURRENCY = 3
|
|
314
|
+
}
|
|
315
|
+
export enum CurrencyFormatType {
|
|
316
|
+
USER_LOCALE = 0,
|
|
317
|
+
COLUMN = 1,
|
|
318
|
+
ISO_CODE = 2
|
|
319
|
+
}
|
|
320
|
+
export enum ColumnAggregationType {
|
|
321
|
+
AGGREGATE = 0,
|
|
322
|
+
AGGREGATE_DISTINCT = 1,
|
|
323
|
+
APPROX_AGGR_DISTINCT = 2,
|
|
324
|
+
APPROX_AGGR_DISTINCT_MERGE = 3,
|
|
325
|
+
APPROX_COUNT_DISTINCT = 4,
|
|
326
|
+
AVERAGE = 5,
|
|
327
|
+
COUNT = 6,
|
|
328
|
+
COUNT_DISTINCT = 7,
|
|
329
|
+
CUMULATIVE_AVERAGE = 8,
|
|
330
|
+
CUMULATIVE_COUNT = 9,
|
|
331
|
+
CUMULATIVE_MAX = 10,
|
|
332
|
+
CUMULATIVE_MIN = 11,
|
|
333
|
+
CUMULATIVE_SUM = 12,
|
|
334
|
+
GROWTH = 13,
|
|
335
|
+
MAX = 14,
|
|
336
|
+
MEDIAN = 15,
|
|
337
|
+
MIN = 16,
|
|
338
|
+
MOVING_AVERAGE = 17,
|
|
339
|
+
MOVING_COUNT = 18,
|
|
340
|
+
MOVING_MAX = 19,
|
|
341
|
+
MOVING_MIN = 20,
|
|
342
|
+
MOVING_SUM = 21,
|
|
343
|
+
NONE = 22,
|
|
344
|
+
PERCENTILE = 23,
|
|
345
|
+
RANK = 24,
|
|
346
|
+
RANK_PERCENTILE = 25,
|
|
347
|
+
SQL_BOOL_AGGREGATE_OP = 26,
|
|
348
|
+
SQL_DATE_AGGREGATE_OP = 27,
|
|
349
|
+
SQL_DATE_TIME_AGGREGATE_OP = 28,
|
|
350
|
+
SQL_DOUBLE_AGGREGATE_OP = 29,
|
|
351
|
+
SQL_INT_AGGREGATE_OP = 30,
|
|
352
|
+
SQL_STRING_AGGREGATE_OP = 31,
|
|
353
|
+
SQL_TIME_AGGREGATE_OP = 32,
|
|
354
|
+
STD_DEVIATION = 33,
|
|
355
|
+
SUM = 34,
|
|
356
|
+
TABLE_AGGR = 35,
|
|
357
|
+
VARIANCE = 36
|
|
358
|
+
}
|
|
359
|
+
export interface CurrencyFormat {
|
|
360
|
+
type: CurrencyFormatType;
|
|
361
|
+
column: string;
|
|
362
|
+
isoCode: string;
|
|
363
|
+
}
|
|
364
|
+
export interface ColumnFormat {
|
|
365
|
+
type: FormatType;
|
|
366
|
+
pattern?: string;
|
|
367
|
+
currencyFormat?: CurrencyFormat;
|
|
368
|
+
}
|
|
369
|
+
export interface ChartColumn {
|
|
370
|
+
id: string;
|
|
371
|
+
name: string;
|
|
372
|
+
type: ColumnType;
|
|
373
|
+
timeBucket: ColumnTimeBucket;
|
|
374
|
+
dataType: DataType;
|
|
375
|
+
format?: ColumnFormat;
|
|
376
|
+
columnProperties?: {
|
|
377
|
+
conditionalFormatting?: Maybe<ConditionalFormatting>;
|
|
378
|
+
numberFormatting?: Maybe<FormatConfig>;
|
|
379
|
+
};
|
|
380
|
+
aggregationType?: ColumnAggregationType;
|
|
381
|
+
customOrder?: Array<string>;
|
|
382
|
+
calenderGuid?: string;
|
|
383
|
+
chartSpecificColumnType: ChartSpecificColumnType;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export enum ChartToTSEvent {
|
|
387
|
+
OpenContextMenu = "OpenContextMenu",
|
|
388
|
+
CloseContextMenu = "CloseContextMenu",
|
|
389
|
+
OpenAxisMenu = "OpenAxisMenu",
|
|
390
|
+
CloseAxisMenu = "CloseAxisMenu",
|
|
391
|
+
InitStart = "InitStart",
|
|
392
|
+
RenderStart = "RenderStart",
|
|
393
|
+
RenderError = "RenderError",
|
|
394
|
+
RenderComplete = "RenderComplete",
|
|
395
|
+
UpdateVisualProps = "UpdateVisualProps",
|
|
396
|
+
GetTMLString = "GetTMLString",
|
|
397
|
+
SetTMLString = "SetTMLString",
|
|
398
|
+
GetDataForQuery = "GetDataForQuery",
|
|
399
|
+
ShowToolTip = "ShowToolTip",
|
|
400
|
+
HideToolTip = "HideToolTip"
|
|
401
|
+
}
|
|
402
|
+
export interface ChartToTSEventsPayloadMap {
|
|
403
|
+
[ChartToTSEvent.OpenContextMenu]: [OpenContextMenuEventPayload];
|
|
404
|
+
[ChartToTSEvent.CloseContextMenu]: [];
|
|
405
|
+
[ChartToTSEvent.InitStart]: [];
|
|
406
|
+
[ChartToTSEvent.RenderStart]: [];
|
|
407
|
+
[ChartToTSEvent.RenderComplete]: [];
|
|
408
|
+
[ChartToTSEvent.RenderError]: [RenderErrorEventPayload];
|
|
409
|
+
[ChartToTSEvent.UpdateVisualProps]: [UpdateVisualPropsEventPayload];
|
|
410
|
+
[ChartToTSEvent.GetTMLString]: [];
|
|
411
|
+
[ChartToTSEvent.SetTMLString]: [SetTMLStringEventPayload];
|
|
412
|
+
[ChartToTSEvent.GetDataForQuery]: [GetDataForQueryEventPayload];
|
|
413
|
+
[ChartToTSEvent.ShowToolTip]: [ShowToolTipEventPayload];
|
|
414
|
+
[ChartToTSEvent.HideToolTip]: [];
|
|
415
|
+
[ChartToTSEvent.OpenAxisMenu]: [OpenAxisMenuEventPayload];
|
|
416
|
+
[ChartToTSEvent.CloseAxisMenu]: [];
|
|
417
|
+
}
|
|
418
|
+
export interface UpdateVisualPropsEventPayload {
|
|
419
|
+
visualProps: VisualProps;
|
|
420
|
+
}
|
|
421
|
+
export interface SetTMLStringEventPayload {
|
|
422
|
+
tmlString: string;
|
|
423
|
+
}
|
|
424
|
+
export interface PointVal {
|
|
425
|
+
columnId: string;
|
|
426
|
+
value: any;
|
|
427
|
+
}
|
|
428
|
+
export interface Point {
|
|
429
|
+
tuple: PointVal[];
|
|
430
|
+
}
|
|
431
|
+
export interface CustomAction {
|
|
432
|
+
id: string;
|
|
433
|
+
label: string;
|
|
434
|
+
icon?: string;
|
|
435
|
+
onClick: (...args: any[]) => void;
|
|
436
|
+
}
|
|
437
|
+
export interface OpenContextMenuEventPayload {
|
|
438
|
+
event: Pick<PointerEvent, 'clientX' | 'clientY'>;
|
|
439
|
+
clickedPoint: Point;
|
|
440
|
+
selectedPoints?: Point[];
|
|
441
|
+
customActions?: CustomAction[];
|
|
442
|
+
}
|
|
443
|
+
export interface ShowToolTipEventPayload {
|
|
444
|
+
event: Pick<PointerEvent, 'clientX' | 'clientY'>;
|
|
445
|
+
customTooltipContent?: string[];
|
|
446
|
+
point?: Point;
|
|
447
|
+
}
|
|
448
|
+
export interface RenderErrorEventPayload {
|
|
449
|
+
hasError: boolean;
|
|
450
|
+
error: any;
|
|
451
|
+
}
|
|
452
|
+
export interface GetDataForQueryEventPayload {
|
|
453
|
+
queries: Query[];
|
|
454
|
+
}
|
|
455
|
+
export enum ErrorType {
|
|
456
|
+
MultipleContextsNotSupported = "MultipleContextsNotSupported"
|
|
457
|
+
}
|
|
458
|
+
export enum AxisMenuActions {
|
|
459
|
+
AGGREGATE = "AGGREGATE",
|
|
460
|
+
TIME_BUCKET = "TIME_BUCKET",
|
|
461
|
+
FILTER = "FILTER",
|
|
462
|
+
SORT = "SORT",
|
|
463
|
+
SEPARATOR = "SEPARATOR"
|
|
464
|
+
}
|
|
465
|
+
export interface AxisMenuCustomAction {
|
|
466
|
+
id: string;
|
|
467
|
+
label: string;
|
|
468
|
+
icon?: string;
|
|
469
|
+
onClick: (...args: any[]) => void;
|
|
470
|
+
}
|
|
471
|
+
export interface OpenAxisMenuEventPayload {
|
|
472
|
+
event: Pick<PointerEvent, 'clientX' | 'clientY'>;
|
|
473
|
+
columnIds: string[];
|
|
474
|
+
selectedActions?: AxisMenuActions[];
|
|
475
|
+
customActions?: AxisMenuCustomAction[];
|
|
476
|
+
}
|
|
477
|
+
export interface ContextMenuActionHandler {
|
|
478
|
+
[key: string]: (args: CustomContextMenuAction) => void;
|
|
479
|
+
}
|
|
480
|
+
export interface AxisMenuActionHandler {
|
|
481
|
+
[key: string]: (args: CustomAxisMenuAction) => void;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export enum TSToChartEvent {
|
|
485
|
+
Initialize = "Initialize",
|
|
486
|
+
InitializeComplete = "InitializeComplete",
|
|
487
|
+
GetDataQuery = "GetDataQuery",
|
|
488
|
+
ChartConfigValidate = "ChartConfigValidate",
|
|
489
|
+
ChartModelUpdate = "ChartModelUpdate",
|
|
490
|
+
DataUpdate = "DataUpdate",
|
|
491
|
+
TriggerRenderChart = "TriggerRenderChart",
|
|
492
|
+
VisualPropsValidate = "VisualPropsValidate",
|
|
493
|
+
VisualPropsUpdate = "VisualPropsUpdate",
|
|
494
|
+
ContextMenuActionClick = "ContextMenuActionClick",
|
|
495
|
+
AxisMenuActionClick = "AxisMenuActionClick"
|
|
496
|
+
}
|
|
497
|
+
export interface TSToChartEventsPayloadMap {
|
|
498
|
+
[TSToChartEvent.ChartModelUpdate]: (payload: ChartModelUpdateEventPayload) => void;
|
|
499
|
+
[TSToChartEvent.DataUpdate]: (payload: DataUpdateEventPayload) => void;
|
|
500
|
+
[TSToChartEvent.VisualPropsUpdate]: (payload: VisualPropsUpdateEventPayload) => void;
|
|
501
|
+
}
|
|
502
|
+
export interface TSToChartInternalEventsPayloadMap {
|
|
503
|
+
[TSToChartEvent.Initialize]: (payload: InitializeEventPayload) => InitializeEventResponsePayload;
|
|
504
|
+
[TSToChartEvent.InitializeComplete]: () => void;
|
|
505
|
+
[TSToChartEvent.GetDataQuery]: (payload: GetDataQueryPayload) => GetDataQueryResponsePayload;
|
|
506
|
+
[TSToChartEvent.ChartConfigValidate]: (payload: ChartConfigValidateEventPayload) => ValidationResponse;
|
|
507
|
+
[TSToChartEvent.VisualPropsValidate]: (payload: VisualPropsValidateEventPayload) => ValidationResponse;
|
|
508
|
+
[TSToChartEvent.TriggerRenderChart]: () => void;
|
|
509
|
+
[TSToChartEvent.ContextMenuActionClick]: (payload: ContextMenuCustomActionPayload) => void;
|
|
510
|
+
[TSToChartEvent.AxisMenuActionClick]: (payload: AxisMenuCustomActionPayload) => void;
|
|
511
|
+
}
|
|
512
|
+
export interface InitializeEventPayload {
|
|
513
|
+
chartModel: ChartModel;
|
|
514
|
+
appConfig?: AppConfig;
|
|
515
|
+
componentId: string;
|
|
516
|
+
hostUrl: string;
|
|
517
|
+
containerElSelector: string;
|
|
518
|
+
}
|
|
519
|
+
export interface InitializeEventResponsePayload {
|
|
520
|
+
isConfigValid: boolean;
|
|
521
|
+
defaultChartConfig: ChartConfig[];
|
|
522
|
+
chartConfigEditorDefinition?: ChartConfigEditorDefinition[];
|
|
523
|
+
visualPropEditorDefinition?: VisualPropEditorDefinition;
|
|
524
|
+
allowedConfigurations?: AllowedConfigurations;
|
|
525
|
+
chartConfigParameters?: ChartConfigParameters;
|
|
526
|
+
}
|
|
527
|
+
export interface GetDataQueryPayload {
|
|
528
|
+
config: ChartConfig[];
|
|
529
|
+
}
|
|
530
|
+
export interface QueryColumn extends ChartColumn {
|
|
531
|
+
isMeasureValue?: boolean;
|
|
532
|
+
}
|
|
533
|
+
export interface Query {
|
|
534
|
+
queryColumns: QueryColumn[];
|
|
535
|
+
queryParams?: {
|
|
536
|
+
offset?: number;
|
|
537
|
+
size?: number;
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
export interface GetDataQueryResponsePayload {
|
|
541
|
+
queries: Query[];
|
|
542
|
+
}
|
|
543
|
+
export interface ChartModelUpdateEventPayload {
|
|
544
|
+
chartModel: ChartModel;
|
|
545
|
+
}
|
|
546
|
+
export interface DataUpdateEventPayload {
|
|
547
|
+
data: QueryData[];
|
|
548
|
+
}
|
|
549
|
+
export interface VisualPropsUpdateEventPayload {
|
|
550
|
+
visualProps: VisualProps;
|
|
551
|
+
}
|
|
552
|
+
export interface VisualPropsValidateEventPayload {
|
|
553
|
+
visualProps: VisualProps;
|
|
554
|
+
activeColumnId?: string;
|
|
555
|
+
}
|
|
556
|
+
export interface ChartConfigValidateEventPayload {
|
|
557
|
+
chartConfig: ChartConfig[];
|
|
558
|
+
}
|
|
559
|
+
export interface CustomContextMenuAction {
|
|
560
|
+
id: string;
|
|
561
|
+
clickedPoint: Point;
|
|
562
|
+
selectedPoints?: Point[];
|
|
563
|
+
event: Pick<PointerEvent, 'clientX' | 'clientY'>;
|
|
564
|
+
}
|
|
565
|
+
export interface ContextMenuCustomActionPayload {
|
|
566
|
+
customAction: CustomContextMenuAction;
|
|
567
|
+
}
|
|
568
|
+
export interface CustomAxisMenuAction {
|
|
569
|
+
id: string;
|
|
570
|
+
columnIds: string[];
|
|
571
|
+
event: Pick<PointerEvent, 'clientX' | 'clientY'>;
|
|
572
|
+
}
|
|
573
|
+
export interface AxisMenuCustomActionPayload {
|
|
574
|
+
customAction: CustomAxisMenuAction;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export type AllowedConfigurations = {
|
|
578
|
+
allowColumnNumberFormatting?: boolean;
|
|
579
|
+
allowColumnConditionalFormatting?: boolean;
|
|
580
|
+
allowMeasureNamesAndValues?: boolean;
|
|
581
|
+
};
|
|
582
|
+
export type ChartConfigParameters = {
|
|
583
|
+
measureNameValueColumns?: {
|
|
584
|
+
enableMeasureNameColumn?: boolean;
|
|
585
|
+
enableMeasureValueColumn?: boolean;
|
|
586
|
+
measureNameColumnAlias?: string;
|
|
587
|
+
measureValueColumnAlias?: string;
|
|
588
|
+
};
|
|
589
|
+
batchSizeLimit?: number;
|
|
590
|
+
};
|
|
591
|
+
export type CustomChartContextProps = {
|
|
592
|
+
getDefaultChartConfig: (chartModel: ChartModel) => ChartConfig[];
|
|
593
|
+
getQueriesFromChartConfig: (chartConfig: ChartConfig[], chartModel: ChartModel) => Query[];
|
|
594
|
+
renderChart: (ctx: CustomChartContext) => Promise<void>;
|
|
595
|
+
validateConfig?: (updatedConfig: ChartConfig[], chartModel: ChartModel) => ValidationResponse;
|
|
596
|
+
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel, activeColumnId?: string) => ValidationResponse;
|
|
597
|
+
chartConfigEditorDefinition?: ConfigEditorDefinitionSetter | ChartConfigEditorDefinition[];
|
|
598
|
+
visualPropEditorDefinition?: VisualEditorDefinitionSetter | VisualPropEditorDefinition;
|
|
599
|
+
allowedConfigurations?: AllowedConfigurations;
|
|
600
|
+
chartConfigParameters?: ChartConfigParameters;
|
|
601
|
+
};
|
|
602
|
+
export type ValidationFunctions = CustomChartContextProps['validateVisualProps'] | CustomChartContextProps['validateConfig'];
|
|
603
|
+
export class CustomChartContext {
|
|
604
|
+
containerEl: HTMLElement | null;
|
|
605
|
+
constructor(chartContextProps: CustomChartContextProps);
|
|
606
|
+
initialize: () => Promise<void>;
|
|
607
|
+
on<T extends keyof TSToChartEventsPayloadMap>(eventType: T, callbackFn: TSToChartEventsPayloadMap[T]): void;
|
|
608
|
+
off<T extends keyof TSToChartEventsPayloadMap>(eventType: T): void;
|
|
609
|
+
destroy(): void;
|
|
610
|
+
getChartModel: () => ChartModel;
|
|
611
|
+
getAppConfig: () => AppConfig;
|
|
612
|
+
contextMenuCustomActionPreProcessor(eventPayload: [OpenContextMenuEventPayload]): [OpenContextMenuEventPayload];
|
|
613
|
+
axisMenuCustomActionPreProcessor(eventPayload: [OpenAxisMenuEventPayload]): [OpenAxisMenuEventPayload];
|
|
614
|
+
emitEvent<T extends keyof ChartToTSEventsPayloadMap>(eventType: T, ...eventPayload: ChartToTSEventsPayloadMap[T]): Promise<any>;
|
|
615
|
+
}
|
|
616
|
+
export const getChartContext: (customChartConfig: CustomChartContextProps) => Promise<CustomChartContext>;
|
|
617
|
+
|
|
618
|
+
export const useChartContext: (props: Omit<CustomChartContextProps, 'renderChart'>) => ChartContextProps;
|
|
619
|
+
|
|
620
|
+
export type ConditionalFormatting = {
|
|
621
|
+
__typename?: 'ConditionalFormatting';
|
|
622
|
+
rows?: Maybe<Array<Maybe<ConditionalMetric>>>;
|
|
623
|
+
};
|
|
624
|
+
export enum BackgroundFormatTypes {
|
|
625
|
+
Gradient = "GRADIENT",
|
|
626
|
+
Solid = "SOLID"
|
|
627
|
+
}
|
|
628
|
+
export enum ConditionalFormattingComparisonTypes {
|
|
629
|
+
ColumnBased = "COLUMN_BASED",
|
|
630
|
+
ParameterBased = "PARAMETER_BASED",
|
|
631
|
+
ValueBased = "VALUE_BASED"
|
|
632
|
+
}
|
|
633
|
+
export type FontAttrs = {
|
|
634
|
+
__typename?: 'FontAttrs';
|
|
635
|
+
bold?: Maybe<Scalars['Boolean']>;
|
|
636
|
+
color?: Maybe<Scalars['String']>;
|
|
637
|
+
italic?: Maybe<Scalars['Boolean']>;
|
|
638
|
+
strikeThrough?: Maybe<Scalars['Boolean']>;
|
|
639
|
+
underline?: Maybe<Scalars['Boolean']>;
|
|
640
|
+
};
|
|
641
|
+
export type GradientBackgroundAttrs = {
|
|
642
|
+
__typename?: 'GradientBackgroundAttrs';
|
|
643
|
+
backgroundFormatMidpoint?: Maybe<Scalars['Float']>;
|
|
644
|
+
backgroundFormatRange?: Maybe<Array<Maybe<Scalars['Float']>>>;
|
|
645
|
+
colors?: Maybe<Array<Maybe<Scalars['String']>>>;
|
|
646
|
+
};
|
|
647
|
+
export enum Operators {
|
|
648
|
+
Contains = "CONTAINS",
|
|
649
|
+
DoesNotContain = "DOES_NOT_CONTAIN",
|
|
650
|
+
EndsWith = "ENDS_WITH",
|
|
651
|
+
EqualTo = "EQUAL_TO",
|
|
652
|
+
GreaterThan = "GREATER_THAN",
|
|
653
|
+
GreaterThanEqualTo = "GREATER_THAN_EQUAL_TO",
|
|
654
|
+
Is = "IS",
|
|
655
|
+
IsBetween = "IS_BETWEEN",
|
|
656
|
+
IsEmpty = "IS_EMPTY",
|
|
657
|
+
IsNot = "IS_NOT",
|
|
658
|
+
IsNotEmpty = "IS_NOT_EMPTY",
|
|
659
|
+
IsNotNull = "IS_NOT_NULL",
|
|
660
|
+
IsNull = "IS_NULL",
|
|
661
|
+
LessThan = "LESS_THAN",
|
|
662
|
+
LessThanEqualTo = "LESS_THAN_EQUAL_TO",
|
|
663
|
+
NotEqualTo = "NOT_EQUAL_TO",
|
|
664
|
+
StartsWith = "STARTS_WITH"
|
|
665
|
+
}
|
|
666
|
+
export type SolidBackgroundAttrs = {
|
|
667
|
+
__typename?: 'SolidBackgroundAttrs';
|
|
668
|
+
color?: Maybe<Scalars['String']>;
|
|
669
|
+
};
|
|
670
|
+
export type Range = {
|
|
671
|
+
__typename?: 'Range';
|
|
672
|
+
max?: Maybe<Scalars['Float']>;
|
|
673
|
+
min?: Maybe<Scalars['Float']>;
|
|
674
|
+
};
|
|
675
|
+
export type ConditionalMetric = {
|
|
676
|
+
__typename?: 'ConditionalMetric';
|
|
677
|
+
backgroundFormatType?: Maybe<BackgroundFormatTypes>;
|
|
678
|
+
comparisonParameterId?: Maybe<Scalars['String']>;
|
|
679
|
+
comparisonType?: Maybe<ConditionalFormattingComparisonTypes>;
|
|
680
|
+
fontProperties?: Maybe<FontAttrs>;
|
|
681
|
+
gradientBackgroundAttrs?: Maybe<GradientBackgroundAttrs>;
|
|
682
|
+
isHighlightRow?: Maybe<Scalars['Boolean']>;
|
|
683
|
+
lhsColumnId?: Maybe<Scalars['String']>;
|
|
684
|
+
operator?: Maybe<Operators>;
|
|
685
|
+
plotAsBand?: Maybe<Scalars['Boolean']>;
|
|
686
|
+
rangeValues?: Maybe<Range>;
|
|
687
|
+
rhsColumnId?: Maybe<Scalars['String']>;
|
|
688
|
+
solidBackgroundAttrs?: Maybe<SolidBackgroundAttrs>;
|
|
689
|
+
value?: Maybe<Scalars['String']>;
|
|
690
|
+
};
|
|
691
|
+
export type Parameter = {
|
|
692
|
+
__typename?: 'Parameter';
|
|
693
|
+
dataType: FalconDataType;
|
|
694
|
+
defaultValue: Scalars['String'];
|
|
695
|
+
description: Scalars['String'];
|
|
696
|
+
id: Scalars['GUID'];
|
|
697
|
+
name: Scalars['String'];
|
|
698
|
+
overrideValue?: Maybe<Scalars['String']>;
|
|
699
|
+
owner: ParameterOwnerInfo;
|
|
700
|
+
valueList?: Maybe<Array<ParameterValueListItem>>;
|
|
701
|
+
valueRange?: Maybe<ParameterValueRange>;
|
|
702
|
+
valueType: ParameterValueType;
|
|
703
|
+
};
|
|
704
|
+
export enum FalconDataType {
|
|
705
|
+
Bool = "BOOL",
|
|
706
|
+
Char = "CHAR",
|
|
707
|
+
Date = "DATE",
|
|
708
|
+
DateTime = "DATE_TIME",
|
|
709
|
+
Double = "DOUBLE",
|
|
710
|
+
Float = "FLOAT",
|
|
711
|
+
Int32 = "INT32",
|
|
712
|
+
Int64 = "INT64",
|
|
713
|
+
List = "LIST",
|
|
714
|
+
ListBool = "LIST_BOOL",
|
|
715
|
+
ListDate = "LIST_DATE",
|
|
716
|
+
ListDateTime = "LIST_DATE_TIME",
|
|
717
|
+
ListDouble = "LIST_DOUBLE",
|
|
718
|
+
ListInt = "LIST_INT",
|
|
719
|
+
ListString = "LIST_STRING",
|
|
720
|
+
ListTime = "LIST_TIME",
|
|
721
|
+
MaxType = "MAX_TYPE",
|
|
722
|
+
Time = "TIME",
|
|
723
|
+
Unknown = "UNKNOWN"
|
|
724
|
+
}
|
|
725
|
+
export type ParameterOwnerInfo = {
|
|
726
|
+
__typename?: 'ParameterOwnerInfo';
|
|
727
|
+
id: Scalars['GUID'];
|
|
728
|
+
name: Scalars['String'];
|
|
729
|
+
type: ParameterOwnerType;
|
|
730
|
+
};
|
|
731
|
+
export enum ParameterOwnerType {
|
|
732
|
+
Answer = "ANSWER",
|
|
733
|
+
Worksheet = "WORKSHEET"
|
|
734
|
+
}
|
|
735
|
+
export type ParameterValueListItem = {
|
|
736
|
+
__typename?: 'ParameterValueListItem';
|
|
737
|
+
displayAs?: Maybe<Scalars['String']>;
|
|
738
|
+
value: Scalars['String'];
|
|
739
|
+
};
|
|
740
|
+
export type ParameterValueListItemInput = {
|
|
741
|
+
displayAs?: InputMaybe<Scalars['String']>;
|
|
742
|
+
value: Scalars['String'];
|
|
743
|
+
};
|
|
744
|
+
export type ParameterValueRange = {
|
|
745
|
+
__typename?: 'ParameterValueRange';
|
|
746
|
+
max?: Maybe<Scalars['Float']>;
|
|
747
|
+
min?: Maybe<Scalars['Float']>;
|
|
748
|
+
};
|
|
749
|
+
export type ParameterValueRangeInput = {
|
|
750
|
+
max?: InputMaybe<Scalars['Float']>;
|
|
751
|
+
min?: InputMaybe<Scalars['Float']>;
|
|
752
|
+
};
|
|
753
|
+
export enum ParameterValueType {
|
|
754
|
+
Any = "ANY",
|
|
755
|
+
List = "LIST",
|
|
756
|
+
Range = "RANGE"
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
export enum CategoryType {
|
|
760
|
+
Currency = "CURRENCY",
|
|
761
|
+
Custom = "CUSTOM",
|
|
762
|
+
Number = "NUMBER",
|
|
763
|
+
Percentage = "PERCENTAGE"
|
|
764
|
+
}
|
|
765
|
+
export enum Unit {
|
|
766
|
+
Auto = "AUTO",
|
|
767
|
+
Billion = "BILLION",
|
|
768
|
+
Million = "MILLION",
|
|
769
|
+
None = "NONE",
|
|
770
|
+
Thousands = "THOUSANDS",
|
|
771
|
+
Trillion = "TRILLION"
|
|
772
|
+
}
|
|
773
|
+
export enum NegativeValueFormat {
|
|
774
|
+
BracesNodash = "BRACES_NODASH",
|
|
775
|
+
PrefixDash = "PREFIX_DASH",
|
|
776
|
+
SuffixDash = "SUFFIX_DASH"
|
|
777
|
+
}
|
|
778
|
+
export type CurrencyFormatConfig = {
|
|
779
|
+
__typename?: 'CurrencyFormatConfig';
|
|
780
|
+
decimals?: Maybe<Scalars['Float']>;
|
|
781
|
+
locale?: Maybe<Scalars['String']>;
|
|
782
|
+
removeTrailingZeroes?: Maybe<Scalars['Boolean']>;
|
|
783
|
+
toSeparateThousands?: Maybe<Scalars['Boolean']>;
|
|
784
|
+
unit?: Maybe<Unit>;
|
|
785
|
+
};
|
|
786
|
+
export type CustomFormatConfig = {
|
|
787
|
+
__typename?: 'CustomFormatConfig';
|
|
788
|
+
format?: Maybe<Scalars['String']>;
|
|
789
|
+
};
|
|
790
|
+
export type NumberFormatConfig = {
|
|
791
|
+
__typename?: 'NumberFormatConfig';
|
|
792
|
+
decimals?: Maybe<Scalars['Float']>;
|
|
793
|
+
negativeValueFormat?: Maybe<NegativeValueFormat>;
|
|
794
|
+
removeTrailingZeroes?: Maybe<Scalars['Boolean']>;
|
|
795
|
+
toSeparateThousands?: Maybe<Scalars['Boolean']>;
|
|
796
|
+
unit?: Maybe<Unit>;
|
|
797
|
+
};
|
|
798
|
+
export type PercentageFormatConfig = {
|
|
799
|
+
__typename?: 'PercentageFormatConfig';
|
|
800
|
+
decimals?: Maybe<Scalars['Float']>;
|
|
801
|
+
removeTrailingZeroes?: Maybe<Scalars['Boolean']>;
|
|
802
|
+
};
|
|
803
|
+
export type FormatConfig = {
|
|
804
|
+
__typename?: 'FormatConfig';
|
|
805
|
+
category?: Maybe<CategoryType>;
|
|
806
|
+
currencyFormatConfig?: Maybe<CurrencyFormatConfig>;
|
|
807
|
+
customFormatConfig?: Maybe<CustomFormatConfig>;
|
|
808
|
+
isCategoryEditable?: Maybe<Scalars['Boolean']>;
|
|
809
|
+
numberFormatConfig?: Maybe<NumberFormatConfig>;
|
|
810
|
+
percentageFormatConfig?: Maybe<PercentageFormatConfig>;
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
export interface CustomCalendarDate {
|
|
814
|
+
v: {
|
|
815
|
+
s: number;
|
|
816
|
+
e: number;
|
|
817
|
+
};
|
|
818
|
+
d: string;
|
|
819
|
+
}
|
|
820
|
+
export const dateFormatPresets: {
|
|
821
|
+
DATE_SHORT: string;
|
|
822
|
+
DATE_SHORT_WITH_HOUR: string;
|
|
823
|
+
DATE_SHORT_WITH_HOUR_WITHOUT_YEAR: string;
|
|
824
|
+
DATETIME_SHORT: string;
|
|
825
|
+
DATETIME_SHORT_WITHOUT_YEAR: string;
|
|
826
|
+
DATETIME_SHORT_WITH_SECONDS: string;
|
|
827
|
+
DATETIME_SHORT_WITH_MILLIS: string;
|
|
828
|
+
MONTH_WITH_YEAR: string;
|
|
829
|
+
QUARTER_WITH_YEAR: string;
|
|
830
|
+
QUARTER_WITH_2_DIGIT_YEAR: string;
|
|
831
|
+
DEFAULT_TIME_FORMAT: string;
|
|
832
|
+
TIME_24_WITH_SECONDS: string;
|
|
833
|
+
DATE_SHORT_2_DIGIT_YEAR: string;
|
|
834
|
+
DATETIME_24_SHORT_WITHOUT_YEAR: string;
|
|
835
|
+
DATETIME_24_SHORT: string;
|
|
836
|
+
DATETIME_SHORT_WITH_SECONDS_WITHOUT_YEAR: string;
|
|
837
|
+
DATETIME_SHORT_WITH_MILLIS_WITHOUT_YEAR: string;
|
|
838
|
+
DATETIME_24_SHORT_WITH_MILLIS_WITHOUT_YEAR: string;
|
|
839
|
+
DATETIME_24_SHORT_WITH_MILLIS: string;
|
|
840
|
+
MONTH_WITH_DAY_AND_YEAR: string;
|
|
841
|
+
MONTH_WITH_2_DIGIT_YEAR: string;
|
|
842
|
+
DAY_WITH_MONTH_NUM: string;
|
|
843
|
+
DATE_SHORT_WITH_HOUR_24_WITHOUT_YEAR: string;
|
|
844
|
+
DATE_SHORT_WITH_HOUR_24: string;
|
|
845
|
+
QUARTER: string;
|
|
846
|
+
MONTH_ONLY: string;
|
|
847
|
+
DATETIME_WITH_SHORT_OFFSET: string;
|
|
848
|
+
};
|
|
849
|
+
export const dateNumTypes: {
|
|
850
|
+
DATE_NUM_ABS_DAY: string;
|
|
851
|
+
DATE_NUM_ABS_MONTH: string;
|
|
852
|
+
DATE_NUM_ABS_QUARTER: string;
|
|
853
|
+
DATE_NUM_ABS_YEAR: string;
|
|
854
|
+
DATE_NUM_DAY_IN_MONTH: string;
|
|
855
|
+
DATE_NUM_DAY_IN_QUARTER: string;
|
|
856
|
+
DATE_NUM_DAY_IN_YEAR: string;
|
|
857
|
+
DATE_NUM_DAY_OF_WEEK: string;
|
|
858
|
+
DATE_NUM_MONTH_IN_QUARTER: string;
|
|
859
|
+
DATE_NUM_MONTH_IN_YEAR: string;
|
|
860
|
+
DATE_NUM_QUARTER_IN_YEAR: string;
|
|
861
|
+
DATE_NUM_WEEK_IN_YEAR: string;
|
|
862
|
+
DATE_NUM_WEEK_IN_QUARTER: string;
|
|
863
|
+
DATE_NUM_WEEK_IN_MONTH: string;
|
|
864
|
+
DATE_NUM_HOUR_IN_DAY: string;
|
|
865
|
+
};
|
|
866
|
+
export const bucketizationToDatePreset: {
|
|
867
|
+
HOURLY: string;
|
|
868
|
+
DAILY: string;
|
|
869
|
+
WEEKLY: string;
|
|
870
|
+
MONTHLY: string;
|
|
871
|
+
QUARTERLY: string;
|
|
872
|
+
YEARLY: string;
|
|
873
|
+
};
|
|
874
|
+
export const timeBuckets: {
|
|
875
|
+
NO_BUCKET: string;
|
|
876
|
+
HOURLY: string;
|
|
877
|
+
DAILY: string;
|
|
878
|
+
WEEKLY: string;
|
|
879
|
+
MONTHLY: string;
|
|
880
|
+
QUARTERLY: string;
|
|
881
|
+
YEARLY: string;
|
|
882
|
+
DAY_OF_WEEK: string;
|
|
883
|
+
DAY_OF_MONTH: string;
|
|
884
|
+
DAY_OF_QUARTER: string;
|
|
885
|
+
DAY_OF_YEAR: string;
|
|
886
|
+
WEEK_OF_MONTH: string;
|
|
887
|
+
WEEK_OF_QUARTER: string;
|
|
888
|
+
WEEK_OF_YEAR: string;
|
|
889
|
+
MONTH_OF_QUARTER: string;
|
|
890
|
+
MONTH_OF_YEAR: string;
|
|
891
|
+
QUARTER_OF_YEAR: string;
|
|
892
|
+
};
|
|
893
|
+
export const isDateColumn: (col: ChartColumn) => boolean;
|
|
894
|
+
export const isAttribute: (col: ChartColumn) => boolean;
|
|
895
|
+
export const isDateTimeColumn: (col: ChartColumn) => boolean;
|
|
896
|
+
export const getCustomCalendarGuidFromColumn: (col: ChartColumn) => string | undefined;
|
|
897
|
+
export const isDateNumColumn: (col: ChartColumn) => boolean;
|
|
898
|
+
export const isDateFamilyColumn: (col: ChartColumn) => boolean;
|
|
899
|
+
export const isTimeColumn: (col: ChartColumn) => boolean;
|
|
900
|
+
export const getEffectiveDateNumDataType: (col: ChartColumn) => string | undefined;
|
|
901
|
+
export const hasCustomCalendar: (col: ChartColumn) => boolean;
|
|
902
|
+
export function getStartEpoch(date: CustomCalendarDate): number | null;
|
|
903
|
+
export const assignQuarterValueToString: (quarter_of_year: any, value: any) => any;
|
|
904
|
+
export function getMonthOfYear(num: any, quarterStartMonth: any, monthOfYear: any): any;
|
|
905
|
+
export function getDisplayString(date: CustomCalendarDate): string | null;
|
|
906
|
+
export const useQuarterStart: (luxonDate: any, quarterStartMonth: any) => any;
|
|
907
|
+
export const getCustomCalendarValueFromEpoch: (col: ChartColumn, dateEpoch: number, displayToCustomCalendarValueMap: any) => any;
|
|
908
|
+
export function getSpecialFormatData(value: string | number, options: any): any;
|
|
909
|
+
export function sanitizeDate(inputDate: string | number, format: string, options: any): any;
|
|
910
|
+
export const formatDateTime: (epochMillis: number, format: string, useSystemCalendar?: boolean, options?: any) => any;
|
|
911
|
+
export function getOrdinalSuffixedValue(i: number | string): string;
|
|
912
|
+
export function formatDateNum(effectiveDataType: string | undefined, value: number | string, formatPattern: string, options: any): any;
|
|
913
|
+
export function formatDate(inputDate: number | string, format: string, useSystemCalendar: boolean, options: any): string;
|
|
914
|
+
|
|
915
|
+
export const getMinRangeValue: (metric: ConditionalMetric) => number | undefined | null;
|
|
916
|
+
export const getMaxRangeValue: (metric: ConditionalMetric) => number | undefined | null;
|
|
917
|
+
export const isConditionSatisfied: (metric: ConditionalMetric, parameters?: Parameter[], lhsColValue?: string | number | null, rhsColValue?: string | number | null) => boolean;
|
|
918
|
+
export function validateCfCondition(conditionalMetric: ConditionalMetric, index: number, columnId: string, dataAttr?: DataPointsArray, inScopeParameters?: Parameter[]): boolean;
|
|
919
|
+
export const applicableConditionalFormatting: (idx: number, columnId: string, dataArr: DataPointsArray, conditionalFormatting?: ConditionalFormatting) => ConditionalMetric | null;
|
|
920
|
+
export function getCfForColumn(column: ChartColumn): ConditionalFormatting | undefined;
|
|
921
|
+
|
|
922
|
+
export type ChartToTSEventEmitters = {
|
|
923
|
+
[key in keyof ChartToTSEventsPayloadMap as `emit${Capitalize<key>}`]: (...args: ChartToTSEventsPayloadMap[key]) => Promise<void>;
|
|
924
|
+
};
|
|
925
|
+
export type TSToChartEventListener = {
|
|
926
|
+
[key in keyof TSToChartEventsPayloadMap as `setOn${Capitalize<key>}`]: (args: TSToChartEventsPayloadMap[key]) => Promise<void>;
|
|
927
|
+
};
|
|
928
|
+
export type TSToChartEventOffListener = {
|
|
929
|
+
[key in keyof TSToChartEventsPayloadMap as `setOff${Capitalize<key>}`]: () => Promise<void>;
|
|
930
|
+
};
|
|
931
|
+
export interface TSChartContextProps {
|
|
932
|
+
children: React.ReactNode;
|
|
933
|
+
}
|
|
934
|
+
export interface ChartContextProps extends ChartToTSEventEmitters, TSToChartEventListener, TSToChartEventOffListener {
|
|
935
|
+
hasInitialized: boolean;
|
|
936
|
+
chartModel: ChartModel | undefined;
|
|
937
|
+
destroy: () => void;
|
|
938
|
+
TSChartContext: ({ children }: TSChartContextProps) => React.JSX.Element;
|
|
939
|
+
}
|
|
940
|
+
|