@thoughtspot/ts-chart-sdk 0.0.1-alpha.1 → 0.0.1-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.
Files changed (109) hide show
  1. package/cjs/index.d.ts +1 -0
  2. package/cjs/index.d.ts.map +1 -1
  3. package/cjs/index.js +1 -0
  4. package/cjs/index.js.map +1 -1
  5. package/cjs/main/custom-chart-context.d.ts +10 -2
  6. package/cjs/main/custom-chart-context.d.ts.map +1 -1
  7. package/cjs/main/custom-chart-context.js +117 -2
  8. package/cjs/main/custom-chart-context.js.map +1 -1
  9. package/cjs/main/custom-chart-context.spec.js +320 -0
  10. package/cjs/main/custom-chart-context.spec.js.map +1 -1
  11. package/cjs/main/post-message-event-bridge.js +1 -1
  12. package/cjs/main/post-message-event-bridge.js.map +1 -1
  13. package/cjs/main/post-message-event-bridge.spec.js +5 -3
  14. package/cjs/main/post-message-event-bridge.spec.js.map +1 -1
  15. package/cjs/react/mocks/custom-chart-context-mock.d.ts +3 -0
  16. package/cjs/react/mocks/custom-chart-context-mock.d.ts.map +1 -0
  17. package/cjs/react/mocks/custom-chart-context-mock.js +100 -0
  18. package/cjs/react/mocks/custom-chart-context-mock.js.map +1 -0
  19. package/cjs/react/use-custom-chart-context.d.ts +4 -0
  20. package/cjs/react/use-custom-chart-context.d.ts.map +1 -0
  21. package/cjs/react/use-custom-chart-context.js +95 -0
  22. package/cjs/react/use-custom-chart-context.js.map +1 -0
  23. package/cjs/react/use-custom-chart-context.spec.d.ts +2 -0
  24. package/cjs/react/use-custom-chart-context.spec.d.ts.map +1 -0
  25. package/cjs/react/use-custom-chart-context.spec.js +391 -0
  26. package/cjs/react/use-custom-chart-context.spec.js.map +1 -0
  27. package/cjs/react/use-custom-chart-context.util.d.ts +6 -0
  28. package/cjs/react/use-custom-chart-context.util.d.ts.map +1 -0
  29. package/cjs/react/use-custom-chart-context.util.js +60 -0
  30. package/cjs/react/use-custom-chart-context.util.js.map +1 -0
  31. package/cjs/react/use-custom-chart-types.d.ts +23 -0
  32. package/cjs/react/use-custom-chart-types.d.ts.map +1 -0
  33. package/cjs/react/use-custom-chart-types.js +3 -0
  34. package/cjs/react/use-custom-chart-types.js.map +1 -0
  35. package/cjs/types/chart-to-ts-event.types.d.ts +54 -4
  36. package/cjs/types/chart-to-ts-event.types.d.ts.map +1 -1
  37. package/cjs/types/chart-to-ts-event.types.js +14 -1
  38. package/cjs/types/chart-to-ts-event.types.js.map +1 -1
  39. package/cjs/types/common.types.d.ts +2 -0
  40. package/cjs/types/common.types.d.ts.map +1 -1
  41. package/cjs/types/ts-to-chart-event.types.d.ts +23 -1
  42. package/cjs/types/ts-to-chart-event.types.d.ts.map +1 -1
  43. package/cjs/types/ts-to-chart-event.types.js +2 -0
  44. package/cjs/types/ts-to-chart-event.types.js.map +1 -1
  45. package/cjs/types/visual-prop.types.d.ts +27 -1
  46. package/cjs/types/visual-prop.types.d.ts.map +1 -1
  47. package/dist/ts-chart-sdk.d.ts +151 -23
  48. package/lib/index.d.ts +1 -0
  49. package/lib/index.d.ts.map +1 -1
  50. package/lib/index.js +1 -0
  51. package/lib/index.js.map +1 -1
  52. package/lib/main/custom-chart-context.d.ts +10 -2
  53. package/lib/main/custom-chart-context.d.ts.map +1 -1
  54. package/lib/main/custom-chart-context.js +118 -3
  55. package/lib/main/custom-chart-context.js.map +1 -1
  56. package/lib/main/custom-chart-context.spec.js +317 -0
  57. package/lib/main/custom-chart-context.spec.js.map +1 -1
  58. package/lib/main/post-message-event-bridge.js +1 -1
  59. package/lib/main/post-message-event-bridge.js.map +1 -1
  60. package/lib/main/post-message-event-bridge.spec.js +5 -3
  61. package/lib/main/post-message-event-bridge.spec.js.map +1 -1
  62. package/lib/react/mocks/custom-chart-context-mock.d.ts +3 -0
  63. package/lib/react/mocks/custom-chart-context-mock.d.ts.map +1 -0
  64. package/lib/react/mocks/custom-chart-context-mock.js +94 -0
  65. package/lib/react/mocks/custom-chart-context-mock.js.map +1 -0
  66. package/lib/react/use-custom-chart-context.d.ts +4 -0
  67. package/lib/react/use-custom-chart-context.d.ts.map +1 -0
  68. package/lib/react/use-custom-chart-context.js +68 -0
  69. package/lib/react/use-custom-chart-context.js.map +1 -0
  70. package/lib/react/use-custom-chart-context.spec.d.ts +2 -0
  71. package/lib/react/use-custom-chart-context.spec.d.ts.map +1 -0
  72. package/lib/react/use-custom-chart-context.spec.js +363 -0
  73. package/lib/react/use-custom-chart-context.spec.js.map +1 -0
  74. package/lib/react/use-custom-chart-context.util.d.ts +6 -0
  75. package/lib/react/use-custom-chart-context.util.d.ts.map +1 -0
  76. package/lib/react/use-custom-chart-context.util.js +51 -0
  77. package/lib/react/use-custom-chart-context.util.js.map +1 -0
  78. package/lib/react/use-custom-chart-types.d.ts +23 -0
  79. package/lib/react/use-custom-chart-types.d.ts.map +1 -0
  80. package/lib/react/use-custom-chart-types.js +2 -0
  81. package/lib/react/use-custom-chart-types.js.map +1 -0
  82. package/lib/types/chart-to-ts-event.types.d.ts +54 -4
  83. package/lib/types/chart-to-ts-event.types.d.ts.map +1 -1
  84. package/lib/types/chart-to-ts-event.types.js +13 -0
  85. package/lib/types/chart-to-ts-event.types.js.map +1 -1
  86. package/lib/types/common.types.d.ts +2 -0
  87. package/lib/types/common.types.d.ts.map +1 -1
  88. package/lib/types/ts-to-chart-event.types.d.ts +23 -1
  89. package/lib/types/ts-to-chart-event.types.d.ts.map +1 -1
  90. package/lib/types/ts-to-chart-event.types.js +2 -0
  91. package/lib/types/ts-to-chart-event.types.js.map +1 -1
  92. package/lib/types/visual-prop.types.d.ts +27 -1
  93. package/lib/types/visual-prop.types.d.ts.map +1 -1
  94. package/package.json +8 -2
  95. package/src/index.ts +1 -0
  96. package/src/main/custom-chart-context.spec.ts +426 -0
  97. package/src/main/custom-chart-context.ts +244 -3
  98. package/src/main/post-message-event-bridge.spec.ts +5 -3
  99. package/src/main/post-message-event-bridge.ts +1 -1
  100. package/src/react/mocks/custom-chart-context-mock.ts +114 -0
  101. package/src/react/use-custom-chart-context.spec.tsx +464 -0
  102. package/src/react/use-custom-chart-context.tsx +180 -0
  103. package/src/react/use-custom-chart-context.util.ts +101 -0
  104. package/src/react/use-custom-chart-types.ts +70 -0
  105. package/src/types/chart-to-ts-event.types.ts +215 -3
  106. package/src/types/common.types.ts +15 -1
  107. package/src/types/ts-to-chart-event.types.ts +70 -0
  108. package/src/types/visual-prop.types.ts +137 -0
  109. package/lib/dist/ts-chart-sdk.d.ts +0 -312
@@ -5,13 +5,20 @@
5
5
  *
6
6
  * Copyright: ThoughtSpot Inc. 2023
7
7
  */
8
+
8
9
  import _ from 'lodash';
9
10
  import {
11
+ AxisMenuActionHandler,
10
12
  ChartToTSEvent,
11
13
  ChartToTSEventsPayloadMap,
14
+ ContextMenuActionHandler,
15
+ CustomAction,
12
16
  ErrorType,
17
+ OpenAxisMenuEventPayload,
18
+ OpenContextMenuEventPayload,
13
19
  } from '../types/chart-to-ts-event.types';
14
20
  import {
21
+ AppConfig,
15
22
  ChartConfig,
16
23
  ChartModel,
17
24
  ValidationResponse,
@@ -19,8 +26,10 @@ import {
19
26
  } from '../types/common.types';
20
27
  import { ChartConfigEditorDefinition } from '../types/configurator.types';
21
28
  import {
29
+ AxisMenuCustomActionPayload,
22
30
  ChartConfigValidateEventPayload,
23
31
  ChartModelUpdateEventPayload,
32
+ ContextMenuCustomActionPayload,
24
33
  DataUpdateEventPayload,
25
34
  GetDataQueryPayload,
26
35
  GetDataQueryResponsePayload,
@@ -104,6 +113,8 @@ export type CustomChartContextProps = {
104
113
  * on the TS app. If not provided, visual properties will not be configurable in
105
114
  * editor
106
115
  *
116
+ * @param chartModel
117
+ * @returns {@link VisualPropEditorDefinition}
107
118
  * @version SDK: 0.1 | ThoughtSpot:
108
119
  */
109
120
  visualPropEditorDefinition?: VisualPropEditorDefinition;
@@ -116,7 +127,6 @@ const DEFAULT_CHART_CONTEXT_PROPS: Partial<CustomChartContextProps> = {
116
127
  validateConfig: () => ({ isValid: true }),
117
128
  validateVisualProps: () => ({ isValid: true }),
118
129
  chartConfigEditorDefinition: undefined,
119
- visualPropEditorDefinition: undefined,
120
130
  };
121
131
 
122
132
  export class CustomChartContext {
@@ -148,6 +158,13 @@ export class CustomChartContext {
148
158
  */
149
159
  private chartModel: ChartModel = {} as any;
150
160
 
161
+ /**
162
+ * App Config object. This contains the app state like locale and timezones.
163
+ *
164
+ * @version SDK: 0.1 | ThoughtSpot:
165
+ */
166
+ private appConfig: AppConfig = {};
167
+
151
168
  /**
152
169
  * Chart Props Object to define the workflow of the application
153
170
  *
@@ -184,6 +201,22 @@ export class CustomChartContext {
184
201
  */
185
202
  private triggerInitResolve: () => void = _.noop;
186
203
 
204
+ /**
205
+ * Stores the callbacks of context menu custom action based on custom action id
206
+ *
207
+ * @returns {@link ContextMenuActionHandler}
208
+ * @version SDK: 0.1 | ThoughtSpot:
209
+ */
210
+ private contextMenuActionHandler: ContextMenuActionHandler = {};
211
+
212
+ /**
213
+ * Stores the callbacks of axis menu custom action based on custom action id
214
+ *
215
+ * @returns {@link AxisMenuActionHandler}
216
+ * @version SDK: 0.1 | ThoughtSpot:
217
+ */
218
+ private axisMenuActionHandler: AxisMenuActionHandler = {};
219
+
187
220
  /**
188
221
  * Constructor to only accept context props as payload
189
222
  *
@@ -232,6 +265,21 @@ export class CustomChartContext {
232
265
  this.eventListeners[eventType].push(callbackFn);
233
266
  }
234
267
 
268
+ /**
269
+ * Removes specific event listeners on the chart context.
270
+ *
271
+ * @param {T} eventType
272
+ * @returns void
273
+ */
274
+ public off<T extends keyof TSToChartEventsPayloadMap>(eventType: T): void {
275
+ if (_.isNil(this.eventListeners[eventType])) {
276
+ console.log('No event listener found to remove');
277
+ this.eventListeners[eventType] = [];
278
+ return;
279
+ }
280
+ this.eventListeners[eventType].splice(0, 1);
281
+ }
282
+
235
283
  /**
236
284
  * Add internal event listeners on the chart context with the required callback.
237
285
  *
@@ -268,6 +316,107 @@ export class CustomChartContext {
268
316
  */
269
317
  public getChartModel = (): ChartModel => this.chartModel;
270
318
 
319
+ /**
320
+ * Getter for the chart model object
321
+ *
322
+ * @version SDK: 0.1 | ThoughtSpot:
323
+ */
324
+ public getAppConfig = (): AppConfig => this.appConfig;
325
+
326
+ /**
327
+ * Function to store the context menu custom action callback mapped with action id
328
+ * @param {[OpenContextMenuEventPayload]} eventPayload Event payload bound
329
+ * to the type of the event
330
+ * @returns payload
331
+ */
332
+ public contextMenuCustomActionPreProcessor(
333
+ eventPayload: [OpenContextMenuEventPayload],
334
+ ): [OpenContextMenuEventPayload] {
335
+ // clear out the stored custom events callback for context menu
336
+ this.contextMenuActionHandler = {};
337
+ if (_.isEmpty(eventPayload?.[0]?.customActions)) {
338
+ return eventPayload;
339
+ }
340
+ eventPayload?.[0]?.customActions?.forEach((action: CustomAction) => {
341
+ this.contextMenuActionHandler[action.id] = action.onClick;
342
+ });
343
+ const processedCustomActions = eventPayload[0]?.customActions?.map(
344
+ (action: CustomAction) => {
345
+ return {
346
+ id: action.id,
347
+ label: action.label,
348
+ icon: action.icon,
349
+ };
350
+ },
351
+ );
352
+ const processedPayload: [OpenContextMenuEventPayload] = [
353
+ {
354
+ ...eventPayload[0],
355
+ customActions: processedCustomActions as CustomAction[],
356
+ },
357
+ ];
358
+ return processedPayload;
359
+ }
360
+
361
+ /**
362
+ * Function to store the axis menu custom action callback mapped with action id
363
+ * @param {[OpenAxisMenuEventPayload]} eventPayload Event payload bound
364
+ * to the type of the event
365
+ * @returns payload
366
+ */
367
+ public axisMenuCustomActionPreProcessor(
368
+ eventPayload: [OpenAxisMenuEventPayload],
369
+ ): [OpenAxisMenuEventPayload] {
370
+ // clear out the stored custom events callback for axis menu
371
+ this.axisMenuActionHandler = {};
372
+ if (_.isEmpty(eventPayload?.[0]?.customActions)) {
373
+ return eventPayload;
374
+ }
375
+ eventPayload[0].customActions?.forEach((action: CustomAction) => {
376
+ this.axisMenuActionHandler[action.id] = action.onClick;
377
+ });
378
+ const processedCustomActions = eventPayload?.[0].customActions?.map(
379
+ (action: CustomAction) => {
380
+ return {
381
+ id: action.id,
382
+ label: action.label,
383
+ icon: action.icon,
384
+ };
385
+ },
386
+ );
387
+ const processedPayload: [OpenAxisMenuEventPayload] = [
388
+ {
389
+ ...eventPayload[0],
390
+ customActions: processedCustomActions as CustomAction[],
391
+ },
392
+ ];
393
+ return processedPayload;
394
+ }
395
+
396
+ /**
397
+ * Function to process the event payload based on event type
398
+ * @param {ChartToTSEventsPayloadMap[T]} eventPayload Event payload bound
399
+ * to the type of the event
400
+ * @returns payload
401
+ */
402
+ private eventPayloadPreProcessor<T extends keyof ChartToTSEventsPayloadMap>(
403
+ eventType: T,
404
+ eventPayload: ChartToTSEventsPayloadMap[T],
405
+ ): ChartToTSEventsPayloadMap[T] {
406
+ switch (eventType) {
407
+ case ChartToTSEvent.OpenContextMenu:
408
+ return this.contextMenuCustomActionPreProcessor(
409
+ eventPayload as [OpenContextMenuEventPayload],
410
+ ) as ChartToTSEventsPayloadMap[T];
411
+ case ChartToTSEvent.OpenAxisMenu:
412
+ return this.axisMenuCustomActionPreProcessor(
413
+ eventPayload as [OpenAxisMenuEventPayload],
414
+ ) as ChartToTSEventsPayloadMap[T];
415
+ default:
416
+ return eventPayload;
417
+ }
418
+ }
419
+
271
420
  /**
272
421
  * Function to emit Chart to TS Events to the TS application.
273
422
 
@@ -286,10 +435,14 @@ export class CustomChartContext {
286
435
  );
287
436
  return Promise.reject(new Error('Context not initialized'));
288
437
  }
438
+ const processedPayload = this.eventPayloadPreProcessor(
439
+ eventType,
440
+ eventPayload,
441
+ );
289
442
  return PostMessageEventBridge.postMessageToHostApp(
290
443
  this.componentId,
291
444
  this.hostUrl,
292
- eventPayload?.[0] ?? null,
445
+ processedPayload?.[0] ?? null,
293
446
  eventType,
294
447
  );
295
448
  }
@@ -431,6 +584,94 @@ export class CustomChartContext {
431
584
  this.chartContextProps.renderChart(this);
432
585
  });
433
586
 
587
+ /**
588
+ * This event is triggered when the custom context action is triggered from TS app
589
+ */
590
+ this.onInternal(
591
+ TSToChartEvent.ContextMenuActionClick,
592
+ (
593
+ payload: ContextMenuCustomActionPayload,
594
+ ): {
595
+ isValid: boolean;
596
+ error?: unknown;
597
+ } => {
598
+ try {
599
+ const {
600
+ id: customActionCallback,
601
+ clickedPoint,
602
+ selectedPoints,
603
+ event,
604
+ } = payload.customAction;
605
+ const customActionCallbackArgs = {
606
+ id: customActionCallback,
607
+ clickedPoint,
608
+ selectedPoints,
609
+ event,
610
+ };
611
+ this.contextMenuActionHandler[customActionCallback](
612
+ customActionCallbackArgs,
613
+ );
614
+ return {
615
+ isValid: true,
616
+ };
617
+ } catch (error: unknown) {
618
+ console.log(
619
+ 'ContextMenuCustomAction: payload recieved:',
620
+ payload,
621
+ 'CustomActionCallbackStore:',
622
+ this.axisMenuActionHandler,
623
+ );
624
+ return {
625
+ isValid: false,
626
+ error,
627
+ };
628
+ }
629
+ },
630
+ );
631
+
632
+ /**
633
+ * This event is triggered when the custom axis action is triggered from TS app
634
+ */
635
+ this.onInternal(
636
+ TSToChartEvent.AxisMenuActionClick,
637
+ (
638
+ payload: AxisMenuCustomActionPayload,
639
+ ): {
640
+ isValid: boolean;
641
+ error?: unknown;
642
+ } => {
643
+ try {
644
+ const {
645
+ id: customActionCallback,
646
+ columnIds,
647
+ event,
648
+ } = payload.customAction;
649
+ const customActionCallbackArgs = {
650
+ id: customActionCallback,
651
+ columnIds,
652
+ event,
653
+ };
654
+ this.axisMenuActionHandler[customActionCallback](
655
+ customActionCallbackArgs,
656
+ );
657
+ return {
658
+ isValid: true,
659
+ };
660
+ } catch (error: unknown) {
661
+ console.log(
662
+ 'AxisMenuCustomAction: payload recieved:',
663
+ payload,
664
+ 'CustomActionCallbackStore:',
665
+ this.axisMenuActionHandler,
666
+ );
667
+ return {
668
+ isValid: false,
669
+ error,
670
+ };
671
+ }
672
+ },
673
+ );
674
+
434
675
  // Register External Events
435
676
  // These events are readable by the developer
436
677
 
@@ -501,6 +742,7 @@ export class CustomChartContext {
501
742
  this.componentId = payload.componentId;
502
743
  this.hostUrl = payload.hostUrl;
503
744
  this.chartModel = payload.chartModel;
745
+ this.appConfig = payload.appConfig ?? {};
504
746
 
505
747
  return this.publishChartContextPropsToHost();
506
748
  };
@@ -534,7 +776,6 @@ export class CustomChartContext {
534
776
  this.chartModel,
535
777
  );
536
778
  }
537
-
538
779
  return {
539
780
  isConfigValid: isValid,
540
781
  defaultChartConfig,
@@ -13,7 +13,7 @@ describe('postMessageToHostApp', () => {
13
13
  jest.resetAllMocks();
14
14
  });
15
15
 
16
- test('should resolve the promise with null when successful', async () => {
16
+ test('should resolve the promise with data object when successful', async () => {
17
17
  // Mock the necessary variables and functions
18
18
  const componentId = '123';
19
19
  const hostUrl = 'https://example.com';
@@ -39,7 +39,9 @@ describe('postMessageToHostApp', () => {
39
39
  );
40
40
 
41
41
  // Simulate a successful response
42
- const response = { data: { hasError: false } };
42
+ const response = {
43
+ data: { hasError: false, randomData: 'randomString' },
44
+ };
43
45
  if (_.isFunction(channel.port1.onmessage)) {
44
46
  (channel.port1.onmessage as any)(response);
45
47
  } else {
@@ -48,7 +50,7 @@ describe('postMessageToHostApp', () => {
48
50
  }
49
51
 
50
52
  // Wait for the promise to resolve
51
- await expect(promise).resolves.toBeNull();
53
+ await expect(promise).resolves.toEqual(response.data);
52
54
 
53
55
  // Verify that the postMessage function was called with the correct
54
56
  // arguments
@@ -44,7 +44,7 @@ const postMessageToHostApp = (
44
44
  reject(error);
45
45
  } else {
46
46
  console.log('ChartContext: message success:', res.data);
47
- resolve(null);
47
+ resolve(res.data);
48
48
  }
49
49
  };
50
50
 
@@ -0,0 +1,114 @@
1
+ import _ from 'lodash';
2
+ import { CustomChartContextProps } from '../../main/custom-chart-context';
3
+ import { ColumnType } from '../../types/answer-column.types';
4
+ import { ChartConfig, ChartModel } from '../../types/common.types';
5
+ import { Query } from '../../types/ts-to-chart-event.types';
6
+
7
+ export const contextChartProps: CustomChartContextProps = {
8
+ getDefaultChartConfig: (chartModel: ChartModel): ChartConfig[] => {
9
+ const cols = chartModel.columns;
10
+
11
+ const measureColumns = _.filter(
12
+ cols,
13
+ (col) => col.type === ColumnType.MEASURE,
14
+ );
15
+
16
+ const attributeColumns = _.filter(
17
+ cols,
18
+ (col) => col.type === ColumnType.ATTRIBUTE,
19
+ );
20
+
21
+ const axisConfig: ChartConfig = {
22
+ key: 'column',
23
+ dimensions: [
24
+ {
25
+ key: 'x',
26
+ columns: [attributeColumns[0]],
27
+ },
28
+ {
29
+ key: 'y',
30
+ columns: measureColumns.slice(0, 2),
31
+ },
32
+ ],
33
+ };
34
+ return [axisConfig];
35
+ },
36
+ getQueriesFromChartConfig: (chartConfig: ChartConfig[]): Array<Query> => {
37
+ const queries = chartConfig.map(
38
+ (config: ChartConfig): Query =>
39
+ _.reduce(
40
+ config.dimensions,
41
+ (acc: Query, dimension) => ({
42
+ queryColumns: [
43
+ ...acc.queryColumns,
44
+ ...dimension.columns,
45
+ ],
46
+ }),
47
+ {
48
+ queryColumns: [],
49
+ } as Query,
50
+ ),
51
+ );
52
+ return queries;
53
+ },
54
+ chartConfigEditorDefinition: [
55
+ {
56
+ key: 'column',
57
+ label: 'Custom Column',
58
+ descriptionText:
59
+ 'X Axis can only have attributes, Y Axis can only have measures, Color can only have attributes. ' +
60
+ 'Should have just 1 column in Y axis with colors columns.',
61
+ columnSections: [
62
+ {
63
+ key: 'x',
64
+ label: 'Custom X Axis',
65
+ allowAttributeColumns: true,
66
+ allowMeasureColumns: false,
67
+ allowTimeSeriesColumns: true,
68
+ maxColumnCount: 1,
69
+ },
70
+ {
71
+ key: 'y',
72
+ label: 'Custom Y Axis',
73
+ allowAttributeColumns: false,
74
+ allowMeasureColumns: true,
75
+ allowTimeSeriesColumns: false,
76
+ },
77
+ ],
78
+ },
79
+ ],
80
+ visualPropEditorDefinition: {
81
+ elements: [
82
+ {
83
+ key: 'color',
84
+ type: 'radio',
85
+ defaultValue: 'red',
86
+ values: ['red', 'green', 'yellow'],
87
+ label: 'Colors',
88
+ },
89
+ {
90
+ type: 'section',
91
+ key: 'accordion',
92
+ label: 'Accordion',
93
+ children: [
94
+ {
95
+ key: 'Color2',
96
+ type: 'radio',
97
+ defaultValue: 'blue',
98
+ values: ['blue', 'white', 'red'],
99
+ label: 'Color2',
100
+ },
101
+ {
102
+ key: 'datalabels',
103
+ type: 'toggle',
104
+ defaultValue: false,
105
+ label: 'Data Labels',
106
+ },
107
+ ],
108
+ },
109
+ ],
110
+ },
111
+ renderChart: (cx) => {
112
+ return Promise.resolve();
113
+ },
114
+ };