@sisense/sdk-ui 0.15.0 → 1.0.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/messages/get-widget-options.d.ts +3 -3
- package/dist/ai.js +334 -308
- package/dist/api/types/dashboard-dto.d.ts +3 -2
- package/dist/area-chart.d.ts +2 -2
- package/dist/bar-chart.d.ts +2 -2
- package/dist/boxplot-chart.d.ts +38 -0
- package/dist/boxplot-utils.d.ts +30 -0
- package/dist/chart-data/boxplot-data.d.ts +11 -0
- package/dist/chart-data/cartesian-data.d.ts +6 -3
- package/dist/chart-data/data-coloring/create-data-coloring-function.d.ts +7 -0
- package/dist/chart-data/data-coloring/index.d.ts +3 -0
- package/dist/chart-data/{series-data-color-service → data-coloring}/legend-color.d.ts +1 -1
- package/dist/chart-data/data-coloring/series-data-coloring-function.d.ts +11 -0
- package/dist/chart-data/indicator-data.d.ts +2 -2
- package/dist/chart-data/scatter-data.d.ts +2 -2
- package/dist/chart-data/scattermap-data.d.ts +4 -0
- package/dist/chart-data/types.d.ts +46 -1
- package/dist/chart-data-options/coloring/consts.d.ts +3 -0
- package/dist/chart-data-options/coloring/utils.d.ts +6 -0
- package/dist/chart-data-options/get-translated-data-options.d.ts +6 -0
- package/dist/chart-data-options/translate-boxplot-data-options.d.ts +7 -0
- package/dist/chart-data-options/translate-scattermap-data-options.d.ts +3 -0
- package/dist/chart-data-options/types.d.ts +122 -10
- package/dist/chart-data-options/utils.d.ts +6 -1
- package/dist/chart-options-processor/boxplot-chart-options.d.ts +10 -0
- package/dist/chart-options-processor/chart-options-service.d.ts +21 -77
- package/dist/chart-options-processor/style-to-design-options-translator/translate-style-to-design-options.d.ts +2 -2
- package/dist/chart-options-processor/style-to-design-options-translator/translate-to-highcharts-options.d.ts +4 -2
- package/dist/chart-options-processor/subtype-to-design-options.d.ts +5 -2
- package/dist/chart-options-processor/theme-option-service.d.ts +0 -1
- package/dist/chart-options-processor/translations/axis-section.d.ts +4 -3
- package/dist/chart-options-processor/translations/boxplot/boxplot-axis.d.ts +10 -0
- package/dist/chart-options-processor/translations/boxplot/boxplot-plot-options.d.ts +3 -0
- package/dist/chart-options-processor/translations/boxplot/boxplot-series.d.ts +5 -0
- package/dist/chart-options-processor/translations/boxplot/boxplot-tooltip.d.ts +3 -0
- package/dist/chart-options-processor/translations/design-options.d.ts +9 -2
- package/dist/chart-options-processor/translations/funnel-series.d.ts +1 -2
- package/dist/chart-options-processor/translations/legend-section.d.ts +6 -4
- package/dist/chart-options-processor/translations/pie-series.d.ts +1 -2
- package/dist/chart-options-processor/translations/tooltip-utils.d.ts +5 -0
- package/dist/chart-options-processor/translations/translations-to-highcharts.d.ts +11 -3
- package/dist/chart-options-processor/translations/types.d.ts +10 -2
- package/dist/chart-options-processor/translations/value-label-section.d.ts +2 -1
- package/dist/chart.d.ts +2 -2
- package/dist/charts/indicator/indicator-legacy-chart-data-options.d.ts +2 -2
- package/dist/charts/indicator/indicator-legacy-chart-options/indicator-legacy-chart-options.d.ts +2 -2
- package/dist/charts/indicator/indicator-legacy-chart-options/override-with-value-color.d.ts +2 -2
- package/dist/charts/scattermap/hooks/use-locations.d.ts +3 -0
- package/dist/charts/scattermap/hooks/use-settings.d.ts +5 -0
- package/dist/charts/scattermap/hooks/use-tooltip-handler.d.ts +14 -0
- package/dist/charts/scattermap/scattermap.d.ts +13 -0
- package/dist/charts/scattermap/types.d.ts +16 -0
- package/dist/charts/scattermap/utils/color.d.ts +3 -0
- package/dist/charts/scattermap/utils/copyright.d.ts +2 -0
- package/dist/charts/scattermap/utils/location.d.ts +5 -0
- package/dist/charts/scattermap/utils/map.d.ts +2 -0
- package/dist/charts/scattermap/utils/markers.d.ts +28 -0
- package/dist/charts/scattermap/utils/size.d.ts +2 -0
- package/dist/charts/scattermap/utils/tooltip.d.ts +8 -0
- package/dist/charts/scattermap/utils/values.d.ts +4 -0
- package/dist/charts/table/types.d.ts +1 -1
- package/dist/column-chart.d.ts +2 -2
- package/dist/common/components/loading-dots.d.ts +4 -0
- package/dist/dashboard-widget/translate-dashboard-filters.d.ts +1 -1
- package/dist/dashboard-widget/translate-panel-color-format.d.ts +3 -3
- package/dist/dashboard-widget/translate-widget-data-options.d.ts +6 -5
- package/dist/dashboard-widget/translate-widget-style-options.d.ts +2 -2
- package/dist/dashboard-widget/types.d.ts +45 -19
- package/dist/dashboard-widget/use-fetch-widget-dto-model.d.ts +9 -5
- package/dist/dashboard-widget/utils.d.ts +1 -1
- package/dist/decorators/component-decorators/as-sisense-component.d.ts +1 -0
- package/dist/filters/components/common/basic-input.d.ts +1 -1
- package/dist/filters/components/common/date-range-field-button.d.ts +3 -2
- package/dist/filters/components/common/dropdown.d.ts +9 -0
- package/dist/filters/components/common/filter-utils.d.ts +13 -0
- package/dist/filters/components/common/index.d.ts +3 -1
- package/dist/filters/components/common/radio.d.ts +7 -0
- package/dist/filters/components/criteria-filter-tile/criteria-filter-display.d.ts +2 -2
- package/dist/filters/components/criteria-filter-tile/criteria-filter-menu.d.ts +6 -3
- package/dist/filters/components/criteria-filter-tile/criteria-filter-operations.d.ts +13 -8
- package/dist/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +21 -4
- package/dist/filters/components/criteria-filter-tile/index.d.ts +0 -1
- package/dist/filters/components/date-filter/date-filter/calendar-date-selector.d.ts +10 -8
- package/dist/filters/components/date-filter/date-filter/quick-date-selection-buttons.d.ts +4 -4
- package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +1 -1
- package/dist/filters/components/date-filter/index.d.ts +1 -0
- package/dist/filters/components/date-filter/relative-date-filter-tile/index.d.ts +1 -0
- package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-display.d.ts +14 -0
- package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +36 -0
- package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +26 -0
- package/dist/filters/components/filter-tile.d.ts +1 -1
- package/dist/filters/components/member-filter-tile/basic-member-filter-tile.d.ts +2 -0
- package/dist/filters/components/member-filter-tile/members-reducer.d.ts +9 -1
- package/dist/filters/components/member-filter-tile/pill-section.d.ts +0 -1
- package/dist/filters/index.d.ts +1 -0
- package/dist/highcharts-memorized.d.ts +4 -3
- package/dist/index.d.ts +5 -2
- package/dist/index.js +5585 -4933
- package/dist/indicator-canvas.d.ts +3 -3
- package/dist/indicator-chart.d.ts +4 -4
- package/dist/line-chart.d.ts +2 -2
- package/dist/models/dashboard/types.d.ts +1 -1
- package/dist/models/dashboard/use-get-dashboard-model.d.ts +1 -0
- package/dist/models/dashboard/use-get-dashboard-models.d.ts +2 -1
- package/dist/models/widget/get-widget-model.d.ts +4 -0
- package/dist/models/widget/index.d.ts +3 -1
- package/dist/models/widget/translate-widget.d.ts +1 -1
- package/dist/models/widget/use-get-widget-model.d.ts +103 -0
- package/dist/models/widget/widget-model.d.ts +123 -0
- package/dist/pie-chart.d.ts +2 -2
- package/dist/polar-chart.d.ts +2 -2
- package/dist/props.d.ts +67 -62
- package/dist/query/execute-query.d.ts +3 -1
- package/dist/query-execution/csv-query-state-reducer.d.ts +2 -0
- package/dist/query-execution/execute-query-by-widget-id.d.ts +10 -2
- package/dist/query-execution/execute-query.d.ts +11 -4
- package/dist/query-execution/index.d.ts +4 -3
- package/dist/query-execution/query-state-reducer.d.ts +1 -58
- package/dist/query-execution/types.d.ts +192 -0
- package/dist/query-execution/use-execute-csv-query.d.ts +80 -0
- package/dist/query-execution/use-execute-query-by-widget-id.d.ts +6 -37
- package/dist/query-execution/use-execute-query.d.ts +10 -35
- package/dist/scatter-chart.d.ts +4 -4
- package/dist/scattermap-chart.d.ts +36 -0
- package/dist/sunburst-chart.d.ts +1 -1
- package/dist/table/hooks/use-table-data.d.ts +7 -2
- package/dist/table/table.d.ts +5 -2
- package/dist/table-widget-7936746a.js +72481 -0
- package/dist/themes/theme-loader.d.ts +0 -1
- package/dist/translation/resources/en.d.ts +21 -0
- package/dist/translation/resources/index.d.ts +42 -0
- package/dist/treemap-chart.d.ts +2 -2
- package/dist/types.d.ts +76 -7
- package/dist/utils/utility-types.d.ts +4 -0
- package/dist/widgets/chart-widget-deprecated.d.ts +1 -1
- package/dist/widgets/chart-widget.d.ts +1 -1
- package/dist/widgets/common/drilldown-breadcrumbs/drilldown-breadcrumbs-navigation.d.ts +8 -0
- package/dist/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +11 -0
- package/dist/widgets/common/drilldown.d.ts +12 -2
- package/dist/widgets/drilldown-widget.d.ts +2 -2
- package/package.json +28 -6
- package/dist/chart-data/series-data-color-service/index.d.ts +0 -3
- package/dist/chart-data/series-data-color-service/series-data-color-service.d.ts +0 -4
- package/dist/models/widget/types.d.ts +0 -6
- package/dist/table-widget-7b20ecf7.js +0 -64167
- /package/dist/chart-data/{series-data-color-service → data-coloring}/types.d.ts +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { WidgetDto, Datasource } from '../../dashboard-widget/types';
|
|
2
2
|
import { FilterJaql } from '@sisense/sdk-data';
|
|
3
|
+
import { AnyObject } from '../../utils/utility-types';
|
|
3
4
|
export type Filter = {
|
|
4
5
|
isCascading?: false;
|
|
5
|
-
jaql: FilterJaql;
|
|
6
|
+
jaql: FilterJaql & AnyObject;
|
|
6
7
|
instanceid?: string;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
};
|
|
@@ -18,4 +19,4 @@ export type DashboardDto = {
|
|
|
18
19
|
datasource: Datasource;
|
|
19
20
|
widgets?: WidgetDto[];
|
|
20
21
|
filters?: Array<Filter | CascadingFilter>;
|
|
21
|
-
};
|
|
22
|
+
} & AnyObject;
|
package/dist/area-chart.d.ts
CHANGED
|
@@ -12,11 +12,11 @@ import { AreaChartProps } from './props';
|
|
|
12
12
|
* dataSet={DM.DataSource}
|
|
13
13
|
* dataOptions={{
|
|
14
14
|
* category: [DM.Commerce.Date.Years],
|
|
15
|
-
* value: [
|
|
15
|
+
* value: [measureFactory.sum(DM.Commerce.Revenue)],
|
|
16
16
|
* breakBy: [DM.Commerce.Gender],
|
|
17
17
|
* }}
|
|
18
18
|
* styleOptions={{ subtype: 'area/stacked' }}
|
|
19
|
-
* filters={[
|
|
19
|
+
* filters={[filterFactory.members(DM.Commerce.Gender, ['Female', 'Male'])]}
|
|
20
20
|
* onDataPointClick={(point, nativeEvent) => {
|
|
21
21
|
* console.log('clicked', point, nativeEvent);
|
|
22
22
|
* }}
|
package/dist/bar-chart.d.ts
CHANGED
|
@@ -12,10 +12,10 @@ import { BarChartProps } from './props';
|
|
|
12
12
|
* dataSet={DM.DataSource}
|
|
13
13
|
* dataOptions={{
|
|
14
14
|
* category: [DM.Commerce.AgeRange],
|
|
15
|
-
* value: [
|
|
15
|
+
* value: [measureFactory.sum(DM.Commerce.Revenue)],
|
|
16
16
|
* breakBy: [DM.Commerce.Gender],
|
|
17
17
|
* }}
|
|
18
|
-
* filters={[
|
|
18
|
+
* filters={[filterFactory.greaterThan(DM.Commerce.Revenue, 1000)]}
|
|
19
19
|
* onDataPointClick={(point, nativeEvent) => {
|
|
20
20
|
* console.log('clicked', point, nativeEvent);
|
|
21
21
|
* }}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BoxplotChartProps } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* A React component representing data in a way that visually describes the distribution, variability,
|
|
5
|
+
* and center of a data set along an axis.
|
|
6
|
+
* See [Boxplot Chart](https://docs.sisense.com/main/SisenseLinux/box-and-whisker-plot.htm) for more information.
|
|
7
|
+
*
|
|
8
|
+
* This component is still in beta.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* An example of using the component to visualize the `Sample ECommerce` data source:
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <BoxplotChart
|
|
14
|
+
* dataSet={DM.DataSource}
|
|
15
|
+
* dataOptions={{
|
|
16
|
+
* category: [DM.Category.Category],
|
|
17
|
+
* value: [DM.Commerce.Cost],
|
|
18
|
+
* boxType: 'iqr',
|
|
19
|
+
* outliersEnabled: true,
|
|
20
|
+
* }}
|
|
21
|
+
* filters={[
|
|
22
|
+
* filterFactory.members(DM.Category.Category, ['Calculators', 'DVD Players', 'Routers']),
|
|
23
|
+
* filterFactory.members(DM.Commerce.AgeRange, ['19-24']),
|
|
24
|
+
* ]}
|
|
25
|
+
* styleOptions={{
|
|
26
|
+
* seriesLabels: {
|
|
27
|
+
* enabled: true,
|
|
28
|
+
* }
|
|
29
|
+
* }}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* <img src="media://boxplot-chart-example-1.png" width="600px" />
|
|
34
|
+
* @param props - Boxplot chart properties
|
|
35
|
+
* @returns Boxplot Chart component
|
|
36
|
+
* @beta
|
|
37
|
+
*/
|
|
38
|
+
export declare const BoxplotChart: import("react").FunctionComponent<BoxplotChartProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Attribute, Measure, Filter, QueryResultData, DataSource } from '@sisense/sdk-data';
|
|
2
|
+
import { ClientApplication } from './app/client-application.js';
|
|
3
|
+
import { BoxplotChartCustomDataOptions, BoxplotChartDataOptionsInternal } from './chart-data-options/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Processes box whisker data and outliers data to combine them into a single data set.
|
|
6
|
+
*
|
|
7
|
+
* @param {QueryResultData} boxWhiskerData - The data for the box whisker.
|
|
8
|
+
* @param {QueryResultData} outliersData - The data for the outliers.
|
|
9
|
+
* @param {BoxplotChartDataOptionsInternal} [dataOptions] - Optional data options for customizing data processing.
|
|
10
|
+
* @returns {QueryResultData} The combined data with outliers included in the box whisker plot.
|
|
11
|
+
*/
|
|
12
|
+
export declare const boxWhiskerProcessResultInternal: (boxWhiskerData: QueryResultData, outliersData: QueryResultData, dataOptions?: BoxplotChartDataOptionsInternal) => QueryResultData;
|
|
13
|
+
/**
|
|
14
|
+
* Processes box whisker data and outliers data to combine them into a single data set.
|
|
15
|
+
*
|
|
16
|
+
* @param {QueryResultData} boxWhiskerData - The data for the box whisker.
|
|
17
|
+
* @param {QueryResultData} outliersData - The data for the outliers.
|
|
18
|
+
* @param {BoxplotChartCustomDataOptions} [dataOptions] - Optional data options for customizing data processing.
|
|
19
|
+
* @returns {QueryResultData} The combined data with outliers included in the box whisker plot.
|
|
20
|
+
*/
|
|
21
|
+
export declare function boxWhiskerProcessResult(boxWhiskerData: QueryResultData, outliersData: QueryResultData, dataOptions?: BoxplotChartCustomDataOptions): QueryResultData;
|
|
22
|
+
export declare const executeBoxplotQuery: ({ app, chartDataOptions, dataSource, attributes, measures, filters, highlights, }: {
|
|
23
|
+
app: ClientApplication;
|
|
24
|
+
chartDataOptions: BoxplotChartDataOptionsInternal;
|
|
25
|
+
dataSource?: string | undefined;
|
|
26
|
+
attributes: Attribute[];
|
|
27
|
+
measures: Measure[];
|
|
28
|
+
filters?: Filter[] | undefined;
|
|
29
|
+
highlights?: Filter[] | undefined;
|
|
30
|
+
}) => Promise<QueryResultData>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataTable } from '../chart-data-processor/table-processor.js';
|
|
2
|
+
import { BoxplotChartData } from './types.js';
|
|
3
|
+
import { BoxplotChartDataOptionsInternal } from '../chart-data-options/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Creates data for box plot charts given chart data table and data options
|
|
6
|
+
*
|
|
7
|
+
* @param chartDataOptions - Data options for box plot chart
|
|
8
|
+
* @param dataTable - Chart data table
|
|
9
|
+
* @returns Box plot chart data
|
|
10
|
+
*/
|
|
11
|
+
export declare const boxplotData: (chartDataOptions: BoxplotChartDataOptionsInternal, dataTable: DataTable) => BoxplotChartData;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { DataTable } from '../chart-data-processor/table-processor';
|
|
2
|
-
import { CartesianChartData } from './types';
|
|
3
|
-
import { CartesianChartDataOptionsInternal } from '../chart-data-options/types';
|
|
1
|
+
import { Column, DataTable } from '../chart-data-processor/table-processor';
|
|
2
|
+
import { CartesianChartData, CategoricalXValues } from './types';
|
|
3
|
+
import { CartesianChartDataOptionsInternal, Value } from '../chart-data-options/types';
|
|
4
|
+
import { SortDirection } from '../types';
|
|
4
5
|
export declare const validateCartesianChartDataOptions: (chartDataOptions: CartesianChartDataOptionsInternal) => CartesianChartDataOptionsInternal;
|
|
5
6
|
export declare const cartesianData: (chartDataOptions: CartesianChartDataOptionsInternal, dataTable: DataTable) => CartesianChartData;
|
|
7
|
+
export declare const sortDirection: (sortType: SortDirection | undefined) => 1 | -1 | 0;
|
|
8
|
+
export declare const getOrderedXValues: (dataTable: DataTable, sortedMeasures: Value[], xColumns: Column[], rownumColumnName?: string) => CategoricalXValues[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DataColorOptions } from './types';
|
|
2
|
+
export type DataStructureOperator<DataStructure extends {}, ColoredDataStructure extends {}> = {
|
|
3
|
+
getValueFromDataStructure: (data: DataStructure) => number;
|
|
4
|
+
applyColorToDataStructure: (data: DataStructure, color?: string) => ColoredDataStructure;
|
|
5
|
+
};
|
|
6
|
+
export type ColoringFunction<DataStructure extends {}, ColoredDataStructure extends {}> = (dataStructures: DataStructure[], colorOpts: DataColorOptions) => ColoredDataStructure[];
|
|
7
|
+
export declare const createDataColoringFunction: <DataStructure extends {}, ColoredDataStructure extends {}>(dsOperator: DataStructureOperator<DataStructure, ColoredDataStructure>) => ColoringFunction<DataStructure, ColoredDataStructure>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DataColorOptions } from './types';
|
|
1
|
+
import { DataColorOptions } from './types.js';
|
|
2
2
|
export declare const legendColor: (colorOpts?: DataColorOptions) => string | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SeriesValueData } from '../types.js';
|
|
2
|
+
export declare const seriesDataColoringFunction: import("./create-data-coloring-function.js").ColoringFunction<SeriesValueData, {
|
|
3
|
+
color: string | undefined;
|
|
4
|
+
value: number;
|
|
5
|
+
blur?: boolean | undefined;
|
|
6
|
+
rawValue?: string | number | undefined;
|
|
7
|
+
xValue?: (string | number)[] | undefined;
|
|
8
|
+
xDisplayValue?: string[] | undefined;
|
|
9
|
+
xCompareValue?: (string | number)[] | undefined;
|
|
10
|
+
parent?: string | undefined;
|
|
11
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DataTable } from '../chart-data-processor/table-processor';
|
|
2
|
-
import {
|
|
2
|
+
import { IndicatorChartDataOptionsInternal } from '../chart-data-options/types';
|
|
3
3
|
import { IndicatorChartData } from './types';
|
|
4
|
-
export declare const indicatorData: (chartDataOptions:
|
|
4
|
+
export declare const indicatorData: (chartDataOptions: IndicatorChartDataOptionsInternal, dataTable: DataTable) => IndicatorChartData;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComparableData, DataTable } from '../chart-data-processor/table-processor';
|
|
2
|
-
import { ScatterCategories, ScatterChartData,
|
|
2
|
+
import { ScatterAxisCategoriesMap, ScatterCategories, ScatterChartData, ScatterDataTable } from './types';
|
|
3
3
|
import { ScatterChartDataOptionsInternal } from '../chart-data-options/types';
|
|
4
4
|
export declare const defaultScatterDataValue: ComparableData;
|
|
5
5
|
export type AxisColumnName = 'xAxis' | 'yAxis';
|
|
@@ -14,7 +14,7 @@ export declare const buildCategories: (data: ScatterDataTable, axisColumnName: A
|
|
|
14
14
|
export declare const createCategoriesMap: (xCategories?: ScatterCategories, yCategories?: ScatterCategories) => ScatterAxisCategoriesMap;
|
|
15
15
|
export declare const groupData: (chartDataOptions: ScatterChartDataOptionsInternal, dataTable: DataTable) => ScatterDataTable;
|
|
16
16
|
/**
|
|
17
|
-
* Creates data for scatter charts given chart data table and data options
|
|
17
|
+
* Creates data for scatter charts given chart data table and data options
|
|
18
18
|
*
|
|
19
19
|
* @param chartDataOptions - Data options for scatter chart
|
|
20
20
|
* @param dataTable - Chart data table
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ScattermapChartDataOptionsInternal } from '../chart-data-options/types.js';
|
|
2
|
+
import { DataTable } from '../chart-data-processor/table-processor.js';
|
|
3
|
+
import { ScattermapChartData } from './types.js';
|
|
4
|
+
export declare const scattermapData: (chartDataOptions: ScattermapChartDataOptionsInternal, dataTable: DataTable) => ScattermapChartData;
|
|
@@ -22,6 +22,30 @@ export type CategoricalSeriesValues = {
|
|
|
22
22
|
title?: string;
|
|
23
23
|
data: SeriesValueData[];
|
|
24
24
|
};
|
|
25
|
+
export type BoxplotSeriesValueData = {
|
|
26
|
+
low: number;
|
|
27
|
+
median: number;
|
|
28
|
+
high: number;
|
|
29
|
+
q1: number;
|
|
30
|
+
q3: number;
|
|
31
|
+
outliers: number[];
|
|
32
|
+
blur?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type BoxplotSeriesValues = {
|
|
35
|
+
name: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
data: BoxplotSeriesValueData[];
|
|
38
|
+
};
|
|
39
|
+
export type BoxplotOutliersSeriesValueData = {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
blur?: boolean;
|
|
43
|
+
};
|
|
44
|
+
export type BoxplotOutliersSeriesValues = {
|
|
45
|
+
name: string;
|
|
46
|
+
title?: string;
|
|
47
|
+
data: BoxplotOutliersSeriesValueData[];
|
|
48
|
+
};
|
|
25
49
|
export type Column = {
|
|
26
50
|
name: string;
|
|
27
51
|
type: string;
|
|
@@ -60,6 +84,17 @@ export type ScatterChartData = {
|
|
|
60
84
|
xCategories: ScatterCategories;
|
|
61
85
|
yCategories: ScatterCategories;
|
|
62
86
|
};
|
|
87
|
+
export type ScattermapChartLocation = {
|
|
88
|
+
name: string;
|
|
89
|
+
value: number;
|
|
90
|
+
colorValue?: number;
|
|
91
|
+
details?: number | string[];
|
|
92
|
+
blur: boolean;
|
|
93
|
+
};
|
|
94
|
+
export type ScattermapChartData = {
|
|
95
|
+
type: 'scattermap';
|
|
96
|
+
locations: ScattermapChartLocation[];
|
|
97
|
+
};
|
|
63
98
|
/**
|
|
64
99
|
* Fact final data that will be passed to chart-component to render
|
|
65
100
|
*
|
|
@@ -77,4 +112,14 @@ export type IndicatorChartData = {
|
|
|
77
112
|
*
|
|
78
113
|
* @internal
|
|
79
114
|
*/
|
|
80
|
-
export type
|
|
115
|
+
export type BoxplotChartData = {
|
|
116
|
+
type: 'boxplot';
|
|
117
|
+
xValues: CategoricalXValues[];
|
|
118
|
+
series: [BoxplotSeriesValues, BoxplotOutliersSeriesValues?];
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Fact final data that will be passed to chart-component to render
|
|
122
|
+
*
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
export type ChartData = CartesianChartData | CategoricalChartData | ScatterChartData | IndicatorChartData | BoxplotChartData | ScattermapChartData;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Color } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a color from the given palette colors array based on index.
|
|
4
|
+
* If no custom palette supplied, returns a color from the default palette.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getPaletteColor: (customPaletteColors: Color[] | undefined, index: number) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ChartDataOptions, ChartType } from '../types';
|
|
2
|
+
export declare function getTranslatedDataOptions(dataOptions: ChartDataOptions, chartType: ChartType): {
|
|
3
|
+
chartDataOptions: import("./types").ChartDataOptionsInternal;
|
|
4
|
+
attributes: import("packages/sdk-data/dist").Attribute[];
|
|
5
|
+
measures: import("packages/sdk-data/dist").Measure[];
|
|
6
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CalculatedMeasureColumn, Column, MeasureColumn } from '@sisense/sdk-data';
|
|
2
|
+
import { BoxplotChartDataOptions, BoxplotChartCustomDataOptions, BoxplotChartDataOptionsInternal, StyledColumn, BoxWhiskerType, StyledMeasureColumn } from './types';
|
|
3
|
+
export declare const generateBoxplotValues: (targetValue: Column | StyledColumn, boxType: BoxWhiskerType, outliersEnabled: boolean) => {
|
|
4
|
+
values: (MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
|
|
5
|
+
outliers: Column | StyledColumn | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare const translateBoxplotDataOptions: (boxplotDataOptions: BoxplotChartDataOptions | BoxplotChartCustomDataOptions) => BoxplotChartDataOptionsInternal;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ScattermapChartDataOptions, ScattermapChartDataOptionsInternal, ScattermapLocationLevel } from './types';
|
|
2
|
+
export declare function getLocationLevel(locationDataOptions: ScattermapChartDataOptions['locations']): ScattermapLocationLevel;
|
|
3
|
+
export declare function translateScattermapChartDataOptions(scattermap: ScattermapChartDataOptions): ScattermapChartDataOptionsInternal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DataColorOptions } from '../chart-data/
|
|
1
|
+
import type { DataColorOptions } from '../chart-data/data-coloring';
|
|
2
2
|
import type { NumberFormatConfig, SeriesChartType, SortDirection, ValueToColorMap, MultiColumnValueToColorMap } from '../types';
|
|
3
3
|
import { Column, MeasureColumn, CalculatedMeasureColumn } from '@sisense/sdk-data';
|
|
4
4
|
/**
|
|
@@ -56,9 +56,9 @@ export interface CategoryStyle {
|
|
|
56
56
|
* },
|
|
57
57
|
* ],
|
|
58
58
|
* value: [
|
|
59
|
-
*
|
|
59
|
+
* measureFactory.sum(DM.Commerce.Revenue),
|
|
60
60
|
* {
|
|
61
|
-
* column:
|
|
61
|
+
* column: measureFactory.sum(DM.Commerce.Quantity),
|
|
62
62
|
* showOnRightAxis: true,
|
|
63
63
|
* chartType: 'column',
|
|
64
64
|
* },
|
|
@@ -128,9 +128,9 @@ export type ValueStyle = {
|
|
|
128
128
|
* },
|
|
129
129
|
* ],
|
|
130
130
|
* value: [
|
|
131
|
-
*
|
|
131
|
+
* measureFactory.sum(DM.Commerce.Revenue),
|
|
132
132
|
* {
|
|
133
|
-
* column:
|
|
133
|
+
* column: measureFactory.sum(DM.Commerce.Quantity),
|
|
134
134
|
* showOnRightAxis: true,
|
|
135
135
|
* chartType: 'column',
|
|
136
136
|
* },
|
|
@@ -211,7 +211,7 @@ export interface CategoricalChartDataOptions {
|
|
|
211
211
|
* Configuration for how to query aggregate data and assign data
|
|
212
212
|
* to a {@link IndicatorChartType | Indicator chart}.
|
|
213
213
|
*/
|
|
214
|
-
export interface
|
|
214
|
+
export interface IndicatorChartDataOptions {
|
|
215
215
|
/** Measure columns (or measures) whose values are used for main value of indicator. */
|
|
216
216
|
value?: (MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
|
|
217
217
|
/** Measure columns (or measures) whose values are used for secondary value of indicator. */
|
|
@@ -294,14 +294,106 @@ export interface TableDataOptions {
|
|
|
294
294
|
*/
|
|
295
295
|
columns: (Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
|
|
296
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* Geographic location level for a Scattermap column.
|
|
299
|
+
* This type can have one of the following values:
|
|
300
|
+
* - 'auto': Automatically determines the appropriate location level.
|
|
301
|
+
* - 'country': Represents the country level in the geographical hierarchy.
|
|
302
|
+
* - 'state': Represents the state or province level in the geographical hierarchy.
|
|
303
|
+
* - 'city': Represents the city level in the geographical hierarchy.
|
|
304
|
+
*/
|
|
305
|
+
export type ScattermapLocationLevel = 'auto' | 'country' | 'state' | 'city';
|
|
306
|
+
/**
|
|
307
|
+
* Scattermap column that allows to specify the geographic location level.
|
|
308
|
+
*/
|
|
309
|
+
export interface ScattermapColumn extends StyledColumn {
|
|
310
|
+
level: ScattermapLocationLevel;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Configuration for how to query aggregate data and assign data
|
|
314
|
+
* to axes of a Scattermap chart.
|
|
315
|
+
*/
|
|
316
|
+
export interface ScattermapChartDataOptions {
|
|
317
|
+
/**
|
|
318
|
+
* Columns (or attributes) whose values represent locations on the map.
|
|
319
|
+
*/
|
|
320
|
+
locations: (Column | StyledColumn | ScattermapColumn)[];
|
|
321
|
+
/**
|
|
322
|
+
* Measure column (or measure) representing the size of the points on the map.
|
|
323
|
+
*/
|
|
324
|
+
size?: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
325
|
+
/**
|
|
326
|
+
* Measure column (or measure) representing the color of the points on the map.
|
|
327
|
+
*/
|
|
328
|
+
colorBy?: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
329
|
+
/**
|
|
330
|
+
* Column or measure column representing the additional details for the points on the map.
|
|
331
|
+
*/
|
|
332
|
+
details?: Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Represents the type of box whisker data algorithm, which can be either `iqr`, `extremums`, or `standardDeviation`.
|
|
336
|
+
*/
|
|
337
|
+
export type BoxWhiskerType = 'iqr' | 'extremums' | 'standardDeviation';
|
|
338
|
+
/**
|
|
339
|
+
* Configuration for how to query aggregate data and assign data
|
|
340
|
+
* to axes of a Boxplot chart.
|
|
341
|
+
*
|
|
342
|
+
* The Boxplot chart can receive a singular numeric column, which is utilized internally to calculate multiple metrics
|
|
343
|
+
* such as `whisker max`, `whisker min`, `box max`, `box median`, and `box min`.
|
|
344
|
+
*/
|
|
345
|
+
export type BoxplotChartDataOptions = {
|
|
346
|
+
/**
|
|
347
|
+
* Columns (or attributes) whose values represent categories in the chart.
|
|
348
|
+
*/
|
|
349
|
+
category: [(Column | StyledColumn)?];
|
|
350
|
+
/**
|
|
351
|
+
* Columns (or attributes) whose values represent the target numeric value column for computing boxplot metrics according to the selected `boxType`
|
|
352
|
+
*/
|
|
353
|
+
value: [Column | StyledColumn];
|
|
354
|
+
/**
|
|
355
|
+
* The type of box whisker data algorithm to be used.
|
|
356
|
+
*/
|
|
357
|
+
boxType: BoxWhiskerType;
|
|
358
|
+
/**
|
|
359
|
+
* Toggle flag whether outliers should be enabled in the boxplot chart.
|
|
360
|
+
*/
|
|
361
|
+
outliersEnabled?: boolean;
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* Configuration for how to query aggregate data and assign data
|
|
365
|
+
* to axes of a Boxplot chart.
|
|
366
|
+
*
|
|
367
|
+
* The Boxplot chart can receive multiple numeric columns, which represent all the metrics
|
|
368
|
+
* such as `whisker max`, `whisker min`, `box max`, `box median`, and `box min`.
|
|
369
|
+
*/
|
|
370
|
+
export type BoxplotChartCustomDataOptions = {
|
|
371
|
+
/**
|
|
372
|
+
* Columns (or attributes) whose values represent categories in the chart.
|
|
373
|
+
*/
|
|
374
|
+
category: [(Column | StyledColumn)?];
|
|
375
|
+
/**
|
|
376
|
+
* Measure columns (or measures) representing the target numeric values used for computing boxplot metrics.
|
|
377
|
+
*/
|
|
378
|
+
value: (Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
|
|
379
|
+
/**
|
|
380
|
+
* Optional measure columns (or measures) representing the boxplot outliers value.
|
|
381
|
+
*/
|
|
382
|
+
outliers?: [Column | StyledColumn];
|
|
383
|
+
/**
|
|
384
|
+
* The title for the numeric value column in the chart.
|
|
385
|
+
*/
|
|
386
|
+
valueTitle: string;
|
|
387
|
+
};
|
|
297
388
|
/**
|
|
298
389
|
* Configuration for querying aggregate data and assigning data to chart encodings.
|
|
299
390
|
*
|
|
300
391
|
* There are separate configurations for {@link CartesianChartDataOptions | Cartesian},
|
|
301
392
|
* {@link CategoricalChartDataOptions | Categorical},
|
|
302
|
-
* {@link ScatterChartDataOptions | Scatter},
|
|
393
|
+
* {@link ScatterChartDataOptions | Scatter}, {@link IndicatorChartDataOptions | Indicator},
|
|
394
|
+
* and {@link BoxplotChartDataOptions | Boxplot} charts.
|
|
303
395
|
*/
|
|
304
|
-
export type ChartDataOptions = CartesianChartDataOptions | CategoricalChartDataOptions | ScatterChartDataOptions |
|
|
396
|
+
export type ChartDataOptions = CartesianChartDataOptions | CategoricalChartDataOptions | ScatterChartDataOptions | IndicatorChartDataOptions | BoxplotChartDataOptions | BoxplotChartCustomDataOptions | ScattermapChartDataOptions;
|
|
305
397
|
/** @internal */
|
|
306
398
|
export interface Category extends CategoryStyle {
|
|
307
399
|
name: string;
|
|
@@ -341,15 +433,35 @@ export interface ScatterChartDataOptionsInternal {
|
|
|
341
433
|
seriesToColorMap?: ValueToColorMap;
|
|
342
434
|
}
|
|
343
435
|
/** @internal */
|
|
436
|
+
export interface ScattermapChartDataOptionsInternal {
|
|
437
|
+
locations: Category[];
|
|
438
|
+
size?: Value;
|
|
439
|
+
colorBy?: Value;
|
|
440
|
+
details?: Category | Value;
|
|
441
|
+
locationLevel: ScattermapLocationLevel;
|
|
442
|
+
}
|
|
443
|
+
/** @internal */
|
|
344
444
|
export type TableDataOptionsInternal = {
|
|
345
445
|
columns: (Category | Value)[];
|
|
346
446
|
};
|
|
347
447
|
/** @internal */
|
|
348
|
-
export type ChartDataOptionsInternal = CartesianChartDataOptionsInternal | CategoricalChartDataOptionsInternal | ScatterChartDataOptionsInternal |
|
|
448
|
+
export type ChartDataOptionsInternal = CartesianChartDataOptionsInternal | CategoricalChartDataOptionsInternal | ScatterChartDataOptionsInternal | IndicatorChartDataOptionsInternal | BoxplotChartDataOptionsInternal | ScattermapChartDataOptionsInternal;
|
|
349
449
|
/** @internal */
|
|
350
|
-
export type
|
|
450
|
+
export type IndicatorChartDataOptionsInternal = {
|
|
351
451
|
min?: Value[];
|
|
352
452
|
max?: Value[];
|
|
353
453
|
value?: Value[];
|
|
354
454
|
secondary?: Value[];
|
|
355
455
|
};
|
|
456
|
+
/** @internal */
|
|
457
|
+
export interface BoxplotChartDataOptionsInternal {
|
|
458
|
+
category?: Category;
|
|
459
|
+
boxMin: Value;
|
|
460
|
+
boxMedian: Value;
|
|
461
|
+
boxMax: Value;
|
|
462
|
+
whiskerMin: Value;
|
|
463
|
+
whiskerMax: Value;
|
|
464
|
+
outliersCount: Value;
|
|
465
|
+
outliers?: Category;
|
|
466
|
+
valueTitle: string;
|
|
467
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Attribute, CalculatedMeasureColumn, Column, Measure, MeasureColumn } from '@sisense/sdk-data';
|
|
2
|
-
import { Category, Value, StyledColumn, StyledMeasureColumn, AnyColumn } from './types';
|
|
2
|
+
import { Category, Value, StyledColumn, StyledMeasureColumn, AnyColumn, CategoryStyle } from './types';
|
|
3
|
+
export declare const splitColumn: (c: StyledColumn | Column) => {
|
|
4
|
+
column: Column;
|
|
5
|
+
style: CategoryStyle | undefined;
|
|
6
|
+
};
|
|
3
7
|
export declare const translateColumnToCategory: (c: StyledColumn | Column) => Category;
|
|
4
8
|
export declare const translateColumnToValue: (c: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn) => Value;
|
|
5
9
|
export declare const translateColumnToCategoryOrValue: (value: AnyColumn) => Value | Category;
|
|
@@ -9,3 +13,4 @@ export declare const translateValueToMeasure: (value: Value) => Measure;
|
|
|
9
13
|
export declare const translateCategoryToAttribute: (category: Category) => Attribute;
|
|
10
14
|
export declare const getDataOptionTitle: (option: Category | Value) => string;
|
|
11
15
|
export declare const translateColumnToAttribure: (c: StyledColumn | Column) => Attribute;
|
|
16
|
+
export declare const translateColumnToMeasure: (c: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn) => Measure;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BoxplotChartData } from '../chart-data/types';
|
|
2
|
+
import { BoxplotChartDataOptionsInternal } from '../chart-data-options/types';
|
|
3
|
+
import { HighchartsOptionsInternal } from './chart-options-service';
|
|
4
|
+
import { OptionsWithAlerts } from '../types';
|
|
5
|
+
import { BoxplotChartDesignOptions } from './translations/design-options';
|
|
6
|
+
/**
|
|
7
|
+
* Convert intermediate chart data, data options, and design options
|
|
8
|
+
* into pure highcharts config data.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getBoxplotChartOptions: (chartData: BoxplotChartData, chartDesignOptions: BoxplotChartDesignOptions, dataOptions: BoxplotChartDataOptionsInternal) => OptionsWithAlerts<HighchartsOptionsInternal>;
|