@sisense/sdk-ui 2.24.0 → 2.26.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 +59 -59
- package/dist/ai.js +1097 -1171
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +587 -616
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/{execute-query-b9oy2Egy.js → apply-styled-options-to-query-Bzt2GrgO.js} +1635 -1530
- package/dist/apply-styled-options-to-query-COD9fRYD.cjs +1 -0
- package/dist/{dimensions-C1R5YRt-.js → dimensions-Ce2zWFrs.js} +1 -1
- package/dist/dimensions-u3w5qNF0.cjs +1 -0
- package/dist/{index-Ck-0gJC9.cjs → index-BX9p-XrU.cjs} +1 -1
- package/dist/{index-r66Tjiqj.js → index-D7mHzfx0.js} +9 -0
- package/dist/index.cjs +467 -452
- package/dist/index.js +27214 -34168
- package/dist/index.umd.js +718 -706
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +12 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +17 -5
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +16 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/utils.d.ts +5 -2
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/rename-widget/use-widget-renaming.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-scroll-persistence.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/persistence-manager.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +52 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +5 -28
- package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +6 -5
- package/dist/packages/sdk-ui/src/domains/data-browser/data-source-dimensional-model/hooks/use-get-data-source-dimensions.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/data-source-dimensional-model/hooks/use-get-data-source-fields.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/drilldown/components/drilldown-widget/drilldown-widget.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-collapsible.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-top-slot-shell.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative-interactive.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative.d.ts +40 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/build-narrative-request.d.ts +36 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/get-narrative-dimensions-and-measures.d.ts +22 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +29 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +36 -0
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +62 -0
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +39 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/core/date-formats/simple-date-format-replacers.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-pivot-query/use-execute-pivot-query.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-query/use-execute-query.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/area-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/areamap-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/bar-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/boxplot-chart/boxplot-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/helpers/highchart-options/axis.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/column-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/funnel-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/line-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pie-chart/pie-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/polar-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/scatter-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/scattermap-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/sunburst-chart/sunburst-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/table.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/treemap-chart/treemap-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/apply-styled-options-to-query.d.ts +87 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/translate-data-options.d.ts +13 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +6 -6
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/axis/axis-builders.d.ts +6 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/plot-bands.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/axis-section.d.ts +29 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/design-options.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/tooltip-utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/compose-code-to-readable.d.ts +32 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +26 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-params-to-view-model.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill-bubble-tooltip.d.ts +12 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/types.d.ts +51 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +166 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/use-scroller-location-save.d.ts +8 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/widget-by-id.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/with-navigator-scroll-save.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/use-get-widget-model.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +170 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/widget-model-translator.d.ts +13 -16
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-api-types.d.ts +32 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-constants.d.ts +6 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-endpoints.d.ts +26 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/send-ai-feedback.d.ts +8 -0
- package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +12 -1
- package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +10 -2
- package/dist/packages/sdk-ui/src/infra/contexts/custom-widgets-provider/use-custom-widgets.d.ts +10 -3
- package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/emotion-cache-provider.d.ts +31 -3
- package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/stylis-plugins/css-selector-prefix-plugin.d.ts +18 -0
- package/dist/packages/sdk-ui/src/infra/plugins/plugin-context.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/plugins/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +18 -0
- package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +3 -4
- package/dist/packages/sdk-ui/src/modules/ai/api/types.d.ts +5 -18
- package/dist/packages/sdk-ui/src/modules/ai/chart/nlq-chart-widget.d.ts +2 -0
- package/dist/packages/sdk-ui/src/modules/ai/common/collapsible.d.ts +3 -0
- package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +5 -13
- package/dist/packages/sdk-ui/src/modules/ai/index.d.ts +2 -1
- package/dist/packages/sdk-ui/src/modules/ai/use-get-nlg-insights.d.ts +4 -26
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +3 -7
- package/dist/packages/sdk-ui/src/props.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +7 -1
- package/dist/packages/sdk-ui/src/shared/utils/filter-relations.d.ts +2 -0
- package/dist/packages/sdk-ui/src/types.d.ts +8 -8
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +10 -1
- package/dist/translations/en-us.cjs +1 -1
- package/dist/translations/en-us.js +1 -1
- package/dist/translations/es-ar.cjs +1 -1
- package/dist/translations/es-ar.js +10 -1
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +10 -1
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +10 -1
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +12 -3
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +12 -3
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +12 -3
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +12 -3
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +10 -1
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +12 -3
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +10 -1
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +12 -3
- package/dist/types-COBvZZm_.cjs +1 -0
- package/dist/{types-DJtC8_5_.js → types-D6jCGncV.js} +1 -1
- package/dist/{quota-notification-CeKnEyQG.js → use-hover-B1HPf4hF.js} +27827 -19390
- package/dist/use-hover-CaQrW_gv.cjs +721 -0
- package/dist/{utils-BCp2ISWh.js → utils-BQtueE3Z.js} +13632 -13251
- package/dist/utils-CAubp1g1.cjs +179 -0
- package/dist/{widget-composer-CDNL9_XF.js → widget-composer-BAJFWk3t.js} +3 -3
- package/dist/{widget-composer-BkHZISs7.cjs → widget-composer-C75b-E6W.cjs} +1 -1
- package/package.json +11 -10
- package/dist/dimensions-C7yXAoZs.cjs +0 -1
- package/dist/execute-query-0Y9Fn9Pf.cjs +0 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/index.d.ts +0 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/table-widget.d.ts +0 -22
- package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/types.d.ts +0 -61
- package/dist/packages/sdk-ui/src/infra/styled/index.d.ts +0 -4
- package/dist/packages/sdk-ui/src/infra/styled/with-css-selector-prefix.d.ts +0 -2
- package/dist/packages/sdk-ui/src/modules/ai/api/narration-endpoints.d.ts +0 -25
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/constants.d.ts +0 -8
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/parse-compose-code.d.ts +0 -34
- package/dist/quota-notification-BqRYSJ7r.cjs +0 -713
- package/dist/types-C0QU2tsE.cjs +0 -1
- package/dist/utils-D8O1_kl3.cjs +0 -190
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TFunction } from '@sisense/sdk-common';
|
|
2
|
+
import type { BaseQueryParams } from '../../../../domains/query-execution/types';
|
|
3
|
+
import type { QueryDefinitionViewModel } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Builds the query definition view model from base query params.
|
|
6
|
+
* Order: Measures → "by" → Dimensions → "for"/"where" → Filters.
|
|
7
|
+
* Operators (comparison/sort) are not derived from BaseQueryParams in v1.
|
|
8
|
+
*
|
|
9
|
+
* @param params - BaseQueryParams from chart or query
|
|
10
|
+
* @param t - Optional i18n translate function. When provided, date-level (`DimensionalLevelAttribute`)
|
|
11
|
+
* dimensions and filters use `attribute.datetimeName.*` strings (e.g. "Months in Date"). When omitted,
|
|
12
|
+
* labels match the previous behavior (`attr.name` only).
|
|
13
|
+
* @returns QueryDefinitionViewModel (pills and connectors)
|
|
14
|
+
* @sisenseInternal
|
|
15
|
+
*/
|
|
16
|
+
export declare function baseQueryParamsToViewModel(params: BaseQueryParams, t?: TFunction): QueryDefinitionViewModel;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FunctionComponent, type ReactNode } from 'react';
|
|
2
|
+
export interface QueryPillBubbleTooltipProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
open: boolean;
|
|
6
|
+
onOpenChange: (open: boolean) => void;
|
|
7
|
+
/** false = prefer above pill (default); true = prefer below (>3 lines of JSON). */
|
|
8
|
+
preferBelow?: boolean;
|
|
9
|
+
/** Tooltip stays inside this box (e.g. widget / story panel); intersects with viewport. */
|
|
10
|
+
boundaryElement?: HTMLElement | null;
|
|
11
|
+
}
|
|
12
|
+
export declare const QueryPillBubbleTooltip: FunctionComponent<QueryPillBubbleTooltipProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import type { QueryPillItem } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link QueryPill}.
|
|
5
|
+
*
|
|
6
|
+
* @sisenseInternal
|
|
7
|
+
*/
|
|
8
|
+
export interface QueryPillProps {
|
|
9
|
+
item: QueryPillItem;
|
|
10
|
+
showTooltip?: boolean;
|
|
11
|
+
tooltipBoundaryElement?: HTMLElement | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Read-only query-definition pill; JSON tooltip is a portal bubble with a real triangle.
|
|
15
|
+
*
|
|
16
|
+
* @sisenseInternal
|
|
17
|
+
*/
|
|
18
|
+
export declare const QueryPill: FunctionComponent<QueryPillProps>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Attribute, Filter, FilterRelations, Measure } from '@sisense/sdk-data';
|
|
2
|
+
/**
|
|
3
|
+
* Category of a query pill for styling (color).
|
|
4
|
+
*
|
|
5
|
+
* @sisenseInternal
|
|
6
|
+
*/
|
|
7
|
+
export type QueryPillCategory = 'measure' | 'dimension' | 'filter' | 'operator';
|
|
8
|
+
/**
|
|
9
|
+
* A single pill item in the query definition (measure, dimension, filter, or operator).
|
|
10
|
+
*
|
|
11
|
+
* @sisenseInternal
|
|
12
|
+
*/
|
|
13
|
+
export interface QueryPillItem {
|
|
14
|
+
type: 'pill';
|
|
15
|
+
/** Display label (friendly name) */
|
|
16
|
+
label: string;
|
|
17
|
+
/** Category for pill color */
|
|
18
|
+
category: QueryPillCategory;
|
|
19
|
+
/** Optional stable id for keys */
|
|
20
|
+
id?: string;
|
|
21
|
+
/** Source entity for debug/tooltip JSON (measure, dimension attribute, filter, etc.) */
|
|
22
|
+
tooltipData?: Attribute | Measure | Filter | FilterRelations;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Connector between pill groups (plain text, no pill styling).
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export interface ConnectorItem {
|
|
30
|
+
type: 'connector';
|
|
31
|
+
label: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* View model for the QueryDefinition component: ordered list of pills and connectors.
|
|
35
|
+
* Order: Measures → "by" → Dimensions → "for"/"where" → Filters → Operators.
|
|
36
|
+
*
|
|
37
|
+
* @sisenseInternal
|
|
38
|
+
*/
|
|
39
|
+
export type QueryDefinitionViewModel = (QueryPillItem | ConnectorItem)[];
|
|
40
|
+
/**
|
|
41
|
+
* Type guard for connector items.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare function isConnectorItem(item: QueryPillItem | ConnectorItem): item is ConnectorItem;
|
|
46
|
+
/**
|
|
47
|
+
* Type guard for pill items.
|
|
48
|
+
*
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
export declare function isPillItem(item: QueryPillItem | ConnectorItem): item is QueryPillItem;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
1
|
+
import type { PivotGrandTotals } from '@sisense/sdk-data';
|
|
2
|
+
import { AppSettings } from '../../../../../infra/app/settings/settings.js';
|
|
3
|
+
import type { AreamapType, AreaStyleOptions, AxisLabel, CompleteThemeSettings, DataLimits, FunnelStyleOptions, IndicatorStyleOptions, LegendOptions, LineStyleOptions, LineWidth, Markers, Navigator, PieStyleOptions, PivotTableWidgetStyleOptions, PolarStyleOptions, ScattermapStyleOptions, ScatterStyleOptions, SeriesLabels, StackableStyleOptions, SunburstStyleOptions, TableStyleOptions, TreemapStyleOptions, WidgetStyleOptions } from '../../../../../types.js';
|
|
4
|
+
import type { AxisStyle, CartesianWidgetStyle, FunnelWidgetStyle, PivotWidgetStyle, PolarWidgetStyle, ScattermapWidgetStyle, ScatterWidgetStyle, SunburstWidgetStyle, TableWidgetStyle, TreemapWidgetStyle, WidgetDesign, WidgetStyle, WidgetSubtype } from '../types.js';
|
|
3
5
|
/**
|
|
4
6
|
* Maps SDK legend options to Fusion DTO legend style.
|
|
5
7
|
*
|
|
@@ -51,6 +53,53 @@ export declare function toMarkersStyle(markers?: Markers): CartesianWidgetStyle[
|
|
|
51
53
|
* @internal
|
|
52
54
|
*/
|
|
53
55
|
export declare function toDataLimitsStyle(dataLimits?: DataLimits): CartesianWidgetStyle['dataLimits'];
|
|
56
|
+
/**
|
|
57
|
+
* Returns true when {@link WidgetModel.styleOptions} carries any widget container / design
|
|
58
|
+
* field that was produced by {@link getFlattenWidgetDesign} (and should be written back).
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export declare function hasWidgetContainerStyleFields(styleOptions: WidgetStyleOptions): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Rebuilds Fusion `style.widgetDesign` from flattened container options (inverse of
|
|
65
|
+
* {@link getFlattenWidgetDesign}).
|
|
66
|
+
*
|
|
67
|
+
* Missing fields default to the corresponding values from `themeSettings.widget` so that
|
|
68
|
+
* the resulting {@link WidgetDesign} is always fully populated which is critical for the widget design feature in Fusion.
|
|
69
|
+
*
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
export declare function toWidgetDesign(styleOptions: WidgetStyleOptions, widgetTheme: CompleteThemeSettings['widget']): WidgetDesign | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Attaches `style.widgetDesign` built from widget container fields in `styleOptions`.
|
|
75
|
+
* When the feature flag is off, or when `styleOptions` carries no container fields, the
|
|
76
|
+
* base style is returned unchanged.
|
|
77
|
+
*
|
|
78
|
+
* @param baseStyle - The base style to be attached with the widget design
|
|
79
|
+
* @param styleOptions - The style options to be used for the widget design
|
|
80
|
+
* @param themeSettings - The theme settings to be used for the widget design
|
|
81
|
+
* @param appSettings - The application settings to be used for the widget design
|
|
82
|
+
* @returns The widget style with the widget design
|
|
83
|
+
*/
|
|
84
|
+
export declare function withWidgetDesign(baseStyle: WidgetStyle, styleOptions: WidgetStyleOptions, themeSettings: CompleteThemeSettings, appSettings?: AppSettings): WidgetStyle;
|
|
85
|
+
/**
|
|
86
|
+
* Maps SDK pie chart style options to Fusion PieWidgetStyle (DTO).
|
|
87
|
+
* Inverse of {@link extractPieChartStyleOptions}.
|
|
88
|
+
*
|
|
89
|
+
* @param styleOptions - Pie style options from WidgetModel.styleOptions
|
|
90
|
+
* @returns Fusion PieWidgetStyle for the widget DTO
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
export declare function toPieWidgetStyle(styleOptions: PieStyleOptions): WidgetStyle;
|
|
94
|
+
/**
|
|
95
|
+
* Maps SDK indicator style options to Fusion IndicatorWidgetStyle (DTO).
|
|
96
|
+
* Inverse of {@link extractIndicatorChartStyleOptions}.
|
|
97
|
+
*
|
|
98
|
+
* @param styleOptions - Indicator style options from WidgetModel.styleOptions
|
|
99
|
+
* @returns Fusion IndicatorWidgetStyle for the widget DTO
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
export declare function toIndicatorWidgetStyle(styleOptions: IndicatorStyleOptions): WidgetStyle;
|
|
54
103
|
/**
|
|
55
104
|
* Maps SDK line chart style options to Fusion CartesianWidgetStyle (DTO).
|
|
56
105
|
* Used when serializing a line chart widget back to WidgetDto.
|
|
@@ -69,4 +118,119 @@ export declare function toLineWidgetStyle(styleOptions: LineStyleOptions): Carte
|
|
|
69
118
|
* @returns Fusion CartesianWidgetStyle for the widget DTO
|
|
70
119
|
*/
|
|
71
120
|
export declare function toAreaWidgetStyle(styleOptions: AreaStyleOptions, widgetSubtype: WidgetSubtype): CartesianWidgetStyle;
|
|
121
|
+
/**
|
|
122
|
+
* Converts funnel chart style options to Fusion FunnelWidgetStyle DTO.
|
|
123
|
+
* Inverse of {@link extractFunnelChartStyleOptions}.
|
|
124
|
+
*
|
|
125
|
+
* @param styleOptions - Funnel style options from WidgetModel.styleOptions
|
|
126
|
+
* @returns Fusion FunnelWidgetStyle for the widget DTO
|
|
127
|
+
* @internal
|
|
128
|
+
*/
|
|
129
|
+
export declare function toFunnelWidgetStyle(styleOptions: FunnelStyleOptions): FunnelWidgetStyle;
|
|
130
|
+
/**
|
|
131
|
+
* Converts treemap chart style options to Fusion TreemapWidgetStyle DTO.
|
|
132
|
+
* Inverse of {@link extractTreemapChartStyleOptions}.
|
|
133
|
+
*
|
|
134
|
+
* @param styleOptions - Treemap style options from WidgetModel.styleOptions
|
|
135
|
+
* @returns Fusion TreemapWidgetStyle for the widget DTO
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
|
+
export declare function toTreemapWidgetStyle(styleOptions: TreemapStyleOptions): TreemapWidgetStyle;
|
|
139
|
+
/**
|
|
140
|
+
* Converts sunburst chart style options to Fusion SunburstWidgetStyle DTO.
|
|
141
|
+
* Inverse of {@link extractSunburstChartStyleOptions}.
|
|
142
|
+
*
|
|
143
|
+
* @param styleOptions - Sunburst style options from WidgetModel.styleOptions
|
|
144
|
+
* @returns Fusion SunburstWidgetStyle for the widget DTO
|
|
145
|
+
* @internal
|
|
146
|
+
*/
|
|
147
|
+
export declare function toSunburstWidgetStyle(styleOptions: SunburstStyleOptions): SunburstWidgetStyle;
|
|
148
|
+
/**
|
|
149
|
+
* Converts bar chart style options to Fusion CartesianWidgetStyle DTO.
|
|
150
|
+
* Used when serializing a bar chart widget back to WidgetDto.
|
|
151
|
+
*
|
|
152
|
+
* @param styleOptions - Bar/stackable style options from WidgetModel.styleOptions
|
|
153
|
+
* @param widgetSubtype - Resolved Fusion widget subtype (e.g. 'bar/classic', 'bar/stacked', 'bar/stacked100')
|
|
154
|
+
* @returns Fusion CartesianWidgetStyle for the widget DTO
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
export declare function toBarWidgetStyle(styleOptions: StackableStyleOptions, widgetSubtype: WidgetSubtype): CartesianWidgetStyle;
|
|
158
|
+
/**
|
|
159
|
+
* Converts column chart style options to Fusion CartesianWidgetStyle DTO.
|
|
160
|
+
* Used when serializing a column chart widget back to WidgetDto.
|
|
161
|
+
*
|
|
162
|
+
* @param styleOptions - Column/stackable style options from WidgetModel.styleOptions
|
|
163
|
+
* @param widgetSubtype - Resolved Fusion widget subtype (e.g. 'column/classic', 'column/stackedcolumn', 'column/stackedcolumn100')
|
|
164
|
+
* @returns Fusion CartesianWidgetStyle for the widget DTO
|
|
165
|
+
* @internal
|
|
166
|
+
*/
|
|
167
|
+
export declare const toColumnWidgetStyle: typeof toBarWidgetStyle;
|
|
168
|
+
/**
|
|
169
|
+
* Converts polar chart style options to Fusion PolarWidgetStyle DTO.
|
|
170
|
+
* Uses `categories` / `axis` field names (instead of `xAxis` / `yAxis` used by Cartesian charts).
|
|
171
|
+
* Used when serializing a polar chart widget back to WidgetDto.
|
|
172
|
+
*
|
|
173
|
+
* @param styleOptions - Polar style options from WidgetModel.styleOptions
|
|
174
|
+
* @returns Fusion PolarWidgetStyle for the widget DTO
|
|
175
|
+
* @internal
|
|
176
|
+
*/
|
|
177
|
+
export declare function toPolarWidgetStyle(styleOptions: PolarStyleOptions): PolarWidgetStyle;
|
|
178
|
+
/**
|
|
179
|
+
* Maps SDK scatter marker size to Fusion DTO marker size style.
|
|
180
|
+
* Inverse of the extraction performed by `extractScatterChartStyleOptions`.
|
|
181
|
+
*
|
|
182
|
+
* @internal
|
|
183
|
+
*/
|
|
184
|
+
export declare function toScatterMarkerSizeStyle(markerSize?: ScatterStyleOptions['markerSize']): ScatterWidgetStyle['markerSize'];
|
|
185
|
+
/**
|
|
186
|
+
* Converts scatter chart style options to Fusion ScatterWidgetStyle DTO.
|
|
187
|
+
* Inverse of `extractScatterChartStyleOptions`.
|
|
188
|
+
*
|
|
189
|
+
* @param styleOptions - Scatter style options from WidgetModel.styleOptions
|
|
190
|
+
* @returns Fusion ScatterWidgetStyle for the widget DTO
|
|
191
|
+
* @internal
|
|
192
|
+
*/
|
|
193
|
+
export declare function toScatterWidgetStyle(styleOptions: ScatterStyleOptions): ScatterWidgetStyle;
|
|
194
|
+
/**
|
|
195
|
+
* Converts scattermap style options to Fusion ScattermapWidgetStyle DTO.
|
|
196
|
+
* Inverse of `extractScattermapChartStyleOptions`. Missing SDK fields fall back
|
|
197
|
+
* to Fusion's scattermap defaults so the emitted DTO always carries a fully
|
|
198
|
+
* populated `markers` object (Fusion assumes it is always set).
|
|
199
|
+
*
|
|
200
|
+
* @param styleOptions - Scattermap style options from WidgetModel.styleOptions
|
|
201
|
+
* @returns Fusion ScattermapWidgetStyle for the widget DTO
|
|
202
|
+
* @internal
|
|
203
|
+
*/
|
|
204
|
+
export declare function toScattermapWidgetStyle(styleOptions: ScattermapStyleOptions): ScattermapWidgetStyle;
|
|
205
|
+
/**
|
|
206
|
+
* Maps an SDK areamap `mapType` to the Fusion widget subtype used as the DTO
|
|
207
|
+
* `subtype` field. Inverse of the `subtype → mapType` mapping performed by
|
|
208
|
+
* {@link extractAreamapChartStyleOptions}. Defaults to `areamap/world` when
|
|
209
|
+
* `mapType` is unset or unrecognized — matching Fusion default.
|
|
210
|
+
*
|
|
211
|
+
* @internal
|
|
212
|
+
*/
|
|
213
|
+
export declare function toAreamapSubtype(mapType?: AreamapType): 'areamap/world' | 'areamap/usa';
|
|
214
|
+
/**
|
|
215
|
+
* Converts table style options to Fusion TableWidgetStyle DTO.
|
|
216
|
+
* Used when serializing a table widget back to WidgetDto.
|
|
217
|
+
*
|
|
218
|
+
* @param styleOptions - Table style options from WidgetModel.styleOptions
|
|
219
|
+
* @returns Fusion TableWidgetStyle for the widget DTO
|
|
220
|
+
* @internal
|
|
221
|
+
*/
|
|
222
|
+
export declare function toTableWidgetStyle(styleOptions: TableStyleOptions): TableWidgetStyle;
|
|
223
|
+
/**
|
|
224
|
+
* Converts pivot table style options to Fusion PivotWidgetStyle DTO.
|
|
225
|
+
* Inverse of {@link extractPivotTableStyleOptions}.
|
|
226
|
+
*
|
|
227
|
+
* Grand totals come from {@link PivotTableDataOptions.grandTotals} in the WidgetModel, not
|
|
228
|
+
* from `styleOptions`, so they are passed in separately.
|
|
229
|
+
*
|
|
230
|
+
* @param styleOptions - Pivot table style options from WidgetModel.styleOptions
|
|
231
|
+
* @param grandTotals - Grand totals config from WidgetModel.dataOptions.grandTotals
|
|
232
|
+
* @returns Fusion PivotWidgetStyle for the widget DTO
|
|
233
|
+
* @internal
|
|
234
|
+
*/
|
|
235
|
+
export declare function toPivotTableWidgetStyle(styleOptions: PivotTableWidgetStyleOptions, grandTotals?: PivotGrandTotals): PivotWidgetStyle;
|
|
72
236
|
export {};
|
|
@@ -236,6 +236,15 @@ export type PanelItem = {
|
|
|
236
236
|
databars?: boolean;
|
|
237
237
|
width?: number;
|
|
238
238
|
colorIndex?: number;
|
|
239
|
+
/**
|
|
240
|
+
* Marker-size range carried on the `size` panel item of a scattermap widget.
|
|
241
|
+
* Fusion reads `items[0].format.size.min/max` and overwrites `style.markers.size.min/max`
|
|
242
|
+
* at widget load — so this is the source of truth for rendered marker sizes.
|
|
243
|
+
*/
|
|
244
|
+
size?: {
|
|
245
|
+
min?: number;
|
|
246
|
+
max?: number;
|
|
247
|
+
};
|
|
239
248
|
};
|
|
240
249
|
jaql: WidgetJaql;
|
|
241
250
|
disabled?: boolean;
|
|
@@ -522,6 +531,15 @@ export type ScattermapWidgetStyle = WidgetContainerStyleOptions & {
|
|
|
522
531
|
defaultSize: number;
|
|
523
532
|
min: number;
|
|
524
533
|
max: number;
|
|
534
|
+
/**
|
|
535
|
+
* Fusion-internal UI state / slider bounds. Not read by the renderer but
|
|
536
|
+
* present on widgets produced by the Fusion wizard, so they are included
|
|
537
|
+
* when writing the DTO so round-trips keep them intact.
|
|
538
|
+
*/
|
|
539
|
+
inactive?: boolean;
|
|
540
|
+
lowest?: number;
|
|
541
|
+
highest?: number;
|
|
542
|
+
step?: number;
|
|
525
543
|
};
|
|
526
544
|
};
|
|
527
545
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WidgetDto } from '../../../../domains/widgets/components/widget-by-id/types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a debounced function that persists the navigator scroller position
|
|
4
|
+
* for the given widget via a PATCH to the dashboard API.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function useScrollerLocationSave(dashboardOid: string, widgetOid: string, currentOptions?: NonNullable<WidgetDto['options']>): (min: number, max: number) => void;
|
|
@@ -11,6 +11,15 @@ import { TextWidgetProps } from '../text-widget/types';
|
|
|
11
11
|
import { WidgetProps, WidgetType, WithCommonWidgetProps } from '../widget/types';
|
|
12
12
|
import { CsdkPluginWidgetType, FusionPluginWidgetType, FusionWidgetType, Panel, PanelItem, TextWidgetDtoStyle, WidgetStyle, WidgetSubtype } from './types.js';
|
|
13
13
|
export { mergeFilters, getFilterRelationsFromJaql, convertFilterRelationsModelToJaql, getFilterCompareId, } from '@sisense/sdk-data';
|
|
14
|
+
/**
|
|
15
|
+
* Returns `true` when a panel item's jaql represents a measure — either a base-measure
|
|
16
|
+
* aggregation (`jaql.agg`) or a calculated measure (`jaql.formula`). Mirrors Fusion's
|
|
17
|
+
* `isMeasure` dimension helper so CSDK code can evaluate the same "is measure?" checks
|
|
18
|
+
* Fusion's widget manifests rely on.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function isMeasurePanelItem(item: PanelItem): boolean;
|
|
14
23
|
/**
|
|
15
24
|
* Returns the corresponding chart type for a given widget type
|
|
16
25
|
*
|
|
@@ -15,8 +15,8 @@ import { WidgetByIdProps } from '../../../../props.js';
|
|
|
15
15
|
*
|
|
16
16
|
* <iframe
|
|
17
17
|
* src='https://csdk-playground.sisense.com/?example=fusion-assets%2Ffusion-widgets&mode=docs'
|
|
18
|
-
* width=800
|
|
19
|
-
* height=870
|
|
18
|
+
* width='800'
|
|
19
|
+
* height='870'
|
|
20
20
|
* style='border:none;'
|
|
21
21
|
* />
|
|
22
22
|
*
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WidgetProps } from '../widget/types';
|
|
2
|
+
/**
|
|
3
|
+
* Injects the navigator scroller-change callback into the widget's navigator style options.
|
|
4
|
+
* Only activates when the widget has a navigator configuration so the event handler is not
|
|
5
|
+
* registered on charts that never show the navigator.
|
|
6
|
+
*
|
|
7
|
+
* @param onScrollerChange - Invoked with navigator min/max when the scroller moves.
|
|
8
|
+
* @returns Widget props transformer for use in a `flow` pipeline.
|
|
9
|
+
*/
|
|
10
|
+
export declare function withNavigatorScrollSave(onScrollerChange: (min: number, max: number) => void): (widgetProps: WidgetProps) => WidgetProps;
|
|
@@ -79,8 +79,8 @@ export type WidgetModelSuccessState = {
|
|
|
79
79
|
*
|
|
80
80
|
* <iframe
|
|
81
81
|
* src='https://csdk-playground.sisense.com/?example=fusion-assets%2Fuse-get-widget-model&mode=docs'
|
|
82
|
-
* width=800
|
|
83
|
-
* height=870
|
|
82
|
+
* width='800'
|
|
83
|
+
* height='870'
|
|
84
84
|
* style='border:none;'
|
|
85
85
|
* />
|
|
86
86
|
*
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { AreamapChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, IndicatorChartDataOptions, PivotTableDataOptions, ScatterChartDataOptions, ScattermapChartDataOptions, TableDataOptionsInternal } from '../../../../domains/visualizations/core/chart-data-options/types.js';
|
|
2
|
+
import { Panel } from '../../../../domains/widgets/components/widget-by-id/types.js';
|
|
3
|
+
import { ScattermapStyleOptions } from '../../../../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Builds DTO panels for a line chart widget. The category panel is named `x-axis`,
|
|
6
|
+
* matching the Fusion convention for line/area charts.
|
|
7
|
+
*
|
|
8
|
+
* @param dataOptions - Cartesian chart data options from the WidgetModel
|
|
9
|
+
* @returns Fusion panels: x-axis, values, break by
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function toLinePanels(dataOptions: CartesianChartDataOptions): Panel[];
|
|
13
|
+
/**
|
|
14
|
+
* Builds DTO panels for an area chart widget. The category panel is named `x-axis`,
|
|
15
|
+
* matching the Fusion convention for line/area charts.
|
|
16
|
+
*
|
|
17
|
+
* @param dataOptions - Cartesian chart data options from the WidgetModel
|
|
18
|
+
* @returns Fusion panels: x-axis, values, break by
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function toAreaPanels(dataOptions: CartesianChartDataOptions): Panel[];
|
|
22
|
+
/**
|
|
23
|
+
* Builds DTO panels for a bar chart widget. The category panel is named `categories`.
|
|
24
|
+
*
|
|
25
|
+
* @param dataOptions - Cartesian chart data options from the WidgetModel
|
|
26
|
+
* @returns Fusion panels: categories, values, break by
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function toBarPanels(dataOptions: CartesianChartDataOptions): Panel[];
|
|
30
|
+
/**
|
|
31
|
+
* Builds DTO panels for a column chart widget. The category panel is named `categories`.
|
|
32
|
+
*
|
|
33
|
+
* @param dataOptions - Cartesian chart data options from the WidgetModel
|
|
34
|
+
* @returns Fusion panels: categories, values, break by
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export declare function toColumnPanels(dataOptions: CartesianChartDataOptions): Panel[];
|
|
38
|
+
/**
|
|
39
|
+
* Builds DTO panels for a polar chart widget. The category panel is named `categories`.
|
|
40
|
+
*
|
|
41
|
+
* @param dataOptions - Cartesian chart data options from the WidgetModel
|
|
42
|
+
* @returns Fusion panels: categories, values, break by
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare function toPolarPanels(dataOptions: CartesianChartDataOptions): Panel[];
|
|
46
|
+
/**
|
|
47
|
+
* Builds the single `columns` panel for a table widget. Attributes are emitted first,
|
|
48
|
+
* then measure columns, preserving the order produced by {@link getTableAttributesAndMeasures}.
|
|
49
|
+
*
|
|
50
|
+
* @param dataOptions - Internal table data options from the WidgetModel
|
|
51
|
+
* @returns Single-element array with the `columns` panel
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
export declare function toTablePanels(dataOptions: TableDataOptionsInternal): Panel[];
|
|
55
|
+
/**
|
|
56
|
+
* Builds DTO panels for an indicator widget. Emits `value`, `min`, `max`, and `secondary`
|
|
57
|
+
* panels in that order; a panel is emitted even when its backing list is empty so that
|
|
58
|
+
* the DTO panel order is stable across widgets.
|
|
59
|
+
*
|
|
60
|
+
* @param dataOptions - Indicator chart data options from the WidgetModel
|
|
61
|
+
* @returns Fusion panels: value, min, max, secondary
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
export declare function toIndicatorPanels(dataOptions: IndicatorChartDataOptions): Panel[];
|
|
65
|
+
/**
|
|
66
|
+
* Builds DTO panels for a pie chart widget. Category items carry `format.members` when
|
|
67
|
+
* a flat `seriesToColorMap` is present so per-slice colors round-trip.
|
|
68
|
+
*
|
|
69
|
+
* @param dataOptions - Categorical chart data options from the WidgetModel
|
|
70
|
+
* @returns Fusion panels: categories, values
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
export declare function toPiePanels(dataOptions: CategoricalChartDataOptions): Panel[];
|
|
74
|
+
/**
|
|
75
|
+
* Builds DTO panels for a funnel chart widget. Category items carry `format.members` when
|
|
76
|
+
* a flat `seriesToColorMap` is present so per-step colors round-trip.
|
|
77
|
+
*
|
|
78
|
+
* @param dataOptions - Categorical chart data options from the WidgetModel
|
|
79
|
+
* @returns Fusion panels: categories, values
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
export declare function toFunnelPanels(dataOptions: CategoricalChartDataOptions): Panel[];
|
|
83
|
+
/**
|
|
84
|
+
* Builds DTO panels for a sunburst chart widget. Each category item carries the nested
|
|
85
|
+
* `format.members` entry matching its column title so per-level colors round-trip.
|
|
86
|
+
*
|
|
87
|
+
* @param dataOptions - Categorical chart data options from the WidgetModel
|
|
88
|
+
* @returns Fusion panels: categories, values
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
export declare function toSunburstPanels(dataOptions: CategoricalChartDataOptions): Panel[];
|
|
92
|
+
/**
|
|
93
|
+
* Builds DTO panels for a treemap chart widget. The measures panel is renamed to `size`
|
|
94
|
+
* and an extra `color` panel is emitted (see {@link toTreemapColorPanel}) so Fusion can
|
|
95
|
+
* restore the per-value color assignments.
|
|
96
|
+
*
|
|
97
|
+
* @param dataOptions - Categorical chart data options from the WidgetModel
|
|
98
|
+
* @returns Fusion panels: categories, size, color
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
export declare function toTreemapPanels(dataOptions: CategoricalChartDataOptions): Panel[];
|
|
102
|
+
/**
|
|
103
|
+
* Builds DTO panels for a scatter chart widget. All panels declared by the Fusion
|
|
104
|
+
* scatter manifest are always emitted (in this exact order: x-axis, y-axis, point,
|
|
105
|
+
* Break By / Color, size), even when no column is configured — Fusion's renderer
|
|
106
|
+
* accesses panels by name and throws "the panel '<name>' was not found" when a
|
|
107
|
+
* declared panel is missing. Slots without a column are emitted with `items: []`.
|
|
108
|
+
*
|
|
109
|
+
* Slot names are remapped to Fusion's conventions: `x`→`x-axis`, `y`→`y-axis`,
|
|
110
|
+
* `breakByPoint`→`point`, `breakByColor`→`Break By / Color`, `size`→`size`.
|
|
111
|
+
*
|
|
112
|
+
* When a flat `seriesToColorMap` is present and `breakByColor` has a column, its
|
|
113
|
+
* entries are attached to the `Break By / Color` item as `format.members` so
|
|
114
|
+
* Fusion restores the per-series colors on round-trip.
|
|
115
|
+
*
|
|
116
|
+
* @param dataOptions - Scatter chart data options from the WidgetModel
|
|
117
|
+
* @returns Fusion panels in fixed order; every declared panel is always present
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
export declare function toScatterPanels(dataOptions: ScatterChartDataOptions): Panel[];
|
|
121
|
+
/**
|
|
122
|
+
* Builds DTO panels for a pivot table widget: `rows`, `columns`, and `values` (in that
|
|
123
|
+
* order). Rows and columns are treated as attributes; values as measures. Grand totals
|
|
124
|
+
* live on the style in the DTO and are written separately by
|
|
125
|
+
* {@link toPivotTableWidgetStyle}.
|
|
126
|
+
*
|
|
127
|
+
* @param dataOptions - Pivot table data options from the WidgetModel
|
|
128
|
+
* @returns Fusion panels: rows, columns, values
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
131
|
+
export declare function toPivotTablePanels(dataOptions: PivotTableDataOptions): Panel[];
|
|
132
|
+
/**
|
|
133
|
+
* Builds DTO panels for a scattermap chart widget. All panels declared by the
|
|
134
|
+
* Fusion scattermap manifest are always emitted (in this exact order: `geo`,
|
|
135
|
+
* `color`, `size`, `details`), even when a slot has no column — Fusion's
|
|
136
|
+
* renderer accesses panels by name and throws "the panel '<name>' was not found"
|
|
137
|
+
* when a declared panel is missing. Slots without a column are emitted with
|
|
138
|
+
* `items: []`.
|
|
139
|
+
*
|
|
140
|
+
* Each geo item carries its `geoLevel` when the styled column supplies one so
|
|
141
|
+
* the country/state/city level round-trips. `color` holds a single measure
|
|
142
|
+
* (range-colored in Fusion), `size` holds a single measure, `details` holds a
|
|
143
|
+
* single attribute or measure.
|
|
144
|
+
*
|
|
145
|
+
* The size panel item additionally carries `format.size = { min, max }` when
|
|
146
|
+
* marker-size options are provided. Fusion reads `items[0].format.size.min/max` at widget load and overwrites
|
|
147
|
+
* `style.markers.size.min/max`, so this item-level format is the source of truth
|
|
148
|
+
* for rendered marker sizes — emitting the style alone is not enough.
|
|
149
|
+
*
|
|
150
|
+
* @param dataOptions - Scattermap chart data options from the WidgetModel
|
|
151
|
+
* @param markerSize - Optional marker-size options from WidgetModel.styleOptions.markers.size
|
|
152
|
+
* @returns Fusion panels in fixed order; every declared panel is always present
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
155
|
+
export declare function toScattermapPanels(dataOptions: ScattermapChartDataOptions, markerSize?: NonNullable<ScattermapStyleOptions['markers']>['size']): Panel[];
|
|
156
|
+
/**
|
|
157
|
+
* Builds DTO panels for an areamap chart widget. All panels declared by the
|
|
158
|
+
* Fusion areamap manifest are always emitted (in this exact order: `geo`,
|
|
159
|
+
* `color`), even when a slot has no column — Fusion's renderer accesses panels
|
|
160
|
+
* by name and throws "the panel '<name>' was not found" when a declared panel
|
|
161
|
+
* is missing. Slots without a column are emitted with `items: []`.
|
|
162
|
+
*
|
|
163
|
+
* The geo slot is a single attribute (country/state). The color slot is a
|
|
164
|
+
* single measure; Fusion's manifest range-colors it at render time.
|
|
165
|
+
*
|
|
166
|
+
* @param dataOptions - Areamap chart data options from the WidgetModel
|
|
167
|
+
* @returns Fusion panels in fixed order; every declared panel is always present
|
|
168
|
+
* @internal
|
|
169
|
+
*/
|
|
170
|
+
export declare function toAreamapPanels(dataOptions: AreamapChartDataOptions): Panel[];
|
package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/utils.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppSettings } from '../../../../infra/app/settings/settings.js';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if widget design style is enabled.
|
|
4
|
+
* Pure function with default fallback.
|
|
5
|
+
*
|
|
6
|
+
* @param appSettings - Optional application settings
|
|
7
|
+
* @returns True if widget design is enabled
|
|
8
|
+
*/
|
|
9
|
+
export declare const isWidgetDesignEnabled: (appSettings?: AppSettings) => boolean;
|
|
@@ -4,7 +4,6 @@ import { ChartWidgetProps } from '../../../../domains/widgets/components/chart-w
|
|
|
4
4
|
import { CommonWidgetProps } from '../../../../domains/widgets/components/common-widget/types';
|
|
5
5
|
import { CustomWidgetProps } from '../../../../domains/widgets/components/custom-widget/types';
|
|
6
6
|
import { PivotTableWidgetProps } from '../../../../domains/widgets/components/pivot-table-widget/types';
|
|
7
|
-
import { TableWidgetProps } from '../../../../domains/widgets/components/table-widget/types';
|
|
8
7
|
import { TextWidgetProps } from '../../../../domains/widgets/components/text-widget/types';
|
|
9
8
|
import { WidgetDto } from '../../../../domains/widgets/components/widget-by-id/types.js';
|
|
10
9
|
import { WidgetProps } from '../../../../domains/widgets/components/widget/types';
|
|
@@ -85,19 +84,6 @@ export declare function toPivotTableProps(widgetModel: WidgetModel): PivotTableP
|
|
|
85
84
|
* Note: this method is not supported for pivot widgets.
|
|
86
85
|
*/
|
|
87
86
|
export declare function toChartWidgetProps(widgetModel: WidgetModel): ChartWidgetProps;
|
|
88
|
-
/**
|
|
89
|
-
* Translates a {@link WidgetModel} to the props for rendering a table widget.
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* ```tsx
|
|
93
|
-
* <TableWidget {...widgetModelTranslator.toTableWidgetProps(widgetModel)} />
|
|
94
|
-
* ```
|
|
95
|
-
*
|
|
96
|
-
* Note: this method is not supported for chart widgets.
|
|
97
|
-
* Use {@link toChartWidgetProps} instead for getting props for the <ChartWidget> component.
|
|
98
|
-
* @internal
|
|
99
|
-
*/
|
|
100
|
-
export declare function toTableWidgetProps(widgetModel: WidgetModel): TableWidgetProps;
|
|
101
87
|
/**
|
|
102
88
|
* Translates a {@link WidgetModel} to the props for rendering a pivot table widget.
|
|
103
89
|
*
|
|
@@ -162,6 +148,14 @@ export declare function fromWidgetDto(widgetDto: WidgetDto, themeSettings?: Comp
|
|
|
162
148
|
* @internal
|
|
163
149
|
*/
|
|
164
150
|
export declare function fromChartWidgetProps(chartWidgetProps: ChartWidgetProps): WidgetModel;
|
|
151
|
+
/**
|
|
152
|
+
* Creates a {@link WidgetModel} from a {@link PivotTableWidgetProps}.
|
|
153
|
+
*
|
|
154
|
+
* @param pivotTableWidgetProps - The PivotTableWidgetProps to be converted to a widget model
|
|
155
|
+
* @returns WidgetModel
|
|
156
|
+
* @internal
|
|
157
|
+
*/
|
|
158
|
+
export declare function fromPivotTableWidgetProps(pivotTableWidgetProps: PivotTableWidgetProps): WidgetModel;
|
|
165
159
|
/**
|
|
166
160
|
* Creates a {@link WidgetModel} from a {@link WidgetProps}.
|
|
167
161
|
*
|
|
@@ -175,7 +169,10 @@ export declare function fromWidgetProps(widgetProps: WidgetProps): WidgetModel;
|
|
|
175
169
|
*
|
|
176
170
|
* @param widgetModel - The WidgetModel to be converted to a widgetDto
|
|
177
171
|
* @param dataSource - The full datasource details
|
|
172
|
+
* @param themeSettings - The theme settings to be used for the widget design
|
|
173
|
+
* @param appSettings - The application settings to be used for the widget design
|
|
178
174
|
* @returns WidgetDto
|
|
179
|
-
*
|
|
175
|
+
*
|
|
176
|
+
* @sisenseInternal
|
|
180
177
|
*/
|
|
181
|
-
export declare function toWidgetDto(widgetModel: WidgetModel, dataSource?: JaqlDataSourceForDto): WidgetDto;
|
|
178
|
+
export declare function toWidgetDto(widgetModel: WidgetModel, dataSource?: JaqlDataSourceForDto, themeSettings?: CompleteThemeSettings, appSettings?: AppSettings): WidgetDto;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { JaqlQueryPayload } from '@sisense/sdk-query-client';
|
|
2
|
+
export interface GetNlgInsightsRequest {
|
|
3
|
+
/**
|
|
4
|
+
* @privateRemarks
|
|
5
|
+
* JAQL sent with narrative requests. Chart narratives omit pivot-only fields; pivot narratives
|
|
6
|
+
* include full `JaqlQueryPayload` fields (`format`, `grandTotals`, `queryGuid`, etc.).
|
|
7
|
+
* The SDK sets the payload `by` field to `ComposeSDK` when calling the narrative API.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
jaql: Partial<JaqlQueryPayload> & Pick<JaqlQueryPayload, 'datasource' | 'metadata'>;
|
|
11
|
+
verbosity?: 'Low' | 'High';
|
|
12
|
+
}
|
|
13
|
+
/** @internal */
|
|
14
|
+
export type NarrativeRequest = GetNlgInsightsRequest;
|
|
15
|
+
export interface NarrativeResponse {
|
|
16
|
+
data?: {
|
|
17
|
+
answer: string;
|
|
18
|
+
};
|
|
19
|
+
responseType: 'Text';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Payload for `api/v2/ai/feedback`.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export interface SendAiFeedbackRequest {
|
|
27
|
+
type: string;
|
|
28
|
+
data: object;
|
|
29
|
+
sourceId: string;
|
|
30
|
+
rating: -1 | 1;
|
|
31
|
+
}
|
|
32
|
+
export type GetNlgInsightsResponse = NarrativeResponse;
|