@opengis/bi 1.2.2 → 1.2.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/package.json CHANGED
@@ -1,78 +1,78 @@
1
- {
2
- "name": "@opengis/bi",
3
- "version": "1.2.2",
4
- "description": "BI data visualization module",
5
- "main": "dist/bi.js",
6
- "browser": "dist/bi.umd.cjs",
7
- "type": "module",
8
- "files": [
9
- "dist",
10
- "server",
11
- "plugin.js",
12
- "utils.js"
13
- ],
14
- "scripts": {
15
- "prepublishOnly": "npm run build",
16
- "debug": "node --watch-path=server server",
17
- "dev": "vite",
18
- "type-check": "vue-tsc --noEmit",
19
- "build": "vite build",
20
- "build-app": "cross-env APP=true vite build",
21
- "lint": "eslint .",
22
- "format": "prettier --write .",
23
- "test": "node --test",
24
- "test21": "node --test ./test/plugins/*",
25
- "start": "node server.js",
26
- "prod": "NODE_ENV=production npm run start",
27
- "docs:i": "npm install --prefix ./docs",
28
- "docs:dev": "npm run --prefix ./docs docs:dev",
29
- "docs:build": "npm run --prefix ./docs docs:build",
30
- "docs:preview": "npm run --prefix ./docs docs:preview",
31
- "adduser": "node script/adduser.js"
32
- },
33
- "keywords": [
34
- "bi",
35
- "data visualization",
36
- "chart",
37
- "opengis",
38
- "vue",
39
- "fastify"
40
- ],
41
- "author": "Softpro",
42
- "license": "ISC",
43
- "dependencies": {
44
- "@mapbox/sphericalmercator": "^1.2.0"
45
- },
46
- "devDependencies": {
47
- "@highlightjs/vue-plugin": "github:highlightjs/vue-plugin",
48
- "@jspreadsheet-ce/vue": "^5.0.0",
49
- "@opengis/fastify-table": "^2.0.33",
50
- "@opengis/v3-core": "^0.3.93",
51
- "@opengis/v3-filter": "^0.0.71",
52
- "cross-env": "^10.1.0",
53
- "@turf/turf": "^7.1.0",
54
- "axios": "^1.3.1",
55
- "echarts": "^5.5.1",
56
- "highlight.js": "^11.10.0",
57
- "marked": "^14.1.2",
58
- "vite": "^5.1.5",
59
- "vue": "^3.4.27",
60
- "vue-router": "^4.4.3",
61
- "@eslint/eslintrc": "^3.1.0",
62
- "@eslint/js": "^9.12.0",
63
- "@types/echarts": "^4.9.22",
64
- "@types/node": "^22.7.5",
65
- "@typescript-eslint/eslint-plugin": "^6.21.0",
66
- "@vitejs/plugin-vue": "^5.1.4",
67
- "eslint": "^8.57.1",
68
- "eslint-config-airbnb-base": "^15.0.0",
69
- "eslint-config-prettier": "^9.1.0",
70
- "eslint-plugin-vue": "^9.29.0",
71
- "globals": "^15.10.0",
72
- "prettier": "^3.3.3",
73
- "sass-embedded": "1.89.2",
74
- "typescript": "^5.4.5",
75
- "typescript-eslint": "~8.8.1",
76
- "vue-tsc": "^2.1.6"
77
- }
1
+ {
2
+ "name": "@opengis/bi",
3
+ "version": "1.2.3",
4
+ "description": "BI data visualization module",
5
+ "main": "dist/bi.js",
6
+ "browser": "dist/bi.umd.cjs",
7
+ "type": "module",
8
+ "files": [
9
+ "dist",
10
+ "server",
11
+ "plugin.js",
12
+ "utils.js"
13
+ ],
14
+ "scripts": {
15
+ "prepublishOnly": "npm run build",
16
+ "debug": "node --watch-path=server server",
17
+ "dev": "vite",
18
+ "type-check": "vue-tsc --noEmit",
19
+ "build": "vite build",
20
+ "build-app": "cross-env APP=true vite build",
21
+ "lint": "eslint .",
22
+ "format": "prettier --write .",
23
+ "test": "node --test",
24
+ "test21": "node --test ./test/plugins/*",
25
+ "start": "node server.js",
26
+ "prod": "NODE_ENV=production npm run start",
27
+ "docs:i": "npm install --prefix ./docs",
28
+ "docs:dev": "npm run --prefix ./docs docs:dev",
29
+ "docs:build": "npm run --prefix ./docs docs:build",
30
+ "docs:preview": "npm run --prefix ./docs docs:preview",
31
+ "adduser": "node script/adduser.js"
32
+ },
33
+ "keywords": [
34
+ "bi",
35
+ "data visualization",
36
+ "chart",
37
+ "opengis",
38
+ "vue",
39
+ "fastify"
40
+ ],
41
+ "author": "Softpro",
42
+ "license": "ISC",
43
+ "dependencies": {
44
+ "@mapbox/sphericalmercator": "^1.2.0"
45
+ },
46
+ "devDependencies": {
47
+ "@highlightjs/vue-plugin": "github:highlightjs/vue-plugin",
48
+ "@jspreadsheet-ce/vue": "^5.0.0",
49
+ "@opengis/fastify-table": "^2.0.33",
50
+ "@opengis/v3-core": "^0.3.93",
51
+ "@opengis/v3-filter": "^0.0.71",
52
+ "cross-env": "^10.1.0",
53
+ "@turf/turf": "^7.1.0",
54
+ "axios": "^1.3.1",
55
+ "echarts": "^5.5.1",
56
+ "highlight.js": "^11.10.0",
57
+ "marked": "^14.1.2",
58
+ "vite": "^5.1.5",
59
+ "vue": "^3.4.27",
60
+ "vue-router": "^4.4.3",
61
+ "@eslint/eslintrc": "^3.1.0",
62
+ "@eslint/js": "^9.12.0",
63
+ "@types/echarts": "^4.9.22",
64
+ "@types/node": "^22.7.5",
65
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
66
+ "@vitejs/plugin-vue": "^5.1.4",
67
+ "eslint": "^8.57.1",
68
+ "eslint-config-airbnb-base": "^15.0.0",
69
+ "eslint-config-prettier": "^9.1.0",
70
+ "eslint-plugin-vue": "^9.29.0",
71
+ "globals": "^15.10.0",
72
+ "prettier": "^3.3.3",
73
+ "sass-embedded": "1.89.2",
74
+ "typescript": "^5.4.5",
75
+ "typescript-eslint": "~8.8.1",
76
+ "vue-tsc": "^2.1.6"
77
+ }
78
78
  }
@@ -23,12 +23,12 @@ export default async function dataAPI(req, reply) {
23
23
 
24
24
  const { query = {}, user = {}, unittest } = req;
25
25
 
26
- query.metric = Array.isArray(query.metric) ? query.metric.pop() : query.metric;
27
-
28
26
  const { dashboard, widget, filter, search, samples } = query;
29
27
 
30
28
  const widgetData = await getWidget({ pg: req.pg, dashboard, widget });
31
29
 
30
+ query.metric = Array.isArray(query.metric) ? query.metric.pop() : query.metric || widgetData?.metric || widgetData?.data?.metrics?.[0]?.fx;
31
+
32
32
  if (widgetData.status) return widgetData;
33
33
 
34
34
  const { type, text, data = {}, controls, style, options } = widgetData;