@sisense/sdk-ui 1.31.0 → 1.32.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 (129) hide show
  1. package/dist/ai.cjs +22 -423
  2. package/dist/ai.js +1825 -1771
  3. package/dist/analytics-composer.cjs +54 -54
  4. package/dist/analytics-composer.js +531 -510
  5. package/dist/derive-chart-family-7Fxxf6Sy.cjs +758 -0
  6. package/dist/derive-chart-family-CVwj-7u5.js +100883 -0
  7. package/dist/index.cjs +27 -858
  8. package/dist/index.js +11422 -10499
  9. package/dist/packages/sdk-ui/src/ai/api/chat-rest-api.d.ts +1 -3
  10. package/dist/packages/sdk-ui/src/ai/api/types.d.ts +1 -0
  11. package/dist/packages/sdk-ui/src/ai/chatbot.d.ts +2 -2
  12. package/dist/packages/sdk-ui/src/ai/custom-ai-context-provider.d.ts +13 -0
  13. package/dist/packages/sdk-ui/src/ai/index.d.ts +7 -4
  14. package/dist/packages/sdk-ui/src/ai/use-get-nlg-insights.d.ts +2 -0
  15. package/dist/packages/sdk-ui/src/ai/use-get-nlq-result.d.ts +12 -5
  16. package/dist/packages/sdk-ui/src/ai/use-get-query-recommendations.d.ts +8 -4
  17. package/dist/packages/sdk-ui/src/analytics-composer/common/constants.d.ts +1 -0
  18. package/dist/packages/sdk-ui/src/api/rest-api.d.ts +11 -1
  19. package/dist/packages/sdk-ui/src/app/client-application.d.ts +15 -0
  20. package/dist/packages/sdk-ui/src/chart/helpers/get-load-data-function.d.ts +16 -0
  21. package/dist/packages/sdk-ui/src/chart/helpers/use-chart-data-preparation.d.ts +17 -0
  22. package/dist/packages/sdk-ui/src/chart/helpers/use-synced-data.d.ts +3 -1
  23. package/dist/packages/sdk-ui/src/chart/index.d.ts +1 -0
  24. package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/areamap-chart-builder.d.ts +2 -0
  25. package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/data/areamap-data.d.ts +4 -0
  26. package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/data/geo-data-coloring-function.d.ts +2 -0
  27. package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/data/index.d.ts +2 -0
  28. package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/data-options/data-options.d.ts +2 -0
  29. package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/data-options/index.d.ts +1 -0
  30. package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/design-options/design-options.d.ts +2 -0
  31. package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/design-options/index.d.ts +1 -0
  32. package/dist/packages/sdk-ui/src/{charts/map-charts/areamap → chart/restructured-charts/areamap-chart/renderer}/areamap-map.d.ts +2 -2
  33. package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/renderer/areamap-utils.d.ts +12 -0
  34. package/dist/packages/sdk-ui/src/{charts/map-charts/areamap → chart/restructured-charts/areamap-chart/renderer}/areamap.d.ts +5 -5
  35. package/dist/packages/sdk-ui/src/{charts/map-charts/areamap → chart/restructured-charts/areamap-chart/renderer}/feature-styles-dictionary.d.ts +2 -2
  36. package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/renderer/index.d.ts +1 -0
  37. package/dist/packages/sdk-ui/src/{charts/map-charts/areamap → chart/restructured-charts/areamap-chart/renderer}/use-geo-json.d.ts +1 -1
  38. package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/types.d.ts +35 -0
  39. package/dist/packages/sdk-ui/src/chart/restructured-charts/bar-chart/bar-chart-builder.d.ts +2 -0
  40. package/dist/packages/sdk-ui/src/chart/restructured-charts/chart-builder-factory.d.ts +3 -0
  41. package/dist/packages/sdk-ui/src/chart/restructured-charts/column-chart/column-chart-builder.d.ts +2 -0
  42. package/dist/packages/sdk-ui/src/chart/restructured-charts/helpers/cartesians/data-options.d.ts +27 -0
  43. package/dist/packages/sdk-ui/src/chart/restructured-charts/helpers/cartesians/data.d.ts +4 -0
  44. package/dist/packages/sdk-ui/src/chart/restructured-charts/helpers/cartesians/stackable/design-options.d.ts +5 -0
  45. package/dist/packages/sdk-ui/src/chart/restructured-charts/helpers/data-loading.d.ts +12 -0
  46. package/dist/packages/sdk-ui/src/chart/restructured-charts/types.d.ts +100 -0
  47. package/dist/packages/sdk-ui/src/chart/restructured-charts/utils.d.ts +3 -0
  48. package/dist/packages/sdk-ui/src/chart-data/types.d.ts +3 -29
  49. package/dist/packages/sdk-ui/src/chart-options-processor/style-to-design-options-translator/prepare-design-options.d.ts +6 -3
  50. package/dist/packages/sdk-ui/src/chart-options-processor/style-to-design-options-translator/translate-to-highcharts-options.d.ts +9 -8
  51. package/dist/packages/sdk-ui/src/chart-options-processor/translations/design-options.d.ts +1 -7
  52. package/dist/packages/sdk-ui/src/chart-options-processor/translations/tooltip-utils.d.ts +2 -3
  53. package/dist/packages/sdk-ui/src/chart-options-processor/translations/types.d.ts +2 -1
  54. package/dist/packages/sdk-ui/src/common/hooks/fusion-endpoints/use-get-data-source-fields.d.ts +14 -0
  55. package/dist/packages/sdk-ui/src/dashboard/hooks/use-tabber.d.ts +18 -0
  56. package/dist/packages/sdk-ui/src/dashboard/hooks/use-widgets-layout.d.ts +14 -0
  57. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +7 -2
  58. package/dist/packages/sdk-ui/src/dashboard/use-composed-dashboard.d.ts +7 -2
  59. package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +1 -1
  60. package/dist/packages/sdk-ui/src/filters/components/date-filter/date-filter/calendar-date-selector.d.ts +8 -7
  61. package/dist/packages/sdk-ui/src/filters/components/date-filter/date-filter/date-range-calculator.d.ts +1 -1
  62. package/dist/packages/sdk-ui/src/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +3 -0
  63. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +1 -1
  64. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/input.d.ts +3 -1
  65. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/search-input.d.ts +4 -0
  66. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/base.d.ts +1 -1
  67. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/calendar-select/calendar-select.d.ts +27 -0
  68. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/calendar-select/index.d.ts +2 -0
  69. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/calendar-select/types.d.ts +14 -0
  70. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/calendar-select/utils.d.ts +5 -0
  71. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/members-list-select.d.ts +11 -0
  72. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/searchable-multi-select.d.ts +2 -0
  73. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/searchable-single-select.d.ts +18 -1
  74. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/single-select.d.ts +3 -2
  75. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-datetime.d.ts +8 -0
  76. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/hooks/use-datetime-formatter.d.ts +2 -0
  77. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/hooks/use-get-attribute-stats.d.ts +1 -1
  78. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/common/granularities.d.ts +8 -0
  79. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-condition-section/condition-forms/datetime-exclude-condition-form.d.ts +11 -0
  80. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-condition-section/condition-forms/datetime-is-within-condition-form.d.ts +10 -0
  81. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-condition-section/datetime-condition-section.d.ts +12 -0
  82. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-condition-section/index.d.ts +1 -0
  83. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-members-section.d.ts +12 -0
  84. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-range-section.d.ts +11 -0
  85. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-relative-section.d.ts +9 -0
  86. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/members-section.d.ts +0 -5
  87. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/numeric-condition-section/numeric-condition-section.d.ts +1 -6
  88. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/text-condition-section.d.ts +1 -3
  89. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/types.d.ts +4 -0
  90. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/utils.d.ts +12 -1
  91. package/dist/packages/sdk-ui/src/filters/components/icons/date-icon.d.ts +1 -1
  92. package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.d.ts +1 -1
  93. package/dist/packages/sdk-ui/src/filters/hooks/use-get-filter-members.d.ts +3 -2
  94. package/dist/packages/sdk-ui/src/index.d.ts +1 -0
  95. package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model.d.ts +7 -1
  96. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +2 -1
  97. package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +9 -1
  98. package/dist/packages/sdk-ui/src/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +1 -1
  99. package/dist/packages/sdk-ui/src/plugins-provider/custom-plugins-provider.d.ts +8 -8
  100. package/dist/packages/sdk-ui/src/plugins-provider/plugins-context.d.ts +6 -6
  101. package/dist/packages/sdk-ui/src/plugins-provider/plugins-provider.d.ts +3 -3
  102. package/dist/packages/sdk-ui/src/plugins-provider/types.d.ts +2 -1
  103. package/dist/packages/sdk-ui/src/props.d.ts +35 -15
  104. package/dist/packages/sdk-ui/src/sisense-chart/sisense-chart.d.ts +1 -16
  105. package/dist/packages/sdk-ui/src/sisense-chart/types.d.ts +16 -1
  106. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +40 -0
  107. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +80 -0
  108. package/dist/packages/sdk-ui/src/types.d.ts +52 -1
  109. package/dist/packages/sdk-ui/src/utils/generate-attribute-name.d.ts +2 -0
  110. package/dist/packages/sdk-ui/src/utils/utility-types.d.ts +34 -0
  111. package/dist/packages/sdk-ui/src/widget-by-id/translate-dashboard-filters.d.ts +1 -0
  112. package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-style-options.d.ts +16 -5
  113. package/dist/packages/sdk-ui/src/widgets/tabber-widget.d.ts +35 -0
  114. package/dist/use-common-filters-BanIIIUW.js +28409 -0
  115. package/dist/use-common-filters-BeKQ1bKU.cjs +271 -0
  116. package/dist/{widget-composer-BrQ6SrZ6.js → widget-composer-4bEKHitq.js} +240 -234
  117. package/dist/widget-composer-NDI4zssI.cjs +316 -0
  118. package/package.json +10 -9
  119. package/dist/derive-chart-family-D3iN--j2.js +0 -44430
  120. package/dist/derive-chart-family-Tt7cIUck.cjs +0 -271
  121. package/dist/packages/sdk-ui/src/ai/use-get-data-source-fields.d.ts +0 -12
  122. package/dist/packages/sdk-ui/src/chart-data/areamap-data.d.ts +0 -4
  123. package/dist/packages/sdk-ui/src/chart-data/data-coloring/geo-data-coloring-function.d.ts +0 -2
  124. package/dist/packages/sdk-ui/src/chart-options-processor/style-to-design-options-translator/translate-to-areamap-options.d.ts +0 -3
  125. package/dist/packages/sdk-ui/src/charts/map-charts/areamap/areamap-utils.d.ts +0 -11
  126. package/dist/use-common-filters-CHBXz5rL.js +0 -83439
  127. package/dist/use-common-filters-Dd-gOMfB.cjs +0 -916
  128. package/dist/widget-composer-BHf4pbvI.cjs +0 -311
  129. /package/dist/packages/sdk-ui/src/{charts/map-charts/areamap → chart/restructured-charts/areamap-chart/renderer}/alternative-country-names-dictionary.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
2
  import type { Chat, ChatRequest, ChatResponse, ChatWithoutHistory, ChatContext, GetNlgInsightsRequest, GetNlgInsightsResponse, LlmConfig, QueryRecommendationConfig, QueryRecommendationResponse, SendFeedbackRequest, GetNlqResultRequest, NlqResult } from './types';
3
- import { DataSourceField } from '@sisense/sdk-data';
4
3
  import { ChatContextDetails } from '../../ai/api/types';
4
+ /** @internal */
5
5
  export declare class ChatRestApi {
6
6
  private readonly volatile;
7
7
  private httpClient;
@@ -17,14 +17,12 @@ export declare class ChatRestApi {
17
17
  private postChat;
18
18
  private deleteChatHistory;
19
19
  private sendFeedback;
20
- private getDataSourceFields;
21
20
  ai: {
22
21
  getNlgInsights: (request: GetNlgInsightsRequest) => Promise<GetNlgInsightsResponse | undefined>;
23
22
  getNlqResult: (contextTitle: string, request: GetNlqResultRequest) => Promise<NlqResult | undefined>;
24
23
  getQueryRecommendations: (contextTitle: string, config: QueryRecommendationConfig) => Promise<QueryRecommendationResponse | undefined>;
25
24
  setLlmConfig: (config: LlmConfig) => Promise<unknown>;
26
25
  sendFeedback: (request: SendFeedbackRequest) => Promise<unknown>;
27
- getDataSourceFields: (dataSource: string) => Promise<DataSourceField[] | undefined>;
28
26
  chat: {
29
27
  getAll: () => Promise<never[] | ChatWithoutHistory[] | undefined>;
30
28
  getById: (chatId: string) => Promise<Chat | undefined>;
@@ -89,6 +89,7 @@ export interface GetNlgInsightsRequest {
89
89
  jaql: Pick<JaqlQueryPayload, 'datasource' | 'metadata' | 'filterRelations'>;
90
90
  verbosity?: 'Low' | 'High';
91
91
  }
92
+ /** @internal */
92
93
  export interface GetNlgInsightsResponse {
93
94
  data?: {
94
95
  answer: string;
@@ -3,7 +3,7 @@ import { ChatConfig } from './chat-config';
3
3
  /**
4
4
  * Props for {@link Chatbot} component.
5
5
  */
6
- export type ChatbotProps = {
6
+ export interface ChatbotProps {
7
7
  /**
8
8
  * Total width of the chatbot
9
9
  *
@@ -20,7 +20,7 @@ export type ChatbotProps = {
20
20
  * Various configuration options for the chatbot
21
21
  */
22
22
  config?: Partial<ChatConfig>;
23
- };
23
+ }
24
24
  /**
25
25
  * React component that renders a chatbot with data topic selection. You can optionally provide `width` and/or `height`.
26
26
  *
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { type ChatRestApi } from './api/chat-rest-api';
3
+ /** @internal */
4
+ export type CustomAiContext = {
5
+ api: ChatRestApi;
6
+ };
7
+ /** @internal */
8
+ export type CustomAiContextProviderProps = {
9
+ context?: CustomAiContext;
10
+ children: ReactNode;
11
+ };
12
+ /** @internal */
13
+ export declare function CustomAiContextProvider({ children, context }: CustomAiContextProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,15 @@
1
1
  export { default as AiContextProvider, type AiContextProviderProps } from './ai-context-provider';
2
2
  export { type ChatConfig } from './chat-config';
3
3
  export { useGetNlgInsights, type UseGetNlgInsightsParams, type UseGetNlgInsightsState, useGetNlgQueryResult, } from './use-get-nlg-insights';
4
- export { useGetNlqResult, type UseGetNlqResultParams, type UseGetNlqResultState, } from './use-get-nlq-result';
5
- export { useGetQueryRecommendations, type UseGetQueryRecommendationsParams, type UseGetQueryRecommendationsState, } from './use-get-query-recommendations';
4
+ export { useGetNlqResult, prepareGetNlqResultPayload, type UseGetNlqResultParams, type UseGetNlqResultState, type GetNlqResultParams, } from './use-get-nlq-result';
5
+ export { useGetQueryRecommendations, type UseGetQueryRecommendationsParams, type GetQueryRecommendationsParams, type UseGetQueryRecommendationsState, DEFAULT_RECOMMENDATIONS_COUNT, } from './use-get-query-recommendations';
6
6
  export { useChatSession, type UseChatSessionResult } from './use-chat-session';
7
7
  export { useLastNlqResponse } from './use-last-nlq-response';
8
- export { useGetDataSourceFields } from './use-get-data-source-fields';
9
- export type { GetNlgInsightsRequest, QueryRecommendationResponse, QueryRecommendation, NlqResponseData, NlqResult, NLQ_RESULT_CHART_TYPES, NlqResultChartType, } from './api/types';
8
+ export type { GetNlgInsightsRequest, GetNlgInsightsResponse, QueryRecommendationResponse, QueryRecommendation, NlqResponseData, NlqResult, NLQ_RESULT_CHART_TYPES, NlqResultChartType, } from './api/types';
10
9
  export { Chatbot, type ChatbotProps } from './chatbot';
11
10
  export { default as GetNlgInsights, type GetNlgInsightsProps, GetNlgQueryResult, type GetNlgQueryResultProps, } from './get-nlg-insights';
12
11
  export { NlqChartWidget, type NlqChartWidgetProps } from './chart/nlq-chart-widget';
12
+ export { ChatRestApi } from './api/chat-rest-api';
13
+ export { CustomAiContextProvider, type CustomAiContext } from './custom-ai-context-provider';
14
+ export { prepareGetNlgInsightsPayload } from './use-get-nlg-insights';
15
+ export { widgetComposer } from '../analytics-composer';
@@ -39,6 +39,8 @@ export interface UseGetNlgInsightsState {
39
39
  /** Callback to trigger a refetch of the data */
40
40
  refetch: () => void;
41
41
  }
42
+ /** @internal */
43
+ export declare function prepareGetNlgInsightsPayload(params: UseGetNlgInsightsParams | GetNlgInsightsRequest): GetNlgInsightsRequest;
42
44
  /**
43
45
  *
44
46
  * @param params - {@link UseGetNlgInsightsParams}
@@ -1,11 +1,8 @@
1
1
  import { WidgetProps } from '../props';
2
2
  import { DataSource } from '@sisense/sdk-data';
3
3
  import { HookEnableParam } from '../common/hooks/types';
4
- import { NlqResultChartType } from './api/types';
5
- /**
6
- * Parameters for {@link useGetNlqResult} hook.
7
- */
8
- export interface UseGetNlqResultParams extends HookEnableParam {
4
+ import { GetNlqResultRequest, NlqResultChartType } from './api/types';
5
+ export interface GetNlqResultParams {
9
6
  /** Data source for queries to run against */
10
7
  dataSource: DataSource;
11
8
  /** Text containing the natural language query */
@@ -20,6 +17,16 @@ export interface UseGetNlqResultParams extends HookEnableParam {
20
17
  */
21
18
  enableAxisTitlesInWidgetProps?: boolean;
22
19
  }
20
+ /** @internal */
21
+ export declare function prepareGetNlqResultPayload(params: GetNlqResultParams): {
22
+ contextTitle: string;
23
+ request: GetNlqResultRequest;
24
+ };
25
+ /**
26
+ * Parameters for {@link useGetNlqResult} hook.
27
+ */
28
+ export interface UseGetNlqResultParams extends GetNlqResultParams, HookEnableParam {
29
+ }
23
30
  /**
24
31
  * State for {@link useGetNlqResult} hook.
25
32
  */
@@ -1,9 +1,8 @@
1
1
  import { QueryRecommendation } from './api/types';
2
2
  import { HookEnableParam } from '../common/hooks/types';
3
- /**
4
- * Parameters for {@link useGetQueryRecommendations} hook.
5
- */
6
- export interface UseGetQueryRecommendationsParams extends HookEnableParam {
3
+ /** @internal */
4
+ export declare const DEFAULT_RECOMMENDATIONS_COUNT = 4;
5
+ export interface GetQueryRecommendationsParams {
7
6
  /** Data model title or perspective title */
8
7
  contextTitle: string;
9
8
  /**
@@ -20,6 +19,11 @@ export interface UseGetQueryRecommendationsParams extends HookEnableParam {
20
19
  */
21
20
  enableAxisTitlesInWidgetProps?: boolean;
22
21
  }
22
+ /**
23
+ * Parameters for {@link useGetQueryRecommendations} hook.
24
+ */
25
+ export interface UseGetQueryRecommendationsParams extends GetQueryRecommendationsParams, HookEnableParam {
26
+ }
23
27
  /**
24
28
  * State for {@link useGetQueryRecommendations} hook.
25
29
  */
@@ -0,0 +1 @@
1
+ export declare const CODE_TEMPLATES_INDENT = 6;
@@ -1,6 +1,6 @@
1
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
2
  import { FeatureCollection as GeoJsonFeatureCollection } from 'geojson';
3
- import { type DataSource } from '@sisense/sdk-data';
3
+ import { DataSourceField, type DataSource } from '@sisense/sdk-data';
4
4
  import { HierarchyDto, SharedFormulaDto, WidgetDto } from '../widget-by-id/types';
5
5
  import type { DashboardDto } from './types/dashboard-dto';
6
6
  import { TranslatableError } from '../translation/translatable-error';
@@ -82,6 +82,16 @@ export declare class RestApi {
82
82
  * @returns A shared formula
83
83
  */
84
84
  getSharedFormula: (sharedFormulaId: string) => Promise<SharedFormulaDto | undefined>;
85
+ /**
86
+ * Get datasource fields
87
+ * @param dataSource - A datasource name
88
+ * @param options - An object with offset and count
89
+ * @returns A list of datasource fields
90
+ */
91
+ getDataSourceFields: (dataSource: string, options?: {
92
+ offset: number;
93
+ count: number;
94
+ }) => Promise<DataSourceField[] | undefined>;
85
95
  }
86
96
  export declare const useRestApi: () => {
87
97
  restApi: RestApi | undefined;
@@ -115,6 +115,21 @@ export type AppConfig = {
115
115
  */
116
116
  enabled?: boolean;
117
117
  };
118
+ /**
119
+ * Configuration of the tabber widget
120
+ *
121
+ * Set the `tabberConfig.enabled` property to `true` to enable the tabber widget support. Otherwise, the tabber widget will be treated as 'unkwon plugin type'.
122
+ *
123
+ * @internal
124
+ */
125
+ tabberConfig?: {
126
+ /**
127
+ * Whether to enable tabber widget support
128
+ *
129
+ * If not specified, the default value is `false`
130
+ */
131
+ enabled?: boolean;
132
+ };
118
133
  /**
119
134
  * Configuration of the component that is rendered in case of an error
120
135
  */
@@ -0,0 +1,16 @@
1
+ import { ClientApplication } from '../../app/client-application';
2
+ import { QueryDescription } from '../../query/execute-query';
3
+ import { ChartType } from '../../types';
4
+ import { QueryResultData } from '@sisense/sdk-data';
5
+ import { QueryExecutionConfig } from '@sisense/sdk-query-client';
6
+ import { ChartDataOptionsInternal } from '../../chart-data-options/types';
7
+ export type LoadDataFunction = (options: {
8
+ app: ClientApplication;
9
+ chartDataOptionsInternal?: ChartDataOptionsInternal;
10
+ queryDescription: QueryDescription;
11
+ executionConfig?: QueryExecutionConfig;
12
+ }) => Promise<QueryResultData>;
13
+ /**
14
+ * Get the load data function based on the chart type
15
+ */
16
+ export declare function getLoadDataFunction(chartType: ChartType): LoadDataFunction;
@@ -0,0 +1,17 @@
1
+ import { Attribute, Data, DataSource, Measure } from '@sisense/sdk-data';
2
+ import { ChartDataOptionsInternal } from '../../chart-data-options/types';
3
+ import { DataColumnNamesMapping } from '../../chart-data-options/validate-data-options';
4
+ import { ChartData } from '../../chart-data/types';
5
+ import { ChartType } from '../../types';
6
+ type UseChartDataPreparationProps = {
7
+ dataSet: DataSource | Data | undefined;
8
+ data: Data;
9
+ chartDataOptions: ChartDataOptionsInternal;
10
+ chartType: ChartType;
11
+ attributes: Attribute[];
12
+ measures: Measure[];
13
+ dataColumnNamesMapping: DataColumnNamesMapping;
14
+ onDataReady?: (data: Data) => Data;
15
+ };
16
+ export declare function useChartDataPreparation({ dataSet, data, chartDataOptions, chartType, attributes, measures, dataColumnNamesMapping, onDataReady, }: UseChartDataPreparationProps): ChartData | null;
17
+ export {};
@@ -3,6 +3,7 @@ import { Dispatch, SetStateAction } from 'react';
3
3
  import { ChartDataOptionsInternal } from '../../chart-data-options/types';
4
4
  import { ChartType } from '../../types';
5
5
  import { DataColumnNamesMapping } from '../../chart-data-options/validate-data-options';
6
+ import { LoadDataFunction } from './get-load-data-function';
6
7
  type DataSet = DataSource | Data | undefined;
7
8
  type UseSyncedDataProps = {
8
9
  dataSet: DataSet;
@@ -16,6 +17,7 @@ type UseSyncedDataProps = {
16
17
  refreshCounter?: number;
17
18
  setIsLoading?: Dispatch<SetStateAction<boolean>>;
18
19
  enabled?: boolean;
20
+ loadData: LoadDataFunction;
19
21
  };
20
- export declare const useSyncedData: ({ dataSet, chartDataOptions, chartType, attributes, measures, dataColumnNamesMapping, filters, highlights, refreshCounter, setIsLoading, enabled, }: UseSyncedDataProps) => [Data, ChartDataOptionsInternal];
22
+ export declare const useSyncedData: ({ dataSet, chartDataOptions, chartType, attributes, measures, dataColumnNamesMapping, filters, highlights, refreshCounter, setIsLoading, enabled, loadData, }: UseSyncedDataProps) => [Data, ChartDataOptionsInternal];
21
23
  export {};
@@ -1 +1,2 @@
1
1
  export * from './chart';
2
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ import { ChartBuilder } from '../types.js';
2
+ export declare const areamapChartBuilder: ChartBuilder<'areamap'>;
@@ -0,0 +1,4 @@
1
+ import { AreamapChartDataOptionsInternal } from '../../../../chart-data-options/types.js';
2
+ import { DataTable } from '../../../../chart-data-processor/table-processor';
3
+ import { AreamapData } from '../types';
4
+ export declare const getAreamapData: (dataOptions: AreamapChartDataOptionsInternal, dataTable: DataTable) => AreamapData;
@@ -0,0 +1,2 @@
1
+ import { GeoDataElement, RawGeoDataElement } from '../types';
2
+ export declare const geoDataColoringFunction: import('../../../../chart-data/data-coloring/create-data-coloring-function').ColoringFunction<RawGeoDataElement, GeoDataElement>;
@@ -0,0 +1,2 @@
1
+ import { ChartBuilder } from '../../types.js';
2
+ export declare const areamapDataTranslators: ChartBuilder<'areamap'>['data'];
@@ -0,0 +1,2 @@
1
+ import { ChartBuilder } from '../../types.js';
2
+ export declare const dataOptionsTranslators: ChartBuilder<'areamap'>['dataOptions'];
@@ -0,0 +1,2 @@
1
+ import { ChartBuilder } from '../../types';
2
+ export declare const areamapDesignOptionsTranslators: ChartBuilder<'areamap'>['designOptions'];
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { FeatureCollection as GeoJsonFeatureCollection } from 'geojson';
3
- import { GeoDataElement } from '../../../chart-data/types.js';
4
- import { AreamapType } from '../../../types.js';
3
+ import { AreamapType } from '../../../../types.js';
4
+ import { GeoDataElement } from '../types.js';
5
5
  export type AreamapProps = {
6
6
  geoJson: GeoJsonFeatureCollection;
7
7
  geoData: GeoDataElement[];
@@ -0,0 +1,12 @@
1
+ import { AreamapChartDataOptionsInternal } from '../../../../chart-data-options/types';
2
+ import { GeoDataElement } from '../types';
3
+ export declare function getAreamapDataPoint(geoDataElement: GeoDataElement, dataOptions: AreamapChartDataOptionsInternal): {
4
+ entries: {
5
+ geo: import('../../../../types').DataPointEntry[];
6
+ color: import('../../../../types').DataPointEntry[];
7
+ };
8
+ geoName: string;
9
+ originalValue: number;
10
+ formattedOriginalValue: string;
11
+ color?: import('../../../../types').Color | undefined;
12
+ };
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { AreamapChartDataOptionsInternal } from '../../../chart-data-options/types.js';
3
- import { AreamapData, ChartData } from '../../../chart-data/types.js';
4
- import { AreamapChartDesignOptions } from '../../../chart-options-processor/translations/design-options.js';
5
- import { AreamapDataPointEventHandler } from '../../../props';
6
- import { ChartRendererProps } from '../../../chart/types.js';
2
+ import { AreamapChartDataOptionsInternal } from '../../../../chart-data-options/types.js';
3
+ import { ChartData } from '../../../../chart-data/types.js';
4
+ import { AreamapDataPointEventHandler } from '../../../../props.js';
5
+ import { ChartRendererProps } from '../../../../chart/types.js';
6
+ import { AreamapChartDesignOptions, AreamapData } from '../types.js';
7
7
  export type AreamapProps = {
8
8
  chartData: AreamapData;
9
9
  dataOptions: AreamapChartDataOptionsInternal;
@@ -1,7 +1,7 @@
1
1
  import { Feature as GeoJsonFeature } from 'geojson';
2
2
  import { PathOptions } from 'leaflet';
3
- import { GeoDataElement } from '../../../chart-data/types.js';
4
- import { AreamapType } from '../../../types.js';
3
+ import { AreamapType } from '../../../../types.js';
4
+ import { GeoDataElement } from '../types.js';
5
5
  export type FeatureId = GeoJsonFeature['id'] & string;
6
6
  export type FeatureInfo = {
7
7
  /** Corresponding GeoDataElement from GeoData */
@@ -1,5 +1,5 @@
1
1
  import { FeatureCollection as GeoJsonFeatureCollection } from 'geojson';
2
- import { AreamapType } from '../../../types';
2
+ import { AreamapType } from '../../../../types.js';
3
3
  /**
4
4
  * Hook to get geoJson from API or cache (LocalStorage)
5
5
  */
@@ -0,0 +1,35 @@
1
+ import { BaseDesignOptionsType } from '../../../chart-options-processor/translations/design-options';
2
+ import { AreamapChartType, AreamapType, Color } from '../../../types';
3
+ /**
4
+ * Fact final data that will be passed to Areamap-component to render
5
+ *
6
+ * @internal
7
+ */
8
+ export type AreamapData = {
9
+ type: AreamapChartType;
10
+ geoData: GeoDataElement[];
11
+ };
12
+ /**
13
+ * Raw GeoDataElement from data
14
+ */
15
+ export type RawGeoDataElement = {
16
+ /** Name of geo-element (country or state) */
17
+ geoName: string;
18
+ /** Original numeric measure value for this geo-element */
19
+ originalValue: number;
20
+ /** Formatted measure value for this geo-element to display*/
21
+ formattedOriginalValue: string;
22
+ };
23
+ /**
24
+ * GeoDataElement with color property, calculated from `originalValue`
25
+ */
26
+ export type GeoDataElement = RawGeoDataElement & {
27
+ /** Calculated color for this geo-element */
28
+ color?: Color;
29
+ };
30
+ /**
31
+ * Configuration for Areamap design options
32
+ */
33
+ export type AreamapChartDesignOptions = BaseDesignOptionsType & {
34
+ mapType: AreamapType;
35
+ };
@@ -0,0 +1,2 @@
1
+ import { ChartBuilder } from '../types.js';
2
+ export declare const barChartBuilder: ChartBuilder<'bar'>;
@@ -0,0 +1,3 @@
1
+ import type { ChartBuilder, SupportedChartType } from './types.js';
2
+ export declare const chartBuildersMap: Record<SupportedChartType, ChartBuilder<SupportedChartType>>;
3
+ export declare function getChartBuilder<CT extends SupportedChartType>(chartType: CT): ChartBuilder<CT>;
@@ -0,0 +1,2 @@
1
+ import { ChartBuilder } from '../types.js';
2
+ export declare const columnChartBuilder: ChartBuilder<'column'>;
@@ -0,0 +1,27 @@
1
+ import { CartesianChartDataOptionsInternal, ChartDataOptions, ChartDataOptionsInternal } from '../../../../chart-data-options/types';
2
+ import { CartesianChartDataOptions } from '../../../../types';
3
+ import { Attribute, Measure } from '@sisense/sdk-data';
4
+ /**
5
+ * Translates the data options for cartesian charts to internal format.
6
+ */
7
+ export declare const translateCartesianChartDataOptions: (dataOptions: CartesianChartDataOptions) => CartesianChartDataOptionsInternal;
8
+ /**
9
+ * Returns the attributes from the internal data options for cartesian charts.
10
+ */
11
+ export declare function getCartesianAttributes(internalDataOptions: CartesianChartDataOptionsInternal): Attribute[];
12
+ /**
13
+ * Returns the measures from the internal data options for cartesian charts.
14
+ */
15
+ export declare function getCartesianMeasures(internalDataOptions: CartesianChartDataOptionsInternal): Measure[];
16
+ /**
17
+ * Checks if the data options are correct for cartesian charts.
18
+ */
19
+ export declare function isCartesianChartDataOptions(dataOptions: ChartDataOptions): dataOptions is CartesianChartDataOptions;
20
+ /**
21
+ * Checks if the internal data options are correct for cartesian charts.
22
+ */
23
+ export declare function isCartesianChartDataOptionsInternal(dataOptions: ChartDataOptionsInternal): dataOptions is CartesianChartDataOptionsInternal;
24
+ /**
25
+ * Checks if the chart should have Y2 axis.
26
+ */
27
+ export declare function shouldHaveY2Axis(dataOptions: CartesianChartDataOptionsInternal): boolean;
@@ -0,0 +1,4 @@
1
+ import { CartesianChartDataOptionsInternal } from '../../../../chart-data-options/types';
2
+ import { DataTable } from '../../../../chart-data-processor/table-processor';
3
+ import { CartesianChartData } from '../../../../chart-data/types';
4
+ export declare function getCartesianChartData(chartDataOptions: CartesianChartDataOptionsInternal, dataTable: DataTable): CartesianChartData;
@@ -0,0 +1,5 @@
1
+ import { CartesianChartDataOptionsInternal } from '../../../../../chart-data-options/types';
2
+ import { StackableChartDesignOptions } from '../../../../../chart-options-processor/translations/design-options';
3
+ import { ChartStyleOptions, StackableStyleOptions } from '../../../../../types';
4
+ export declare function translateStackableStyleOptionsToDesignOptions(chartType: 'bar' | 'column', styleOptions: StackableStyleOptions, dataOptionsInternal: CartesianChartDataOptionsInternal): StackableChartDesignOptions;
5
+ export declare function isStackableStyleOptions(styleOptions: ChartStyleOptions): styleOptions is StackableStyleOptions;
@@ -0,0 +1,12 @@
1
+ import { ClientApplication } from '../../../app/client-application';
2
+ import { QueryDescription } from '../../../query/execute-query';
3
+ import { QueryResultData } from '@sisense/sdk-data';
4
+ import { QueryExecutionConfig } from '@sisense/sdk-query-client';
5
+ /**
6
+ * Load data by a regular single query execution.
7
+ */
8
+ export declare function loadDataBySingleQuery(options: {
9
+ app: ClientApplication;
10
+ queryDescription: QueryDescription;
11
+ executionConfig?: QueryExecutionConfig | undefined;
12
+ }): Promise<QueryResultData>;
@@ -0,0 +1,100 @@
1
+ /// <reference types="react" />
2
+ import { Attribute, Measure, QueryResultData } from '@sisense/sdk-data';
3
+ import { QueryDescription, QueryExecutionConfig } from '@sisense/sdk-query-client';
4
+ import type { AreamapStyleOptions, ChartDataOptions, ChartStyleOptions, ScattermapStyleOptions, StackableStyleOptions } from '../../types';
5
+ import type { SisenseChartProps } from '../../sisense-chart';
6
+ import type { ChartRendererProps } from '../../chart';
7
+ import type { CartesianChartData, ScattermapChartData } from '../../chart-data/types';
8
+ import { AreamapChartDataOptions, AreamapChartDataOptionsInternal, CartesianChartDataOptions, CartesianChartDataOptionsInternal, ChartDataOptionsInternal, ScattermapChartDataOptions, ScattermapChartDataOptionsInternal } from '../../chart-data-options/types';
9
+ import { DesignOptions } from '../../chart-options-processor/translations/types';
10
+ import { DataTable } from '../../chart-data-processor/table-processor';
11
+ import { ClientApplication } from '../../app/client-application';
12
+ import { AreamapProps } from '../../chart/restructured-charts/areamap-chart/renderer';
13
+ import { ScattermapProps } from '../../charts/map-charts/scattermap/scattermap';
14
+ import { AreamapData } from './areamap-chart/types';
15
+ export type SupportedChartType = 'areamap' | 'column' | 'bar';
16
+ export type TypedChartDataOptions<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapChartDataOptions : CT extends 'scattermap' ? ScattermapChartDataOptions : CT extends 'column' | 'bar' ? CartesianChartDataOptions : never;
17
+ export type TypedDataOptionsInternal<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapChartDataOptionsInternal : CT extends 'scattermap' ? ScattermapChartDataOptionsInternal : CT extends 'column' | 'bar' ? CartesianChartDataOptionsInternal : never;
18
+ export type TypedChartStyleOptions<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapStyleOptions : CT extends 'scattermap' ? ScattermapStyleOptions : CT extends 'column' | 'bar' ? StackableStyleOptions : never;
19
+ export type TypedDesignOptions<CT extends SupportedChartType> = DesignOptions<CT>;
20
+ export type TypedChartData<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapData : CT extends 'scattermap' ? ScattermapChartData : CT extends 'column' | 'bar' ? CartesianChartData : never;
21
+ export type TypedLoadDataFunction<CT extends SupportedChartType> = (options: {
22
+ app: ClientApplication;
23
+ chartDataOptionsInternal: TypedDataOptionsInternal<CT>;
24
+ queryDescription: QueryDescription;
25
+ executionConfig?: QueryExecutionConfig;
26
+ }) => Promise<QueryResultData>;
27
+ export type TypedChartRendererProps<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapProps : CT extends 'scattermap' ? ScattermapProps : CT extends 'column' | 'bar' ? SisenseChartProps : never;
28
+ /**
29
+ * Chart builder interface.
30
+ */
31
+ export interface ChartBuilder<CT extends SupportedChartType = SupportedChartType> {
32
+ /**
33
+ * Data options translation utils.
34
+ */
35
+ dataOptions: {
36
+ /**
37
+ * Translates the data options to the internal format.
38
+ */
39
+ translateDataOptionsToInternal: (dataOptions: TypedChartDataOptions<CT>) => TypedDataOptionsInternal<CT>;
40
+ /**
41
+ * Returns the attributes from the internal data options.
42
+ */
43
+ getAttributes: (internalDataOptions: TypedDataOptionsInternal<CT>) => Attribute[];
44
+ /**
45
+ * Returns the measures from the internal data options.
46
+ */
47
+ getMeasures: (internalDataOptions: TypedDataOptionsInternal<CT>) => Measure[];
48
+ /**
49
+ * Validates and cleans the data options if needed.
50
+ */
51
+ validateAndCleanDataOptions?: (dataOptions: TypedChartDataOptions<CT>) => TypedChartDataOptions<CT>;
52
+ /**
53
+ * Checks if the data options are correct for the current chart type.
54
+ */
55
+ isCorrectDataOptions: (dataOptions: ChartDataOptions) => dataOptions is TypedChartDataOptions<CT>;
56
+ /**
57
+ * Checks if the data options are correct for the internal format.
58
+ */
59
+ isCorrectDataOptionsInternal: (dataOptions: ChartDataOptionsInternal) => dataOptions is TypedDataOptionsInternal<CT>;
60
+ };
61
+ /**
62
+ * Data retrieving and translation utils.
63
+ */
64
+ data: {
65
+ /**
66
+ * Loads the data from backend.
67
+ */
68
+ loadData: TypedLoadDataFunction<CT>;
69
+ /**
70
+ * Translates the data table to the chart data.
71
+ */
72
+ getChartData: (chartDataOptions: TypedDataOptionsInternal<CT>, dataTable: DataTable) => TypedChartData<CT>;
73
+ };
74
+ /**
75
+ * Design options translation utils.
76
+ */
77
+ designOptions: {
78
+ /**
79
+ * Translates the style options to the design options.
80
+ */
81
+ translateStyleOptionsToDesignOptions: (styleOptions: TypedChartStyleOptions<CT>, dataOptionsInternal: TypedDataOptionsInternal<CT>) => TypedDesignOptions<CT>;
82
+ /**
83
+ * Checks if the style options are correct for the current chart type.
84
+ */
85
+ isCorrectStyleOptions: (styleOptions: ChartStyleOptions) => styleOptions is TypedChartStyleOptions<CT>;
86
+ };
87
+ /**
88
+ * Chart renderer component and related utils
89
+ */
90
+ renderer: {
91
+ /**
92
+ * Chart renderer component.
93
+ */
94
+ ChartRendererComponent: React.ComponentType<TypedChartRendererProps<CT>>;
95
+ /**
96
+ * Type guard for the chart renderer props.
97
+ */
98
+ isCorrectRendererProps: (props: ChartRendererProps) => props is TypedChartRendererProps<CT>;
99
+ };
100
+ }
@@ -0,0 +1,3 @@
1
+ import { ChartType } from '../../index';
2
+ import { SupportedChartType } from './types.js';
3
+ export declare function isRestructuredChartType(chartType: ChartType): chartType is SupportedChartType;
@@ -1,7 +1,8 @@
1
- import { Color, NumberFormatConfig } from '../types';
2
- import { AreamapChartType, IndicatorChartType } from '../chart-options-processor/translations/types';
1
+ import { NumberFormatConfig } from '../types';
2
+ import { IndicatorChartType } from '../chart-options-processor/translations/types';
3
3
  import { ComparableData, Value } from '../chart-data-processor/table-processor';
4
4
  import { Coordinates } from '../charts/map-charts/scattermap/types';
5
+ import { AreamapData } from '../chart/restructured-charts/areamap-chart/types';
5
6
  export type CategoricalXValues = {
6
7
  key: string;
7
8
  xValues: string[];
@@ -124,33 +125,6 @@ export type IndicatorChartData = {
124
125
  min?: number;
125
126
  max?: number;
126
127
  };
127
- /**
128
- * Raw GeoDataElement from data
129
- */
130
- export type RawGeoDataElement = {
131
- /** Name of geo-element (country or state) */
132
- geoName: string;
133
- /** Original numeric measure value for this geo-element */
134
- originalValue: number;
135
- /** Formatted measure value for this geo-element to display*/
136
- formattedOriginalValue: string;
137
- };
138
- /**
139
- * GeoDataElement with color property, calculated from `originalValue`
140
- */
141
- export type GeoDataElement = RawGeoDataElement & {
142
- /** Calculated color for this geo-element */
143
- color?: Color;
144
- };
145
- /**
146
- * Fact final data that will be passed to Areamap-component to render
147
- *
148
- * @internal
149
- */
150
- export type AreamapData = {
151
- type: AreamapChartType;
152
- geoData: GeoDataElement[];
153
- };
154
128
  /**
155
129
  * Fact final data that will be passed to chart-component to render
156
130
  *