@sisense/sdk-ui 1.21.0 → 1.23.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.
- package/dist/ai.cjs +57 -49
- package/dist/ai.js +844 -744
- package/dist/analytics-composer.cjs +89 -148
- package/dist/analytics-composer.js +1198 -1481
- package/dist/{get-widget-options-NhNoIBS9.js → derive-chart-family-CTpRObm1.js} +11138 -11042
- package/dist/{get-widget-options-BmZF5Ztf.cjs → derive-chart-family-DcALKnKU.cjs} +100 -100
- package/dist/index.cjs +116 -116
- package/dist/index.js +9303 -8779
- package/dist/packages/sdk-ui/src/ai/api/chat-rest-api.d.ts +1 -1
- package/dist/packages/sdk-ui/src/ai/api/types.d.ts +3 -23
- package/dist/packages/sdk-ui/src/ai/chart/chart-insights.d.ts +5 -0
- package/dist/packages/sdk-ui/src/ai/chart/nlq-chart-widget.d.ts +41 -0
- package/dist/packages/sdk-ui/src/ai/chat-config.d.ts +1 -1
- package/dist/packages/sdk-ui/src/ai/icons/ai-icon.d.ts +2 -0
- package/dist/packages/sdk-ui/src/ai/index.d.ts +2 -3
- package/dist/packages/sdk-ui/src/ai/messages/chart-message.d.ts +1 -2
- package/dist/packages/sdk-ui/src/ai/use-get-data-source-fields.d.ts +1 -1
- package/dist/packages/sdk-ui/src/analytics-composer/{translators → code}/code-templates.d.ts +1 -1
- package/dist/packages/sdk-ui/src/analytics-composer/{translators → code}/generate-code.d.ts +3 -3
- package/dist/packages/sdk-ui/src/analytics-composer/{translators → common}/utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +12 -1
- package/dist/packages/sdk-ui/src/analytics-composer/query/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/analytics-composer/{translators → query}/query-translator.d.ts +2 -3
- package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +149 -0
- package/dist/packages/sdk-ui/src/{ai/messages → analytics-composer/widget/chart-options}/get-widget-options.d.ts +5 -14
- package/dist/packages/sdk-ui/src/analytics-composer/widget/stringify-filters.d.ts +2 -0
- package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-code.d.ts +3 -0
- package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-props.d.ts +3 -0
- package/dist/packages/sdk-ui/src/analytics-composer/widget/widget-composer.d.ts +15 -0
- package/dist/packages/sdk-ui/src/api/rest-api.d.ts +5 -1
- package/dist/packages/sdk-ui/src/api/types/dashboard-dto.d.ts +1 -1
- package/dist/packages/sdk-ui/src/app/client-application.d.ts +60 -16
- package/dist/packages/sdk-ui/src/app/settings/settings.d.ts +5 -0
- package/dist/packages/sdk-ui/src/app/settings/types/user.d.ts +0 -1
- package/dist/packages/sdk-ui/src/boxplot-utils.d.ts +5 -4
- package/dist/packages/sdk-ui/src/chart/chart.d.ts +1 -0
- package/dist/packages/sdk-ui/src/chart/helpers/derive-chart-family.d.ts +8 -0
- package/dist/packages/sdk-ui/src/chart-data-options/utils.d.ts +1 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/translations-to-highcharts.d.ts +1 -1
- package/dist/packages/sdk-ui/src/common/components/menu/types.d.ts +1 -0
- package/dist/packages/sdk-ui/src/common/hooks/use-fetch.d.ts +1 -1
- package/dist/packages/sdk-ui/src/common/hooks/use-synced-state.d.ts +19 -0
- package/dist/packages/sdk-ui/src/common-filters/selection-utils.d.ts +9 -1
- package/dist/packages/sdk-ui/src/common-filters/use-common-filters.d.ts +4 -2
- package/dist/packages/sdk-ui/src/dashboard/dashboard-by-id.d.ts +1 -2
- package/dist/packages/sdk-ui/src/dashboard/dashboard-helpers.d.ts +86 -9
- package/dist/packages/sdk-ui/src/dashboard/dashboard.d.ts +9 -1
- package/dist/packages/sdk-ui/src/dashboard/index.d.ts +2 -1
- package/dist/packages/sdk-ui/src/dashboard/types.d.ts +18 -0
- package/dist/packages/sdk-ui/src/dashboard/use-composed-dashboard.d.ts +30 -0
- package/dist/packages/sdk-ui/src/dashboard/use-dashboard-theme.d.ts +40 -0
- package/dist/packages/sdk-ui/src/decorators/hook-decorators/with-tracking.d.ts +1 -0
- package/dist/packages/sdk-ui/src/filters/components/common/member-radio.d.ts +8 -0
- package/dist/packages/sdk-ui/src/filters/components/date-filter/date-range-filter-tile/date-range-filter-display.d.ts +2 -1
- package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.d.ts +2 -2
- package/dist/packages/sdk-ui/src/filters/components/filters-panel/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-list.d.ts +1 -0
- package/dist/packages/sdk-ui/src/formulas/use-get-shared-formula.d.ts +2 -2
- package/dist/packages/sdk-ui/src/index.d.ts +28 -13
- package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model-translator.d.ts +2 -2
- package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model.d.ts +1 -1
- package/dist/packages/sdk-ui/src/models/dashboard/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-dto-utils.d.ts +11 -0
- package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dasboard-model-utils.d.ts +22 -0
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +63 -0
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts +38 -0
- package/dist/packages/sdk-ui/src/models/dashboard/use-get-dashboard-model.d.ts +3 -4
- package/dist/packages/sdk-ui/src/models/dashboard/use-get-dashboard-models.d.ts +1 -1
- package/dist/packages/sdk-ui/src/models/hierarchy/hierarchy-model-translator.d.ts +1 -1
- package/dist/packages/sdk-ui/src/models/hierarchy/use-get-hierarchy-models.d.ts +2 -2
- package/dist/packages/sdk-ui/src/models/widget/use-get-widget-model.d.ts +2 -2
- package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +19 -1
- package/dist/packages/sdk-ui/src/models/widget/widget-model.d.ts +2 -2
- package/dist/packages/sdk-ui/src/props.d.ts +47 -24
- package/dist/packages/sdk-ui/src/query-execution/execute-query-by-widget-id.d.ts +1 -1
- package/dist/packages/sdk-ui/src/query-execution/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/query-execution/use-execute-query-by-widget-id.d.ts +1 -1
- package/dist/packages/sdk-ui/src/sisense-context/custom-sisense-context-provider.d.ts +1 -3
- package/dist/packages/sdk-ui/src/sisense-context/sisense-context.d.ts +3 -0
- package/dist/packages/sdk-ui/src/translation/i18n-provider.d.ts +3 -1
- package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +114 -2
- package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +206 -4
- package/dist/packages/sdk-ui/src/types.d.ts +33 -5
- package/dist/packages/sdk-ui/src/utils/filters.d.ts +1 -0
- package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/dashboard-widget.d.ts +4 -3
- package/dist/packages/sdk-ui/src/widget-by-id/translate-dashboard-filters.d.ts +4800 -0
- package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-panel-color-format.d.ts +3 -3
- package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-data-options.d.ts +15 -5
- package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-drilldown-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-filters.d.ts +85 -83
- package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/use-fetch-widget-dto-model.d.ts +3 -3
- package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/utils.d.ts +6 -13
- package/dist/packages/sdk-ui/src/widget-by-id/widget-by-id.d.ts +26 -0
- package/dist/packages/sdk-ui/src/widgets/common/drilldown-utils.d.ts +7 -0
- package/dist/packages/sdk-ui/src/widgets/common/{use-drilldown.d.ts → use-drilldown-core.d.ts} +14 -8
- package/dist/packages/sdk-ui/src/widgets/common-widget.d.ts +1 -0
- package/dist/packages/sdk-ui/src/widgets/hooks/use-drilldown.d.ts +27 -0
- package/dist/packages/sdk-ui/src/widgets/hooks/use-with-drilldown.d.ts +12 -0
- package/dist/packages/sdk-ui/src/widgets/widget.d.ts +9 -0
- package/dist/{table-widget-BPmucihM.js → useQuery-1xZMqnAI.js} +40059 -39949
- package/dist/useQuery-D9rZ58KS.cjs +821 -0
- package/dist/widget-composer-B17DVa2A.cjs +101 -0
- package/dist/widget-composer-DqjH_6dw.js +448 -0
- package/package.json +9 -9
- package/dist/packages/sdk-ui/src/ai/api/errors.d.ts +0 -4
- package/dist/packages/sdk-ui/src/ai/messages/jaql-element.d.ts +0 -28
- package/dist/packages/sdk-ui/src/analytics-composer/translators/index.d.ts +0 -3
- package/dist/packages/sdk-ui/src/analytics-composer/translators/model-translator.d.ts +0 -48
- package/dist/packages/sdk-ui/src/analytics-composer/translators/translate-filters-to-code.d.ts +0 -2
- package/dist/packages/sdk-ui/src/analytics-composer/translators/types.d.ts +0 -95
- package/dist/packages/sdk-ui/src/dashboard-widget/translate-dashboard-filters.d.ts +0 -4798
- package/dist/packages/sdk-ui/src/widgets/common/drilldown-connector.d.ts +0 -19
- package/dist/table-widget-BikAZUJv.cjs +0 -821
- /package/dist/packages/sdk-ui/src/analytics-composer/{translators → query}/query-templates.d.ts +0 -0
- /package/dist/packages/sdk-ui/src/analytics-composer/{translators/translate-props-to-code.d.ts → widget/stringify-props.d.ts} +0 -0
- /package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-style-options.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient } from '@sisense/sdk-rest-client';
|
|
2
2
|
import type { Chat, ChatRequest, ChatResponse, ChatWithoutHistory, ChatContext, GetNlgQueryResultRequest, GetNlgQueryResultResponse, LlmConfig, QueryRecommendationConfig, QueryRecommendationResponse, SendFeedbackRequest } from './types';
|
|
3
|
-
import { DataSourceField } from '@sisense/sdk-
|
|
3
|
+
import { DataSourceField } from '@sisense/sdk-data';
|
|
4
4
|
export declare class ChatRestApi {
|
|
5
5
|
private httpClient;
|
|
6
6
|
constructor(httpClient: HttpClient);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JaqlQueryPayload
|
|
2
|
-
import {
|
|
1
|
+
import { JaqlQueryPayload } from '@sisense/sdk-query-client';
|
|
2
|
+
import { ExpandedQueryModel } from '../../analytics-composer';
|
|
3
3
|
export interface ChatContext {
|
|
4
4
|
title: string;
|
|
5
5
|
live: boolean;
|
|
@@ -54,30 +54,10 @@ interface ErrorResponse {
|
|
|
54
54
|
};
|
|
55
55
|
responseType: 'error';
|
|
56
56
|
}
|
|
57
|
-
export
|
|
58
|
-
export type AllPossibleChartOptionKeys = KeysOfUnion<ChartDataOptions>;
|
|
59
|
-
export type AxesMappingKey = Exclude<AllPossibleChartOptionKeys, 'seriesToColorMap'>;
|
|
60
|
-
export type AxesMapping = Partial<Record<AxesMappingKey, Array<{
|
|
61
|
-
name: string;
|
|
62
|
-
type?: string;
|
|
63
|
-
}>>>;
|
|
64
|
-
export interface ChartRecommendations {
|
|
65
|
-
chartFamily: string;
|
|
66
|
-
chartType: string;
|
|
67
|
-
axesMapping: AxesMapping;
|
|
68
|
-
}
|
|
69
|
-
export interface NlqResponseData {
|
|
57
|
+
export interface NlqResponseData extends ExpandedQueryModel {
|
|
70
58
|
detailedDescription: string;
|
|
71
59
|
followupQuestions: string[];
|
|
72
60
|
nlqPrompt: string;
|
|
73
|
-
chartRecommendations: ChartRecommendations | {};
|
|
74
|
-
jaql: {
|
|
75
|
-
datasource: {
|
|
76
|
-
title: string;
|
|
77
|
-
};
|
|
78
|
-
metadata: MetadataItem[];
|
|
79
|
-
};
|
|
80
|
-
queryTitle: string;
|
|
81
61
|
}
|
|
82
62
|
export interface NlqResponse {
|
|
83
63
|
data: NlqResponseData;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Filter } from '@sisense/sdk-data';
|
|
2
|
+
import type { NlqResponseData } from '../../ai';
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link NlqChartWidget} component.
|
|
5
|
+
*
|
|
6
|
+
* @group Generative AI
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export interface NlqChartWidgetProps {
|
|
10
|
+
/**
|
|
11
|
+
* Chatbot NLQ Response
|
|
12
|
+
*/
|
|
13
|
+
nlqResponse: NlqResponseData;
|
|
14
|
+
/**
|
|
15
|
+
* The dashboard filters to be applied to the chart
|
|
16
|
+
*/
|
|
17
|
+
filters?: Filter[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* React component that renders a chart widget based on NLQ response data.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* import { NlqChartWidget, NlqResponseData } from '@sisense/sdk-ui/ai';
|
|
25
|
+
* import { Filter } from '@sisense/sdk-data';
|
|
26
|
+
*
|
|
27
|
+
* function ExampleComponent(nlqResponse: NlqResponseData, filters?: Filter[]) {
|
|
28
|
+
*
|
|
29
|
+
* return (
|
|
30
|
+
* <ChartWidgetWithInsights
|
|
31
|
+
* nlqResponse={nlqResponse}
|
|
32
|
+
* filters={filters}
|
|
33
|
+
* />
|
|
34
|
+
* );
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
* @param props - {@link NlqChartWidgetProps}
|
|
38
|
+
* @group Generative AI
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare const NlqChartWidget: ({ nlqResponse, filters }: NlqChartWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,8 +5,7 @@ export { useGetQueryRecommendations, type UseGetQueryRecommendationsParams, type
|
|
|
5
5
|
export { useChatSession, type UseChatSessionResult } from './use-chat-session';
|
|
6
6
|
export { useLastNlqResponse } from './use-last-nlq-response';
|
|
7
7
|
export { useGetDataSourceFields } from './use-get-data-source-fields';
|
|
8
|
-
export type { GetNlgQueryResultRequest, QueryRecommendationResponse, QueryRecommendation, NlqResponseData,
|
|
8
|
+
export type { GetNlgQueryResultRequest, QueryRecommendationResponse, QueryRecommendation, NlqResponseData, } from './api/types';
|
|
9
9
|
export { Chatbot, type ChatbotProps } from './chatbot';
|
|
10
10
|
export { default as GetNlgQueryResult, type GetNlgQueryResultProps } from './get-nlg-query-result';
|
|
11
|
-
export {
|
|
12
|
-
export { JaqlElement } from './messages/jaql-element';
|
|
11
|
+
export { NlqChartWidget, type NlqChartWidgetProps } from './chart/nlq-chart-widget';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NlqResponseData } from '../api/types';
|
|
2
2
|
type ChartMessageProps = {
|
|
3
3
|
content: NlqResponseData;
|
|
4
|
-
dataSource: string;
|
|
5
4
|
};
|
|
6
|
-
export default function ChartMessage({ content
|
|
5
|
+
export default function ChartMessage({ content }: ChartMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export {};
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export declare const useGetDataSourceFields: (dataSource: string | undefined) => {
|
|
10
|
-
data: import("@sisense/sdk-
|
|
10
|
+
data: import("@sisense/sdk-data").DataSourceField[] | undefined;
|
|
11
11
|
isLoading: boolean;
|
|
12
12
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodeTemplateKey, UiFramework } from '
|
|
1
|
+
import { CodePlaceholderMap, CodeTemplateKey, UiFramework } from '../types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Populates placeholders in the given template with the given data.
|
|
4
4
|
* If a placeholder is not found in the data, a warning is logged.
|
|
@@ -12,7 +12,7 @@ export declare const populatePlaceholders: (template: string, data: Record<strin
|
|
|
12
12
|
* Generates code from a template with the given data and UI framework.
|
|
13
13
|
*
|
|
14
14
|
* @param templateKey - the key of the template to use
|
|
15
|
-
* @param
|
|
15
|
+
* @param placeholderMap - the data to populate the template with
|
|
16
16
|
* @param uiFramework - the UI framework for the generated code
|
|
17
17
|
*/
|
|
18
|
-
export declare const generateCode: (templateKey: CodeTemplateKey,
|
|
18
|
+
export declare const generateCode: (templateKey: CodeTemplateKey, placeholderMap: CodePlaceholderMap, uiFramework?: UiFramework) => string;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './query';
|
|
3
|
+
/**
|
|
4
|
+
* Utility functions to compose props and code for widgets.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export * as widgetComposer from './widget/widget-composer';
|
|
8
|
+
/**
|
|
9
|
+
* Utility functions to compose props and code for dashboards.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export * as dashboardComposer from './dashboard/dashboard-composer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { QueryTranslator } from './query-translator.js';
|
package/dist/packages/sdk-ui/src/analytics-composer/{translators → query}/query-translator.d.ts
RENAMED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ExpandedQueryModel, SimpleQueryModel, SimpleChartRecommendations } from '
|
|
2
|
-
import {
|
|
3
|
-
import { ChartRecommendations } from '../../ai';
|
|
1
|
+
import { ExpandedQueryModel, SimpleQueryModel, SimpleChartRecommendations, ChartRecommendations } from '../types.js';
|
|
2
|
+
import { MetadataItem, MetadataItemJaql, DataSourceField } from '@sisense/sdk-data';
|
|
4
3
|
/**
|
|
5
4
|
* A class that translates ExpandedQueryModel (Raw JAQL+Chart Recommendations)
|
|
6
5
|
* to SimpleQueryModel (Simple JAQL+Simple Chart Options) and vice versa.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { WidgetProps } from '../props';
|
|
2
|
+
import { ChartDataOptions } from '../types';
|
|
3
|
+
import { MetadataItem } from '@sisense/sdk-data';
|
|
4
|
+
export type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
5
|
+
export type AllPossibleChartOptionKeys = KeysOfUnion<ChartDataOptions>;
|
|
6
|
+
export type AxesMappingKey = Exclude<AllPossibleChartOptionKeys, 'seriesToColorMap'>;
|
|
7
|
+
export type AxesMapping = Partial<Record<AxesMappingKey, Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
type?: string;
|
|
10
|
+
}>>>;
|
|
11
|
+
export interface ChartRecommendations {
|
|
12
|
+
chartFamily: string;
|
|
13
|
+
chartType: string;
|
|
14
|
+
axesMapping: AxesMapping;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Expanded Query Model that is based on NlqResponseData.
|
|
18
|
+
* It contains expanded JAQL and chart recommendations returned from the chat response.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export interface ExpandedQueryModel {
|
|
22
|
+
chartRecommendations: ChartRecommendations | {};
|
|
23
|
+
jaql: {
|
|
24
|
+
datasource: {
|
|
25
|
+
title: string;
|
|
26
|
+
};
|
|
27
|
+
metadata: MetadataItem[];
|
|
28
|
+
};
|
|
29
|
+
queryTitle: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Empty Expanded Query Model
|
|
33
|
+
*
|
|
34
|
+
* Used as a default value for ExpandedQueryModel
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export declare const EMPTY_EXPANDED_QUERY_MODEL: ExpandedQueryModel;
|
|
38
|
+
/**
|
|
39
|
+
* Simple Chart Recommendations
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export interface SimpleChartRecommendations {
|
|
43
|
+
chartType: string;
|
|
44
|
+
dataOptions: AxesMapping;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Simple Query Model that is a simplified version of ExpandedQueryModel.
|
|
48
|
+
*
|
|
49
|
+
* It removes any JAQL syntax or information that already exists in the schema.
|
|
50
|
+
* Also, any parameters that have a default do not need to be specified.
|
|
51
|
+
*
|
|
52
|
+
* Users manipulates this model via the query in YAML format.
|
|
53
|
+
*
|
|
54
|
+
* QueryTranslator is responsible for translating this query model to ExpandedWidgetModel.
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
export interface SimpleQueryModel {
|
|
58
|
+
/**
|
|
59
|
+
* The data model or perspective title.
|
|
60
|
+
*/
|
|
61
|
+
model: string;
|
|
62
|
+
metadata: MetadataItem[];
|
|
63
|
+
chart: SimpleChartRecommendations | {};
|
|
64
|
+
/**
|
|
65
|
+
* Title of the query
|
|
66
|
+
*/
|
|
67
|
+
queryTitle: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Empty Simple Query Model
|
|
71
|
+
*
|
|
72
|
+
* Used as a default value for SimpleQueryModel
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
export declare const EMPTY_SIMPLE_QUERY_MODEL: SimpleQueryModel;
|
|
76
|
+
/**
|
|
77
|
+
* UI Framework
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
export type UiFramework = 'react' | 'vue' | 'angular';
|
|
81
|
+
/**
|
|
82
|
+
* Code Template Key
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
export type CodeTemplateKey = 'baseChartTmpl' | 'chartTmpl' | 'chartWidgetTmpl' | 'widgetByIdTmpl';
|
|
86
|
+
/**
|
|
87
|
+
* Code Templates
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
export type CodeTemplates = {
|
|
91
|
+
[key in UiFramework]: {
|
|
92
|
+
[key in CodeTemplateKey]: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Code Placeholder Map
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
export type CodePlaceholderMap = Record<string, string>;
|
|
100
|
+
/**
|
|
101
|
+
* Base Code Config
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
export type BaseCodeConfig = {
|
|
105
|
+
uiFramework?: UiFramework;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Widget Code Config
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
export type WidgetCodeConfig = BaseCodeConfig & {
|
|
112
|
+
includeChart?: boolean;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Client-side Widget Code Params
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
export type ClientSideWidgetCodeParams = WidgetCodeConfig & {
|
|
119
|
+
widgetProps: WidgetProps;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* By ID Widget Code Params
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
export type ByIdWidgetCodeParams = WidgetCodeConfig & {
|
|
126
|
+
dashboardOid: string;
|
|
127
|
+
widgetOid: string;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Widget Code Params
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
export type WidgetCodeParams = ClientSideWidgetCodeParams | ByIdWidgetCodeParams;
|
|
134
|
+
/**
|
|
135
|
+
* Check if widget code params is for client-side code
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
|
+
export declare const isClientSideWidgetCodeParams: (params: WidgetCodeParams) => params is ClientSideWidgetCodeParams;
|
|
139
|
+
/**
|
|
140
|
+
* Check if widget code params is for by ID code
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
export declare const isByIdWidgetCodeParams: (params: WidgetCodeParams) => params is ByIdWidgetCodeParams;
|
|
144
|
+
/**
|
|
145
|
+
* @internal
|
|
146
|
+
**/
|
|
147
|
+
export type WidgetPropsConfig = {
|
|
148
|
+
useCustomizedStyleOptions?: boolean;
|
|
149
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ChartRecommendations,
|
|
4
|
-
export declare const getChartRecommendationsOrDefault: (response:
|
|
1
|
+
import { ChartDataOptions, ChartStyleOptions } from '../../../types';
|
|
2
|
+
import { MetadataItem } from '@sisense/sdk-data';
|
|
3
|
+
import { ChartRecommendations, ExpandedQueryModel } from '../../../analytics-composer/types';
|
|
4
|
+
export declare const getChartRecommendationsOrDefault: (response: ExpandedQueryModel) => ChartRecommendations;
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
8
|
export declare const getTableOptions: (jaql: MetadataItem[]) => {
|
|
9
9
|
dataOptions: {
|
|
10
|
-
columns: import("
|
|
10
|
+
columns: import("@sisense/sdk-data").JaqlElement[];
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
@@ -21,13 +21,4 @@ export declare const getTableOptions: (jaql: MetadataItem[]) => {
|
|
|
21
21
|
export declare const getChartOptions: (jaql: MetadataItem[], chartRecommendations: ChartRecommendations, useCustomizedStyleOptions?: boolean) => {
|
|
22
22
|
dataOptions: ChartDataOptions;
|
|
23
23
|
chartStyleOptions: ChartStyleOptions;
|
|
24
|
-
expandedChartStyleOptions: ChartStyleOptions;
|
|
25
24
|
};
|
|
26
|
-
/**
|
|
27
|
-
* Derives chart family from chart type.
|
|
28
|
-
*
|
|
29
|
-
* @param chartType - chart type
|
|
30
|
-
* @returns chart family
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
export declare const deriveChartFamily: (chartType: string) => string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ByIdWidgetCodeParams, ClientSideWidgetCodeParams } from '../types.js';
|
|
2
|
+
export declare const toWidgetCodeById: ({ dashboardOid, widgetOid, uiFramework, }: ByIdWidgetCodeParams) => string;
|
|
3
|
+
export declare const toWidgetCodeClientSide: ({ widgetProps, uiFramework, }: ClientSideWidgetCodeParams) => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { WidgetProps } from '../../props.js';
|
|
2
|
+
import { ExpandedQueryModel, WidgetCodeParams, WidgetPropsConfig } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Converts query model to widget props.
|
|
5
|
+
* @param queryModel - Expanded query model
|
|
6
|
+
* @returns Widget props
|
|
7
|
+
*/
|
|
8
|
+
export declare const toWidgetProps: (queryModel: ExpandedQueryModel, config?: WidgetPropsConfig) => WidgetProps | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Converts widget props to CSDK code.
|
|
11
|
+
*
|
|
12
|
+
* @param widgetCodeParams - Widget code params
|
|
13
|
+
* @returns CSDK code string
|
|
14
|
+
*/
|
|
15
|
+
export declare const toWidgetCode: (widgetCodeParams: WidgetCodeParams) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpClient } from '@sisense/sdk-rest-client';
|
|
2
2
|
import { FeatureCollection as GeoJsonFeatureCollection } from 'geojson';
|
|
3
3
|
import { type DataSource } from '@sisense/sdk-data';
|
|
4
|
-
import { HierarchyDto, WidgetDto } from '../
|
|
4
|
+
import { HierarchyDto, WidgetDto } from '../widget-by-id/types';
|
|
5
5
|
import type { DashboardDto } from './types/dashboard-dto';
|
|
6
6
|
import { PaletteDto } from '../api/types/palette-dto';
|
|
7
7
|
import { GetHierarchiesOptions } from '../models/hierarchy/types';
|
|
@@ -49,6 +49,10 @@ export declare class RestApi {
|
|
|
49
49
|
* Get hierarchies
|
|
50
50
|
*/
|
|
51
51
|
getHierarchies: ({ dataSource, dimension, ids, alwaysIncluded, }: GetHierarchiesOptions) => Promise<HierarchyDto[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Partially update a dashboard
|
|
54
|
+
*/
|
|
55
|
+
patchDashboard: (dashboardOid: string, dashboard: Partial<DashboardDto>) => Promise<DashboardDto | undefined>;
|
|
52
56
|
}
|
|
53
57
|
export declare const useGetApi: () => RestApi;
|
|
54
58
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WidgetDto } from '../../
|
|
1
|
+
import { WidgetDto } from '../../widget-by-id/types';
|
|
2
2
|
import { FilterJaql, FilterRelationsModel, JaqlDataSource } from '@sisense/sdk-data';
|
|
3
3
|
import { AnyObject } from '../../utils/utility-types';
|
|
4
4
|
/** @internal */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { HttpClient
|
|
1
|
+
import { HttpClient } from '@sisense/sdk-rest-client';
|
|
2
2
|
import { QueryClient } from '@sisense/sdk-query-client';
|
|
3
3
|
import { DataSource } from '@sisense/sdk-data';
|
|
4
|
-
import { DateConfig } from '../query/date-formats';
|
|
5
|
-
import { AppSettings } from './settings/settings';
|
|
6
4
|
import { PivotClient } from '@sisense/sdk-pivot-client';
|
|
7
|
-
import { LoadingIndicatorConfig } from '../types';
|
|
8
5
|
import { TrackingEventDetails } from '@sisense/sdk-tracking';
|
|
6
|
+
import { DateConfig } from '../query/date-formats';
|
|
7
|
+
import { AppSettings } from './settings/settings';
|
|
8
|
+
import { CustomTranslationObject, LoadingIndicatorConfig } from '../types';
|
|
9
9
|
import { SisenseContextProviderProps } from '../props';
|
|
10
10
|
/**
|
|
11
11
|
* Application configuration
|
|
@@ -15,10 +15,60 @@ export type AppConfig = {
|
|
|
15
15
|
* A [date-fns Locale](https://date-fns.org/v2.30.0/docs/Locale)
|
|
16
16
|
*/
|
|
17
17
|
locale?: Locale;
|
|
18
|
+
/**
|
|
19
|
+
* Translation Configurations
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
translationConfig?: {
|
|
24
|
+
/**
|
|
25
|
+
* Language code to be used for translations.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
language?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Additional translation resources to be loaded.
|
|
32
|
+
*
|
|
33
|
+
* You can find the list of available translation keys in the translation folder of every package.
|
|
34
|
+
*
|
|
35
|
+
* Translation keys that are not provided will default to the English translation.
|
|
36
|
+
* If translation is provided for a package other than sdk-ui, please specify the namespace property.
|
|
37
|
+
*
|
|
38
|
+
* Important: Do not translate parts in {{}} - these are placeholders for dynamic values and will be matched using provided variable names.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* customTranslations: [
|
|
43
|
+
* {
|
|
44
|
+
* language: 'fr',
|
|
45
|
+
* resources: {
|
|
46
|
+
* errors: {
|
|
47
|
+
* invalidFilterType: 'Type de filtre invalide',
|
|
48
|
+
* },
|
|
49
|
+
* },
|
|
50
|
+
* },
|
|
51
|
+
* {
|
|
52
|
+
* language: 'es',
|
|
53
|
+
* namespace: 'sdkData'
|
|
54
|
+
* resources: {
|
|
55
|
+
* errors: {
|
|
56
|
+
* measure: {
|
|
57
|
+
* unsupportedType: 'Tipo de medida no compatible',
|
|
58
|
+
* },
|
|
59
|
+
* },
|
|
60
|
+
* },
|
|
61
|
+
* },
|
|
62
|
+
* ]
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
customTranslations?: CustomTranslationObject[];
|
|
66
|
+
};
|
|
18
67
|
/**
|
|
19
68
|
* Language code to be used for translations
|
|
20
69
|
*
|
|
21
70
|
* @internal
|
|
71
|
+
* @deprecated Use `translationConfig.language` instead
|
|
22
72
|
*/
|
|
23
73
|
language?: string;
|
|
24
74
|
/**
|
|
@@ -81,10 +131,12 @@ export type AppConfig = {
|
|
|
81
131
|
*/
|
|
82
132
|
trackingConfig?: {
|
|
83
133
|
/**
|
|
84
|
-
* Whether to enable tracking
|
|
134
|
+
* Whether to enable or disable tracking in development or test environment.
|
|
85
135
|
*
|
|
86
136
|
* If not specified, the default value is `true`
|
|
87
137
|
*
|
|
138
|
+
* In production, tracking is always enabled.
|
|
139
|
+
*
|
|
88
140
|
* @internal
|
|
89
141
|
*/
|
|
90
142
|
enabled?: boolean;
|
|
@@ -99,7 +151,7 @@ export type AppConfig = {
|
|
|
99
151
|
*
|
|
100
152
|
* @internal
|
|
101
153
|
*/
|
|
102
|
-
export
|
|
154
|
+
export interface ClientApplication {
|
|
103
155
|
/**
|
|
104
156
|
* Gets the underlying HTTP Client
|
|
105
157
|
*/
|
|
@@ -115,7 +167,7 @@ export declare class ClientApplication {
|
|
|
115
167
|
/**
|
|
116
168
|
* Gets the default data source being used as default for child components with no explicitly defined data source
|
|
117
169
|
*/
|
|
118
|
-
readonly defaultDataSource
|
|
170
|
+
readonly defaultDataSource?: DataSource;
|
|
119
171
|
/**
|
|
120
172
|
* Gets the application settings
|
|
121
173
|
*/
|
|
@@ -129,16 +181,8 @@ export declare class ClientApplication {
|
|
|
129
181
|
*/
|
|
130
182
|
clear: () => void;
|
|
131
183
|
};
|
|
132
|
-
/**
|
|
133
|
-
* Construct new Sisense Client Application
|
|
134
|
-
*
|
|
135
|
-
* @param url - URL to the sisense environment
|
|
136
|
-
* @param auth - Authentication to be used
|
|
137
|
-
* @param defaultDataSource - Default data source to be used by child components by default
|
|
138
|
-
*/
|
|
139
|
-
constructor(url: string, auth: Authenticator, defaultDataSource?: DataSource);
|
|
140
184
|
}
|
|
141
185
|
type ClientApplicationParams = Pick<SisenseContextProviderProps, 'appConfig' | 'defaultDataSource' | 'url' | 'token' | 'wat' | 'ssoEnabled' | 'enableSilentPreAuth' | 'useFusionAuth'>;
|
|
142
186
|
/** @internal */
|
|
143
|
-
export declare const createClientApplication: ({ defaultDataSource, url, token, wat, ssoEnabled, appConfig, enableSilentPreAuth, useFusionAuth, }: ClientApplicationParams) => Promise<ClientApplication>;
|
|
187
|
+
export declare const createClientApplication: ({ defaultDataSource, url: rawUrl, token, wat, ssoEnabled, appConfig, enableSilentPreAuth, useFusionAuth, }: ClientApplicationParams) => Promise<ClientApplication>;
|
|
144
188
|
export {};
|
|
@@ -14,10 +14,11 @@ export declare const boxWhiskerProcessResultInternal: (boxWhiskerData: QueryResu
|
|
|
14
14
|
/**
|
|
15
15
|
* Processes box whisker data and outliers data to combine them into a single data set.
|
|
16
16
|
*
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
19
|
-
* @param
|
|
20
|
-
* @returns
|
|
17
|
+
* @param boxWhiskerData - The data for the box whisker.
|
|
18
|
+
* @param outliersData - The data for the outliers.
|
|
19
|
+
* @param dataOptions - Optional data options for customizing data processing.
|
|
20
|
+
* @returns The combined data with outliers included in the box whisker plot.
|
|
21
|
+
* @shortDescription Utility function that combines box whisker data and outliers data
|
|
21
22
|
* @group Charts
|
|
22
23
|
*/
|
|
23
24
|
export declare function boxWhiskerProcessResult(boxWhiskerData: QueryResultData, outliersData: QueryResultData, dataOptions?: BoxplotChartCustomDataOptions): QueryResultData;
|
|
@@ -16,6 +16,7 @@ import { ChartProps } from '../props';
|
|
|
16
16
|
*
|
|
17
17
|
* @param props - Chart properties
|
|
18
18
|
* @returns Chart component representing a chart type as specified in `ChartProps.`{@link ChartProps.chartType | chartType}
|
|
19
|
+
* @shortDescription Common component for rendering charts of different types including table
|
|
19
20
|
* @group Charts
|
|
20
21
|
*/
|
|
21
22
|
export declare const Chart: import("react").FunctionComponent<ChartProps>;
|
|
@@ -36,6 +36,7 @@ export declare const splitColumn: <C extends AnyColumn>(targetColumn: C) => {
|
|
|
36
36
|
export declare function isMeasureColumn(arg: AnyColumn): arg is MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
37
37
|
export declare const getDataOptionTitle: ({ column }: StyledColumn | StyledMeasureColumn) => string;
|
|
38
38
|
export declare const getDataOptionGranularity: ({ column, granularity }: StyledColumn) => string;
|
|
39
|
+
/** @internal */
|
|
39
40
|
export declare const translateColumnToAttribute: (c: Column | StyledColumn) => Attribute;
|
|
40
41
|
export declare const translateColumnToMeasure: (c: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn) => Measure;
|
|
41
42
|
/**
|
|
@@ -75,7 +75,7 @@ export declare const addStackingIfSpecified: (chartType: ChartType, designOption
|
|
|
75
75
|
*/
|
|
76
76
|
export declare const indexMapWhenOnlyY: (categories: string[], index: number) => (-1 | 0)[];
|
|
77
77
|
export declare const formatSeriesContinuousXAxis: (series: CategoricalSeriesValues, indexMap: number[], treatNullDataAsZeros: boolean, interval: number, maxCategories: number, dateFormatter: (time: number) => string, yAxisSettings: AxisSettings, axisClipped: AxisClipped) => HighchartsSeriesValues;
|
|
78
|
-
export declare const formatSeries: (series: CategoricalSeriesValues, indexMap: number[], treatNullDataAsZeros: boolean, categories?: string[], categoryColors?: string[]) => HighchartsSeriesValues;
|
|
78
|
+
export declare const formatSeries: (series: CategoricalSeriesValues, indexMap: number[], treatNullDataAsZeros: boolean, categories?: string[], categoryColors?: string[], convertValuesToAbsolute?: boolean) => HighchartsSeriesValues;
|
|
79
79
|
export declare const adjustMinMaxWhenInvalid: (explicitAxis: AxisMinMax, autoMinMax: AxisMinMax) => {
|
|
80
80
|
min: number;
|
|
81
81
|
max: number;
|