@thoughtspot/ts-chart-sdk 0.0.2-alpha.8 → 1.0.0
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 +337 -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 +15 -3
- package/lib/main/custom-chart-context.d.ts.map +1 -1
- package/lib/main/custom-chart-context.js +45 -16
- package/lib/main/custom-chart-context.js.map +1 -1
- package/lib/main/custom-chart-context.spec.js +302 -4
- package/lib/main/custom-chart-context.spec.js.map +1 -1
- package/lib/main/logger.d.ts +13 -0
- package/lib/main/logger.d.ts.map +1 -0
- package/lib/main/logger.js +64 -0
- package/lib/main/logger.js.map +1 -0
- package/lib/main/logger.spec.d.ts +2 -0
- package/lib/main/logger.spec.d.ts.map +1 -0
- package/lib/main/logger.spec.js +88 -0
- package/lib/main/logger.spec.js.map +1 -0
- package/lib/main/util.d.ts +2 -0
- package/lib/main/util.d.ts.map +1 -1
- package/lib/main/util.js +11 -0
- package/lib/main/util.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 +73 -0
- package/lib/main/util.spec.js.map +1 -0
- package/lib/react/use-custom-chart-context.d.ts.map +1 -1
- package/lib/react/use-custom-chart-context.js +3 -1
- package/lib/react/use-custom-chart-context.js.map +1 -1
- package/lib/react/use-custom-chart-context.spec.js +0 -1
- package/lib/react/use-custom-chart-context.spec.js.map +1 -1
- package/lib/react/use-custom-chart-context.util.d.ts.map +1 -1
- package/lib/react/use-custom-chart-context.util.js +5 -3
- package/lib/react/use-custom-chart-context.util.js.map +1 -1
- package/lib/types/answer-column.types.d.ts +15 -5
- package/lib/types/answer-column.types.d.ts.map +1 -1
- package/lib/types/answer-column.types.js +10 -3
- 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 +65 -5
- package/lib/types/common.types.d.ts.map +1 -1
- package/lib/types/common.types.js.map +1 -1
- package/lib/types/conditional-formatting.types.d.ts +1 -16
- package/lib/types/conditional-formatting.types.d.ts.map +1 -1
- package/lib/types/conditional-formatting.types.js.map +1 -1
- package/lib/types/configurator.types.d.ts +3 -1
- 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 +19 -6
- package/lib/types/ts-to-chart-event.types.d.ts.map +1 -1
- package/lib/types/ts-to-chart-event.types.js +1 -0
- package/lib/types/ts-to-chart-event.types.js.map +1 -1
- package/lib/types/visual-prop.types.d.ts +71 -3
- package/lib/types/visual-prop.types.d.ts.map +1 -1
- package/lib/types/visual-prop.types.js +32 -1
- package/lib/types/visual-prop.types.js.map +1 -1
- package/lib/utils/conditional-formatting/conditional-formatting.spec.js +2 -1
- package/lib/utils/conditional-formatting/conditional-formatting.spec.js.map +1 -1
- package/lib/utils/date-formatting.d.ts +85 -1
- package/lib/utils/date-formatting.d.ts.map +1 -1
- package/lib/utils/date-formatting.js +344 -9
- package/lib/utils/date-formatting.js.map +1 -1
- package/lib/utils/date-formatting.spec.js +303 -32
- package/lib/utils/date-formatting.spec.js.map +1 -1
- 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/lib/utils/globalize-Initializer/globalize-utils.d.ts +16 -0
- package/lib/utils/globalize-Initializer/globalize-utils.d.ts.map +1 -0
- package/lib/utils/globalize-Initializer/globalize-utils.js +101 -0
- package/lib/utils/globalize-Initializer/globalize-utils.js.map +1 -0
- package/lib/utils/globalize-Initializer/globalize-utils.spec.d.ts +2 -0
- package/lib/utils/globalize-Initializer/globalize-utils.spec.d.ts.map +1 -0
- package/lib/utils/globalize-Initializer/globalize-utils.spec.js +149 -0
- package/lib/utils/globalize-Initializer/globalize-utils.spec.js.map +1 -0
- package/lib/utils/number-formatting/number-formatting-utils.d.ts +20 -0
- package/lib/utils/number-formatting/number-formatting-utils.d.ts.map +1 -0
- package/lib/utils/number-formatting/number-formatting-utils.js +159 -0
- package/lib/utils/number-formatting/number-formatting-utils.js.map +1 -0
- package/lib/utils/number-formatting/number-formatting-utils.spec.d.ts +2 -0
- package/lib/utils/number-formatting/number-formatting-utils.spec.d.ts.map +1 -0
- package/lib/utils/number-formatting/number-formatting-utils.spec.js +221 -0
- package/lib/utils/number-formatting/number-formatting-utils.spec.js.map +1 -0
- package/lib/utils/number-formatting/number-formatting.d.ts +5 -0
- package/lib/utils/number-formatting/number-formatting.d.ts.map +1 -0
- package/lib/utils/number-formatting/number-formatting.js +128 -0
- package/lib/utils/number-formatting/number-formatting.js.map +1 -0
- package/lib/utils/number-formatting/number-formatting.spec.d.ts +2 -0
- package/lib/utils/number-formatting/number-formatting.spec.d.ts.map +1 -0
- package/lib/utils/number-formatting/number-formatting.spec.js +159 -0
- package/lib/utils/number-formatting/number-formatting.spec.js.map +1 -0
- package/package.json +5 -2
- package/src/index.ts +3 -0
- package/src/main/custom-chart-context.spec.ts +356 -6
- package/src/main/custom-chart-context.ts +182 -15
- package/src/main/logger.spec.ts +114 -0
- package/src/main/logger.ts +97 -0
- package/src/main/util.spec.ts +94 -0
- package/src/main/util.ts +20 -0
- package/src/react/use-custom-chart-context.spec.tsx +0 -1
- package/src/react/use-custom-chart-context.tsx +4 -1
- package/src/react/use-custom-chart-context.util.ts +6 -3
- package/src/types/answer-column.types.ts +29 -6
- package/src/types/chart-to-ts-event.types.ts +7 -0
- package/src/types/common.types.ts +103 -8
- package/src/types/conditional-formatting.types.ts +2 -17
- package/src/types/configurator.types.ts +15 -1
- package/src/types/number-formatting.types.ts +80 -0
- package/src/types/ts-to-chart-event.types.ts +54 -5
- package/src/types/visual-prop.types.ts +197 -3
- package/src/utils/conditional-formatting/conditional-formatting.spec.ts +2 -0
- package/src/utils/date-formatting.spec.ts +377 -32
- package/src/utils/date-formatting.ts +587 -14
- 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
- package/src/utils/globalize-Initializer/globalize-utils.spec.ts +192 -0
- package/src/utils/globalize-Initializer/globalize-utils.ts +216 -0
- package/src/utils/number-formatting/number-formatting-utils.spec.ts +296 -0
- package/src/utils/number-formatting/number-formatting-utils.ts +260 -0
- package/src/utils/number-formatting/number-formatting.spec.ts +243 -0
- package/src/utils/number-formatting/number-formatting.ts +264 -0
package/dist/ts-chart-sdk.d.ts
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
// Generated by dts-bundle v0.7.3
|
|
2
2
|
// Dependencies for this module:
|
|
3
|
+
// ../globalize
|
|
3
4
|
// ../react
|
|
4
5
|
|
|
6
|
+
import Globalize from 'globalize';
|
|
5
7
|
import React from 'react';
|
|
6
8
|
|
|
9
|
+
export type Maybe<T> = T | null;
|
|
10
|
+
export type InputMaybe<T> = Maybe<T>;
|
|
11
|
+
export type Scalars = {
|
|
12
|
+
ID: string;
|
|
13
|
+
String: string;
|
|
14
|
+
Boolean: boolean;
|
|
15
|
+
Int: number;
|
|
16
|
+
Float: number;
|
|
17
|
+
FileUpload: unknown;
|
|
18
|
+
GUID: string;
|
|
19
|
+
JSON: {
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
JSONObject: unknown;
|
|
23
|
+
Long: unknown;
|
|
24
|
+
};
|
|
7
25
|
export enum CustomizableChartFeature {
|
|
8
26
|
X_AXIS_LABEL = 0,
|
|
9
27
|
X_AXIS_TITLE = 1,
|
|
@@ -49,13 +67,19 @@ export type SuccessValidationResponse = {
|
|
|
49
67
|
chartConfigEditorDefinition: ChartConfigEditorDefinition[];
|
|
50
68
|
visualPropEditorDefinition: VisualPropEditorDefinition;
|
|
51
69
|
};
|
|
70
|
+
export type VisualPropError = {
|
|
71
|
+
propElementKey: string;
|
|
72
|
+
propElementType: string;
|
|
73
|
+
value: unknown;
|
|
74
|
+
};
|
|
52
75
|
export type ValidationResponse = {
|
|
53
76
|
isValid: boolean;
|
|
54
77
|
validationErrorMessage?: string[];
|
|
78
|
+
visualPropError?: VisualPropError;
|
|
55
79
|
};
|
|
56
80
|
export type VisualProps = unknown;
|
|
57
|
-
export type
|
|
58
|
-
guid: string;
|
|
81
|
+
export type TSFontFace = {
|
|
82
|
+
guid: string | null;
|
|
59
83
|
family?: string;
|
|
60
84
|
format?: string;
|
|
61
85
|
url?: string;
|
|
@@ -77,12 +101,49 @@ export type ChartSdkCustomStylingConfig = {
|
|
|
77
101
|
chartColorPalettes?: Array<{
|
|
78
102
|
colors: Array<string>;
|
|
79
103
|
}>;
|
|
104
|
+
numColorPalettes?: number;
|
|
80
105
|
disableColorRotation?: boolean;
|
|
81
106
|
chartFeatureToFontGuid?: Record<CustomizableChartFeature, string>;
|
|
82
|
-
|
|
107
|
+
fontFaces?: Array<TSFontFace>;
|
|
108
|
+
};
|
|
109
|
+
export interface DateFormats {
|
|
110
|
+
DATE_SHORT: string;
|
|
111
|
+
DATE_SHORT_2_DIGIT_YEAR: string;
|
|
112
|
+
DATE_SHORT_WITH_HOUR: string;
|
|
113
|
+
DATE_SHORT_WITH_HOUR_WITHOUT_YEAR: string;
|
|
114
|
+
DATE_SHORT_WITH_HOUR_24: string;
|
|
115
|
+
DATE_SHORT_WITH_HOUR_24_WITHOUT_YEAR: string;
|
|
116
|
+
DATETIME_SHORT: string;
|
|
117
|
+
DATETIME_SHORT_WITHOUT_YEAR: string;
|
|
118
|
+
DATETIME_24_SHORT: string;
|
|
119
|
+
DATETIME_24_SHORT_WITH_MILLIS: string;
|
|
120
|
+
DATETIME_24_SHORT_WITH_MILLIS_WITHOUT_YEAR: string;
|
|
121
|
+
DATETIME_SHORT_WITH_SECONDS: string;
|
|
122
|
+
DATETIME_SHORT_WITH_SECONDS_WITHOUT_YEAR: string;
|
|
123
|
+
DATETIME_SHORT_WITH_MILLIS: string;
|
|
124
|
+
DATETIME_SHORT_WITH_MILLIS_WITHOUT_YEAR: string;
|
|
125
|
+
QUARTER_WITH_YEAR: string;
|
|
126
|
+
QUARTER_WITH_2_DIGIT_YEAR: string;
|
|
127
|
+
DEFAULT_TIME_FORMAT: string;
|
|
128
|
+
MONTH_WITH_YEAR: string;
|
|
129
|
+
MONTH_WITH_DAY_AND_YEAR: string;
|
|
130
|
+
MONTH_WITH_2_DIGIT_YEAR: string;
|
|
131
|
+
DAY_WITH_MONTH: string;
|
|
132
|
+
DAY_WITH_MONTH_NUM: string;
|
|
133
|
+
QUARTER: string;
|
|
134
|
+
MONTH_ONLY: string;
|
|
135
|
+
DATETIME_WITH_SHORT_OFFSET: string;
|
|
136
|
+
}
|
|
137
|
+
export type ChartSdkDateFormatsConfig = {
|
|
138
|
+
tsLocaleBasedDateFormats?: Record<string, DateFormats>;
|
|
139
|
+
tsLocaleBasedStringsFormats?: Record<string, string>;
|
|
140
|
+
tsDateConstants?: Record<string, string>;
|
|
141
|
+
tsDefinedCustomCalenders?: any;
|
|
142
|
+
defaultDataSourceId?: string;
|
|
83
143
|
};
|
|
84
144
|
export interface AppConfig {
|
|
85
145
|
styleConfig?: ChartSdkCustomStylingConfig;
|
|
146
|
+
dateFormatsConfig?: ChartSdkDateFormatsConfig;
|
|
86
147
|
appOptions?: {
|
|
87
148
|
isMobile?: boolean;
|
|
88
149
|
isPrintMode?: boolean;
|
|
@@ -96,6 +157,7 @@ export interface AppConfig {
|
|
|
96
157
|
};
|
|
97
158
|
appUrl?: string;
|
|
98
159
|
customCalendarConfig?: any;
|
|
160
|
+
chartAppAccessToken?: string;
|
|
99
161
|
}
|
|
100
162
|
|
|
101
163
|
export interface ChartConfigSection {
|
|
@@ -105,6 +167,8 @@ export interface ChartConfigSection {
|
|
|
105
167
|
allowMeasureColumns?: boolean;
|
|
106
168
|
allowAttributeColumns?: boolean;
|
|
107
169
|
allowTimeSeriesColumns?: boolean;
|
|
170
|
+
allowMeasureNameColumn?: boolean;
|
|
171
|
+
allowMeasureValueColumn?: boolean;
|
|
108
172
|
}
|
|
109
173
|
export interface ChartConfigEditorDefinition {
|
|
110
174
|
key: string;
|
|
@@ -114,6 +178,40 @@ export interface ChartConfigEditorDefinition {
|
|
|
114
178
|
}
|
|
115
179
|
export type ConfigEditorDefinitionSetter = (currentState: ChartModel, ctx: CustomChartContext) => ChartConfigEditorDefinition[];
|
|
116
180
|
|
|
181
|
+
export type TSTooltipConfig = {
|
|
182
|
+
columnIds: Array<string>;
|
|
183
|
+
};
|
|
184
|
+
export enum VisualPropComponentTranslationKeys {
|
|
185
|
+
SHOW_ALL_LABELS = "SHOW_ALL_LABELS",
|
|
186
|
+
TOO_MANY_LABELS = "TOO_MANY_LABELS",
|
|
187
|
+
MAP_TILE_LABEL = "MAP_TILE_LABEL",
|
|
188
|
+
ENABLE_MARKERS = "ENABLE_MARKERS",
|
|
189
|
+
SHOW_REGRESSION_LINE = "SHOW_REGRESSION_LINE",
|
|
190
|
+
X_AXIS_GRID_LINE = "X_AXIS_GRID_LINE",
|
|
191
|
+
Y_AXIS_GRID_LINE = "Y_AXIS_GRID_LINE",
|
|
192
|
+
MAX_DATA_POINTS = "MAX_DATA_POINTS",
|
|
193
|
+
HIGH_CARDINALITY_BATCH_SIZE_DISABLED = "highCardinalityBatchSizeDisabled",
|
|
194
|
+
HIGH_CARDINALITY_BATCH_SIZE_LIMIT = "highCardinalityBatchSizeLimit",
|
|
195
|
+
CHART_CUSTOMIZE = "CHART_CUSTOMIZE",
|
|
196
|
+
SELECT_AN_AREA = "chartConfigurator.SELECT_AN_AREA",
|
|
197
|
+
RESET_ZOOM = "chartConfigurator.RESET_ZOOM",
|
|
198
|
+
EDIT_TOOLTIP = "EDIT_TOOLTIP",
|
|
199
|
+
DONT_SHOW = "DONT_SHOW",
|
|
200
|
+
SHOW_GAP = "SHOW_GAP",
|
|
201
|
+
SHOW_AS_ZERO = "SHOW_AS_ZERO",
|
|
202
|
+
HANDLE_MISSING_VALUES = "HANDLE_MISSING_VALUES",
|
|
203
|
+
SHOW_NULL_AS_ZERO = "SHOW_NULL_AS_ZERO",
|
|
204
|
+
EXCLUDE_NULL_VALUES = "EXCLUDE_NULL_VALUES",
|
|
205
|
+
COLUMN_CUSTOMIZE = "COLUMN_CUSTOMIZE",
|
|
206
|
+
SHOW_TOTAL_LABELS = "SHOW_TOTAL_LABELS",
|
|
207
|
+
SHOW_DETAILED_LABELS = "SHOW_DETAILED_LABELS",
|
|
208
|
+
SHOW_DATA_LABELS = "SHOW_DATA_LABELS",
|
|
209
|
+
SHOW_AXIS_AS_PERCENT = "SHOW_AXIS_AS_PERCENT",
|
|
210
|
+
RIGHT_LEGEND = "RIGHT_LEGEND",
|
|
211
|
+
LEFT_LEGEND = "LEFT_LEGEND",
|
|
212
|
+
TOP_LEGEND = "TOP_LEGEND",
|
|
213
|
+
BOTTOM_LEGEND = "BOTTOM_LEGEND"
|
|
214
|
+
}
|
|
117
215
|
export interface InputValidation {
|
|
118
216
|
required?: boolean;
|
|
119
217
|
requiredError?: string;
|
|
@@ -133,6 +231,8 @@ export interface TextInputFormDetail {
|
|
|
133
231
|
placeholder?: string;
|
|
134
232
|
defaultValue?: string;
|
|
135
233
|
inputValidation?: InputValidation;
|
|
234
|
+
disabled?: boolean;
|
|
235
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
136
236
|
}
|
|
137
237
|
export interface NumberInputFormDetail {
|
|
138
238
|
type: 'number';
|
|
@@ -140,6 +240,8 @@ export interface NumberInputFormDetail {
|
|
|
140
240
|
label?: string;
|
|
141
241
|
defaultValue?: number;
|
|
142
242
|
inputValidation?: InputValidation;
|
|
243
|
+
disabled?: boolean;
|
|
244
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
143
245
|
}
|
|
144
246
|
export interface ColorPickerFormDetail {
|
|
145
247
|
type: 'colorpicker';
|
|
@@ -147,18 +249,23 @@ export interface ColorPickerFormDetail {
|
|
|
147
249
|
label?: string;
|
|
148
250
|
selectorType?: 'FONT' | 'COLOR';
|
|
149
251
|
defaultValue?: string;
|
|
252
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
150
253
|
}
|
|
151
254
|
export interface ToggleFormDetail {
|
|
152
255
|
type: 'toggle';
|
|
153
256
|
key: string;
|
|
154
257
|
label?: string;
|
|
155
258
|
defaultValue?: boolean;
|
|
259
|
+
disabled?: boolean;
|
|
260
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
156
261
|
}
|
|
157
262
|
export interface CheckboxFormDetail {
|
|
158
263
|
type: 'checkbox';
|
|
159
264
|
key: string;
|
|
160
265
|
label?: string;
|
|
161
266
|
defaultValue?: boolean;
|
|
267
|
+
disabled?: boolean;
|
|
268
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
162
269
|
}
|
|
163
270
|
export interface RadioButtonFormDetail {
|
|
164
271
|
type: 'radio';
|
|
@@ -166,6 +273,8 @@ export interface RadioButtonFormDetail {
|
|
|
166
273
|
label?: string;
|
|
167
274
|
defaultValue?: string;
|
|
168
275
|
values: string[];
|
|
276
|
+
disabled?: boolean;
|
|
277
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
169
278
|
}
|
|
170
279
|
export interface DropDownFormDetail {
|
|
171
280
|
type: 'dropdown';
|
|
@@ -173,6 +282,8 @@ export interface DropDownFormDetail {
|
|
|
173
282
|
label?: string;
|
|
174
283
|
defaultValue?: string;
|
|
175
284
|
values: string[];
|
|
285
|
+
disabled?: boolean;
|
|
286
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
176
287
|
}
|
|
177
288
|
export interface Section {
|
|
178
289
|
type: 'section';
|
|
@@ -181,17 +292,43 @@ export interface Section {
|
|
|
181
292
|
children?: PropElement[];
|
|
182
293
|
alignment?: 'row' | 'column';
|
|
183
294
|
layoutType?: 'accordion' | 'tab' | 'none';
|
|
295
|
+
disabled?: boolean;
|
|
296
|
+
isAccordianExpanded?: boolean;
|
|
297
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
298
|
+
}
|
|
299
|
+
export interface NativeEditToolTip {
|
|
300
|
+
type: 'tooltipconfig';
|
|
301
|
+
key: string;
|
|
302
|
+
defaultValue?: TSTooltipConfig;
|
|
303
|
+
label?: string;
|
|
304
|
+
disabled?: boolean;
|
|
305
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
306
|
+
}
|
|
307
|
+
export type PropElement = Section | TextInputFormDetail | NumberInputFormDetail | ColorPickerFormDetail | ToggleFormDetail | CheckboxFormDetail | RadioButtonFormDetail | DropDownFormDetail | NativeEditToolTip;
|
|
308
|
+
export interface ColumnProp {
|
|
309
|
+
type: ColumnType;
|
|
310
|
+
columnSettingsDefinition: {
|
|
311
|
+
[columnId: string]: {
|
|
312
|
+
elements: PropElement[];
|
|
313
|
+
};
|
|
314
|
+
};
|
|
184
315
|
}
|
|
185
|
-
export type PropElement = Section | TextInputFormDetail | NumberInputFormDetail | ColorPickerFormDetail | ToggleFormDetail | CheckboxFormDetail | RadioButtonFormDetail | DropDownFormDetail;
|
|
186
316
|
export interface VisualPropEditorDefinition {
|
|
187
317
|
elements: PropElement[];
|
|
318
|
+
columnsVizPropDefinition?: ColumnProp[];
|
|
188
319
|
}
|
|
189
|
-
export type VisualEditorDefinitionSetter = (currentState: ChartModel, ctx: CustomChartContext) => VisualPropEditorDefinition;
|
|
320
|
+
export type VisualEditorDefinitionSetter = (currentState: ChartModel, ctx: CustomChartContext, activeColumnId?: string) => VisualPropEditorDefinition;
|
|
190
321
|
|
|
191
322
|
export enum ColumnType {
|
|
192
323
|
UNKNOWN = 0,
|
|
193
324
|
MEASURE = 1,
|
|
194
|
-
ATTRIBUTE = 2
|
|
325
|
+
ATTRIBUTE = 2,
|
|
326
|
+
VIRTUAL = 3
|
|
327
|
+
}
|
|
328
|
+
export enum ChartSpecificColumnType {
|
|
329
|
+
UNKNOWN = 0,
|
|
330
|
+
MEASURE_NAMES = 1,
|
|
331
|
+
MEASURE_VALUES = 2
|
|
195
332
|
}
|
|
196
333
|
export enum DataType {
|
|
197
334
|
UNKNOWN = 0,
|
|
@@ -234,9 +371,9 @@ export enum FormatType {
|
|
|
234
371
|
CURRENCY = 3
|
|
235
372
|
}
|
|
236
373
|
export enum CurrencyFormatType {
|
|
237
|
-
USER_LOCALE =
|
|
238
|
-
COLUMN =
|
|
239
|
-
ISO_CODE =
|
|
374
|
+
USER_LOCALE = "USER_LOCALE",
|
|
375
|
+
COLUMN = "COLUMN",
|
|
376
|
+
ISO_CODE = "ISO_CODE"
|
|
240
377
|
}
|
|
241
378
|
export enum ColumnAggregationType {
|
|
242
379
|
AGGREGATE = 0,
|
|
@@ -296,10 +433,12 @@ export interface ChartColumn {
|
|
|
296
433
|
format?: ColumnFormat;
|
|
297
434
|
columnProperties?: {
|
|
298
435
|
conditionalFormatting?: Maybe<ConditionalFormatting>;
|
|
436
|
+
numberFormatting?: Maybe<FormatConfig>;
|
|
299
437
|
};
|
|
300
438
|
aggregationType?: ColumnAggregationType;
|
|
301
439
|
customOrder?: Array<string>;
|
|
302
440
|
calenderGuid?: string;
|
|
441
|
+
chartSpecificColumnType: ChartSpecificColumnType;
|
|
303
442
|
}
|
|
304
443
|
|
|
305
444
|
export enum ChartToTSEvent {
|
|
@@ -307,6 +446,7 @@ export enum ChartToTSEvent {
|
|
|
307
446
|
CloseContextMenu = "CloseContextMenu",
|
|
308
447
|
OpenAxisMenu = "OpenAxisMenu",
|
|
309
448
|
CloseAxisMenu = "CloseAxisMenu",
|
|
449
|
+
InitStart = "InitStart",
|
|
310
450
|
RenderStart = "RenderStart",
|
|
311
451
|
RenderError = "RenderError",
|
|
312
452
|
RenderComplete = "RenderComplete",
|
|
@@ -320,6 +460,7 @@ export enum ChartToTSEvent {
|
|
|
320
460
|
export interface ChartToTSEventsPayloadMap {
|
|
321
461
|
[ChartToTSEvent.OpenContextMenu]: [OpenContextMenuEventPayload];
|
|
322
462
|
[ChartToTSEvent.CloseContextMenu]: [];
|
|
463
|
+
[ChartToTSEvent.InitStart]: [];
|
|
323
464
|
[ChartToTSEvent.RenderStart]: [];
|
|
324
465
|
[ChartToTSEvent.RenderComplete]: [];
|
|
325
466
|
[ChartToTSEvent.RenderError]: [RenderErrorEventPayload];
|
|
@@ -409,7 +550,8 @@ export enum TSToChartEvent {
|
|
|
409
550
|
VisualPropsValidate = "VisualPropsValidate",
|
|
410
551
|
VisualPropsUpdate = "VisualPropsUpdate",
|
|
411
552
|
ContextMenuActionClick = "ContextMenuActionClick",
|
|
412
|
-
AxisMenuActionClick = "AxisMenuActionClick"
|
|
553
|
+
AxisMenuActionClick = "AxisMenuActionClick",
|
|
554
|
+
GetColumnData = "GetColumnData"
|
|
413
555
|
}
|
|
414
556
|
export interface TSToChartEventsPayloadMap {
|
|
415
557
|
[TSToChartEvent.ChartModelUpdate]: (payload: ChartModelUpdateEventPayload) => void;
|
|
@@ -420,6 +562,7 @@ export interface TSToChartInternalEventsPayloadMap {
|
|
|
420
562
|
[TSToChartEvent.Initialize]: (payload: InitializeEventPayload) => InitializeEventResponsePayload;
|
|
421
563
|
[TSToChartEvent.InitializeComplete]: () => void;
|
|
422
564
|
[TSToChartEvent.GetDataQuery]: (payload: GetDataQueryPayload) => GetDataQueryResponsePayload;
|
|
565
|
+
[TSToChartEvent.GetColumnData]: (payload: GetColumnDataPayload) => GetColumnDataResponsePayload;
|
|
423
566
|
[TSToChartEvent.ChartConfigValidate]: (payload: ChartConfigValidateEventPayload) => ValidationResponse;
|
|
424
567
|
[TSToChartEvent.VisualPropsValidate]: (payload: VisualPropsValidateEventPayload) => ValidationResponse;
|
|
425
568
|
[TSToChartEvent.TriggerRenderChart]: () => void;
|
|
@@ -439,12 +582,19 @@ export interface InitializeEventResponsePayload {
|
|
|
439
582
|
chartConfigEditorDefinition?: ChartConfigEditorDefinition[];
|
|
440
583
|
visualPropEditorDefinition?: VisualPropEditorDefinition;
|
|
441
584
|
allowedConfigurations?: AllowedConfigurations;
|
|
585
|
+
chartConfigParameters?: ChartConfigParameters;
|
|
442
586
|
}
|
|
443
587
|
export interface GetDataQueryPayload {
|
|
444
588
|
config: ChartConfig[];
|
|
445
589
|
}
|
|
590
|
+
export interface GetColumnDataPayload {
|
|
591
|
+
columnId: string;
|
|
592
|
+
}
|
|
593
|
+
export interface QueryColumn extends ChartColumn {
|
|
594
|
+
isMeasureValue?: boolean;
|
|
595
|
+
}
|
|
446
596
|
export interface Query {
|
|
447
|
-
queryColumns:
|
|
597
|
+
queryColumns: QueryColumn[];
|
|
448
598
|
queryParams?: {
|
|
449
599
|
offset?: number;
|
|
450
600
|
size?: number;
|
|
@@ -453,6 +603,9 @@ export interface Query {
|
|
|
453
603
|
export interface GetDataQueryResponsePayload {
|
|
454
604
|
queries: Query[];
|
|
455
605
|
}
|
|
606
|
+
export interface GetColumnDataResponsePayload {
|
|
607
|
+
data?: any[];
|
|
608
|
+
}
|
|
456
609
|
export interface ChartModelUpdateEventPayload {
|
|
457
610
|
chartModel: ChartModel;
|
|
458
611
|
}
|
|
@@ -464,6 +617,7 @@ export interface VisualPropsUpdateEventPayload {
|
|
|
464
617
|
}
|
|
465
618
|
export interface VisualPropsValidateEventPayload {
|
|
466
619
|
visualProps: VisualProps;
|
|
620
|
+
activeColumnId?: string;
|
|
467
621
|
}
|
|
468
622
|
export interface ChartConfigValidateEventPayload {
|
|
469
623
|
chartConfig: ChartConfig[];
|
|
@@ -487,18 +641,30 @@ export interface AxisMenuCustomActionPayload {
|
|
|
487
641
|
}
|
|
488
642
|
|
|
489
643
|
export type AllowedConfigurations = {
|
|
490
|
-
allowColumnNumberFormatting
|
|
491
|
-
allowColumnConditionalFormatting
|
|
644
|
+
allowColumnNumberFormatting?: boolean;
|
|
645
|
+
allowColumnConditionalFormatting?: boolean;
|
|
646
|
+
allowGradientColoring?: boolean;
|
|
647
|
+
allowMeasureNamesAndValues?: boolean;
|
|
648
|
+
};
|
|
649
|
+
export type ChartConfigParameters = {
|
|
650
|
+
measureNameValueColumns?: {
|
|
651
|
+
enableMeasureNameColumn?: boolean;
|
|
652
|
+
enableMeasureValueColumn?: boolean;
|
|
653
|
+
measureNameColumnAlias?: string;
|
|
654
|
+
measureValueColumnAlias?: string;
|
|
655
|
+
};
|
|
656
|
+
batchSizeLimit?: number;
|
|
492
657
|
};
|
|
493
658
|
export type CustomChartContextProps = {
|
|
494
659
|
getDefaultChartConfig: (chartModel: ChartModel) => ChartConfig[];
|
|
495
660
|
getQueriesFromChartConfig: (chartConfig: ChartConfig[], chartModel: ChartModel) => Query[];
|
|
496
661
|
renderChart: (ctx: CustomChartContext) => Promise<void>;
|
|
497
662
|
validateConfig?: (updatedConfig: ChartConfig[], chartModel: ChartModel) => ValidationResponse;
|
|
498
|
-
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel) => ValidationResponse;
|
|
663
|
+
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel, activeColumnId?: string) => ValidationResponse;
|
|
499
664
|
chartConfigEditorDefinition?: ConfigEditorDefinitionSetter | ChartConfigEditorDefinition[];
|
|
500
665
|
visualPropEditorDefinition?: VisualEditorDefinitionSetter | VisualPropEditorDefinition;
|
|
501
666
|
allowedConfigurations?: AllowedConfigurations;
|
|
667
|
+
chartConfigParameters?: ChartConfigParameters;
|
|
502
668
|
};
|
|
503
669
|
export type ValidationFunctions = CustomChartContextProps['validateVisualProps'] | CustomChartContextProps['validateConfig'];
|
|
504
670
|
export class CustomChartContext {
|
|
@@ -518,26 +684,10 @@ export const getChartContext: (customChartConfig: CustomChartContextProps) => Pr
|
|
|
518
684
|
|
|
519
685
|
export const useChartContext: (props: Omit<CustomChartContextProps, 'renderChart'>) => ChartContextProps;
|
|
520
686
|
|
|
521
|
-
export type Maybe<T> = T | null;
|
|
522
|
-
export type InputMaybe<T> = Maybe<T>;
|
|
523
687
|
export type ConditionalFormatting = {
|
|
524
688
|
__typename?: 'ConditionalFormatting';
|
|
525
689
|
rows?: Maybe<Array<Maybe<ConditionalMetric>>>;
|
|
526
690
|
};
|
|
527
|
-
export type Scalars = {
|
|
528
|
-
ID: string;
|
|
529
|
-
String: string;
|
|
530
|
-
Boolean: boolean;
|
|
531
|
-
Int: number;
|
|
532
|
-
Float: number;
|
|
533
|
-
FileUpload: any;
|
|
534
|
-
GUID: string;
|
|
535
|
-
JSON: {
|
|
536
|
-
[key: string]: any;
|
|
537
|
-
};
|
|
538
|
-
JSONObject: any;
|
|
539
|
-
Long: any;
|
|
540
|
-
};
|
|
541
691
|
export enum BackgroundFormatTypes {
|
|
542
692
|
Gradient = "GRADIENT",
|
|
543
693
|
Solid = "SOLID"
|
|
@@ -673,6 +823,60 @@ export enum ParameterValueType {
|
|
|
673
823
|
Range = "RANGE"
|
|
674
824
|
}
|
|
675
825
|
|
|
826
|
+
export enum CategoryType {
|
|
827
|
+
Currency = "CURRENCY",
|
|
828
|
+
Custom = "CUSTOM",
|
|
829
|
+
Number = "NUMBER",
|
|
830
|
+
Percentage = "PERCENTAGE"
|
|
831
|
+
}
|
|
832
|
+
export enum Unit {
|
|
833
|
+
Auto = "AUTO",
|
|
834
|
+
Billion = "BILLION",
|
|
835
|
+
Million = "MILLION",
|
|
836
|
+
None = "NONE",
|
|
837
|
+
Thousands = "THOUSANDS",
|
|
838
|
+
Trillion = "TRILLION"
|
|
839
|
+
}
|
|
840
|
+
export enum NegativeValueFormat {
|
|
841
|
+
BracesNodash = "BRACES_NODASH",
|
|
842
|
+
PrefixDash = "PREFIX_DASH",
|
|
843
|
+
SuffixDash = "SUFFIX_DASH"
|
|
844
|
+
}
|
|
845
|
+
export type CurrencyFormatConfig = {
|
|
846
|
+
__typename?: 'CurrencyFormatConfig';
|
|
847
|
+
decimals?: Maybe<Scalars['Float']>;
|
|
848
|
+
locale?: Maybe<Scalars['String']>;
|
|
849
|
+
removeTrailingZeroes?: Maybe<Scalars['Boolean']>;
|
|
850
|
+
toSeparateThousands?: Maybe<Scalars['Boolean']>;
|
|
851
|
+
unit?: Maybe<Unit>;
|
|
852
|
+
};
|
|
853
|
+
export type CustomFormatConfig = {
|
|
854
|
+
__typename?: 'CustomFormatConfig';
|
|
855
|
+
format?: Maybe<Scalars['String']>;
|
|
856
|
+
};
|
|
857
|
+
export type NumberFormatConfig = {
|
|
858
|
+
__typename?: 'NumberFormatConfig';
|
|
859
|
+
decimals?: Maybe<Scalars['Float']>;
|
|
860
|
+
negativeValueFormat?: Maybe<NegativeValueFormat>;
|
|
861
|
+
removeTrailingZeroes?: Maybe<Scalars['Boolean']>;
|
|
862
|
+
toSeparateThousands?: Maybe<Scalars['Boolean']>;
|
|
863
|
+
unit?: Maybe<Unit>;
|
|
864
|
+
};
|
|
865
|
+
export type PercentageFormatConfig = {
|
|
866
|
+
__typename?: 'PercentageFormatConfig';
|
|
867
|
+
decimals?: Maybe<Scalars['Float']>;
|
|
868
|
+
removeTrailingZeroes?: Maybe<Scalars['Boolean']>;
|
|
869
|
+
};
|
|
870
|
+
export type FormatConfig = {
|
|
871
|
+
__typename?: 'FormatConfig';
|
|
872
|
+
category?: Maybe<CategoryType>;
|
|
873
|
+
currencyFormatConfig?: Maybe<CurrencyFormatConfig>;
|
|
874
|
+
customFormatConfig?: Maybe<CustomFormatConfig>;
|
|
875
|
+
isCategoryEditable?: Maybe<Scalars['Boolean']>;
|
|
876
|
+
numberFormatConfig?: Maybe<NumberFormatConfig>;
|
|
877
|
+
percentageFormatConfig?: Maybe<PercentageFormatConfig>;
|
|
878
|
+
};
|
|
879
|
+
|
|
676
880
|
export interface CustomCalendarDate {
|
|
677
881
|
v: {
|
|
678
882
|
s: number;
|
|
@@ -680,16 +884,100 @@ export interface CustomCalendarDate {
|
|
|
680
884
|
};
|
|
681
885
|
d: string;
|
|
682
886
|
}
|
|
887
|
+
export const dateFormatPresets: {
|
|
888
|
+
DATE_SHORT: string;
|
|
889
|
+
DATE_SHORT_WITH_HOUR: string;
|
|
890
|
+
DATE_SHORT_WITH_HOUR_WITHOUT_YEAR: string;
|
|
891
|
+
DATETIME_SHORT: string;
|
|
892
|
+
DATETIME_SHORT_WITHOUT_YEAR: string;
|
|
893
|
+
DATETIME_SHORT_WITH_SECONDS: string;
|
|
894
|
+
DATETIME_SHORT_WITH_MILLIS: string;
|
|
895
|
+
MONTH_WITH_YEAR: string;
|
|
896
|
+
QUARTER_WITH_YEAR: string;
|
|
897
|
+
QUARTER_WITH_2_DIGIT_YEAR: string;
|
|
898
|
+
DEFAULT_TIME_FORMAT: string;
|
|
899
|
+
TIME_24_WITH_SECONDS: string;
|
|
900
|
+
DATE_SHORT_2_DIGIT_YEAR: string;
|
|
901
|
+
DATETIME_24_SHORT_WITHOUT_YEAR: string;
|
|
902
|
+
DATETIME_24_SHORT: string;
|
|
903
|
+
DATETIME_SHORT_WITH_SECONDS_WITHOUT_YEAR: string;
|
|
904
|
+
DATETIME_SHORT_WITH_MILLIS_WITHOUT_YEAR: string;
|
|
905
|
+
DATETIME_24_SHORT_WITH_MILLIS_WITHOUT_YEAR: string;
|
|
906
|
+
DATETIME_24_SHORT_WITH_MILLIS: string;
|
|
907
|
+
MONTH_WITH_DAY_AND_YEAR: string;
|
|
908
|
+
MONTH_WITH_2_DIGIT_YEAR: string;
|
|
909
|
+
DAY_WITH_MONTH_NUM: string;
|
|
910
|
+
DATE_SHORT_WITH_HOUR_24_WITHOUT_YEAR: string;
|
|
911
|
+
DATE_SHORT_WITH_HOUR_24: string;
|
|
912
|
+
QUARTER: string;
|
|
913
|
+
MONTH_ONLY: string;
|
|
914
|
+
DATETIME_WITH_SHORT_OFFSET: string;
|
|
915
|
+
};
|
|
916
|
+
export const dateNumTypes: {
|
|
917
|
+
DATE_NUM_ABS_DAY: string;
|
|
918
|
+
DATE_NUM_ABS_MONTH: string;
|
|
919
|
+
DATE_NUM_ABS_QUARTER: string;
|
|
920
|
+
DATE_NUM_ABS_YEAR: string;
|
|
921
|
+
DATE_NUM_DAY_IN_MONTH: string;
|
|
922
|
+
DATE_NUM_DAY_IN_QUARTER: string;
|
|
923
|
+
DATE_NUM_DAY_IN_YEAR: string;
|
|
924
|
+
DATE_NUM_DAY_OF_WEEK: string;
|
|
925
|
+
DATE_NUM_MONTH_IN_QUARTER: string;
|
|
926
|
+
DATE_NUM_MONTH_IN_YEAR: string;
|
|
927
|
+
DATE_NUM_QUARTER_IN_YEAR: string;
|
|
928
|
+
DATE_NUM_WEEK_IN_YEAR: string;
|
|
929
|
+
DATE_NUM_WEEK_IN_QUARTER: string;
|
|
930
|
+
DATE_NUM_WEEK_IN_MONTH: string;
|
|
931
|
+
DATE_NUM_HOUR_IN_DAY: string;
|
|
932
|
+
};
|
|
933
|
+
export const bucketizationToDatePreset: {
|
|
934
|
+
HOURLY: string;
|
|
935
|
+
DAILY: string;
|
|
936
|
+
WEEKLY: string;
|
|
937
|
+
MONTHLY: string;
|
|
938
|
+
QUARTERLY: string;
|
|
939
|
+
YEARLY: string;
|
|
940
|
+
};
|
|
941
|
+
export const timeBuckets: {
|
|
942
|
+
NO_BUCKET: string;
|
|
943
|
+
HOURLY: string;
|
|
944
|
+
DAILY: string;
|
|
945
|
+
WEEKLY: string;
|
|
946
|
+
MONTHLY: string;
|
|
947
|
+
QUARTERLY: string;
|
|
948
|
+
YEARLY: string;
|
|
949
|
+
DAY_OF_WEEK: string;
|
|
950
|
+
DAY_OF_MONTH: string;
|
|
951
|
+
DAY_OF_QUARTER: string;
|
|
952
|
+
DAY_OF_YEAR: string;
|
|
953
|
+
WEEK_OF_MONTH: string;
|
|
954
|
+
WEEK_OF_QUARTER: string;
|
|
955
|
+
WEEK_OF_YEAR: string;
|
|
956
|
+
MONTH_OF_QUARTER: string;
|
|
957
|
+
MONTH_OF_YEAR: string;
|
|
958
|
+
QUARTER_OF_YEAR: string;
|
|
959
|
+
};
|
|
683
960
|
export const isDateColumn: (col: ChartColumn) => boolean;
|
|
684
961
|
export const isAttribute: (col: ChartColumn) => boolean;
|
|
962
|
+
export const isDateTimeColumn: (col: ChartColumn) => boolean;
|
|
685
963
|
export const getCustomCalendarGuidFromColumn: (col: ChartColumn) => string | undefined;
|
|
686
964
|
export const isDateNumColumn: (col: ChartColumn) => boolean;
|
|
687
965
|
export const isDateFamilyColumn: (col: ChartColumn) => boolean;
|
|
688
966
|
export const isTimeColumn: (col: ChartColumn) => boolean;
|
|
967
|
+
export const getEffectiveDateNumDataType: (col: ChartColumn) => string | undefined;
|
|
689
968
|
export const hasCustomCalendar: (col: ChartColumn) => boolean;
|
|
690
969
|
export function getStartEpoch(date: CustomCalendarDate): number | null;
|
|
970
|
+
export const assignQuarterValueToString: (quarter_of_year: any, value: any) => any;
|
|
971
|
+
export function getMonthOfYear(num: any, quarterStartMonth: any, monthOfYear: any): any;
|
|
691
972
|
export function getDisplayString(date: CustomCalendarDate): string | null;
|
|
692
|
-
export
|
|
973
|
+
export const useQuarterStart: (luxonDate: any, quarterStartMonth: any) => any;
|
|
974
|
+
export const getCustomCalendarValueFromEpoch: (col: ChartColumn, dateEpoch: number, displayToCustomCalendarValueMap: any) => any;
|
|
975
|
+
export function getSpecialFormatData(value: string | number, options: any): any;
|
|
976
|
+
export function sanitizeDate(inputDate: string | number, format: string, options: any): any;
|
|
977
|
+
export const formatDateTime: (epochMillis: number, format: string, useSystemCalendar?: boolean, options?: any) => any;
|
|
978
|
+
export function getOrdinalSuffixedValue(i: number | string): string;
|
|
979
|
+
export function formatDateNum(effectiveDataType: string | undefined, value: number | string, formatPattern: string, options: any): any;
|
|
980
|
+
export function formatDate(inputDate: number | string, format: string, useSystemCalendar: boolean, options: any): string;
|
|
693
981
|
|
|
694
982
|
export const getMinRangeValue: (metric: ConditionalMetric) => number | undefined | null;
|
|
695
983
|
export const getMaxRangeValue: (metric: ConditionalMetric) => number | undefined | null;
|
|
@@ -698,6 +986,24 @@ export function validateCfCondition(conditionalMetric: ConditionalMetric, index:
|
|
|
698
986
|
export const applicableConditionalFormatting: (idx: number, columnId: string, dataArr: DataPointsArray, conditionalFormatting?: ConditionalFormatting) => ConditionalMetric | null;
|
|
699
987
|
export function getCfForColumn(column: ChartColumn): ConditionalFormatting | undefined;
|
|
700
988
|
|
|
989
|
+
export const formatCurrencyWithCustomPattern: (value: number, currencyCode: string, formatPattern: string) => string;
|
|
990
|
+
export const getFormattedValue: (value: string | number, formatConfigProp: FormatConfig, columnFormatConfig: ColumnFormat) => string;
|
|
991
|
+
|
|
992
|
+
export const getCountryCode: (locale: string) => string;
|
|
993
|
+
export const getDefaultCurrencyCode: () => string;
|
|
994
|
+
export const setGlobalizeLocale: (locale: string) => void;
|
|
995
|
+
export const getGlobalizeLocale: () => string;
|
|
996
|
+
export const setCurrentCurrencyFormat: (currencyFormat: any) => void;
|
|
997
|
+
export const getCurrentCurrencyFormat: () => any;
|
|
998
|
+
export const loadCurrencyData: (data: any) => void;
|
|
999
|
+
export const loadGlobalizeData: (data: any) => void;
|
|
1000
|
+
export const initGlobalize: (locale?: string) => void;
|
|
1001
|
+
export function globalizeNumberFormatter(format: Globalize.NumberFormatterOptions): (num: number) => string;
|
|
1002
|
+
export function globalizeCurrencyFormatter(currencyCode: string, format: Globalize.CurrencyFormatterOptions): (num: number) => string;
|
|
1003
|
+
export function formatNumberSafely<FormatOptions extends Globalize.NumberFormatterOptions>(format: FormatOptions, num: number): string;
|
|
1004
|
+
export const sanitizeFormat: (format: string) => string;
|
|
1005
|
+
export const validateNumberFormat: (format: string) => boolean;
|
|
1006
|
+
|
|
701
1007
|
export type ChartToTSEventEmitters = {
|
|
702
1008
|
[key in keyof ChartToTSEventsPayloadMap as `emit${Capitalize<key>}`]: (...args: ChartToTSEventsPayloadMap[key]) => Promise<void>;
|
|
703
1009
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ 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
9
|
export * from './types/conditional-formatting.types';
|
|
10
|
+
export * from './types/number-formatting.types';
|
|
10
11
|
export * from './utils/date-formatting';
|
|
11
12
|
export * from './utils/conditional-formatting/conditional-formatting';
|
|
13
|
+
export * from './utils/number-formatting/number-formatting';
|
|
14
|
+
export * from './utils/globalize-Initializer/globalize-utils';
|
|
12
15
|
//# 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;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yBAAyB,CAAC;AACxC,cAAc,uDAAuD,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,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,uDAAuD,CAAC;AACtE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+CAA+C,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -7,6 +7,9 @@ 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
9
|
export * from './types/conditional-formatting.types';
|
|
10
|
+
export * from './types/number-formatting.types';
|
|
10
11
|
export * from './utils/date-formatting';
|
|
11
12
|
export * from './utils/conditional-formatting/conditional-formatting';
|
|
13
|
+
export * from './utils/number-formatting/number-formatting';
|
|
14
|
+
export * from './utils/globalize-Initializer/globalize-utils';
|
|
12
15
|
//# 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;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yBAAyB,CAAC;AACxC,cAAc,uDAAuD,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,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,uDAAuD,CAAC;AACtE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+CAA+C,CAAC"}
|
|
@@ -4,18 +4,30 @@ import { ChartConfigEditorDefinition, ConfigEditorDefinitionSetter } from '../ty
|
|
|
4
4
|
import { Query, TSToChartEventsPayloadMap } from '../types/ts-to-chart-event.types';
|
|
5
5
|
import { VisualEditorDefinitionSetter, VisualPropEditorDefinition } from '../types/visual-prop.types';
|
|
6
6
|
export type AllowedConfigurations = {
|
|
7
|
-
allowColumnNumberFormatting
|
|
8
|
-
allowColumnConditionalFormatting
|
|
7
|
+
allowColumnNumberFormatting?: boolean;
|
|
8
|
+
allowColumnConditionalFormatting?: boolean;
|
|
9
|
+
allowGradientColoring?: boolean;
|
|
10
|
+
allowMeasureNamesAndValues?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type ChartConfigParameters = {
|
|
13
|
+
measureNameValueColumns?: {
|
|
14
|
+
enableMeasureNameColumn?: boolean;
|
|
15
|
+
enableMeasureValueColumn?: boolean;
|
|
16
|
+
measureNameColumnAlias?: string;
|
|
17
|
+
measureValueColumnAlias?: string;
|
|
18
|
+
};
|
|
19
|
+
batchSizeLimit?: number;
|
|
9
20
|
};
|
|
10
21
|
export type CustomChartContextProps = {
|
|
11
22
|
getDefaultChartConfig: (chartModel: ChartModel) => ChartConfig[];
|
|
12
23
|
getQueriesFromChartConfig: (chartConfig: ChartConfig[], chartModel: ChartModel) => Query[];
|
|
13
24
|
renderChart: (ctx: CustomChartContext) => Promise<void>;
|
|
14
25
|
validateConfig?: (updatedConfig: ChartConfig[], chartModel: ChartModel) => ValidationResponse;
|
|
15
|
-
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel) => ValidationResponse;
|
|
26
|
+
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel, activeColumnId?: string) => ValidationResponse;
|
|
16
27
|
chartConfigEditorDefinition?: ConfigEditorDefinitionSetter | ChartConfigEditorDefinition[];
|
|
17
28
|
visualPropEditorDefinition?: VisualEditorDefinitionSetter | VisualPropEditorDefinition;
|
|
18
29
|
allowedConfigurations?: AllowedConfigurations;
|
|
30
|
+
chartConfigParameters?: ChartConfigParameters;
|
|
19
31
|
};
|
|
20
32
|
export type ValidationFunctions = CustomChartContextProps['validateVisualProps'] | CustomChartContextProps['validateConfig'];
|
|
21
33
|
export declare class CustomChartContext {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-chart-context.d.ts","sourceRoot":"","sources":["../../src/main/custom-chart-context.ts"],"names":[],"mappings":"AASA,OAAO,EAGH,yBAAyB,EAIzB,wBAAwB,EACxB,2BAA2B,EAC9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,SAAS,EACT,WAAW,EACX,UAAU,EAEV,kBAAkB,EAClB,WAAW,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACH,2BAA2B,EAC3B,4BAA4B,EAC/B,MAAM,6BAA6B,CAAC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"custom-chart-context.d.ts","sourceRoot":"","sources":["../../src/main/custom-chart-context.ts"],"names":[],"mappings":"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"}
|