@thoughtspot/ts-chart-sdk 0.0.2-alpha.9 → 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 +327 -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 +15 -4
- package/lib/main/custom-chart-context.d.ts.map +1 -1
- package/lib/main/custom-chart-context.js +44 -16
- package/lib/main/custom-chart-context.js.map +1 -1
- package/lib/main/custom-chart-context.spec.js +301 -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 +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/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 +355 -6
- package/src/main/custom-chart-context.ts +181 -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 +54 -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,19 @@ export interface InitializeEventResponsePayload {
|
|
|
449
582
|
chartConfigEditorDefinition?: ChartConfigEditorDefinition[];
|
|
450
583
|
visualPropEditorDefinition?: VisualPropEditorDefinition;
|
|
451
584
|
allowedConfigurations?: AllowedConfigurations;
|
|
585
|
+
chartConfigParameters?: ChartConfigParameters;
|
|
452
586
|
}
|
|
453
587
|
export interface GetDataQueryPayload {
|
|
454
588
|
config: ChartConfig[];
|
|
455
589
|
}
|
|
590
|
+
export interface GetColumnDataPayload {
|
|
591
|
+
columnId: string;
|
|
592
|
+
}
|
|
593
|
+
export interface QueryColumn extends ChartColumn {
|
|
594
|
+
isMeasureValue?: boolean;
|
|
595
|
+
}
|
|
456
596
|
export interface Query {
|
|
457
|
-
queryColumns:
|
|
597
|
+
queryColumns: QueryColumn[];
|
|
458
598
|
queryParams?: {
|
|
459
599
|
offset?: number;
|
|
460
600
|
size?: number;
|
|
@@ -463,6 +603,9 @@ export interface Query {
|
|
|
463
603
|
export interface GetDataQueryResponsePayload {
|
|
464
604
|
queries: Query[];
|
|
465
605
|
}
|
|
606
|
+
export interface GetColumnDataResponsePayload {
|
|
607
|
+
data?: any[];
|
|
608
|
+
}
|
|
466
609
|
export interface ChartModelUpdateEventPayload {
|
|
467
610
|
chartModel: ChartModel;
|
|
468
611
|
}
|
|
@@ -474,6 +617,7 @@ export interface VisualPropsUpdateEventPayload {
|
|
|
474
617
|
}
|
|
475
618
|
export interface VisualPropsValidateEventPayload {
|
|
476
619
|
visualProps: VisualProps;
|
|
620
|
+
activeColumnId?: string;
|
|
477
621
|
}
|
|
478
622
|
export interface ChartConfigValidateEventPayload {
|
|
479
623
|
chartConfig: ChartConfig[];
|
|
@@ -497,19 +641,30 @@ export interface AxisMenuCustomActionPayload {
|
|
|
497
641
|
}
|
|
498
642
|
|
|
499
643
|
export type AllowedConfigurations = {
|
|
500
|
-
allowColumnNumberFormatting
|
|
501
|
-
allowColumnConditionalFormatting
|
|
502
|
-
|
|
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;
|
|
503
657
|
};
|
|
504
658
|
export type CustomChartContextProps = {
|
|
505
659
|
getDefaultChartConfig: (chartModel: ChartModel) => ChartConfig[];
|
|
506
660
|
getQueriesFromChartConfig: (chartConfig: ChartConfig[], chartModel: ChartModel) => Query[];
|
|
507
661
|
renderChart: (ctx: CustomChartContext) => Promise<void>;
|
|
508
662
|
validateConfig?: (updatedConfig: ChartConfig[], chartModel: ChartModel) => ValidationResponse;
|
|
509
|
-
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel) => ValidationResponse;
|
|
663
|
+
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel, activeColumnId?: string) => ValidationResponse;
|
|
510
664
|
chartConfigEditorDefinition?: ConfigEditorDefinitionSetter | ChartConfigEditorDefinition[];
|
|
511
665
|
visualPropEditorDefinition?: VisualEditorDefinitionSetter | VisualPropEditorDefinition;
|
|
512
666
|
allowedConfigurations?: AllowedConfigurations;
|
|
667
|
+
chartConfigParameters?: ChartConfigParameters;
|
|
513
668
|
};
|
|
514
669
|
export type ValidationFunctions = CustomChartContextProps['validateVisualProps'] | CustomChartContextProps['validateConfig'];
|
|
515
670
|
export class CustomChartContext {
|
|
@@ -529,26 +684,10 @@ export const getChartContext: (customChartConfig: CustomChartContextProps) => Pr
|
|
|
529
684
|
|
|
530
685
|
export const useChartContext: (props: Omit<CustomChartContextProps, 'renderChart'>) => ChartContextProps;
|
|
531
686
|
|
|
532
|
-
export type Maybe<T> = T | null;
|
|
533
|
-
export type InputMaybe<T> = Maybe<T>;
|
|
534
687
|
export type ConditionalFormatting = {
|
|
535
688
|
__typename?: 'ConditionalFormatting';
|
|
536
689
|
rows?: Maybe<Array<Maybe<ConditionalMetric>>>;
|
|
537
690
|
};
|
|
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
691
|
export enum BackgroundFormatTypes {
|
|
553
692
|
Gradient = "GRADIENT",
|
|
554
693
|
Solid = "SOLID"
|
|
@@ -684,6 +823,60 @@ export enum ParameterValueType {
|
|
|
684
823
|
Range = "RANGE"
|
|
685
824
|
}
|
|
686
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
|
+
|
|
687
880
|
export interface CustomCalendarDate {
|
|
688
881
|
v: {
|
|
689
882
|
s: number;
|
|
@@ -691,16 +884,100 @@ export interface CustomCalendarDate {
|
|
|
691
884
|
};
|
|
692
885
|
d: string;
|
|
693
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
|
+
};
|
|
694
960
|
export const isDateColumn: (col: ChartColumn) => boolean;
|
|
695
961
|
export const isAttribute: (col: ChartColumn) => boolean;
|
|
962
|
+
export const isDateTimeColumn: (col: ChartColumn) => boolean;
|
|
696
963
|
export const getCustomCalendarGuidFromColumn: (col: ChartColumn) => string | undefined;
|
|
697
964
|
export const isDateNumColumn: (col: ChartColumn) => boolean;
|
|
698
965
|
export const isDateFamilyColumn: (col: ChartColumn) => boolean;
|
|
699
966
|
export const isTimeColumn: (col: ChartColumn) => boolean;
|
|
967
|
+
export const getEffectiveDateNumDataType: (col: ChartColumn) => string | undefined;
|
|
700
968
|
export const hasCustomCalendar: (col: ChartColumn) => boolean;
|
|
701
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;
|
|
702
972
|
export function getDisplayString(date: CustomCalendarDate): string | null;
|
|
703
|
-
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;
|
|
704
981
|
|
|
705
982
|
export const getMinRangeValue: (metric: ConditionalMetric) => number | undefined | null;
|
|
706
983
|
export const getMaxRangeValue: (metric: ConditionalMetric) => number | undefined | null;
|
|
@@ -709,6 +986,24 @@ export function validateCfCondition(conditionalMetric: ConditionalMetric, index:
|
|
|
709
986
|
export const applicableConditionalFormatting: (idx: number, columnId: string, dataArr: DataPointsArray, conditionalFormatting?: ConditionalFormatting) => ConditionalMetric | null;
|
|
710
987
|
export function getCfForColumn(column: ChartColumn): ConditionalFormatting | undefined;
|
|
711
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
|
+
|
|
712
1007
|
export type ChartToTSEventEmitters = {
|
|
713
1008
|
[key in keyof ChartToTSEventsPayloadMap as `emit${Capitalize<key>}`]: (...args: ChartToTSEventsPayloadMap[key]) => Promise<void>;
|
|
714
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,19 +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
|
|
9
|
-
|
|
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;
|
|
10
20
|
};
|
|
11
21
|
export type CustomChartContextProps = {
|
|
12
22
|
getDefaultChartConfig: (chartModel: ChartModel) => ChartConfig[];
|
|
13
23
|
getQueriesFromChartConfig: (chartConfig: ChartConfig[], chartModel: ChartModel) => Query[];
|
|
14
24
|
renderChart: (ctx: CustomChartContext) => Promise<void>;
|
|
15
25
|
validateConfig?: (updatedConfig: ChartConfig[], chartModel: ChartModel) => ValidationResponse;
|
|
16
|
-
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel) => ValidationResponse;
|
|
26
|
+
validateVisualProps?: (updatedVisualProps: VisualProps, chartModel: ChartModel, activeColumnId?: string) => ValidationResponse;
|
|
17
27
|
chartConfigEditorDefinition?: ConfigEditorDefinitionSetter | ChartConfigEditorDefinition[];
|
|
18
28
|
visualPropEditorDefinition?: VisualEditorDefinitionSetter | VisualPropEditorDefinition;
|
|
19
29
|
allowedConfigurations?: AllowedConfigurations;
|
|
30
|
+
chartConfigParameters?: ChartConfigParameters;
|
|
20
31
|
};
|
|
21
32
|
export type ValidationFunctions = CustomChartContextProps['validateVisualProps'] | CustomChartContextProps['validateConfig'];
|
|
22
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,CA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