@thoughtspot/ts-chart-sdk 0.0.1-alpha.9 → 0.0.2-alpha.10
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/dist/ts-chart-sdk.d.ts +449 -31
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/main/custom-chart-context.d.ts +17 -5
- package/lib/main/custom-chart-context.d.ts.map +1 -1
- package/lib/main/custom-chart-context.js +74 -34
- package/lib/main/custom-chart-context.js.map +1 -1
- package/lib/main/custom-chart-context.spec.js +256 -257
- package/lib/main/custom-chart-context.spec.js.map +1 -1
- package/lib/main/post-message-event-bridge.d.ts +3 -3
- package/lib/main/post-message-event-bridge.d.ts.map +1 -1
- package/lib/main/post-message-event-bridge.js +24 -36
- package/lib/main/post-message-event-bridge.js.map +1 -1
- package/lib/main/post-message-event-bridge.spec.js +0 -2
- package/lib/main/post-message-event-bridge.spec.js.map +1 -1
- package/lib/main/util.d.ts +2 -0
- package/lib/main/util.d.ts.map +1 -0
- package/lib/main/util.js +9 -0
- package/lib/main/util.js.map +1 -0
- package/lib/react/use-custom-chart-context.spec.js +128 -121
- 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 +54 -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/common.types.d.ts +51 -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 +155 -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/ts-to-chart-event.types.d.ts +3 -0
- 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 +3 -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 +19 -0
- package/lib/utils/date-formatting.d.ts.map +1 -0
- package/lib/utils/date-formatting.js +56 -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 +124 -0
- package/lib/utils/date-formatting.spec.js.map +1 -0
- package/package.json +10 -7
- package/src/index.ts +3 -0
- package/src/main/custom-chart-context.spec.ts +291 -266
- package/src/main/custom-chart-context.ts +164 -46
- package/src/main/post-message-event-bridge.spec.ts +0 -3
- package/src/main/post-message-event-bridge.ts +36 -62
- package/src/main/util.ts +11 -0
- package/src/react/use-custom-chart-context.spec.tsx +149 -122
- package/src/test/test-conditional-formatting-utils.ts +95 -0
- package/src/types/answer-column.types.ts +98 -0
- package/src/types/common.types.ts +82 -10
- package/src/types/conditional-formatting.types.ts +172 -0
- package/src/types/configurator.types.ts +21 -0
- package/src/types/ts-to-chart-event.types.ts +15 -0
- package/src/types/visual-prop.types.ts +7 -0
- 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 +168 -0
- package/src/utils/date-formatting.ts +109 -0
- package/cjs/index.d.ts +0 -9
- package/cjs/index.d.ts.map +0 -1
- package/cjs/index.js +0 -25
- package/cjs/index.js.map +0 -1
- package/cjs/main/custom-chart-context.d.ts +0 -47
- package/cjs/main/custom-chart-context.d.ts.map +0 -1
- package/cjs/main/custom-chart-context.js +0 -326
- package/cjs/main/custom-chart-context.js.map +0 -1
- package/cjs/main/custom-chart-context.spec.d.ts +0 -2
- package/cjs/main/custom-chart-context.spec.d.ts.map +0 -1
- package/cjs/main/custom-chart-context.spec.js +0 -699
- package/cjs/main/custom-chart-context.spec.js.map +0 -1
- package/cjs/main/post-message-event-bridge.d.ts +0 -6
- package/cjs/main/post-message-event-bridge.d.ts.map +0 -1
- package/cjs/main/post-message-event-bridge.js +0 -46
- package/cjs/main/post-message-event-bridge.js.map +0 -1
- package/cjs/main/post-message-event-bridge.spec.d.ts +0 -2
- package/cjs/main/post-message-event-bridge.spec.d.ts.map +0 -1
- package/cjs/main/post-message-event-bridge.spec.js +0 -124
- package/cjs/main/post-message-event-bridge.spec.js.map +0 -1
- package/cjs/react/custom-chart-context-service.d.ts +0 -33
- package/cjs/react/custom-chart-context-service.d.ts.map +0 -1
- package/cjs/react/custom-chart-context-service.js +0 -118
- package/cjs/react/custom-chart-context-service.js.map +0 -1
- package/cjs/react/custom-chart.context.d.ts +0 -26
- package/cjs/react/custom-chart.context.d.ts.map +0 -1
- package/cjs/react/custom-chart.context.js +0 -105
- package/cjs/react/custom-chart.context.js.map +0 -1
- package/cjs/react/custom-chart.spec.d.ts +0 -2
- package/cjs/react/custom-chart.spec.d.ts.map +0 -1
- package/cjs/react/custom-chart.spec.js +0 -72
- package/cjs/react/custom-chart.spec.js.map +0 -1
- package/cjs/react/mocks/custom-chart-context-mock.d.ts +0 -3
- package/cjs/react/mocks/custom-chart-context-mock.d.ts.map +0 -1
- package/cjs/react/mocks/custom-chart-context-mock.js +0 -100
- package/cjs/react/mocks/custom-chart-context-mock.js.map +0 -1
- package/cjs/react/use-custom-chart-context.d.ts +0 -4
- package/cjs/react/use-custom-chart-context.d.ts.map +0 -1
- package/cjs/react/use-custom-chart-context.js +0 -95
- package/cjs/react/use-custom-chart-context.js.map +0 -1
- package/cjs/react/use-custom-chart-context.spec.d.ts +0 -2
- package/cjs/react/use-custom-chart-context.spec.d.ts.map +0 -1
- package/cjs/react/use-custom-chart-context.spec.js +0 -391
- package/cjs/react/use-custom-chart-context.spec.js.map +0 -1
- package/cjs/react/use-custom-chart-context.util.d.ts +0 -6
- package/cjs/react/use-custom-chart-context.util.d.ts.map +0 -1
- package/cjs/react/use-custom-chart-context.util.js +0 -60
- package/cjs/react/use-custom-chart-context.util.js.map +0 -1
- package/cjs/react/use-custom-chart-types.d.ts +0 -23
- package/cjs/react/use-custom-chart-types.d.ts.map +0 -1
- package/cjs/react/use-custom-chart-types.js +0 -3
- package/cjs/react/use-custom-chart-types.js.map +0 -1
- package/cjs/test/test-utils.d.ts +0 -7
- package/cjs/test/test-utils.d.ts.map +0 -1
- package/cjs/test/test-utils.js +0 -14
- package/cjs/test/test-utils.js.map +0 -1
- package/cjs/types/answer-column.types.d.ts +0 -69
- package/cjs/types/answer-column.types.d.ts.map +0 -1
- package/cjs/types/answer-column.types.js +0 -59
- package/cjs/types/answer-column.types.js.map +0 -1
- package/cjs/types/chart-to-ts-event.types.d.ts +0 -98
- package/cjs/types/chart-to-ts-event.types.d.ts.map +0 -1
- package/cjs/types/chart-to-ts-event.types.js +0 -32
- package/cjs/types/chart-to-ts-event.types.js.map +0 -1
- package/cjs/types/common.types.d.ts +0 -51
- package/cjs/types/common.types.d.ts.map +0 -1
- package/cjs/types/common.types.js +0 -3
- package/cjs/types/common.types.js.map +0 -1
- package/cjs/types/configurator.types.d.ts +0 -15
- package/cjs/types/configurator.types.d.ts.map +0 -1
- package/cjs/types/configurator.types.js +0 -3
- package/cjs/types/configurator.types.js.map +0 -1
- package/cjs/types/ts-to-chart-event.types.d.ts +0 -91
- package/cjs/types/ts-to-chart-event.types.d.ts.map +0 -1
- package/cjs/types/ts-to-chart-event.types.js +0 -18
- package/cjs/types/ts-to-chart-event.types.js.map +0 -1
- package/cjs/types/visual-prop.types.d.ts +0 -73
- package/cjs/types/visual-prop.types.d.ts.map +0 -1
- package/cjs/types/visual-prop.types.js +0 -3
- package/cjs/types/visual-prop.types.js.map +0 -1
- package/lib/dist/ts-chart-sdk.d.ts +0 -312
- package/lib/react/custom-chart-context-service.d.ts +0 -33
- package/lib/react/custom-chart-context-service.d.ts.map +0 -1
- package/lib/react/custom-chart-context-service.js +0 -91
- package/lib/react/custom-chart-context-service.js.map +0 -1
- package/lib/react/custom-chart.context.d.ts +0 -26
- package/lib/react/custom-chart.context.d.ts.map +0 -1
- package/lib/react/custom-chart.context.js +0 -78
- package/lib/react/custom-chart.context.js.map +0 -1
- package/lib/react/custom-chart.spec.d.ts +0 -2
- package/lib/react/custom-chart.spec.d.ts.map +0 -1
- package/lib/react/custom-chart.spec.js +0 -67
- package/lib/react/custom-chart.spec.js.map +0 -1
package/dist/ts-chart-sdk.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
// Generated by dts-bundle v0.7.3
|
|
2
|
+
// Dependencies for this module:
|
|
3
|
+
// ../react
|
|
2
4
|
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
export enum CustomizableChartFeature {
|
|
8
|
+
X_AXIS_LABEL = 0,
|
|
9
|
+
X_AXIS_TITLE = 1,
|
|
10
|
+
Y_AXIS_LABEL = 2,
|
|
11
|
+
Y_AXIS_TITLE = 3,
|
|
12
|
+
TOOLTIP = 4,
|
|
13
|
+
SCATTER_CHART = 5,
|
|
14
|
+
PIE_CHART = 6,
|
|
15
|
+
LINE_CHART = 7,
|
|
16
|
+
COLUMN_CHART = 8,
|
|
17
|
+
BAR_CHART = 9,
|
|
18
|
+
AREA_CHART = 10,
|
|
19
|
+
TAIL_FEATURE = 11
|
|
20
|
+
}
|
|
3
21
|
export interface ChartConfigDimension {
|
|
4
22
|
key: string;
|
|
5
23
|
columns: ChartColumn[];
|
|
@@ -8,15 +26,14 @@ export interface ChartConfig {
|
|
|
8
26
|
key: string;
|
|
9
27
|
dimensions: ChartConfigDimension[];
|
|
10
28
|
}
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
dataValue: any[];
|
|
29
|
+
export type DataPointsArray = {
|
|
30
|
+
columns: string[];
|
|
31
|
+
dataValue: any[][];
|
|
15
32
|
};
|
|
16
33
|
export type QueryData = {
|
|
17
|
-
data:
|
|
18
|
-
completionRatio
|
|
19
|
-
samplingRatio
|
|
34
|
+
data: DataPointsArray;
|
|
35
|
+
completionRatio?: number;
|
|
36
|
+
samplingRatio?: number;
|
|
20
37
|
totalRowCount: number;
|
|
21
38
|
};
|
|
22
39
|
export interface ChartModel {
|
|
@@ -28,17 +45,48 @@ export interface ChartModel {
|
|
|
28
45
|
chartConfig?: ChartConfig[];
|
|
29
46
|
};
|
|
30
47
|
}
|
|
48
|
+
export type SuccessValidationResponse = {
|
|
49
|
+
chartConfigEditorDefinition: ChartConfigEditorDefinition[];
|
|
50
|
+
visualPropEditorDefinition: VisualPropEditorDefinition;
|
|
51
|
+
};
|
|
31
52
|
export type ValidationResponse = {
|
|
32
53
|
isValid: boolean;
|
|
33
54
|
validationErrorMessage?: string[];
|
|
34
55
|
};
|
|
35
|
-
export type VisualProps =
|
|
36
|
-
type
|
|
56
|
+
export type VisualProps = unknown;
|
|
57
|
+
export type CustomFontFaces = {
|
|
58
|
+
guid: string;
|
|
59
|
+
family?: string;
|
|
60
|
+
format?: string;
|
|
61
|
+
url?: string;
|
|
62
|
+
weight?: string;
|
|
63
|
+
style?: string;
|
|
64
|
+
size?: string;
|
|
65
|
+
unicodeRange?: string;
|
|
66
|
+
variant?: string;
|
|
67
|
+
stretch?: string;
|
|
68
|
+
color?: string;
|
|
69
|
+
};
|
|
70
|
+
export type ChartSdkCustomStylingConfig = {
|
|
71
|
+
appBackground?: {
|
|
72
|
+
color?: string;
|
|
73
|
+
};
|
|
74
|
+
appPanelColor?: {
|
|
75
|
+
color?: string;
|
|
76
|
+
};
|
|
77
|
+
chartColorPalettes?: Array<{
|
|
78
|
+
colors: Array<string>;
|
|
79
|
+
}>;
|
|
80
|
+
disableColorRotation?: boolean;
|
|
81
|
+
chartFeatureToFontGuid?: Record<CustomizableChartFeature, string>;
|
|
82
|
+
customFontFaces?: Array<CustomFontFaces>;
|
|
83
|
+
};
|
|
37
84
|
export interface AppConfig {
|
|
38
|
-
styleConfig?:
|
|
85
|
+
styleConfig?: ChartSdkCustomStylingConfig;
|
|
39
86
|
appOptions?: {
|
|
40
87
|
isMobile?: boolean;
|
|
41
88
|
isPrintMode?: boolean;
|
|
89
|
+
isLiveboardContext?: boolean;
|
|
42
90
|
isDebugMode?: boolean;
|
|
43
91
|
};
|
|
44
92
|
localeOptions?: {
|
|
@@ -46,9 +94,10 @@ export interface AppConfig {
|
|
|
46
94
|
quarterStartMonth: string;
|
|
47
95
|
sessionTimezone: string;
|
|
48
96
|
};
|
|
97
|
+
appUrl?: string;
|
|
49
98
|
customCalendarConfig?: any;
|
|
99
|
+
customerId?: string;
|
|
50
100
|
}
|
|
51
|
-
export {};
|
|
52
101
|
|
|
53
102
|
export interface ChartConfigSection {
|
|
54
103
|
key: string;
|
|
@@ -57,6 +106,8 @@ export interface ChartConfigSection {
|
|
|
57
106
|
allowMeasureColumns?: boolean;
|
|
58
107
|
allowAttributeColumns?: boolean;
|
|
59
108
|
allowTimeSeriesColumns?: boolean;
|
|
109
|
+
allowMeasureNameColumn?: boolean;
|
|
110
|
+
allowMeasureValueColumn?: boolean;
|
|
60
111
|
}
|
|
61
112
|
export interface ChartConfigEditorDefinition {
|
|
62
113
|
key: string;
|
|
@@ -64,7 +115,18 @@ export interface ChartConfigEditorDefinition {
|
|
|
64
115
|
descriptionText?: string;
|
|
65
116
|
columnSections: ChartConfigSection[];
|
|
66
117
|
}
|
|
118
|
+
export type ConfigEditorDefinitionSetter = (currentState: ChartModel, ctx: CustomChartContext) => ChartConfigEditorDefinition[];
|
|
67
119
|
|
|
120
|
+
export interface InputValidation {
|
|
121
|
+
required?: boolean;
|
|
122
|
+
requiredError?: string;
|
|
123
|
+
regex?: string;
|
|
124
|
+
regexError?: string;
|
|
125
|
+
minLength?: number;
|
|
126
|
+
minLengthError?: string;
|
|
127
|
+
range?: string;
|
|
128
|
+
rangeError?: string;
|
|
129
|
+
}
|
|
68
130
|
export interface TextInputFormDetail {
|
|
69
131
|
type: 'text';
|
|
70
132
|
key: string;
|
|
@@ -73,6 +135,21 @@ export interface TextInputFormDetail {
|
|
|
73
135
|
multiline?: boolean;
|
|
74
136
|
placeholder?: string;
|
|
75
137
|
defaultValue?: string;
|
|
138
|
+
inputValidation?: InputValidation;
|
|
139
|
+
}
|
|
140
|
+
export interface NumberInputFormDetail {
|
|
141
|
+
type: 'number';
|
|
142
|
+
key: string;
|
|
143
|
+
label?: string;
|
|
144
|
+
defaultValue?: number;
|
|
145
|
+
inputValidation?: InputValidation;
|
|
146
|
+
}
|
|
147
|
+
export interface ColorPickerFormDetail {
|
|
148
|
+
type: 'colorpicker';
|
|
149
|
+
key: string;
|
|
150
|
+
label?: string;
|
|
151
|
+
selectorType?: 'FONT' | 'COLOR';
|
|
152
|
+
defaultValue?: string;
|
|
76
153
|
}
|
|
77
154
|
export interface ToggleFormDetail {
|
|
78
155
|
type: 'toggle';
|
|
@@ -106,16 +183,24 @@ export interface Section {
|
|
|
106
183
|
label?: string;
|
|
107
184
|
children?: PropElement[];
|
|
108
185
|
alignment?: 'row' | 'column';
|
|
186
|
+
layoutType?: 'accordion' | 'tab' | 'none';
|
|
109
187
|
}
|
|
110
|
-
export type PropElement = Section | TextInputFormDetail | ToggleFormDetail | CheckboxFormDetail | RadioButtonFormDetail | DropDownFormDetail;
|
|
188
|
+
export type PropElement = Section | TextInputFormDetail | NumberInputFormDetail | ColorPickerFormDetail | ToggleFormDetail | CheckboxFormDetail | RadioButtonFormDetail | DropDownFormDetail;
|
|
111
189
|
export interface VisualPropEditorDefinition {
|
|
112
190
|
elements: PropElement[];
|
|
113
191
|
}
|
|
192
|
+
export type VisualEditorDefinitionSetter = (currentState: ChartModel, ctx: CustomChartContext) => VisualPropEditorDefinition;
|
|
114
193
|
|
|
115
194
|
export enum ColumnType {
|
|
116
195
|
UNKNOWN = 0,
|
|
117
196
|
MEASURE = 1,
|
|
118
|
-
ATTRIBUTE = 2
|
|
197
|
+
ATTRIBUTE = 2,
|
|
198
|
+
VIRTUAL = 3
|
|
199
|
+
}
|
|
200
|
+
export enum ChartSpecificColumnType {
|
|
201
|
+
UNKNOWN = 0,
|
|
202
|
+
MEASURE_NAMES = 1,
|
|
203
|
+
MEASURE_VALUES = 2
|
|
119
204
|
}
|
|
120
205
|
export enum DataType {
|
|
121
206
|
UNKNOWN = 0,
|
|
@@ -162,6 +247,45 @@ export enum CurrencyFormatType {
|
|
|
162
247
|
COLUMN = 1,
|
|
163
248
|
ISO_CODE = 2
|
|
164
249
|
}
|
|
250
|
+
export enum ColumnAggregationType {
|
|
251
|
+
AGGREGATE = 0,
|
|
252
|
+
AGGREGATE_DISTINCT = 1,
|
|
253
|
+
APPROX_AGGR_DISTINCT = 2,
|
|
254
|
+
APPROX_AGGR_DISTINCT_MERGE = 3,
|
|
255
|
+
APPROX_COUNT_DISTINCT = 4,
|
|
256
|
+
AVERAGE = 5,
|
|
257
|
+
COUNT = 6,
|
|
258
|
+
COUNT_DISTINCT = 7,
|
|
259
|
+
CUMULATIVE_AVERAGE = 8,
|
|
260
|
+
CUMULATIVE_COUNT = 9,
|
|
261
|
+
CUMULATIVE_MAX = 10,
|
|
262
|
+
CUMULATIVE_MIN = 11,
|
|
263
|
+
CUMULATIVE_SUM = 12,
|
|
264
|
+
GROWTH = 13,
|
|
265
|
+
MAX = 14,
|
|
266
|
+
MEDIAN = 15,
|
|
267
|
+
MIN = 16,
|
|
268
|
+
MOVING_AVERAGE = 17,
|
|
269
|
+
MOVING_COUNT = 18,
|
|
270
|
+
MOVING_MAX = 19,
|
|
271
|
+
MOVING_MIN = 20,
|
|
272
|
+
MOVING_SUM = 21,
|
|
273
|
+
NONE = 22,
|
|
274
|
+
PERCENTILE = 23,
|
|
275
|
+
RANK = 24,
|
|
276
|
+
RANK_PERCENTILE = 25,
|
|
277
|
+
SQL_BOOL_AGGREGATE_OP = 26,
|
|
278
|
+
SQL_DATE_AGGREGATE_OP = 27,
|
|
279
|
+
SQL_DATE_TIME_AGGREGATE_OP = 28,
|
|
280
|
+
SQL_DOUBLE_AGGREGATE_OP = 29,
|
|
281
|
+
SQL_INT_AGGREGATE_OP = 30,
|
|
282
|
+
SQL_STRING_AGGREGATE_OP = 31,
|
|
283
|
+
SQL_TIME_AGGREGATE_OP = 32,
|
|
284
|
+
STD_DEVIATION = 33,
|
|
285
|
+
SUM = 34,
|
|
286
|
+
TABLE_AGGR = 35,
|
|
287
|
+
VARIANCE = 36
|
|
288
|
+
}
|
|
165
289
|
export interface CurrencyFormat {
|
|
166
290
|
type: CurrencyFormatType;
|
|
167
291
|
column: string;
|
|
@@ -179,6 +303,13 @@ export interface ChartColumn {
|
|
|
179
303
|
timeBucket: ColumnTimeBucket;
|
|
180
304
|
dataType: DataType;
|
|
181
305
|
format?: ColumnFormat;
|
|
306
|
+
columnProperties?: {
|
|
307
|
+
conditionalFormatting?: Maybe<ConditionalFormatting>;
|
|
308
|
+
};
|
|
309
|
+
aggregationType?: ColumnAggregationType;
|
|
310
|
+
customOrder?: Array<string>;
|
|
311
|
+
calenderGuid?: string;
|
|
312
|
+
chartSpecificColumnType: ChartSpecificColumnType;
|
|
182
313
|
}
|
|
183
314
|
|
|
184
315
|
export enum ChartToTSEvent {
|
|
@@ -189,17 +320,34 @@ export enum ChartToTSEvent {
|
|
|
189
320
|
RenderStart = "RenderStart",
|
|
190
321
|
RenderError = "RenderError",
|
|
191
322
|
RenderComplete = "RenderComplete",
|
|
192
|
-
UpdateVisualProps = "UpdateVisualProps"
|
|
323
|
+
UpdateVisualProps = "UpdateVisualProps",
|
|
324
|
+
GetTMLString = "GetTMLString",
|
|
325
|
+
SetTMLString = "SetTMLString",
|
|
326
|
+
GetDataForQuery = "GetDataForQuery",
|
|
327
|
+
ShowToolTip = "ShowToolTip",
|
|
328
|
+
HideToolTip = "HideToolTip"
|
|
193
329
|
}
|
|
194
330
|
export interface ChartToTSEventsPayloadMap {
|
|
195
|
-
[ChartToTSEvent.OpenContextMenu]: OpenContextMenuEventPayload;
|
|
196
|
-
[ChartToTSEvent.CloseContextMenu]:
|
|
197
|
-
[ChartToTSEvent.RenderStart]:
|
|
198
|
-
[ChartToTSEvent.RenderComplete]:
|
|
199
|
-
[ChartToTSEvent.RenderError]: RenderErrorEventPayload;
|
|
200
|
-
[ChartToTSEvent.UpdateVisualProps]: UpdateVisualPropsEventPayload;
|
|
201
|
-
|
|
202
|
-
|
|
331
|
+
[ChartToTSEvent.OpenContextMenu]: [OpenContextMenuEventPayload];
|
|
332
|
+
[ChartToTSEvent.CloseContextMenu]: [];
|
|
333
|
+
[ChartToTSEvent.RenderStart]: [];
|
|
334
|
+
[ChartToTSEvent.RenderComplete]: [];
|
|
335
|
+
[ChartToTSEvent.RenderError]: [RenderErrorEventPayload];
|
|
336
|
+
[ChartToTSEvent.UpdateVisualProps]: [UpdateVisualPropsEventPayload];
|
|
337
|
+
[ChartToTSEvent.GetTMLString]: [];
|
|
338
|
+
[ChartToTSEvent.SetTMLString]: [SetTMLStringEventPayload];
|
|
339
|
+
[ChartToTSEvent.GetDataForQuery]: [GetDataForQueryEventPayload];
|
|
340
|
+
[ChartToTSEvent.ShowToolTip]: [ShowToolTipEventPayload];
|
|
341
|
+
[ChartToTSEvent.HideToolTip]: [];
|
|
342
|
+
[ChartToTSEvent.OpenAxisMenu]: [OpenAxisMenuEventPayload];
|
|
343
|
+
[ChartToTSEvent.CloseAxisMenu]: [];
|
|
344
|
+
}
|
|
345
|
+
export interface UpdateVisualPropsEventPayload {
|
|
346
|
+
visualProps: VisualProps;
|
|
347
|
+
}
|
|
348
|
+
export interface SetTMLStringEventPayload {
|
|
349
|
+
tmlString: string;
|
|
350
|
+
}
|
|
203
351
|
export interface PointVal {
|
|
204
352
|
columnId: string;
|
|
205
353
|
value: any;
|
|
@@ -210,33 +358,68 @@ export interface Point {
|
|
|
210
358
|
export interface CustomAction {
|
|
211
359
|
id: string;
|
|
212
360
|
label: string;
|
|
213
|
-
icon
|
|
361
|
+
icon?: string;
|
|
214
362
|
onClick: (...args: any[]) => void;
|
|
215
363
|
}
|
|
216
364
|
export interface OpenContextMenuEventPayload {
|
|
217
|
-
event: Pick<PointerEvent, '
|
|
365
|
+
event: Pick<PointerEvent, 'clientX' | 'clientY'>;
|
|
218
366
|
clickedPoint: Point;
|
|
219
367
|
selectedPoints?: Point[];
|
|
220
368
|
customActions?: CustomAction[];
|
|
221
369
|
}
|
|
222
|
-
interface
|
|
370
|
+
export interface ShowToolTipEventPayload {
|
|
371
|
+
event: Pick<PointerEvent, 'clientX' | 'clientY'>;
|
|
372
|
+
customTooltipContent?: string[];
|
|
373
|
+
point?: Point;
|
|
374
|
+
}
|
|
375
|
+
export interface RenderErrorEventPayload {
|
|
223
376
|
hasError: boolean;
|
|
224
377
|
error: any;
|
|
225
378
|
}
|
|
379
|
+
export interface GetDataForQueryEventPayload {
|
|
380
|
+
queries: Query[];
|
|
381
|
+
}
|
|
226
382
|
export enum ErrorType {
|
|
227
383
|
MultipleContextsNotSupported = "MultipleContextsNotSupported"
|
|
228
384
|
}
|
|
229
|
-
export {
|
|
385
|
+
export enum AxisMenuActions {
|
|
386
|
+
AGGREGATE = "AGGREGATE",
|
|
387
|
+
TIME_BUCKET = "TIME_BUCKET",
|
|
388
|
+
FILTER = "FILTER",
|
|
389
|
+
SORT = "SORT",
|
|
390
|
+
SEPARATOR = "SEPARATOR"
|
|
391
|
+
}
|
|
392
|
+
export interface AxisMenuCustomAction {
|
|
393
|
+
id: string;
|
|
394
|
+
label: string;
|
|
395
|
+
icon?: string;
|
|
396
|
+
onClick: (...args: any[]) => void;
|
|
397
|
+
}
|
|
398
|
+
export interface OpenAxisMenuEventPayload {
|
|
399
|
+
event: Pick<PointerEvent, 'clientX' | 'clientY'>;
|
|
400
|
+
columnIds: string[];
|
|
401
|
+
selectedActions?: AxisMenuActions[];
|
|
402
|
+
customActions?: AxisMenuCustomAction[];
|
|
403
|
+
}
|
|
404
|
+
export interface ContextMenuActionHandler {
|
|
405
|
+
[key: string]: (args: CustomContextMenuAction) => void;
|
|
406
|
+
}
|
|
407
|
+
export interface AxisMenuActionHandler {
|
|
408
|
+
[key: string]: (args: CustomAxisMenuAction) => void;
|
|
409
|
+
}
|
|
230
410
|
|
|
231
411
|
export enum TSToChartEvent {
|
|
232
412
|
Initialize = "Initialize",
|
|
413
|
+
InitializeComplete = "InitializeComplete",
|
|
233
414
|
GetDataQuery = "GetDataQuery",
|
|
234
415
|
ChartConfigValidate = "ChartConfigValidate",
|
|
235
416
|
ChartModelUpdate = "ChartModelUpdate",
|
|
236
417
|
DataUpdate = "DataUpdate",
|
|
237
418
|
TriggerRenderChart = "TriggerRenderChart",
|
|
238
419
|
VisualPropsValidate = "VisualPropsValidate",
|
|
239
|
-
VisualPropsUpdate = "VisualPropsUpdate"
|
|
420
|
+
VisualPropsUpdate = "VisualPropsUpdate",
|
|
421
|
+
ContextMenuActionClick = "ContextMenuActionClick",
|
|
422
|
+
AxisMenuActionClick = "AxisMenuActionClick"
|
|
240
423
|
}
|
|
241
424
|
export interface TSToChartEventsPayloadMap {
|
|
242
425
|
[TSToChartEvent.ChartModelUpdate]: (payload: ChartModelUpdateEventPayload) => void;
|
|
@@ -245,22 +428,27 @@ export interface TSToChartEventsPayloadMap {
|
|
|
245
428
|
}
|
|
246
429
|
export interface TSToChartInternalEventsPayloadMap {
|
|
247
430
|
[TSToChartEvent.Initialize]: (payload: InitializeEventPayload) => InitializeEventResponsePayload;
|
|
431
|
+
[TSToChartEvent.InitializeComplete]: () => void;
|
|
248
432
|
[TSToChartEvent.GetDataQuery]: (payload: GetDataQueryPayload) => GetDataQueryResponsePayload;
|
|
249
433
|
[TSToChartEvent.ChartConfigValidate]: (payload: ChartConfigValidateEventPayload) => ValidationResponse;
|
|
250
434
|
[TSToChartEvent.VisualPropsValidate]: (payload: VisualPropsValidateEventPayload) => ValidationResponse;
|
|
251
435
|
[TSToChartEvent.TriggerRenderChart]: () => void;
|
|
436
|
+
[TSToChartEvent.ContextMenuActionClick]: (payload: ContextMenuCustomActionPayload) => void;
|
|
437
|
+
[TSToChartEvent.AxisMenuActionClick]: (payload: AxisMenuCustomActionPayload) => void;
|
|
252
438
|
}
|
|
253
439
|
export interface InitializeEventPayload {
|
|
254
440
|
chartModel: ChartModel;
|
|
255
441
|
appConfig?: AppConfig;
|
|
256
442
|
componentId: string;
|
|
257
443
|
hostUrl: string;
|
|
444
|
+
containerElSelector: string;
|
|
258
445
|
}
|
|
259
446
|
export interface InitializeEventResponsePayload {
|
|
260
447
|
isConfigValid: boolean;
|
|
261
448
|
defaultChartConfig: ChartConfig[];
|
|
262
449
|
chartConfigEditorDefinition?: ChartConfigEditorDefinition[];
|
|
263
450
|
visualPropEditorDefinition?: VisualPropEditorDefinition;
|
|
451
|
+
allowedConfigurations?: AllowedConfigurations;
|
|
264
452
|
}
|
|
265
453
|
export interface GetDataQueryPayload {
|
|
266
454
|
config: ChartConfig[];
|
|
@@ -290,23 +478,253 @@ export interface VisualPropsValidateEventPayload {
|
|
|
290
478
|
export interface ChartConfigValidateEventPayload {
|
|
291
479
|
chartConfig: ChartConfig[];
|
|
292
480
|
}
|
|
481
|
+
export interface CustomContextMenuAction {
|
|
482
|
+
id: string;
|
|
483
|
+
clickedPoint: Point;
|
|
484
|
+
selectedPoints?: Point[];
|
|
485
|
+
event: Pick<PointerEvent, 'clientX' | 'clientY'>;
|
|
486
|
+
}
|
|
487
|
+
export interface ContextMenuCustomActionPayload {
|
|
488
|
+
customAction: CustomContextMenuAction;
|
|
489
|
+
}
|
|
490
|
+
export interface CustomAxisMenuAction {
|
|
491
|
+
id: string;
|
|
492
|
+
columnIds: string[];
|
|
493
|
+
event: Pick<PointerEvent, 'clientX' | 'clientY'>;
|
|
494
|
+
}
|
|
495
|
+
export interface AxisMenuCustomActionPayload {
|
|
496
|
+
customAction: CustomAxisMenuAction;
|
|
497
|
+
}
|
|
293
498
|
|
|
499
|
+
export type AllowedConfigurations = {
|
|
500
|
+
allowColumnNumberFormatting: boolean;
|
|
501
|
+
allowColumnConditionalFormatting: boolean;
|
|
502
|
+
allowMeasureNamesAndValues: boolean;
|
|
503
|
+
};
|
|
294
504
|
export type CustomChartContextProps = {
|
|
295
505
|
getDefaultChartConfig: (chartModel: ChartModel) => ChartConfig[];
|
|
296
|
-
getQueriesFromChartConfig: (chartConfig: ChartConfig[]) => Query[];
|
|
506
|
+
getQueriesFromChartConfig: (chartConfig: ChartConfig[], chartModel: ChartModel) => Query[];
|
|
297
507
|
renderChart: (ctx: CustomChartContext) => Promise<void>;
|
|
298
508
|
validateConfig?: (updatedConfig: ChartConfig[], chartModel: ChartModel) => ValidationResponse;
|
|
299
509
|
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel) => ValidationResponse;
|
|
300
|
-
chartConfigEditorDefinition?: ChartConfigEditorDefinition[];
|
|
301
|
-
visualPropEditorDefinition?: VisualPropEditorDefinition;
|
|
510
|
+
chartConfigEditorDefinition?: ConfigEditorDefinitionSetter | ChartConfigEditorDefinition[];
|
|
511
|
+
visualPropEditorDefinition?: VisualEditorDefinitionSetter | VisualPropEditorDefinition;
|
|
512
|
+
allowedConfigurations?: AllowedConfigurations;
|
|
302
513
|
};
|
|
514
|
+
export type ValidationFunctions = CustomChartContextProps['validateVisualProps'] | CustomChartContextProps['validateConfig'];
|
|
303
515
|
export class CustomChartContext {
|
|
516
|
+
containerEl: HTMLElement | null;
|
|
304
517
|
constructor(chartContextProps: CustomChartContextProps);
|
|
305
518
|
initialize: () => Promise<void>;
|
|
306
519
|
on<T extends keyof TSToChartEventsPayloadMap>(eventType: T, callbackFn: TSToChartEventsPayloadMap[T]): void;
|
|
520
|
+
off<T extends keyof TSToChartEventsPayloadMap>(eventType: T): void;
|
|
307
521
|
destroy(): void;
|
|
308
522
|
getChartModel: () => ChartModel;
|
|
309
|
-
|
|
523
|
+
getAppConfig: () => AppConfig;
|
|
524
|
+
contextMenuCustomActionPreProcessor(eventPayload: [OpenContextMenuEventPayload]): [OpenContextMenuEventPayload];
|
|
525
|
+
axisMenuCustomActionPreProcessor(eventPayload: [OpenAxisMenuEventPayload]): [OpenAxisMenuEventPayload];
|
|
526
|
+
emitEvent<T extends keyof ChartToTSEventsPayloadMap>(eventType: T, ...eventPayload: ChartToTSEventsPayloadMap[T]): Promise<any>;
|
|
310
527
|
}
|
|
311
528
|
export const getChartContext: (customChartConfig: CustomChartContextProps) => Promise<CustomChartContext>;
|
|
312
529
|
|
|
530
|
+
export const useChartContext: (props: Omit<CustomChartContextProps, 'renderChart'>) => ChartContextProps;
|
|
531
|
+
|
|
532
|
+
export type Maybe<T> = T | null;
|
|
533
|
+
export type InputMaybe<T> = Maybe<T>;
|
|
534
|
+
export type ConditionalFormatting = {
|
|
535
|
+
__typename?: 'ConditionalFormatting';
|
|
536
|
+
rows?: Maybe<Array<Maybe<ConditionalMetric>>>;
|
|
537
|
+
};
|
|
538
|
+
export type Scalars = {
|
|
539
|
+
ID: string;
|
|
540
|
+
String: string;
|
|
541
|
+
Boolean: boolean;
|
|
542
|
+
Int: number;
|
|
543
|
+
Float: number;
|
|
544
|
+
FileUpload: any;
|
|
545
|
+
GUID: string;
|
|
546
|
+
JSON: {
|
|
547
|
+
[key: string]: any;
|
|
548
|
+
};
|
|
549
|
+
JSONObject: any;
|
|
550
|
+
Long: any;
|
|
551
|
+
};
|
|
552
|
+
export enum BackgroundFormatTypes {
|
|
553
|
+
Gradient = "GRADIENT",
|
|
554
|
+
Solid = "SOLID"
|
|
555
|
+
}
|
|
556
|
+
export enum ConditionalFormattingComparisonTypes {
|
|
557
|
+
ColumnBased = "COLUMN_BASED",
|
|
558
|
+
ParameterBased = "PARAMETER_BASED",
|
|
559
|
+
ValueBased = "VALUE_BASED"
|
|
560
|
+
}
|
|
561
|
+
export type FontAttrs = {
|
|
562
|
+
__typename?: 'FontAttrs';
|
|
563
|
+
bold?: Maybe<Scalars['Boolean']>;
|
|
564
|
+
color?: Maybe<Scalars['String']>;
|
|
565
|
+
italic?: Maybe<Scalars['Boolean']>;
|
|
566
|
+
strikeThrough?: Maybe<Scalars['Boolean']>;
|
|
567
|
+
underline?: Maybe<Scalars['Boolean']>;
|
|
568
|
+
};
|
|
569
|
+
export type GradientBackgroundAttrs = {
|
|
570
|
+
__typename?: 'GradientBackgroundAttrs';
|
|
571
|
+
backgroundFormatMidpoint?: Maybe<Scalars['Float']>;
|
|
572
|
+
backgroundFormatRange?: Maybe<Array<Maybe<Scalars['Float']>>>;
|
|
573
|
+
colors?: Maybe<Array<Maybe<Scalars['String']>>>;
|
|
574
|
+
};
|
|
575
|
+
export enum Operators {
|
|
576
|
+
Contains = "CONTAINS",
|
|
577
|
+
DoesNotContain = "DOES_NOT_CONTAIN",
|
|
578
|
+
EndsWith = "ENDS_WITH",
|
|
579
|
+
EqualTo = "EQUAL_TO",
|
|
580
|
+
GreaterThan = "GREATER_THAN",
|
|
581
|
+
GreaterThanEqualTo = "GREATER_THAN_EQUAL_TO",
|
|
582
|
+
Is = "IS",
|
|
583
|
+
IsBetween = "IS_BETWEEN",
|
|
584
|
+
IsEmpty = "IS_EMPTY",
|
|
585
|
+
IsNot = "IS_NOT",
|
|
586
|
+
IsNotEmpty = "IS_NOT_EMPTY",
|
|
587
|
+
IsNotNull = "IS_NOT_NULL",
|
|
588
|
+
IsNull = "IS_NULL",
|
|
589
|
+
LessThan = "LESS_THAN",
|
|
590
|
+
LessThanEqualTo = "LESS_THAN_EQUAL_TO",
|
|
591
|
+
NotEqualTo = "NOT_EQUAL_TO",
|
|
592
|
+
StartsWith = "STARTS_WITH"
|
|
593
|
+
}
|
|
594
|
+
export type SolidBackgroundAttrs = {
|
|
595
|
+
__typename?: 'SolidBackgroundAttrs';
|
|
596
|
+
color?: Maybe<Scalars['String']>;
|
|
597
|
+
};
|
|
598
|
+
export type Range = {
|
|
599
|
+
__typename?: 'Range';
|
|
600
|
+
max?: Maybe<Scalars['Float']>;
|
|
601
|
+
min?: Maybe<Scalars['Float']>;
|
|
602
|
+
};
|
|
603
|
+
export type ConditionalMetric = {
|
|
604
|
+
__typename?: 'ConditionalMetric';
|
|
605
|
+
backgroundFormatType?: Maybe<BackgroundFormatTypes>;
|
|
606
|
+
comparisonParameterId?: Maybe<Scalars['String']>;
|
|
607
|
+
comparisonType?: Maybe<ConditionalFormattingComparisonTypes>;
|
|
608
|
+
fontProperties?: Maybe<FontAttrs>;
|
|
609
|
+
gradientBackgroundAttrs?: Maybe<GradientBackgroundAttrs>;
|
|
610
|
+
isHighlightRow?: Maybe<Scalars['Boolean']>;
|
|
611
|
+
lhsColumnId?: Maybe<Scalars['String']>;
|
|
612
|
+
operator?: Maybe<Operators>;
|
|
613
|
+
plotAsBand?: Maybe<Scalars['Boolean']>;
|
|
614
|
+
rangeValues?: Maybe<Range>;
|
|
615
|
+
rhsColumnId?: Maybe<Scalars['String']>;
|
|
616
|
+
solidBackgroundAttrs?: Maybe<SolidBackgroundAttrs>;
|
|
617
|
+
value?: Maybe<Scalars['String']>;
|
|
618
|
+
};
|
|
619
|
+
export type Parameter = {
|
|
620
|
+
__typename?: 'Parameter';
|
|
621
|
+
dataType: FalconDataType;
|
|
622
|
+
defaultValue: Scalars['String'];
|
|
623
|
+
description: Scalars['String'];
|
|
624
|
+
id: Scalars['GUID'];
|
|
625
|
+
name: Scalars['String'];
|
|
626
|
+
overrideValue?: Maybe<Scalars['String']>;
|
|
627
|
+
owner: ParameterOwnerInfo;
|
|
628
|
+
valueList?: Maybe<Array<ParameterValueListItem>>;
|
|
629
|
+
valueRange?: Maybe<ParameterValueRange>;
|
|
630
|
+
valueType: ParameterValueType;
|
|
631
|
+
};
|
|
632
|
+
export enum FalconDataType {
|
|
633
|
+
Bool = "BOOL",
|
|
634
|
+
Char = "CHAR",
|
|
635
|
+
Date = "DATE",
|
|
636
|
+
DateTime = "DATE_TIME",
|
|
637
|
+
Double = "DOUBLE",
|
|
638
|
+
Float = "FLOAT",
|
|
639
|
+
Int32 = "INT32",
|
|
640
|
+
Int64 = "INT64",
|
|
641
|
+
List = "LIST",
|
|
642
|
+
ListBool = "LIST_BOOL",
|
|
643
|
+
ListDate = "LIST_DATE",
|
|
644
|
+
ListDateTime = "LIST_DATE_TIME",
|
|
645
|
+
ListDouble = "LIST_DOUBLE",
|
|
646
|
+
ListInt = "LIST_INT",
|
|
647
|
+
ListString = "LIST_STRING",
|
|
648
|
+
ListTime = "LIST_TIME",
|
|
649
|
+
MaxType = "MAX_TYPE",
|
|
650
|
+
Time = "TIME",
|
|
651
|
+
Unknown = "UNKNOWN"
|
|
652
|
+
}
|
|
653
|
+
export type ParameterOwnerInfo = {
|
|
654
|
+
__typename?: 'ParameterOwnerInfo';
|
|
655
|
+
id: Scalars['GUID'];
|
|
656
|
+
name: Scalars['String'];
|
|
657
|
+
type: ParameterOwnerType;
|
|
658
|
+
};
|
|
659
|
+
export enum ParameterOwnerType {
|
|
660
|
+
Answer = "ANSWER",
|
|
661
|
+
Worksheet = "WORKSHEET"
|
|
662
|
+
}
|
|
663
|
+
export type ParameterValueListItem = {
|
|
664
|
+
__typename?: 'ParameterValueListItem';
|
|
665
|
+
displayAs?: Maybe<Scalars['String']>;
|
|
666
|
+
value: Scalars['String'];
|
|
667
|
+
};
|
|
668
|
+
export type ParameterValueListItemInput = {
|
|
669
|
+
displayAs?: InputMaybe<Scalars['String']>;
|
|
670
|
+
value: Scalars['String'];
|
|
671
|
+
};
|
|
672
|
+
export type ParameterValueRange = {
|
|
673
|
+
__typename?: 'ParameterValueRange';
|
|
674
|
+
max?: Maybe<Scalars['Float']>;
|
|
675
|
+
min?: Maybe<Scalars['Float']>;
|
|
676
|
+
};
|
|
677
|
+
export type ParameterValueRangeInput = {
|
|
678
|
+
max?: InputMaybe<Scalars['Float']>;
|
|
679
|
+
min?: InputMaybe<Scalars['Float']>;
|
|
680
|
+
};
|
|
681
|
+
export enum ParameterValueType {
|
|
682
|
+
Any = "ANY",
|
|
683
|
+
List = "LIST",
|
|
684
|
+
Range = "RANGE"
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
export interface CustomCalendarDate {
|
|
688
|
+
v: {
|
|
689
|
+
s: number;
|
|
690
|
+
e: number;
|
|
691
|
+
};
|
|
692
|
+
d: string;
|
|
693
|
+
}
|
|
694
|
+
export const isDateColumn: (col: ChartColumn) => boolean;
|
|
695
|
+
export const isAttribute: (col: ChartColumn) => boolean;
|
|
696
|
+
export const getCustomCalendarGuidFromColumn: (col: ChartColumn) => string | undefined;
|
|
697
|
+
export const isDateNumColumn: (col: ChartColumn) => boolean;
|
|
698
|
+
export const isDateFamilyColumn: (col: ChartColumn) => boolean;
|
|
699
|
+
export const isTimeColumn: (col: ChartColumn) => boolean;
|
|
700
|
+
export const hasCustomCalendar: (col: ChartColumn) => boolean;
|
|
701
|
+
export function getStartEpoch(date: CustomCalendarDate): number | null;
|
|
702
|
+
export function getDisplayString(date: CustomCalendarDate): string | null;
|
|
703
|
+
export function dateFormatter(dataValue: any, col: ChartColumn): string | null;
|
|
704
|
+
|
|
705
|
+
export const getMinRangeValue: (metric: ConditionalMetric) => number | undefined | null;
|
|
706
|
+
export const getMaxRangeValue: (metric: ConditionalMetric) => number | undefined | null;
|
|
707
|
+
export const isConditionSatisfied: (metric: ConditionalMetric, parameters?: Parameter[], lhsColValue?: string | number | null, rhsColValue?: string | number | null) => boolean;
|
|
708
|
+
export function validateCfCondition(conditionalMetric: ConditionalMetric, index: number, columnId: string, dataAttr?: DataPointsArray, inScopeParameters?: Parameter[]): boolean;
|
|
709
|
+
export const applicableConditionalFormatting: (idx: number, columnId: string, dataArr: DataPointsArray, conditionalFormatting?: ConditionalFormatting) => ConditionalMetric | null;
|
|
710
|
+
export function getCfForColumn(column: ChartColumn): ConditionalFormatting | undefined;
|
|
711
|
+
|
|
712
|
+
export type ChartToTSEventEmitters = {
|
|
713
|
+
[key in keyof ChartToTSEventsPayloadMap as `emit${Capitalize<key>}`]: (...args: ChartToTSEventsPayloadMap[key]) => Promise<void>;
|
|
714
|
+
};
|
|
715
|
+
export type TSToChartEventListener = {
|
|
716
|
+
[key in keyof TSToChartEventsPayloadMap as `setOn${Capitalize<key>}`]: (args: TSToChartEventsPayloadMap[key]) => Promise<void>;
|
|
717
|
+
};
|
|
718
|
+
export type TSToChartEventOffListener = {
|
|
719
|
+
[key in keyof TSToChartEventsPayloadMap as `setOff${Capitalize<key>}`]: () => Promise<void>;
|
|
720
|
+
};
|
|
721
|
+
export interface TSChartContextProps {
|
|
722
|
+
children: React.ReactNode;
|
|
723
|
+
}
|
|
724
|
+
export interface ChartContextProps extends ChartToTSEventEmitters, TSToChartEventListener, TSToChartEventOffListener {
|
|
725
|
+
hasInitialized: boolean;
|
|
726
|
+
chartModel: ChartModel | undefined;
|
|
727
|
+
destroy: () => void;
|
|
728
|
+
TSChartContext: ({ children }: TSChartContextProps) => React.JSX.Element;
|
|
729
|
+
}
|
|
730
|
+
|
package/lib/index.d.ts
CHANGED
|
@@ -6,4 +6,7 @@ export * from './types/chart-to-ts-event.types';
|
|
|
6
6
|
export * from './types/ts-to-chart-event.types';
|
|
7
7
|
export * from './main/custom-chart-context';
|
|
8
8
|
export * from './react/use-custom-chart-context';
|
|
9
|
+
export * from './types/conditional-formatting.types';
|
|
10
|
+
export * from './utils/date-formatting';
|
|
11
|
+
export * from './utils/conditional-formatting/conditional-formatting';
|
|
9
12
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yBAAyB,CAAC;AACxC,cAAc,uDAAuD,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -6,4 +6,7 @@ export * from './types/chart-to-ts-event.types';
|
|
|
6
6
|
export * from './types/ts-to-chart-event.types';
|
|
7
7
|
export * from './main/custom-chart-context';
|
|
8
8
|
export * from './react/use-custom-chart-context';
|
|
9
|
+
export * from './types/conditional-formatting.types';
|
|
10
|
+
export * from './utils/date-formatting';
|
|
11
|
+
export * from './utils/conditional-formatting/conditional-formatting';
|
|
9
12
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yBAAyB,CAAC;AACxC,cAAc,uDAAuD,CAAC"}
|