semanticdb-core 1.1.3 → 1.1.4
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 系统支持的图表类型
|
|
3
3
|
* - 基础图表:表格、饼图、柱状图(横向/纵向/堆积)、折线图、散点图、面积图
|
|
4
|
-
* -
|
|
5
|
-
* - 其他可视化:KPI卡片、实体详情卡片、报告、文本、视频列表、图片列表、RAG
|
|
4
|
+
* - 高级图表:气泡图、漏斗图、仪表盘、热力图、直方图、帕累托图、雷达图、词云、地图、树图
|
|
5
|
+
* - 其他可视化:KPI卡片、实体详情卡片、报告、文本、视频列表、图片列表、RAG、电子表格
|
|
6
6
|
*/
|
|
7
|
-
export declare type RepresentationType = 'value' | 'table' | 'pie' | 'bar' | 'column' | 'stackedColumn' | 'line' | 'scatter' | 'area' | 'bubble' | 'funnel' | 'guage' | 'heatmap' | 'histogram' | 'pareto' | 'radar' | 'wordCloud' | 'map' | 'entity' | 'report' | 'text' | 'videos' | 'images' | 'rag';
|
|
7
|
+
export declare type RepresentationType = 'value' | 'table' | 'sheet' | 'pie' | 'bar' | 'column' | 'stackedColumn' | 'line' | 'scatter' | 'area' | 'bubble' | 'funnel' | 'guage' | 'heatmap' | 'histogram' | 'pareto' | 'radar' | 'treemap' | 'wordCloud' | 'map' | 'entity' | 'report' | 'text' | 'videos' | 'images' | 'rag';
|
|
@@ -82,3 +82,10 @@ export declare const getDimensionsInLogicform: (logicform: LogicformType, schema
|
|
|
82
82
|
_id: string;
|
|
83
83
|
level?: string;
|
|
84
84
|
}[];
|
|
85
|
+
/**
|
|
86
|
+
* 判断一个logicform是否是简单查询
|
|
87
|
+
* 简单查询的定义:没有groupby,没有having,所有preds都是简单的(没有operator或只有$dateLevel operator)
|
|
88
|
+
* @param logicform - 逻辑表单
|
|
89
|
+
* @returns 如果是简单查询返回true,否则返回false
|
|
90
|
+
*/
|
|
91
|
+
export declare const isSimpleQuery: (logicform: LogicformType) => boolean;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getDimensionsInLogicform = exports.getValueByChain = exports.getFlattenQuery = exports.isDimensionInLogicform = exports.isDimensionInPred = exports.isDimensionInGroupby = exports.isDimensionInQuery = void 0;
|
|
6
|
+
exports.isSimpleQuery = exports.getDimensionsInLogicform = exports.getValueByChain = exports.getFlattenQuery = exports.isDimensionInLogicform = exports.isDimensionInPred = exports.isDimensionInGroupby = exports.isDimensionInQuery = void 0;
|
|
7
7
|
const date_1 = require("../common/date");
|
|
8
8
|
const schema_utils_1 = require("../schema/schema.utils");
|
|
9
9
|
const underscore_1 = __importDefault(require("underscore"));
|
|
@@ -342,3 +342,22 @@ const getDimensionsInLogicform = (logicform, schemasDict) => {
|
|
|
342
342
|
return dimensions;
|
|
343
343
|
};
|
|
344
344
|
exports.getDimensionsInLogicform = getDimensionsInLogicform;
|
|
345
|
+
/**
|
|
346
|
+
* 判断一个logicform是否是简单查询
|
|
347
|
+
* 简单查询的定义:没有groupby,没有having,所有preds都是简单的(没有operator或只有$dateLevel operator)
|
|
348
|
+
* @param logicform - 逻辑表单
|
|
349
|
+
* @returns 如果是简单查询返回true,否则返回false
|
|
350
|
+
*/
|
|
351
|
+
const isSimpleQuery = (logicform) => {
|
|
352
|
+
if (logicform.groupby)
|
|
353
|
+
return false;
|
|
354
|
+
if (logicform.having && Object.keys(logicform.having).length > 0)
|
|
355
|
+
return false;
|
|
356
|
+
const isPredsAllSimplePred = !(logicform.preds || [])
|
|
357
|
+
.filter((predItem) => predItem.name !== '_id')
|
|
358
|
+
.find((predItem) => predItem.operator && predItem.operator !== '$dateLevel'); // dateLevel是row based operator,以后想办法把这个逻辑抽象出来
|
|
359
|
+
if (!isPredsAllSimplePred)
|
|
360
|
+
return false;
|
|
361
|
+
return true;
|
|
362
|
+
};
|
|
363
|
+
exports.isSimpleQuery = isSimpleQuery;
|