@sisense/sdk-ui 2.7.0 → 2.9.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 +29 -29
- package/dist/ai.js +175 -193
- package/dist/analytics-composer/node.cjs +1 -0
- package/dist/analytics-composer/node.d.ts +1 -0
- package/dist/analytics-composer/node.js +897 -0
- package/dist/analytics-composer.cjs +118 -118
- package/dist/analytics-composer.js +2244 -2951
- package/dist/{derive-chart-family-DvYmrG1k.js → derive-chart-family-BLG1sO1D.js} +41019 -47803
- package/dist/derive-chart-family-QPmz5DJ3.cjs +656 -0
- package/dist/{dimensions-WmjaZcrG.js → dimensions-B2jz151s.js} +2 -3
- package/dist/dimensions-CVJeJ8mi.cjs +1 -0
- package/dist/execute-query-Cp3se7Yb.cjs +1 -0
- package/dist/execute-query-agpyzZz6.js +6406 -0
- package/dist/index.cjs +25 -25
- package/dist/index.js +6612 -6353
- package/dist/index.umd.js +355 -389
- package/dist/packages/sdk-ui/src/ai/common/icon-button.d.ts +1 -3
- package/dist/packages/sdk-ui/src/ai/messages/clickable-message.d.ts +0 -1
- package/dist/packages/sdk-ui/src/analytics-composer/index-node.d.ts +9 -0
- package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/common.d.ts +26 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-dimensions.d.ts +3 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-filters.d.ts +44 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-measures.d.ts +30 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-query-to-jaql.d.ts +18 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-query.d.ts +224 -0
- package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +28 -1
- package/dist/packages/sdk-ui/src/chart/helpers/get-load-data-function.d.ts +3 -1
- package/dist/packages/sdk-ui/src/chart/helpers/use-chart-data-preparation.d.ts +3 -1
- package/dist/packages/sdk-ui/src/chart/helpers/use-translated-data-options.d.ts +1 -1
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/highchart-options/axis.d.ts +5 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/highchart-options/y-axis.d.ts +28 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/line-chart/helpers/design-options.d.ts +12 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/line-chart/highchart-options/axes.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/line-chart/highcharts-options-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/line-chart/line-chart-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/data/index.d.ts +10 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/data-options/index.d.ts +12 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/design-options/index.d.ts +18 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/highchart-options/axes.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/highchart-options/highcharts-options-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/polar-chart-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/area-chart/area-chart-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/area-chart/helpers/design-options.d.ts +12 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/area-chart/highchart-options/axes.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/area-chart/highchart-options/highcharts-options-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/area-chart/highchart-options/labels-spacing.d.ts +8 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/bar-chart/highchart-options/axes.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/bar-chart/highchart-options/labels-spacing.d.ts +9 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/column-chart/highchart-options/axes.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/column-chart/highchart-options/labels-spacing.d.ts +9 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/helpers/highchart-options/stacking.d.ts +21 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/types.d.ts +1 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/build-highchart-options.d.ts +9 -4
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/utils.d.ts +2 -1
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/chart/restructured-charts/types.d.ts +7 -7
- package/dist/packages/sdk-ui/src/chart/restructured-charts/utils.d.ts +5 -0
- package/dist/packages/sdk-ui/src/chart-data/data-coloring/types.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/axis-builders.d.ts +155 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/axis-settings.d.ts +39 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/axis-transformers.d.ts +45 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/axis-utils.d.ts +1 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/date-utils.d.ts +27 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/index.d.ts +3 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/chart-configuration.d.ts +33 -3
- package/dist/packages/sdk-ui/src/chart-options-processor/chart-options-service.d.ts +0 -10
- package/dist/packages/sdk-ui/src/chart-options-processor/data-points.d.ts +1 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/defaults/cartesian.d.ts +4 -3
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/axis-section.d.ts +5 -12
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/design-options.d.ts +1 -1
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/legend-section.d.ts +2 -2
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/types.d.ts +13 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/value-label-section.d.ts +2 -2
- package/dist/packages/sdk-ui/src/common/icons/drag-handle-icon.d.ts +2 -1
- package/dist/packages/sdk-ui/src/const.d.ts +2 -0
- package/dist/packages/sdk-ui/src/custom-widgets-provider/types.d.ts +10 -1
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/draggable-line.d.ts +5 -1
- package/dist/packages/sdk-ui/src/dashboard/hooks/use-dashboard-header-toolbar.d.ts +0 -1
- package/dist/packages/sdk-ui/src/dashboard/hooks/use-edit-mode-toolbar.d.ts +0 -1
- package/dist/packages/sdk-ui/src/dashboard/use-dashboard-theme.d.ts +4 -0
- package/dist/packages/sdk-ui/src/error-boundary/error-boundary.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/filters-panel/hooks/use-existing-filter-editing.d.ts +0 -1
- package/dist/packages/sdk-ui/src/filters/components/filters-panel/hooks/use-new-filter-adding.d.ts +0 -1
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/use-members.d.ts +1 -1
- package/dist/packages/sdk-ui/src/pivot-table/formatters/data-cell-formatters/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/pivot-table/formatters/formatter-utils.d.ts +23 -0
- package/dist/packages/sdk-ui/src/pivot-table/formatters/types.d.ts +45 -2
- package/dist/packages/sdk-ui/src/pivot-table/formatters/utils.d.ts +1 -0
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-cell-events/get-pivot-table-data-point.d.ts +4 -0
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-cell-events/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-cell-events/types.d.ts +32 -0
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-cell-events/use-apply-pivot-table-cell-events.d.ts +18 -0
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-cell-events/utils.d.ts +11 -0
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-formatting.d.ts +6 -3
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-render-pivot.d.ts +8 -4
- package/dist/packages/sdk-ui/src/props.d.ts +122 -1
- package/dist/packages/sdk-ui/src/query/date-formats/apply-date-format.d.ts +7 -6
- package/dist/packages/sdk-ui/src/query/date-formats/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/query/execute-query.d.ts +3 -1
- package/dist/packages/sdk-ui/src/query-execution/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/query-execution/types.d.ts +9 -2
- package/dist/packages/sdk-ui/src/theme-provider/default-theme-settings.d.ts +5 -0
- package/dist/packages/sdk-ui/src/types.d.ts +57 -3
- package/dist/packages/sdk-ui/src/utils/__development-utils__/highcharts-options-builder-collector.d.ts +61 -0
- package/dist/packages/sdk-ui/src/utils/__development-utils__/input-output-collector.d.ts +125 -0
- package/dist/packages/sdk-ui/src/widget-by-id/translate-dashboard-filters.d.ts +1 -1
- package/dist/packages/sdk-ui/src/widget-by-id/translate-panel-color-format.d.ts +9 -0
- package/dist/packages/sdk-ui/src/widget-by-id/translate-statistical-models.d.ts +10 -0
- package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-data-options.d.ts +0 -14
- package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +6 -4
- package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +2 -2
- package/dist/packages/sdk-ui/src/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +2 -6
- package/dist/types-BYUVZb6u.js +80 -0
- package/dist/types-QUSMO7gF.cjs +1 -0
- package/dist/use-common-filters-DmdADAhl.cjs +350 -0
- package/dist/{use-common-filters-CVgB69Xe.js → use-common-filters-wo5IRF5u.js} +6326 -6441
- package/dist/{widget-composer-B4eAv2pf.js → widget-composer-BG4HonVl.js} +159 -239
- package/dist/{widget-composer-D0FZj1tX.cjs → widget-composer-CGp5yOny.cjs} +9 -9
- package/package.json +27 -17
- package/dist/derive-chart-family-BCY-GLVZ.cjs +0 -672
- package/dist/dimensions-DAISVpEZ.cjs +0 -1
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis-configuration.d.ts +0 -41
- package/dist/use-common-filters-CRrL9rOQ.cjs +0 -350
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AxisSettings } from '../../../../../../../chart-options-processor/translations/axis-section';
|
|
2
|
+
import { BuildContext } from '../../../../types';
|
|
3
|
+
export declare const getAxes: (ctx: BuildContext<'bar'>) => {
|
|
4
|
+
xAxis: AxisSettings[];
|
|
5
|
+
yAxis: AxisSettings[];
|
|
6
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StackableChartDesignOptions } from '../../../../../../../chart-options-processor/translations/design-options';
|
|
2
|
+
/**
|
|
3
|
+
* Calculate spacing for bar chart total labels based on rotation.
|
|
4
|
+
* Bar charts only use horizontal spacing as they have vertical orientation.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getBarChartSpacingForTotalLabels(chartDesignOptions: StackableChartDesignOptions): {
|
|
7
|
+
rightSpacing: number;
|
|
8
|
+
topSpacing: number;
|
|
9
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AxisSettings } from '../../../../../../../chart-options-processor/translations/axis-section';
|
|
2
|
+
import { BuildContext } from '../../../../types';
|
|
3
|
+
export declare const getAxes: (ctx: BuildContext<'column'>) => {
|
|
4
|
+
xAxis: AxisSettings[];
|
|
5
|
+
yAxis: AxisSettings[];
|
|
6
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StackableChartDesignOptions } from '../../../../../../../chart-options-processor/translations/design-options';
|
|
2
|
+
/**
|
|
3
|
+
* Calculate spacing for column chart total labels based on rotation.
|
|
4
|
+
* Column charts only use top spacing as they have horizontal orientation.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getColumnChartSpacingForTotalLabels(chartDesignOptions: StackableChartDesignOptions): {
|
|
7
|
+
rightSpacing: number;
|
|
8
|
+
topSpacing: number;
|
|
9
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AxisSettings } from '../../../../../../../chart-options-processor/translations/axis-section';
|
|
2
|
+
import { BuildContext } from '../../../../types';
|
|
3
|
+
import { StackableChartTypes } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Functional transformer that applies stacking-specific Y-axis enhancements.
|
|
6
|
+
* This transformer adds stacking-related properties (stack labels, total labels, formatting)
|
|
7
|
+
* to basic Y-axis settings for stackable charts (bar, column, area).
|
|
8
|
+
*
|
|
9
|
+
* This version is chart-type independent since all stackable chart types use identical stacking logic.
|
|
10
|
+
*
|
|
11
|
+
* @param ctx - Build context containing chart data, options, and configuration
|
|
12
|
+
* @returns A function that transforms basic Y-axis settings to include stacking support
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Apply stacking enhancements to basic Y-axis
|
|
17
|
+
* const basicYAxisSettings = getBasicYAxisSettings(ctx);
|
|
18
|
+
* const stackedYAxis = withStacking(ctx)(basicYAxisSettings);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const withStacking: (ctx: BuildContext<StackableChartTypes>) => (basicYAxisSettings: AxisSettings[]) => AxisSettings[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type StackableChartTypes = 'column' | 'bar' | 'area';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type CartesianChartTypes = 'column' | 'bar';
|
|
1
|
+
export type CartesianChartTypes = 'column' | 'bar' | 'line' | 'area' | 'polar';
|
|
@@ -5,7 +5,7 @@ import { BuildContext, HighchartBasedChartTypes, HighchartsOptionsBuilder } from
|
|
|
5
5
|
import { SisenseChartDataPointsEventHandler } from '../../../../sisense-chart/types';
|
|
6
6
|
import { SisenseChartDataPointEventHandler } from '../../../../sisense-chart/types';
|
|
7
7
|
import { BeforeRenderHandler } from '../../../../props';
|
|
8
|
-
export declare
|
|
8
|
+
export declare const buildHighchartsOptions: <CT extends HighchartBasedChartTypes>({ highchartsOptionsBuilder: builder, chartData, dataOptions, designOptions, extraConfig, dataPointsEventHandlers, onBeforeRender, }: {
|
|
9
9
|
highchartsOptionsBuilder: HighchartsOptionsBuilder<CT>;
|
|
10
10
|
chartData: TypedChartData<CT>;
|
|
11
11
|
dataOptions: TypedDataOptionsInternal<CT>;
|
|
@@ -15,6 +15,11 @@ export declare function buildHighchartsOptions<CT extends HighchartBasedChartTyp
|
|
|
15
15
|
onDataPointContextMenu?: SisenseChartDataPointEventHandler;
|
|
16
16
|
onDataPointsSelected?: SisenseChartDataPointsEventHandler;
|
|
17
17
|
};
|
|
18
|
-
extraConfig:
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
extraConfig: {
|
|
19
|
+
translate: import("i18next").TFunction<"translation", undefined>;
|
|
20
|
+
themeSettings: import("../../../../types.js").CompleteThemeSettings;
|
|
21
|
+
dateFormatter: (date: Date, format: string) => string;
|
|
22
|
+
accessibilityEnabled: boolean;
|
|
23
|
+
};
|
|
24
|
+
onBeforeRender?: BeforeRenderHandler | undefined;
|
|
25
|
+
}) => HighchartsOptionsInternal;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ChartType } from '../../../../types';
|
|
2
|
-
|
|
2
|
+
import { HighchartBasedChartTypes } from '../types';
|
|
3
|
+
export declare const isHighchartsBasedChart: (chartType: ChartType) => chartType is HighchartBasedChartTypes;
|
package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { HighchartsOptionsInternal } from '../../../chart-options-processor/char
|
|
|
2
2
|
import { CompleteThemeSettings } from '../../../index-typedoc';
|
|
3
3
|
import { TFunction } from '@sisense/sdk-common';
|
|
4
4
|
import { TypedChartData, TypedDataOptionsInternal, TypedDesignOptions } from '../types';
|
|
5
|
-
export type HighchartBasedChartTypes = 'column' | 'bar';
|
|
5
|
+
export type HighchartBasedChartTypes = 'column' | 'bar' | 'line' | 'area' | 'polar';
|
|
6
6
|
export type HighchartsOptionsBuilder<CT extends HighchartBasedChartTypes> = {
|
|
7
7
|
getChart: (ctx: BuildContext<CT>) => HighchartsOptionsInternal['chart'];
|
|
8
8
|
getSeries: (ctx: BuildContext<CT>) => HighchartsOptionsInternal['series'];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Attribute, Measure, QueryResultData } from '@sisense/sdk-data';
|
|
3
3
|
import { QueryDescription, QueryExecutionConfig } from '@sisense/sdk-query-client';
|
|
4
|
-
import type { AreamapStyleOptions, ChartDataOptions, ChartStyleOptions, ScattermapStyleOptions, StackableStyleOptions } from '../../types';
|
|
4
|
+
import type { AreaStyleOptions, AreamapStyleOptions, ChartDataOptions, ChartStyleOptions, LineStyleOptions, PolarStyleOptions, ScattermapStyleOptions, StackableStyleOptions } from '../../types';
|
|
5
5
|
import type { ChartRendererProps } from '../../chart';
|
|
6
6
|
import type { CartesianChartData, ScattermapChartData } from '../../chart-data/types';
|
|
7
7
|
import { AreamapChartDataOptions, AreamapChartDataOptionsInternal, CartesianChartDataOptions, CartesianChartDataOptionsInternal, ChartDataOptionsInternal, ScattermapChartDataOptions, ScattermapChartDataOptionsInternal } from '../../chart-data-options/types';
|
|
@@ -12,19 +12,19 @@ import { AreamapProps } from '../../chart/restructured-charts/areamap-chart/rend
|
|
|
12
12
|
import { ScattermapProps } from '../../charts/map-charts/scattermap/scattermap';
|
|
13
13
|
import { AreamapData } from './areamap-chart/types';
|
|
14
14
|
import { HighchartsBasedChartRendererProps } from './highchart-based-charts/highcharts-based-chart-renderer/highcharts-based-chart-renderer';
|
|
15
|
-
export type SupportedChartType = 'areamap' | 'column' | 'bar';
|
|
16
|
-
export type TypedChartDataOptions<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapChartDataOptions : CT extends 'scattermap' ? ScattermapChartDataOptions : CT extends 'column' | 'bar' ? CartesianChartDataOptions : never;
|
|
17
|
-
export type TypedDataOptionsInternal<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapChartDataOptionsInternal : CT extends 'scattermap' ? ScattermapChartDataOptionsInternal : CT extends 'column' | 'bar' ? CartesianChartDataOptionsInternal : never;
|
|
18
|
-
export type TypedChartStyleOptions<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapStyleOptions : CT extends 'scattermap' ? ScattermapStyleOptions : CT extends 'column' | 'bar' ? StackableStyleOptions : never;
|
|
15
|
+
export type SupportedChartType = 'areamap' | 'column' | 'bar' | 'line' | 'area' | 'polar';
|
|
16
|
+
export type TypedChartDataOptions<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapChartDataOptions : CT extends 'scattermap' ? ScattermapChartDataOptions : CT extends 'column' | 'bar' | 'line' | 'area' | 'polar' ? CartesianChartDataOptions : never;
|
|
17
|
+
export type TypedDataOptionsInternal<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapChartDataOptionsInternal : CT extends 'scattermap' ? ScattermapChartDataOptionsInternal : CT extends 'column' | 'bar' | 'line' | 'area' | 'polar' ? CartesianChartDataOptionsInternal : never;
|
|
18
|
+
export type TypedChartStyleOptions<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapStyleOptions : CT extends 'scattermap' ? ScattermapStyleOptions : CT extends 'column' | 'bar' ? StackableStyleOptions : CT extends 'line' ? LineStyleOptions : CT extends 'area' ? AreaStyleOptions : CT extends 'polar' ? PolarStyleOptions : never;
|
|
19
19
|
export type TypedDesignOptions<CT extends SupportedChartType> = DesignOptions<CT>;
|
|
20
|
-
export type TypedChartData<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapData : CT extends 'scattermap' ? ScattermapChartData : CT extends 'column' | 'bar' ? CartesianChartData : never;
|
|
20
|
+
export type TypedChartData<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapData : CT extends 'scattermap' ? ScattermapChartData : CT extends 'column' | 'bar' | 'line' | 'area' | 'polar' ? CartesianChartData : never;
|
|
21
21
|
export type TypedLoadDataFunction<CT extends SupportedChartType> = (options: {
|
|
22
22
|
app: ClientApplication;
|
|
23
23
|
chartDataOptionsInternal: TypedDataOptionsInternal<CT>;
|
|
24
24
|
queryDescription: QueryDescription;
|
|
25
25
|
executionConfig?: QueryExecutionConfig;
|
|
26
26
|
}) => Promise<QueryResultData>;
|
|
27
|
-
export type TypedChartRendererProps<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapProps : CT extends 'scattermap' ? ScattermapProps : CT extends 'column' | 'bar' ? HighchartsBasedChartRendererProps<CT> : never;
|
|
27
|
+
export type TypedChartRendererProps<CT extends SupportedChartType> = CT extends 'areamap' ? AreamapProps : CT extends 'scattermap' ? ScattermapProps : CT extends 'column' | 'bar' | 'line' | 'area' | 'polar' ? HighchartsBasedChartRendererProps<CT> : never;
|
|
28
28
|
/**
|
|
29
29
|
* Chart builder interface.
|
|
30
30
|
*/
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { ChartType } from '../../index';
|
|
2
2
|
import { SupportedChartType } from './types.js';
|
|
3
|
+
import { ChartDataOptions } from '../../chart-data-options/types';
|
|
4
|
+
/**
|
|
5
|
+
* Helper function to detect if chart data options contain forecast or trend analytics
|
|
6
|
+
*/
|
|
7
|
+
export declare function hasForecastOrTrend(dataOptions: ChartDataOptions, chartType: ChartType): boolean;
|
|
3
8
|
export declare function isRestructuredChartType(chartType: ChartType): chartType is SupportedChartType;
|
|
@@ -24,6 +24,12 @@ export type UniformDataColorOptions = {
|
|
|
24
24
|
* Color name, e.g., `red`, or a hexadecimal value, e.g., `#ff0000`.
|
|
25
25
|
*/
|
|
26
26
|
color: string;
|
|
27
|
+
/**
|
|
28
|
+
* Color index in the palette colors array
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
colorIndex?: number;
|
|
27
33
|
};
|
|
28
34
|
/**
|
|
29
35
|
* Range color options for data similar to the Range option in the Sisense UI.
|
package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/axis-builders.d.ts
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { ChartType, CompleteThemeSettings } from '../../../../types';
|
|
2
|
+
import { CartesianChartData } from '../../../../chart-data/types';
|
|
3
|
+
import { CartesianChartDataOptionsInternal } from '../../../../chart-data-options/types';
|
|
4
|
+
import { StackableChartDesignOptions, PolarChartDesignOptions } from '../../../translations/design-options';
|
|
5
|
+
import { ChartDesignOptions } from '../../../translations/types';
|
|
6
|
+
import { Axis, AxisSettings, AxisMinMax, PlotBand } from '../../../translations/axis-section';
|
|
7
|
+
import { withChartSpecificAxisSettings, withPolarSpecificAxisSettings, withStacking } from './axis-utils';
|
|
8
|
+
export { withChartSpecificAxisSettings, withPolarSpecificAxisSettings, withStacking };
|
|
9
|
+
import { AxisClipped } from '../../../translations/translations-to-highcharts';
|
|
10
|
+
import { Stacking } from '../../../chart-options-service';
|
|
11
|
+
/**
|
|
12
|
+
* X-axis orientation type
|
|
13
|
+
*/
|
|
14
|
+
export type XAxisOrientation = 'horizontal' | 'vertical';
|
|
15
|
+
/**
|
|
16
|
+
* Y-axis metadata containing all Y-axis related configuration
|
|
17
|
+
*/
|
|
18
|
+
export interface YAxisMeta {
|
|
19
|
+
side: number[];
|
|
20
|
+
chartType: (string | undefined)[];
|
|
21
|
+
treatNullAsZero: boolean[];
|
|
22
|
+
connectNulls: boolean[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Categories metadata containing categories, index mapping, and plot bands
|
|
26
|
+
*/
|
|
27
|
+
export interface CategoriesMeta {
|
|
28
|
+
categories: string[];
|
|
29
|
+
indexMap: number[];
|
|
30
|
+
plotBands: PlotBand[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Parameters for building X-axis settings
|
|
34
|
+
*/
|
|
35
|
+
export interface BuildXAxisSettingsParams {
|
|
36
|
+
designOptions: ChartDesignOptions;
|
|
37
|
+
dataOptions: CartesianChartDataOptionsInternal;
|
|
38
|
+
chartData: CartesianChartData;
|
|
39
|
+
categoriesMeta: CategoriesMeta;
|
|
40
|
+
orientation: XAxisOrientation;
|
|
41
|
+
isContinuous: boolean;
|
|
42
|
+
dateFormatter?: (date: Date, format: string) => string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Stacking configuration metadata
|
|
46
|
+
*/
|
|
47
|
+
export interface StackingMeta {
|
|
48
|
+
stacking?: Stacking;
|
|
49
|
+
showTotal?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Y-axis settings result containing both settings and clipping information
|
|
53
|
+
*/
|
|
54
|
+
export interface YAxisSettingsResult {
|
|
55
|
+
settings: AxisSettings[];
|
|
56
|
+
clipped: AxisClipped[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Determines if the X-axis should use continuous datetime scale
|
|
60
|
+
*
|
|
61
|
+
* @param xDataOptions - X-axis data options
|
|
62
|
+
* @returns true if continuous datetime X-axis should be used
|
|
63
|
+
*/
|
|
64
|
+
export declare const isContinuousDatetimeXAxis: (xDataOptions: CartesianChartDataOptionsInternal['x']) => boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Builds Y-axis metadata from chart data and options
|
|
67
|
+
*
|
|
68
|
+
* @param chartData - Cartesian chart data
|
|
69
|
+
* @param dataOptions - Chart data options
|
|
70
|
+
* @returns Y-axis metadata object
|
|
71
|
+
*/
|
|
72
|
+
export declare const buildYAxisMeta: (chartData: CartesianChartData, dataOptions: CartesianChartDataOptionsInternal) => YAxisMeta;
|
|
73
|
+
/**
|
|
74
|
+
* Determines X-axis orientation based on chart type and Y-axis chart types
|
|
75
|
+
*
|
|
76
|
+
* @param chartType - Main chart type
|
|
77
|
+
* @param yAxisChartTypes - Array of Y-axis chart types
|
|
78
|
+
* @returns X-axis orientation
|
|
79
|
+
*/
|
|
80
|
+
export declare const getXAxisOrientation: (chartType: ChartType, yAxisChartTypes: (string | undefined)[]) => XAxisOrientation;
|
|
81
|
+
/**
|
|
82
|
+
* Builds categories metadata including categories, index map, and plot bands
|
|
83
|
+
*
|
|
84
|
+
* @param chartData - Chart data
|
|
85
|
+
* @param dataOptions - Chart data options
|
|
86
|
+
* @param designOptions - Chart design options
|
|
87
|
+
* @param isContinuous - Whether X-axis is continuous
|
|
88
|
+
* @returns Categories metadata object
|
|
89
|
+
*/
|
|
90
|
+
export declare const buildCategoriesMeta: (chartData: CartesianChartData, dataOptions: CartesianChartDataOptionsInternal, designOptions: ChartDesignOptions, isContinuous: boolean) => CategoriesMeta;
|
|
91
|
+
/**
|
|
92
|
+
* Builds X-axis settings based on whether it's continuous datetime or categorical
|
|
93
|
+
*
|
|
94
|
+
* @param params - Parameters object containing all required data
|
|
95
|
+
* @param params.designOptions - Chart design options
|
|
96
|
+
* @param params.dataOptions - Chart data options
|
|
97
|
+
* @param params.chartData - Chart data
|
|
98
|
+
* @param params.categoriesMeta - Categories metadata
|
|
99
|
+
* @param params.orientation - X-axis orientation
|
|
100
|
+
* @param params.isContinuous - Whether X-axis is continuous
|
|
101
|
+
* @param params.dateFormatter - Optional date formatter function
|
|
102
|
+
* @returns X-axis settings array
|
|
103
|
+
*/
|
|
104
|
+
export declare const buildXAxisSettings: ({ designOptions, dataOptions, chartData, categoriesMeta, orientation, isContinuous, dateFormatter, }: BuildXAxisSettingsParams) => AxisSettings[];
|
|
105
|
+
/**
|
|
106
|
+
* Calculates Y-axis min/max values for a specific axis side
|
|
107
|
+
*
|
|
108
|
+
* @param axisIndex - Axis index (0 for left/primary, 1 for right/secondary)
|
|
109
|
+
* @param chartType - Chart type
|
|
110
|
+
* @param chartData - Chart data
|
|
111
|
+
* @param designOptions - Chart design options
|
|
112
|
+
* @param yAxisSide - Array indicating which side each series belongs to
|
|
113
|
+
* @param treatNullAsZero - Array indicating null treatment for each series
|
|
114
|
+
* @returns Axis min/max values
|
|
115
|
+
*/
|
|
116
|
+
export declare const buildYAxisMinMax: (axisIndex: 0 | 1, chartType: ChartType, chartData: CartesianChartData, designOptions: ChartDesignOptions, yAxisSide: number[], treatNullAsZero: boolean[]) => AxisMinMax;
|
|
117
|
+
/**
|
|
118
|
+
* Builds stacking configuration metadata
|
|
119
|
+
*
|
|
120
|
+
* @param chartType - Chart type
|
|
121
|
+
* @param designOptions - Stackable chart design options
|
|
122
|
+
* @returns Stacking metadata
|
|
123
|
+
*/
|
|
124
|
+
export declare const buildStackingMeta: (chartType: ChartType, designOptions: StackableChartDesignOptions) => StackingMeta;
|
|
125
|
+
/**
|
|
126
|
+
* Contextless transformer that normalizes Y-axis configuration for polar charts.
|
|
127
|
+
* Disables Y-axis titles which are not meaningful in polar coordinate system.
|
|
128
|
+
*
|
|
129
|
+
* @param designOptions - Polar chart design options to normalize
|
|
130
|
+
* @returns Normalized polar chart design options with Y-axis title disabled
|
|
131
|
+
* @example
|
|
132
|
+
* const normalizedOptions = withYAxisNormalizationForPolar(polarDesignOptions);
|
|
133
|
+
*/
|
|
134
|
+
export declare const withYAxisNormalizationForPolar: (designOptions: Readonly<PolarChartDesignOptions>) => PolarChartDesignOptions;
|
|
135
|
+
/**
|
|
136
|
+
* Builds Y-axis settings and clipping information
|
|
137
|
+
*
|
|
138
|
+
* @param yAxis - Primary Y-axis configuration
|
|
139
|
+
* @param y2Axis - Secondary Y-axis configuration
|
|
140
|
+
* @param primaryMinMax - Primary axis min/max values
|
|
141
|
+
* @param secondaryMinMax - Secondary axis min/max values (optional)
|
|
142
|
+
* @param stackingMeta - Stacking configuration
|
|
143
|
+
* @param totalLabelRotation - Total label rotation angle
|
|
144
|
+
* @param dataOptions - Chart data options
|
|
145
|
+
* @param themeSettings - Theme settings (optional)
|
|
146
|
+
* @returns Y-axis settings and clipping information
|
|
147
|
+
*/
|
|
148
|
+
export declare const buildYAxisSettings: (yAxis: Axis, y2Axis: Axis | undefined, primaryMinMax: AxisMinMax, secondaryMinMax: AxisMinMax | undefined, stackingMeta: StackingMeta, totalLabelRotation: number, dataOptions: CartesianChartDataOptionsInternal, themeSettings?: CompleteThemeSettings) => YAxisSettingsResult;
|
|
149
|
+
/**
|
|
150
|
+
* Determines if a secondary Y-axis is needed based on Y-axis side configuration
|
|
151
|
+
*
|
|
152
|
+
* @param yAxisSide - Array indicating which side each series belongs to
|
|
153
|
+
* @returns true if secondary Y-axis is needed
|
|
154
|
+
*/
|
|
155
|
+
export declare const hasSecondaryYAxis: (yAxisSide: number[]) => boolean;
|
package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/axis-settings.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ChartDataOptionsInternal } from '../../../../chart-data-options/types';
|
|
2
|
+
import { CompleteThemeSettings } from '../../../../types';
|
|
3
|
+
import { AxisClipped } from '../../../translations/translations-to-highcharts';
|
|
4
|
+
import { Axis, AxisMinMax, AxisOrientation, AxisSettings, PlotBand } from '../../../translations/axis-section';
|
|
5
|
+
/**
|
|
6
|
+
* Builds X-axis settings for categorical axes
|
|
7
|
+
*
|
|
8
|
+
* @param axis - Primary X-axis configuration
|
|
9
|
+
* @param axis2 - Secondary X-axis configuration (optional)
|
|
10
|
+
* @param categories - Array of category labels
|
|
11
|
+
* @param plotBands - Array of plot band configurations
|
|
12
|
+
* @param xAxisOrientation - X-axis orientation ('horizontal' or 'vertical')
|
|
13
|
+
* @param dataOptions - Chart data options
|
|
14
|
+
* @returns Array of X-axis settings
|
|
15
|
+
*/
|
|
16
|
+
export declare const getXAxisSettings: (axis: Axis, axis2: Axis | undefined, categories: string[], plotBands: PlotBand[], xAxisOrientation: AxisOrientation, dataOptions: ChartDataOptionsInternal) => AxisSettings[];
|
|
17
|
+
/**
|
|
18
|
+
* Creates Y-axis clipping information for cartesian charts.
|
|
19
|
+
*
|
|
20
|
+
* @param axis - Primary Y-axis configuration
|
|
21
|
+
* @param axis2 - Secondary Y-axis configuration (optional)
|
|
22
|
+
* @param axis2MinMax - Min/max values for secondary axis (optional)
|
|
23
|
+
* @returns Array of axis clipping information
|
|
24
|
+
*/
|
|
25
|
+
export declare const getYClippings: (axis: Axis, axis2: Axis | undefined, axis2MinMax: AxisMinMax | undefined) => AxisClipped[];
|
|
26
|
+
/**
|
|
27
|
+
* Creates basic Y-axis settings configuration for cartesian charts.
|
|
28
|
+
* This function provides core Y-axis functionality without stacking-specific features.
|
|
29
|
+
* Use the withStacking transformer to add stacking capabilities when needed.
|
|
30
|
+
*
|
|
31
|
+
* @param axis - Primary Y-axis configuration
|
|
32
|
+
* @param axis2 - Secondary Y-axis configuration (optional)
|
|
33
|
+
* @param axisMinMax - Min/max values for primary axis
|
|
34
|
+
* @param axis2MinMax - Min/max values for secondary axis (optional)
|
|
35
|
+
* @param dataOptions - Chart data options
|
|
36
|
+
* @param themeSettings - Theme settings for styling (optional)
|
|
37
|
+
* @returns Array of basic axis settings
|
|
38
|
+
*/
|
|
39
|
+
export declare const getYAxisSettings: (axis: Axis, axis2: Axis | undefined, axisMinMax: AxisMinMax, axis2MinMax: AxisMinMax | undefined, dataOptions: ChartDataOptionsInternal, themeSettings?: CompleteThemeSettings) => AxisSettings[];
|
package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/axis-transformers.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Stacking } from '../../../chart-options-service';
|
|
2
|
+
import { ChartDataOptionsInternal } from '../../../../chart-data-options/types';
|
|
3
|
+
import { ChartType, CompleteThemeSettings } from '../../../../types';
|
|
4
|
+
import { AxisSettings } from '../../../translations/axis-section';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration interface for stacking transformer
|
|
7
|
+
*/
|
|
8
|
+
export interface StackingConfig {
|
|
9
|
+
stacking?: Stacking;
|
|
10
|
+
showTotal?: boolean;
|
|
11
|
+
totalLabelRotation?: number;
|
|
12
|
+
dataOptions: ChartDataOptionsInternal;
|
|
13
|
+
themeSettings?: CompleteThemeSettings;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Transformer that combines polar-specific axis transformations
|
|
17
|
+
* Applies both top title positioning and removes label rotation
|
|
18
|
+
*/
|
|
19
|
+
export declare const withPolarSpecificAxisSettings: (axisSettings: AxisSettings[]) => AxisSettings[];
|
|
20
|
+
/**
|
|
21
|
+
* Transformer that applies stacking-specific enhancements to Y-axis settings.
|
|
22
|
+
* This transformer adds stacking-related properties (stack labels, total labels, formatting)
|
|
23
|
+
* to basic Y-axis settings for stackable charts.
|
|
24
|
+
*
|
|
25
|
+
* @param config - Stacking configuration containing stacking type, showTotal, rotation, and formatting options
|
|
26
|
+
* @returns A function that transforms basic Y-axis settings to include stacking support
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* // Apply stacking enhancements to basic Y-axis
|
|
31
|
+
* const stackedYAxis = flow(
|
|
32
|
+
* getYAxisSettings,
|
|
33
|
+
* withStacking({ stacking: 'normal', showTotal: true, totalLabelRotation: 0, dataOptions, themeSettings }),
|
|
34
|
+
* )(axis, axis2, axisMinMax, axis2MinMax, dataOptions, themeSettings);
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const withStacking: (config: StackingConfig) => (axisSettings: AxisSettings[]) => AxisSettings[];
|
|
38
|
+
/**
|
|
39
|
+
* Applies chart-specific axis settings to the axis settings array
|
|
40
|
+
*
|
|
41
|
+
* @param chartType - Chart type
|
|
42
|
+
* @param axisSettings - Array of axis settings
|
|
43
|
+
* @returns Array of axis settings with chart-specific settings applied
|
|
44
|
+
*/
|
|
45
|
+
export declare const withChartSpecificAxisSettings: (chartType: ChartType) => (axisSettings: AxisSettings[]) => AxisSettings[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StyledColumn } from '../../../../chart-data-options/types';
|
|
2
|
+
import { Axis, AxisSettings } from '../../../translations/axis-section';
|
|
3
|
+
/**
|
|
4
|
+
* Maps date granularity levels to their corresponding intervals in milliseconds
|
|
5
|
+
*
|
|
6
|
+
* @param granularity - The date granularity level
|
|
7
|
+
* @returns Interval in milliseconds for the given granularity
|
|
8
|
+
*/
|
|
9
|
+
export declare const getInterval: (granularity: string) => number;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a date formatter function for chart axis labels
|
|
12
|
+
*
|
|
13
|
+
* @param category - The styled column containing date formatting information
|
|
14
|
+
* @param dateFormatter - Optional external date formatter function
|
|
15
|
+
* @returns A function that formats timestamps as strings
|
|
16
|
+
*/
|
|
17
|
+
export declare const getDateFormatter: (category: StyledColumn, dateFormatter?: ((date: Date, format: string) => string) | undefined) => (time: number) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Builds X-axis settings for datetime axes with continuous data
|
|
20
|
+
*
|
|
21
|
+
* @param axis - Primary axis configuration
|
|
22
|
+
* @param category - The styled column for date formatting
|
|
23
|
+
* @param values - Array of numeric timestamp values
|
|
24
|
+
* @param dateFormatter - Optional date formatter function
|
|
25
|
+
* @returns Array of axis settings for datetime X-axis
|
|
26
|
+
*/
|
|
27
|
+
export declare const getXAxisDatetimeSettings: (axis: Axis, category: StyledColumn, values: number[], dateFormatter?: ((date: Date, format: string) => string) | undefined) => AxisSettings[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { getInterval, getDateFormatter, getXAxisDatetimeSettings } from './date-utils';
|
|
2
|
+
export { getXAxisSettings, getYAxisSettings, getYClippings } from './axis-settings';
|
|
3
|
+
export { withStacking, withPolarSpecificAxisSettings, withChartSpecificAxisSettings, type StackingConfig, } from './axis-transformers';
|
package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/chart-configuration.d.ts
CHANGED
|
@@ -1,13 +1,43 @@
|
|
|
1
|
+
import { ChartDesignOptions } from '../../../chart-options-processor/translations/types';
|
|
1
2
|
import { AxisSettings } from '../../translations/axis-section';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Configuration for Y-axis label positioning adjustments
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
+
type YAxisLabelPositioningConfig = {
|
|
7
|
+
readonly rightShift: number;
|
|
8
|
+
readonly topShift: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for X-axis label positioning adjustments
|
|
12
|
+
*/
|
|
13
|
+
type XAxisLabelPositioningConfig = {
|
|
14
|
+
readonly totalLabelRightSpacing: number;
|
|
15
|
+
readonly totalLabelTopSpacing: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Higher-order function for Y-axis label positioning adjustments.
|
|
19
|
+
* Returns a function that transforms Y-axis settings without mutating the input parameters.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const positionYAxisLabels = withYAxisLabelPositioning({ rightShift: 10, topShift: 20 });
|
|
23
|
+
* const updatedSettings = positionYAxisLabels(yAxisSettings);
|
|
24
|
+
*/
|
|
25
|
+
export declare function withYAxisLabelPositioning(config: YAxisLabelPositioningConfig): (yAxisSettings: AxisSettings[]) => AxisSettings[];
|
|
26
|
+
/**
|
|
27
|
+
* Higher-order function for X-axis label positioning adjustments.
|
|
28
|
+
* Returns a function that transforms X-axis settings without mutating the input parameters.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* const positionXAxisLabels = withXAxisLabelPositioning({ totalLabelRightSpacing: 15, totalLabelTopSpacing: 25 });
|
|
32
|
+
* const updatedSettings = positionXAxisLabels(xAxisSettings);
|
|
33
|
+
*/
|
|
34
|
+
export declare function withXAxisLabelPositioning(config: XAxisLabelPositioningConfig): (xAxisSettings: AxisSettings[]) => AxisSettings[];
|
|
6
35
|
/**
|
|
7
36
|
* Determine chart state information
|
|
8
37
|
*/
|
|
9
|
-
export declare function determineChartState(chartType: string, chartDesignOptions:
|
|
38
|
+
export declare function determineChartState(chartType: string, chartDesignOptions: ChartDesignOptions, stacking?: string): {
|
|
10
39
|
treatNullDataAsZeros: boolean;
|
|
11
40
|
isPolarChart: boolean;
|
|
12
41
|
polarType?: any;
|
|
13
42
|
};
|
|
43
|
+
export {};
|
|
@@ -177,16 +177,6 @@ export type HighchartsOptionsInternal = {
|
|
|
177
177
|
};
|
|
178
178
|
drilldown?: DrilldownOptions;
|
|
179
179
|
};
|
|
180
|
-
export type Style = {
|
|
181
|
-
fontFamily?: string;
|
|
182
|
-
fontSize?: string;
|
|
183
|
-
fontWeight?: string;
|
|
184
|
-
color?: string;
|
|
185
|
-
textOutline?: string;
|
|
186
|
-
pointerEvents?: string;
|
|
187
|
-
textOverflow?: string;
|
|
188
|
-
width?: string;
|
|
189
|
-
};
|
|
190
180
|
type Navigator = {
|
|
191
181
|
series: {
|
|
192
182
|
type: HighchartsType;
|
|
@@ -2,6 +2,7 @@ import { Measure } from '@sisense/sdk-data';
|
|
|
2
2
|
import { HighchartsPoint } from '../types';
|
|
3
3
|
import { SisenseChartDataPoint } from '../sisense-chart/types';
|
|
4
4
|
import { ChartDataOptionsInternal, StyledColumn, StyledMeasureColumn } from '..';
|
|
5
|
+
export declare function createFormatter(dataOption: StyledColumn | StyledMeasureColumn): (value?: number | string | Date) => string;
|
|
5
6
|
export declare function getDataPointMetadata(dataOptionPath: string, dataOption: StyledColumn | StyledMeasureColumn): {
|
|
6
7
|
measure?: Measure | undefined;
|
|
7
8
|
attribute?: import("@sisense/sdk-data").Attribute | undefined;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AxisSettings } from '../translations/axis-section';
|
|
2
|
-
import {
|
|
2
|
+
import { HighchartsOptionsInternal, Stacking } from '../chart-options-service';
|
|
3
|
+
import { TextStyle } from '../translations/types';
|
|
3
4
|
import { ChartType } from '../../types';
|
|
4
5
|
import { PolarType } from '../translations/design-options';
|
|
5
6
|
export declare const lineColorDefault = "#d1d1d7";
|
|
6
|
-
export declare const fontStyleDefault:
|
|
7
|
-
export declare const stackTotalFontStyleDefault:
|
|
7
|
+
export declare const fontStyleDefault: TextStyle;
|
|
8
|
+
export declare const stackTotalFontStyleDefault: TextStyle;
|
|
8
9
|
export declare const xAxisDefaults: AxisSettings;
|
|
9
10
|
export declare const yAxisDefaults: AxisSettings;
|
|
10
11
|
export declare const chartOptionsDefaults: (chartType: ChartType, polarType?: PolarType, stacking?: Stacking) => HighchartsOptionsInternal;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChartDataOptionsInternal, StyledColumn } from '../../chart-data-options/types';
|
|
3
|
-
import { ChartType, CompleteThemeSettings } from '../../types';
|
|
1
|
+
import { TextStyle } from './types';
|
|
4
2
|
import { CategoricalXValues } from '../../chart-data/types';
|
|
5
|
-
import { AxisClipped } from './translations-to-highcharts';
|
|
6
3
|
export type Axis = {
|
|
7
4
|
enabled?: boolean;
|
|
8
5
|
titleEnabled?: boolean;
|
|
@@ -31,7 +28,7 @@ export type AxisSettings = {
|
|
|
31
28
|
text?: string | null;
|
|
32
29
|
enabled?: boolean;
|
|
33
30
|
margin?: number;
|
|
34
|
-
style?:
|
|
31
|
+
style?: TextStyle;
|
|
35
32
|
};
|
|
36
33
|
gridLineDashStyle?: 'Dot';
|
|
37
34
|
gridLineWidth?: number;
|
|
@@ -43,7 +40,7 @@ export type AxisSettings = {
|
|
|
43
40
|
overflow?: 'none' | 'justify';
|
|
44
41
|
enabled?: boolean;
|
|
45
42
|
autoRotation?: number[];
|
|
46
|
-
style?:
|
|
43
|
+
style?: TextStyle;
|
|
47
44
|
rotation?: number;
|
|
48
45
|
formatter?: (this: AxisLabelsFormatterContextObject) => string;
|
|
49
46
|
};
|
|
@@ -72,7 +69,7 @@ export type AxisSettings = {
|
|
|
72
69
|
visible?: boolean;
|
|
73
70
|
};
|
|
74
71
|
export type StackLabel = {
|
|
75
|
-
style:
|
|
72
|
+
style: TextStyle;
|
|
76
73
|
crop: boolean;
|
|
77
74
|
allowOverlap: boolean;
|
|
78
75
|
enabled: boolean;
|
|
@@ -100,12 +97,8 @@ export type AxisPlotBand = {
|
|
|
100
97
|
text: string;
|
|
101
98
|
x: number;
|
|
102
99
|
y: number;
|
|
103
|
-
style?:
|
|
100
|
+
style?: TextStyle;
|
|
104
101
|
};
|
|
105
102
|
};
|
|
106
103
|
export declare const getCategoricalCompareValue: (value: CategoricalXValues) => number;
|
|
107
104
|
export declare const getDefaultDateFormat: (granularity?: string) => "HH:mm:ss" | "yyyy" | "yyyy Q" | "MM/yyyy" | "ww yyyy" | "M/d/yy" | "HH" | "M/d/yy HH" | "HH:mm" | undefined;
|
|
108
|
-
export declare const getDateFormatter: (category: StyledColumn, dateFormatter?: ((date: Date, format: string) => string) | undefined) => (time: number) => string;
|
|
109
|
-
export declare const getXAxisDatetimeSettings: (axis: Axis, category: StyledColumn, values: number[], dateFormatter?: ((date: Date, format: string) => string) | undefined) => AxisSettings[];
|
|
110
|
-
export declare const getXAxisSettings: (axis: Axis, axis2: Axis | undefined, categories: string[], plotBands: PlotBand[], xAxisOrientation: AxisOrientation, dataOptions: ChartDataOptionsInternal, chartType: ChartType) => AxisSettings[];
|
|
111
|
-
export declare const getYAxisSettings: (axis: Axis, axis2: Axis | undefined, axisMinMax: AxisMinMax, axis2MinMax: AxisMinMax | undefined, showTotal: boolean, totalLabelRotation: number, dataOptions: ChartDataOptionsInternal, stacking: Stacking | undefined, themeSettings?: CompleteThemeSettings) => [AxisSettings[], AxisClipped[]];
|
|
@@ -36,7 +36,7 @@ export type StackableChartDesignOptions = CartesianChartDesignOptions & {
|
|
|
36
36
|
stackType: StackType;
|
|
37
37
|
showTotal?: boolean;
|
|
38
38
|
totalLabelRotation?: number;
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
40
|
export type LineChartDesignOptions = CartesianChartDesignOptions & {
|
|
41
41
|
/** Step type for step line charts: left, center, or right */
|
|
42
42
|
step?: 'left' | 'center' | 'right';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextStyle } from './types';
|
|
2
2
|
export type LegendPosition = 'top' | 'left' | 'right' | 'bottom' | null;
|
|
3
3
|
export type LegendSettings = {
|
|
4
4
|
enabled: boolean;
|
|
5
5
|
align?: 'center' | 'left' | 'right';
|
|
6
6
|
verticalAlign?: 'top' | 'middle' | 'bottom';
|
|
7
7
|
layout?: 'horizontal' | 'vertical';
|
|
8
|
-
itemStyle?:
|
|
8
|
+
itemStyle?: TextStyle & {
|
|
9
9
|
cursor?: string;
|
|
10
10
|
};
|
|
11
11
|
symbolRadius?: number;
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { AreamapChartDesignOptions } from '../../chart/restructured-charts/areamap-chart/types';
|
|
2
2
|
import { ChartType } from '../../types';
|
|
3
3
|
import { LineChartDesignOptions, AreaChartDesignOptions, BarChartDesignOptions, ColumnChartDesignOptions, PieChartDesignOptions, FunnelChartDesignOptions, IndicatorChartDesignOptions, PolarChartDesignOptions, ScatterChartDesignOptions, TreemapChartDesignOptions, BoxplotChartDesignOptions, ScattermapChartDesignOptions, AreaRangeChartDesignOptions, BaseDesignOptionsType } from './design-options';
|
|
4
|
+
/**
|
|
5
|
+
* Style configuration for text elements
|
|
6
|
+
*/
|
|
7
|
+
export type TextStyle = {
|
|
8
|
+
fontFamily?: string;
|
|
9
|
+
fontSize?: string;
|
|
10
|
+
fontWeight?: string;
|
|
11
|
+
color?: string;
|
|
12
|
+
textOutline?: string;
|
|
13
|
+
pointerEvents?: string;
|
|
14
|
+
textOverflow?: string;
|
|
15
|
+
width?: string;
|
|
16
|
+
};
|
|
4
17
|
export declare const POLAR_CHART_TYPES: readonly ["polar"];
|
|
5
18
|
export type PolarChartType = (typeof POLAR_CHART_TYPES)[number];
|
|
6
19
|
export declare const CARTESIAN_CHART_TYPES: readonly ["line", "area", "bar", "column", "polar"];
|