@thoughtspot/ts-chart-sdk 1.1.0 → 1.2.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.
@@ -285,19 +285,29 @@ export enum AxisMenuActions {
285
285
  SORT = 'SORT',
286
286
 
287
287
  /**
288
- * These 2 methods are disabled currently as they are not supported by the backend.
288
+ * This method is disabled currently as it is not supported by the backend.
289
289
  * Following are the reasons for the same:
290
- * 1. Remove is ambiguous as it can mean remove from the answer scope or remove from the chart.
291
- * 2. Rename columns is not supported by the menu for now. If need be, this can be implemented.
290
+ * 1. Rename columns is not supported by the menu for now. If need be, this can be implemented.
292
291
  */
293
292
  // /**
294
293
  // * Rename the column.
295
294
  // * */
296
295
  // RENAME = 'RENAME',
297
- // /**
298
- // * Remove the column from the answer scope.
299
- // * */
300
- // REMOVE = 'REMOVE',
296
+
297
+ /**
298
+ * Remove the column from the answer scope.
299
+ * */
300
+ REMOVE = 'REMOVE',
301
+
302
+ /**
303
+ * Open configure settings.
304
+ */
305
+ EDIT = 'EDIT',
306
+
307
+ /**
308
+ * Open Conditional Formatting editor of the column.
309
+ */
310
+ CONDITIONAL_FORMAT = 'CONDITIONAL_FORMAT',
301
311
  /**
302
312
  * Defines a separator element between the actions.
303
313
  * Can be added multiple times.
@@ -6,6 +6,7 @@
6
6
  * Copyright: ThoughtSpot Inc. 2023
7
7
  */
8
8
 
9
+ import { Action } from './actions.types';
9
10
  import { ChartColumn } from './answer-column.types';
10
11
  import type { ChartConfigEditorDefinition } from './configurator.types';
11
12
  import type { VisualPropEditorDefinition } from './visual-prop.types';
@@ -358,3 +359,38 @@ export interface AppConfig {
358
359
  */
359
360
  chartAppAccessToken?: string;
360
361
  }
362
+
363
+ /**
364
+ * @description Configuration interface for controlling the visibility and behavior of actions in a custom chart.
365
+ * This interface allows control over which actions are disabled, hidden, or visible
366
+ * in the Answer Actions(3dot menu)/ context menu actions.
367
+ *
368
+ * @export
369
+ * @interface VisualConfig
370
+ */
371
+ export interface VisualConfig {
372
+ /**
373
+ * Array of actions that should be disabled (grayed out) in the custom chart.
374
+ * These actions will be visible but not interactive.
375
+ */
376
+ customChartDisabledActions?: Action[];
377
+
378
+ /**
379
+ * Tooltip message for why certain actions are disabled.
380
+ *
381
+ */
382
+ customChartDisabledActionReason?: string;
383
+
384
+ /**
385
+ * Array of actions that should be completely hidden from the custom chart's UI.
386
+ * These actions will not be visible to users. Define either this or visibleActions.
387
+ */
388
+ customChartHiddenActions?: Action[];
389
+
390
+ /**
391
+ * Array of actions that should be explicitly visible in the custom chart.
392
+ * Use this to specify which actions should be shown in the UI. Define either this or Hidden
393
+ * Actions
394
+ */
395
+ customChartVisibleActions?: Action[];
396
+ }
@@ -12,6 +12,7 @@ import {
12
12
  DataPointsArray,
13
13
  QueryData,
14
14
  ValidationResponse,
15
+ VisualConfig,
15
16
  VisualProps,
16
17
  } from './common.types';
17
18
  import type { ChartConfigEditorDefinition } from './configurator.types';
@@ -234,6 +235,16 @@ export interface InitializeEventResponsePayload {
234
235
  * @version SDK: 0.1 | ThoughtSpot:
235
236
  */
236
237
  chartConfigParameters?: ChartConfigParameters;
238
+
239
+ /**
240
+ * @description
241
+ * Optional parameter to control certain visual elements on the chart For example visibleAction
242
+ * array if Passed will only show those actions in context menu/Action menu of the chart on
243
+ * answer page. To be passed to TS via this payload
244
+ * @type {VisualConfig}
245
+ * @memberof InitializeEventResponsePayload
246
+ */
247
+ customChartVisualConfig?: VisualConfig;
237
248
  }
238
249
 
239
250
  /**