@sisense/sdk-ui 0.12.1 → 0.14.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.
Files changed (60) hide show
  1. package/dist/api/types/dashboard-dto.d.ts +11 -4
  2. package/dist/chart-data-options/types.d.ts +12 -6
  3. package/dist/chart-options-processor/chart-options-service.d.ts +6 -2
  4. package/dist/chart-options-processor/style-to-design-options-translator/translate-to-highcharts-options.d.ts +5 -2
  5. package/dist/chart-options-processor/subtype-to-design-options.d.ts +2 -1
  6. package/dist/chart-options-processor/tooltip.d.ts +1 -0
  7. package/dist/chart-options-processor/translations/axis-section.d.ts +1 -0
  8. package/dist/chart-options-processor/translations/design-options.d.ts +2 -1
  9. package/dist/chart-options-processor/translations/scatter-series.d.ts +1 -0
  10. package/dist/chart-options-processor/translations/sunburst/sunburst-levels.d.ts +12 -0
  11. package/dist/chart-options-processor/translations/sunburst/sunburst-options.d.ts +6 -0
  12. package/dist/chart-options-processor/translations/sunburst/sunburst-series.d.ts +38 -0
  13. package/dist/chart-options-processor/translations/translations-to-highcharts.d.ts +5 -2
  14. package/dist/chart-options-processor/translations/treemap/treemap-tooltip.d.ts +8 -2
  15. package/dist/chart-options-processor/translations/types.d.ts +2 -2
  16. package/dist/chart.d.ts +1 -1
  17. package/dist/dashboard-widget/translate-dashboard-filters.d.ts +13 -0
  18. package/dist/dashboard-widget/translate-panel-color-format.d.ts +3 -2
  19. package/dist/dashboard-widget/translate-widget-filters.d.ts +31 -0
  20. package/dist/dashboard-widget/types.d.ts +26 -4
  21. package/dist/dashboard-widget/use-fetch-widget-dto-model.d.ts +48 -0
  22. package/dist/dashboard-widget/utils.d.ts +1 -1
  23. package/dist/decorators/{with-tracking → component-decorators/with-tracking}/error-tracker.d.ts +1 -1
  24. package/dist/decorators/hook-decorators/index.d.ts +1 -0
  25. package/dist/decorators/hook-decorators/with-tracking.d.ts +2 -0
  26. package/dist/filters/components/common/basic-input.d.ts +8 -0
  27. package/dist/filters/components/common/index.d.ts +1 -0
  28. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +1 -1
  29. package/dist/filters/components/filter-tile.d.ts +2 -2
  30. package/dist/filters/components/member-filter-tile/member-filter-tile.d.ts +1 -1
  31. package/dist/funnel-chart.d.ts +1 -1
  32. package/dist/highcharts-memorized.d.ts +6 -0
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +33180 -32481
  35. package/dist/indicator-chart.d.ts +1 -1
  36. package/dist/models/dashboard/use-get-dashboard-model.d.ts +5 -0
  37. package/dist/models/dashboard/use-get-dashboard-models.d.ts +6 -1
  38. package/dist/no-results-overlay/images/index.d.ts +1 -1
  39. package/dist/pie-chart.d.ts +1 -1
  40. package/dist/props.d.ts +95 -46
  41. package/dist/query/execute-query.d.ts +13 -2
  42. package/dist/query-execution/use-execute-query-by-widget-id.d.ts +20 -5
  43. package/dist/query-execution/use-execute-query.d.ts +11 -3
  44. package/dist/scatter-chart.d.ts +1 -1
  45. package/dist/sunburst-chart.d.ts +27 -0
  46. package/dist/theme-provider/theme-provider.d.ts +1 -1
  47. package/dist/treemap-chart.d.ts +1 -2
  48. package/dist/types.d.ts +24 -2
  49. package/dist/widgets/chart-widget-deprecated.d.ts +30 -0
  50. package/dist/widgets/chart-widget.d.ts +3 -7
  51. package/dist/widgets/common/drilldown.d.ts +1 -1
  52. package/dist/widgets/table-widget.d.ts +1 -2
  53. package/package.json +7 -6
  54. /package/dist/decorators/{as-sisense-component.d.ts → component-decorators/as-sisense-component.d.ts} +0 -0
  55. /package/dist/decorators/{with-default-translations.d.ts → component-decorators/with-default-translations.d.ts} +0 -0
  56. /package/dist/decorators/{with-error-boundary.d.ts → component-decorators/with-error-boundary.d.ts} +0 -0
  57. /package/dist/decorators/{with-sisense-context-validation.d.ts → component-decorators/with-sisense-context-validation.d.ts} +0 -0
  58. /package/dist/decorators/{with-tracking → component-decorators/with-tracking}/index.d.ts +0 -0
  59. /package/dist/decorators/{with-tracking → component-decorators/with-tracking}/use-track-component-init.d.ts +0 -0
  60. /package/dist/decorators/{with-tracking → component-decorators/with-tracking}/with-tracking.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { IndicatorChartProps } from './props';
3
3
  /**
4
- * A React component that displays a single value.
4
+ * A React component that provides various options for displaying one or two numeric values as a number, gauge or ticker.
5
5
  * See [Indicator](https://docs.sisense.com/main/SisenseLinux/indicator.htm) for more information.
6
6
  *
7
7
  * @example
@@ -97,3 +97,8 @@ export type DashboardModelSuccessState = {
97
97
  * @returns Dashboard load state that contains the status of the execution, the result dashboard model, or the error if any
98
98
  */
99
99
  export declare const useGetDashboardModel: (params: GetDashboardModelParams) => DashboardModelState;
100
+ /**
101
+ * {@link useGetDashboardModel} without tracking to be used inside other hooks or components in Compose SDK.
102
+ * @internal
103
+ */
104
+ export declare function useGetDashboardModelInternal(params: GetDashboardModelParams): DashboardModelState;
@@ -81,4 +81,9 @@ export type DashboardModelsSuccessState = {
81
81
  * @param params - Parameters of the dashboards to be retrieved
82
82
  * @returns Load state that contains the status of the execution, the result dashboards, or the error if any
83
83
  */
84
- export declare const useGetDashboardModels: (params?: GetDashboardModelsParams) => DashboardModelsState;
84
+ export declare const useGetDashboardModels: (params?: GetDashboardModelsParams | undefined) => DashboardModelsState;
85
+ /**
86
+ * {@link useGetDashboardModels} without tracking to be used inside other hooks or components in Compose SDK.
87
+ * @internal
88
+ */
89
+ export declare function useGetDashboardModelsInternal(params?: GetDashboardModelsParams): DashboardModelsState;
@@ -1,2 +1,2 @@
1
1
  import { ChartType, TableType } from '../../types';
2
- export declare function getNoResultOverlayImage(type: ChartType | TableType): string;
2
+ export declare function getNoResultOverlayImage(type: ChartType | TableType): any;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { PieChartProps } from './props';
3
3
  /**
4
- * A React component representing data in circular graph with the data shown as slices of a whole,
4
+ * A React component representing data in a circular graph with the data shown as slices of a whole,
5
5
  * with each slice representing a proportion of the total.
6
6
  * See [Pie Chart](https://docs.sisense.com/main/SisenseLinux/pie-chart.htm) for more information.
7
7
  *
package/dist/props.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Attribute, Filter, Measure, DataSource, Data, QueryResultData } from '@sisense/sdk-data';
2
- import { ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ThemeSettings, PolarStyleOptions, PieStyleOptions, StackableStyleOptions, LineStyleOptions, AreaStyleOptions, FunnelStyleOptions, ScatterStyleOptions, StyleOptions, ChartType, IndicatorStyleOptions, DrilldownOptions, TableStyleOptions, ThemeOid, WidgetStyleOptions, TreemapStyleOptions, CustomDrilldownResult, MenuPosition, MenuItemSection } from './types';
2
+ import { ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ThemeSettings, PolarStyleOptions, PieStyleOptions, StackableStyleOptions, LineStyleOptions, AreaStyleOptions, FunnelStyleOptions, ScatterStyleOptions, StyleOptions, ChartType, IndicatorStyleOptions, DrilldownOptions, TableStyleOptions, ThemeOid, WidgetStyleOptions, TreemapStyleOptions, CustomDrilldownResult, MenuPosition, MenuItemSection, SunburstStyleOptions } from './types';
3
3
  import { HighchartsOptions } from './chart-options-processor/chart-options-service';
4
4
  import { ComponentType, PropsWithChildren, ReactNode } from 'react';
5
5
  import { IndicatorDataOptions, ScatterChartDataOptions, TableDataOptions } from './chart-data-options/types';
@@ -9,7 +9,7 @@ import { ExecuteQueryParams } from './query-execution';
9
9
  import { FiltersMergeStrategy } from './dashboard-widget/types';
10
10
  export type { ScatterDataPointEventHandler, ScatterDataPointsEventHandler, DataPointEventHandler, DataPointsEventHandler, MenuItemSection, HighchartsOptions, };
11
11
  /**
12
- * Props for {@link SisenseContextProvider} component
12
+ * Configurations for Sisense Context
13
13
  */
14
14
  export interface SisenseContextProviderProps {
15
15
  /**
@@ -73,7 +73,7 @@ export interface ExecuteQueryProps {
73
73
  /**
74
74
  * Data source the query is run against - e.g. `Sample ECommerce`
75
75
  *
76
- * If not specified, the query will use the `defaultDataSource` specified in the parent {@link SisenseContextProvider} component.
76
+ * If not specified, the query will use the `defaultDataSource` specified in the parent Sisense Context.
77
77
  */
78
78
  dataSource?: DataSource;
79
79
  /** Dimensions of the query */
@@ -100,9 +100,21 @@ export interface ExecuteQueryProps {
100
100
  children?: (queryResult: QueryResultData) => ReactNode;
101
101
  /** Callback function that is evaluated when query results are ready */
102
102
  onDataChanged?: (data: QueryResultData) => void;
103
+ /**
104
+ * Sync or async callback that allows to modify the JAQL payload before it is sent to the server.
105
+ *
106
+ * **Note:** wrap this function in `useCallback` hook to avoid triggering query execution on each render.
107
+ * ```tsx
108
+ * const onBeforeQuery = useCallback((jaql) => {
109
+ * // modify jaql here
110
+ * return jaql;
111
+ * }, []);
112
+ * ```
113
+ */
114
+ onBeforeQuery?: (jaql: any) => any | Promise<any>;
103
115
  }
104
116
  /**
105
- * Props for {@link ThemeProvider} component.
117
+ * Configurations for Theme.
106
118
  *
107
119
  * Two options are supported:
108
120
  *
@@ -138,7 +150,7 @@ export type ThemeProviderProps = PropsWithChildren<{
138
150
  export type BeforeRenderHandler = (
139
151
  /** Highcharts options */
140
152
  highchartsOptions: HighchartsOptions) => HighchartsOptions;
141
- interface ChartEventProps {
153
+ interface BaseChartEventProps {
142
154
  /**
143
155
  * Click handler callback for a data point
144
156
  *
@@ -161,13 +173,13 @@ interface ChartEventProps {
161
173
  * Before render handler callback that allows adjusting
162
174
  * detail chart options prior to render
163
175
  *
164
- * This callback is not yet supported for {@link IndicatorChart}
176
+ * This callback is not yet supported for Indicator Chart
165
177
  *
166
178
  * @category Callbacks
167
179
  */
168
180
  onBeforeRender?: BeforeRenderHandler;
169
181
  }
170
- interface CartesianChartEventProps extends ChartEventProps {
182
+ interface ChartEventProps extends BaseChartEventProps {
171
183
  /**
172
184
  * Click handler callback for a data point
173
185
  *
@@ -187,7 +199,7 @@ interface CartesianChartEventProps extends ChartEventProps {
187
199
  */
188
200
  onDataPointsSelected?: DataPointsEventHandler;
189
201
  }
190
- interface ScatterChartEventProps extends ChartEventProps {
202
+ interface ScatterChartEventProps extends BaseChartEventProps {
191
203
  /**
192
204
  * Click handler callback for a data point
193
205
  *
@@ -214,22 +226,22 @@ interface ScatterChartEventProps extends ChartEventProps {
214
226
  */
215
227
  export interface BaseChartProps {
216
228
  /**
217
- * Data set for this chart, which supports two options:
229
+ * Data set for this component, which supports two options:
218
230
  *
219
231
  * (1) Data source name (as a `string`) - e.g. `Sample ECommerce`. Under the hood,
220
- * the chart will have an internal {@link ExecuteQuery} connect to the data source
232
+ * the chart will have an internal query connect to the data source
221
233
  * and load the data as specified in {@link dataOptions}, {@link filters}, and {@link highlights}.
222
234
  *
223
235
  * OR
224
236
  *
225
- * (2) Explicit {@link @sisense/sdk-data!Data}, which is made up of
237
+ * (2) Explicit {@link @sisense/sdk-data!Data | Data}, which is made up of
226
238
  * an array of {@link @sisense/sdk-data!Column | columns}
227
239
  * and a two-dimensional array of data {@link @sisense/sdk-data!Cell | cells}.
228
240
  * This allows the chart component to be used
229
241
  * with user-provided data.
230
242
  *
231
243
  * If neither option is specified,
232
- * the chart will use the `defaultDataSource` specified in the parent {@link SisenseContextProvider} component.
244
+ * the chart will use the `defaultDataSource` specified in the parent Sisense Context.
233
245
  *
234
246
  *
235
247
  * @category Data
@@ -251,7 +263,7 @@ export interface BaseChartProps {
251
263
  /**
252
264
  * Props shared across {@link Chart} components.
253
265
  */
254
- export interface ChartProps extends BaseChartProps, ChartEventProps {
266
+ export interface ChartProps extends BaseChartProps, BaseChartEventProps {
255
267
  /**
256
268
  * Default chart type of each series.
257
269
  *
@@ -281,7 +293,7 @@ export interface ChartProps extends BaseChartProps, ChartEventProps {
281
293
  /**
282
294
  * Props of the {@link AreaChart} component.
283
295
  */
284
- export interface AreaChartProps extends BaseChartProps, CartesianChartEventProps {
296
+ export interface AreaChartProps extends BaseChartProps, ChartEventProps {
285
297
  /**
286
298
  * Configurations for how to interpret and present data passed to the chart.
287
299
  *
@@ -298,7 +310,7 @@ export interface AreaChartProps extends BaseChartProps, CartesianChartEventProps
298
310
  /**
299
311
  * Props of the {@link BarChart} component.
300
312
  */
301
- export interface BarChartProps extends BaseChartProps, CartesianChartEventProps {
313
+ export interface BarChartProps extends BaseChartProps, ChartEventProps {
302
314
  /**
303
315
  * Configurations for how to interpret and present the data passed to the chart
304
316
  *
@@ -315,7 +327,7 @@ export interface BarChartProps extends BaseChartProps, CartesianChartEventProps
315
327
  /**
316
328
  * Props of the {@link ColumnChart} component.
317
329
  */
318
- export interface ColumnChartProps extends BaseChartProps, CartesianChartEventProps {
330
+ export interface ColumnChartProps extends BaseChartProps, ChartEventProps {
319
331
  /**
320
332
  * Configurations for how to interpret and present the data passed to the chart
321
333
  *
@@ -332,7 +344,7 @@ export interface ColumnChartProps extends BaseChartProps, CartesianChartEventPro
332
344
  /**
333
345
  * Props of the {@link FunnelChart} component.
334
346
  */
335
- export interface FunnelChartProps extends BaseChartProps, CartesianChartEventProps {
347
+ export interface FunnelChartProps extends BaseChartProps, ChartEventProps {
336
348
  /**
337
349
  * Configurations for how to interpret and present the data passed to the chart
338
350
  *
@@ -349,7 +361,7 @@ export interface FunnelChartProps extends BaseChartProps, CartesianChartEventPro
349
361
  /**
350
362
  * Props of the {@link LineChart} component.
351
363
  */
352
- export interface LineChartProps extends BaseChartProps, CartesianChartEventProps {
364
+ export interface LineChartProps extends BaseChartProps, ChartEventProps {
353
365
  /**
354
366
  * Configurations for how to interpret and present data passed to the chart.
355
367
  *
@@ -366,7 +378,7 @@ export interface LineChartProps extends BaseChartProps, CartesianChartEventProps
366
378
  /**
367
379
  * Props of the {@link PieChart} component.
368
380
  */
369
- export interface PieChartProps extends BaseChartProps, CartesianChartEventProps {
381
+ export interface PieChartProps extends BaseChartProps, ChartEventProps {
370
382
  /**
371
383
  * Configurations for how to interpret and present the data passed to the chart
372
384
  *
@@ -383,7 +395,7 @@ export interface PieChartProps extends BaseChartProps, CartesianChartEventProps
383
395
  /**
384
396
  * Props of the {@link PolarChart} component.
385
397
  */
386
- export interface PolarChartProps extends BaseChartProps, CartesianChartEventProps {
398
+ export interface PolarChartProps extends BaseChartProps, ChartEventProps {
387
399
  /** Configurations for how to interpret and present the data passed to the chart */
388
400
  dataOptions: CartesianChartDataOptions;
389
401
  /** Configuration that define functional style of the various chart elements */
@@ -403,31 +415,16 @@ export interface IndicatorChartProps extends BaseChartProps {
403
415
  */
404
416
  export interface TableProps {
405
417
  /**
406
- * Data set for this chart, which supports two options:
407
- *
408
- * (1) Data source name (as a `string`) - e.g. `Sample ECommerce`. Under the hood,
409
- * the chart will have an internal {@link ExecuteQuery} connect to the data source
410
- * and load the data as specified in {@link dataOptions} and {@link filters}.
411
- *
412
- * OR
413
- *
414
- * (2) Explicit {@link @sisense/sdk-data!Data}, which is made up of
415
- * an array of {@link @sisense/sdk-data!Column | columns}
416
- * and a two-dimensional array of data {@link @sisense/sdk-data!Cell | cells}.
417
- * This allows the chart component to be used
418
- * with user-provided data.
419
- *
420
- * If neither option is specified,
421
- * the chart will use the `defaultDataSource` specified in the parent {@link SisenseContextProvider} component.
418
+ * {@inheritDoc ChartProps.dataSet}
422
419
  *
423
420
  *
424
421
  * @category Data
425
422
  */
426
423
  dataSet?: DataSource | Data;
427
424
  /**
428
- * Configurations for how to interpret and present the data passed to the chart
425
+ * Configurations for how to interpret and present the data passed to the component
429
426
  *
430
- * @category Chart
427
+ * @category Representation
431
428
  */
432
429
  dataOptions: TableDataOptions;
433
430
  /**
@@ -437,9 +434,9 @@ export interface TableProps {
437
434
  */
438
435
  filters?: Filter[];
439
436
  /**
440
- * Configurations that define functional style of the various chart elements
437
+ * Configurations that define functional style of the various table elements
441
438
  *
442
- * @category Chart
439
+ * @category Representation
443
440
  */
444
441
  styleOptions?: TableStyleOptions;
445
442
  /**
@@ -471,7 +468,7 @@ export interface ScatterChartProps extends BaseChartProps, ScatterChartEventProp
471
468
  * Props for the {@link DashboardWidget} component
472
469
  *
473
470
  */
474
- export interface DashboardWidgetProps extends Omit<ChartWidgetProps, 'dataSource' | 'dataOptions' | 'chartType' | 'styleOptions'>, ChartEventProps {
471
+ export interface DashboardWidgetProps extends Omit<ChartWidgetProps, 'dataSource' | 'dataOptions' | 'chartType' | 'styleOptions'>, BaseChartEventProps {
475
472
  /**
476
473
  * Identifier of the widget
477
474
  *
@@ -504,6 +501,12 @@ export interface DashboardWidgetProps extends Omit<ChartWidgetProps, 'dataSource
504
501
  * @category Data
505
502
  */
506
503
  filtersMergeStrategy?: FiltersMergeStrategy;
504
+ /**
505
+ * {@inheritDoc ExecuteQueryByWidgetIdProps.includeDashboardFilters}
506
+ *
507
+ * @category Data
508
+ */
509
+ includeDashboardFilters?: boolean;
507
510
  /**
508
511
  * Title of the widget
509
512
  *
@@ -562,11 +565,11 @@ export interface DashboardWidgetProps extends Omit<ChartWidgetProps, 'dataSource
562
565
  * Props for the {@link ChartWidget} component
563
566
  *
564
567
  */
565
- export interface ChartWidgetProps extends ChartEventProps {
568
+ export interface ChartWidgetProps extends BaseChartEventProps {
566
569
  /**
567
570
  * Data source the query is run against - e.g. `Sample ECommerce`
568
571
  *
569
- * If not specified, the query will use the `defaultDataSource` specified in the parent {@link SisenseContextProvider} component.
572
+ * If not specified, the query will use the `defaultDataSource` specified in the parent Sisense Context.
570
573
  *
571
574
  * @category Data
572
575
  */
@@ -610,6 +613,7 @@ export interface ChartWidgetProps extends ChartEventProps {
610
613
  /**
611
614
  * List of categories to allow drilldowns on
612
615
  *
616
+ * @deprecated Use {@link DrilldownWidget} instead
613
617
  * @category Widget
614
618
  */
615
619
  drilldownOptions?: DrilldownOptions;
@@ -653,6 +657,16 @@ export interface ChartWidgetProps extends ChartEventProps {
653
657
  * @category Widget
654
658
  */
655
659
  description?: string;
660
+ /**
661
+ * Boolean flag whether selecting data points triggers highlight filter of the selected data
662
+ *
663
+ * Recommended to turn on when the Chart Widget component is enhanced with data drilldown by the Drilldown Widget component
664
+ *
665
+ * If not specified, the default value is `false`
666
+ *
667
+ * @category Widget
668
+ */
669
+ highlightSelectionDisabled?: boolean;
656
670
  }
657
671
  /**
658
672
  * Props for the {@link TableWidget} component
@@ -663,7 +677,7 @@ export interface TableWidgetProps {
663
677
  /**
664
678
  * Data source the query is run against - e.g. `Sample ECommerce`
665
679
  *
666
- * If not specified, the query will use the `defaultDataSource` specified in the parent {@link SisenseContextProvider} component.
680
+ * If not specified, the query will use the `defaultDataSource` specified in the parent Sisense Context.
667
681
  *
668
682
  * @category Data
669
683
  */
@@ -738,7 +752,7 @@ export interface ExecuteQueryByWidgetIdProps {
738
752
  /** {@inheritDoc ExecuteQueryProps.offset} */
739
753
  offset?: number;
740
754
  /**
741
- * Strategy for merging the existing widget filters with the filters provided via the `filters` prop:
755
+ * Strategy for merging the existing widget filters (including highlights) with the filters provided via the `filters` and `highlights` props:
742
756
  *
743
757
  * - `widgetFirst` - prioritizes the widget filters over the provided filters in case of filter conflicts by certain attributes.
744
758
  * - `codeFirst` - prioritizes the provided filters over the widget filters in case of filter conflicts by certain attributes.
@@ -747,15 +761,33 @@ export interface ExecuteQueryByWidgetIdProps {
747
761
  * If not specified, the default strategy is `codeFirst`.
748
762
  */
749
763
  filtersMergeStrategy?: FiltersMergeStrategy;
764
+ /**
765
+ * Boolean flag whether to include dashboard filters in the widget's `filters` and `highlights`
766
+ *
767
+ * If not specified, the default value is `false`.
768
+ */
769
+ includeDashboardFilters?: boolean;
750
770
  /** Function as child component that is called to render the query results */
751
771
  children?: (queryResult: QueryResultData, queryParams: ExecuteQueryParams) => ReactNode;
752
772
  /** Callback function that is evaluated when query results are ready */
753
773
  onDataChanged?: (data: QueryResultData, queryParams: ExecuteQueryParams) => void;
774
+ /**
775
+ * Sync or async callback that allows to modify the JAQL payload before it is sent to the server.
776
+ *
777
+ * **Note:** wrap this function in `useCallback` hook to avoid triggering query execution on each render.
778
+ * ```tsx
779
+ * const onBeforeQuery = useCallback((jaql) => {
780
+ * // modify jaql here
781
+ * return jaql;
782
+ * }, []);
783
+ * ```
784
+ */
785
+ onBeforeQuery?: (jaql: any) => any | Promise<any>;
754
786
  }
755
787
  /**
756
788
  * Props of the {@link TreemapChart} component.
757
789
  */
758
- export interface TreemapChartProps extends BaseChartProps, CartesianChartEventProps {
790
+ export interface TreemapChartProps extends BaseChartProps, ChartEventProps {
759
791
  /**
760
792
  * Configurations for how to interpret and present the data passed to the chart
761
793
  *
@@ -769,6 +801,23 @@ export interface TreemapChartProps extends BaseChartProps, CartesianChartEventPr
769
801
  */
770
802
  styleOptions?: TreemapStyleOptions;
771
803
  }
804
+ /**
805
+ * Props of the {@link SunburstChart} component.
806
+ */
807
+ export interface SunburstChartProps extends BaseChartProps, ChartEventProps {
808
+ /**
809
+ * Configurations for how to interpret and present the data passed to the chart
810
+ *
811
+ * @category Chart
812
+ */
813
+ dataOptions: CategoricalChartDataOptions;
814
+ /**
815
+ * Configuration that define functional style of the various chart elements
816
+ *
817
+ * @category Chart
818
+ */
819
+ styleOptions?: SunburstStyleOptions;
820
+ }
772
821
  /**
773
822
  * Props for {@link ContextMenu} component.
774
823
  */
@@ -1,8 +1,19 @@
1
- import { Attribute, DataSource, Filter, Measure, QueryResultData } from '@sisense/sdk-data';
1
+ import { Attribute, QueryResultData } from '@sisense/sdk-data';
2
+ import type { QueryDescription as InternalQueryDescription, QueryExecutionConfig } from '@sisense/sdk-query-client';
2
3
  import { ClientApplication } from '../app/client-application';
4
+ /**
5
+ * All the properties that fully describe a query you want to send.
6
+ *
7
+ * We use "dimensions" it public interface because the term is closer to the query and charting
8
+ * as used in the industry (Sisense included).
9
+ * internally, "dimensions" are represented by attributes as the latter is closer to the data model.
10
+ */
11
+ export type QueryDescription = Partial<Omit<InternalQueryDescription, 'attributes'>> & {
12
+ dimensions?: Attribute[];
13
+ };
3
14
  /** @internal */
4
15
  export declare const QUERY_DEFAULT_LIMIT = 20000;
5
16
  /** @internal */
6
17
  export declare const QUERY_DEFAULT_OFFSET = 0;
7
18
  /** @internal */
8
- export declare const executeQuery: (dataSource: DataSource | undefined, dimensions: Attribute[] | undefined, measures: Measure[] | undefined, filters: Filter[] | undefined, highlights: Filter[] | undefined, app: ClientApplication, count?: number, offset?: number) => Promise<QueryResultData>;
19
+ export declare const executeQuery: (queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig) => Promise<QueryResultData>;
@@ -1,8 +1,8 @@
1
1
  import { type Filter } from '@sisense/sdk-data';
2
- import { ExecuteQueryParams } from './index.js';
3
- import { QueryState } from './query-state-reducer.js';
4
- import { FiltersMergeStrategy } from '../dashboard-widget/types.js';
5
- import { ClientApplication } from '../app/client-application.js';
2
+ import { ExecuteQueryParams } from './';
3
+ import { QueryState } from './query-state-reducer';
4
+ import { FiltersMergeStrategy } from '../dashboard-widget/types';
5
+ import { ClientApplication } from '../app/client-application';
6
6
  /**
7
7
  * Parameters for {@link useExecuteQueryByWidgetId} hook.
8
8
  */
@@ -21,6 +21,16 @@ export interface ExecuteQueryByWidgetIdParams {
21
21
  offset?: number;
22
22
  /** {@inheritDoc ExecuteQueryByWidgetIdProps.filtersMergeStrategy} */
23
23
  filtersMergeStrategy?: FiltersMergeStrategy;
24
+ /** {@inheritDoc ExecuteQueryByWidgetIdProps.includeDashboardFilters} */
25
+ includeDashboardFilters?: boolean;
26
+ /** {@inheritDoc ExecuteQueryByWidgetIdProps.onBeforeQuery} */
27
+ onBeforeQuery?: (jaql: any) => any | Promise<any>;
28
+ /**
29
+ * Boolean flag to control if query is executed
30
+ *
31
+ * If not specified, the default value is `true`
32
+ */
33
+ enabled?: boolean;
24
34
  }
25
35
  export type QueryByWidgetIdState = QueryState & {
26
36
  /** Query parameters constructed over the widget */
@@ -55,6 +65,11 @@ export type QueryByWidgetIdState = QueryState & {
55
65
  * @returns Query state that contains the status of the query execution, the result data, the constructed query parameters, or the error if any occurred
56
66
  */
57
67
  export declare const useExecuteQueryByWidgetId: (params: ExecuteQueryByWidgetIdParams) => QueryByWidgetIdState;
68
+ /**
69
+ * {@link useExecuteQueryByWidgetId} without tracking to be used inside other hooks or components in Compose SDK.
70
+ * @internal
71
+ */
72
+ export declare function useExecuteQueryByWidgetIdInternal(params: ExecuteQueryByWidgetIdParams): QueryByWidgetIdState;
58
73
  /**
59
74
  * Checks if the parameters have changed by deep comparison.
60
75
  *
@@ -63,7 +78,7 @@ export declare const useExecuteQueryByWidgetId: (params: ExecuteQueryByWidgetIdP
63
78
  */
64
79
  export declare function isParamsChanged(prevParams: ExecuteQueryByWidgetIdParams | undefined, newParams: ExecuteQueryByWidgetIdParams): boolean;
65
80
  /** @internal */
66
- export declare function executeQueryByWidgetId({ widgetOid, dashboardOid, filters, highlights, filtersMergeStrategy, count, offset, app, }: ExecuteQueryByWidgetIdParams & {
81
+ export declare function executeQueryByWidgetId({ widgetOid, dashboardOid, filters, highlights, filtersMergeStrategy, count, offset, includeDashboardFilters, app, onBeforeQuery, }: ExecuteQueryByWidgetIdParams & {
67
82
  app: ClientApplication;
68
83
  }): Promise<{
69
84
  data: import("@sisense/sdk-data").QueryResultData;
@@ -3,11 +3,11 @@ import { QueryState } from './query-state-reducer';
3
3
  /**
4
4
  * Parameters for {@link useExecuteQuery} hook.
5
5
  */
6
- export type ExecuteQueryParams = {
6
+ export interface ExecuteQueryParams {
7
7
  /**
8
8
  * Data source the query is run against - e.g. `Sample ECommerce`
9
9
  *
10
- * If not specified, the query will use the `defaultDataSource` specified in the parent {@link SisenseContextProvider} component.
10
+ * If not specified, the query will use the `defaultDataSource` specified in the parent Sisense Context.
11
11
  */
12
12
  dataSource?: DataSource;
13
13
  /** Dimensions of the query */
@@ -28,7 +28,9 @@ export type ExecuteQueryParams = {
28
28
  * If not specified, the default value is `true`
29
29
  */
30
30
  enabled?: boolean;
31
- };
31
+ /** {@inheritDoc ExecuteQueryProps.onBeforeQuery} */
32
+ onBeforeQuery?: (jaql: any) => any | Promise<any>;
33
+ }
32
34
  /**
33
35
  * React hook that executes a data query.
34
36
  * This approach, which offers an alternative to {@link ExecuteQuery} component, is similar to React Query's `useQuery` hook.
@@ -61,3 +63,9 @@ export type ExecuteQueryParams = {
61
63
  * @returns Query state that contains the status of the query execution, the result data, or the error if any occurred
62
64
  */
63
65
  export declare const useExecuteQuery: (params: ExecuteQueryParams) => QueryState;
66
+ /**
67
+ * {@link useExecuteQuery} without tracking to be used inside other hooks or components in Compose SDK.
68
+ *
69
+ * @internal
70
+ */
71
+ export declare function useExecuteQueryInternal(params: ExecuteQueryParams): QueryState;
@@ -7,7 +7,7 @@ import { ScatterChartProps } from './props';
7
7
  * **Point**: A field that for each of its members a scatter point is drawn. The maximum amount of data points is 500.
8
8
  *
9
9
  * **Size**: An optional field represented by the size of the circles.
10
- * If omitted, all scatter points are equal in size. If used, the circle size is relative to their value.
10
+ * If omitted, all scatter points are equal in size. If used, the circle sizes are relative to their values.
11
11
  *
12
12
  * See [Scatter Chart](https://docs.sisense.com/main/SisenseLinux/scatter-chart.htm) for more information.
13
13
  *
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import { SunburstChartProps } from './props';
3
+ /**
4
+ * A React component displaying hierarchical data in the form of nested circle slices.
5
+ * This type of chart can be used in different scenarios, for example, to compare both categories and sub-categories.
6
+ * See [Sunburst Chart](https://docs.sisense.com/main/SisenseLinux/sunburst-widget.htm) for more information.
7
+ *
8
+ * @example
9
+ * An example of using the component to visualize the `Sample ECommerce` data source:
10
+ * ```tsx
11
+ * <SunburstChart
12
+ * dataSet={DM.DataSource}
13
+ * dataOptions={{
14
+ * category: [
15
+ * DM.Commerce.Сondition,
16
+ * DM.Commerce.Date.Years
17
+ * ],
18
+ * value: [measures.sum(DM.Commerce.Quantity)],
19
+ * }}
20
+ * />
21
+ * ```
22
+ *
23
+ * <img src="media://sunburst-chart-example-1.png" width="600px" />
24
+ * @param props - Sunburst chart properties
25
+ * @returns Sunburst Chart component
26
+ */
27
+ export declare const SunburstChart: import("react").FunctionComponent<SunburstChartProps>;
@@ -38,7 +38,7 @@ export declare const useThemeContext: () => {
38
38
  * For comparison, indicator chart with default theme settings:
39
39
  *
40
40
  * <img src="media://indicator-chart-example-1.png" width="400px" />
41
- * @see {@link ThemeSettings}, {@link getDefaultThemeSettings}, {@link IndicatorChart}
41
+ * @see {@link ThemeSettings} and {@link IndicatorChart}
42
42
  * @param props - Theme provider props
43
43
  * @returns A Theme Provider component
44
44
  */
@@ -2,8 +2,7 @@
2
2
  import { TreemapChartProps } from './props';
3
3
  /**
4
4
  * A React component displaying hierarchical data in the form of nested rectangles.
5
- * This type of chart can be used in different scenarios, for example,
6
- * instead of a column chart if you have to compare too many categories and sub-categories.
5
+ * This type of chart can be used instead of a column chart for comparing a large number of categories and sub-categories.
7
6
  * See [Treemap Chart](https://docs.sisense.com/main/SisenseLinux/treemap.htm) for more information.
8
7
  *
9
8
  * @example
package/dist/types.d.ts CHANGED
@@ -356,12 +356,34 @@ export interface TreemapStyleOptions extends BaseStyleOptions {
356
356
  mode?: 'value' | 'contribution';
357
357
  };
358
358
  }
359
+ /** Configuration options that define functional style of the various elements of {@link SunburstChart} */
360
+ export interface SunburstStyleOptions extends BaseStyleOptions {
361
+ /** Labels options object */
362
+ labels?: {
363
+ /** Array with single label options objects (order of items relative to dataOptions.category) */
364
+ category?: {
365
+ /** Define visibility of label */
366
+ enabled?: boolean;
367
+ }[];
368
+ };
369
+ /** Tooltip options object */
370
+ tooltip?: {
371
+ /** Define mode of data showing */
372
+ mode?: 'value' | 'contribution';
373
+ };
374
+ }
359
375
  /**
360
376
  * Configuration options that define functional style of the various elements of chart.
361
377
  */
362
- export type StyleOptions = LineStyleOptions | AreaStyleOptions | StackableStyleOptions | PieStyleOptions | FunnelStyleOptions | PolarStyleOptions | IndicatorStyleOptions | ScatterStyleOptions | TreemapStyleOptions;
378
+ export type StyleOptions = LineStyleOptions | AreaStyleOptions | StackableStyleOptions | PieStyleOptions | FunnelStyleOptions | PolarStyleOptions | IndicatorStyleOptions | ScatterStyleOptions | TreemapStyleOptions | SunburstStyleOptions;
363
379
  /** Mapping of each of the chart value series to colors. */
364
- export type ValueToColorMap = Record<string, string>;
380
+ export type ValueToColorMap = {
381
+ [value: string]: string;
382
+ };
383
+ /** Mapping of each of the chart columns with mapping of each value series to colors. */
384
+ export type MultiColumnValueToColorMap = {
385
+ [columnName: string]: ValueToColorMap;
386
+ };
365
387
  /**
366
388
  * Chart type of one of the supported chart families
367
389
  */
@@ -0,0 +1,30 @@
1
+ import { type FunctionComponent } from 'react';
2
+ import { ChartWidgetProps } from '../props';
3
+ /**
4
+ * The Chart Widget component extending the {@link Chart} component to support advanced BI
5
+ * capabilities such as drilldown.
6
+ *
7
+ * @example
8
+ * Example of using the `ChartWidget` component to
9
+ * plot a bar chart of the `Sample ECommerce` data source hosted in a Sisense instance.
10
+ * Drill-down capability is enabled.
11
+ * ```tsx
12
+ * <ChartWidget
13
+ * dataSource={DM.DataSource}
14
+ * chartType="bar"
15
+ * dataOptions={{
16
+ * category: [DM.Category.Category],
17
+ * value: [measures.sum(DM.Commerce.Revenue)],
18
+ * breakBy: [],
19
+ * }}
20
+ * drilldownOptions={{
21
+ * drilldownDimensions: [DM.Commerce.AgeRange, DM.Commerce.Gender, DM.Commerce.Condition],
22
+ * }}
23
+ * />
24
+ * ```
25
+ *
26
+ * <img src="media://chart-widget-with-drilldown-example-1.png" width="800px" />
27
+ * @param props - ChartWidget properties
28
+ * @returns ChartWidget component representing a chart type as specified in `ChartWidgetProps.`{@link ChartWidgetProps.chartType}
29
+ */
30
+ export declare const ChartWidgetDeprecated: FunctionComponent<ChartWidgetProps>;