@cloudcare/guance-front-tools 1.0.0

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.
Files changed (216) hide show
  1. package/.prettierignore +3 -0
  2. package/.prettierrc +6 -0
  3. package/LICENSE +21 -0
  4. package/README.md +31 -0
  5. package/cli.js +16 -0
  6. package/lib/cjs/generated/browserSessionReplay.d.ts +703 -0
  7. package/lib/cjs/generated/browserSessionReplay.js +6 -0
  8. package/lib/cjs/generated/dashboardCharts.d.ts +1372 -0
  9. package/lib/cjs/generated/dashboardCharts.js +6 -0
  10. package/lib/cjs/generated/mobileSessionReplay.d.ts +653 -0
  11. package/lib/cjs/generated/mobileSessionReplay.js +6 -0
  12. package/lib/cjs/generated/sessionReplay.d.ts +1190 -0
  13. package/lib/cjs/generated/sessionReplay.js +6 -0
  14. package/lib/cjs/src/dashboard-charts.d.ts +1 -0
  15. package/lib/cjs/src/dashboard-charts.js +17 -0
  16. package/lib/cjs/src/index.d.ts +2 -0
  17. package/lib/cjs/src/index.js +18 -0
  18. package/lib/cjs/src/session-replay-browser.d.ts +58 -0
  19. package/lib/cjs/src/session-replay-browser.js +69 -0
  20. package/lib/cjs/src/session-replay-mobile.d.ts +30 -0
  21. package/lib/cjs/src/session-replay-mobile.js +42 -0
  22. package/lib/cjs/src/session-replay.d.ts +30 -0
  23. package/lib/cjs/src/session-replay.js +49 -0
  24. package/lib/esm/generated/browserSessionReplay.d.ts +703 -0
  25. package/lib/esm/generated/browserSessionReplay.js +5 -0
  26. package/lib/esm/generated/dashboardCharts.d.ts +1372 -0
  27. package/lib/esm/generated/dashboardCharts.js +5 -0
  28. package/lib/esm/generated/mobileSessionReplay.d.ts +653 -0
  29. package/lib/esm/generated/mobileSessionReplay.js +5 -0
  30. package/lib/esm/generated/sessionReplay.d.ts +1190 -0
  31. package/lib/esm/generated/sessionReplay.js +5 -0
  32. package/lib/esm/src/dashboard-charts.d.ts +1 -0
  33. package/lib/esm/src/dashboard-charts.js +1 -0
  34. package/lib/esm/src/index.d.ts +2 -0
  35. package/lib/esm/src/index.js +2 -0
  36. package/lib/esm/src/session-replay-browser.d.ts +58 -0
  37. package/lib/esm/src/session-replay-browser.js +52 -0
  38. package/lib/esm/src/session-replay-mobile.d.ts +30 -0
  39. package/lib/esm/src/session-replay-mobile.js +25 -0
  40. package/lib/esm/src/session-replay.d.ts +30 -0
  41. package/lib/esm/src/session-replay.js +24 -0
  42. package/lib/example/grafana-dashboard.json +2205 -0
  43. package/lib/example/guance-covert-test.json +629 -0
  44. package/lib/example/guance-dashboard-1.json +672 -0
  45. package/lib/example/guance-dashboard.json +2841 -0
  46. package/lib/scripts/grafana-covert-to-guance.d.ts +1 -0
  47. package/lib/scripts/grafana-covert-to-guance.js +367 -0
  48. package/lib/scripts/grafana-covert-to-guance.ts +374 -0
  49. package/lib/scripts/grafana-dashbord.d.ts +2220 -0
  50. package/lib/scripts/grafana-dashbord.js +1 -0
  51. package/lib/scripts/grafana-dashbord.ts +2427 -0
  52. package/lib/src/dashboard-charts.ts +1 -0
  53. package/lib/src/index.ts +2 -0
  54. package/lib/src/session-replay-browser.ts +98 -0
  55. package/lib/src/session-replay-mobile.ts +54 -0
  56. package/lib/src/session-replay.ts +61 -0
  57. package/package.json +45 -0
  58. package/samples/dashboard/dashboard.json +2842 -0
  59. package/samples/dashboard/promql-dashboard.json +2175 -0
  60. package/samples/session-replay/mobile/record/full-snapshot-record.json +51 -0
  61. package/samples/session-replay/mobile/record/has-focus-record.json +7 -0
  62. package/samples/session-replay/mobile/record/incremental-snapshot-record.json +74 -0
  63. package/samples/session-replay/mobile/record/metadata-record.json +8 -0
  64. package/samples/session-replay/mobile/record/view-end-record.json +4 -0
  65. package/samples/session-replay/mobile/segment/segment.json +110 -0
  66. package/schemas/charts/chart-schema.json +73 -0
  67. package/schemas/charts/common/common-chart-types-schema.json +37 -0
  68. package/schemas/charts/common/common-vars-item-schema.json +117 -0
  69. package/schemas/charts/common/common-vars-schema.json +10 -0
  70. package/schemas/charts/dashboard-schema.json +73 -0
  71. package/schemas/charts/query/queries-schema.json +10 -0
  72. package/schemas/charts/query/query-item-schema.json +42 -0
  73. package/schemas/charts/settings/_common-settings-connect-null-schema.json +7 -0
  74. package/schemas/charts/settings/_common-settings-gradual-color-schema.json +72 -0
  75. package/schemas/charts/settings/_common-settings-groupby-schema.json +22 -0
  76. package/schemas/charts/settings/_common-settings-legend-position-schema.json +14 -0
  77. package/schemas/charts/settings/_common-settings-legend-values-schema.json +19 -0
  78. package/schemas/charts/settings/_common-settings-open-stack-schema.json +8 -0
  79. package/schemas/charts/settings/_common-settings-show-label-schema.json +8 -0
  80. package/schemas/charts/settings/_common-settings-show-line-schema.json +8 -0
  81. package/schemas/charts/settings/_common-settings-stack-content-schema.json +12 -0
  82. package/schemas/charts/settings/_common-settings-stack-type-schema.json +11 -0
  83. package/schemas/charts/settings/chart-alarm-settings-schema.json +48 -0
  84. package/schemas/charts/settings/chart-bar-settings-schema.json +69 -0
  85. package/schemas/charts/settings/chart-chinamap-settings-schema.json +102 -0
  86. package/schemas/charts/settings/chart-funnel-settings-schema.json +34 -0
  87. package/schemas/charts/settings/chart-gauge-settings-schema.json +65 -0
  88. package/schemas/charts/settings/chart-heatmap-settings-schema.json +50 -0
  89. package/schemas/charts/settings/chart-hexgon-settings-schema.json +90 -0
  90. package/schemas/charts/settings/chart-histogram-settings-schema.json +47 -0
  91. package/schemas/charts/settings/chart-iframe-settings-schema.json +24 -0
  92. package/schemas/charts/settings/chart-log-settings-schema.json +84 -0
  93. package/schemas/charts/settings/chart-object-settings-schema.json +52 -0
  94. package/schemas/charts/settings/chart-picture-settings-schema.json +46 -0
  95. package/schemas/charts/settings/chart-pie-settings-schema.json +90 -0
  96. package/schemas/charts/settings/chart-sankey-settings-schema.json +34 -0
  97. package/schemas/charts/settings/chart-scatter-bubble-settings-schema.json +31 -0
  98. package/schemas/charts/settings/chart-sequence-settings-schema.json +76 -0
  99. package/schemas/charts/settings/chart-singlestat-settings-schema.json +163 -0
  100. package/schemas/charts/settings/chart-table-settings-schema.json +184 -0
  101. package/schemas/charts/settings/chart-text-settings-schema.json +20 -0
  102. package/schemas/charts/settings/chart-toplist-settings-schema.json +117 -0
  103. package/schemas/charts/settings/chart-topology-settings-schema.json +71 -0
  104. package/schemas/charts/settings/chart-treemap-settings-schema.json +66 -0
  105. package/schemas/charts/settings/chart-worldmap-settings-schema.json +102 -0
  106. package/schemas/charts/settings/common-settings-schema.json +82 -0
  107. package/schemas/charts/settings/settings-alias-schema.json +47 -0
  108. package/schemas/charts/settings/settings-chart-type-schema.json +27 -0
  109. package/schemas/charts/settings/settings-colors-schema.json +46 -0
  110. package/schemas/charts/settings/settings-compare-schema.json +58 -0
  111. package/schemas/charts/settings/settings-fixed-time-schema.json +49 -0
  112. package/schemas/charts/settings/settings-levels-schema.json +33 -0
  113. package/schemas/charts/settings/settings-schema.json +79 -0
  114. package/schemas/charts/settings/settings-time-schema.json +47 -0
  115. package/schemas/charts/settings/settings-unit-items-schema.json +226 -0
  116. package/schemas/charts/settings/settings-units-schema.json +60 -0
  117. package/schemas/dashboard-schema.json +5 -0
  118. package/schemas/session-replay/browser/attribute-mutation-schema.json +21 -0
  119. package/schemas/session-replay/browser/attributes-schema.json +10 -0
  120. package/schemas/session-replay/browser/cdata-node-schema.json +19 -0
  121. package/schemas/session-replay/browser/creation-reason-schema.json +17 -0
  122. package/schemas/session-replay/browser/document-fragment-node-schema.json +35 -0
  123. package/schemas/session-replay/browser/document-node-schema.json +30 -0
  124. package/schemas/session-replay/browser/document-type-node-schema.json +28 -0
  125. package/schemas/session-replay/browser/element-node-schema.json +33 -0
  126. package/schemas/session-replay/browser/frustration-record-schema.json +49 -0
  127. package/schemas/session-replay/browser/full-snapshot-record-schema.json +26 -0
  128. package/schemas/session-replay/browser/incremental-data-schema.json +36 -0
  129. package/schemas/session-replay/browser/incremental-snapshot-record-schema.json +29 -0
  130. package/schemas/session-replay/browser/input-data-schema.json +27 -0
  131. package/schemas/session-replay/browser/input-state-schema.json +27 -0
  132. package/schemas/session-replay/browser/media-interaction-data-schema.json +23 -0
  133. package/schemas/session-replay/browser/media-interaction-schema.json +20 -0
  134. package/schemas/session-replay/browser/mouse-interaction-data-schema.json +23 -0
  135. package/schemas/session-replay/browser/mouse-interaction-schema.json +47 -0
  136. package/schemas/session-replay/browser/mouse-move-data-schema.json +23 -0
  137. package/schemas/session-replay/browser/mouse-position-schema.json +26 -0
  138. package/schemas/session-replay/browser/mutation-data-schema.json +23 -0
  139. package/schemas/session-replay/browser/mutation-payload-schema.json +42 -0
  140. package/schemas/session-replay/browser/node-added-mutation-schema.json +41 -0
  141. package/schemas/session-replay/browser/node-removed-mutation-schema.json +18 -0
  142. package/schemas/session-replay/browser/node-schema.json +28 -0
  143. package/schemas/session-replay/browser/record-schema.json +30 -0
  144. package/schemas/session-replay/browser/scroll-data-schema.json +23 -0
  145. package/schemas/session-replay/browser/scroll-position-schema.json +22 -0
  146. package/schemas/session-replay/browser/segment-metadata-schema.json +28 -0
  147. package/schemas/session-replay/browser/segment-schema.json +25 -0
  148. package/schemas/session-replay/browser/serialized-node-schema.json +15 -0
  149. package/schemas/session-replay/browser/serialized-node-with-id-schema.json +21 -0
  150. package/schemas/session-replay/browser/stylesheet-rule-add-schema.json +28 -0
  151. package/schemas/session-replay/browser/stylesheet-rule-data-schema.json +23 -0
  152. package/schemas/session-replay/browser/stylesheet-rule-delete-schema.json +24 -0
  153. package/schemas/session-replay/browser/stylesheet-rule-schema.json +29 -0
  154. package/schemas/session-replay/browser/stylesheet-schema.json +30 -0
  155. package/schemas/session-replay/browser/text-mutation-schema.json +27 -0
  156. package/schemas/session-replay/browser/text-node-schema.json +23 -0
  157. package/schemas/session-replay/common/_common-record-schema.json +14 -0
  158. package/schemas/session-replay/common/_common-segment-metadata-schema.json +30 -0
  159. package/schemas/session-replay/common/_slot-supported-common-record-schema.json +21 -0
  160. package/schemas/session-replay/common/focus-record-schema.json +34 -0
  161. package/schemas/session-replay/common/meta-record-schema.json +42 -0
  162. package/schemas/session-replay/common/pointer-interaction-data-schema.json +23 -0
  163. package/schemas/session-replay/common/pointer-interaction-schema.json +34 -0
  164. package/schemas/session-replay/common/segment-context-schema.json +46 -0
  165. package/schemas/session-replay/common/view-end-record-schema.json +23 -0
  166. package/schemas/session-replay/common/viewport-resize-data-schema.json +23 -0
  167. package/schemas/session-replay/common/viewport-resize-dimension-schema.json +18 -0
  168. package/schemas/session-replay/common/visual-viewport-record-schema.json +50 -0
  169. package/schemas/session-replay/full-snapshot-record-schema.json +14 -0
  170. package/schemas/session-replay/incremental-data-schema.json +14 -0
  171. package/schemas/session-replay/incremental-snapshot-record-schema.json +14 -0
  172. package/schemas/session-replay/mobile/_common-shape-wireframe-schema.json +22 -0
  173. package/schemas/session-replay/mobile/_common-shape-wireframe-update-schema.json +22 -0
  174. package/schemas/session-replay/mobile/_common-wireframe-schema.json +38 -0
  175. package/schemas/session-replay/mobile/_common-wireframe-update-schema.json +38 -0
  176. package/schemas/session-replay/mobile/full-snapshot-record-schema.json +38 -0
  177. package/schemas/session-replay/mobile/image-wireframe-schema.json +43 -0
  178. package/schemas/session-replay/mobile/image-wireframe-update-schema.json +43 -0
  179. package/schemas/session-replay/mobile/incremental-data-schema.json +21 -0
  180. package/schemas/session-replay/mobile/incremental-snapshot-record-schema.json +26 -0
  181. package/schemas/session-replay/mobile/mutation-data-schema.json +23 -0
  182. package/schemas/session-replay/mobile/mutation-payload-schema.json +55 -0
  183. package/schemas/session-replay/mobile/placeholder-wireframe-schema.json +28 -0
  184. package/schemas/session-replay/mobile/placeholder-wireframe-update-schema.json +28 -0
  185. package/schemas/session-replay/mobile/record-schema.json +27 -0
  186. package/schemas/session-replay/mobile/segment-metadata-schema.json +25 -0
  187. package/schemas/session-replay/mobile/segment-schema.json +25 -0
  188. package/schemas/session-replay/mobile/shape-border-schema.json +25 -0
  189. package/schemas/session-replay/mobile/shape-style-schema.json +29 -0
  190. package/schemas/session-replay/mobile/shape-wireframe-schema.json +23 -0
  191. package/schemas/session-replay/mobile/shape-wireframe-update-schema.json +23 -0
  192. package/schemas/session-replay/mobile/text-position-schema.json +57 -0
  193. package/schemas/session-replay/mobile/text-style-schema.json +31 -0
  194. package/schemas/session-replay/mobile/text-wireframe-schema.json +34 -0
  195. package/schemas/session-replay/mobile/text-wireframe-update-schema.json +34 -0
  196. package/schemas/session-replay/mobile/touch-data-schema.json +51 -0
  197. package/schemas/session-replay/mobile/webview-wireframe-schema.json +33 -0
  198. package/schemas/session-replay/mobile/webview-wireframe-update-schema.json +33 -0
  199. package/schemas/session-replay/mobile/wireframe-clip-schema.json +29 -0
  200. package/schemas/session-replay/mobile/wireframe-schema.json +24 -0
  201. package/schemas/session-replay/mobile/wireframe-update-mutation-schema.json +24 -0
  202. package/schemas/session-replay/mutation-data-schema.json +14 -0
  203. package/schemas/session-replay/mutation-payload-schema.json +14 -0
  204. package/schemas/session-replay/record-schema.json +14 -0
  205. package/schemas/session-replay/segment-metadata-schema.json +14 -0
  206. package/schemas/session-replay/segment-schema.json +15 -0
  207. package/schemas/session-replay-browser-schema.json +5 -0
  208. package/schemas/session-replay-mobile-schema.json +5 -0
  209. package/schemas/session-replay-schema.json +33 -0
  210. package/scripts/generate.mjs +96 -0
  211. package/scripts/utils.mjs +16 -0
  212. package/scripts/validate.mjs +144 -0
  213. package/tsconfig.cjs.json +7 -0
  214. package/tsconfig.esm.json +7 -0
  215. package/tsconfig.json +13 -0
  216. package/tsconfig.script.json +15 -0
@@ -0,0 +1,184 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/settings/chart-table-settings-schema.json",
4
+ "title": "ChartTableSettings",
5
+ "description": "表格图配置信息",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "allOf": [
9
+ {
10
+ "$ref": "common-settings-schema.json"
11
+ },
12
+ {
13
+ "properties": {
14
+ "alias": {
15
+ "$ref": "settings-alias-schema.json"
16
+ },
17
+ "colors": {
18
+ "$ref": "settings-colors-schema.json"
19
+ },
20
+ "levels": {
21
+ "$ref": "settings-levels-schema.json"
22
+ },
23
+ "isTimeInterval": {
24
+ "type": "boolean",
25
+ "description": "是否开启时间分片",
26
+ "default": false
27
+ },
28
+ "queryMode": {
29
+ "type": "string",
30
+ "description": "表格类型:支持分组模式和时序模式",
31
+ "enum": [
32
+ "toGroupColumn",
33
+ "toOneColumn"
34
+ ]
35
+ },
36
+ "showColumns": {
37
+ "type": "array",
38
+ "description": "需要显示的列,指标名称列表",
39
+ "items": {
40
+ "type": "string",
41
+ "examples": [
42
+ "avg(load5s)"
43
+ ]
44
+ }
45
+ },
46
+ "valMappings": {
47
+ "type": "array",
48
+ "description": "表格图规则映射配置",
49
+ "items": {
50
+ "type": "object",
51
+ "properties": {
52
+ "field": {
53
+ "type": "string",
54
+ "description": "需要映射的指标字段名称"
55
+ },
56
+ "originalVal": {
57
+ "type": "array",
58
+ "description": "",
59
+ "items": {
60
+ "anyOf": [
61
+ {
62
+ "type": "string"
63
+ },
64
+ {
65
+ "type": "integer"
66
+ }
67
+ ]
68
+ }
69
+ },
70
+ "mappingVal": {
71
+ "description": "映射对应的显示文本",
72
+ "anyOf": [
73
+ {
74
+ "type": "string"
75
+ },
76
+ {
77
+ "type": "integer"
78
+ }
79
+ ]
80
+ },
81
+ "operation": {
82
+ "description": "映射表达式操作符",
83
+ "enum": [
84
+ ">",
85
+ ">=",
86
+ "<",
87
+ "<=",
88
+ "=",
89
+ "!=",
90
+ "between",
91
+ "=~",
92
+ "!=~",
93
+ "nodata"
94
+ ]
95
+ }
96
+ }
97
+ }
98
+ },
99
+ "valColorMappings": {
100
+ "type": "array",
101
+ "description": "表格图规则映射对应颜色配置数据",
102
+ "items": {
103
+ "type": "object",
104
+ "required": [
105
+ "field",
106
+ "value",
107
+ "bgColor",
108
+ "operation",
109
+ "fontColor"
110
+ ],
111
+ "properties": {
112
+ "field": {
113
+ "type": "string",
114
+ "description": "需要映射的指标字段名称"
115
+ },
116
+ "value": {
117
+ "type": "array",
118
+ "description": "",
119
+ "items": {
120
+ "anyOf": [
121
+ {
122
+ "type": "string"
123
+ },
124
+ {
125
+ "type": "integer"
126
+ }
127
+ ]
128
+ }
129
+ },
130
+ "bgColor": {
131
+ "type": "string",
132
+ "description": "映射对应的背景颜色"
133
+ },
134
+ "fontColor": {
135
+ "type": "string",
136
+ "description": "映射对应的字体颜色"
137
+ },
138
+ "operation": {
139
+ "description": "映射指标数据值的计算规则",
140
+ "enum": [
141
+ ">",
142
+ ">=",
143
+ "<",
144
+ "<=",
145
+ "=",
146
+ "!=",
147
+ "between",
148
+ "=~",
149
+ "!=~",
150
+ "nodata"
151
+ ]
152
+ }
153
+ }
154
+ }
155
+ },
156
+ "mainMeasurementQueryCode": {
157
+ "type": "string",
158
+ "description": "选择指标对应的code 名称,根据查询语句顺序以大些字母命名",
159
+ "default": "A"
160
+ },
161
+ "mainMeasurementSort": {
162
+ "type": "string",
163
+ "enum": [
164
+ "top",
165
+ "bottom"
166
+ ],
167
+ "description": "选择指标的排序方式"
168
+ },
169
+ "mainMeasurementLimit": {
170
+ "type": "integer",
171
+ "description": "选择指标排序返回数据线的限制条数"
172
+ },
173
+ "disableFuncList": {
174
+ "type": "boolean",
175
+ "description": "冗余字段, 时序表格图为true, 分组表格图为false",
176
+ "readOnly": true
177
+ }
178
+ }
179
+ },
180
+ {
181
+ "$ref": "settings-units-schema.json"
182
+ }
183
+ ]
184
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/settings/chart-text-settings-schema.json",
4
+ "title": "ChartTextSettings",
5
+ "description": "文本图配置信息",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "properties": {
9
+ "showTitle": {
10
+ "type": "boolean",
11
+ "description": "是否显示图表标题",
12
+ "default": true
13
+ },
14
+ "titleDesc": {
15
+ "type": "string",
16
+ "description": "图表的描述信息",
17
+ "default": ""
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,117 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/settings/chart-toplist-settings-schema.json",
4
+ "title": "ChartToplistSettings",
5
+ "description": "排行榜图表配置信息",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "allOf": [
9
+ {
10
+ "$ref": "common-settings-schema.json"
11
+ },
12
+ {
13
+ "properties": {
14
+ "alias": {
15
+ "$ref": "settings-alias-schema.json"
16
+ },
17
+ "colors": {
18
+ "$ref": "settings-colors-schema.json"
19
+ },
20
+ "levels": {
21
+ "$ref": "settings-levels-schema.json"
22
+ },
23
+ "chartType": {
24
+ "type": "string",
25
+ "const": "bar",
26
+ "description": "冗余字段图表类型,排行榜固定为 bar"
27
+ },
28
+ "colorMappings": {
29
+ "type": "array",
30
+ "description": "排行榜规则映射对应颜色配置数据",
31
+ "items": {
32
+ "type": "object",
33
+ "required": [
34
+ "value",
35
+ "bgColor",
36
+ "operation"
37
+ ],
38
+ "properties": {
39
+ "value": {
40
+ "type": "array",
41
+ "description": "",
42
+ "items": {
43
+ "anyOf": [
44
+ {
45
+ "type": "string"
46
+ },
47
+ {
48
+ "type": "integer"
49
+ }
50
+ ]
51
+ }
52
+ },
53
+ "bgColor": {
54
+ "type": "string",
55
+ "description": "映射对应的背景颜色"
56
+ },
57
+ "operation": {
58
+ "description": "映射指标数据值的计算规则",
59
+ "enum": [
60
+ ">",
61
+ ">=",
62
+ "<",
63
+ "<=",
64
+ "=",
65
+ "!=",
66
+ "between",
67
+ "=~",
68
+ "!=~",
69
+ "nodata"
70
+ ]
71
+ }
72
+ }
73
+ }
74
+ },
75
+ "isTimeInterval": {
76
+ "type": "boolean",
77
+ "description": "是否开启时间分片",
78
+ "default": false
79
+ },
80
+ "mainMeasurementQueryCode": {
81
+ "type": "string",
82
+ "description": "主指标对应的code 名称,在饼图中固定为 A",
83
+ "const": "A"
84
+ },
85
+ "mainMeasurementSort": {
86
+ "type": "string",
87
+ "enum": [
88
+ "top",
89
+ "bottom"
90
+ ],
91
+ "description": "主指标的排序方式"
92
+ },
93
+ "mainMeasurementLimit": {
94
+ "type": "integer",
95
+ "description": "主指标排序返回数据线的限制条数"
96
+ },
97
+ "bar": {
98
+ "description": "冗余字段,固定值",
99
+ "type": "object",
100
+ "properties": {
101
+ "direction": {
102
+ "type": "string",
103
+ "const": "horizontal"
104
+ },
105
+ "xAxisShowType": {
106
+ "type": "string",
107
+ "const": "groupBy"
108
+ }
109
+ }
110
+ }
111
+ }
112
+ },
113
+ {
114
+ "$ref": "settings-units-schema.json"
115
+ }
116
+ ]
117
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/settings/chart-topology-settings-schema.json",
4
+ "title": "ChartTopologySettings",
5
+ "description": "拓扑图配置信息",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "properties": {
9
+ "showTitle": {
10
+ "type": "boolean",
11
+ "description": "是否显示图表标题",
12
+ "default": true
13
+ },
14
+ "titleDesc": {
15
+ "type": "string",
16
+ "description": "图表的描述信息",
17
+ "default": ""
18
+ },
19
+ "showLegend": {
20
+ "type": "string",
21
+ "description": "显示图例的位置信息,可以选择隐藏,以及在底部区域",
22
+ "enum": [
23
+ "none",
24
+ "bottom"
25
+ ]
26
+ },
27
+ "fixedTime": {
28
+ "$ref": "settings-fixed-time-schema.json"
29
+ },
30
+ "color": {
31
+ "type": "object",
32
+ "description": "颜色配置",
33
+ "required": [
34
+ "key",
35
+ "min",
36
+ "max"
37
+ ],
38
+ "properties": {
39
+ "key": {
40
+ "type": "string",
41
+ "description": "颜色色系",
42
+ "enum": [
43
+ "color-first",
44
+ "color-second",
45
+ "color-third"
46
+ ]
47
+ },
48
+ "min": {
49
+ "anyOf": [
50
+ {
51
+ "type": "integer"
52
+ },
53
+ {
54
+ "type": "null"
55
+ }
56
+ ]
57
+ },
58
+ "max": {
59
+ "anyOf": [
60
+ {
61
+ "type": "integer"
62
+ },
63
+ {
64
+ "type": "null"
65
+ }
66
+ ]
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/settings/chart-treemap-settings-schema.json",
4
+ "title": "ChartTreeMapSettings",
5
+ "description": "矩形树图配置信息",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "allOf": [
9
+ {
10
+ "$ref": "common-settings-schema.json"
11
+ },
12
+ {
13
+ "properties": {
14
+ "alias": {
15
+ "$ref": "settings-alias-schema.json"
16
+ },
17
+ "colors": {
18
+ "$ref": "settings-colors-schema.json"
19
+ },
20
+ "levels": {
21
+ "$ref": "settings-levels-schema.json"
22
+ },
23
+ "isTimeInterval": {
24
+ "type": "boolean",
25
+ "description": "是否开启时间分片",
26
+ "default": false
27
+ },
28
+ "showLabel": {
29
+ "type": "boolean",
30
+ "description": "图例是否显示标签",
31
+ "default": true
32
+ },
33
+ "showPercent": {
34
+ "type": "boolean",
35
+ "description": "图例是否显示百分比",
36
+ "default": false
37
+ },
38
+ "showLabelValue": {
39
+ "type": "boolean",
40
+ "description": "图例是否显示值",
41
+ "default": true
42
+ },
43
+ "mainMeasurementQueryCode": {
44
+ "type": "string",
45
+ "description": "选择指标匹配色块大小,值为对应查询语句 code 名称,根据查询语句顺序以大些字母命名",
46
+ "default": "A"
47
+ },
48
+ "mainMeasurementSort": {
49
+ "type": "string",
50
+ "enum": [
51
+ "top",
52
+ "bottom"
53
+ ],
54
+ "description": "选择指标的排序方式"
55
+ },
56
+ "mainMeasurementLimit": {
57
+ "type": "integer",
58
+ "description": "选择指标排序返回数据线的限制条数"
59
+ }
60
+ }
61
+ },
62
+ {
63
+ "$ref": "settings-units-schema.json"
64
+ }
65
+ ]
66
+ }
@@ -0,0 +1,102 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/settings/chart-worldmap-settings-schema.json",
4
+ "title": "ChartWorldMapSettings",
5
+ "description": "中国地图配置信息",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "allOf": [
9
+ {
10
+ "$ref": "common-settings-schema.json"
11
+ },
12
+ {
13
+ "properties": {
14
+ "alias": {
15
+ "$ref": "settings-alias-schema.json"
16
+ },
17
+ "colors": {
18
+ "$ref": "settings-colors-schema.json"
19
+ },
20
+ "levels": {
21
+ "$ref": "settings-levels-schema.json"
22
+ },
23
+ "isTimeInterval": {
24
+ "type": "boolean",
25
+ "description": "是否开启时间分片",
26
+ "default": false
27
+ },
28
+ "rangeColorKey": {
29
+ "type": "string",
30
+ "description": "区间颜色选择色系的唯一对应健",
31
+ "enum": [
32
+ "light-blue",
33
+ "light-red",
34
+ "dark-red",
35
+ "dark-yellow",
36
+ "dark-green",
37
+ "dark-blue",
38
+ "dark-purple",
39
+ "light-yellow",
40
+ "light-purple",
41
+ "light-green"
42
+ ]
43
+ },
44
+ "levelArr": {
45
+ "type": "array",
46
+ "description": "区间颜色配置",
47
+ "items": {
48
+ "type": "object",
49
+ "required": [
50
+ "min",
51
+ "max",
52
+ "color"
53
+ ],
54
+ "properties": {
55
+ "min": {
56
+ "type": "integer",
57
+ "description": "区间左范围值"
58
+ },
59
+ "max": {
60
+ "type": "integer",
61
+ "description": "区间右范围值"
62
+ },
63
+ "color": {
64
+ "type": "string",
65
+ "description": "区间范围内显示色值"
66
+ },
67
+ "isAuto": {
68
+ "type": "boolean",
69
+ "description": "是否是自动生成的区间范围"
70
+ }
71
+ }
72
+ }
73
+ },
74
+ "showLegend": {
75
+ "type": "string",
76
+ "description": "显示图例的位置信息,可以选择隐藏,以及在底部区域",
77
+ "enum": [
78
+ "none",
79
+ "bottom"
80
+ ]
81
+ },
82
+ "showTopList": {
83
+ "type": "boolean",
84
+ "description": "是否显示地区排名列表",
85
+ "default": false
86
+ },
87
+ "mainMeasurementQueryCode": {
88
+ "type": "string",
89
+ "description": "选择指标匹配色块大小,值为对应查询语句 code 名称,根据查询语句顺序以大些字母命名",
90
+ "default": "A"
91
+ },
92
+ "provinceKey": {
93
+ "type": "string",
94
+ "description": "选择对应国家的指标名称"
95
+ }
96
+ }
97
+ },
98
+ {
99
+ "$ref": "settings-units-schema.json"
100
+ }
101
+ ]
102
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/settings/common-settings-schema.json",
4
+ "title": "CommonChartSettings",
5
+ "type": "object",
6
+ "description": "所有图表通用的图表配置结构",
7
+ "allOf": [
8
+ {
9
+ "properties": {
10
+ "showTitle": {
11
+ "type": "boolean",
12
+ "description": "是否显示图表标题",
13
+ "default": true
14
+ },
15
+ "titleDesc": {
16
+ "type": "string",
17
+ "description": "图表的描述信息",
18
+ "default": ""
19
+ },
20
+ "isSampling": {
21
+ "type": "boolean",
22
+ "description": "启用后,当数据量过大时,会对除“指标”外的其他类型数据自动执行采样查询,采样率不固定,会根据数据量大小动态调整",
23
+ "default": true
24
+ },
25
+ "changeWorkspace": {
26
+ "type": "boolean",
27
+ "description": "在图表中查询外部工作空间的数据,可选择“跨空间授权”中已添加的工作空间",
28
+ "default": false
29
+ },
30
+ "workspaceUUID": {
31
+ "type": "string",
32
+ "examples": [
33
+ "wksp_xxxx1,wksp_xxxx2"
34
+ ],
35
+ "description": "开启跨空间后,选择授权空间的空间 id 列表,用 “,” 号分割"
36
+ },
37
+ "workspaceName": {
38
+ "type": "array",
39
+ "description": "开启跨空间后,选择授权空间的空间名称",
40
+ "items": {
41
+ "anyOf": [
42
+ {
43
+ "type": "string"
44
+ },
45
+ {
46
+ "type": "null"
47
+ }
48
+ ]
49
+ }
50
+ },
51
+ "showFieldMapping": {
52
+ "type": "boolean",
53
+ "description": "应用于实际查询字段与前端显示字段不一致时,a→b,即实际查询字段 a,图表中映射显示为字段 b",
54
+ "default": false
55
+ },
56
+ "openThousandsSeparator": {
57
+ "type": "boolean",
58
+ "default": true,
59
+ "description": "是否开启千分位分割符显示"
60
+ },
61
+ "precision": {
62
+ "type": "string",
63
+ "default": "2",
64
+ "description": "图表值精确的小数点位数"
65
+ },
66
+ "openTimeOffset": {
67
+ "type": "boolean",
68
+ "description": "启用时间偏移后,当查询相对时间区间时,实际查询时间范围向前偏移 1 分钟,以防止入库延迟导致数据获取为空。如:当前为12:30,查询最近15分钟的数据,开启时间偏移后,实际查询的时间是:12:14-12:29。",
69
+ "default": false
70
+ },
71
+ "aliasVersion": {
72
+ "type": "integer",
73
+ "description": "区分别名版本,固定为 2",
74
+ "const": 2
75
+ }
76
+ }
77
+ },
78
+ {
79
+ "$ref": "settings-time-schema.json"
80
+ }
81
+ ]
82
+ }