@antv/gpt-vis 0.0.6 → 0.2.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 (272) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +92 -50
  3. package/README.zh-CN.md +138 -0
  4. package/dist/cjs/Area/index.d.ts +8 -2
  5. package/dist/cjs/Area/index.js +17 -16
  6. package/dist/cjs/Bar/index.d.ts +11 -0
  7. package/dist/cjs/Bar/index.js +65 -0
  8. package/dist/cjs/ChartCodeRender/Loading.d.ts +3 -0
  9. package/dist/cjs/ChartCodeRender/Loading.js +54 -0
  10. package/dist/cjs/ChartCodeRender/VisChart.d.ts +11 -0
  11. package/dist/cjs/ChartCodeRender/VisChart.js +84 -0
  12. package/dist/cjs/ChartCodeRender/index.d.ts +3 -4
  13. package/dist/cjs/ChartCodeRender/index.js +24 -68
  14. package/dist/cjs/ChartCodeRender/type.d.ts +9 -11
  15. package/dist/cjs/Column/index.d.ts +8 -2
  16. package/dist/cjs/Column/index.js +19 -27
  17. package/dist/cjs/ConfigProvider/context.d.ts +3 -0
  18. package/dist/cjs/ConfigProvider/context.js +41 -0
  19. package/dist/cjs/ConfigProvider/hooks/index.d.ts +1 -0
  20. package/dist/cjs/ConfigProvider/hooks/index.js +23 -0
  21. package/dist/cjs/ConfigProvider/hooks/useConfig.d.ts +13 -0
  22. package/dist/cjs/ConfigProvider/hooks/useConfig.js +108 -0
  23. package/dist/cjs/ConfigProvider/index.d.ts +2 -5
  24. package/dist/cjs/ConfigProvider/index.js +15 -9
  25. package/dist/cjs/DualAxes/index.d.ts +15 -0
  26. package/dist/cjs/DualAxes/index.js +71 -0
  27. package/dist/cjs/DualAxes/util.d.ts +9 -0
  28. package/dist/cjs/DualAxes/util.js +73 -0
  29. package/dist/cjs/FlowDiagram/index.d.ts +6 -0
  30. package/dist/cjs/FlowDiagram/index.js +100 -0
  31. package/dist/cjs/GPTVis/Lite.d.ts +10 -0
  32. package/dist/cjs/GPTVis/Lite.js +54 -0
  33. package/dist/cjs/GPTVis/index.d.ts +4 -8
  34. package/dist/cjs/GPTVis/index.js +4 -4
  35. package/dist/cjs/HeatMap/index.d.ts +7 -7
  36. package/dist/cjs/HeatMap/index.js +13 -26
  37. package/dist/cjs/Histogram/index.d.ts +10 -0
  38. package/dist/cjs/Histogram/index.js +51 -0
  39. package/dist/cjs/IndentedTree/index.d.ts +6 -0
  40. package/dist/cjs/IndentedTree/index.js +63 -0
  41. package/dist/cjs/Line/index.d.ts +8 -6
  42. package/dist/cjs/Line/index.js +15 -16
  43. package/dist/cjs/Map/data.json +305 -0
  44. package/dist/cjs/Map/index.d.ts +5 -0
  45. package/dist/cjs/Map/index.js +68 -0
  46. package/dist/cjs/MindMap/index.d.ts +6 -0
  47. package/dist/cjs/MindMap/index.js +64 -0
  48. package/dist/cjs/NetworkGraph/index.d.ts +6 -0
  49. package/dist/cjs/NetworkGraph/index.js +72 -0
  50. package/dist/cjs/OrganizationChart/index.d.ts +6 -0
  51. package/dist/cjs/OrganizationChart/index.js +93 -0
  52. package/dist/cjs/PathMap/index.d.ts +3 -9
  53. package/dist/cjs/PathMap/index.js +19 -109
  54. package/dist/cjs/Pie/index.d.ts +7 -5
  55. package/dist/cjs/Pie/index.js +17 -13
  56. package/dist/cjs/PinMap/index.d.ts +3 -9
  57. package/dist/cjs/PinMap/index.js +6 -85
  58. package/dist/cjs/Radar/index.d.ts +11 -0
  59. package/dist/cjs/Radar/index.js +84 -0
  60. package/dist/cjs/Scatter/index.d.ts +11 -0
  61. package/dist/cjs/Scatter/index.js +57 -0
  62. package/dist/cjs/Text/VisText.d.ts +4 -0
  63. package/dist/cjs/Text/VisText.js +74 -0
  64. package/dist/cjs/Text/config.d.ts +18 -0
  65. package/dist/cjs/Text/config.js +91 -0
  66. package/dist/cjs/Text/constants.d.ts +9 -0
  67. package/dist/cjs/Text/constants.js +37 -0
  68. package/dist/cjs/Text/custom-icons/index.d.ts +3 -0
  69. package/dist/cjs/Text/custom-icons/index.js +66 -0
  70. package/dist/cjs/Text/index.d.ts +3 -0
  71. package/dist/cjs/Text/index.js +42 -0
  72. package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.d.ts +1 -0
  73. package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.js +65 -0
  74. package/dist/cjs/Text/mini-charts/hooks/index.d.ts +1 -0
  75. package/dist/cjs/Text/mini-charts/hooks/index.js +29 -0
  76. package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.d.ts +5 -0
  77. package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.js +65 -0
  78. package/dist/cjs/Text/mini-charts/index.d.ts +2 -0
  79. package/dist/cjs/Text/mini-charts/index.js +25 -0
  80. package/dist/cjs/Text/mini-charts/line/SingleLineChart.d.ts +3 -0
  81. package/dist/cjs/Text/mini-charts/line/SingleLineChart.js +63 -0
  82. package/dist/cjs/Text/mini-charts/line/index.d.ts +1 -0
  83. package/dist/cjs/Text/mini-charts/line/index.js +29 -0
  84. package/dist/cjs/Text/mini-charts/line/scaleLinear.d.ts +4 -0
  85. package/dist/cjs/Text/mini-charts/line/scaleLinear.js +35 -0
  86. package/dist/cjs/Text/mini-charts/line/useLineCompute.d.ts +6 -0
  87. package/dist/cjs/Text/mini-charts/line/useLineCompute.js +103 -0
  88. package/dist/cjs/Text/mini-charts/proportion/getArcPath.d.ts +1 -0
  89. package/dist/cjs/Text/mini-charts/proportion/getArcPath.js +51 -0
  90. package/dist/cjs/Text/mini-charts/proportion/index.d.ts +3 -0
  91. package/dist/cjs/Text/mini-charts/proportion/index.js +72 -0
  92. package/dist/cjs/Text/types.d.ts +20 -0
  93. package/dist/cjs/Text/types.js +17 -0
  94. package/dist/cjs/Treemap/index.d.ts +11 -0
  95. package/dist/cjs/Treemap/index.js +73 -0
  96. package/dist/cjs/WordCloud/index.d.ts +4 -5
  97. package/dist/cjs/WordCloud/index.js +7 -15
  98. package/dist/cjs/constants/index.d.ts +1 -3
  99. package/dist/cjs/constants/index.js +4 -35
  100. package/dist/cjs/export.d.ts +28 -0
  101. package/dist/cjs/export.js +116 -0
  102. package/dist/cjs/index.d.ts +10 -11
  103. package/dist/cjs/index.js +9 -25
  104. package/dist/cjs/types/chart.d.ts +49 -14
  105. package/dist/cjs/types/chart.js +12 -0
  106. package/dist/cjs/types/config.d.ts +16 -0
  107. package/dist/cjs/types/index.d.ts +1 -1
  108. package/dist/cjs/types/index.js +0 -9
  109. package/dist/cjs/types/map.d.ts +242 -0
  110. package/dist/cjs/types/map.js +17 -0
  111. package/dist/cjs/utils/config.d.ts +5 -5
  112. package/dist/cjs/utils/config.js +41 -24
  113. package/dist/cjs/utils/graph.d.ts +18 -0
  114. package/dist/cjs/utils/graph.js +64 -0
  115. package/dist/cjs/utils/index.d.ts +1 -1
  116. package/dist/cjs/utils/index.js +3 -13
  117. package/dist/cjs/utils/map/context.d.ts +3 -0
  118. package/dist/cjs/utils/map/context.js +42 -0
  119. package/dist/cjs/utils/map/controls.d.ts +0 -0
  120. package/dist/cjs/utils/map/controls.js +0 -0
  121. package/dist/cjs/utils/map/index.d.ts +6 -0
  122. package/dist/cjs/utils/map/index.js +33 -0
  123. package/dist/cjs/utils/map/markers.d.ts +2 -0
  124. package/dist/cjs/utils/map/markers.js +88 -0
  125. package/dist/cjs/utils/map/polyline.d.ts +2 -0
  126. package/dist/cjs/utils/map/polyline.js +52 -0
  127. package/dist/cjs/utils/map/style.d.ts +45 -0
  128. package/dist/cjs/utils/map/style.js +112 -0
  129. package/dist/cjs/utils/map/util.d.ts +1 -0
  130. package/dist/cjs/utils/map/util.js +38 -0
  131. package/dist/cjs/utils/map/view.d.ts +3 -0
  132. package/dist/cjs/utils/map/view.js +93 -0
  133. package/dist/cjs/utils/plot.d.ts +4 -0
  134. package/dist/cjs/utils/plot.js +69 -0
  135. package/dist/cjs/version.d.ts +2 -0
  136. package/dist/cjs/version.js +25 -0
  137. package/dist/esm/Area/index.d.ts +8 -2
  138. package/dist/esm/Area/index.js +21 -27
  139. package/dist/esm/Bar/index.d.ts +11 -0
  140. package/dist/esm/Bar/index.js +35 -0
  141. package/dist/esm/ChartCodeRender/Loading.d.ts +3 -0
  142. package/dist/esm/ChartCodeRender/Loading.js +20 -0
  143. package/dist/esm/ChartCodeRender/VisChart.d.ts +11 -0
  144. package/dist/esm/ChartCodeRender/VisChart.js +65 -0
  145. package/dist/esm/ChartCodeRender/index.d.ts +3 -4
  146. package/dist/esm/ChartCodeRender/index.js +28 -84
  147. package/dist/esm/ChartCodeRender/type.d.ts +9 -11
  148. package/dist/esm/Column/index.d.ts +8 -2
  149. package/dist/esm/Column/index.js +22 -27
  150. package/dist/esm/ConfigProvider/context.d.ts +3 -0
  151. package/dist/esm/ConfigProvider/context.js +3 -0
  152. package/dist/esm/ConfigProvider/hooks/index.d.ts +1 -0
  153. package/dist/esm/ConfigProvider/hooks/index.js +1 -0
  154. package/dist/esm/ConfigProvider/hooks/useConfig.d.ts +13 -0
  155. package/dist/esm/ConfigProvider/hooks/useConfig.js +57 -0
  156. package/dist/esm/ConfigProvider/index.d.ts +2 -5
  157. package/dist/esm/ConfigProvider/index.js +9 -9
  158. package/dist/esm/DualAxes/index.d.ts +15 -0
  159. package/dist/esm/DualAxes/index.js +44 -0
  160. package/dist/esm/DualAxes/util.d.ts +9 -0
  161. package/dist/esm/DualAxes/util.js +61 -0
  162. package/dist/esm/FlowDiagram/index.d.ts +6 -0
  163. package/dist/esm/FlowDiagram/index.js +75 -0
  164. package/dist/esm/GPTVis/Lite.d.ts +10 -0
  165. package/dist/esm/GPTVis/Lite.js +18 -0
  166. package/dist/esm/GPTVis/index.d.ts +4 -8
  167. package/dist/esm/GPTVis/index.js +5 -5
  168. package/dist/esm/HeatMap/index.d.ts +7 -7
  169. package/dist/esm/HeatMap/index.js +19 -27
  170. package/dist/esm/Histogram/index.d.ts +10 -0
  171. package/dist/esm/Histogram/index.js +25 -0
  172. package/dist/esm/IndentedTree/index.d.ts +6 -0
  173. package/dist/esm/IndentedTree/index.js +47 -0
  174. package/dist/esm/Line/index.d.ts +8 -6
  175. package/dist/esm/Line/index.js +17 -23
  176. package/dist/esm/Map/data.json +305 -0
  177. package/dist/esm/Map/index.d.ts +5 -0
  178. package/dist/esm/Map/index.js +60 -0
  179. package/dist/esm/MindMap/index.d.ts +6 -0
  180. package/dist/esm/MindMap/index.js +48 -0
  181. package/dist/esm/NetworkGraph/index.d.ts +6 -0
  182. package/dist/esm/NetworkGraph/index.js +57 -0
  183. package/dist/esm/OrganizationChart/index.d.ts +6 -0
  184. package/dist/esm/OrganizationChart/index.js +64 -0
  185. package/dist/esm/PathMap/index.d.ts +3 -9
  186. package/dist/esm/PathMap/index.js +32 -129
  187. package/dist/esm/Pie/index.d.ts +7 -5
  188. package/dist/esm/Pie/index.js +24 -20
  189. package/dist/esm/PinMap/index.d.ts +3 -9
  190. package/dist/esm/PinMap/index.js +18 -104
  191. package/dist/esm/Radar/index.d.ts +11 -0
  192. package/dist/esm/Radar/index.js +54 -0
  193. package/dist/esm/Scatter/index.d.ts +11 -0
  194. package/dist/esm/Scatter/index.js +30 -0
  195. package/dist/esm/Text/VisText.d.ts +4 -0
  196. package/dist/esm/Text/VisText.js +38 -0
  197. package/dist/esm/Text/config.d.ts +18 -0
  198. package/dist/esm/Text/config.js +79 -0
  199. package/dist/esm/Text/constants.d.ts +9 -0
  200. package/dist/esm/Text/constants.js +9 -0
  201. package/dist/esm/Text/custom-icons/index.d.ts +3 -0
  202. package/dist/esm/Text/custom-icons/index.js +37 -0
  203. package/dist/esm/Text/index.d.ts +3 -0
  204. package/dist/esm/Text/index.js +2 -0
  205. package/dist/esm/Text/mini-charts/hooks/getElementFontSize.d.ts +1 -0
  206. package/dist/esm/Text/mini-charts/hooks/getElementFontSize.js +32 -0
  207. package/dist/esm/Text/mini-charts/hooks/index.d.ts +1 -0
  208. package/dist/esm/Text/mini-charts/hooks/index.js +1 -0
  209. package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.d.ts +5 -0
  210. package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.js +31 -0
  211. package/dist/esm/Text/mini-charts/index.d.ts +2 -0
  212. package/dist/esm/Text/mini-charts/index.js +2 -0
  213. package/dist/esm/Text/mini-charts/line/SingleLineChart.d.ts +3 -0
  214. package/dist/esm/Text/mini-charts/line/SingleLineChart.js +57 -0
  215. package/dist/esm/Text/mini-charts/line/index.d.ts +1 -0
  216. package/dist/esm/Text/mini-charts/line/index.js +1 -0
  217. package/dist/esm/Text/mini-charts/line/scaleLinear.d.ts +4 -0
  218. package/dist/esm/Text/mini-charts/line/scaleLinear.js +14 -0
  219. package/dist/esm/Text/mini-charts/line/useLineCompute.d.ts +6 -0
  220. package/dist/esm/Text/mini-charts/line/useLineCompute.js +106 -0
  221. package/dist/esm/Text/mini-charts/proportion/getArcPath.d.ts +1 -0
  222. package/dist/esm/Text/mini-charts/proportion/getArcPath.js +19 -0
  223. package/dist/esm/Text/mini-charts/proportion/index.d.ts +3 -0
  224. package/dist/esm/Text/mini-charts/proportion/index.js +60 -0
  225. package/dist/esm/Text/types.d.ts +20 -0
  226. package/dist/esm/Text/types.js +1 -0
  227. package/dist/esm/Treemap/index.d.ts +11 -0
  228. package/dist/esm/Treemap/index.js +52 -0
  229. package/dist/esm/WordCloud/index.d.ts +4 -5
  230. package/dist/esm/WordCloud/index.js +8 -18
  231. package/dist/esm/constants/index.d.ts +1 -3
  232. package/dist/esm/constants/index.js +5 -14
  233. package/dist/esm/export.d.ts +28 -0
  234. package/dist/esm/export.js +33 -0
  235. package/dist/esm/index.d.ts +10 -11
  236. package/dist/esm/index.js +9 -9
  237. package/dist/esm/types/chart.d.ts +49 -14
  238. package/dist/esm/types/chart.js +12 -0
  239. package/dist/esm/types/config.d.ts +16 -0
  240. package/dist/esm/types/index.d.ts +1 -1
  241. package/dist/esm/types/index.js +1 -1
  242. package/dist/esm/types/map.d.ts +242 -0
  243. package/dist/esm/types/map.js +1 -0
  244. package/dist/esm/utils/config.d.ts +5 -5
  245. package/dist/esm/utils/config.js +40 -18
  246. package/dist/esm/utils/graph.d.ts +18 -0
  247. package/dist/esm/utils/graph.js +49 -0
  248. package/dist/esm/utils/index.d.ts +1 -1
  249. package/dist/esm/utils/index.js +1 -1
  250. package/dist/esm/utils/map/context.d.ts +3 -0
  251. package/dist/esm/utils/map/context.js +34 -0
  252. package/dist/esm/utils/map/controls.d.ts +0 -0
  253. package/dist/esm/utils/map/controls.js +0 -0
  254. package/dist/esm/utils/map/index.d.ts +6 -0
  255. package/dist/esm/utils/map/index.js +6 -0
  256. package/dist/esm/utils/map/markers.d.ts +2 -0
  257. package/dist/esm/utils/map/markers.js +64 -0
  258. package/dist/esm/utils/map/polyline.d.ts +2 -0
  259. package/dist/esm/utils/map/polyline.js +26 -0
  260. package/dist/esm/utils/map/style.d.ts +45 -0
  261. package/dist/esm/utils/map/style.js +76 -0
  262. package/dist/esm/utils/map/util.d.ts +1 -0
  263. package/dist/esm/utils/map/util.js +11 -0
  264. package/dist/esm/utils/map/view.d.ts +3 -0
  265. package/dist/esm/utils/map/view.js +81 -0
  266. package/dist/esm/utils/plot.d.ts +4 -0
  267. package/dist/esm/utils/plot.js +65 -0
  268. package/dist/esm/version.d.ts +2 -0
  269. package/dist/esm/version.js +1 -0
  270. package/dist/umd/895.async.js +1 -0
  271. package/dist/umd/index.min.js +1 -0
  272. package/package.json +97 -58
@@ -2,10 +2,6 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
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
5
  var __copyProps = (to, from, except, desc) => {
10
6
  if (from && typeof from === "object" || typeof from === "function") {
11
7
  for (let key of __getOwnPropNames(from))
@@ -14,20 +10,14 @@ var __copyProps = (to, from, except, desc) => {
14
10
  }
15
11
  return to;
16
12
  };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
15
 
19
16
  // src/utils/index.ts
20
17
  var utils_exports = {};
21
- __export(utils_exports, {
22
- getGlobalConfig: () => import_config.getGlobalConfig,
23
- getMapConfig: () => import_config.getMapConfig,
24
- setGlobalConfig: () => import_config.setGlobalConfig
25
- });
26
18
  module.exports = __toCommonJS(utils_exports);
27
- var import_config = require("./config");
19
+ __reExport(utils_exports, require("./map"), module.exports);
28
20
  // Annotate the CommonJS export names for ESM import in node:
29
21
  0 && (module.exports = {
30
- getGlobalConfig,
31
- getMapConfig,
32
- setGlobalConfig
22
+ ...require("./map")
33
23
  });
@@ -0,0 +1,3 @@
1
+ import type { Scene } from '@antv/l7';
2
+ import type { Map } from '../../types/map';
3
+ export declare function setMapContext(props: Map, scene: Scene): Promise<void[]> | undefined;
@@ -0,0 +1,42 @@
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
+
19
+ // src/utils/map/context.ts
20
+ var context_exports = {};
21
+ __export(context_exports, {
22
+ setMapContext: () => setMapContext
23
+ });
24
+ module.exports = __toCommonJS(context_exports);
25
+ var import_util = require("./util");
26
+ function setMapContext(props, scene) {
27
+ if (props.markers) {
28
+ const icons = new Set(
29
+ props.markers.filter((item) => item.iconPath !== void 0).map((item) => item.iconPath)
30
+ );
31
+ return Promise.all(
32
+ Array.from(icons.values()).map(async (url) => {
33
+ const id = (0, import_util.urlToMarkerId)(url);
34
+ return await scene.addImage(id, url);
35
+ })
36
+ );
37
+ }
38
+ }
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ setMapContext
42
+ });
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ export * from './context';
2
+ export * from './markers';
3
+ export * from './polyline';
4
+ export * from './style';
5
+ export * from './util';
6
+ export * from './view';
@@ -0,0 +1,33 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/utils/map/index.ts
17
+ var map_exports = {};
18
+ module.exports = __toCommonJS(map_exports);
19
+ __reExport(map_exports, require("./context"), module.exports);
20
+ __reExport(map_exports, require("./markers"), module.exports);
21
+ __reExport(map_exports, require("./polyline"), module.exports);
22
+ __reExport(map_exports, require("./style"), module.exports);
23
+ __reExport(map_exports, require("./util"), module.exports);
24
+ __reExport(map_exports, require("./view"), module.exports);
25
+ // Annotate the CommonJS export names for ESM import in node:
26
+ 0 && (module.exports = {
27
+ ...require("./context"),
28
+ ...require("./markers"),
29
+ ...require("./polyline"),
30
+ ...require("./style"),
31
+ ...require("./util"),
32
+ ...require("./view")
33
+ });
@@ -0,0 +1,2 @@
1
+ import type { Marker as MarkerProps } from '../../types/map';
2
+ export declare function setMarkers(data: MarkerProps[]): import("@antv/l7").ILayer[];
@@ -0,0 +1,88 @@
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
+
19
+ // src/utils/map/markers.ts
20
+ var markers_exports = {};
21
+ __export(markers_exports, {
22
+ setMarkers: () => setMarkers
23
+ });
24
+ module.exports = __toCommonJS(markers_exports);
25
+ var import_l7 = require("@antv/l7");
26
+ var import_lodash = require("lodash");
27
+ var import_util = require("./util");
28
+ function setMarkers(data) {
29
+ const items = data.map((item) => {
30
+ var _a, _b, _c;
31
+ return {
32
+ ...item,
33
+ label: (0, import_lodash.isObject)(item.label) ? item.label.content : item.label,
34
+ color: (_a = item.label) == null ? void 0 : _a.color,
35
+ bgColor: (_b = item.label) == null ? void 0 : _b.bgColor,
36
+ fontSize: (_c = item.label) == null ? void 0 : _c.fontSize,
37
+ offsets: [item.anchorX || 0, item.anchorY || -1],
38
+ iconPath: item.iconPath ? (0, import_util.urlToMarkerId)(item.iconPath) : void 0
39
+ };
40
+ });
41
+ const icons = items.filter((item) => item.iconPath !== void 0);
42
+ const texts = items.filter((item) => item.label !== void 0);
43
+ const layers = [];
44
+ if (texts.length > 0) {
45
+ const offsets = texts[0].offsets;
46
+ const fontSize = texts[0].fontSize || 10;
47
+ const text = new import_l7.PointLayer({
48
+ zIndex: 2
49
+ }).source(texts, {
50
+ parser: {
51
+ type: "json",
52
+ x: "longitude",
53
+ y: "latitude"
54
+ }
55
+ }).shape("label", "text").size("fontSize").color("color").style({
56
+ opacity: 1,
57
+ textOffset: [offsets[0], -2 * offsets[1] * fontSize],
58
+ fontWeight: 600,
59
+ textAnchor: "center",
60
+ stroke: texts[0].bgColor || "#ffffff",
61
+ // 描边颜色
62
+ strokeWidth: 2,
63
+ // 描边宽度
64
+ strokeOpacity: 1,
65
+ padding: [10, 10]
66
+ });
67
+ layers.push(text);
68
+ }
69
+ if (icons.length !== 0) {
70
+ const offsets = icons[0].offsets;
71
+ const width = icons[0].width || 10;
72
+ const iconLayer = new import_l7.PointLayer().source(icons, {
73
+ parser: {
74
+ type: "json",
75
+ x: "longitude",
76
+ y: "latitude"
77
+ }
78
+ }).shape("iconPath").size("width").style({
79
+ offsets: [offsets[0], offsets[1] * width]
80
+ });
81
+ layers.push(iconLayer);
82
+ }
83
+ return layers;
84
+ }
85
+ // Annotate the CommonJS export names for ESM import in node:
86
+ 0 && (module.exports = {
87
+ setMarkers
88
+ });
@@ -0,0 +1,2 @@
1
+ import type { Polyline as PolylinePorps } from '../../types/map';
2
+ export declare function setPolyline(data: PolylinePorps[]): import("@antv/l7").ILayer[];
@@ -0,0 +1,52 @@
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
+
19
+ // src/utils/map/polyline.ts
20
+ var polyline_exports = {};
21
+ __export(polyline_exports, {
22
+ setPolyline: () => setPolyline
23
+ });
24
+ module.exports = __toCommonJS(polyline_exports);
25
+ var import_l7 = require("@antv/l7");
26
+ function setPolyline(data) {
27
+ const lineData = data.map((item) => {
28
+ const coord = item.points.map((point) => [point.longitude, point.latitude]);
29
+ return {
30
+ ...item,
31
+ coordinates: coord,
32
+ color: item.color,
33
+ width: item.width
34
+ };
35
+ });
36
+ const isdash = lineData[0].dottedLine;
37
+ const lineLayer = new import_l7.LineLayer().source(lineData, {
38
+ parser: {
39
+ type: "json",
40
+ coordinates: "coordinates"
41
+ }
42
+ }).size("width").shape("line").color("color").style({
43
+ opacity: 1,
44
+ lineType: isdash ? "dash" : "solid",
45
+ dashArray: [3, 1]
46
+ });
47
+ return [lineLayer];
48
+ }
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ setPolyline
52
+ });
@@ -0,0 +1,45 @@
1
+ import type { MapProps } from '../../Map';
2
+ import type { LarkMapProps } from '../../types';
3
+ import type { Marker, MarkerData, Polyline } from '../../types/map';
4
+ declare const formatMapStyle: (props: MapProps) => LarkMapProps;
5
+ declare const DefaultMarkerStyle: {
6
+ width: number;
7
+ anchorX: number;
8
+ anchorY: number;
9
+ label: {
10
+ content: string;
11
+ color: string;
12
+ fontSize: number;
13
+ borderRadius: number;
14
+ bgColor: string;
15
+ padding: number;
16
+ };
17
+ iconPath: string;
18
+ };
19
+ declare const formatMakerStyle: (data: MarkerData[], markerStyle: Partial<Marker>) => {
20
+ label: {
21
+ content: string;
22
+ color: string;
23
+ fontSize: number;
24
+ borderRadius: number;
25
+ bgColor: string;
26
+ padding: number;
27
+ };
28
+ id: string;
29
+ iconPath: string;
30
+ width: number;
31
+ height?: number | undefined;
32
+ alpha?: number | undefined;
33
+ anchorX: number;
34
+ anchorY: number;
35
+ longitude: number;
36
+ latitude: number;
37
+ }[];
38
+ declare const DefaultPolylineStyle: {
39
+ width: number;
40
+ color: string;
41
+ dottedLine: boolean;
42
+ zIndex: number;
43
+ };
44
+ declare const formatPolylineStyle: (data: Polyline[] | undefined, polylineStyle: Partial<Marker>) => any[];
45
+ export { DefaultMarkerStyle, DefaultPolylineStyle, formatMakerStyle, formatMapStyle, formatPolylineStyle, };
@@ -0,0 +1,112 @@
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
+
19
+ // src/utils/map/style.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ DefaultMarkerStyle: () => DefaultMarkerStyle,
23
+ DefaultPolylineStyle: () => DefaultPolylineStyle,
24
+ formatMakerStyle: () => formatMakerStyle,
25
+ formatMapStyle: () => formatMapStyle,
26
+ formatPolylineStyle: () => formatPolylineStyle
27
+ });
28
+ module.exports = __toCommonJS(style_exports);
29
+ var import_lodash = require("lodash");
30
+ var DefaultMapConfig = {
31
+ mapOptions: {
32
+ center: [120.210792, 30.246026],
33
+ zoom: 16,
34
+ maxZoom: 18,
35
+ pitch: 0,
36
+ rotation: 0,
37
+ zoomEnable: true,
38
+ pitchEnable: true
39
+ }
40
+ };
41
+ var formatMapStyle = (props) => {
42
+ const config = {
43
+ mapOptions: {
44
+ ...DefaultMapConfig.mapOptions,
45
+ center: props.longitude && props.latitude ? [props.longitude, props.latitude] : DefaultMapConfig.mapOptions.center,
46
+ zoom: props.scale || DefaultMapConfig.mapOptions.zoom,
47
+ pitch: props.skew || DefaultMapConfig.mapOptions.pitch,
48
+ rotation: props.rotate || DefaultMapConfig.mapOptions.rotation,
49
+ zoomEnable: props.enableZoom || DefaultMapConfig.mapOptions.zoomEnable,
50
+ pitchEnable: props.enableRotate || DefaultMapConfig.mapOptions.pitchEnable,
51
+ // 地图底图样式
52
+ style: props == null ? void 0 : props.mapType,
53
+ // 高德地图密钥
54
+ token: props == null ? void 0 : props.token
55
+ },
56
+ logoVisible: false
57
+ };
58
+ return config;
59
+ };
60
+ var DefaultMarkerStyle = {
61
+ width: 12,
62
+ anchorX: 0,
63
+ anchorY: 1,
64
+ label: {
65
+ content: "",
66
+ color: "#000000",
67
+ fontSize: 10,
68
+ borderRadius: 5,
69
+ bgColor: "#ffffff",
70
+ padding: 5
71
+ },
72
+ iconPath: "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*3XdDTbsQ84QAAAAAAAAAAAAADmJ7AQ/original"
73
+ };
74
+ var formatMakerStyle = (data, markerStyle) => {
75
+ const labelStyle = Object.assign({}, DefaultMarkerStyle.label, markerStyle == null ? void 0 : markerStyle.label);
76
+ return data.map((marker, index) => {
77
+ const { label, id, ...rest } = marker;
78
+ return {
79
+ ...DefaultMarkerStyle,
80
+ ...markerStyle,
81
+ ...rest,
82
+ label: {
83
+ ...labelStyle,
84
+ ...(0, import_lodash.isObject)(label) ? label : { content: label }
85
+ },
86
+ id: id || index.toString()
87
+ };
88
+ });
89
+ };
90
+ var DefaultPolylineStyle = {
91
+ width: 2,
92
+ color: "#16f",
93
+ dottedLine: false,
94
+ zIndex: 1
95
+ };
96
+ var formatPolylineStyle = (data = [], polylineStyle) => {
97
+ return data.map((item) => {
98
+ return {
99
+ ...DefaultPolylineStyle,
100
+ ...polylineStyle,
101
+ ...item
102
+ };
103
+ });
104
+ };
105
+ // Annotate the CommonJS export names for ESM import in node:
106
+ 0 && (module.exports = {
107
+ DefaultMarkerStyle,
108
+ DefaultPolylineStyle,
109
+ formatMakerStyle,
110
+ formatMapStyle,
111
+ formatPolylineStyle
112
+ });
@@ -0,0 +1 @@
1
+ export declare function urlToMarkerId(url: string): string;
@@ -0,0 +1,38 @@
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
+
19
+ // src/utils/map/util.ts
20
+ var util_exports = {};
21
+ __export(util_exports, {
22
+ urlToMarkerId: () => urlToMarkerId
23
+ });
24
+ module.exports = __toCommonJS(util_exports);
25
+ function urlToMarkerId(url) {
26
+ let hash = 0;
27
+ if (url.length > 0) {
28
+ for (let i = 0; i < url.length; i++) {
29
+ hash = (hash << 5) - hash + url.charCodeAt(i) | 0;
30
+ }
31
+ }
32
+ const id = Math.abs(hash % 1e4).toString().padStart(4, "0");
33
+ return `marker-${id}`;
34
+ }
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ urlToMarkerId
38
+ });
@@ -0,0 +1,3 @@
1
+ import type { Scene } from '@antv/l7';
2
+ import type { Map } from '../../types/map';
3
+ export declare const setMapView: (props: Map, scene: Scene) => void;
@@ -0,0 +1,93 @@
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
+
19
+ // src/utils/map/view.ts
20
+ var view_exports = {};
21
+ __export(view_exports, {
22
+ setMapView: () => setMapView
23
+ });
24
+ module.exports = __toCommonJS(view_exports);
25
+ function fitIncludePoints(includePoints, scene, includePadding) {
26
+ if (includePoints.length === 1) {
27
+ scene.setCenter([includePoints[0].longitude, includePoints[0].latitude]);
28
+ } else {
29
+ const bounds = [180, 90, -180, -90];
30
+ includePoints.forEach((point) => {
31
+ if (bounds[0] > point.longitude) {
32
+ bounds[0] = point.longitude;
33
+ }
34
+ if (bounds[1] > point.latitude) {
35
+ bounds[1] = point.latitude;
36
+ }
37
+ if (bounds[2] < point.longitude) {
38
+ bounds[2] = point.longitude;
39
+ }
40
+ if (bounds[3] < point.latitude) {
41
+ bounds[3] = point.latitude;
42
+ }
43
+ });
44
+ const { left = 20, right = 20, bottom = 20, top = 20 } = includePadding || {};
45
+ const padding = [left, top, right, bottom];
46
+ scene.map.setBounds(bounds, false, padding);
47
+ }
48
+ }
49
+ var setMapView = (props, scene) => {
50
+ if (props.includePoints) {
51
+ fitIncludePoints(props.includePoints, scene, props.includePadding);
52
+ } else {
53
+ const points = [];
54
+ if (props.markers) {
55
+ props.markers.forEach((item) => {
56
+ points.push({ longitude: item.longitude, latitude: item.latitude });
57
+ });
58
+ }
59
+ if (props.polyline) {
60
+ props.polyline.forEach((item) => {
61
+ item.points.forEach((point) => {
62
+ points.push({ longitude: point.longitude, latitude: point.latitude });
63
+ });
64
+ });
65
+ }
66
+ if (points.length) {
67
+ fitIncludePoints(points, scene, props.includePadding);
68
+ }
69
+ }
70
+ if (props.enableZoom !== void 0) {
71
+ scene.setMapStatus({
72
+ zoomEnable: props.enableZoom
73
+ });
74
+ }
75
+ if (props.enableRotate !== void 0) {
76
+ scene.setMapStatus({
77
+ rotateEnable: props.enableRotate
78
+ });
79
+ }
80
+ if (props.enableScroll !== void 0) {
81
+ scene.setMapStatus({
82
+ dragEnable: props.enableScroll
83
+ });
84
+ }
85
+ if (props.onInitComplete) {
86
+ scene.off("loaded", props.onInitComplete);
87
+ scene.on("loaded", props.onInitComplete);
88
+ }
89
+ };
90
+ // Annotate the CommonJS export names for ESM import in node:
91
+ 0 && (module.exports = {
92
+ setMapView
93
+ });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 将 GPT-Vis 图表的配置转换为 ADC 的配置
3
+ */
4
+ export declare function transform2ADCProps<T extends Record<string, any>>(props: T): T;
@@ -0,0 +1,69 @@
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
+
19
+ // src/utils/plot.ts
20
+ var plot_exports = {};
21
+ __export(plot_exports, {
22
+ transform2ADCProps: () => transform2ADCProps
23
+ });
24
+ module.exports = __toCommonJS(plot_exports);
25
+ var import_lodash = require("lodash");
26
+ var ADC_ENCODE_FIELDS = /* @__PURE__ */ new Map([
27
+ ["x", "xField"],
28
+ ["y", "yField"],
29
+ ["series", "seriesField"],
30
+ ["size", "sizeField"],
31
+ ["color", "colorField"],
32
+ ["shape", "shapeField"],
33
+ ["y", "angleField"]
34
+ ]);
35
+ function visG2Encode2ADCEncode(config) {
36
+ const encodeConfig = config.encode;
37
+ if (!encodeConfig)
38
+ return config;
39
+ const _config = { ...config };
40
+ for (const field of encodeConfig) {
41
+ const adcField = ADC_ENCODE_FIELDS.get(field);
42
+ if (adcField) {
43
+ _config[adcField] = encodeConfig[field];
44
+ }
45
+ }
46
+ return _config;
47
+ }
48
+ function axisTitle2G2axis(config) {
49
+ const { axisXTitle, axisYTitle, axis } = config;
50
+ if (!(0, import_lodash.isUndefined)(axis))
51
+ return config;
52
+ const _config = { axis: {}, ...config };
53
+ if (axisXTitle) {
54
+ _config.axis.x = { title: axisXTitle };
55
+ }
56
+ if (axisYTitle) {
57
+ _config.axis.y = { title: axisYTitle };
58
+ }
59
+ return _config;
60
+ }
61
+ function transform2ADCProps(props) {
62
+ const transformedEncode = visG2Encode2ADCEncode(props);
63
+ const transformedAxis = axisTitle2G2axis(transformedEncode);
64
+ return transformedAxis;
65
+ }
66
+ // Annotate the CommonJS export names for ESM import in node:
67
+ 0 && (module.exports = {
68
+ transform2ADCProps
69
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: "0.2.0";
2
+ export default _default;