@thoughtspot/ts-chart-sdk 0.0.2-alpha.9 → 1.1.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 +330 -32
- 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 -4
- package/lib/main/custom-chart-context.d.ts.map +1 -1
- package/lib/main/custom-chart-context.js +46 -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 +7 -4
- package/lib/types/answer-column.types.d.ts.map +1 -1
- package/lib/types/answer-column.types.js +3 -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 -6
- 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 +1 -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 +20 -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/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 +301 -31
- 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 +4 -1
- package/src/index.ts +3 -0
- package/src/main/custom-chart-context.spec.ts +356 -6
- package/src/main/custom-chart-context.ts +205 -16
- 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 +9 -6
- package/src/types/chart-to-ts-event.types.ts +7 -0
- package/src/types/common.types.ts +100 -10
- package/src/types/conditional-formatting.types.ts +2 -17
- package/src/types/configurator.types.ts +1 -1
- package/src/types/number-formatting.types.ts +80 -0
- package/src/types/ts-to-chart-event.types.ts +63 -5
- package/src/types/visual-prop.types.ts +197 -3
- package/src/utils/date-formatting.spec.ts +375 -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,7 +157,7 @@ export interface AppConfig {
|
|
|
96
157
|
};
|
|
97
158
|
appUrl?: string;
|
|
98
159
|
customCalendarConfig?: any;
|
|
99
|
-
|
|
160
|
+
chartAppAccessToken?: string;
|
|
100
161
|
}
|
|
101
162
|
|
|
102
163
|
export interface ChartConfigSection {
|
|
@@ -117,6 +178,40 @@ export interface ChartConfigEditorDefinition {
|
|
|
117
178
|
}
|
|
118
179
|
export type ConfigEditorDefinitionSetter = (currentState: ChartModel, ctx: CustomChartContext) => ChartConfigEditorDefinition[];
|
|
119
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
|
+
}
|
|
120
215
|
export interface InputValidation {
|
|
121
216
|
required?: boolean;
|
|
122
217
|
requiredError?: string;
|
|
@@ -136,6 +231,8 @@ export interface TextInputFormDetail {
|
|
|
136
231
|
placeholder?: string;
|
|
137
232
|
defaultValue?: string;
|
|
138
233
|
inputValidation?: InputValidation;
|
|
234
|
+
disabled?: boolean;
|
|
235
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
139
236
|
}
|
|
140
237
|
export interface NumberInputFormDetail {
|
|
141
238
|
type: 'number';
|
|
@@ -143,6 +240,8 @@ export interface NumberInputFormDetail {
|
|
|
143
240
|
label?: string;
|
|
144
241
|
defaultValue?: number;
|
|
145
242
|
inputValidation?: InputValidation;
|
|
243
|
+
disabled?: boolean;
|
|
244
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
146
245
|
}
|
|
147
246
|
export interface ColorPickerFormDetail {
|
|
148
247
|
type: 'colorpicker';
|
|
@@ -150,18 +249,23 @@ export interface ColorPickerFormDetail {
|
|
|
150
249
|
label?: string;
|
|
151
250
|
selectorType?: 'FONT' | 'COLOR';
|
|
152
251
|
defaultValue?: string;
|
|
252
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
153
253
|
}
|
|
154
254
|
export interface ToggleFormDetail {
|
|
155
255
|
type: 'toggle';
|
|
156
256
|
key: string;
|
|
157
257
|
label?: string;
|
|
158
258
|
defaultValue?: boolean;
|
|
259
|
+
disabled?: boolean;
|
|
260
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
159
261
|
}
|
|
160
262
|
export interface CheckboxFormDetail {
|
|
161
263
|
type: 'checkbox';
|
|
162
264
|
key: string;
|
|
163
265
|
label?: string;
|
|
164
266
|
defaultValue?: boolean;
|
|
267
|
+
disabled?: boolean;
|
|
268
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
165
269
|
}
|
|
166
270
|
export interface RadioButtonFormDetail {
|
|
167
271
|
type: 'radio';
|
|
@@ -169,6 +273,8 @@ export interface RadioButtonFormDetail {
|
|
|
169
273
|
label?: string;
|
|
170
274
|
defaultValue?: string;
|
|
171
275
|
values: string[];
|
|
276
|
+
disabled?: boolean;
|
|
277
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
172
278
|
}
|
|
173
279
|
export interface DropDownFormDetail {
|
|
174
280
|
type: 'dropdown';
|
|
@@ -176,6 +282,8 @@ export interface DropDownFormDetail {
|
|
|
176
282
|
label?: string;
|
|
177
283
|
defaultValue?: string;
|
|
178
284
|
values: string[];
|
|
285
|
+
disabled?: boolean;
|
|
286
|
+
labelTranslation?: VisualPropComponentTranslationKeys;
|
|
179
287
|
}
|
|
180
288
|
export interface Section {
|
|
181
289
|
type: 'section';
|
|
@@ -184,12 +292,32 @@ export interface Section {
|
|
|
184
292
|
children?: PropElement[];
|
|
185
293
|
alignment?: 'row' | 'column';
|
|
186
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
|
+
};
|
|
187
315
|
}
|
|
188
|
-
export type PropElement = Section | TextInputFormDetail | NumberInputFormDetail | ColorPickerFormDetail | ToggleFormDetail | CheckboxFormDetail | RadioButtonFormDetail | DropDownFormDetail;
|
|
189
316
|
export interface VisualPropEditorDefinition {
|
|
190
317
|
elements: PropElement[];
|
|
318
|
+
columnsVizPropDefinition?: ColumnProp[];
|
|
191
319
|
}
|
|
192
|
-
export type VisualEditorDefinitionSetter = (currentState: ChartModel, ctx: CustomChartContext) => VisualPropEditorDefinition;
|
|
320
|
+
export type VisualEditorDefinitionSetter = (currentState: ChartModel, ctx: CustomChartContext, activeColumnId?: string) => VisualPropEditorDefinition;
|
|
193
321
|
|
|
194
322
|
export enum ColumnType {
|
|
195
323
|
UNKNOWN = 0,
|
|
@@ -243,9 +371,9 @@ export enum FormatType {
|
|
|
243
371
|
CURRENCY = 3
|
|
244
372
|
}
|
|
245
373
|
export enum CurrencyFormatType {
|
|
246
|
-
USER_LOCALE =
|
|
247
|
-
COLUMN =
|
|
248
|
-
ISO_CODE =
|
|
374
|
+
USER_LOCALE = "USER_LOCALE",
|
|
375
|
+
COLUMN = "COLUMN",
|
|
376
|
+
ISO_CODE = "ISO_CODE"
|
|
249
377
|
}
|
|
250
378
|
export enum ColumnAggregationType {
|
|
251
379
|
AGGREGATE = 0,
|
|
@@ -305,6 +433,7 @@ export interface ChartColumn {
|
|
|
305
433
|
format?: ColumnFormat;
|
|
306
434
|
columnProperties?: {
|
|
307
435
|
conditionalFormatting?: Maybe<ConditionalFormatting>;
|
|
436
|
+
numberFormatting?: Maybe<FormatConfig>;
|
|
308
437
|
};
|
|
309
438
|
aggregationType?: ColumnAggregationType;
|
|
310
439
|
customOrder?: Array<string>;
|
|
@@ -317,6 +446,7 @@ export enum ChartToTSEvent {
|
|
|
317
446
|
CloseContextMenu = "CloseContextMenu",
|
|
318
447
|
OpenAxisMenu = "OpenAxisMenu",
|
|
319
448
|
CloseAxisMenu = "CloseAxisMenu",
|
|
449
|
+
InitStart = "InitStart",
|
|
320
450
|
RenderStart = "RenderStart",
|
|
321
451
|
RenderError = "RenderError",
|
|
322
452
|
RenderComplete = "RenderComplete",
|
|
@@ -330,6 +460,7 @@ export enum ChartToTSEvent {
|
|
|
330
460
|
export interface ChartToTSEventsPayloadMap {
|
|
331
461
|
[ChartToTSEvent.OpenContextMenu]: [OpenContextMenuEventPayload];
|
|
332
462
|
[ChartToTSEvent.CloseContextMenu]: [];
|
|
463
|
+
[ChartToTSEvent.InitStart]: [];
|
|
333
464
|
[ChartToTSEvent.RenderStart]: [];
|
|
334
465
|
[ChartToTSEvent.RenderComplete]: [];
|
|
335
466
|
[ChartToTSEvent.RenderError]: [RenderErrorEventPayload];
|
|
@@ -419,7 +550,8 @@ export enum TSToChartEvent {
|
|
|
419
550
|
VisualPropsValidate = "VisualPropsValidate",
|
|
420
551
|
VisualPropsUpdate = "VisualPropsUpdate",
|
|
421
552
|
ContextMenuActionClick = "ContextMenuActionClick",
|
|
422
|
-
AxisMenuActionClick = "AxisMenuActionClick"
|
|
553
|
+
AxisMenuActionClick = "AxisMenuActionClick",
|
|
554
|
+
GetColumnData = "GetColumnData"
|
|
423
555
|
}
|
|
424
556
|
export interface TSToChartEventsPayloadMap {
|
|
425
557
|
[TSToChartEvent.ChartModelUpdate]: (payload: ChartModelUpdateEventPayload) => void;
|
|
@@ -430,6 +562,7 @@ export interface TSToChartInternalEventsPayloadMap {
|
|
|
430
562
|
[TSToChartEvent.Initialize]: (payload: InitializeEventPayload) => InitializeEventResponsePayload;
|
|
431
563
|
[TSToChartEvent.InitializeComplete]: () => void;
|
|
432
564
|
[TSToChartEvent.GetDataQuery]: (payload: GetDataQueryPayload) => GetDataQueryResponsePayload;
|
|
565
|
+
[TSToChartEvent.GetColumnData]: (payload: GetColumnDataPayload) => GetColumnDataResponsePayload;
|
|
433
566
|
[TSToChartEvent.ChartConfigValidate]: (payload: ChartConfigValidateEventPayload) => ValidationResponse;
|
|
434
567
|
[TSToChartEvent.VisualPropsValidate]: (payload: VisualPropsValidateEventPayload) => ValidationResponse;
|
|
435
568
|
[TSToChartEvent.TriggerRenderChart]: () => void;
|
|
@@ -449,12 +582,20 @@ export interface InitializeEventResponsePayload {
|
|
|
449
582
|
chartConfigEditorDefinition?: ChartConfigEditorDefinition[];
|
|
450
583
|
visualPropEditorDefinition?: VisualPropEditorDefinition;
|
|
451
584
|
allowedConfigurations?: AllowedConfigurations;
|
|
585
|
+
persistedVisualPropKeys?: PersistedVisualPropKeys;
|
|
586
|
+
chartConfigParameters?: ChartConfigParameters;
|
|
452
587
|
}
|
|
453
588
|
export interface GetDataQueryPayload {
|
|
454
589
|
config: ChartConfig[];
|
|
455
590
|
}
|
|
591
|
+
export interface GetColumnDataPayload {
|
|
592
|
+
columnId: string;
|
|
593
|
+
}
|
|
594
|
+
export interface QueryColumn extends ChartColumn {
|
|
595
|
+
isMeasureValue?: boolean;
|
|
596
|
+
}
|
|
456
597
|
export interface Query {
|
|
457
|
-
queryColumns:
|
|
598
|
+
queryColumns: QueryColumn[];
|
|
458
599
|
queryParams?: {
|
|
459
600
|
offset?: number;
|
|
460
601
|
size?: number;
|
|
@@ -463,6 +604,9 @@ export interface Query {
|
|
|
463
604
|
export interface GetDataQueryResponsePayload {
|
|
464
605
|
queries: Query[];
|
|
465
606
|
}
|
|
607
|
+
export interface GetColumnDataResponsePayload {
|
|
608
|
+
data?: any[];
|
|
609
|
+
}
|
|
466
610
|
export interface ChartModelUpdateEventPayload {
|
|
467
611
|
chartModel: ChartModel;
|
|
468
612
|
}
|
|
@@ -474,6 +618,7 @@ export interface VisualPropsUpdateEventPayload {
|
|
|
474
618
|
}
|
|
475
619
|
export interface VisualPropsValidateEventPayload {
|
|
476
620
|
visualProps: VisualProps;
|
|
621
|
+
activeColumnId?: string;
|
|
477
622
|
}
|
|
478
623
|
export interface ChartConfigValidateEventPayload {
|
|
479
624
|
chartConfig: ChartConfig[];
|
|
@@ -497,19 +642,32 @@ export interface AxisMenuCustomActionPayload {
|
|
|
497
642
|
}
|
|
498
643
|
|
|
499
644
|
export type AllowedConfigurations = {
|
|
500
|
-
allowColumnNumberFormatting
|
|
501
|
-
allowColumnConditionalFormatting
|
|
502
|
-
|
|
645
|
+
allowColumnNumberFormatting?: boolean;
|
|
646
|
+
allowColumnConditionalFormatting?: boolean;
|
|
647
|
+
allowGradientColoring?: boolean;
|
|
648
|
+
allowMeasureNamesAndValues?: boolean;
|
|
649
|
+
};
|
|
650
|
+
export type PersistedVisualPropKeys = string[];
|
|
651
|
+
export type ChartConfigParameters = {
|
|
652
|
+
measureNameValueColumns?: {
|
|
653
|
+
enableMeasureNameColumn?: boolean;
|
|
654
|
+
enableMeasureValueColumn?: boolean;
|
|
655
|
+
measureNameColumnAlias?: string;
|
|
656
|
+
measureValueColumnAlias?: string;
|
|
657
|
+
};
|
|
658
|
+
batchSizeLimit?: number;
|
|
503
659
|
};
|
|
504
660
|
export type CustomChartContextProps = {
|
|
505
661
|
getDefaultChartConfig: (chartModel: ChartModel) => ChartConfig[];
|
|
506
662
|
getQueriesFromChartConfig: (chartConfig: ChartConfig[], chartModel: ChartModel) => Query[];
|
|
507
663
|
renderChart: (ctx: CustomChartContext) => Promise<void>;
|
|
508
664
|
validateConfig?: (updatedConfig: ChartConfig[], chartModel: ChartModel) => ValidationResponse;
|
|
509
|
-
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel) => ValidationResponse;
|
|
665
|
+
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel, activeColumnId?: string) => ValidationResponse;
|
|
510
666
|
chartConfigEditorDefinition?: ConfigEditorDefinitionSetter | ChartConfigEditorDefinition[];
|
|
511
667
|
visualPropEditorDefinition?: VisualEditorDefinitionSetter | VisualPropEditorDefinition;
|
|
512
668
|
allowedConfigurations?: AllowedConfigurations;
|
|
669
|
+
persistedVisualPropKeys?: PersistedVisualPropKeys;
|
|
670
|
+
chartConfigParameters?: ChartConfigParameters;
|
|
513
671
|
};
|
|
514
672
|
export type ValidationFunctions = CustomChartContextProps['validateVisualProps'] | CustomChartContextProps['validateConfig'];
|
|
515
673
|
export class CustomChartContext {
|
|
@@ -529,26 +687,10 @@ export const getChartContext: (customChartConfig: CustomChartContextProps) => Pr
|
|
|
529
687
|
|
|
530
688
|
export const useChartContext: (props: Omit<CustomChartContextProps, 'renderChart'>) => ChartContextProps;
|
|
531
689
|
|
|
532
|
-
export type Maybe<T> = T | null;
|
|
533
|
-
export type InputMaybe<T> = Maybe<T>;
|
|
534
690
|
export type ConditionalFormatting = {
|
|
535
691
|
__typename?: 'ConditionalFormatting';
|
|
536
692
|
rows?: Maybe<Array<Maybe<ConditionalMetric>>>;
|
|
537
693
|
};
|
|
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
694
|
export enum BackgroundFormatTypes {
|
|
553
695
|
Gradient = "GRADIENT",
|
|
554
696
|
Solid = "SOLID"
|
|
@@ -684,6 +826,60 @@ export enum ParameterValueType {
|
|
|
684
826
|
Range = "RANGE"
|
|
685
827
|
}
|
|
686
828
|
|
|
829
|
+
export enum CategoryType {
|
|
830
|
+
Currency = "CURRENCY",
|
|
831
|
+
Custom = "CUSTOM",
|
|
832
|
+
Number = "NUMBER",
|
|
833
|
+
Percentage = "PERCENTAGE"
|
|
834
|
+
}
|
|
835
|
+
export enum Unit {
|
|
836
|
+
Auto = "AUTO",
|
|
837
|
+
Billion = "BILLION",
|
|
838
|
+
Million = "MILLION",
|
|
839
|
+
None = "NONE",
|
|
840
|
+
Thousands = "THOUSANDS",
|
|
841
|
+
Trillion = "TRILLION"
|
|
842
|
+
}
|
|
843
|
+
export enum NegativeValueFormat {
|
|
844
|
+
BracesNodash = "BRACES_NODASH",
|
|
845
|
+
PrefixDash = "PREFIX_DASH",
|
|
846
|
+
SuffixDash = "SUFFIX_DASH"
|
|
847
|
+
}
|
|
848
|
+
export type CurrencyFormatConfig = {
|
|
849
|
+
__typename?: 'CurrencyFormatConfig';
|
|
850
|
+
decimals?: Maybe<Scalars['Float']>;
|
|
851
|
+
locale?: Maybe<Scalars['String']>;
|
|
852
|
+
removeTrailingZeroes?: Maybe<Scalars['Boolean']>;
|
|
853
|
+
toSeparateThousands?: Maybe<Scalars['Boolean']>;
|
|
854
|
+
unit?: Maybe<Unit>;
|
|
855
|
+
};
|
|
856
|
+
export type CustomFormatConfig = {
|
|
857
|
+
__typename?: 'CustomFormatConfig';
|
|
858
|
+
format?: Maybe<Scalars['String']>;
|
|
859
|
+
};
|
|
860
|
+
export type NumberFormatConfig = {
|
|
861
|
+
__typename?: 'NumberFormatConfig';
|
|
862
|
+
decimals?: Maybe<Scalars['Float']>;
|
|
863
|
+
negativeValueFormat?: Maybe<NegativeValueFormat>;
|
|
864
|
+
removeTrailingZeroes?: Maybe<Scalars['Boolean']>;
|
|
865
|
+
toSeparateThousands?: Maybe<Scalars['Boolean']>;
|
|
866
|
+
unit?: Maybe<Unit>;
|
|
867
|
+
};
|
|
868
|
+
export type PercentageFormatConfig = {
|
|
869
|
+
__typename?: 'PercentageFormatConfig';
|
|
870
|
+
decimals?: Maybe<Scalars['Float']>;
|
|
871
|
+
removeTrailingZeroes?: Maybe<Scalars['Boolean']>;
|
|
872
|
+
};
|
|
873
|
+
export type FormatConfig = {
|
|
874
|
+
__typename?: 'FormatConfig';
|
|
875
|
+
category?: Maybe<CategoryType>;
|
|
876
|
+
currencyFormatConfig?: Maybe<CurrencyFormatConfig>;
|
|
877
|
+
customFormatConfig?: Maybe<CustomFormatConfig>;
|
|
878
|
+
isCategoryEditable?: Maybe<Scalars['Boolean']>;
|
|
879
|
+
numberFormatConfig?: Maybe<NumberFormatConfig>;
|
|
880
|
+
percentageFormatConfig?: Maybe<PercentageFormatConfig>;
|
|
881
|
+
};
|
|
882
|
+
|
|
687
883
|
export interface CustomCalendarDate {
|
|
688
884
|
v: {
|
|
689
885
|
s: number;
|
|
@@ -691,16 +887,100 @@ export interface CustomCalendarDate {
|
|
|
691
887
|
};
|
|
692
888
|
d: string;
|
|
693
889
|
}
|
|
890
|
+
export const dateFormatPresets: {
|
|
891
|
+
DATE_SHORT: string;
|
|
892
|
+
DATE_SHORT_WITH_HOUR: string;
|
|
893
|
+
DATE_SHORT_WITH_HOUR_WITHOUT_YEAR: string;
|
|
894
|
+
DATETIME_SHORT: string;
|
|
895
|
+
DATETIME_SHORT_WITHOUT_YEAR: string;
|
|
896
|
+
DATETIME_SHORT_WITH_SECONDS: string;
|
|
897
|
+
DATETIME_SHORT_WITH_MILLIS: string;
|
|
898
|
+
MONTH_WITH_YEAR: string;
|
|
899
|
+
QUARTER_WITH_YEAR: string;
|
|
900
|
+
QUARTER_WITH_2_DIGIT_YEAR: string;
|
|
901
|
+
DEFAULT_TIME_FORMAT: string;
|
|
902
|
+
TIME_24_WITH_SECONDS: string;
|
|
903
|
+
DATE_SHORT_2_DIGIT_YEAR: string;
|
|
904
|
+
DATETIME_24_SHORT_WITHOUT_YEAR: string;
|
|
905
|
+
DATETIME_24_SHORT: string;
|
|
906
|
+
DATETIME_SHORT_WITH_SECONDS_WITHOUT_YEAR: string;
|
|
907
|
+
DATETIME_SHORT_WITH_MILLIS_WITHOUT_YEAR: string;
|
|
908
|
+
DATETIME_24_SHORT_WITH_MILLIS_WITHOUT_YEAR: string;
|
|
909
|
+
DATETIME_24_SHORT_WITH_MILLIS: string;
|
|
910
|
+
MONTH_WITH_DAY_AND_YEAR: string;
|
|
911
|
+
MONTH_WITH_2_DIGIT_YEAR: string;
|
|
912
|
+
DAY_WITH_MONTH_NUM: string;
|
|
913
|
+
DATE_SHORT_WITH_HOUR_24_WITHOUT_YEAR: string;
|
|
914
|
+
DATE_SHORT_WITH_HOUR_24: string;
|
|
915
|
+
QUARTER: string;
|
|
916
|
+
MONTH_ONLY: string;
|
|
917
|
+
DATETIME_WITH_SHORT_OFFSET: string;
|
|
918
|
+
};
|
|
919
|
+
export const dateNumTypes: {
|
|
920
|
+
DATE_NUM_ABS_DAY: string;
|
|
921
|
+
DATE_NUM_ABS_MONTH: string;
|
|
922
|
+
DATE_NUM_ABS_QUARTER: string;
|
|
923
|
+
DATE_NUM_ABS_YEAR: string;
|
|
924
|
+
DATE_NUM_DAY_IN_MONTH: string;
|
|
925
|
+
DATE_NUM_DAY_IN_QUARTER: string;
|
|
926
|
+
DATE_NUM_DAY_IN_YEAR: string;
|
|
927
|
+
DATE_NUM_DAY_OF_WEEK: string;
|
|
928
|
+
DATE_NUM_MONTH_IN_QUARTER: string;
|
|
929
|
+
DATE_NUM_MONTH_IN_YEAR: string;
|
|
930
|
+
DATE_NUM_QUARTER_IN_YEAR: string;
|
|
931
|
+
DATE_NUM_WEEK_IN_YEAR: string;
|
|
932
|
+
DATE_NUM_WEEK_IN_QUARTER: string;
|
|
933
|
+
DATE_NUM_WEEK_IN_MONTH: string;
|
|
934
|
+
DATE_NUM_HOUR_IN_DAY: string;
|
|
935
|
+
};
|
|
936
|
+
export const bucketizationToDatePreset: {
|
|
937
|
+
HOURLY: string;
|
|
938
|
+
DAILY: string;
|
|
939
|
+
WEEKLY: string;
|
|
940
|
+
MONTHLY: string;
|
|
941
|
+
QUARTERLY: string;
|
|
942
|
+
YEARLY: string;
|
|
943
|
+
};
|
|
944
|
+
export const timeBuckets: {
|
|
945
|
+
NO_BUCKET: string;
|
|
946
|
+
HOURLY: string;
|
|
947
|
+
DAILY: string;
|
|
948
|
+
WEEKLY: string;
|
|
949
|
+
MONTHLY: string;
|
|
950
|
+
QUARTERLY: string;
|
|
951
|
+
YEARLY: string;
|
|
952
|
+
DAY_OF_WEEK: string;
|
|
953
|
+
DAY_OF_MONTH: string;
|
|
954
|
+
DAY_OF_QUARTER: string;
|
|
955
|
+
DAY_OF_YEAR: string;
|
|
956
|
+
WEEK_OF_MONTH: string;
|
|
957
|
+
WEEK_OF_QUARTER: string;
|
|
958
|
+
WEEK_OF_YEAR: string;
|
|
959
|
+
MONTH_OF_QUARTER: string;
|
|
960
|
+
MONTH_OF_YEAR: string;
|
|
961
|
+
QUARTER_OF_YEAR: string;
|
|
962
|
+
};
|
|
694
963
|
export const isDateColumn: (col: ChartColumn) => boolean;
|
|
695
964
|
export const isAttribute: (col: ChartColumn) => boolean;
|
|
965
|
+
export const isDateTimeColumn: (col: ChartColumn) => boolean;
|
|
696
966
|
export const getCustomCalendarGuidFromColumn: (col: ChartColumn) => string | undefined;
|
|
697
967
|
export const isDateNumColumn: (col: ChartColumn) => boolean;
|
|
698
968
|
export const isDateFamilyColumn: (col: ChartColumn) => boolean;
|
|
699
969
|
export const isTimeColumn: (col: ChartColumn) => boolean;
|
|
970
|
+
export const getEffectiveDateNumDataType: (col: ChartColumn) => string | undefined;
|
|
700
971
|
export const hasCustomCalendar: (col: ChartColumn) => boolean;
|
|
701
972
|
export function getStartEpoch(date: CustomCalendarDate): number | null;
|
|
973
|
+
export const assignQuarterValueToString: (quarter_of_year: any, value: any) => any;
|
|
974
|
+
export function getMonthOfYear(num: any, quarterStartMonth: any, monthOfYear: any): any;
|
|
702
975
|
export function getDisplayString(date: CustomCalendarDate): string | null;
|
|
703
|
-
export
|
|
976
|
+
export const useQuarterStart: (luxonDate: any, quarterStartMonth: any) => any;
|
|
977
|
+
export const getCustomCalendarValueFromEpoch: (col: ChartColumn, dateEpoch: number, displayToCustomCalendarValueMap: any) => any;
|
|
978
|
+
export function getSpecialFormatData(value: string | number, options: any): any;
|
|
979
|
+
export function sanitizeDate(inputDate: string | number, format: string, options: any): any;
|
|
980
|
+
export const formatDateTime: (epochMillis: number, format: string, useSystemCalendar?: boolean, options?: any) => any;
|
|
981
|
+
export function getOrdinalSuffixedValue(i: number | string): string;
|
|
982
|
+
export function formatDateNum(effectiveDataType: string | undefined, value: number | string, formatPattern: string, options: any): any;
|
|
983
|
+
export function formatDate(inputDate: number | string, format: string, useSystemCalendar: boolean, options: any): string;
|
|
704
984
|
|
|
705
985
|
export const getMinRangeValue: (metric: ConditionalMetric) => number | undefined | null;
|
|
706
986
|
export const getMaxRangeValue: (metric: ConditionalMetric) => number | undefined | null;
|
|
@@ -709,6 +989,24 @@ export function validateCfCondition(conditionalMetric: ConditionalMetric, index:
|
|
|
709
989
|
export const applicableConditionalFormatting: (idx: number, columnId: string, dataArr: DataPointsArray, conditionalFormatting?: ConditionalFormatting) => ConditionalMetric | null;
|
|
710
990
|
export function getCfForColumn(column: ChartColumn): ConditionalFormatting | undefined;
|
|
711
991
|
|
|
992
|
+
export const formatCurrencyWithCustomPattern: (value: number, currencyCode: string, formatPattern: string) => string;
|
|
993
|
+
export const getFormattedValue: (value: string | number, formatConfigProp: FormatConfig, columnFormatConfig: ColumnFormat) => string;
|
|
994
|
+
|
|
995
|
+
export const getCountryCode: (locale: string) => string;
|
|
996
|
+
export const getDefaultCurrencyCode: () => string;
|
|
997
|
+
export const setGlobalizeLocale: (locale: string) => void;
|
|
998
|
+
export const getGlobalizeLocale: () => string;
|
|
999
|
+
export const setCurrentCurrencyFormat: (currencyFormat: any) => void;
|
|
1000
|
+
export const getCurrentCurrencyFormat: () => any;
|
|
1001
|
+
export const loadCurrencyData: (data: any) => void;
|
|
1002
|
+
export const loadGlobalizeData: (data: any) => void;
|
|
1003
|
+
export const initGlobalize: (locale?: string) => void;
|
|
1004
|
+
export function globalizeNumberFormatter(format: Globalize.NumberFormatterOptions): (num: number) => string;
|
|
1005
|
+
export function globalizeCurrencyFormatter(currencyCode: string, format: Globalize.CurrencyFormatterOptions): (num: number) => string;
|
|
1006
|
+
export function formatNumberSafely<FormatOptions extends Globalize.NumberFormatterOptions>(format: FormatOptions, num: number): string;
|
|
1007
|
+
export const sanitizeFormat: (format: string) => string;
|
|
1008
|
+
export const validateNumberFormat: (format: string) => boolean;
|
|
1009
|
+
|
|
712
1010
|
export type ChartToTSEventEmitters = {
|
|
713
1011
|
[key in keyof ChartToTSEventsPayloadMap as `emit${Capitalize<key>}`]: (...args: ChartToTSEventsPayloadMap[key]) => Promise<void>;
|
|
714
1012
|
};
|
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,19 +4,32 @@ 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
|
|
9
|
-
|
|
7
|
+
allowColumnNumberFormatting?: boolean;
|
|
8
|
+
allowColumnConditionalFormatting?: boolean;
|
|
9
|
+
allowGradientColoring?: boolean;
|
|
10
|
+
allowMeasureNamesAndValues?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type PersistedVisualPropKeys = string[];
|
|
13
|
+
export type ChartConfigParameters = {
|
|
14
|
+
measureNameValueColumns?: {
|
|
15
|
+
enableMeasureNameColumn?: boolean;
|
|
16
|
+
enableMeasureValueColumn?: boolean;
|
|
17
|
+
measureNameColumnAlias?: string;
|
|
18
|
+
measureValueColumnAlias?: string;
|
|
19
|
+
};
|
|
20
|
+
batchSizeLimit?: number;
|
|
10
21
|
};
|
|
11
22
|
export type CustomChartContextProps = {
|
|
12
23
|
getDefaultChartConfig: (chartModel: ChartModel) => ChartConfig[];
|
|
13
24
|
getQueriesFromChartConfig: (chartConfig: ChartConfig[], chartModel: ChartModel) => Query[];
|
|
14
25
|
renderChart: (ctx: CustomChartContext) => Promise<void>;
|
|
15
26
|
validateConfig?: (updatedConfig: ChartConfig[], chartModel: ChartModel) => ValidationResponse;
|
|
16
|
-
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel) => ValidationResponse;
|
|
27
|
+
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel, activeColumnId?: string) => ValidationResponse;
|
|
17
28
|
chartConfigEditorDefinition?: ConfigEditorDefinitionSetter | ChartConfigEditorDefinition[];
|
|
18
29
|
visualPropEditorDefinition?: VisualEditorDefinitionSetter | VisualPropEditorDefinition;
|
|
19
30
|
allowedConfigurations?: AllowedConfigurations;
|
|
31
|
+
persistedVisualPropKeys?: PersistedVisualPropKeys;
|
|
32
|
+
chartConfigParameters?: ChartConfigParameters;
|
|
20
33
|
};
|
|
21
34
|
export type ValidationFunctions = CustomChartContextProps['validateVisualProps'] | CustomChartContextProps['validateConfig'];
|
|
22
35
|
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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"}
|