@sisense/sdk-ui 0.11.3
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/LICENSE.md +35 -0
- package/README.md +2 -0
- package/dist/alert-box/alert-box.d.ts +6 -0
- package/dist/app/client-application.d.ts +52 -0
- package/dist/app/settings/settings.d.ts +23 -0
- package/dist/app/settings/types/brand.d.ts +1 -0
- package/dist/app/settings/types/deployment-props.d.ts +37 -0
- package/dist/app/settings/types/ecm-props.d.ts +11 -0
- package/dist/app/settings/types/features.d.ts +124 -0
- package/dist/app/settings/types/globalization.d.ts +7 -0
- package/dist/app/settings/types/globals.d.ts +33 -0
- package/dist/app/settings/types/index.d.ts +1 -0
- package/dist/app/settings/types/role-manifest.d.ts +263 -0
- package/dist/app/settings/types/user.d.ts +51 -0
- package/dist/area-chart.d.ts +30 -0
- package/dist/bar-chart.d.ts +29 -0
- package/dist/chart-data/cartesian-data.d.ts +5 -0
- package/dist/chart-data/categorical-data.d.ts +5 -0
- package/dist/chart-data/chart-data-service.d.ts +18 -0
- package/dist/chart-data/filter-and-aggregate-chart-data.d.ts +4 -0
- package/dist/chart-data/indicator-data.d.ts +4 -0
- package/dist/chart-data/scatter-data.d.ts +23 -0
- package/dist/chart-data/series-data-color-service/index.d.ts +3 -0
- package/dist/chart-data/series-data-color-service/legend-color.d.ts +2 -0
- package/dist/chart-data/series-data-color-service/series-data-color-service.d.ts +4 -0
- package/dist/chart-data/series-data-color-service/types.d.ts +143 -0
- package/dist/chart-data/table-data.d.ts +6 -0
- package/dist/chart-data/types.d.ts +80 -0
- package/dist/chart-data/utils.d.ts +7 -0
- package/dist/chart-data-options/coloring/coloring-service.d.ts +22 -0
- package/dist/chart-data-options/coloring/conditional-coloring.d.ts +9 -0
- package/dist/chart-data-options/coloring/consts.d.ts +1 -0
- package/dist/chart-data-options/coloring/index.d.ts +1 -0
- package/dist/chart-data-options/coloring/range-coloring.d.ts +9 -0
- package/dist/chart-data-options/coloring/uniform-coloring.d.ts +4 -0
- package/dist/chart-data-options/translate-data-options.d.ts +7 -0
- package/dist/chart-data-options/types.d.ts +349 -0
- package/dist/chart-data-options/utils.d.ts +11 -0
- package/dist/chart-data-options/validate-data-options.d.ts +21 -0
- package/dist/chart-data-processor/categorical-distribution.d.ts +10 -0
- package/dist/chart-data-processor/data-table-date-period.d.ts +37 -0
- package/dist/chart-data-processor/distribution.d.ts +22 -0
- package/dist/chart-data-processor/row-comparator.d.ts +24 -0
- package/dist/chart-data-processor/table-creators.d.ts +39 -0
- package/dist/chart-data-processor/table-processor.d.ts +93 -0
- package/dist/chart-options-processor/apply-event-handlers.d.ts +49 -0
- package/dist/chart-options-processor/cartesian-chart-options.d.ts +18 -0
- package/dist/chart-options-processor/category-chart-options.d.ts +16 -0
- package/dist/chart-options-processor/chart-options-service.d.ts +253 -0
- package/dist/chart-options-processor/common-highcharts-option-service.d.ts +4 -0
- package/dist/chart-options-processor/defaults/cartesian.d.ts +45 -0
- package/dist/chart-options-processor/plot-bands.d.ts +23 -0
- package/dist/chart-options-processor/scatter-chart-options.d.ts +22 -0
- package/dist/chart-options-processor/style-to-design-options-translator/translate-style-to-design-options.d.ts +4 -0
- package/dist/chart-options-processor/style-to-design-options-translator/translate-to-highcharts-options.d.ts +13 -0
- package/dist/chart-options-processor/style-to-design-options-translator/translate-to-indicator-options.d.ts +3 -0
- package/dist/chart-options-processor/subtype-to-design-options.d.ts +97 -0
- package/dist/chart-options-processor/theme-option-service.d.ts +11 -0
- package/dist/chart-options-processor/tooltip.d.ts +29 -0
- package/dist/chart-options-processor/translations/axis-section.d.ts +105 -0
- package/dist/chart-options-processor/translations/base-design-options.d.ts +7 -0
- package/dist/chart-options-processor/translations/design-options.d.ts +118 -0
- package/dist/chart-options-processor/translations/funnel-plot-options.d.ts +53 -0
- package/dist/chart-options-processor/translations/funnel-series.d.ts +15 -0
- package/dist/chart-options-processor/translations/legend-section.d.ts +23 -0
- package/dist/chart-options-processor/translations/marker-section.d.ts +26 -0
- package/dist/chart-options-processor/translations/navigator.d.ts +32 -0
- package/dist/chart-options-processor/translations/number-format-config.d.ts +16 -0
- package/dist/chart-options-processor/translations/pie-plot-options.d.ts +29 -0
- package/dist/chart-options-processor/translations/pie-series.d.ts +19 -0
- package/dist/chart-options-processor/translations/scatter-axis.d.ts +7 -0
- package/dist/chart-options-processor/translations/scatter-plot-options.d.ts +22 -0
- package/dist/chart-options-processor/translations/scatter-series.d.ts +23 -0
- package/dist/chart-options-processor/translations/scatter-tooltip.d.ts +21 -0
- package/dist/chart-options-processor/translations/tooltip-utils.d.ts +39 -0
- package/dist/chart-options-processor/translations/tooltip.d.ts +3 -0
- package/dist/chart-options-processor/translations/translations-to-highcharts.d.ts +73 -0
- package/dist/chart-options-processor/translations/treemap/treemap-labels.d.ts +6 -0
- package/dist/chart-options-processor/translations/treemap/treemap-options.d.ts +6 -0
- package/dist/chart-options-processor/translations/treemap/treemap-series.d.ts +5 -0
- package/dist/chart-options-processor/translations/treemap/treemap-tooltip.d.ts +6 -0
- package/dist/chart-options-processor/translations/treemap/types.d.ts +19 -0
- package/dist/chart-options-processor/translations/types.d.ts +36 -0
- package/dist/chart-options-processor/translations/value-label-section.d.ts +28 -0
- package/dist/chart.d.ts +80 -0
- package/dist/charts/indicator/chart/gauge.d.ts +166 -0
- package/dist/charts/indicator/chart/indicator-helper.d.ts +47 -0
- package/dist/charts/indicator/chart/indicator.d.ts +39 -0
- package/dist/charts/indicator/chart/numeric-bar.d.ts +98 -0
- package/dist/charts/indicator/chart/numeric-simple.d.ts +91 -0
- package/dist/charts/indicator/chart/ticker.d.ts +65 -0
- package/dist/charts/indicator/indicator-legacy-chart-data-options.d.ts +36 -0
- package/dist/charts/indicator/indicator-legacy-chart-options/default-options.d.ts +4 -0
- package/dist/charts/indicator/indicator-legacy-chart-options/index.d.ts +1 -0
- package/dist/charts/indicator/indicator-legacy-chart-options/indicator-legacy-chart-options.d.ts +16 -0
- package/dist/charts/indicator/indicator-legacy-chart-options/legacy-chart-options-to-theme-settings-dictionary.d.ts +12 -0
- package/dist/charts/indicator/indicator-legacy-chart-options/override-with-theme-settings.d.ts +3 -0
- package/dist/charts/indicator/indicator-legacy-chart-options/override-with-value-color.d.ts +35 -0
- package/dist/charts/indicator/indicator-legacy-chart-options/utils/override-with-custom-settings.d.ts +22 -0
- package/dist/charts/indicator/types.d.ts +118 -0
- package/dist/charts/table/data-table-wrapper.d.ts +3 -0
- package/dist/charts/table/header/field-type-icon.d.ts +6 -0
- package/dist/charts/table/header/sortable-table-column-header.d.ts +10 -0
- package/dist/charts/table/helpers/calc-column-widths.d.ts +2 -0
- package/dist/charts/table/helpers/format-numbers.d.ts +3 -0
- package/dist/charts/table/helpers/get-cell-styles.d.ts +13 -0
- package/dist/charts/table/index.d.ts +3 -0
- package/dist/charts/table/pure-table.d.ts +8 -0
- package/dist/charts/table/styles/style-constants.d.ts +9 -0
- package/dist/charts/table/types.d.ts +83 -0
- package/dist/column-chart.d.ts +29 -0
- package/dist/dashboard-widget/dashboard-widget.d.ts +16 -0
- package/dist/dashboard-widget/fetch-widget.d.ts +11 -0
- package/dist/dashboard-widget/translate-panel-color-format.d.ts +5 -0
- package/dist/dashboard-widget/translate-widget-data-options.d.ts +7 -0
- package/dist/dashboard-widget/translate-widget-drilldown-options.d.ts +3 -0
- package/dist/dashboard-widget/translate-widget-filters.d.ts +16 -0
- package/dist/dashboard-widget/translate-widget-style-options.d.ts +5 -0
- package/dist/dashboard-widget/translate-widget.d.ts +12 -0
- package/dist/dashboard-widget/types.d.ts +336 -0
- package/dist/dashboard-widget/utils.d.ts +32 -0
- package/dist/decorators/as-sisense-component.d.ts +19 -0
- package/dist/decorators/with-error-boundary.d.ts +5 -0
- package/dist/decorators/with-sisense-context-validation.d.ts +7 -0
- package/dist/decorators/with-tracking/error-tracker.d.ts +20 -0
- package/dist/decorators/with-tracking/index.d.ts +1 -0
- package/dist/decorators/with-tracking/use-track-component-init.d.ts +5 -0
- package/dist/decorators/with-tracking/with-tracking.d.ts +10 -0
- package/dist/dynamic-size-container/default-size.d.ts +14 -0
- package/dist/dynamic-size-container/dynamic-size-container.d.ts +22 -0
- package/dist/dynamic-size-container/index.d.ts +2 -0
- package/dist/error-boundary/error-boundary-box.d.ts +13 -0
- package/dist/error-boundary/error-boundary.d.ts +34 -0
- package/dist/error-boundary/use-set-error.d.ts +2 -0
- package/dist/filters/components/common/buttons.d.ts +10 -0
- package/dist/filters/components/common/checkbox.d.ts +7 -0
- package/dist/filters/components/common/date-range-field-button.d.ts +13 -0
- package/dist/filters/components/common/index.d.ts +5 -0
- package/dist/filters/components/common/input.d.ts +7 -0
- package/dist/filters/components/common/radio.d.ts +6 -0
- package/dist/filters/components/common/switch.d.ts +1 -0
- package/dist/filters/components/date-filter/consts.d.ts +1 -0
- package/dist/filters/components/date-filter/date-filter/calendar-date-selector.d.ts +20 -0
- package/dist/filters/components/date-filter/date-filter/calendar-header.d.ts +12 -0
- package/dist/filters/components/date-filter/date-filter/date-filter.d.ts +61 -0
- package/dist/filters/components/date-filter/date-filter/date-range-calculator.d.ts +8 -0
- package/dist/filters/components/date-filter/date-filter/index.d.ts +1 -0
- package/dist/filters/components/date-filter/date-filter/quick-date-selection-buttons.d.ts +13 -0
- package/dist/filters/components/date-filter/date-filter/styled-date-picker.d.ts +7 -0
- package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +63 -0
- package/dist/filters/components/date-filter/date-range-filter-tile/index.d.ts +1 -0
- package/dist/filters/components/date-filter/date-range-filter-tile/use-date-limits.d.ts +7 -0
- package/dist/filters/components/date-filter/index.d.ts +2 -0
- package/dist/filters/components/date-filter/types.d.ts +14 -0
- package/dist/filters/components/filter-tile.d.ts +14 -0
- package/dist/filters/components/icons/arrow-down-icon.d.ts +2 -0
- package/dist/filters/components/icons/arrow-right-icon.d.ts +2 -0
- package/dist/filters/components/icons/date-icon.d.ts +5 -0
- package/dist/filters/components/icons/double-arrow-right-icon.d.ts +2 -0
- package/dist/filters/components/icons/index.d.ts +7 -0
- package/dist/filters/components/icons/menu-icon.d.ts +2 -0
- package/dist/filters/components/icons/pencil-icon.d.ts +2 -0
- package/dist/filters/components/icons/plus-icon.d.ts +2 -0
- package/dist/filters/components/icons/search-icon.d.ts +2 -0
- package/dist/filters/components/icons/trash-icon.d.ts +2 -0
- package/dist/filters/components/member-filter-tile/basic-member-filter-tile.d.ts +50 -0
- package/dist/filters/components/member-filter-tile/index.d.ts +3 -0
- package/dist/filters/components/member-filter-tile/member-filter-tile.d.ts +46 -0
- package/dist/filters/components/member-filter-tile/member-list.d.ts +11 -0
- package/dist/filters/components/member-filter-tile/members-reducer.d.ts +32 -0
- package/dist/filters/components/member-filter-tile/pill-section.d.ts +9 -0
- package/dist/filters/components/member-filter-tile/use-members.d.ts +14 -0
- package/dist/filters/components/member-filter-tile/use-validate-members.d.ts +8 -0
- package/dist/filters/index.d.ts +2 -0
- package/dist/funnel-chart.d.ts +47 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +71761 -0
- package/dist/indicator-canvas.d.ts +21 -0
- package/dist/indicator-chart.d.ts +60 -0
- package/dist/line-chart.d.ts +28 -0
- package/dist/locales/en.d.ts +17 -0
- package/dist/no-results-overlay/images/index.d.ts +2 -0
- package/dist/no-results-overlay/no-results-overlay.d.ts +13 -0
- package/dist/pie-chart.d.ts +28 -0
- package/dist/polar-chart.d.ts +28 -0
- package/dist/props.d.ts +882 -0
- package/dist/query/date-formats/angular-text-date-format-replacers.d.ts +5 -0
- package/dist/query/date-formats/apply-date-format.d.ts +65 -0
- package/dist/query/date-formats/fiscal-date-format-replacers.d.ts +33 -0
- package/dist/query/date-formats/index.d.ts +2 -0
- package/dist/query/date-formats/new-date-format.d.ts +16 -0
- package/dist/query/date-formats/simple-date-format-replacers.d.ts +4 -0
- package/dist/query/execute-query.d.ts +8 -0
- package/dist/query/query-result-date-formatting.d.ts +5 -0
- package/dist/query-execution/execute-query-by-widget-id.d.ts +29 -0
- package/dist/query-execution/execute-query.d.ts +32 -0
- package/dist/query-execution/index.d.ts +5 -0
- package/dist/query-execution/query-state-reducer.d.ts +66 -0
- package/dist/query-execution/use-execute-query-by-widget-id.d.ts +71 -0
- package/dist/query-execution/use-execute-query.d.ts +70 -0
- package/dist/query-execution/utils.d.ts +9 -0
- package/dist/scatter-chart.d.ts +68 -0
- package/dist/sisense-chart.d.ts +23 -0
- package/dist/sisense-context/custom-sisense-context-provider.d.ts +19 -0
- package/dist/sisense-context/sisense-context-provider.d.ts +36 -0
- package/dist/sisense-context/sisense-context.d.ts +9 -0
- package/dist/table/hooks/use-table-data.d.ts +11 -0
- package/dist/table/hooks/use-table-datatable.d.ts +11 -0
- package/dist/table/index.d.ts +1 -0
- package/dist/table/styles/get-custom-pagination-styles.d.ts +10 -0
- package/dist/table/table.d.ts +50 -0
- package/dist/theme-provider/custom-theme-provider.d.ts +18 -0
- package/dist/theme-provider/index.d.ts +1 -0
- package/dist/theme-provider/theme-provider.d.ts +45 -0
- package/dist/theme-provider/use-theme-settings.d.ts +12 -0
- package/dist/themes/legacy-design-settings.d.ts +84 -0
- package/dist/themes/theme-loader.d.ts +14 -0
- package/dist/treemap-chart.d.ts +34 -0
- package/dist/types.d.ts +692 -0
- package/dist/utils/color/color-interpolation.d.ts +37 -0
- package/dist/utils/color/index.d.ts +1 -0
- package/dist/utils/data-limit-warning.d.ts +2 -0
- package/dist/utils/dedupe.d.ts +1 -0
- package/dist/utils/filters-comparator.d.ts +11 -0
- package/dist/utils/utility-types.d.ts +39 -0
- package/dist/vite.svg +1 -0
- package/dist/widgets/chart-widget.d.ts +30 -0
- package/dist/widgets/common/context-menu.d.ts +3 -0
- package/dist/widgets/common/custom-drilldown.d.ts +20 -0
- package/dist/widgets/common/drilldown-breadcrumbs/drilldown-breadcrumbs.d.ts +4 -0
- package/dist/widgets/common/drilldown-breadcrumbs/index.d.ts +1 -0
- package/dist/widgets/common/drilldown-breadcrumbs/use-buttons.d.ts +27 -0
- package/dist/widgets/common/drilldown-breadcrumbs/use-popper.d.ts +24 -0
- package/dist/widgets/common/drilldown-breadcrumbs/use-theme-for-breadcrumbs.d.ts +11 -0
- package/dist/widgets/common/drilldown.d.ts +32 -0
- package/dist/widgets/common/use-widget-drilldown.d.ts +2 -0
- package/dist/widgets/common/widget-header.d.ts +11 -0
- package/dist/widgets/common/widget-style-utils.d.ts +13 -0
- package/dist/widgets/drilldown-widget.d.ts +49 -0
- package/dist/widgets/table-widget.d.ts +23 -0
- package/package.json +110 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import type { DataColorOptions } from '../chart-data/series-data-color-service';
|
|
2
|
+
import type { NumberFormatConfig, SeriesChartType, SortDirection, ValueToColorMap } from '../types';
|
|
3
|
+
import { Column, MeasureColumn, CalculatedMeasureColumn } from '@sisense/sdk-data';
|
|
4
|
+
/**
|
|
5
|
+
* Styles for a category/column when visualized in a chart
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export interface CategoryStyle {
|
|
10
|
+
/** {@inheritDoc NumberFormatConfig} */
|
|
11
|
+
numberFormatConfig?: NumberFormatConfig;
|
|
12
|
+
/**
|
|
13
|
+
* Date format.
|
|
14
|
+
*
|
|
15
|
+
* See [ECMAScript Date Time String Format](https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-date-time-string-format)
|
|
16
|
+
*/
|
|
17
|
+
dateFormat?: string;
|
|
18
|
+
/** Boolean flag to toggle continuous timeline on this date column. */
|
|
19
|
+
continuous?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Date granularity that works with continuous timeline.
|
|
22
|
+
*
|
|
23
|
+
* Values from {@link @sisense/sdk-data!DateLevels}.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
granularity?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Toggle flag for this category/column in the chart.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
/** {@inheritDoc SortDirection} */
|
|
34
|
+
sortType?: SortDirection;
|
|
35
|
+
isColored?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Wrapped {@link @sisense/sdk-data!Column} with styles controlling how the column is visualized in a chart.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* An example of using `StyledColumn` to change the date format of the months displayed on the x-axis.
|
|
42
|
+
*
|
|
43
|
+
*
|
|
44
|
+
* ```tsx
|
|
45
|
+
* <Chart
|
|
46
|
+
* dataSet={DM.DataSource}
|
|
47
|
+
* chartType={'line'}
|
|
48
|
+
* dataOptions={{
|
|
49
|
+
* category: [
|
|
50
|
+
* {
|
|
51
|
+
* column: DM.Commerce.Date.Months,
|
|
52
|
+
* dateFormat: 'yy-MM',
|
|
53
|
+
* },
|
|
54
|
+
* ],
|
|
55
|
+
* value: [
|
|
56
|
+
* measures.sum(DM.Commerce.Revenue),
|
|
57
|
+
* {
|
|
58
|
+
* column: measures.sum(DM.Commerce.Quantity),
|
|
59
|
+
* showOnRightAxis: true,
|
|
60
|
+
* chartType: 'column',
|
|
61
|
+
* },
|
|
62
|
+
* ],
|
|
63
|
+
* breakBy: [],
|
|
64
|
+
* }}
|
|
65
|
+
* />
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* <img src="media://chart-mixed-series-example-1.png" width="800px" />
|
|
69
|
+
*
|
|
70
|
+
* Also, see {@link StyledMeasureColumn}.
|
|
71
|
+
*/
|
|
72
|
+
export interface StyledColumn extends CategoryStyle {
|
|
73
|
+
/** Wrapped Column */
|
|
74
|
+
column: Column;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Styles for a value/measure when it is visualized in a chart.
|
|
78
|
+
*
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
export type ValueStyle = {
|
|
82
|
+
/** {@inheritDoc SortDirection} */
|
|
83
|
+
sortType?: SortDirection;
|
|
84
|
+
/**
|
|
85
|
+
* Boolean flag whether to show this value/measure
|
|
86
|
+
* on the right axis (`true`) or on the left axis (`false`).
|
|
87
|
+
*/
|
|
88
|
+
showOnRightAxis?: boolean;
|
|
89
|
+
/** {@inheritDoc NumberFormatConfig} */
|
|
90
|
+
numberFormatConfig?: NumberFormatConfig;
|
|
91
|
+
/** {@inheritDoc SeriesChartType} */
|
|
92
|
+
chartType?: SeriesChartType;
|
|
93
|
+
/** {@inheritDoc DataColorOptions} */
|
|
94
|
+
color?: DataColorOptions;
|
|
95
|
+
/**
|
|
96
|
+
* Toggle flag for this value/measure in the chart.
|
|
97
|
+
*
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
enabled?: boolean;
|
|
101
|
+
/** Boolean flag whether null values are treated as zeros in the chart */
|
|
102
|
+
treatNullDataAsZeros?: boolean;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Wrapped {@link @sisense/sdk-data!MeasureColumn | Measure Column} with styles
|
|
106
|
+
* controlling how the measure is visualized in a chart.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* Example of using `StyledMeasureColumn` to mix a column series of `Total Revenue` to a line chart.
|
|
110
|
+
*
|
|
111
|
+
* Note that the chart doesn't display a second Y-axis on the right but that can be customized by
|
|
112
|
+
* style options.
|
|
113
|
+
*
|
|
114
|
+
* ```tsx
|
|
115
|
+
* <Chart
|
|
116
|
+
* dataSet={DM.DataSource}
|
|
117
|
+
* chartType={'line'}
|
|
118
|
+
* dataOptions={{
|
|
119
|
+
* category: [
|
|
120
|
+
* {
|
|
121
|
+
* column: DM.Commerce.Date.Months,
|
|
122
|
+
* dateFormat: 'yy-MM',
|
|
123
|
+
* },
|
|
124
|
+
* ],
|
|
125
|
+
* value: [
|
|
126
|
+
* measures.sum(DM.Commerce.Revenue),
|
|
127
|
+
* {
|
|
128
|
+
* column: measures.sum(DM.Commerce.Quantity),
|
|
129
|
+
* showOnRightAxis: true,
|
|
130
|
+
* chartType: 'column',
|
|
131
|
+
* },
|
|
132
|
+
* ],
|
|
133
|
+
* breakBy: [],
|
|
134
|
+
* }}
|
|
135
|
+
* />
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* <img src="media://chart-mixed-series-example-1.png" width="800px" />
|
|
139
|
+
*
|
|
140
|
+
* See also {@link StyledColumn}.
|
|
141
|
+
*/
|
|
142
|
+
export interface StyledMeasureColumn extends ValueStyle {
|
|
143
|
+
/** Wrapped MeasureColumn or CalculatedMeasureColumn */
|
|
144
|
+
column: MeasureColumn | CalculatedMeasureColumn;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
export type AnyColumn = Column | StyledColumn | MeasureColumn | StyledMeasureColumn | CalculatedMeasureColumn;
|
|
150
|
+
/**
|
|
151
|
+
* Configuration for how to query aggregate data and assign data
|
|
152
|
+
* to axes of a {@link CartesianChartType | Cartesian chart}.
|
|
153
|
+
*
|
|
154
|
+
* These charts can include multiple values on both the X and Y-axis,
|
|
155
|
+
* as well as a break-down by categories displayed on the Y-axis.
|
|
156
|
+
*/
|
|
157
|
+
export interface CartesianChartDataOptions {
|
|
158
|
+
/**
|
|
159
|
+
* Columns (or attributes) whose values are placed on the X-axis.
|
|
160
|
+
*
|
|
161
|
+
* Typically, the X-axis represents descriptive data.
|
|
162
|
+
*/
|
|
163
|
+
category: (Column | StyledColumn)[];
|
|
164
|
+
/**
|
|
165
|
+
* Measure columns (or measures) whose values are scaled to the Y-axis of the chart.
|
|
166
|
+
*
|
|
167
|
+
* Each measure is represented as a series in the chart.
|
|
168
|
+
*
|
|
169
|
+
*/
|
|
170
|
+
value: (MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
|
|
171
|
+
/**
|
|
172
|
+
* Columns (or attributes) by which to break (group) the data represented in the chart.
|
|
173
|
+
*
|
|
174
|
+
* Each group is represented by a different visual encoding - for example, color of bars in a bar chart,
|
|
175
|
+
* and is automatically added to the chart's legend.
|
|
176
|
+
*/
|
|
177
|
+
breakBy: (Column | StyledColumn)[];
|
|
178
|
+
/**
|
|
179
|
+
* Optional mapping of each of the series to colors.
|
|
180
|
+
*/
|
|
181
|
+
seriesToColorMap?: ValueToColorMap;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Configuration for how to query aggregate data and assign data
|
|
185
|
+
* to a {@link CategoricalChartType | Categorical chart}.
|
|
186
|
+
*/
|
|
187
|
+
export interface CategoricalChartDataOptions {
|
|
188
|
+
/**
|
|
189
|
+
* Measure columns (or measures) whose values are scaled to visual elements of the chart.
|
|
190
|
+
* For example, the size of the pie slices of a pie chart.
|
|
191
|
+
*
|
|
192
|
+
* Values are typically used to represent numeric data.
|
|
193
|
+
*/
|
|
194
|
+
value: (MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
|
|
195
|
+
/**
|
|
196
|
+
* Columns (or attributes) whose values represent categories in the chart.
|
|
197
|
+
*/
|
|
198
|
+
category: (Column | StyledColumn)[];
|
|
199
|
+
/**
|
|
200
|
+
* Optional mapping of each of the series to colors.
|
|
201
|
+
*/
|
|
202
|
+
seriesToColorMap?: ValueToColorMap;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Configuration for how to query aggregate data and assign data
|
|
206
|
+
* to a {@link IndicatorChartType | Indicator chart}.
|
|
207
|
+
*/
|
|
208
|
+
export interface IndicatorDataOptions {
|
|
209
|
+
/** Measure columns (or measures) whose values are used for main value of indicator. */
|
|
210
|
+
value?: (MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
|
|
211
|
+
/** Measure columns (or measures) whose values are used for secondary value of indicator. */
|
|
212
|
+
secondary?: (MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
|
|
213
|
+
/** Measure columns (or measures) whose values are used for min value of indicator. */
|
|
214
|
+
min?: (MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
|
|
215
|
+
/** Measure columns (or measures) whose values are used for max value of indicator. */
|
|
216
|
+
max?: (MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Configuration for how to query aggregate data and assign data
|
|
220
|
+
* to axes of a {@link ScatterChartType | Scatter chart}.
|
|
221
|
+
*
|
|
222
|
+
* These charts can include data points scattered on X-Y plane further broken down by categories
|
|
223
|
+
* and encoded by bubble sizes.
|
|
224
|
+
*/
|
|
225
|
+
export interface ScatterChartDataOptions {
|
|
226
|
+
/**
|
|
227
|
+
* A column or measure column whose values are placed on the X-axis.
|
|
228
|
+
*
|
|
229
|
+
* Typically, the X-axis of a Scatter Chart is used to represent numeric data.
|
|
230
|
+
* Alternatively, Descriptive data is also supported. At most one column is allowed.
|
|
231
|
+
*/
|
|
232
|
+
x?: Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
233
|
+
/**
|
|
234
|
+
* A column or measure column whose values are placed on the Y-axis.
|
|
235
|
+
*
|
|
236
|
+
* Typically, the Y-axis of a Scatter Chart is used to represent numeric data.
|
|
237
|
+
* Alternatively, Descriptive data is also supported. At most one column is allowed.
|
|
238
|
+
*/
|
|
239
|
+
y?: Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
240
|
+
/**
|
|
241
|
+
* A column to be scattered across the chart as circles;
|
|
242
|
+
* one point (circle) appears on the chart for each member of this column.
|
|
243
|
+
* These columns must be descriptive data (not numeric data).
|
|
244
|
+
*
|
|
245
|
+
* You can only add a break-by point if either the X-axis or the Y-axis was defined to represent numeric data.
|
|
246
|
+
*/
|
|
247
|
+
breakByPoint?: Column | StyledColumn;
|
|
248
|
+
/**
|
|
249
|
+
* Select a column by which to break (group) the columns in the chart.
|
|
250
|
+
* This must be a descriptive column. If you select descriptive data,
|
|
251
|
+
* then the points in the chart are grouped into the members of the column.
|
|
252
|
+
* Each member is represented by a different color.
|
|
253
|
+
*
|
|
254
|
+
* OR
|
|
255
|
+
*
|
|
256
|
+
* Select a column by which to color the columns in the chart.
|
|
257
|
+
* This must be a numeric column. If you select numeric data,
|
|
258
|
+
* then the point color is a gradient where the highest value is
|
|
259
|
+
* the darkest color and the lowest value is the lightest color.
|
|
260
|
+
*
|
|
261
|
+
*/
|
|
262
|
+
breakByColor?: Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
263
|
+
/**
|
|
264
|
+
* Column that determines the size of the circle. It must be numeric data.
|
|
265
|
+
*
|
|
266
|
+
*/
|
|
267
|
+
size?: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
268
|
+
/**
|
|
269
|
+
* Optional mapping of each of the series created by {@link breakByColor} to colors.
|
|
270
|
+
*/
|
|
271
|
+
seriesToColorMap?: ValueToColorMap;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Checks if the given argument is a measure column.
|
|
275
|
+
*
|
|
276
|
+
* @param arg
|
|
277
|
+
* @internal
|
|
278
|
+
*/
|
|
279
|
+
export declare function isMeasureColumn(arg: AnyColumn): arg is MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
|
|
280
|
+
/**
|
|
281
|
+
* Configuration for how to query data and assign data to {@link Table}.
|
|
282
|
+
*
|
|
283
|
+
*/
|
|
284
|
+
export type TableDataOptions = {
|
|
285
|
+
/**
|
|
286
|
+
* Columns (or attributes) whose values represent data columns in table
|
|
287
|
+
*
|
|
288
|
+
*/
|
|
289
|
+
columns: (Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Configuration for querying aggregate data and assigning data to chart encodings.
|
|
293
|
+
*
|
|
294
|
+
* There are separate configurations for {@link CartesianChartDataOptions | Cartesian},
|
|
295
|
+
* {@link CategoricalChartDataOptions | Categorical},
|
|
296
|
+
* {@link ScatterChartDataOptions | Scatter}, and {@link IndicatorDataOptions | Indicator} charts.
|
|
297
|
+
*/
|
|
298
|
+
export type ChartDataOptions = CartesianChartDataOptions | CategoricalChartDataOptions | ScatterChartDataOptions | IndicatorDataOptions;
|
|
299
|
+
/** @internal */
|
|
300
|
+
export interface Category extends CategoryStyle {
|
|
301
|
+
name: string;
|
|
302
|
+
type: string;
|
|
303
|
+
title?: string;
|
|
304
|
+
}
|
|
305
|
+
/** @internal */
|
|
306
|
+
export declare const isValue: (arg: Category | Value) => arg is Value;
|
|
307
|
+
/** @internal */
|
|
308
|
+
export declare const isCategory: (arg: Category | Value) => arg is Category;
|
|
309
|
+
/** @internal */
|
|
310
|
+
export interface Value extends ValueStyle {
|
|
311
|
+
name: string;
|
|
312
|
+
aggregation?: string;
|
|
313
|
+
title: string;
|
|
314
|
+
}
|
|
315
|
+
/** @internal */
|
|
316
|
+
export interface CartesianChartDataOptionsInternal {
|
|
317
|
+
x: Category[];
|
|
318
|
+
y: Value[];
|
|
319
|
+
breakBy: Category[];
|
|
320
|
+
seriesToColorMap?: ValueToColorMap;
|
|
321
|
+
}
|
|
322
|
+
/** @internal */
|
|
323
|
+
export interface CategoricalChartDataOptionsInternal {
|
|
324
|
+
y: Value[];
|
|
325
|
+
breakBy: Category[];
|
|
326
|
+
seriesToColorMap?: ValueToColorMap;
|
|
327
|
+
}
|
|
328
|
+
/** @internal */
|
|
329
|
+
export interface ScatterChartDataOptionsInternal {
|
|
330
|
+
x?: Value | Category;
|
|
331
|
+
y?: Value | Category;
|
|
332
|
+
breakByPoint?: Category;
|
|
333
|
+
breakByColor?: Category | Value;
|
|
334
|
+
size?: Value;
|
|
335
|
+
seriesToColorMap?: ValueToColorMap;
|
|
336
|
+
}
|
|
337
|
+
/** @internal */
|
|
338
|
+
export type TableDataOptionsInternal = {
|
|
339
|
+
columns: (Category | Value)[];
|
|
340
|
+
};
|
|
341
|
+
/** @internal */
|
|
342
|
+
export type ChartDataOptionsInternal = CartesianChartDataOptionsInternal | CategoricalChartDataOptionsInternal | ScatterChartDataOptionsInternal | IndicatorDataOptionsInternal;
|
|
343
|
+
/** @internal */
|
|
344
|
+
export type IndicatorDataOptionsInternal = {
|
|
345
|
+
min?: Value[];
|
|
346
|
+
max?: Value[];
|
|
347
|
+
value?: Value[];
|
|
348
|
+
secondary?: Value[];
|
|
349
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Attribute, CalculatedMeasureColumn, Column, Measure, MeasureColumn } from '@sisense/sdk-data';
|
|
2
|
+
import { Category, Value, StyledColumn, StyledMeasureColumn, AnyColumn } from './types';
|
|
3
|
+
export declare const translateColumnToCategory: (c: StyledColumn | Column) => Category;
|
|
4
|
+
export declare const translateColumnToValue: (c: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn) => Value;
|
|
5
|
+
export declare const translateColumnToCategoryOrValue: (value: AnyColumn) => Value | Category;
|
|
6
|
+
export declare const translateMeasureToValue: (measure: Measure) => Value;
|
|
7
|
+
export declare const translateAttributeToCategory: (attribute: Attribute) => Category;
|
|
8
|
+
export declare const translateValueToMeasure: (value: Value) => Measure;
|
|
9
|
+
export declare const translateCategoryToAttribute: (category: Category) => Attribute;
|
|
10
|
+
export declare const getDataOptionTitle: (option: Category | Value) => string;
|
|
11
|
+
export declare const translateColumnToAttribure: (c: StyledColumn | Column) => Attribute;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChartDataOptions, ChartDataOptionsInternal, Value } from './types';
|
|
2
|
+
import { ChartType } from '../types';
|
|
3
|
+
import { Attribute, Data, Filter, Measure } from '@sisense/sdk-data';
|
|
4
|
+
import { DataTable } from '../chart-data-processor/table-processor';
|
|
5
|
+
export type DataColumnNamesMapping = Record<string, string>;
|
|
6
|
+
/**
|
|
7
|
+
* Generates and applies unique data column names and creates a mapping of new names to original names.
|
|
8
|
+
*
|
|
9
|
+
* @param measures - An array of Value objects representing measures.
|
|
10
|
+
* @returns - The mapping of unique names to original names.
|
|
11
|
+
*/
|
|
12
|
+
export declare const generateUniqueDataColumnsNames: (measures: Value[]) => DataColumnNamesMapping;
|
|
13
|
+
/**
|
|
14
|
+
* Applies default chart data options based on input chart type.
|
|
15
|
+
*/
|
|
16
|
+
export declare const applyDefaultChartDataOptions: (chartDataOptions: ChartDataOptionsInternal, chartType: ChartType) => ChartDataOptionsInternal;
|
|
17
|
+
/**
|
|
18
|
+
* Validates attributes, measures, filters, and highlights against the columns in data.
|
|
19
|
+
*/
|
|
20
|
+
export declare const validateDataOptionsAgainstData: (data: Data | DataTable, attributes: Attribute[], measures: Measure[], dataColumnNamesMapping: DataColumnNamesMapping, filters?: Filter[], highlights?: Filter[]) => boolean;
|
|
21
|
+
export declare function validateDataOptions(chartType: ChartType, dataOptions: ChartDataOptions): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type CategoricalStat = 'count' | 'countdistinct';
|
|
2
|
+
export declare class CategoricalDistribution {
|
|
3
|
+
data: string[];
|
|
4
|
+
countDistinct: number | undefined;
|
|
5
|
+
constructor(data: string[]);
|
|
6
|
+
getStat(stat: string): number;
|
|
7
|
+
getN(): number;
|
|
8
|
+
getCount(): number;
|
|
9
|
+
getCountDistinct(): number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Locale } from 'date-fns';
|
|
2
|
+
export type SystemSettings = {
|
|
3
|
+
language: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const getBaseDateFnsLocale: (systemSettings?: SystemSettings) => Locale;
|
|
6
|
+
export declare enum DatePeriod {
|
|
7
|
+
YEAR = "years",
|
|
8
|
+
QUARTER = "quarters",
|
|
9
|
+
MONTH = "months",
|
|
10
|
+
WEEK = "weeks",
|
|
11
|
+
DATE = "dates"
|
|
12
|
+
}
|
|
13
|
+
export type DateFnsDate = Date | number;
|
|
14
|
+
export declare const startOfPeriod: (period: DatePeriod, date: DateFnsDate, locale: Locale) => Date;
|
|
15
|
+
export declare const formatPeriod: (period: ExtendedDatePeriod, date: number, locale: Locale) => string;
|
|
16
|
+
export declare const parseDataTableDateValue: (value: string) => Date;
|
|
17
|
+
export declare const toPeriodCompareValue: (period: ExtendedDatePeriod, value: string, locale: Locale) => number;
|
|
18
|
+
export declare const periodCompareValueForSpecificDate: (period: DatePeriod, date: Date | number, locale: Locale) => number;
|
|
19
|
+
export declare const periodCompareValueForNow: (period: DatePeriod, locale: Locale) => number;
|
|
20
|
+
export declare const periodCompareValueForPastPeriod: (period: DatePeriod, num: number, refDate: number | undefined, locale: Locale) => number;
|
|
21
|
+
export declare const periodCompareValueForFuturePeriod: (period: DatePeriod, num: number, refDate: number | undefined, locale: Locale) => number;
|
|
22
|
+
export declare enum PseudoDatePeriod {
|
|
23
|
+
QUARTER_NUM = "quarterNumber",
|
|
24
|
+
MONTH_NAME = "monthName",
|
|
25
|
+
DAY_OF_WEEK = "dayOfWeek",
|
|
26
|
+
TIME_OF_DAY = "timeOfDay"
|
|
27
|
+
}
|
|
28
|
+
export type ExtendedDatePeriod = DatePeriod | PseudoDatePeriod;
|
|
29
|
+
export declare const isDatePeriod: (period: ExtendedDatePeriod) => period is DatePeriod;
|
|
30
|
+
export declare const isPseudoDatePeriod: (period: ExtendedDatePeriod) => period is PseudoDatePeriod;
|
|
31
|
+
export type PseudoDatePeriodConfig<T> = {
|
|
32
|
+
[key in PseudoDatePeriod]: T;
|
|
33
|
+
};
|
|
34
|
+
export declare const formatPseudoPeriod: (period: PseudoDatePeriod, date: number, locale: Locale) => string;
|
|
35
|
+
export declare const PSEUDO_PERIOD_VALUES: PseudoDatePeriodConfig<number[]>;
|
|
36
|
+
export declare const toPseudoPeriodCompareValue: (period: PseudoDatePeriod, value: string) => number;
|
|
37
|
+
export declare const today: () => Date;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type Stat = 'sum' | 'max' | 'min' | 'count' | 'countdistinct' | 'average' | 'mean' | 'avg' | 'variance' | 'var' | 'stddev';
|
|
2
|
+
export declare class Distribution {
|
|
3
|
+
data: number[];
|
|
4
|
+
sum: number | undefined;
|
|
5
|
+
max: number | undefined;
|
|
6
|
+
min: number | undefined;
|
|
7
|
+
avg: number | undefined;
|
|
8
|
+
variance: number | undefined;
|
|
9
|
+
stddev: number | undefined;
|
|
10
|
+
constructor(data: number[]);
|
|
11
|
+
getStat(stat: string): number;
|
|
12
|
+
getSum(): number;
|
|
13
|
+
getMax(): number;
|
|
14
|
+
getMin(): number;
|
|
15
|
+
getMean(): number;
|
|
16
|
+
getAverage(): number;
|
|
17
|
+
getN(): number;
|
|
18
|
+
getCount(): number;
|
|
19
|
+
getCountDistinct(): number;
|
|
20
|
+
getVariance(): number;
|
|
21
|
+
getStdDev(): number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Row, Column, ComparableData, CompareValue } from './table-processor';
|
|
2
|
+
export declare const createCompareValue: (displayValue: string | undefined | null, columnType: string) => CompareValue;
|
|
3
|
+
type ComparableValue = string | number | ComparableData | null | undefined;
|
|
4
|
+
export declare enum SortDirectionValue {
|
|
5
|
+
ASC = 1,
|
|
6
|
+
DESC = -1,
|
|
7
|
+
NONE = 0
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Compares the two values as ComparableData objects.
|
|
11
|
+
*
|
|
12
|
+
* @param data1 - The first data to compare.
|
|
13
|
+
* @param data2 - The second data to compare.
|
|
14
|
+
* @param direction - The sorting direction. A positive number for ascending order, a negative number for descending order.
|
|
15
|
+
* @param type - The data type of comparison to perform. Defaults to 'string'.
|
|
16
|
+
* @returns {number} Returns -1 if data1 is smaller, 1 if data1 is larger, or 0 if they are equal.
|
|
17
|
+
*/
|
|
18
|
+
export declare function compareValues(data1: ComparableValue, data2: ComparableValue, direction?: SortDirectionValue, type?: string): number;
|
|
19
|
+
export declare class RowComparator {
|
|
20
|
+
columns: readonly Column[];
|
|
21
|
+
constructor(columns: readonly Column[]);
|
|
22
|
+
compare(row1: Row, row2: Row): number;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Cell, Data } from '@sisense/sdk-data';
|
|
2
|
+
import { DataTable } from './table-processor';
|
|
3
|
+
export declare const itemIndexColumnName = "$itemIndex";
|
|
4
|
+
export type TableColumn = {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly type: string;
|
|
7
|
+
};
|
|
8
|
+
export type TableData = {
|
|
9
|
+
columns: readonly TableColumn[];
|
|
10
|
+
rows: readonly (readonly string[])[];
|
|
11
|
+
};
|
|
12
|
+
export declare const createSortableTable: (tableData: TableData) => {
|
|
13
|
+
columns: {
|
|
14
|
+
name: string;
|
|
15
|
+
type: string;
|
|
16
|
+
index: number;
|
|
17
|
+
direction: number;
|
|
18
|
+
}[];
|
|
19
|
+
rows: {
|
|
20
|
+
displayValue: string;
|
|
21
|
+
}[][];
|
|
22
|
+
};
|
|
23
|
+
export declare const createSortableFromColumnsRows: (columns: TableData['columns'], rows: TableData['rows'], rownumColumn?: string) => {
|
|
24
|
+
columns: {
|
|
25
|
+
name: string;
|
|
26
|
+
type: string;
|
|
27
|
+
index: number;
|
|
28
|
+
direction: number;
|
|
29
|
+
}[];
|
|
30
|
+
rows: {
|
|
31
|
+
displayValue: string;
|
|
32
|
+
}[][];
|
|
33
|
+
};
|
|
34
|
+
type RowValue = Data['rows'][number][number];
|
|
35
|
+
export declare const isCell: (rowValue: RowValue) => rowValue is Cell;
|
|
36
|
+
export declare const isDataTableEmpty: (dataTable: DataTable) => boolean;
|
|
37
|
+
export declare const rownumColumnName = "$rownum";
|
|
38
|
+
export declare const createDataTableFromData: (data: Data) => DataTable;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export type FilterTypes = 'greater' | 'lesser' | 'equal' | 'contains' | 'not equal';
|
|
2
|
+
export type Value = string | number;
|
|
3
|
+
export type BooleanOperator = 'or' | 'and';
|
|
4
|
+
export type CompareValue = {
|
|
5
|
+
value: Value;
|
|
6
|
+
valueUndefined: boolean;
|
|
7
|
+
valueIsNaN: boolean;
|
|
8
|
+
lowercaseValue?: string;
|
|
9
|
+
};
|
|
10
|
+
export type ComparableData = {
|
|
11
|
+
readonly displayValue: string;
|
|
12
|
+
compareValue?: CompareValue;
|
|
13
|
+
rawValue?: string | number;
|
|
14
|
+
blur?: boolean;
|
|
15
|
+
color?: string;
|
|
16
|
+
};
|
|
17
|
+
export type Row = readonly ComparableData[];
|
|
18
|
+
export type Column = {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly type: string;
|
|
21
|
+
readonly index: number;
|
|
22
|
+
direction: number;
|
|
23
|
+
};
|
|
24
|
+
export type DataTable = {
|
|
25
|
+
readonly columns: readonly Column[];
|
|
26
|
+
readonly rows: readonly Row[];
|
|
27
|
+
};
|
|
28
|
+
export type ColumnMeasure = {
|
|
29
|
+
readonly column: string;
|
|
30
|
+
readonly agg: string;
|
|
31
|
+
readonly title: string;
|
|
32
|
+
};
|
|
33
|
+
export type AggregationColumn = {
|
|
34
|
+
readonly aggFunc: string;
|
|
35
|
+
readonly aggName: string;
|
|
36
|
+
readonly column: Column;
|
|
37
|
+
};
|
|
38
|
+
export type IndexedRows = {
|
|
39
|
+
[key: string]: Row[];
|
|
40
|
+
};
|
|
41
|
+
export declare const separateBy: (rows: readonly Row[], separateByColumns: Column[]) => Row[][];
|
|
42
|
+
export declare const orderBy: (table: DataTable, sortColumns: readonly Column[]) => {
|
|
43
|
+
columns: readonly Column[];
|
|
44
|
+
rows: Row[];
|
|
45
|
+
};
|
|
46
|
+
export declare const groupBy: (table: DataTable, groupByColumns: Column[], aggregationColumns: ColumnMeasure[]) => {
|
|
47
|
+
rows: ComparableData[][];
|
|
48
|
+
columns: {
|
|
49
|
+
index: number;
|
|
50
|
+
name: string;
|
|
51
|
+
type: string;
|
|
52
|
+
direction: number;
|
|
53
|
+
}[];
|
|
54
|
+
};
|
|
55
|
+
export declare const getColumnByName: (table: DataTable, name: string) => Column | undefined;
|
|
56
|
+
export declare const getColumnsByName: (table: DataTable, names: string[]) => Column[];
|
|
57
|
+
export declare const selectColumns: (table: DataTable, selectColumns: Column[]) => {
|
|
58
|
+
columns: {
|
|
59
|
+
index: number;
|
|
60
|
+
name: string;
|
|
61
|
+
type: string;
|
|
62
|
+
direction: number;
|
|
63
|
+
}[];
|
|
64
|
+
rows: ComparableData[][];
|
|
65
|
+
};
|
|
66
|
+
export declare const filterBy: (table: DataTable, filterColumns: Column[], filterValues: Value[], filterTypes: FilterTypes[], caseInsensitive?: boolean, booleanOperator?: BooleanOperator) => {
|
|
67
|
+
columns: readonly Column[];
|
|
68
|
+
rows: Row[];
|
|
69
|
+
};
|
|
70
|
+
export declare const getValue: (row: Row, column: Column) => Value | undefined;
|
|
71
|
+
export declare const isBlurred: (row: Row, column: Column) => boolean;
|
|
72
|
+
export declare const getValues: (row: Row, columns: readonly Column[]) => ComparableData[];
|
|
73
|
+
export declare const getValuesAsString: (row: Row, columns: readonly Column[]) => string;
|
|
74
|
+
export declare const getIndexedRows: (rows: readonly Row[], indexColumns: Column[]) => IndexedRows;
|
|
75
|
+
export declare const getDistinctTable: (table: DataTable, distinctColumns: Column[]) => {
|
|
76
|
+
rows: Row[];
|
|
77
|
+
columns: {
|
|
78
|
+
index: number;
|
|
79
|
+
name: string;
|
|
80
|
+
type: string;
|
|
81
|
+
direction: number;
|
|
82
|
+
}[];
|
|
83
|
+
};
|
|
84
|
+
export declare const getColumnValues: (table: DataTable, column: Column) => (Value | undefined)[];
|
|
85
|
+
export declare const emptyTable: (table: DataTable) => boolean;
|
|
86
|
+
export declare const limitRows: (table: DataTable, limit: number) => {
|
|
87
|
+
columns: Column[];
|
|
88
|
+
rows: Row[];
|
|
89
|
+
};
|
|
90
|
+
export declare const innerJoin: (table: DataTable, joinTable: DataTable, joinKeys: string[]) => {
|
|
91
|
+
rows: Row[];
|
|
92
|
+
columns: Column[];
|
|
93
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DataPoint, HighchartsPointerEvent, HighchartsSelectEvent, ScatterDataPoint } from '../types';
|
|
2
|
+
import { HighchartsOptionsInternal } from '../chart-options-processor/chart-options-service';
|
|
3
|
+
/** Click handler for when multiple data points are selected. */
|
|
4
|
+
export type DataPointsEventHandler = (
|
|
5
|
+
/** Data points that were selected */
|
|
6
|
+
points: DataPoint[],
|
|
7
|
+
/** Native MouseEvent */
|
|
8
|
+
nativeEvent: MouseEvent) => void;
|
|
9
|
+
/** Click handler for when a data point is clicked. One parameter, `DataPoint`, is passed to the function. */
|
|
10
|
+
export type DataPointEventHandler = (
|
|
11
|
+
/** Data point that was clicked */
|
|
12
|
+
point: DataPoint,
|
|
13
|
+
/** Native PointerEvent */
|
|
14
|
+
nativeEvent: PointerEvent) => void;
|
|
15
|
+
/** Click handler for when a scatter data point is clicked */
|
|
16
|
+
export type ScatterDataPointEventHandler = (
|
|
17
|
+
/** Data point that was clicked */
|
|
18
|
+
point: ScatterDataPoint,
|
|
19
|
+
/** Native PointerEvent */
|
|
20
|
+
nativeEvent: PointerEvent) => void;
|
|
21
|
+
/** Click handler for when multiple scatter data points are selected. */
|
|
22
|
+
export type ScatterDataPointsEventHandler = (
|
|
23
|
+
/** Data points that were selected */
|
|
24
|
+
points: ScatterDataPoint[],
|
|
25
|
+
/** Native MouseEvent */
|
|
26
|
+
nativeEvent: MouseEvent) => void;
|
|
27
|
+
export type HighchartsEventOptions = {
|
|
28
|
+
chart: {
|
|
29
|
+
zoomType?: string;
|
|
30
|
+
events: {
|
|
31
|
+
selection?: (ev: HighchartsSelectEvent) => void;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
plotOptions: {
|
|
35
|
+
series: {
|
|
36
|
+
point: {
|
|
37
|
+
events: {
|
|
38
|
+
click?: (ev: HighchartsPointerEvent) => void;
|
|
39
|
+
contextmenu?: (ev: HighchartsPointerEvent) => void;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare const applyEventHandlersToChart: (chartOptions: HighchartsOptionsInternal, { onDataPointClick, onDataPointContextMenu, onDataPointsSelected, }?: {
|
|
46
|
+
onDataPointClick?: DataPointEventHandler | ScatterDataPointEventHandler | undefined;
|
|
47
|
+
onDataPointContextMenu?: DataPointEventHandler | ScatterDataPointEventHandler | undefined;
|
|
48
|
+
onDataPointsSelected?: DataPointsEventHandler | ScatterDataPointsEventHandler | undefined;
|
|
49
|
+
}) => HighchartsOptionsInternal;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ChartData } from '../chart-data/types';
|
|
2
|
+
import { ChartDesignOptions } from './translations/types';
|
|
3
|
+
import { ChartType, CompleteThemeSettings } from '../types';
|
|
4
|
+
import { CartesianChartDataOptionsInternal } from '../chart-data-options/types';
|
|
5
|
+
import { HighchartsOptionsInternal } from './chart-options-service';
|
|
6
|
+
import { OptionsWithAlerts } from './../types';
|
|
7
|
+
/**
|
|
8
|
+
* Convert intermediate chart data, data options, and design options
|
|
9
|
+
* into pure highcharts config data.
|
|
10
|
+
*
|
|
11
|
+
* @param chartData - the data for the chart in an intermediate format
|
|
12
|
+
* @param chartType -
|
|
13
|
+
* @param chartDesignOptions -
|
|
14
|
+
* @param dataOptions -
|
|
15
|
+
* @param themeSettings -
|
|
16
|
+
* @param dateFormatter
|
|
17
|
+
*/
|
|
18
|
+
export declare const getCartesianChartOptions: (chartData: ChartData, chartType: ChartType, chartDesignOptions: ChartDesignOptions, dataOptions: CartesianChartDataOptionsInternal, themeSettings?: CompleteThemeSettings, dateFormatter?: ((date: Date, format: string) => string) | undefined) => OptionsWithAlerts<HighchartsOptionsInternal>;
|