@qrvey/utils 1.16.0-14 → 1.16.0-15
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/charts/adapters/RequestAdapterMetric.d.ts +2 -1
- package/dist/charts/adapters/RequestAdapterMetric.js +14 -1
- package/dist/charts/constants/AGGREGATE.d.ts +3 -1
- package/dist/charts/constants/AGGREGATE.js +2 -0
- package/dist/charts/constants/AGGREGATE_ABBREVIATION.d.ts +3 -1
- package/dist/charts/constants/AGGREGATE_ABBREVIATION.js +2 -0
- package/dist/charts/constants/AGGREGATE_INFO.js +16 -0
- package/dist/charts/constants/AGGREGATE_LABEL.d.ts +3 -1
- package/dist/charts/constants/AGGREGATE_LABEL.js +2 -0
- package/dist/charts/interfaces/IRequestAdapterMetric.d.ts +3 -1
- package/dist/cjs/charts/adapters/RequestAdapterMetric.d.ts +2 -1
- package/dist/cjs/charts/adapters/RequestAdapterMetric.js +16 -2
- package/dist/cjs/charts/constants/AGGREGATE.d.ts +3 -1
- package/dist/cjs/charts/constants/AGGREGATE.js +2 -0
- package/dist/cjs/charts/constants/AGGREGATE_ABBREVIATION.d.ts +3 -1
- package/dist/cjs/charts/constants/AGGREGATE_ABBREVIATION.js +2 -0
- package/dist/cjs/charts/constants/AGGREGATE_INFO.js +16 -0
- package/dist/cjs/charts/constants/AGGREGATE_LABEL.d.ts +3 -1
- package/dist/cjs/charts/constants/AGGREGATE_LABEL.js +2 -0
- package/dist/cjs/charts/interfaces/IRequestAdapterMetric.d.ts +3 -1
- package/dist/cjs/column_format/helpers/columnTypeByChart.js +3 -1
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.d.ts +4 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +4 -0
- package/dist/column_format/helpers/columnTypeByChart.js +4 -2
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.d.ts +4 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +4 -0
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { IBColumn } from "../../columns";
|
|
2
|
-
import { CustomRangeConfig, MetricConfig, MetricCustomRange, MetricPeriod, MetricRequestPayload, MetricTimeInfo } from "../interfaces/IRequestAdapterMetric";
|
|
2
|
+
import { CustomRangeConfig, MetricConfig, MetricConfigData, MetricCustomRange, MetricPeriod, MetricRequestPayload, MetricTimeInfo } from "../interfaces/IRequestAdapterMetric";
|
|
3
3
|
/**
|
|
4
4
|
* It takes a metric object and returns a metric request object
|
|
5
5
|
* @param {MetricConfig} metricObj - MetricConfigData
|
|
6
6
|
* @returns A function that takes in a metricObj and returns a partial metricRequest
|
|
7
7
|
*/
|
|
8
8
|
export declare const makeBodyRequestMetrics: (metricObj: MetricConfig) => Partial<MetricRequestPayload>;
|
|
9
|
+
export declare const isDateAsText: (data: Partial<MetricConfigData>) => boolean;
|
|
9
10
|
/**
|
|
10
11
|
* It takes a date column, time data, and a custom range config and returns a metric period or metric
|
|
11
12
|
* custom range
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AGGREGATE_FORMULA } from "../../formulas";
|
|
2
2
|
import { isEmpty } from "../../general";
|
|
3
3
|
import { TIME_PERIOD, TP_CUSTOM_RANGE } from "../../interfaces";
|
|
4
|
+
import { AGGREGATE } from "../constants";
|
|
4
5
|
import { RELATIVE_OBJECT_BY_TIME_LABEL } from "../constants/REQUEST_ADAPTER";
|
|
5
6
|
/**
|
|
6
7
|
* It takes a metric object and returns a metric request object
|
|
@@ -14,7 +15,7 @@ export const makeBodyRequestMetrics = (metricObj) => {
|
|
|
14
15
|
body.value = metricMakeValue(data);
|
|
15
16
|
/* Checking if the data object has a dateColumn property. If it does, it will add a period and
|
|
16
17
|
comparison property to the body object. */
|
|
17
|
-
if (isComparison(data)) {
|
|
18
|
+
if (isComparison(data) && !isDateAsText(data)) {
|
|
18
19
|
body.period = metricMakeTimeData(data.dateColumn, data.timePeriod, getRangeDataPeriod(data));
|
|
19
20
|
body.comparison = metricMakeTimeData(data.dateColumn, data.comparison, getRangeDataComparison(data));
|
|
20
21
|
}
|
|
@@ -23,6 +24,7 @@ export const makeBodyRequestMetrics = (metricObj) => {
|
|
|
23
24
|
/**
|
|
24
25
|
* If data is truthy, return data.logic, otherwise return an empty array.
|
|
25
26
|
* @param filters - The data object that is passed to the component.
|
|
27
|
+
* @returns An array of IFBLogic objects.
|
|
26
28
|
*/
|
|
27
29
|
const getFilterLogic = (filters) => (filters === null || filters === void 0 ? void 0 : filters.logic) || [];
|
|
28
30
|
/**
|
|
@@ -36,14 +38,25 @@ const metricMakeValue = (data) => {
|
|
|
36
38
|
const metricValue = {
|
|
37
39
|
questionid: (_b = data === null || data === void 0 ? void 0 : data.value) === null || _b === void 0 ? void 0 : _b.id,
|
|
38
40
|
property: ((_c = data === null || data === void 0 ? void 0 : data.value) === null || _c === void 0 ? void 0 : _c.property) || null,
|
|
41
|
+
dateAsText: isDateAsText(data),
|
|
39
42
|
};
|
|
40
43
|
if (!isAggregateFormula)
|
|
41
44
|
metricValue.aggregate = (_d = data === null || data === void 0 ? void 0 : data.valueAggregate) === null || _d === void 0 ? void 0 : _d.label;
|
|
42
45
|
return metricValue;
|
|
43
46
|
};
|
|
47
|
+
export const isDateAsText = (data) => {
|
|
48
|
+
var _a;
|
|
49
|
+
return [
|
|
50
|
+
AGGREGATE.MIN,
|
|
51
|
+
AGGREGATE.MAX,
|
|
52
|
+
AGGREGATE.FIRST,
|
|
53
|
+
AGGREGATE.LAST,
|
|
54
|
+
].includes((_a = data === null || data === void 0 ? void 0 : data.valueAggregate) === null || _a === void 0 ? void 0 : _a.id);
|
|
55
|
+
};
|
|
44
56
|
/**
|
|
45
57
|
* If data is truthy and data.dateColumn is truthy, return true, otherwise return false.
|
|
46
58
|
* @param data - The data object that is passed to the component.
|
|
59
|
+
* @returns A boolean.
|
|
47
60
|
*/
|
|
48
61
|
const isComparison = (data) => Boolean(data === null || data === void 0 ? void 0 : data.dateColumn);
|
|
49
62
|
/**
|
|
@@ -9,4 +9,6 @@ export var AGGREGATE_ABBREVIATION;
|
|
|
9
9
|
AGGREGATE_ABBREVIATION["STDEV"] = "STDEV";
|
|
10
10
|
AGGREGATE_ABBREVIATION["COUNT"] = "CNT";
|
|
11
11
|
AGGREGATE_ABBREVIATION["DISTINCTCOUNT"] = "CNTD";
|
|
12
|
+
AGGREGATE_ABBREVIATION["FIRST"] = "FIRST";
|
|
13
|
+
AGGREGATE_ABBREVIATION["LAST"] = "LAST";
|
|
12
14
|
})(AGGREGATE_ABBREVIATION || (AGGREGATE_ABBREVIATION = {}));
|
|
@@ -74,4 +74,20 @@ export const AGGREGATE_INFO = {
|
|
|
74
74
|
abbrLabel: AGGREGATE_ABBREVIATION.DISTINCTCOUNT,
|
|
75
75
|
i18nLabelPath: "common.aggregate_labels.distinct_count",
|
|
76
76
|
},
|
|
77
|
+
[AGGREGATE.FIRST]: {
|
|
78
|
+
value: AGGREGATE.FIRST,
|
|
79
|
+
displayed: false,
|
|
80
|
+
label: AGGREGATE_LABEL.LAST,
|
|
81
|
+
shortLabel: AGGREGATE_LABEL.FIRST,
|
|
82
|
+
abbrLabel: AGGREGATE_ABBREVIATION.FIRST,
|
|
83
|
+
i18nLabelPath: "common.aggregate_labels.first",
|
|
84
|
+
},
|
|
85
|
+
[AGGREGATE.LAST]: {
|
|
86
|
+
value: AGGREGATE.LAST,
|
|
87
|
+
displayed: false,
|
|
88
|
+
label: AGGREGATE_LABEL.LAST,
|
|
89
|
+
shortLabel: AGGREGATE_LABEL.LAST,
|
|
90
|
+
abbrLabel: AGGREGATE_ABBREVIATION.LAST,
|
|
91
|
+
i18nLabelPath: "common.aggregate_labels.last",
|
|
92
|
+
},
|
|
77
93
|
};
|
|
@@ -9,4 +9,6 @@ export var AGGREGATE_LABEL;
|
|
|
9
9
|
AGGREGATE_LABEL["STDEV"] = "Standard deviation";
|
|
10
10
|
AGGREGATE_LABEL["COUNT"] = "Count";
|
|
11
11
|
AGGREGATE_LABEL["DISTINCTCOUNT"] = "Distinct Count";
|
|
12
|
+
AGGREGATE_LABEL["FIRST"] = "First";
|
|
13
|
+
AGGREGATE_LABEL["LAST"] = "Last";
|
|
12
14
|
})(AGGREGATE_LABEL || (AGGREGATE_LABEL = {}));
|
|
@@ -2,7 +2,7 @@ import { IBColumn, IColumnType } from "../../columns";
|
|
|
2
2
|
import { IDateGroupingProperty, RelativeCursor } from "../../dates";
|
|
3
3
|
import { IFBLogic } from "../../filters";
|
|
4
4
|
import { TimePeriod, TP_CUSTOM_RANGE } from "../../interfaces";
|
|
5
|
-
import { AGGREGATE_LABEL } from "../constants";
|
|
5
|
+
import { AGGREGATE, AGGREGATE_LABEL } from "../constants";
|
|
6
6
|
export interface MetricRequestPayload {
|
|
7
7
|
logic: IFBLogic[];
|
|
8
8
|
value: MetricValue;
|
|
@@ -21,6 +21,7 @@ export type MetricValue = {
|
|
|
21
21
|
aggregate?: AGGREGATE_LABEL;
|
|
22
22
|
questionid: string;
|
|
23
23
|
property?: string | null;
|
|
24
|
+
dateAsText?: boolean;
|
|
24
25
|
};
|
|
25
26
|
/**
|
|
26
27
|
* A `RelativeDateConfig` is an object with a `questionid` property, a `cursor` property, an optional
|
|
@@ -113,6 +114,7 @@ export type MetricConfigData = {
|
|
|
113
114
|
};
|
|
114
115
|
valueAggregate: {
|
|
115
116
|
label: AGGREGATE_LABEL;
|
|
117
|
+
id: AGGREGATE;
|
|
116
118
|
};
|
|
117
119
|
};
|
|
118
120
|
export type MetricTimeCustomRange = {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { IBColumn } from "../../columns";
|
|
2
|
-
import { CustomRangeConfig, MetricConfig, MetricCustomRange, MetricPeriod, MetricRequestPayload, MetricTimeInfo } from "../interfaces/IRequestAdapterMetric";
|
|
2
|
+
import { CustomRangeConfig, MetricConfig, MetricConfigData, MetricCustomRange, MetricPeriod, MetricRequestPayload, MetricTimeInfo } from "../interfaces/IRequestAdapterMetric";
|
|
3
3
|
/**
|
|
4
4
|
* It takes a metric object and returns a metric request object
|
|
5
5
|
* @param {MetricConfig} metricObj - MetricConfigData
|
|
6
6
|
* @returns A function that takes in a metricObj and returns a partial metricRequest
|
|
7
7
|
*/
|
|
8
8
|
export declare const makeBodyRequestMetrics: (metricObj: MetricConfig) => Partial<MetricRequestPayload>;
|
|
9
|
+
export declare const isDateAsText: (data: Partial<MetricConfigData>) => boolean;
|
|
9
10
|
/**
|
|
10
11
|
* It takes a date column, time data, and a custom range config and returns a metric period or metric
|
|
11
12
|
* custom range
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.metricMakeTimeData = exports.makeBodyRequestMetrics = void 0;
|
|
3
|
+
exports.metricMakeTimeData = exports.isDateAsText = exports.makeBodyRequestMetrics = void 0;
|
|
4
4
|
const formulas_1 = require("../../formulas");
|
|
5
5
|
const general_1 = require("../../general");
|
|
6
6
|
const interfaces_1 = require("../../interfaces");
|
|
7
|
+
const constants_1 = require("../constants");
|
|
7
8
|
const REQUEST_ADAPTER_1 = require("../constants/REQUEST_ADAPTER");
|
|
8
9
|
/**
|
|
9
10
|
* It takes a metric object and returns a metric request object
|
|
@@ -17,7 +18,7 @@ const makeBodyRequestMetrics = (metricObj) => {
|
|
|
17
18
|
body.value = metricMakeValue(data);
|
|
18
19
|
/* Checking if the data object has a dateColumn property. If it does, it will add a period and
|
|
19
20
|
comparison property to the body object. */
|
|
20
|
-
if (isComparison(data)) {
|
|
21
|
+
if (isComparison(data) && !(0, exports.isDateAsText)(data)) {
|
|
21
22
|
body.period = (0, exports.metricMakeTimeData)(data.dateColumn, data.timePeriod, getRangeDataPeriod(data));
|
|
22
23
|
body.comparison = (0, exports.metricMakeTimeData)(data.dateColumn, data.comparison, getRangeDataComparison(data));
|
|
23
24
|
}
|
|
@@ -27,6 +28,7 @@ exports.makeBodyRequestMetrics = makeBodyRequestMetrics;
|
|
|
27
28
|
/**
|
|
28
29
|
* If data is truthy, return data.logic, otherwise return an empty array.
|
|
29
30
|
* @param filters - The data object that is passed to the component.
|
|
31
|
+
* @returns An array of IFBLogic objects.
|
|
30
32
|
*/
|
|
31
33
|
const getFilterLogic = (filters) => (filters === null || filters === void 0 ? void 0 : filters.logic) || [];
|
|
32
34
|
/**
|
|
@@ -40,14 +42,26 @@ const metricMakeValue = (data) => {
|
|
|
40
42
|
const metricValue = {
|
|
41
43
|
questionid: (_b = data === null || data === void 0 ? void 0 : data.value) === null || _b === void 0 ? void 0 : _b.id,
|
|
42
44
|
property: ((_c = data === null || data === void 0 ? void 0 : data.value) === null || _c === void 0 ? void 0 : _c.property) || null,
|
|
45
|
+
dateAsText: (0, exports.isDateAsText)(data),
|
|
43
46
|
};
|
|
44
47
|
if (!isAggregateFormula)
|
|
45
48
|
metricValue.aggregate = (_d = data === null || data === void 0 ? void 0 : data.valueAggregate) === null || _d === void 0 ? void 0 : _d.label;
|
|
46
49
|
return metricValue;
|
|
47
50
|
};
|
|
51
|
+
const isDateAsText = (data) => {
|
|
52
|
+
var _a;
|
|
53
|
+
return [
|
|
54
|
+
constants_1.AGGREGATE.MIN,
|
|
55
|
+
constants_1.AGGREGATE.MAX,
|
|
56
|
+
constants_1.AGGREGATE.FIRST,
|
|
57
|
+
constants_1.AGGREGATE.LAST,
|
|
58
|
+
].includes((_a = data === null || data === void 0 ? void 0 : data.valueAggregate) === null || _a === void 0 ? void 0 : _a.id);
|
|
59
|
+
};
|
|
60
|
+
exports.isDateAsText = isDateAsText;
|
|
48
61
|
/**
|
|
49
62
|
* If data is truthy and data.dateColumn is truthy, return true, otherwise return false.
|
|
50
63
|
* @param data - The data object that is passed to the component.
|
|
64
|
+
* @returns A boolean.
|
|
51
65
|
*/
|
|
52
66
|
const isComparison = (data) => Boolean(data === null || data === void 0 ? void 0 : data.dateColumn);
|
|
53
67
|
/**
|
|
@@ -12,4 +12,6 @@ var AGGREGATE_ABBREVIATION;
|
|
|
12
12
|
AGGREGATE_ABBREVIATION["STDEV"] = "STDEV";
|
|
13
13
|
AGGREGATE_ABBREVIATION["COUNT"] = "CNT";
|
|
14
14
|
AGGREGATE_ABBREVIATION["DISTINCTCOUNT"] = "CNTD";
|
|
15
|
+
AGGREGATE_ABBREVIATION["FIRST"] = "FIRST";
|
|
16
|
+
AGGREGATE_ABBREVIATION["LAST"] = "LAST";
|
|
15
17
|
})(AGGREGATE_ABBREVIATION || (exports.AGGREGATE_ABBREVIATION = AGGREGATE_ABBREVIATION = {}));
|
|
@@ -77,4 +77,20 @@ exports.AGGREGATE_INFO = {
|
|
|
77
77
|
abbrLabel: AGGREGATE_ABBREVIATION_1.AGGREGATE_ABBREVIATION.DISTINCTCOUNT,
|
|
78
78
|
i18nLabelPath: "common.aggregate_labels.distinct_count",
|
|
79
79
|
},
|
|
80
|
+
[AGGREGATE_1.AGGREGATE.FIRST]: {
|
|
81
|
+
value: AGGREGATE_1.AGGREGATE.FIRST,
|
|
82
|
+
displayed: false,
|
|
83
|
+
label: AGGREGATE_LABEL_1.AGGREGATE_LABEL.LAST,
|
|
84
|
+
shortLabel: AGGREGATE_LABEL_1.AGGREGATE_LABEL.FIRST,
|
|
85
|
+
abbrLabel: AGGREGATE_ABBREVIATION_1.AGGREGATE_ABBREVIATION.FIRST,
|
|
86
|
+
i18nLabelPath: "common.aggregate_labels.first",
|
|
87
|
+
},
|
|
88
|
+
[AGGREGATE_1.AGGREGATE.LAST]: {
|
|
89
|
+
value: AGGREGATE_1.AGGREGATE.LAST,
|
|
90
|
+
displayed: false,
|
|
91
|
+
label: AGGREGATE_LABEL_1.AGGREGATE_LABEL.LAST,
|
|
92
|
+
shortLabel: AGGREGATE_LABEL_1.AGGREGATE_LABEL.LAST,
|
|
93
|
+
abbrLabel: AGGREGATE_ABBREVIATION_1.AGGREGATE_ABBREVIATION.LAST,
|
|
94
|
+
i18nLabelPath: "common.aggregate_labels.last",
|
|
95
|
+
},
|
|
80
96
|
};
|
|
@@ -12,4 +12,6 @@ var AGGREGATE_LABEL;
|
|
|
12
12
|
AGGREGATE_LABEL["STDEV"] = "Standard deviation";
|
|
13
13
|
AGGREGATE_LABEL["COUNT"] = "Count";
|
|
14
14
|
AGGREGATE_LABEL["DISTINCTCOUNT"] = "Distinct Count";
|
|
15
|
+
AGGREGATE_LABEL["FIRST"] = "First";
|
|
16
|
+
AGGREGATE_LABEL["LAST"] = "Last";
|
|
15
17
|
})(AGGREGATE_LABEL || (exports.AGGREGATE_LABEL = AGGREGATE_LABEL = {}));
|
|
@@ -2,7 +2,7 @@ import { IBColumn, IColumnType } from "../../columns";
|
|
|
2
2
|
import { IDateGroupingProperty, RelativeCursor } from "../../dates";
|
|
3
3
|
import { IFBLogic } from "../../filters";
|
|
4
4
|
import { TimePeriod, TP_CUSTOM_RANGE } from "../../interfaces";
|
|
5
|
-
import { AGGREGATE_LABEL } from "../constants";
|
|
5
|
+
import { AGGREGATE, AGGREGATE_LABEL } from "../constants";
|
|
6
6
|
export interface MetricRequestPayload {
|
|
7
7
|
logic: IFBLogic[];
|
|
8
8
|
value: MetricValue;
|
|
@@ -21,6 +21,7 @@ export type MetricValue = {
|
|
|
21
21
|
aggregate?: AGGREGATE_LABEL;
|
|
22
22
|
questionid: string;
|
|
23
23
|
property?: string | null;
|
|
24
|
+
dateAsText?: boolean;
|
|
24
25
|
};
|
|
25
26
|
/**
|
|
26
27
|
* A `RelativeDateConfig` is an object with a `questionid` property, a `cursor` property, an optional
|
|
@@ -113,6 +114,7 @@ export type MetricConfigData = {
|
|
|
113
114
|
};
|
|
114
115
|
valueAggregate: {
|
|
115
116
|
label: AGGREGATE_LABEL;
|
|
117
|
+
id: AGGREGATE;
|
|
116
118
|
};
|
|
117
119
|
};
|
|
118
120
|
export type MetricTimeCustomRange = {
|
|
@@ -17,6 +17,7 @@ const parseFormulaTypeByCharts_1 = require("./parseFormulaTypeByCharts");
|
|
|
17
17
|
* @returns The column type of the column.
|
|
18
18
|
*/
|
|
19
19
|
const columnTypeByChart = (column, shelfType, chartGroup, isGroupedTable) => {
|
|
20
|
+
var _a;
|
|
20
21
|
if (!column)
|
|
21
22
|
return;
|
|
22
23
|
const currentType = column.type === columns_1.COLUMN.FORMULA
|
|
@@ -25,7 +26,8 @@ const columnTypeByChart = (column, shelfType, chartGroup, isGroupedTable) => {
|
|
|
25
26
|
const isNumericalColumn = __1.NUMERICAL_COLUMNS.some((colType) => colType === currentType) ||
|
|
26
27
|
(chartGroup === CHART_GROUP_1.CHART_GROUPS.TABLES &&
|
|
27
28
|
isGroupedTable === true &&
|
|
28
|
-
shelfType === SHELF_TYPE_1.SHELF_TYPE.COLUMNS
|
|
29
|
+
shelfType === SHELF_TYPE_1.SHELF_TYPE.COLUMNS &&
|
|
30
|
+
![__1.AGGREGATE.MIN, __1.AGGREGATE.MAX].includes((_a = column === null || column === void 0 ? void 0 : column.aggregate) === null || _a === void 0 ? void 0 : _a.id)) ||
|
|
29
31
|
(chartGroup === CHART_GROUP_1.CHART_GROUPS.XY && shelfType === SHELF_TYPE_1.SHELF_TYPE.VALUE);
|
|
30
32
|
return isNumericalColumn === true ? __1.NUMERICAL_COLUMN.NUMERIC : currentType;
|
|
31
33
|
};
|
|
@@ -49,4 +49,8 @@ export interface II18nChartBuilderStyleOptions {
|
|
|
49
49
|
heatmap_pivot_axis_caption: string;
|
|
50
50
|
global_y_axis_caption: string;
|
|
51
51
|
multiseries_type: string;
|
|
52
|
+
default_format_date_title: string;
|
|
53
|
+
type_custom_format: string;
|
|
54
|
+
type_custom_format_placeholder: string;
|
|
55
|
+
type_custom_format_error: string;
|
|
52
56
|
}
|
|
@@ -56,6 +56,10 @@ exports.I18N_CHART_BUILDER_STYLE_OPTIONS = {
|
|
|
56
56
|
heatmap_pivot_axis_caption: "pivot",
|
|
57
57
|
global_y_axis_caption: "global",
|
|
58
58
|
multiseries_type: "Multiseries Type",
|
|
59
|
+
default_format_date_title: "Date Format",
|
|
60
|
+
type_custom_format: "Custom Format",
|
|
61
|
+
type_custom_format_placeholder: "Type custom format",
|
|
62
|
+
type_custom_format_error: "Invalid format",
|
|
59
63
|
},
|
|
60
64
|
color_settings: {
|
|
61
65
|
color_by_category: "By category",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NUMERICAL_COLUMN, NUMERICAL_COLUMNS } from "../..";
|
|
1
|
+
import { AGGREGATE, NUMERICAL_COLUMN, NUMERICAL_COLUMNS } from "../..";
|
|
2
2
|
import { COLUMN } from "../../columns";
|
|
3
3
|
import { CHART_GROUPS } from "../constants/CHART_GROUP";
|
|
4
4
|
import { SHELF_TYPE } from "../constants/SHELF_TYPE";
|
|
@@ -14,6 +14,7 @@ import { parseFormulaTypeByCharts } from "./parseFormulaTypeByCharts";
|
|
|
14
14
|
* @returns The column type of the column.
|
|
15
15
|
*/
|
|
16
16
|
export const columnTypeByChart = (column, shelfType, chartGroup, isGroupedTable) => {
|
|
17
|
+
var _a;
|
|
17
18
|
if (!column)
|
|
18
19
|
return;
|
|
19
20
|
const currentType = column.type === COLUMN.FORMULA
|
|
@@ -22,7 +23,8 @@ export const columnTypeByChart = (column, shelfType, chartGroup, isGroupedTable)
|
|
|
22
23
|
const isNumericalColumn = NUMERICAL_COLUMNS.some((colType) => colType === currentType) ||
|
|
23
24
|
(chartGroup === CHART_GROUPS.TABLES &&
|
|
24
25
|
isGroupedTable === true &&
|
|
25
|
-
shelfType === SHELF_TYPE.COLUMNS
|
|
26
|
+
shelfType === SHELF_TYPE.COLUMNS &&
|
|
27
|
+
![AGGREGATE.MIN, AGGREGATE.MAX].includes((_a = column === null || column === void 0 ? void 0 : column.aggregate) === null || _a === void 0 ? void 0 : _a.id)) ||
|
|
26
28
|
(chartGroup === CHART_GROUPS.XY && shelfType === SHELF_TYPE.VALUE);
|
|
27
29
|
return isNumericalColumn === true ? NUMERICAL_COLUMN.NUMERIC : currentType;
|
|
28
30
|
};
|
|
@@ -49,4 +49,8 @@ export interface II18nChartBuilderStyleOptions {
|
|
|
49
49
|
heatmap_pivot_axis_caption: string;
|
|
50
50
|
global_y_axis_caption: string;
|
|
51
51
|
multiseries_type: string;
|
|
52
|
+
default_format_date_title: string;
|
|
53
|
+
type_custom_format: string;
|
|
54
|
+
type_custom_format_placeholder: string;
|
|
55
|
+
type_custom_format_error: string;
|
|
52
56
|
}
|
|
@@ -53,6 +53,10 @@ export const I18N_CHART_BUILDER_STYLE_OPTIONS = {
|
|
|
53
53
|
heatmap_pivot_axis_caption: "pivot",
|
|
54
54
|
global_y_axis_caption: "global",
|
|
55
55
|
multiseries_type: "Multiseries Type",
|
|
56
|
+
default_format_date_title: "Date Format",
|
|
57
|
+
type_custom_format: "Custom Format",
|
|
58
|
+
type_custom_format_placeholder: "Type custom format",
|
|
59
|
+
type_custom_format_error: "Invalid format",
|
|
56
60
|
},
|
|
57
61
|
color_settings: {
|
|
58
62
|
color_by_category: "By category",
|