@nocobase/plugin-data-visualization 0.14.0-alpha.6 → 0.14.0-alpha.8
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/client/DataVisualization.d.ts +2 -0
- package/dist/client/block/transformers.d.ts +2 -1
- package/dist/client/chart/antd/statistic.d.ts +2 -12
- package/dist/client/chart/chart.d.ts +15 -27
- package/dist/client/chart/configs.d.ts +36 -0
- package/dist/client/chart/g2plot/bar.d.ts +2 -12
- package/dist/client/chart/g2plot/configs.d.ts +0 -33
- package/dist/client/chart/g2plot/dualAxes.d.ts +2 -12
- package/dist/client/chart/g2plot/g2plot.d.ts +2 -10
- package/dist/client/chart/g2plot/index.d.ts +1 -4
- package/dist/client/chart/g2plot/pie.d.ts +2 -11
- package/dist/client/chart/group.d.ts +32 -0
- package/dist/client/index.d.ts +6 -3
- package/dist/client/index.js +36 -36
- package/dist/externalVersion.js +10 -10
- package/dist/node_modules/koa-compose/package.json +1 -1
- package/dist/server/actions/query.js +4 -7
- package/dist/server/migrations/20230926211750-rename-charttype.d.ts +4 -0
- package/dist/server/migrations/20230926211750-rename-charttype.js +50 -0
- package/dist/server/plugin.js +8 -0
- package/package.json +2 -2
- package/dist/client/Settings.d.ts +0 -2
- package/dist/client/chart/library.d.ts +0 -28
package/dist/externalVersion.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@
|
|
3
|
-
"@formily/antd-v5": "1.1.0",
|
|
4
|
-
"@nocobase/client": "0.14.0-alpha.6",
|
|
5
|
-
"antd": "5.8.6",
|
|
2
|
+
"@nocobase/client": "0.14.0-alpha.8",
|
|
6
3
|
"react": "18.2.0",
|
|
7
4
|
"@formily/react": "2.2.27",
|
|
8
5
|
"@formily/shared": "2.2.27",
|
|
9
|
-
"@nocobase/cache": "0.14.0-alpha.
|
|
10
|
-
"@nocobase/server": "0.14.0-alpha.
|
|
6
|
+
"@nocobase/cache": "0.14.0-alpha.8",
|
|
7
|
+
"@nocobase/server": "0.14.0-alpha.8",
|
|
8
|
+
"@ant-design/icons": "5.1.4",
|
|
11
9
|
"dayjs": "1.11.9",
|
|
10
|
+
"@formily/antd-v5": "1.1.7",
|
|
12
11
|
"@formily/core": "2.2.27",
|
|
12
|
+
"antd": "5.8.6",
|
|
13
13
|
"lodash": "4.17.21",
|
|
14
|
+
"@emotion/css": "11.11.2",
|
|
14
15
|
"react-i18next": "11.18.6",
|
|
15
16
|
"ahooks": "3.7.8",
|
|
16
|
-
"@
|
|
17
|
-
"@nocobase/
|
|
18
|
-
"@nocobase/
|
|
19
|
-
"@nocobase/utils": "0.14.0-alpha.6"
|
|
17
|
+
"@nocobase/actions": "0.14.0-alpha.8",
|
|
18
|
+
"@nocobase/database": "0.14.0-alpha.8",
|
|
19
|
+
"@nocobase/utils": "0.14.0-alpha.8"
|
|
20
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2023-
|
|
1
|
+
{"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2023-11-01T02:12:00.125Z"}
|
|
@@ -133,7 +133,8 @@ const parseBuilder = async (ctx, next) => {
|
|
|
133
133
|
include,
|
|
134
134
|
group,
|
|
135
135
|
order,
|
|
136
|
-
limit: limit
|
|
136
|
+
limit: limit || 2e3,
|
|
137
|
+
subQuery: false,
|
|
137
138
|
raw: true
|
|
138
139
|
},
|
|
139
140
|
fieldMap
|
|
@@ -144,7 +145,7 @@ const parseFieldAndAssociations = async (ctx, next) => {
|
|
|
144
145
|
const { collection: collectionName, measures, dimensions, orders, filter } = ctx.action.params.values;
|
|
145
146
|
const collection = ctx.db.getCollection(collectionName);
|
|
146
147
|
const fields = collection.fields;
|
|
147
|
-
const underscored =
|
|
148
|
+
const underscored = collection.options.underscored;
|
|
148
149
|
const models = {};
|
|
149
150
|
const parseField = (selected) => {
|
|
150
151
|
var _a, _b, _c;
|
|
@@ -272,9 +273,7 @@ const cacheMiddleware = async (ctx, next) => {
|
|
|
272
273
|
}
|
|
273
274
|
await next();
|
|
274
275
|
if (useCache) {
|
|
275
|
-
console.log(uid, ctx.body);
|
|
276
276
|
await cache.set(uid, ctx.body, (cacheConfig == null ? void 0 : cacheConfig.ttl) || 30);
|
|
277
|
-
console.log(cache.get(uid));
|
|
278
277
|
}
|
|
279
278
|
};
|
|
280
279
|
const checkPermission = (ctx, next) => {
|
|
@@ -296,13 +295,11 @@ const query = async (ctx, next) => {
|
|
|
296
295
|
parseBuilder,
|
|
297
296
|
queryData,
|
|
298
297
|
postProcess
|
|
299
|
-
])(ctx,
|
|
300
|
-
});
|
|
298
|
+
])(ctx, next);
|
|
301
299
|
} catch (err) {
|
|
302
300
|
ctx.app.logger.error("charts query: ", err);
|
|
303
301
|
ctx.throw(500, err);
|
|
304
302
|
}
|
|
305
|
-
await next();
|
|
306
303
|
};
|
|
307
304
|
// Annotate the CommonJS export names for ESM import in node:
|
|
308
305
|
0 && (module.exports = {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var rename_charttype_exports = {};
|
|
19
|
+
__export(rename_charttype_exports, {
|
|
20
|
+
default: () => RenameChartTypeMigration
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(rename_charttype_exports);
|
|
23
|
+
var import_server = require("@nocobase/server");
|
|
24
|
+
class RenameChartTypeMigration extends import_server.Migration {
|
|
25
|
+
async up() {
|
|
26
|
+
const result = await this.app.version.satisfies("<=0.14.0-alpha.7");
|
|
27
|
+
if (!result) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const r = this.db.getRepository("uiSchemas");
|
|
31
|
+
const items = await r.find({
|
|
32
|
+
filter: {
|
|
33
|
+
"schema.x-decorator": "ChartRendererProvider"
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
await this.db.sequelize.transaction(async (transaction) => {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
for (const item of items) {
|
|
39
|
+
const schema = item.schema;
|
|
40
|
+
const chartType = (_b = (_a = schema["x-decorator-props"]) == null ? void 0 : _a.config) == null ? void 0 : _b.chartType;
|
|
41
|
+
if (!chartType || chartType.startsWith("Built-in.")) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
schema["x-decorator-props"].config.chartType = `Built-in.${chartType}`;
|
|
45
|
+
item.set("schema", schema);
|
|
46
|
+
await item.save({ transaction });
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
package/dist/server/plugin.js
CHANGED
|
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(plugin_exports);
|
|
|
24
24
|
var import_cache = require("@nocobase/cache");
|
|
25
25
|
var import_server = require("@nocobase/server");
|
|
26
26
|
var import_query = require("./actions/query");
|
|
27
|
+
var import_path = require("path");
|
|
27
28
|
class DataVisualizationPlugin extends import_server.Plugin {
|
|
28
29
|
cache;
|
|
29
30
|
afterAdd() {
|
|
@@ -38,6 +39,13 @@ class DataVisualizationPlugin extends import_server.Plugin {
|
|
|
38
39
|
this.app.acl.allow("charts", "query", "loggedIn");
|
|
39
40
|
}
|
|
40
41
|
async load() {
|
|
42
|
+
this.db.addMigrations({
|
|
43
|
+
namespace: "data-visulization",
|
|
44
|
+
directory: (0, import_path.resolve)(__dirname, "migrations"),
|
|
45
|
+
context: {
|
|
46
|
+
plugin: this
|
|
47
|
+
}
|
|
48
|
+
});
|
|
41
49
|
this.cache = (0, import_cache.createCache)({
|
|
42
50
|
ttl: 30,
|
|
43
51
|
// seconds
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-data-visualization",
|
|
3
|
-
"version": "0.14.0-alpha.
|
|
3
|
+
"version": "0.14.0-alpha.8",
|
|
4
4
|
"displayName": "Data Visualization",
|
|
5
5
|
"displayName.zh-CN": "数据可视化",
|
|
6
6
|
"description": "Provides business intelligence and data visualization features",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"@nocobase/test": "0.x",
|
|
34
34
|
"@nocobase/utils": "0.x"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "59c82fef6e34707802b5841f5ec4d9b3b6b68abb"
|
|
37
37
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ChartType } from './chart';
|
|
3
|
-
export type ChartLibraries = {
|
|
4
|
-
[library: string]: {
|
|
5
|
-
enabled: boolean;
|
|
6
|
-
charts: ChartType[];
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export declare const ChartLibraryContext: React.Context<ChartLibraries>;
|
|
10
|
-
export declare const useCharts: () => {
|
|
11
|
-
[name: string]: ChartType;
|
|
12
|
-
};
|
|
13
|
-
export declare const useChartTypes: () => {
|
|
14
|
-
label: string;
|
|
15
|
-
children: {
|
|
16
|
-
key: string;
|
|
17
|
-
label: string;
|
|
18
|
-
value: string;
|
|
19
|
-
}[];
|
|
20
|
-
}[];
|
|
21
|
-
export declare const useDefaultChartType: () => string;
|
|
22
|
-
export declare const useToggleChartLibrary: () => {
|
|
23
|
-
toggle: (library: string) => void;
|
|
24
|
-
};
|
|
25
|
-
export declare const ChartLibraryProvider: React.FC<{
|
|
26
|
-
name: string;
|
|
27
|
-
charts: ChartType[];
|
|
28
|
-
}>;
|