@sisense/sdk-ui 2.31.1 → 2.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.
- package/dist/ai.cjs +2 -2
- package/dist/ai.js +9 -9
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +5 -5
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/apply-styled-options-to-query-CE3WQwRs.cjs +1 -0
- package/dist/{apply-styled-options-to-query-lFlufwrB.js → apply-styled-options-to-query-TW3CqofD.js} +209 -207
- package/dist/{flow-DHowZLKN.cjs → const-BLmTd3gM.cjs} +1 -1
- package/dist/{flow-Cs53Uv2Y.js → const-vJfedJf9.js} +15 -15
- package/dist/execute-query-CZOWu-Fh.cjs +1 -0
- package/dist/{execute-query-4_76L7Ax.js → execute-query-D-gXk-LI.js} +908 -906
- package/dist/index-Boixy7N4.cjs +1 -0
- package/dist/{index-C2A2EHoh.cjs → index-C6ytYe3A.cjs} +1 -1
- package/dist/{index-eIOG6LP6.js → index-Ct7mA7YB.js} +1 -1
- package/dist/{index-CyVSfJ-B.js → index-D3DsBxkp.js} +22 -22
- package/dist/{index-DCYw3JUB.js → index-DrI_xqvr.js} +14 -0
- package/dist/{index-DTvxJdqZ.cjs → index-UssOwVVX.cjs} +1 -1
- package/dist/index.cjs +340 -340
- package/dist/index.js +12477 -12340
- package/dist/index.umd.js +805 -690
- package/dist/packages/sdk-ui/src/domains/dashboarding/common-filters/utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +22 -6
- package/dist/packages/sdk-ui/src/domains/query-execution/types.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/components/regular-chart/has-no-results.d.ts +12 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/components/sisense-chart/sisense-chart.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/components/sisense-chart/types.d.ts +8 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/helpers/use-chart-on-ready.d.ts +38 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/helpers/use-chart-renderer-props.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/highcharts-based-chart-renderer.d.ts +8 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/helpers/on-ready-state.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/sankey-chart-builder.d.ts +8 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/data/comparison.d.ts +22 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/data/data.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/data/index.d.ts +4 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/data/load-data.d.ts +64 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/data/value-colors.d.ts +27 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/data-options/data-options.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/data-options/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/design-options/design-options.d.ts +31 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/design-options/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/kpi-chart-builder.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/helpers.d.ts +139 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/kpi-card-styles.d.ts +154 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/kpi-card.d.ts +41 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/kpi-chart-renderer.d.ts +46 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/kpi-comparison.d.ts +60 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/kpi-sparkline.d.ts +23 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/kpi-title.d.ts +28 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/kpi-value.d.ts +55 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/on-color.d.ts +70 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/sparkline-options.d.ts +51 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/use-auto-fit-font-size.d.ts +98 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/use-element-size.d.ts +26 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/renderer/use-size-tier.d.ts +19 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/kpi-chart/types.d.ts +62 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/types.d.ts +47 -9
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/types.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/kpi-chart.d.ts +23 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/apply-on-ready-to-highcharts-options.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/types.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +108 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/chart-options-service.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/design-options.d.ts +41 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/types.d.ts +17 -3
- package/dist/packages/sdk-ui/src/domains/visualizations/core/highcharts-renderer.d.ts +7 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition-style-constants.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/types.d.ts +1 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-chart-widget-excel-download.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/types.d.ts +1 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/filter-widget/filter-widget-dropdown.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/filter-widget/types.d.ts +17 -23
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/types.d.ts +1 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget/types.d.ts +18 -4
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-dashboard-filters.d.ts +447 -447
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-panel-color-format.d.ts +8 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-filters.d.ts +56 -56
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/categorical-labels-style.d.ts +3 -3
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/series-label-affix-style.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +11 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +28 -5
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-fire-on-ready.d.ts +14 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +11 -1
- package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +9 -2
- package/dist/packages/sdk-ui/src/infra/app/helpers.d.ts +23 -2
- package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +6 -3
- package/dist/packages/sdk-ui/src/infra/app/types.d.ts +14 -1
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +14 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +28 -0
- package/dist/packages/sdk-ui/src/props.d.ts +77 -5
- package/dist/packages/sdk-ui/src/public-api/beta.d.ts +4 -0
- package/dist/packages/sdk-ui/src/types.d.ts +296 -5
- package/dist/query.cjs +1 -1
- package/dist/query.js +3 -3
- package/dist/quota-notification-CdcItYEO.cjs +665 -0
- package/dist/{quota-notification-mCXOSF0U.js → quota-notification-DJPs09UQ.js} +17392 -15866
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +15 -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 +15 -1
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +15 -1
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +17 -3
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +15 -1
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +15 -1
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +15 -1
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +15 -1
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +15 -1
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +15 -1
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +15 -1
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +15 -1
- package/dist/{types-CzQiy3kx.js → types-B60QjE1r.js} +1 -1
- package/dist/{types-pkCiWY_S.cjs → types-BAIldf5u.cjs} +1 -1
- package/dist/{use-execute-csv-query-DnTVUxCj.cjs → use-execute-csv-query-DAJqBzR5.cjs} +2 -2
- package/dist/{use-execute-csv-query-LtQrd2A4.js → use-execute-csv-query-tLJmsnwg.js} +6 -6
- package/dist/{utils-Bqaxp0gq.cjs → utils-BIAAcoFt.cjs} +12 -12
- package/dist/{utils-DHLPgrHF.js → utils-D2c9kOce.js} +1544 -1541
- package/dist/{widget-composer-CSkR-kBh.js → widget-composer-VWvON_Hi.js} +4 -4
- package/dist/{widget-composer-BUq7QhlK.cjs → widget-composer-srdW7lV4.cjs} +1 -1
- package/package.json +8 -8
- package/dist/apply-styled-options-to-query-siyJXPed.cjs +0 -1
- package/dist/execute-query-9rwu12er.cjs +0 -1
- package/dist/index-BGVJyEgp.cjs +0 -1
- package/dist/quota-notification-C49kSTz5.cjs +0 -550
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* An element's border-box size, in CSS pixels (matches `getBoundingClientRect`, which this hook
|
|
4
|
+
* measures with -- border- and padding-inclusive, not the content box).
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export type ElementSize = {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Observes the element referenced by `ref` via `ResizeObserver` and returns its current border
|
|
13
|
+
* box size (via `getBoundingClientRect`, border- and padding-inclusive), in CSS pixels. Reports
|
|
14
|
+
* `{ width: 0, height: 0 }` until the element is measured, or when no element is attached.
|
|
15
|
+
*
|
|
16
|
+
* This hook owns the KPI renderer's element-tracker/`ResizeObserver` lifecycle pattern in one
|
|
17
|
+
* place: the renderer derives the card's coarse tier from this raw size (via the pure
|
|
18
|
+
* `getSizeTier`, see `use-size-tier.ts`), and other callers consume the size directly -- e.g.
|
|
19
|
+
* sizing a Highcharts sparkline to its cell, or computing a non-circular height budget for an
|
|
20
|
+
* auto-fit sibling (whose own border-subtraction logic, see `kpi-chart-renderer.tsx`, relies on
|
|
21
|
+
* this being border-box, not content-box).
|
|
22
|
+
* @param ref - Ref to the element whose size should be observed.
|
|
23
|
+
* @returns The element's current border box size.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function useElementSize(ref: RefObject<HTMLElement | null>): ElementSize;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coarse size classification for a KPI card, used to switch layout/typography rules
|
|
3
|
+
* as the card is resized rather than continuously scaling every property.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export type KpiSizeTier = 'xs' | 'sm' | 'md' | 'lg';
|
|
7
|
+
/**
|
|
8
|
+
* Classifies a width/height pair into a coarse {@link KpiSizeTier}.
|
|
9
|
+
*
|
|
10
|
+
* Width and height are classified independently against their own thresholds, and the
|
|
11
|
+
* smaller-tier axis wins -- a card that's wide but short is still capped to the smaller
|
|
12
|
+
* tier. For example, 600x100 is `'xs'` (not `'lg'`) because the height falls below the
|
|
13
|
+
* `'xs'` floor even though the width alone would qualify for `'lg'`.
|
|
14
|
+
* @param width - Card width in CSS pixels.
|
|
15
|
+
* @param height - Card height in CSS pixels.
|
|
16
|
+
* @returns The size tier: `'xs'`, `'sm'`, `'md'`, or `'lg'`.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function getSizeTier(width: number, height: number): KpiSizeTier;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ChartData } from '../../../../../../domains/visualizations/core/chart-data/types';
|
|
2
|
+
import { NumberFormatConfig } from '../../../../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Computed comparison data for a KPI chart, as resolved by the data layer.
|
|
5
|
+
* Mirrors the public {@link KpiComparison} union, with all math and coloring resolved.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export type KpiComparisonData = {
|
|
10
|
+
type: 'previous-period';
|
|
11
|
+
baseline: number;
|
|
12
|
+
deltaValue: number;
|
|
13
|
+
deltaPercent?: number;
|
|
14
|
+
labelKey: string;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'delta';
|
|
17
|
+
baseline: number;
|
|
18
|
+
deltaValue: number;
|
|
19
|
+
deltaPercent?: number;
|
|
20
|
+
label: string;
|
|
21
|
+
color?: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'target';
|
|
24
|
+
target: number;
|
|
25
|
+
percentOfTarget?: number;
|
|
26
|
+
toGo: number;
|
|
27
|
+
label: string;
|
|
28
|
+
color?: string;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'value';
|
|
31
|
+
value: number;
|
|
32
|
+
label: string;
|
|
33
|
+
color?: string;
|
|
34
|
+
numberFormatConfig?: NumberFormatConfig;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Processed chart data ready for the KPI renderer.
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export type KpiChartData = {
|
|
42
|
+
type: 'kpi';
|
|
43
|
+
/** Whether the query returned any rows; false triggers the no-results overlay. */
|
|
44
|
+
hasRows: boolean;
|
|
45
|
+
value?: number;
|
|
46
|
+
valueTitle: string;
|
|
47
|
+
valueColor?: string;
|
|
48
|
+
/** Last date bucket as epoch milliseconds — shown in the header when the headline is the last bucket. */
|
|
49
|
+
valuePeriodMs?: number;
|
|
50
|
+
numberFormatConfig?: NumberFormatConfig;
|
|
51
|
+
comparison?: KpiComparisonData;
|
|
52
|
+
/** `null` points are gaps in the sparkline, never rendered as zero. */
|
|
53
|
+
sparklinePoints?: {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number | null;
|
|
56
|
+
}[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Checks whether the given generic chart data is shaped as {@link KpiChartData}.
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export declare const isKpiChartData: (chartData: ChartData) => chartData is KpiChartData;
|
|
@@ -6,29 +6,52 @@ import { QueryDescription } from '../../../../../domains/query-execution/core/ex
|
|
|
6
6
|
import type { ChartRendererProps } from '../../../../../domains/visualizations/components/chart';
|
|
7
7
|
import { ScattermapProps } from '../../../../../domains/visualizations/components/chart/components/scattermap/scattermap';
|
|
8
8
|
import { AreamapProps } from '../../../../../domains/visualizations/components/chart/restructured-charts/areamap-chart/renderer';
|
|
9
|
-
import { AreamapChartDataOptions, AreamapChartDataOptionsInternal, CalendarHeatmapChartDataOptions, CalendarHeatmapChartDataOptionsInternal, CartesianChartDataOptions, CartesianChartDataOptionsInternal, CategoricalChartDataOptions, CategoricalChartDataOptionsInternal, ChartDataOptionsInternal, SankeyChartDataOptions, SankeyChartDataOptionsInternal, ScattermapChartDataOptions, ScattermapChartDataOptionsInternal } from '../../../../../domains/visualizations/core/chart-data-options/types';
|
|
9
|
+
import { AreamapChartDataOptions, AreamapChartDataOptionsInternal, CalendarHeatmapChartDataOptions, CalendarHeatmapChartDataOptionsInternal, CartesianChartDataOptions, CartesianChartDataOptionsInternal, CategoricalChartDataOptions, CategoricalChartDataOptionsInternal, ChartDataOptionsInternal, KpiChartDataOptions, KpiChartDataOptionsInternal, SankeyChartDataOptions, SankeyChartDataOptionsInternal, ScattermapChartDataOptions, ScattermapChartDataOptionsInternal } from '../../../../../domains/visualizations/core/chart-data-options/types';
|
|
10
10
|
import { DataTable } from '../../../../../domains/visualizations/core/chart-data-processor/table-processor';
|
|
11
|
-
import type { CartesianChartData, CategoricalChartData, ScattermapChartData } from '../../../../../domains/visualizations/core/chart-data/types';
|
|
11
|
+
import type { CartesianChartData, CategoricalChartData, ChartData, ScattermapChartData } from '../../../../../domains/visualizations/core/chart-data/types';
|
|
12
12
|
import { DesignOptions } from '../../../../../domains/visualizations/core/chart-options-processor/translations/types';
|
|
13
13
|
import { type ClientApplication } from '../../../../../infra/app/types';
|
|
14
|
-
import type { AreamapStyleOptions, AreaStyleOptions, CalendarHeatmapStyleOptions, ChartDataOptions, ChartStyleOptions, FunnelStyleOptions, LineStyleOptions, PieStyleOptions, PolarStyleOptions, SankeyStyleOptions, ScattermapStyleOptions, StackableStyleOptions, StreamgraphStyleOptions, SunburstStyleOptions, TreemapStyleOptions } from '../../../../../types';
|
|
14
|
+
import type { AreamapStyleOptions, AreaStyleOptions, CalendarHeatmapStyleOptions, ChartDataOptions, ChartStyleOptions, FunnelStyleOptions, KpiStyleOptions, LineStyleOptions, PieStyleOptions, PolarStyleOptions, SankeyStyleOptions, ScattermapStyleOptions, StackableStyleOptions, StreamgraphStyleOptions, SunburstStyleOptions, TreemapStyleOptions } from '../../../../../types';
|
|
15
15
|
import { AreamapData } from './areamap-chart/types';
|
|
16
16
|
import { CalendarHeatmapChartData } from './highchart-based-charts/calendar-heatmap-chart/data';
|
|
17
17
|
import { HighchartsBasedChartRendererProps } from './highchart-based-charts/highcharts-based-chart-renderer/highcharts-based-chart-renderer';
|
|
18
18
|
import { SankeyChartData } from './highchart-based-charts/sankey-chart/types';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export type
|
|
22
|
-
export type
|
|
19
|
+
import { KpiChartRendererProps } from './kpi-chart/renderer/index';
|
|
20
|
+
import { KpiChartData } from './kpi-chart/types';
|
|
21
|
+
export type SupportedChartType = 'areamap' | 'column' | 'bar' | 'line' | 'area' | 'polar' | 'pie' | 'funnel' | 'calendar-heatmap' | 'kpi' | 'treemap' | 'sunburst' | 'streamgraph' | 'sankey';
|
|
22
|
+
export type TypedChartDataOptions<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapChartDataOptions : CT extends 'scattermap' ? ScattermapChartDataOptions : CT extends 'pie' | 'funnel' | 'treemap' | 'sunburst' ? CategoricalChartDataOptions : CT extends 'column' | 'bar' | 'line' | 'area' | 'polar' | 'streamgraph' ? CartesianChartDataOptions : CT extends 'calendar-heatmap' ? CalendarHeatmapChartDataOptions : CT extends 'sankey' ? SankeyChartDataOptions : CT extends 'kpi' ? KpiChartDataOptions : never;
|
|
23
|
+
export type TypedDataOptionsInternal<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapChartDataOptionsInternal : CT extends 'scattermap' ? ScattermapChartDataOptionsInternal : CT extends 'pie' | 'funnel' | 'treemap' | 'sunburst' ? CategoricalChartDataOptionsInternal : CT extends 'column' | 'bar' | 'line' | 'area' | 'polar' | 'streamgraph' ? CartesianChartDataOptionsInternal : CT extends 'calendar-heatmap' ? CalendarHeatmapChartDataOptionsInternal : CT extends 'sankey' ? SankeyChartDataOptionsInternal : CT extends 'kpi' ? KpiChartDataOptionsInternal : never;
|
|
24
|
+
export type TypedChartStyleOptions<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapStyleOptions : CT extends 'scattermap' ? ScattermapStyleOptions : CT extends 'pie' ? PieStyleOptions : CT extends 'funnel' ? FunnelStyleOptions : CT extends 'treemap' ? TreemapStyleOptions : CT extends 'sunburst' ? SunburstStyleOptions : CT extends 'column' | 'bar' ? StackableStyleOptions : CT extends 'line' ? LineStyleOptions : CT extends 'area' ? AreaStyleOptions : CT extends 'polar' ? PolarStyleOptions : CT extends 'calendar-heatmap' ? CalendarHeatmapStyleOptions : CT extends 'kpi' ? KpiStyleOptions : CT extends 'streamgraph' ? StreamgraphStyleOptions : CT extends 'sankey' ? SankeyStyleOptions : never;
|
|
23
25
|
export type TypedDesignOptions<CT extends SupportedChartType> = DesignOptions<CT>;
|
|
24
|
-
export type TypedChartData<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapData : CT extends 'scattermap' ? ScattermapChartData : CT extends 'pie' | 'funnel' | 'treemap' | 'sunburst' ? CategoricalChartData : CT extends 'column' | 'bar' | 'line' | 'area' | 'polar' | 'streamgraph' ? CartesianChartData : CT extends 'calendar-heatmap' ? CalendarHeatmapChartData : CT extends 'sankey' ? SankeyChartData : never;
|
|
26
|
+
export type TypedChartData<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapData : CT extends 'scattermap' ? ScattermapChartData : CT extends 'pie' | 'funnel' | 'treemap' | 'sunburst' ? CategoricalChartData : CT extends 'column' | 'bar' | 'line' | 'area' | 'polar' | 'streamgraph' ? CartesianChartData : CT extends 'calendar-heatmap' ? CalendarHeatmapChartData : CT extends 'sankey' ? SankeyChartData : CT extends 'kpi' ? KpiChartData : never;
|
|
25
27
|
export type TypedLoadDataFunction<CT extends SupportedChartType> = (options: {
|
|
26
28
|
app: ClientApplication;
|
|
27
29
|
chartDataOptionsInternal: TypedDataOptionsInternal<CT>;
|
|
28
30
|
queryDescription: QueryDescription;
|
|
29
31
|
executionConfig?: QueryExecutionConfig;
|
|
30
32
|
}) => Promise<QueryResultData>;
|
|
31
|
-
export type TypedChartRendererProps<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapProps : CT extends 'scattermap' ? ScattermapProps : CT extends 'column' | 'bar' | 'line' | 'area' | 'polar' | 'pie' | 'funnel' | 'calendar-heatmap' | 'treemap' | 'sunburst' | 'streamgraph' | 'sankey' ? HighchartsBasedChartRendererProps<CT> : never;
|
|
33
|
+
export type TypedChartRendererProps<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapProps : CT extends 'scattermap' ? ScattermapProps : CT extends 'column' | 'bar' | 'line' | 'area' | 'polar' | 'pie' | 'funnel' | 'calendar-heatmap' | 'treemap' | 'sunburst' | 'streamgraph' | 'sankey' ? HighchartsBasedChartRendererProps<CT> : CT extends 'kpi' ? KpiChartRendererProps : never;
|
|
34
|
+
/**
|
|
35
|
+
* State signals passed to a chart's {@link ChartBuilder.onReady} readiness
|
|
36
|
+
* predicate to compute rising-edge readiness for the consumer `onReady`
|
|
37
|
+
* callback (Fusion `domready` / PDF).
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export type ChartOnReadyStateInput = {
|
|
42
|
+
/** Whether a query / data sync is in progress. */
|
|
43
|
+
isLoading: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the active renderer has signaled paint for the current cycle
|
|
46
|
+
* (`ChartRendererProps.onReady`, e.g. Highcharts `chart.events.load` /
|
|
47
|
+
* `render`).
|
|
48
|
+
*/
|
|
49
|
+
rendererPainted: boolean;
|
|
50
|
+
/** Whether data options have no attributes or measures. */
|
|
51
|
+
hasNoDimensions: boolean;
|
|
52
|
+
/** Prepared chart data, or `null` while unavailable. */
|
|
53
|
+
chartData: ChartData | null;
|
|
54
|
+
};
|
|
32
55
|
/**
|
|
33
56
|
* Chart builder interface.
|
|
34
57
|
*/
|
|
@@ -107,4 +130,19 @@ export interface ChartBuilder<CT extends SupportedChartType = SupportedChartType
|
|
|
107
130
|
*/
|
|
108
131
|
isCorrectRendererProps: (props: ChartRendererProps) => props is TypedChartRendererProps<CT>;
|
|
109
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* Optional consumer `onReady` (Fusion `domready` / PDF) readiness contract.
|
|
135
|
+
*
|
|
136
|
+
* When present, RegularChart wires the renderer's paint signal
|
|
137
|
+
* (`ChartRendererProps.onReady`) into this predicate and fires the consumer
|
|
138
|
+
* `onReady` callback on each rising edge of readiness. Chart types that omit
|
|
139
|
+
* this field do not participate in the `onReady` contract.
|
|
140
|
+
*/
|
|
141
|
+
onReady?: {
|
|
142
|
+
/**
|
|
143
|
+
* Computes whether the consumer `onReady` callback should fire for the
|
|
144
|
+
* current cycle, given the loading, paint, and data signals.
|
|
145
|
+
*/
|
|
146
|
+
isReadyForOnReady: (state: ChartOnReadyStateInput) => boolean;
|
|
147
|
+
};
|
|
110
148
|
}
|
|
@@ -19,4 +19,13 @@ export type ChartRendererProps = {
|
|
|
19
19
|
onDataPointContextMenu?: ChartProps['onDataPointContextMenu'];
|
|
20
20
|
onDataPointsSelected?: ChartProps['onDataPointsSelected'];
|
|
21
21
|
onBeforeRender?: ChartProps['onBeforeRender'];
|
|
22
|
+
/**
|
|
23
|
+
* Paint signal from the active renderer after it finishes painting.
|
|
24
|
+
* Used for Sankey `onReady` (Fusion `domready`): RegularChart stores the
|
|
25
|
+
* flag and fires the consumer callback via `useFireOnReady`. Highcharts
|
|
26
|
+
* wires this to `chart.events.load` / `render`.
|
|
27
|
+
*
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
onReady?: ChartProps['onReady'];
|
|
22
31
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { KpiChartProps } from '../../../props';
|
|
3
|
+
/**
|
|
4
|
+
* A React component that displays a KPI card: primary value with an optional
|
|
5
|
+
* sparkline trend and a comparison readout — previous period, another measure,
|
|
6
|
+
* or a target.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <KpiChart
|
|
11
|
+
* dataSet={DM.DataSource}
|
|
12
|
+
* dataOptions={{
|
|
13
|
+
* value: measureFactory.sum(DM.Commerce.Revenue),
|
|
14
|
+
* trend: DM.Commerce.Date.Months,
|
|
15
|
+
* }}
|
|
16
|
+
* />
|
|
17
|
+
* ```
|
|
18
|
+
* @param props - KPI chart properties
|
|
19
|
+
* @returns KPI Chart component
|
|
20
|
+
* @group Charts
|
|
21
|
+
* @beta
|
|
22
|
+
*/
|
|
23
|
+
export declare const KpiChart: import("react").FunctionComponent<KpiChartProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HighchartsOptionsInternal } from './chart-options-processor/chart-options-service.js';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps `chart.events.load` / `render` so `onReady` fires after Highcharts paints,
|
|
4
|
+
* while preserving any existing handlers.
|
|
5
|
+
*
|
|
6
|
+
* @param options - Highcharts options to augment.
|
|
7
|
+
* @param onReady - Callback invoked after each preserved load/render handler.
|
|
8
|
+
* @returns Options with load/render handlers that also call `onReady`.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function applyOnReadyToHighchartsOptions(options: HighchartsOptionsInternal, onReady: () => void): HighchartsOptionsInternal;
|
|
@@ -2,6 +2,7 @@ import { Coordinates } from '../../../../domains/visualizations/components/chart
|
|
|
2
2
|
import { AreamapData } from '../../../../domains/visualizations/components/chart/restructured-charts/areamap-chart/types';
|
|
3
3
|
import { CalendarHeatmapChartData } from '../../../../domains/visualizations/components/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/data';
|
|
4
4
|
import { SankeyChartData } from '../../../../domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/types';
|
|
5
|
+
import { KpiChartData } from '../../../../domains/visualizations/components/chart/restructured-charts/kpi-chart/types';
|
|
5
6
|
import { ComparableData, Value } from '../../../../domains/visualizations/core/chart-data-processor/table-processor';
|
|
6
7
|
import { IndicatorChartType } from '../../../../domains/visualizations/core/chart-options-processor/translations/types';
|
|
7
8
|
import { NumberFormatConfig } from '../../../../types';
|
|
@@ -142,5 +143,5 @@ export type BoxplotChartData = {
|
|
|
142
143
|
*
|
|
143
144
|
* @internal
|
|
144
145
|
*/
|
|
145
|
-
export type ChartData = CartesianChartData | CategoricalChartData | ScatterChartData | IndicatorChartData | BoxplotChartData | AreamapData | ScattermapChartData | RangeChartData | CalendarHeatmapChartData | SankeyChartData;
|
|
146
|
+
export type ChartData = CartesianChartData | CategoricalChartData | ScatterChartData | IndicatorChartData | BoxplotChartData | AreamapData | ScattermapChartData | RangeChartData | CalendarHeatmapChartData | SankeyChartData | KpiChartData;
|
|
146
147
|
export {};
|
|
@@ -570,7 +570,7 @@ export type CommonDataOptions = ChartDataOptions | PivotTableDataOptions | Gener
|
|
|
570
570
|
/**
|
|
571
571
|
* Configuration for how to query aggregate data and assigning data to chart encodings of regular charts.
|
|
572
572
|
*/
|
|
573
|
-
export type RegularChartDataOptions = CartesianChartDataOptions | CategoricalChartDataOptions | ScatterChartDataOptions | IndicatorChartDataOptions | BoxplotChartDataOptions | BoxplotChartCustomDataOptions | AreamapChartDataOptions | ScattermapChartDataOptions | RangeChartDataOptions | CalendarHeatmapChartDataOptions | SankeyChartDataOptions;
|
|
573
|
+
export type RegularChartDataOptions = CartesianChartDataOptions | CategoricalChartDataOptions | ScatterChartDataOptions | IndicatorChartDataOptions | BoxplotChartDataOptions | BoxplotChartCustomDataOptions | AreamapChartDataOptions | ScattermapChartDataOptions | RangeChartDataOptions | CalendarHeatmapChartDataOptions | SankeyChartDataOptions | KpiChartDataOptions;
|
|
574
574
|
/** @internal */
|
|
575
575
|
export interface CartesianChartDataOptionsInternal {
|
|
576
576
|
x: StyledColumn[];
|
|
@@ -644,7 +644,7 @@ export interface PivotTableDataOptionsInternal {
|
|
|
644
644
|
grandTotals?: PivotGrandTotals;
|
|
645
645
|
}
|
|
646
646
|
/** @internal */
|
|
647
|
-
export type ChartDataOptionsInternal = CartesianChartDataOptionsInternal | CategoricalChartDataOptionsInternal | ScatterChartDataOptionsInternal | IndicatorChartDataOptionsInternal | BoxplotChartDataOptionsInternal | AreamapChartDataOptionsInternal | ScattermapChartDataOptionsInternal | RangeChartDataOptionsInternal | CalendarHeatmapChartDataOptionsInternal | SankeyChartDataOptionsInternal;
|
|
647
|
+
export type ChartDataOptionsInternal = CartesianChartDataOptionsInternal | CategoricalChartDataOptionsInternal | ScatterChartDataOptionsInternal | IndicatorChartDataOptionsInternal | BoxplotChartDataOptionsInternal | AreamapChartDataOptionsInternal | ScattermapChartDataOptionsInternal | RangeChartDataOptionsInternal | CalendarHeatmapChartDataOptionsInternal | SankeyChartDataOptionsInternal | KpiChartDataOptionsInternal;
|
|
648
648
|
/** @internal */
|
|
649
649
|
export type IndicatorChartDataOptionsInternal = {
|
|
650
650
|
value?: StyledMeasureColumn[];
|
|
@@ -714,3 +714,109 @@ export type SankeyChartDataOptionsInternal = {
|
|
|
714
714
|
value: StyledMeasureColumn;
|
|
715
715
|
seriesToColorMap?: ValueToColorMap | MultiColumnValueToColorMap;
|
|
716
716
|
};
|
|
717
|
+
/**
|
|
718
|
+
* Which number becomes the KPI headline when {@link KpiChartDataOptions.trend} is set.
|
|
719
|
+
* 'last' — the last date bucket; 'total' — aggregate over the whole period
|
|
720
|
+
* (computed by a separate ungrouped query — correct SQL semantics).
|
|
721
|
+
*
|
|
722
|
+
* @beta
|
|
723
|
+
*/
|
|
724
|
+
export type KpiValueMode = 'last' | 'total';
|
|
725
|
+
/**
|
|
726
|
+
* What the KPI headline value is compared against.
|
|
727
|
+
* Each variant carries its own baseline, so invalid combinations are unrepresentable.
|
|
728
|
+
*
|
|
729
|
+
* @beta
|
|
730
|
+
*/
|
|
731
|
+
export type KpiComparison =
|
|
732
|
+
/** Compares the last trend bucket against the previous one. Requires `trend`. */
|
|
733
|
+
{
|
|
734
|
+
type: 'previous-period';
|
|
735
|
+
}
|
|
736
|
+
/** Compares against a second measure: delta and percent change, up/down arrow. */
|
|
737
|
+
| {
|
|
738
|
+
type: 'delta';
|
|
739
|
+
value: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
740
|
+
}
|
|
741
|
+
/** Treats the baseline as a goal: “82% of goal, $12K to go”. Fixed number or measure. */
|
|
742
|
+
| {
|
|
743
|
+
type: 'target';
|
|
744
|
+
target: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn | number;
|
|
745
|
+
}
|
|
746
|
+
/** Shows a plain second value next to the headline; no delta, no coloring. */
|
|
747
|
+
| {
|
|
748
|
+
type: 'value';
|
|
749
|
+
value: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
750
|
+
};
|
|
751
|
+
/**
|
|
752
|
+
* Configuration for how to query aggregate data and assign data to a
|
|
753
|
+
* {@link KpiChartType | KPI chart}.
|
|
754
|
+
*
|
|
755
|
+
* @beta
|
|
756
|
+
*
|
|
757
|
+
* @example
|
|
758
|
+
* ```tsx
|
|
759
|
+
* <KpiChart
|
|
760
|
+
* dataSet={DM.DataSource}
|
|
761
|
+
* dataOptions={{
|
|
762
|
+
* value: measureFactory.sum(DM.Commerce.Revenue),
|
|
763
|
+
* trend: DM.Commerce.Date.Months,
|
|
764
|
+
* comparison: { type: 'previous-period' },
|
|
765
|
+
* }}
|
|
766
|
+
* />
|
|
767
|
+
* ```
|
|
768
|
+
*/
|
|
769
|
+
export interface KpiChartDataOptions {
|
|
770
|
+
/** Primary measure — the headline KPI value. Conditional coloring via `color` on the styled measure. */
|
|
771
|
+
value: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
772
|
+
/**
|
|
773
|
+
* Sets the card's trend axis (typically a date dimension): enables the sparkline, the
|
|
774
|
+
* current-period caption, the 'previous-period' comparison, and the `valueMode` semantics.
|
|
775
|
+
* Granularity comes from the column.
|
|
776
|
+
*
|
|
777
|
+
* @example
|
|
778
|
+
* ```ts
|
|
779
|
+
* trend: DM.Commerce.Date.Months
|
|
780
|
+
* ```
|
|
781
|
+
*/
|
|
782
|
+
trend?: Column | StyledColumn;
|
|
783
|
+
/**
|
|
784
|
+
* Selects which number is the headline when `trend` is set.
|
|
785
|
+
*
|
|
786
|
+
* @example
|
|
787
|
+
* ```ts
|
|
788
|
+
* valueMode: 'total' // aggregate over the whole period instead of the last trend bucket
|
|
789
|
+
* ```
|
|
790
|
+
* @defaultValue 'last'
|
|
791
|
+
*/
|
|
792
|
+
valueMode?: KpiValueMode;
|
|
793
|
+
/**
|
|
794
|
+
* Configures what the headline is compared against.
|
|
795
|
+
*
|
|
796
|
+
* @example
|
|
797
|
+
* ```ts
|
|
798
|
+
* comparison: { type: 'target', target: 10000 }
|
|
799
|
+
* ```
|
|
800
|
+
*/
|
|
801
|
+
comparison?: KpiComparison;
|
|
802
|
+
}
|
|
803
|
+
/** @internal */
|
|
804
|
+
export type KpiComparisonInternal = {
|
|
805
|
+
type: 'previous-period';
|
|
806
|
+
} | {
|
|
807
|
+
type: 'delta';
|
|
808
|
+
value: StyledMeasureColumn;
|
|
809
|
+
} | {
|
|
810
|
+
type: 'target';
|
|
811
|
+
target: StyledMeasureColumn | number;
|
|
812
|
+
} | {
|
|
813
|
+
type: 'value';
|
|
814
|
+
value: StyledMeasureColumn;
|
|
815
|
+
};
|
|
816
|
+
/** @internal */
|
|
817
|
+
export type KpiChartDataOptionsInternal = {
|
|
818
|
+
value: StyledMeasureColumn;
|
|
819
|
+
trend?: StyledColumn;
|
|
820
|
+
valueMode: KpiValueMode;
|
|
821
|
+
comparison?: KpiComparisonInternal;
|
|
822
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CalendarDayOfWeek } from '../../../../../domains/visualizations/components/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/utils';
|
|
2
|
-
import { CalendarHeatmapSubtype, CalendarHeatmapViewType, Convolution, FunnelSeriesLabels, LegendOptions, LineOptions, PieSeriesLabels, SankeyStyleOptions, ScattermapMarkers, SeriesLabels, SunburstStyleOptions, TotalLabels, TreemapStyleOptions } from '../../../../../types';
|
|
2
|
+
import { CalendarHeatmapSubtype, CalendarHeatmapViewType, Convolution, FunnelSeriesLabels, KpiIconCondition, LegendOptions, LineOptions, PieSeriesLabels, SankeyStyleOptions, ScattermapMarkers, SeriesLabels, SunburstStyleOptions, TotalLabels, TreemapStyleOptions } from '../../../../../types';
|
|
3
|
+
import { DataColorOptions } from '../../chart-data/data-coloring';
|
|
3
4
|
import { Axis } from './axis-section';
|
|
4
5
|
import { FunnelDirection, FunnelSize, FunnelType } from './funnel-plot-options';
|
|
5
6
|
import { Marker } from './marker-section';
|
|
@@ -83,6 +84,44 @@ export type CalendarHeatmapChartDesignOptions = BaseDesignOptionsType & {
|
|
|
83
84
|
startMonth?: Date;
|
|
84
85
|
};
|
|
85
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* Resolved, internal-use design options for a KPI chart -- the translated form of
|
|
89
|
+
* {@link KpiStyleOptions} (see `translateKpiStyleOptionsToDesignOptions`), consumed directly by
|
|
90
|
+
* `KpiChartRenderer`.
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
export type KpiChartDesignOptions = BaseDesignOptionsType & {
|
|
94
|
+
width?: number;
|
|
95
|
+
height?: number;
|
|
96
|
+
layout: 'standard' | 'big-comparison';
|
|
97
|
+
value: {
|
|
98
|
+
/** `'auto'` for auto-fit sizing, or a fixed font size in px. */
|
|
99
|
+
textSize: 'auto' | number;
|
|
100
|
+
noDataText?: string;
|
|
101
|
+
conditionalIcons?: KpiIconCondition[];
|
|
102
|
+
};
|
|
103
|
+
title: {
|
|
104
|
+
enabled: boolean;
|
|
105
|
+
text?: string;
|
|
106
|
+
};
|
|
107
|
+
card: {
|
|
108
|
+
backgroundColor?: string;
|
|
109
|
+
textAlign: 'left' | 'center' | 'right';
|
|
110
|
+
showBorder: boolean;
|
|
111
|
+
cornerRadius: number;
|
|
112
|
+
};
|
|
113
|
+
sparkline: {
|
|
114
|
+
enabled: boolean;
|
|
115
|
+
chartType: 'line' | 'spline' | 'area' | 'column';
|
|
116
|
+
};
|
|
117
|
+
comparison: {
|
|
118
|
+
display: 'percent' | 'value' | 'both';
|
|
119
|
+
label?: string;
|
|
120
|
+
color?: DataColorOptions;
|
|
121
|
+
showIcon: boolean;
|
|
122
|
+
conditionalIcons?: KpiIconCondition[];
|
|
123
|
+
};
|
|
124
|
+
};
|
|
86
125
|
export type PolarType = 'line' | 'area' | 'column';
|
|
87
126
|
export type PolarChartDesignOptions = CartesianChartDesignOptions & {
|
|
88
127
|
polarType: PolarType;
|
|
@@ -110,6 +149,7 @@ export type SankeyChartDesignOptions = BaseDesignOptionsType & {
|
|
|
110
149
|
linkOpacity?: SankeyStyleOptions['linkOpacity'];
|
|
111
150
|
nodeWidth?: SankeyStyleOptions['nodeWidth'];
|
|
112
151
|
nodePadding?: SankeyStyleOptions['nodePadding'];
|
|
152
|
+
minLinkWidth?: SankeyStyleOptions['minLinkWidth'];
|
|
113
153
|
nodeAlignment?: SankeyStyleOptions['nodeAlignment'];
|
|
114
154
|
};
|
|
115
155
|
export type ScatterChartDesignOptions = BaseDesignOptionsType & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AreamapChartDesignOptions } from '../../../../../domains/visualizations/components/chart/restructured-charts/areamap-chart/types';
|
|
2
2
|
import { StreamgraphChartDesignOptions } from '../../../../../domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/stackable/streamgraph-chart/types';
|
|
3
3
|
import { ChartType } from '../../../../../types';
|
|
4
|
-
import { AreaChartDesignOptions, AreaRangeChartDesignOptions, BarChartDesignOptions, BaseDesignOptionsType, BoxplotChartDesignOptions, CalendarHeatmapChartDesignOptions, ColumnChartDesignOptions, FunnelChartDesignOptions, IndicatorChartDesignOptions, LineChartDesignOptions, PieChartDesignOptions, PolarChartDesignOptions, SankeyChartDesignOptions, ScatterChartDesignOptions, ScattermapChartDesignOptions, SunburstChartDesignOptions, TreemapChartDesignOptions } from './design-options';
|
|
4
|
+
import { AreaChartDesignOptions, AreaRangeChartDesignOptions, BarChartDesignOptions, BaseDesignOptionsType, BoxplotChartDesignOptions, CalendarHeatmapChartDesignOptions, ColumnChartDesignOptions, FunnelChartDesignOptions, IndicatorChartDesignOptions, KpiChartDesignOptions, LineChartDesignOptions, PieChartDesignOptions, PolarChartDesignOptions, SankeyChartDesignOptions, ScatterChartDesignOptions, ScattermapChartDesignOptions, SunburstChartDesignOptions, TreemapChartDesignOptions } from './design-options';
|
|
5
5
|
/**
|
|
6
6
|
* Style configuration for text elements in charts and UI components.
|
|
7
7
|
* Defines the visual appearance and behavior of text rendering.
|
|
@@ -81,6 +81,20 @@ export type ImageChartType = (typeof IMAGE_CHART_TYPES)[number];
|
|
|
81
81
|
export declare const SCATTERMAP_CHART_TYPES: readonly ["scattermap"];
|
|
82
82
|
/** Scattermap chart types @expandType */
|
|
83
83
|
export type ScattermapChartType = (typeof SCATTERMAP_CHART_TYPES)[number];
|
|
84
|
+
/** Chart type strings recognized as KPI charts. @internal */
|
|
85
|
+
export declare const KPI_CHART_TYPES: readonly ["kpi"];
|
|
86
|
+
/**
|
|
87
|
+
* KPI chart types.
|
|
88
|
+
*
|
|
89
|
+
* @expandType
|
|
90
|
+
* @beta
|
|
91
|
+
*/
|
|
92
|
+
export type KpiChartType = (typeof KPI_CHART_TYPES)[number];
|
|
93
|
+
/**
|
|
94
|
+
* Checks whether the given chart type is a {@link KpiChartType}.
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
export declare const isKpi: (chartType: ChartType) => chartType is "kpi";
|
|
84
98
|
export declare const CALENDAR_HEATMAP_CHART_TYPES: readonly ["calendar-heatmap"];
|
|
85
99
|
/**
|
|
86
100
|
* Calendar heatmap chart types
|
|
@@ -103,7 +117,7 @@ export type ChartDataType = 'cartesian' | 'categorical' | 'scatter' | 'table' |
|
|
|
103
117
|
/**
|
|
104
118
|
* Design options for a specific chart type
|
|
105
119
|
*/
|
|
106
|
-
export type DesignOptions<SpecificChartType extends ChartType = ChartType> = SpecificChartType extends 'line' ? LineChartDesignOptions : SpecificChartType extends 'area' ? AreaChartDesignOptions : SpecificChartType extends 'bar' ? BarChartDesignOptions : SpecificChartType extends 'column' ? ColumnChartDesignOptions : SpecificChartType extends 'streamgraph' ? StreamgraphChartDesignOptions : SpecificChartType extends 'pie' ? PieChartDesignOptions : SpecificChartType extends 'funnel' ? FunnelChartDesignOptions : SpecificChartType extends 'polar' ? PolarChartDesignOptions : SpecificChartType extends 'indicator' ? IndicatorChartDesignOptions : SpecificChartType extends 'scatter' ? ScatterChartDesignOptions : SpecificChartType extends 'treemap' ? TreemapChartDesignOptions : SpecificChartType extends 'sunburst' ? SunburstChartDesignOptions : SpecificChartType extends 'boxplot' ? BoxplotChartDesignOptions : SpecificChartType extends 'areamap' ? AreamapChartDesignOptions : SpecificChartType extends 'scattermap' ? ScattermapChartDesignOptions : SpecificChartType extends 'calendar-heatmap' ? CalendarHeatmapChartDesignOptions : SpecificChartType extends 'arearange' ? AreaRangeChartDesignOptions : SpecificChartType extends 'sankey' ? SankeyChartDesignOptions : never;
|
|
120
|
+
export type DesignOptions<SpecificChartType extends ChartType = ChartType> = SpecificChartType extends 'line' ? LineChartDesignOptions : SpecificChartType extends 'area' ? AreaChartDesignOptions : SpecificChartType extends 'bar' ? BarChartDesignOptions : SpecificChartType extends 'column' ? ColumnChartDesignOptions : SpecificChartType extends 'streamgraph' ? StreamgraphChartDesignOptions : SpecificChartType extends 'pie' ? PieChartDesignOptions : SpecificChartType extends 'funnel' ? FunnelChartDesignOptions : SpecificChartType extends 'polar' ? PolarChartDesignOptions : SpecificChartType extends 'indicator' ? IndicatorChartDesignOptions : SpecificChartType extends 'scatter' ? ScatterChartDesignOptions : SpecificChartType extends 'treemap' ? TreemapChartDesignOptions : SpecificChartType extends 'sunburst' ? SunburstChartDesignOptions : SpecificChartType extends 'boxplot' ? BoxplotChartDesignOptions : SpecificChartType extends 'areamap' ? AreamapChartDesignOptions : SpecificChartType extends 'scattermap' ? ScattermapChartDesignOptions : SpecificChartType extends 'calendar-heatmap' ? CalendarHeatmapChartDesignOptions : SpecificChartType extends 'kpi' ? KpiChartDesignOptions : SpecificChartType extends 'arearange' ? AreaRangeChartDesignOptions : SpecificChartType extends 'sankey' ? SankeyChartDesignOptions : never;
|
|
107
121
|
/** A unique identifier for a series to be found in {@link ChartDataOptionsInternal} */
|
|
108
122
|
type SeriesId = string;
|
|
109
123
|
/**
|
|
@@ -132,6 +146,6 @@ export declare const isAreamap: (chartType: ChartType) => chartType is "areamap"
|
|
|
132
146
|
export declare const isRange: (chartType: ChartType) => chartType is "arearange";
|
|
133
147
|
export declare const isCalendarHeatmap: (chartType: ChartType) => chartType is "calendar-heatmap";
|
|
134
148
|
export declare const isSankey: (chartType: ChartType) => chartType is "sankey";
|
|
135
|
-
export declare const ALL_CHART_TYPES: readonly ["line", "area", "bar", "column", "streamgraph", "polar", "pie", "funnel", "treemap", "sunburst", "scatter", "table", "indicator", "boxplot", "areamap", "image", "scattermap", "calendar-heatmap", "arearange", "sankey"];
|
|
149
|
+
export declare const ALL_CHART_TYPES: readonly ["line", "area", "bar", "column", "streamgraph", "polar", "pie", "funnel", "treemap", "sunburst", "scatter", "table", "indicator", "boxplot", "areamap", "image", "scattermap", "calendar-heatmap", "kpi", "arearange", "sankey"];
|
|
136
150
|
export type DynamicChartType = (typeof ALL_CHART_TYPES)[number];
|
|
137
151
|
export {};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { HighchartsOptionsInternal } from './chart-options-processor/chart-options-service';
|
|
2
2
|
type HighchartsRendererProps = {
|
|
3
3
|
options: HighchartsOptionsInternal;
|
|
4
|
+
/**
|
|
5
|
+
* Invoked after Highcharts paints the chart (`chart.events.load` and
|
|
6
|
+
* subsequent `chart.events.render`). Existing load/render handlers on
|
|
7
|
+
* `options` are preserved and called first.
|
|
8
|
+
*/
|
|
9
|
+
onReady?: () => void;
|
|
4
10
|
};
|
|
5
11
|
/**
|
|
6
12
|
* Renders a Highcharts chart with optimized behavior
|
|
@@ -9,5 +15,5 @@ type HighchartsRendererProps = {
|
|
|
9
15
|
* by detecting key changes that require chart re-initialization.
|
|
10
16
|
* It also handles cases where Highcharts mutates input options by making deep clone.
|
|
11
17
|
*/
|
|
12
|
-
export declare const HighchartsRenderer: ({ options }: HighchartsRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const HighchartsRenderer: ({ options, onReady }: HighchartsRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
19
|
export {};
|
|
@@ -99,10 +99,9 @@ export interface ChartWidgetProps extends ChartEventProps {
|
|
|
99
99
|
/**
|
|
100
100
|
* Widget identifier
|
|
101
101
|
*
|
|
102
|
-
*
|
|
102
|
+
* Used to identify the widget when exporting its data (for example, the "Download as Excel" action).
|
|
103
103
|
*
|
|
104
104
|
* @category Widget
|
|
105
|
-
* @internal
|
|
106
105
|
*/
|
|
107
106
|
id?: string;
|
|
108
107
|
/**
|
|
@@ -7,7 +7,7 @@ export type UseChartWidgetExcelDownloadResult = {
|
|
|
7
7
|
headerConfig: WidgetHeaderConfig;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
-
* Enhances a chart widget header with Excel download menu items
|
|
10
|
+
* Enhances a chart widget header with Excel download menu items.
|
|
11
11
|
* Excel menu is shown only when the widget/dashboard allows download.
|
|
12
12
|
* **Repeat rows** sets `mergeRows: false`; **Merge rows** sets `mergeRows: true`).
|
|
13
13
|
*
|
|
@@ -60,10 +60,9 @@ export interface CustomWidgetProps extends CustomWidgetEventProps {
|
|
|
60
60
|
/**
|
|
61
61
|
* Widget identifier
|
|
62
62
|
*
|
|
63
|
-
*
|
|
63
|
+
* Used to identify the widget when exporting its data (for example, the "Download as Excel" action).
|
|
64
64
|
*
|
|
65
65
|
* @category Widget
|
|
66
|
-
* @internal
|
|
67
66
|
*/
|
|
68
67
|
id?: string;
|
|
69
68
|
/**
|
|
@@ -13,6 +13,13 @@ type FilterWidgetDropdownProps = Pick<FilterWidgetProps, 'attribute' | 'dataSour
|
|
|
13
13
|
* channel as a `dateLevel/changed` event (e.g. to sync Fusion widget metadata).
|
|
14
14
|
*/
|
|
15
15
|
onDateLevelChange?: (attribute: Attribute) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Calls the provided callback on every rising edge of readiness — after member data loads
|
|
18
|
+
* successfully and the list is ready to display, including after subsequent
|
|
19
|
+
* reloads (e.g. dimension change, refetch). Used by the host FilterWidget to
|
|
20
|
+
* surface the `onRender` prop.
|
|
21
|
+
*/
|
|
22
|
+
onReady?: () => void;
|
|
16
23
|
};
|
|
17
24
|
/**
|
|
18
25
|
* Effective selection mode for the dropdown. The widget and its linked dashboard filter
|
|
@@ -23,6 +30,15 @@ type FilterWidgetDropdownProps = Pick<FilterWidgetProps, 'attribute' | 'dataSour
|
|
|
23
30
|
* @internal
|
|
24
31
|
*/
|
|
25
32
|
export declare function getEffectiveMultiselect(widgetMultiselect: boolean, selectedCount: number, filterMultiSelection: boolean | undefined): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Reduces a member selection to a single deterministic member (the alphabetically first)
|
|
35
|
+
* when it holds more than one, for switching a filter from multi- to single-select.
|
|
36
|
+
*
|
|
37
|
+
* @param members - Current member selection (treated as immutable).
|
|
38
|
+
* @returns A newly-allocated array: the single retained member, or a copy of the input.
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare function asSingleSelectionMembers(members: readonly string[]): string[];
|
|
26
42
|
/**
|
|
27
43
|
* Renders a searchable member-select dropdown using the existing CSDK filter editor select
|
|
28
44
|
* components (SearchableMultiSelect / SearchableSingleSelect).
|