semanticdb-core 1.1.22 → 1.1.23
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.
|
@@ -14,7 +14,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.getDrilldownDimensions = void 0;
|
|
16
16
|
const logicform_utils_1 = require("../../logicform/logicform.utils");
|
|
17
|
-
const property_utils_1 = require("../property.utils");
|
|
18
17
|
const moment_1 = __importDefault(require("moment"));
|
|
19
18
|
// 日期粒度,从粗到细
|
|
20
19
|
const DATE_GRANULARITIES = [
|
|
@@ -50,7 +49,6 @@ const getDrilldownDimensions = (schema_1, schemasDict_1, logicform_1, ...args_1)
|
|
|
50
49
|
let drilldownProps = [];
|
|
51
50
|
// 一个递归函数
|
|
52
51
|
const addToArrayWithProperty = (property, prefix, schema) => {
|
|
53
|
-
var _a;
|
|
54
52
|
if (usage === 'analyze' && property.is_analyzable === false)
|
|
55
53
|
return;
|
|
56
54
|
const pushToPropNames = (property, level, prefix, schema) => {
|
|
@@ -76,22 +74,12 @@ const getDrilldownDimensions = (schema_1, schemasDict_1, logicform_1, ...args_1)
|
|
|
76
74
|
if (property.can_drilldown === false)
|
|
77
75
|
return;
|
|
78
76
|
if (property.primal_type === 'date') {
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const defaultGranularity = (0, property_utils_1.getGranularity)(property);
|
|
86
|
-
// 确定起始粒度索引
|
|
87
|
-
const startIndex = currentGranularity
|
|
88
|
-
? DATE_GRANULARITIES.indexOf(currentGranularity)
|
|
89
|
-
: DATE_GRANULARITIES.indexOf(defaultGranularity);
|
|
90
|
-
if (startIndex >= 0 && startIndex < DATE_GRANULARITIES.length - 1) {
|
|
91
|
-
// 提供比当前粒度更细的所有选项
|
|
92
|
-
for (let i = startIndex + 1; i < DATE_GRANULARITIES.length; i++) {
|
|
93
|
-
pushToPropNames(property, DATE_GRANULARITIES[i], prefix, schema);
|
|
94
|
-
}
|
|
77
|
+
// 日期维度的下钻:从 year 开始,提供更细粒度的所有选项
|
|
78
|
+
// TODO: 后续需要从 logicform.query 中获取当前粒度
|
|
79
|
+
const startIndex = DATE_GRANULARITIES.indexOf('year');
|
|
80
|
+
// 提供比当前粒度更细的所有选项
|
|
81
|
+
for (let i = startIndex + 1; i < DATE_GRANULARITIES.length; i++) {
|
|
82
|
+
pushToPropNames(property, DATE_GRANULARITIES[i], prefix, schema);
|
|
95
83
|
}
|
|
96
84
|
}
|
|
97
85
|
else if (property.is_categorical) {
|