@thoughtspot/ts-chart-sdk 0.0.1-alpha.9 → 0.0.2-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ts-chart-sdk.d.ts +449 -31
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/main/custom-chart-context.d.ts +17 -5
- package/lib/main/custom-chart-context.d.ts.map +1 -1
- package/lib/main/custom-chart-context.js +74 -34
- package/lib/main/custom-chart-context.js.map +1 -1
- package/lib/main/custom-chart-context.spec.js +256 -257
- package/lib/main/custom-chart-context.spec.js.map +1 -1
- package/lib/main/post-message-event-bridge.d.ts +3 -3
- package/lib/main/post-message-event-bridge.d.ts.map +1 -1
- package/lib/main/post-message-event-bridge.js +24 -36
- package/lib/main/post-message-event-bridge.js.map +1 -1
- package/lib/main/post-message-event-bridge.spec.js +0 -2
- package/lib/main/post-message-event-bridge.spec.js.map +1 -1
- package/lib/main/util.d.ts +2 -0
- package/lib/main/util.d.ts.map +1 -0
- package/lib/main/util.js +9 -0
- package/lib/main/util.js.map +1 -0
- package/lib/react/use-custom-chart-context.spec.js +128 -121
- package/lib/react/use-custom-chart-context.spec.js.map +1 -1
- package/lib/test/test-conditional-formatting-utils.d.ts +5 -0
- package/lib/test/test-conditional-formatting-utils.d.ts.map +1 -0
- package/lib/test/test-conditional-formatting-utils.js +43 -0
- package/lib/test/test-conditional-formatting-utils.js.map +1 -0
- package/lib/types/answer-column.types.d.ts +54 -1
- package/lib/types/answer-column.types.d.ts.map +1 -1
- package/lib/types/answer-column.types.js +47 -0
- package/lib/types/answer-column.types.js.map +1 -1
- package/lib/types/common.types.d.ts +51 -4
- package/lib/types/common.types.d.ts.map +1 -1
- package/lib/types/common.types.js +15 -1
- package/lib/types/common.types.js.map +1 -1
- package/lib/types/conditional-formatting.types.d.ts +155 -0
- package/lib/types/conditional-formatting.types.d.ts.map +1 -0
- package/lib/types/conditional-formatting.types.js +60 -0
- package/lib/types/conditional-formatting.types.js.map +1 -0
- package/lib/types/configurator.types.d.ts +5 -0
- package/lib/types/configurator.types.d.ts.map +1 -1
- package/lib/types/ts-to-chart-event.types.d.ts +3 -0
- package/lib/types/ts-to-chart-event.types.d.ts.map +1 -1
- package/lib/types/ts-to-chart-event.types.js.map +1 -1
- package/lib/types/visual-prop.types.d.ts +3 -0
- package/lib/types/visual-prop.types.d.ts.map +1 -1
- package/lib/utils/conditional-formatting/conditional-formatting.d.ts +10 -0
- package/lib/utils/conditional-formatting/conditional-formatting.d.ts.map +1 -0
- package/lib/utils/conditional-formatting/conditional-formatting.js +103 -0
- package/lib/utils/conditional-formatting/conditional-formatting.js.map +1 -0
- package/lib/utils/conditional-formatting/conditional-formatting.spec.d.ts +2 -0
- package/lib/utils/conditional-formatting/conditional-formatting.spec.d.ts.map +1 -0
- package/lib/utils/conditional-formatting/conditional-formatting.spec.js +142 -0
- package/lib/utils/conditional-formatting/conditional-formatting.spec.js.map +1 -0
- package/lib/utils/date-formatting.d.ts +19 -0
- package/lib/utils/date-formatting.d.ts.map +1 -0
- package/lib/utils/date-formatting.js +56 -0
- package/lib/utils/date-formatting.js.map +1 -0
- package/lib/utils/date-formatting.spec.d.ts +2 -0
- package/lib/utils/date-formatting.spec.d.ts.map +1 -0
- package/lib/utils/date-formatting.spec.js +124 -0
- package/lib/utils/date-formatting.spec.js.map +1 -0
- package/package.json +10 -7
- package/src/index.ts +3 -0
- package/src/main/custom-chart-context.spec.ts +291 -266
- package/src/main/custom-chart-context.ts +164 -46
- package/src/main/post-message-event-bridge.spec.ts +0 -3
- package/src/main/post-message-event-bridge.ts +36 -62
- package/src/main/util.ts +11 -0
- package/src/react/use-custom-chart-context.spec.tsx +149 -122
- package/src/test/test-conditional-formatting-utils.ts +95 -0
- package/src/types/answer-column.types.ts +98 -0
- package/src/types/common.types.ts +82 -10
- package/src/types/conditional-formatting.types.ts +172 -0
- package/src/types/configurator.types.ts +21 -0
- package/src/types/ts-to-chart-event.types.ts +15 -0
- package/src/types/visual-prop.types.ts +7 -0
- package/src/utils/conditional-formatting/conditional-formatting.spec.ts +469 -0
- package/src/utils/conditional-formatting/conditional-formatting.ts +229 -0
- package/src/utils/date-formatting.spec.ts +168 -0
- package/src/utils/date-formatting.ts +109 -0
- package/cjs/index.d.ts +0 -9
- package/cjs/index.d.ts.map +0 -1
- package/cjs/index.js +0 -25
- package/cjs/index.js.map +0 -1
- package/cjs/main/custom-chart-context.d.ts +0 -47
- package/cjs/main/custom-chart-context.d.ts.map +0 -1
- package/cjs/main/custom-chart-context.js +0 -326
- package/cjs/main/custom-chart-context.js.map +0 -1
- package/cjs/main/custom-chart-context.spec.d.ts +0 -2
- package/cjs/main/custom-chart-context.spec.d.ts.map +0 -1
- package/cjs/main/custom-chart-context.spec.js +0 -699
- package/cjs/main/custom-chart-context.spec.js.map +0 -1
- package/cjs/main/post-message-event-bridge.d.ts +0 -6
- package/cjs/main/post-message-event-bridge.d.ts.map +0 -1
- package/cjs/main/post-message-event-bridge.js +0 -46
- package/cjs/main/post-message-event-bridge.js.map +0 -1
- package/cjs/main/post-message-event-bridge.spec.d.ts +0 -2
- package/cjs/main/post-message-event-bridge.spec.d.ts.map +0 -1
- package/cjs/main/post-message-event-bridge.spec.js +0 -124
- package/cjs/main/post-message-event-bridge.spec.js.map +0 -1
- package/cjs/react/custom-chart-context-service.d.ts +0 -33
- package/cjs/react/custom-chart-context-service.d.ts.map +0 -1
- package/cjs/react/custom-chart-context-service.js +0 -118
- package/cjs/react/custom-chart-context-service.js.map +0 -1
- package/cjs/react/custom-chart.context.d.ts +0 -26
- package/cjs/react/custom-chart.context.d.ts.map +0 -1
- package/cjs/react/custom-chart.context.js +0 -105
- package/cjs/react/custom-chart.context.js.map +0 -1
- package/cjs/react/custom-chart.spec.d.ts +0 -2
- package/cjs/react/custom-chart.spec.d.ts.map +0 -1
- package/cjs/react/custom-chart.spec.js +0 -72
- package/cjs/react/custom-chart.spec.js.map +0 -1
- package/cjs/react/mocks/custom-chart-context-mock.d.ts +0 -3
- package/cjs/react/mocks/custom-chart-context-mock.d.ts.map +0 -1
- package/cjs/react/mocks/custom-chart-context-mock.js +0 -100
- package/cjs/react/mocks/custom-chart-context-mock.js.map +0 -1
- package/cjs/react/use-custom-chart-context.d.ts +0 -4
- package/cjs/react/use-custom-chart-context.d.ts.map +0 -1
- package/cjs/react/use-custom-chart-context.js +0 -95
- package/cjs/react/use-custom-chart-context.js.map +0 -1
- package/cjs/react/use-custom-chart-context.spec.d.ts +0 -2
- package/cjs/react/use-custom-chart-context.spec.d.ts.map +0 -1
- package/cjs/react/use-custom-chart-context.spec.js +0 -391
- package/cjs/react/use-custom-chart-context.spec.js.map +0 -1
- package/cjs/react/use-custom-chart-context.util.d.ts +0 -6
- package/cjs/react/use-custom-chart-context.util.d.ts.map +0 -1
- package/cjs/react/use-custom-chart-context.util.js +0 -60
- package/cjs/react/use-custom-chart-context.util.js.map +0 -1
- package/cjs/react/use-custom-chart-types.d.ts +0 -23
- package/cjs/react/use-custom-chart-types.d.ts.map +0 -1
- package/cjs/react/use-custom-chart-types.js +0 -3
- package/cjs/react/use-custom-chart-types.js.map +0 -1
- package/cjs/test/test-utils.d.ts +0 -7
- package/cjs/test/test-utils.d.ts.map +0 -1
- package/cjs/test/test-utils.js +0 -14
- package/cjs/test/test-utils.js.map +0 -1
- package/cjs/types/answer-column.types.d.ts +0 -69
- package/cjs/types/answer-column.types.d.ts.map +0 -1
- package/cjs/types/answer-column.types.js +0 -59
- package/cjs/types/answer-column.types.js.map +0 -1
- package/cjs/types/chart-to-ts-event.types.d.ts +0 -98
- package/cjs/types/chart-to-ts-event.types.d.ts.map +0 -1
- package/cjs/types/chart-to-ts-event.types.js +0 -32
- package/cjs/types/chart-to-ts-event.types.js.map +0 -1
- package/cjs/types/common.types.d.ts +0 -51
- package/cjs/types/common.types.d.ts.map +0 -1
- package/cjs/types/common.types.js +0 -3
- package/cjs/types/common.types.js.map +0 -1
- package/cjs/types/configurator.types.d.ts +0 -15
- package/cjs/types/configurator.types.d.ts.map +0 -1
- package/cjs/types/configurator.types.js +0 -3
- package/cjs/types/configurator.types.js.map +0 -1
- package/cjs/types/ts-to-chart-event.types.d.ts +0 -91
- package/cjs/types/ts-to-chart-event.types.d.ts.map +0 -1
- package/cjs/types/ts-to-chart-event.types.js +0 -18
- package/cjs/types/ts-to-chart-event.types.js.map +0 -1
- package/cjs/types/visual-prop.types.d.ts +0 -73
- package/cjs/types/visual-prop.types.d.ts.map +0 -1
- package/cjs/types/visual-prop.types.js +0 -3
- package/cjs/types/visual-prop.types.js.map +0 -1
- package/lib/dist/ts-chart-sdk.d.ts +0 -312
- package/lib/react/custom-chart-context-service.d.ts +0 -33
- package/lib/react/custom-chart-context-service.d.ts.map +0 -1
- package/lib/react/custom-chart-context-service.js +0 -91
- package/lib/react/custom-chart-context-service.js.map +0 -1
- package/lib/react/custom-chart.context.d.ts +0 -26
- package/lib/react/custom-chart.context.d.ts.map +0 -1
- package/lib/react/custom-chart.context.js +0 -78
- package/lib/react/custom-chart.context.js.map +0 -1
- package/lib/react/custom-chart.spec.d.ts +0 -2
- package/lib/react/custom-chart.spec.d.ts.map +0 -1
- package/lib/react/custom-chart.spec.js +0 -67
- package/lib/react/custom-chart.spec.js.map +0 -1
|
@@ -7,6 +7,30 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { ChartColumn } from './answer-column.types';
|
|
10
|
+
import { ChartConfigEditorDefinition } from './configurator.types';
|
|
11
|
+
import { VisualPropEditorDefinition } from './visual-prop.types';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Defines types of features for which font can be customised with Custom style config used in TS.
|
|
15
|
+
* @remarks
|
|
16
|
+
* Use chartFeatureToFontGuid to get the guid for the feature and get the font face from guid
|
|
17
|
+
* from customFontFaces
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export enum CustomizableChartFeature {
|
|
21
|
+
X_AXIS_LABEL,
|
|
22
|
+
X_AXIS_TITLE,
|
|
23
|
+
Y_AXIS_LABEL,
|
|
24
|
+
Y_AXIS_TITLE,
|
|
25
|
+
TOOLTIP,
|
|
26
|
+
SCATTER_CHART,
|
|
27
|
+
PIE_CHART,
|
|
28
|
+
LINE_CHART,
|
|
29
|
+
COLUMN_CHART,
|
|
30
|
+
BAR_CHART,
|
|
31
|
+
AREA_CHART,
|
|
32
|
+
TAIL_FEATURE,
|
|
33
|
+
}
|
|
10
34
|
|
|
11
35
|
/**
|
|
12
36
|
* List of Columns for a dimension in the Custom Chart Config.
|
|
@@ -140,6 +164,12 @@ export interface ChartModel {
|
|
|
140
164
|
};
|
|
141
165
|
}
|
|
142
166
|
|
|
167
|
+
// Validation Response for valid config or visual props
|
|
168
|
+
export type SuccessValidationResponse = {
|
|
169
|
+
chartConfigEditorDefinition: ChartConfigEditorDefinition[];
|
|
170
|
+
visualPropEditorDefinition: VisualPropEditorDefinition;
|
|
171
|
+
};
|
|
172
|
+
|
|
143
173
|
// Generic Validation Response
|
|
144
174
|
export type ValidationResponse = {
|
|
145
175
|
isValid: boolean;
|
|
@@ -149,26 +179,63 @@ export type ValidationResponse = {
|
|
|
149
179
|
/**
|
|
150
180
|
* Custom Visual props is the stored metadata for the visual props definition
|
|
151
181
|
* configured by the user in the visual prop editor
|
|
152
|
-
* The
|
|
153
|
-
*
|
|
182
|
+
* The object is defined by the visual prop types. See VisualPropEditorDefinition.
|
|
183
|
+
* If there is any local state specific to charts needs to be maintained on save answer, store it
|
|
184
|
+
* in VisualProps, with visualProps.clientState variable. The clientState variable should be a
|
|
185
|
+
* string, preferrably a result of JSON.stringify(<yourlocalClientState>).
|
|
186
|
+
* @remark
|
|
187
|
+
* only values stored in clientSate variable will be preserved on changing the
|
|
188
|
+
* visualPropeditorDefinition, any other variable store would not be preserved
|
|
154
189
|
* @group Chart Model
|
|
155
190
|
* @version SDK: 0.1 | ThoughtSpot:
|
|
156
191
|
*/
|
|
157
|
-
export type VisualProps =
|
|
192
|
+
export type VisualProps = unknown;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Custom Font Faces type from TS.
|
|
196
|
+
*
|
|
197
|
+
*/
|
|
198
|
+
|
|
199
|
+
export type CustomFontFaces = {
|
|
200
|
+
guid: string;
|
|
201
|
+
family?: string;
|
|
202
|
+
format?: string;
|
|
203
|
+
url?: string;
|
|
204
|
+
weight?: string;
|
|
205
|
+
style?: string;
|
|
206
|
+
size?: string;
|
|
207
|
+
unicodeRange?: string;
|
|
208
|
+
variant?: string;
|
|
209
|
+
stretch?: string;
|
|
210
|
+
color?: string;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Used for Custom color pallete and Custom font for charts defined in Style customisations
|
|
215
|
+
* inside thoughtspot admin or developer section
|
|
216
|
+
*
|
|
217
|
+
*/
|
|
158
218
|
|
|
159
|
-
|
|
160
|
-
|
|
219
|
+
export type ChartSdkCustomStylingConfig = {
|
|
220
|
+
appBackground?: {
|
|
221
|
+
color?: string;
|
|
222
|
+
};
|
|
223
|
+
appPanelColor?: {
|
|
224
|
+
color?: string;
|
|
225
|
+
};
|
|
226
|
+
chartColorPalettes?: Array<{ colors: Array<string> }>;
|
|
227
|
+
disableColorRotation?: boolean;
|
|
228
|
+
chartFeatureToFontGuid?: Record<CustomizableChartFeature, string>;
|
|
229
|
+
customFontFaces?: Array<CustomFontFaces>;
|
|
230
|
+
};
|
|
161
231
|
|
|
162
232
|
export interface AppConfig {
|
|
163
|
-
|
|
164
|
-
* @hidden
|
|
165
|
-
*/
|
|
166
|
-
styleConfig?: CustomStylingConfig;
|
|
233
|
+
styleConfig?: ChartSdkCustomStylingConfig;
|
|
167
234
|
|
|
168
235
|
appOptions?: {
|
|
169
236
|
isMobile?: boolean;
|
|
170
237
|
isPrintMode?: boolean; // export mode on/off
|
|
171
|
-
|
|
238
|
+
isLiveboardContext?: boolean; // if chart renders in liveboard context
|
|
172
239
|
// runtime configurations
|
|
173
240
|
isDebugMode?: boolean; // enables debug mode for logging
|
|
174
241
|
};
|
|
@@ -195,4 +262,9 @@ export interface AppConfig {
|
|
|
195
262
|
* @hidden
|
|
196
263
|
*/
|
|
197
264
|
customCalendarConfig?: any; // this is to initialize custom calendar service
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Unique identifier for the customer. This is used to identify the customer
|
|
268
|
+
*/
|
|
269
|
+
customerId?: string;
|
|
198
270
|
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file: Conditional Formatting Types
|
|
3
|
+
* @fileoverview All CF types for the Custom Chart implementations
|
|
4
|
+
* @author Yashvardhan Nehra <yashvardhan.nehra@thoughtspot.com>
|
|
5
|
+
*
|
|
6
|
+
* Copyright: ThoughtSpot Inc. 2023
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export type Maybe<T> = T | null;
|
|
10
|
+
export type InputMaybe<T> = Maybe<T>;
|
|
11
|
+
|
|
12
|
+
export type ConditionalFormatting = {
|
|
13
|
+
__typename?: 'ConditionalFormatting';
|
|
14
|
+
rows?: Maybe<Array<Maybe<ConditionalMetric>>>;
|
|
15
|
+
};
|
|
16
|
+
export type Scalars = {
|
|
17
|
+
ID: string;
|
|
18
|
+
String: string;
|
|
19
|
+
Boolean: boolean;
|
|
20
|
+
Int: number;
|
|
21
|
+
Float: number;
|
|
22
|
+
FileUpload: any;
|
|
23
|
+
GUID: string;
|
|
24
|
+
JSON: {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
};
|
|
27
|
+
JSONObject: any;
|
|
28
|
+
Long: any;
|
|
29
|
+
};
|
|
30
|
+
export declare enum BackgroundFormatTypes {
|
|
31
|
+
Gradient = 'GRADIENT',
|
|
32
|
+
Solid = 'SOLID',
|
|
33
|
+
}
|
|
34
|
+
export enum ConditionalFormattingComparisonTypes {
|
|
35
|
+
ColumnBased = 'COLUMN_BASED',
|
|
36
|
+
ParameterBased = 'PARAMETER_BASED',
|
|
37
|
+
ValueBased = 'VALUE_BASED',
|
|
38
|
+
}
|
|
39
|
+
export type FontAttrs = {
|
|
40
|
+
__typename?: 'FontAttrs';
|
|
41
|
+
bold?: Maybe<Scalars['Boolean']>;
|
|
42
|
+
color?: Maybe<Scalars['String']>;
|
|
43
|
+
italic?: Maybe<Scalars['Boolean']>;
|
|
44
|
+
strikeThrough?: Maybe<Scalars['Boolean']>;
|
|
45
|
+
underline?: Maybe<Scalars['Boolean']>;
|
|
46
|
+
};
|
|
47
|
+
export type GradientBackgroundAttrs = {
|
|
48
|
+
__typename?: 'GradientBackgroundAttrs';
|
|
49
|
+
backgroundFormatMidpoint?: Maybe<Scalars['Float']>;
|
|
50
|
+
backgroundFormatRange?: Maybe<Array<Maybe<Scalars['Float']>>>;
|
|
51
|
+
colors?: Maybe<Array<Maybe<Scalars['String']>>>;
|
|
52
|
+
};
|
|
53
|
+
export enum Operators {
|
|
54
|
+
Contains = 'CONTAINS',
|
|
55
|
+
DoesNotContain = 'DOES_NOT_CONTAIN',
|
|
56
|
+
EndsWith = 'ENDS_WITH',
|
|
57
|
+
EqualTo = 'EQUAL_TO',
|
|
58
|
+
GreaterThan = 'GREATER_THAN',
|
|
59
|
+
GreaterThanEqualTo = 'GREATER_THAN_EQUAL_TO',
|
|
60
|
+
Is = 'IS',
|
|
61
|
+
IsBetween = 'IS_BETWEEN',
|
|
62
|
+
IsEmpty = 'IS_EMPTY',
|
|
63
|
+
IsNot = 'IS_NOT',
|
|
64
|
+
IsNotEmpty = 'IS_NOT_EMPTY',
|
|
65
|
+
IsNotNull = 'IS_NOT_NULL',
|
|
66
|
+
IsNull = 'IS_NULL',
|
|
67
|
+
LessThan = 'LESS_THAN',
|
|
68
|
+
LessThanEqualTo = 'LESS_THAN_EQUAL_TO',
|
|
69
|
+
NotEqualTo = 'NOT_EQUAL_TO',
|
|
70
|
+
StartsWith = 'STARTS_WITH',
|
|
71
|
+
}
|
|
72
|
+
export type SolidBackgroundAttrs = {
|
|
73
|
+
__typename?: 'SolidBackgroundAttrs';
|
|
74
|
+
color?: Maybe<Scalars['String']>;
|
|
75
|
+
};
|
|
76
|
+
export type Range = {
|
|
77
|
+
__typename?: 'Range';
|
|
78
|
+
max?: Maybe<Scalars['Float']>;
|
|
79
|
+
min?: Maybe<Scalars['Float']>;
|
|
80
|
+
};
|
|
81
|
+
export type ConditionalMetric = {
|
|
82
|
+
__typename?: 'ConditionalMetric';
|
|
83
|
+
backgroundFormatType?: Maybe<BackgroundFormatTypes>;
|
|
84
|
+
comparisonParameterId?: Maybe<Scalars['String']>;
|
|
85
|
+
comparisonType?: Maybe<ConditionalFormattingComparisonTypes>;
|
|
86
|
+
fontProperties?: Maybe<FontAttrs>;
|
|
87
|
+
gradientBackgroundAttrs?: Maybe<GradientBackgroundAttrs>;
|
|
88
|
+
isHighlightRow?: Maybe<Scalars['Boolean']>;
|
|
89
|
+
lhsColumnId?: Maybe<Scalars['String']>;
|
|
90
|
+
operator?: Maybe<Operators>;
|
|
91
|
+
plotAsBand?: Maybe<Scalars['Boolean']>;
|
|
92
|
+
rangeValues?: Maybe<Range>;
|
|
93
|
+
rhsColumnId?: Maybe<Scalars['String']>;
|
|
94
|
+
solidBackgroundAttrs?: Maybe<SolidBackgroundAttrs>;
|
|
95
|
+
value?: Maybe<Scalars['String']>;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export type Parameter = {
|
|
99
|
+
__typename?: 'Parameter';
|
|
100
|
+
dataType: FalconDataType;
|
|
101
|
+
defaultValue: Scalars['String'];
|
|
102
|
+
description: Scalars['String'];
|
|
103
|
+
id: Scalars['GUID'];
|
|
104
|
+
name: Scalars['String'];
|
|
105
|
+
/** If not present, the parameter has not been overridden */
|
|
106
|
+
overrideValue?: Maybe<Scalars['String']>;
|
|
107
|
+
owner: ParameterOwnerInfo;
|
|
108
|
+
valueList?: Maybe<Array<ParameterValueListItem>>;
|
|
109
|
+
valueRange?: Maybe<ParameterValueRange>;
|
|
110
|
+
valueType: ParameterValueType;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export enum FalconDataType {
|
|
114
|
+
Bool = 'BOOL',
|
|
115
|
+
Char = 'CHAR',
|
|
116
|
+
Date = 'DATE',
|
|
117
|
+
DateTime = 'DATE_TIME',
|
|
118
|
+
Double = 'DOUBLE',
|
|
119
|
+
Float = 'FLOAT',
|
|
120
|
+
Int32 = 'INT32',
|
|
121
|
+
Int64 = 'INT64',
|
|
122
|
+
List = 'LIST',
|
|
123
|
+
ListBool = 'LIST_BOOL',
|
|
124
|
+
ListDate = 'LIST_DATE',
|
|
125
|
+
ListDateTime = 'LIST_DATE_TIME',
|
|
126
|
+
ListDouble = 'LIST_DOUBLE',
|
|
127
|
+
ListInt = 'LIST_INT',
|
|
128
|
+
ListString = 'LIST_STRING',
|
|
129
|
+
ListTime = 'LIST_TIME',
|
|
130
|
+
MaxType = 'MAX_TYPE',
|
|
131
|
+
Time = 'TIME',
|
|
132
|
+
Unknown = 'UNKNOWN',
|
|
133
|
+
}
|
|
134
|
+
export type ParameterOwnerInfo = {
|
|
135
|
+
__typename?: 'ParameterOwnerInfo';
|
|
136
|
+
id: Scalars['GUID'];
|
|
137
|
+
name: Scalars['String'];
|
|
138
|
+
type: ParameterOwnerType;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export enum ParameterOwnerType {
|
|
142
|
+
Answer = 'ANSWER',
|
|
143
|
+
Worksheet = 'WORKSHEET',
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export type ParameterValueListItem = {
|
|
147
|
+
__typename?: 'ParameterValueListItem';
|
|
148
|
+
displayAs?: Maybe<Scalars['String']>;
|
|
149
|
+
value: Scalars['String'];
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export type ParameterValueListItemInput = {
|
|
153
|
+
displayAs?: InputMaybe<Scalars['String']>;
|
|
154
|
+
value: Scalars['String'];
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export type ParameterValueRange = {
|
|
158
|
+
__typename?: 'ParameterValueRange';
|
|
159
|
+
max?: Maybe<Scalars['Float']>;
|
|
160
|
+
min?: Maybe<Scalars['Float']>;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export type ParameterValueRangeInput = {
|
|
164
|
+
max?: InputMaybe<Scalars['Float']>;
|
|
165
|
+
min?: InputMaybe<Scalars['Float']>;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export enum ParameterValueType {
|
|
169
|
+
Any = 'ANY',
|
|
170
|
+
List = 'LIST',
|
|
171
|
+
Range = 'RANGE',
|
|
172
|
+
}
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* Copyright: ThoughtSpot Inc. 2023
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { CustomChartContext } from '../main/custom-chart-context';
|
|
18
|
+
import { ChartModel } from './common.types';
|
|
17
19
|
/**
|
|
18
20
|
*
|
|
19
21
|
* @group Chart Configuration Editor
|
|
@@ -68,6 +70,20 @@ export interface ChartConfigSection {
|
|
|
68
70
|
* @version SDK: 0.1 | ThoughtSpot:
|
|
69
71
|
*/
|
|
70
72
|
allowTimeSeriesColumns?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Allow measure name Column on the Section
|
|
75
|
+
*
|
|
76
|
+
* @default true
|
|
77
|
+
* @version SDK: 0.1 | ThoughtSpot:
|
|
78
|
+
*/
|
|
79
|
+
allowMeasureNameColumn?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Allow measure value Column on the Section
|
|
82
|
+
*
|
|
83
|
+
* @default true
|
|
84
|
+
* @version SDK: 0.1 | ThoughtSpot:
|
|
85
|
+
*/
|
|
86
|
+
allowMeasureValueColumn?: boolean;
|
|
71
87
|
}
|
|
72
88
|
|
|
73
89
|
/**
|
|
@@ -100,3 +116,8 @@ export interface ChartConfigEditorDefinition {
|
|
|
100
116
|
*/
|
|
101
117
|
columnSections: ChartConfigSection[];
|
|
102
118
|
}
|
|
119
|
+
|
|
120
|
+
export type ConfigEditorDefinitionSetter = (
|
|
121
|
+
currentState: ChartModel,
|
|
122
|
+
ctx: CustomChartContext,
|
|
123
|
+
) => ChartConfigEditorDefinition[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AllowedConfigurations } from '../main/custom-chart-context';
|
|
1
2
|
import { ChartColumn } from './answer-column.types';
|
|
2
3
|
import { Point } from './chart-to-ts-event.types';
|
|
3
4
|
import {
|
|
@@ -159,6 +160,13 @@ export interface InitializeEventPayload {
|
|
|
159
160
|
* @version SDK: 0.1 | ThoughtSpot:
|
|
160
161
|
*/
|
|
161
162
|
hostUrl: string;
|
|
163
|
+
/**
|
|
164
|
+
* The selector of the container element where the chart will be rendered. Used for internal
|
|
165
|
+
* charts, external custom charts mostly have their own DOM.
|
|
166
|
+
*
|
|
167
|
+
* @version SDK: 0.2 | ThoughtSpot:
|
|
168
|
+
*/
|
|
169
|
+
containerElSelector: string;
|
|
162
170
|
}
|
|
163
171
|
|
|
164
172
|
/**
|
|
@@ -191,6 +199,13 @@ export interface InitializeEventResponsePayload {
|
|
|
191
199
|
* @version SDK: 0.1 | ThoughtSpot:
|
|
192
200
|
*/
|
|
193
201
|
visualPropEditorDefinition?: VisualPropEditorDefinition;
|
|
202
|
+
/**
|
|
203
|
+
* Toggle native configurations supported by TS UI. Ex: column level number and conditional
|
|
204
|
+
* formatting.
|
|
205
|
+
*
|
|
206
|
+
* @version SDK: 0.1 | ThoughtSpot:
|
|
207
|
+
*/
|
|
208
|
+
allowedConfigurations?: AllowedConfigurations;
|
|
194
209
|
}
|
|
195
210
|
|
|
196
211
|
/**
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* Copyright: ThoughtSpot Inc. 2023
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import { CustomChartContext } from '../main/custom-chart-context';
|
|
12
|
+
import { ChartModel } from './common.types';
|
|
11
13
|
/**
|
|
12
14
|
* Configuration for input validation rules
|
|
13
15
|
*/
|
|
@@ -373,6 +375,11 @@ export interface VisualPropEditorDefinition {
|
|
|
373
375
|
elements: PropElement[];
|
|
374
376
|
}
|
|
375
377
|
|
|
378
|
+
export type VisualEditorDefinitionSetter = (
|
|
379
|
+
currentState: ChartModel,
|
|
380
|
+
ctx: CustomChartContext,
|
|
381
|
+
) => VisualPropEditorDefinition;
|
|
382
|
+
|
|
376
383
|
/**
|
|
377
384
|
* Example config to be able to store config in the following keys
|
|
378
385
|
* 1. range.xaxis.min
|