@antv/g2 5.0.0-rc.2 → 5.0.1

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 (481) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.en-US.md +5 -5
  3. package/README.md +5 -7
  4. package/dist/g2-lite.min.js +3 -3
  5. package/dist/g2.min.js +3 -3
  6. package/esm/api/chart.d.ts +5 -3
  7. package/esm/api/chart.js +14 -11
  8. package/esm/api/chart.js.map +1 -1
  9. package/esm/api/composition/base.d.ts +7 -1
  10. package/esm/api/composition/base.js +26 -0
  11. package/esm/api/composition/base.js.map +1 -1
  12. package/esm/component/axis.js +41 -27
  13. package/esm/component/axis.js.map +1 -1
  14. package/esm/component/axisRadar.js +4 -3
  15. package/esm/component/axisRadar.js.map +1 -1
  16. package/esm/component/axisX.js.map +1 -1
  17. package/esm/component/legendCategory.js +61 -36
  18. package/esm/component/legendCategory.js.map +1 -1
  19. package/esm/component/legendContinuous.js +8 -6
  20. package/esm/component/legendContinuous.js.map +1 -1
  21. package/esm/component/legendContinuousBlockSize.js +1 -1
  22. package/esm/component/legendContinuousBlockSize.js.map +1 -1
  23. package/esm/component/legendContinuousSize.js +1 -1
  24. package/esm/component/legendContinuousSize.js.map +1 -1
  25. package/esm/component/scrollbar.js +1 -1
  26. package/esm/component/scrollbar.js.map +1 -1
  27. package/esm/component/slider.js +1 -1
  28. package/esm/component/slider.js.map +1 -1
  29. package/esm/component/title.js +13 -2
  30. package/esm/component/title.js.map +1 -1
  31. package/esm/component/utils.d.ts +1 -0
  32. package/esm/component/utils.js +25 -1
  33. package/esm/component/utils.js.map +1 -1
  34. package/esm/coordinate/fisheye.js +1 -1
  35. package/esm/coordinate/fisheye.js.map +1 -1
  36. package/esm/interaction/brushFilter.js +1 -1
  37. package/esm/interaction/brushFilter.js.map +1 -1
  38. package/esm/interaction/fisheye.js +1 -1
  39. package/esm/interaction/fisheye.js.map +1 -1
  40. package/esm/interaction/legendFilter.d.ts +1 -1
  41. package/esm/interaction/legendFilter.js +33 -27
  42. package/esm/interaction/legendFilter.js.map +1 -1
  43. package/esm/interaction/sliderFilter.js +2 -2
  44. package/esm/interaction/sliderFilter.js.map +1 -1
  45. package/esm/interaction/tooltip.d.ts +1 -1
  46. package/esm/interaction/tooltip.js +5 -3
  47. package/esm/interaction/tooltip.js.map +1 -1
  48. package/esm/mark/boxplot.js +2 -2
  49. package/esm/mark/boxplot.js.map +1 -1
  50. package/esm/runtime/component.d.ts +3 -3
  51. package/esm/runtime/component.js +4 -4
  52. package/esm/runtime/component.js.map +1 -1
  53. package/esm/runtime/plot.js +2 -2
  54. package/esm/runtime/plot.js.map +1 -1
  55. package/esm/runtime/render.d.ts +1 -1
  56. package/esm/runtime/render.js +19 -3
  57. package/esm/runtime/render.js.map +1 -1
  58. package/esm/runtime/types/common.d.ts +12 -9
  59. package/esm/runtime/types/component.d.ts +13 -4
  60. package/esm/shape/area/area.js +1 -1
  61. package/esm/shape/area/area.js.map +1 -1
  62. package/esm/shape/area/curve.js +2 -1
  63. package/esm/shape/area/curve.js.map +1 -1
  64. package/esm/shape/area/hv.js +1 -1
  65. package/esm/shape/area/hv.js.map +1 -1
  66. package/esm/shape/area/hvh.js +1 -1
  67. package/esm/shape/area/hvh.js.map +1 -1
  68. package/esm/shape/area/smooth.js +1 -1
  69. package/esm/shape/area/smooth.js.map +1 -1
  70. package/esm/shape/area/vh.js +1 -1
  71. package/esm/shape/area/vh.js.map +1 -1
  72. package/esm/shape/box/box.js +1 -0
  73. package/esm/shape/box/box.js.map +1 -1
  74. package/esm/shape/connector/connector.d.ts +2 -2
  75. package/esm/shape/connector/connector.js +3 -2
  76. package/esm/shape/connector/connector.js.map +1 -1
  77. package/esm/shape/interval/funnel.js +1 -1
  78. package/esm/shape/interval/funnel.js.map +1 -1
  79. package/esm/shape/interval/hollow.js +1 -1
  80. package/esm/shape/interval/hollow.js.map +1 -1
  81. package/esm/shape/interval/pyramid.js +1 -1
  82. package/esm/shape/interval/pyramid.js.map +1 -1
  83. package/esm/shape/interval/rect.js +1 -1
  84. package/esm/shape/interval/rect.js.map +1 -1
  85. package/esm/shape/label/label.js +3 -1
  86. package/esm/shape/label/label.js.map +1 -1
  87. package/esm/shape/line/curve.js +2 -1
  88. package/esm/shape/line/curve.js.map +1 -1
  89. package/esm/shape/line/hv.js +1 -1
  90. package/esm/shape/line/hv.js.map +1 -1
  91. package/esm/shape/line/hvh.js +1 -1
  92. package/esm/shape/line/hvh.js.map +1 -1
  93. package/esm/shape/line/line.js +1 -1
  94. package/esm/shape/line/line.js.map +1 -1
  95. package/esm/shape/line/smooth.js +1 -1
  96. package/esm/shape/line/smooth.js.map +1 -1
  97. package/esm/shape/line/vh.js +1 -1
  98. package/esm/shape/line/vh.js.map +1 -1
  99. package/esm/shape/lineXY/line.js +1 -0
  100. package/esm/shape/lineXY/line.js.map +1 -1
  101. package/esm/shape/link/arc.js +1 -0
  102. package/esm/shape/link/arc.js.map +1 -1
  103. package/esm/shape/link/link.js +1 -0
  104. package/esm/shape/link/link.js.map +1 -1
  105. package/esm/shape/link/smooth.js +1 -0
  106. package/esm/shape/link/smooth.js.map +1 -1
  107. package/esm/shape/link/vhv.js +1 -0
  108. package/esm/shape/link/vhv.js.map +1 -1
  109. package/esm/shape/path/hollow.js +1 -0
  110. package/esm/shape/path/hollow.js.map +1 -1
  111. package/esm/shape/path/path.js +1 -0
  112. package/esm/shape/path/path.js.map +1 -1
  113. package/esm/shape/point/bowtie.js +1 -1
  114. package/esm/shape/point/bowtie.js.map +1 -1
  115. package/esm/shape/point/color.js +2 -2
  116. package/esm/shape/point/color.js.map +1 -1
  117. package/esm/shape/point/cross.js +1 -1
  118. package/esm/shape/point/cross.js.map +1 -1
  119. package/esm/shape/point/diamond.js +1 -1
  120. package/esm/shape/point/diamond.js.map +1 -1
  121. package/esm/shape/point/hexagon.js +1 -1
  122. package/esm/shape/point/hexagon.js.map +1 -1
  123. package/esm/shape/point/hollow.js +1 -1
  124. package/esm/shape/point/hollow.js.map +1 -1
  125. package/esm/shape/point/hollowBowtie.js +1 -1
  126. package/esm/shape/point/hollowBowtie.js.map +1 -1
  127. package/esm/shape/point/hollowDiamond.js +1 -1
  128. package/esm/shape/point/hollowDiamond.js.map +1 -1
  129. package/esm/shape/point/hollowHexagon.js +1 -1
  130. package/esm/shape/point/hollowHexagon.js.map +1 -1
  131. package/esm/shape/point/hollowSquare.js +1 -1
  132. package/esm/shape/point/hollowSquare.js.map +1 -1
  133. package/esm/shape/point/hollowTriangle.js +1 -1
  134. package/esm/shape/point/hollowTriangle.js.map +1 -1
  135. package/esm/shape/point/hollowTriangleDown.js +1 -1
  136. package/esm/shape/point/hollowTriangleDown.js.map +1 -1
  137. package/esm/shape/point/hyphen.js +1 -1
  138. package/esm/shape/point/hyphen.js.map +1 -1
  139. package/esm/shape/point/line.js +1 -1
  140. package/esm/shape/point/line.js.map +1 -1
  141. package/esm/shape/point/plus.js +1 -1
  142. package/esm/shape/point/plus.js.map +1 -1
  143. package/esm/shape/point/point.js +1 -1
  144. package/esm/shape/point/point.js.map +1 -1
  145. package/esm/shape/point/square.js +1 -1
  146. package/esm/shape/point/square.js.map +1 -1
  147. package/esm/shape/point/tick.js +1 -1
  148. package/esm/shape/point/tick.js.map +1 -1
  149. package/esm/shape/point/triangle.js +1 -1
  150. package/esm/shape/point/triangle.js.map +1 -1
  151. package/esm/shape/point/triangleDown.js +1 -1
  152. package/esm/shape/point/triangleDown.js.map +1 -1
  153. package/esm/shape/polygon/polygon.js +1 -0
  154. package/esm/shape/polygon/polygon.js.map +1 -1
  155. package/esm/shape/polygon/ribbon.js +1 -0
  156. package/esm/shape/polygon/ribbon.js.map +1 -1
  157. package/esm/shape/shape/shape.js +1 -0
  158. package/esm/shape/shape/shape.js.map +1 -1
  159. package/esm/shape/text/badge.js +1 -0
  160. package/esm/shape/text/badge.js.map +1 -1
  161. package/esm/shape/text/text.js +1 -0
  162. package/esm/shape/text/text.js.map +1 -1
  163. package/esm/shape/utils.d.ts +1 -16
  164. package/esm/shape/utils.js +2 -2
  165. package/esm/shape/utils.js.map +1 -1
  166. package/esm/shape/vector/vector.js +1 -0
  167. package/esm/shape/vector/vector.js.map +1 -1
  168. package/esm/spec/component.d.ts +10 -9
  169. package/esm/spec/coordinateTransform.d.ts +1 -1
  170. package/esm/spec/interaction.d.ts +19 -33
  171. package/esm/spec/theme.d.ts +8 -2
  172. package/esm/stdlib/index.js +2 -2
  173. package/esm/stdlib/index.js.map +1 -1
  174. package/esm/theme/academy.js +73 -74
  175. package/esm/theme/academy.js.map +1 -1
  176. package/esm/theme/classic.d.ts +6 -0
  177. package/esm/theme/{light.js → classic.js} +76 -84
  178. package/esm/theme/classic.js.map +1 -0
  179. package/esm/theme/classicDark.d.ts +6 -0
  180. package/esm/theme/{dark.js → classicDark.js} +74 -83
  181. package/esm/theme/classicDark.js.map +1 -0
  182. package/esm/theme/index.d.ts +2 -2
  183. package/esm/theme/index.js +2 -2
  184. package/esm/theme/index.js.map +1 -1
  185. package/esm/transform/maybeTitle.js +5 -1
  186. package/esm/transform/maybeTitle.js.map +1 -1
  187. package/esm/utils/marker.d.ts +10 -0
  188. package/esm/utils/marker.js +250 -0
  189. package/esm/utils/marker.js.map +1 -0
  190. package/lib/api/chart.d.ts +5 -3
  191. package/lib/api/chart.js +15 -12
  192. package/lib/api/chart.js.map +1 -1
  193. package/lib/api/composition/base.d.ts +7 -1
  194. package/lib/api/composition/base.js +26 -0
  195. package/lib/api/composition/base.js.map +1 -1
  196. package/lib/component/axis.js +40 -26
  197. package/lib/component/axis.js.map +1 -1
  198. package/lib/component/axisRadar.js +4 -3
  199. package/lib/component/axisRadar.js.map +1 -1
  200. package/lib/component/axisX.js.map +1 -1
  201. package/lib/component/legendCategory.js +60 -35
  202. package/lib/component/legendCategory.js.map +1 -1
  203. package/lib/component/legendContinuous.js +7 -5
  204. package/lib/component/legendContinuous.js.map +1 -1
  205. package/lib/component/legendContinuousBlockSize.js +1 -1
  206. package/lib/component/legendContinuousBlockSize.js.map +1 -1
  207. package/lib/component/legendContinuousSize.js +1 -1
  208. package/lib/component/legendContinuousSize.js.map +1 -1
  209. package/lib/component/scrollbar.js +1 -1
  210. package/lib/component/scrollbar.js.map +1 -1
  211. package/lib/component/slider.js +1 -1
  212. package/lib/component/slider.js.map +1 -1
  213. package/lib/component/title.js +13 -2
  214. package/lib/component/title.js.map +1 -1
  215. package/lib/component/utils.d.ts +1 -0
  216. package/lib/component/utils.js +26 -1
  217. package/lib/component/utils.js.map +1 -1
  218. package/lib/coordinate/fisheye.js +1 -1
  219. package/lib/coordinate/fisheye.js.map +1 -1
  220. package/lib/interaction/brushFilter.js +1 -1
  221. package/lib/interaction/brushFilter.js.map +1 -1
  222. package/lib/interaction/fisheye.js +1 -1
  223. package/lib/interaction/fisheye.js.map +1 -1
  224. package/lib/interaction/legendFilter.d.ts +1 -1
  225. package/lib/interaction/legendFilter.js +33 -27
  226. package/lib/interaction/legendFilter.js.map +1 -1
  227. package/lib/interaction/sliderFilter.js +2 -2
  228. package/lib/interaction/sliderFilter.js.map +1 -1
  229. package/lib/interaction/tooltip.d.ts +1 -1
  230. package/lib/interaction/tooltip.js +4 -2
  231. package/lib/interaction/tooltip.js.map +1 -1
  232. package/lib/mark/boxplot.js +2 -2
  233. package/lib/mark/boxplot.js.map +1 -1
  234. package/lib/runtime/component.d.ts +3 -3
  235. package/lib/runtime/component.js +4 -4
  236. package/lib/runtime/component.js.map +1 -1
  237. package/lib/runtime/plot.js +2 -2
  238. package/lib/runtime/plot.js.map +1 -1
  239. package/lib/runtime/render.d.ts +1 -1
  240. package/lib/runtime/render.js +19 -3
  241. package/lib/runtime/render.js.map +1 -1
  242. package/lib/runtime/types/common.d.ts +12 -9
  243. package/lib/runtime/types/component.d.ts +13 -4
  244. package/lib/shape/area/area.js +1 -1
  245. package/lib/shape/area/area.js.map +1 -1
  246. package/lib/shape/area/curve.js +2 -1
  247. package/lib/shape/area/curve.js.map +1 -1
  248. package/lib/shape/area/hv.js +1 -1
  249. package/lib/shape/area/hv.js.map +1 -1
  250. package/lib/shape/area/hvh.js +1 -1
  251. package/lib/shape/area/hvh.js.map +1 -1
  252. package/lib/shape/area/smooth.js +1 -1
  253. package/lib/shape/area/smooth.js.map +1 -1
  254. package/lib/shape/area/vh.js +1 -1
  255. package/lib/shape/area/vh.js.map +1 -1
  256. package/lib/shape/box/box.js +1 -0
  257. package/lib/shape/box/box.js.map +1 -1
  258. package/lib/shape/connector/connector.d.ts +2 -2
  259. package/lib/shape/connector/connector.js +3 -2
  260. package/lib/shape/connector/connector.js.map +1 -1
  261. package/lib/shape/interval/funnel.js +1 -1
  262. package/lib/shape/interval/funnel.js.map +1 -1
  263. package/lib/shape/interval/hollow.js +1 -1
  264. package/lib/shape/interval/hollow.js.map +1 -1
  265. package/lib/shape/interval/pyramid.js +1 -1
  266. package/lib/shape/interval/pyramid.js.map +1 -1
  267. package/lib/shape/interval/rect.js +1 -1
  268. package/lib/shape/interval/rect.js.map +1 -1
  269. package/lib/shape/label/label.js +3 -1
  270. package/lib/shape/label/label.js.map +1 -1
  271. package/lib/shape/line/curve.js +2 -1
  272. package/lib/shape/line/curve.js.map +1 -1
  273. package/lib/shape/line/hv.js +1 -1
  274. package/lib/shape/line/hv.js.map +1 -1
  275. package/lib/shape/line/hvh.js +1 -1
  276. package/lib/shape/line/hvh.js.map +1 -1
  277. package/lib/shape/line/line.js +1 -1
  278. package/lib/shape/line/line.js.map +1 -1
  279. package/lib/shape/line/smooth.js +1 -1
  280. package/lib/shape/line/smooth.js.map +1 -1
  281. package/lib/shape/line/vh.js +1 -1
  282. package/lib/shape/line/vh.js.map +1 -1
  283. package/lib/shape/lineXY/line.js +1 -0
  284. package/lib/shape/lineXY/line.js.map +1 -1
  285. package/lib/shape/link/arc.js +1 -0
  286. package/lib/shape/link/arc.js.map +1 -1
  287. package/lib/shape/link/link.js +1 -0
  288. package/lib/shape/link/link.js.map +1 -1
  289. package/lib/shape/link/smooth.js +1 -0
  290. package/lib/shape/link/smooth.js.map +1 -1
  291. package/lib/shape/link/vhv.js +1 -0
  292. package/lib/shape/link/vhv.js.map +1 -1
  293. package/lib/shape/path/hollow.js +1 -0
  294. package/lib/shape/path/hollow.js.map +1 -1
  295. package/lib/shape/path/path.js +1 -0
  296. package/lib/shape/path/path.js.map +1 -1
  297. package/lib/shape/point/bowtie.js +1 -1
  298. package/lib/shape/point/bowtie.js.map +1 -1
  299. package/lib/shape/point/color.js +2 -25
  300. package/lib/shape/point/color.js.map +1 -1
  301. package/lib/shape/point/cross.js +1 -1
  302. package/lib/shape/point/cross.js.map +1 -1
  303. package/lib/shape/point/diamond.js +1 -1
  304. package/lib/shape/point/diamond.js.map +1 -1
  305. package/lib/shape/point/hexagon.js +1 -1
  306. package/lib/shape/point/hexagon.js.map +1 -1
  307. package/lib/shape/point/hollow.js +1 -1
  308. package/lib/shape/point/hollow.js.map +1 -1
  309. package/lib/shape/point/hollowBowtie.js +1 -1
  310. package/lib/shape/point/hollowBowtie.js.map +1 -1
  311. package/lib/shape/point/hollowDiamond.js +1 -1
  312. package/lib/shape/point/hollowDiamond.js.map +1 -1
  313. package/lib/shape/point/hollowHexagon.js +1 -1
  314. package/lib/shape/point/hollowHexagon.js.map +1 -1
  315. package/lib/shape/point/hollowSquare.js +1 -1
  316. package/lib/shape/point/hollowSquare.js.map +1 -1
  317. package/lib/shape/point/hollowTriangle.js +1 -1
  318. package/lib/shape/point/hollowTriangle.js.map +1 -1
  319. package/lib/shape/point/hollowTriangleDown.js +1 -1
  320. package/lib/shape/point/hollowTriangleDown.js.map +1 -1
  321. package/lib/shape/point/hyphen.js +1 -1
  322. package/lib/shape/point/hyphen.js.map +1 -1
  323. package/lib/shape/point/line.js +1 -1
  324. package/lib/shape/point/line.js.map +1 -1
  325. package/lib/shape/point/plus.js +1 -1
  326. package/lib/shape/point/plus.js.map +1 -1
  327. package/lib/shape/point/point.js +1 -1
  328. package/lib/shape/point/point.js.map +1 -1
  329. package/lib/shape/point/square.js +1 -1
  330. package/lib/shape/point/square.js.map +1 -1
  331. package/lib/shape/point/tick.js +1 -1
  332. package/lib/shape/point/tick.js.map +1 -1
  333. package/lib/shape/point/triangle.js +1 -1
  334. package/lib/shape/point/triangle.js.map +1 -1
  335. package/lib/shape/point/triangleDown.js +1 -1
  336. package/lib/shape/point/triangleDown.js.map +1 -1
  337. package/lib/shape/polygon/polygon.js +1 -0
  338. package/lib/shape/polygon/polygon.js.map +1 -1
  339. package/lib/shape/polygon/ribbon.js +1 -0
  340. package/lib/shape/polygon/ribbon.js.map +1 -1
  341. package/lib/shape/shape/shape.js +1 -0
  342. package/lib/shape/shape/shape.js.map +1 -1
  343. package/lib/shape/text/badge.js +1 -0
  344. package/lib/shape/text/badge.js.map +1 -1
  345. package/lib/shape/text/text.js +1 -0
  346. package/lib/shape/text/text.js.map +1 -1
  347. package/lib/shape/utils.d.ts +1 -16
  348. package/lib/shape/utils.js +2 -2
  349. package/lib/shape/utils.js.map +1 -1
  350. package/lib/shape/vector/vector.js +1 -0
  351. package/lib/shape/vector/vector.js.map +1 -1
  352. package/lib/spec/component.d.ts +10 -9
  353. package/lib/spec/coordinateTransform.d.ts +1 -1
  354. package/lib/spec/interaction.d.ts +19 -33
  355. package/lib/spec/theme.d.ts +8 -2
  356. package/lib/stdlib/index.js +1 -1
  357. package/lib/stdlib/index.js.map +1 -1
  358. package/lib/theme/academy.js +73 -74
  359. package/lib/theme/academy.js.map +1 -1
  360. package/lib/theme/classic.d.ts +6 -0
  361. package/lib/theme/{light.js → classic.js} +78 -86
  362. package/lib/theme/classic.js.map +1 -0
  363. package/lib/theme/classicDark.d.ts +6 -0
  364. package/lib/theme/{dark.js → classicDark.js} +76 -85
  365. package/lib/theme/classicDark.js.map +1 -0
  366. package/lib/theme/index.d.ts +2 -2
  367. package/lib/theme/index.js +5 -5
  368. package/lib/theme/index.js.map +1 -1
  369. package/lib/transform/maybeTitle.js +5 -1
  370. package/lib/transform/maybeTitle.js.map +1 -1
  371. package/lib/utils/marker.d.ts +10 -0
  372. package/lib/utils/marker.js +256 -0
  373. package/lib/utils/marker.js.map +1 -0
  374. package/package.json +25 -22
  375. package/src/.DS_Store +0 -0
  376. package/src/api/chart.ts +17 -14
  377. package/src/api/composition/base.ts +26 -1
  378. package/src/component/axis.ts +77 -62
  379. package/src/component/axisRadar.ts +4 -3
  380. package/src/component/axisX.ts +0 -1
  381. package/src/component/legendCategory.ts +68 -63
  382. package/src/component/legendContinuous.ts +29 -21
  383. package/src/component/legendContinuousBlockSize.ts +1 -1
  384. package/src/component/legendContinuousSize.ts +1 -1
  385. package/src/component/scrollbar.ts +1 -1
  386. package/src/component/slider.ts +1 -1
  387. package/src/component/title.ts +3 -5
  388. package/src/component/utils.ts +25 -1
  389. package/src/coordinate/fisheye.ts +2 -2
  390. package/src/data/.DS_Store +0 -0
  391. package/src/interaction/brushFilter.ts +2 -2
  392. package/src/interaction/fisheye.ts +1 -1
  393. package/src/interaction/legendFilter.ts +39 -30
  394. package/src/interaction/sliderFilter.ts +2 -2
  395. package/src/interaction/tooltip.ts +5 -3
  396. package/src/mark/boxplot.ts +2 -2
  397. package/src/runtime/component.ts +7 -4
  398. package/src/runtime/plot.ts +2 -0
  399. package/src/runtime/render.ts +22 -2
  400. package/src/runtime/types/common.ts +13 -10
  401. package/src/runtime/types/component.ts +16 -8
  402. package/src/shape/.DS_Store +0 -0
  403. package/src/shape/area/area.ts +1 -0
  404. package/src/shape/area/curve.ts +2 -1
  405. package/src/shape/area/hv.ts +1 -0
  406. package/src/shape/area/hvh.ts +1 -0
  407. package/src/shape/area/smooth.ts +1 -0
  408. package/src/shape/area/vh.ts +1 -0
  409. package/src/shape/box/box.ts +1 -0
  410. package/src/shape/connector/connector.ts +6 -4
  411. package/src/shape/interval/funnel.ts +1 -0
  412. package/src/shape/interval/hollow.ts +1 -0
  413. package/src/shape/interval/pyramid.ts +1 -0
  414. package/src/shape/interval/rect.ts +1 -0
  415. package/src/shape/label/label.ts +3 -1
  416. package/src/shape/line/curve.ts +2 -1
  417. package/src/shape/line/hv.ts +1 -0
  418. package/src/shape/line/hvh.ts +1 -0
  419. package/src/shape/line/line.ts +1 -0
  420. package/src/shape/line/smooth.ts +1 -0
  421. package/src/shape/line/vh.ts +1 -0
  422. package/src/shape/lineXY/line.ts +1 -0
  423. package/src/shape/link/arc.ts +1 -0
  424. package/src/shape/link/link.ts +1 -0
  425. package/src/shape/link/smooth.ts +1 -0
  426. package/src/shape/link/vhv.ts +1 -0
  427. package/src/shape/path/hollow.ts +1 -0
  428. package/src/shape/path/path.ts +1 -0
  429. package/src/shape/point/bowtie.ts +1 -0
  430. package/src/shape/point/color.ts +4 -4
  431. package/src/shape/point/cross.ts +1 -0
  432. package/src/shape/point/diamond.ts +1 -0
  433. package/src/shape/point/hexagon.ts +1 -0
  434. package/src/shape/point/hollow.ts +1 -0
  435. package/src/shape/point/hollowBowtie.ts +1 -0
  436. package/src/shape/point/hollowDiamond.ts +1 -0
  437. package/src/shape/point/hollowHexagon.ts +1 -0
  438. package/src/shape/point/hollowSquare.ts +1 -0
  439. package/src/shape/point/hollowTriangle.ts +1 -0
  440. package/src/shape/point/hollowTriangleDown.ts +1 -0
  441. package/src/shape/point/hyphen.ts +1 -0
  442. package/src/shape/point/line.ts +1 -0
  443. package/src/shape/point/plus.ts +1 -0
  444. package/src/shape/point/point.ts +1 -0
  445. package/src/shape/point/square.ts +1 -0
  446. package/src/shape/point/tick.ts +1 -0
  447. package/src/shape/point/triangle.ts +1 -0
  448. package/src/shape/point/triangleDown.ts +1 -0
  449. package/src/shape/polygon/polygon.ts +1 -0
  450. package/src/shape/polygon/ribbon.ts +1 -0
  451. package/src/shape/shape/shape.ts +1 -0
  452. package/src/shape/text/badge.ts +1 -0
  453. package/src/shape/text/text.ts +1 -0
  454. package/src/shape/utils.ts +4 -22
  455. package/src/shape/vector/vector.ts +1 -0
  456. package/src/spec/component.ts +10 -9
  457. package/src/spec/coordinateTransform.ts +1 -1
  458. package/src/spec/interaction.ts +19 -43
  459. package/src/spec/theme.ts +22 -2
  460. package/src/stdlib/index.ts +3 -3
  461. package/src/theme/academy.ts +73 -74
  462. package/src/theme/{light.ts → classic.ts} +76 -84
  463. package/src/theme/{dark.ts → classicDark.ts} +74 -84
  464. package/src/theme/index.ts +2 -2
  465. package/src/transform/maybeTitle.ts +5 -1
  466. package/src/utils/marker.ts +293 -0
  467. package/esm/shape/point/symbol.d.ts +0 -49
  468. package/esm/shape/point/symbol.js +0 -143
  469. package/esm/shape/point/symbol.js.map +0 -1
  470. package/esm/theme/dark.d.ts +0 -6
  471. package/esm/theme/dark.js.map +0 -1
  472. package/esm/theme/light.d.ts +0 -6
  473. package/esm/theme/light.js.map +0 -1
  474. package/lib/shape/point/symbol.d.ts +0 -49
  475. package/lib/shape/point/symbol.js +0 -158
  476. package/lib/shape/point/symbol.js.map +0 -1
  477. package/lib/theme/dark.d.ts +0 -6
  478. package/lib/theme/dark.js.map +0 -1
  479. package/lib/theme/light.d.ts +0 -6
  480. package/lib/theme/light.js.map +0 -1
  481. package/src/shape/point/symbol.ts +0 -154
@@ -1,6 +1,6 @@
1
1
  import { ThemeComponent as TC, Theme } from '../runtime';
2
2
 
3
- export type LightOptions = Theme;
3
+ export type ClassicOptions = Theme;
4
4
 
5
5
  const COLORS = {
6
6
  BLACK: '#000',
@@ -13,7 +13,7 @@ const BACKGROUND_COLOR = 'transparent';
13
13
  /**
14
14
  * Default theme.
15
15
  */
16
- export const Light: TC<LightOptions> = (options) => {
16
+ export const Classic: TC<ClassicOptions> = (options) => {
17
17
  const DEFAULT_COLOR = '#5B8FF9';
18
18
  const defaultOptions: Theme = {
19
19
  defaultColor: DEFAULT_COLOR,
@@ -220,142 +220,134 @@ export const Light: TC<LightOptions> = (options) => {
220
220
  disabled: {},
221
221
  },
222
222
  axis: {
223
- // axis title
224
- titleFill: COLORS.BLACK,
225
- titleFillOpacity: 0.65,
226
- titleFontSize: 12,
227
- titleFontWeight: 'normal',
228
- titleSpacing: 12,
229
- // axis line
230
- lineStroke: COLORS.BLACK,
231
- lineStrokeOpacity: 0.45,
232
- lineLineWidth: 0.5,
233
- showArrow: false,
234
- // axis tick line
235
- tickStroke: COLORS.BLACK,
236
- tickStrokeOpacity: 0.25,
237
- tickLineWidth: 1,
238
- tickLength: 4,
239
- // axis label
223
+ arrow: false,
224
+ gridLineDash: [0, 0],
225
+ gridLineWidth: 0.5,
226
+ gridStroke: COLORS.BLACK,
227
+ gridStrokeOpacity: 0.05,
228
+ labelAlign: 'horizontal',
240
229
  labelFill: COLORS.BLACK,
241
230
  labelFillOpacity: 0.65,
242
231
  labelFontSize: 12,
243
232
  labelFontWeight: 'lighter',
244
233
  labelSpacing: 8, // spacing between label and it's tick
245
- labelAlign: 'horizontal',
246
- // axis grid
247
- gridStroke: COLORS.BLACK,
248
- gridStrokeOpacity: 0.05,
249
- gridLineWidth: 0.5,
250
- gridLineDash: [0, 0],
234
+ line: false,
235
+ lineLineWidth: 0.5,
236
+ lineStroke: COLORS.BLACK,
237
+ lineStrokeOpacity: 0.45,
238
+ tickLength: 4,
239
+ tickLineWidth: 1,
240
+ tickStroke: COLORS.BLACK,
241
+ tickStrokeOpacity: 0.25,
242
+ titleFill: COLORS.BLACK,
243
+ titleFillOpacity: 0.65,
244
+ titleFontSize: 12,
245
+ titleFontWeight: 'normal',
246
+ titleSpacing: 12,
251
247
  titleTransformOrigin: 'center',
252
248
  },
253
249
  axisTop: {
250
+ gridDirection: 'positive',
251
+ labelDirection: 'negative',
252
+ labelSpacing: 8,
253
+ tickDirection: 'negative',
254
254
  titlePosition: 'top',
255
255
  titleSpacing: 0,
256
256
  titleTextBaseline: 'middle',
257
- labelSpacing: 8,
258
- labelDirection: 'negative',
259
- tickDirection: 'negative',
260
- gridDirection: 'positive',
261
257
  },
262
258
  axisBottom: {
259
+ gridDirection: 'negative',
260
+ labelDirection: 'positive',
261
+ labelSpacing: 12,
262
+ tickDirection: 'positive',
263
263
  titlePosition: 'bottom',
264
264
  titleSpacing: 10,
265
265
  titleTextBaseline: 'bottom',
266
- labelSpacing: 12,
267
- labelDirection: 'positive',
268
- tickDirection: 'positive',
269
- gridDirection: 'negative',
270
266
  },
271
267
  axisLeft: {
272
- titleTextBaseline: 'middle',
273
- titleSpacing: 10,
274
- titlePosition: 'left',
275
- titleTransformOrigin: 'center',
276
- titleTransform: `translate(50%, 0) rotate(-90)`,
277
- labelSpacing: 4,
278
- labelDirection: 'positive',
268
+ gridDirection: 'negative',
279
269
  labelAutoRotate: false,
270
+ labelDirection: 'positive',
271
+ labelSpacing: 4,
280
272
  tickDirection: 'positive',
281
- gridDirection: 'negative',
273
+ titlePosition: 'left',
274
+ titleSpacing: 10,
275
+ titleTextBaseline: 'middle',
276
+ titleTransform: `translate(50%, 0) rotate(-90)`,
277
+ titleTransformOrigin: 'center',
282
278
  },
283
279
  axisRight: {
284
- titleTextBaseline: 'top',
285
- titleSpacing: 0,
286
- titlePosition: 'right',
287
- titleTransformOrigin: 'center',
288
- titleTransform: `translate(-50%, 0) rotate(-90)`,
289
- labelSpacing: 4,
280
+ gridDirection: 'positive',
290
281
  labelDirection: 'negative',
282
+ labelSpacing: 4,
291
283
  tickDirection: 'negative',
292
- gridDirection: 'positive',
284
+ titlePosition: 'right',
285
+ titleSpacing: 0,
286
+ titleTextBaseline: 'top',
287
+ titleTransform: `translate(-50%, 0) rotate(-90)`,
288
+ titleTransformOrigin: 'center',
293
289
  },
294
290
  axisLinear: {
295
- titlePosition: 'top',
296
- titleSpacing: 0,
297
- gridDirection: 'negative',
291
+ girdClosed: true,
298
292
  gridConnect: 'arc',
293
+ gridDirection: 'negative',
299
294
  gridType: 'surround',
300
- girdClosed: true,
295
+ titlePosition: 'top',
296
+ titleSpacing: 0,
301
297
  },
302
298
  axisRadar: {
303
- titlePosition: 'start',
304
- showTick: false,
305
- showLabel: false,
306
- gridType: 'surround',
307
299
  girdClosed: true,
308
300
  gridStrokeOpacity: 0.3,
301
+ gridType: 'surround',
302
+ label: false,
303
+ tick: false,
304
+ titlePosition: 'start',
309
305
  },
310
306
  legend: {
311
- padding: 8,
312
- showTitle: false,
313
- titleFill: COLORS.BLACK,
314
- titleFillOpacity: 0.45,
315
- titleFontSize: 12,
316
- titleFontWeight: 'normal',
317
- titleSpacing: 4,
318
- // legend marker
319
- // itemMarkerFill: DEFAULT_COLOR,
320
- itemMarkerFillOpacity: 1,
321
- itemMarkerSize: 8,
322
- itemSpacing: [5, 8],
307
+ backgroundFill: 'transparent',
308
+ itemBackgroundFill: 'transparent',
323
309
  itemLabelFill: COLORS.BLACK,
324
310
  itemLabelFillOpacity: 0.65,
325
311
  itemLabelFontSize: 12,
326
312
  itemLabelFontWeight: 'normal',
313
+ itemMarkerFillOpacity: 1,
314
+ itemMarkerSize: 8,
315
+ itemSpacing: [5, 8],
327
316
  itemValueFill: COLORS.BLACK,
328
317
  itemValueFillOpacity: 0.65,
329
318
  itemValueFontSize: 12,
330
319
  itemValueFontWeight: 'normal',
331
- itemBackgroundFill: 'transparent',
332
- // [todo] rename legend navigator
333
320
  navButtonFill: COLORS.BLACK,
334
321
  navButtonFillOpacity: 0.65,
335
322
  navPageNumFill: COLORS.BLACK,
336
323
  navPageNumFillOpacity: 0.45,
337
324
  navPageNumFontSize: 12,
338
- // others
339
- backgroundFill: 'transparent',
325
+ padding: 8,
326
+ title: false,
327
+ titleFill: COLORS.BLACK,
328
+ titleFillOpacity: 0.45,
329
+ titleFontSize: 12,
330
+ titleFontWeight: 'normal',
331
+ titleSpacing: 4,
340
332
  },
341
333
  continuousLegend: {
342
- labelFill: COLORS.BLACK,
343
- labelFillOpacity: 0.45,
344
- labelFontSize: 12,
345
- labelFontWeight: 'normal',
346
- handleWidth: 10,
347
334
  handleHeight: 12,
348
- handleMarkerFill: COLORS.BLACK,
349
- handleMarkerFillOpacity: 0.6,
350
- handleMarkerStroke: COLORS.BLACK,
351
- handleMarkerStrokeOpacity: 0.25,
352
- handleMarkerLineWidth: 1,
353
335
  handleLabelFill: COLORS.BLACK,
354
336
  handleLabelFillOpacity: 0.45,
355
337
  handleLabelFontSize: 12,
356
338
  handleLabelFontWeight: 'normal',
357
- showTick: true,
339
+ handleMarkerFill: COLORS.BLACK,
340
+ handleMarkerFillOpacity: 0.6,
341
+ handleMarkerLineWidth: 1,
342
+ handleMarkerStroke: COLORS.BLACK,
343
+ handleMarkerStrokeOpacity: 0.25,
344
+ handleWidth: 10,
345
+ labelFill: COLORS.BLACK,
346
+ labelFillOpacity: 0.45,
347
+ labelFontSize: 12,
348
+ labelFontWeight: 'normal',
358
349
  labelSpacing: 8,
350
+ tick: true,
359
351
  // [todo] legend rail
360
352
  },
361
353
  label: {
@@ -426,4 +418,4 @@ export const Light: TC<LightOptions> = (options) => {
426
418
  return Object.assign({}, defaultOptions, options);
427
419
  };
428
420
 
429
- Light.props = {};
421
+ Classic.props = {};
@@ -1,6 +1,6 @@
1
1
  import { ThemeComponent as TC, Theme } from '../runtime';
2
2
 
3
- export type DarkOptions = Theme;
3
+ export type ClassicDarkOptions = Theme;
4
4
 
5
5
  const COLORS = {
6
6
  BLACK: '#fff',
@@ -13,7 +13,7 @@ const BACKGROUND_COLOR = '#141414';
13
13
  /**
14
14
  * Dark theme.
15
15
  */
16
- export const Dark: TC<DarkOptions> = (options) => {
16
+ export const ClassicDark: TC<ClassicDarkOptions> = (options) => {
17
17
  const DEFAULT_COLOR = '#5B8FF9';
18
18
  const defaultOptions: Theme = {
19
19
  defaultColor: DEFAULT_COLOR,
@@ -220,139 +220,131 @@ export const Dark: TC<DarkOptions> = (options) => {
220
220
  disabled: {},
221
221
  },
222
222
  axis: {
223
- // axis title
224
- titleFill: COLORS.BLACK,
225
- titleFillOpacity: 0.65,
226
- titleFontSize: 12,
227
- titleFontWeight: 'normal',
228
- titleSpacing: 12,
229
- // axis line
230
- lineStroke: COLORS.BLACK,
231
- lineStrokeOpacity: 0.45,
232
- lineLineWidth: 0.5,
233
- showArrow: false,
234
- // axis tick line
235
- tickStroke: COLORS.BLACK,
236
- tickStrokeOpacity: 0.25,
237
- tickLineWidth: 1,
238
- tickLength: 4,
239
- // axis label
223
+ arrow: false,
224
+ gridLineDash: [0, 0],
225
+ gridLineWidth: 0.5,
226
+ gridStroke: COLORS.BLACK,
227
+ gridStrokeOpacity: 0.05,
228
+ labelAlign: 'horizontal',
240
229
  labelFill: COLORS.BLACK,
241
230
  labelFillOpacity: 0.65,
242
231
  labelFontSize: 12,
243
232
  labelFontWeight: 'lighter',
244
233
  labelSpacing: 8, // spacing between label and it's tick
245
- labelAlign: 'horizontal',
246
- // axis grid
247
- gridStroke: COLORS.BLACK,
248
- gridStrokeOpacity: 0.05,
249
- gridLineWidth: 0.5,
250
- gridLineDash: [0, 0],
234
+ lineLineWidth: 0.5,
235
+ lineStroke: COLORS.BLACK,
236
+ lineStrokeOpacity: 0.45,
237
+ tickLength: 4,
238
+ tickLineWidth: 1,
239
+ tickStroke: COLORS.BLACK,
240
+ tickStrokeOpacity: 0.25,
241
+ titleFill: COLORS.BLACK,
242
+ titleFillOpacity: 0.65,
243
+ titleFontSize: 12,
244
+ titleFontWeight: 'normal',
245
+ titleSpacing: 12,
251
246
  titleTransformOrigin: 'center',
252
247
  },
253
248
  axisTop: {
249
+ gridDirection: 'positive',
250
+ labelDirection: 'negative',
251
+ labelSpacing: 8,
252
+ tickDirection: 'negative',
254
253
  titlePosition: 'top',
255
254
  titleSpacing: 0,
256
255
  titleTextBaseline: 'middle',
257
- labelSpacing: 8,
258
- labelDirection: 'negative',
259
- tickDirection: 'negative',
260
- gridDirection: 'positive',
261
256
  },
262
257
  axisBottom: {
258
+ gridDirection: 'negative',
259
+ labelDirection: 'positive',
260
+ labelSpacing: 12,
261
+ tickDirection: 'positive',
263
262
  titlePosition: 'bottom',
264
263
  titleSpacing: 10,
265
264
  titleTextBaseline: 'bottom',
266
- labelSpacing: 12,
267
- labelDirection: 'positive',
268
- tickDirection: 'positive',
269
- gridDirection: 'negative',
270
265
  },
271
266
  axisLeft: {
272
- titleTextBaseline: 'middle',
273
- titleSpacing: 10,
274
- titlePosition: 'left',
275
- titleTransformOrigin: 'center',
276
- titleTransform: `translate(50%, 0) rotate(-90)`,
277
- labelSpacing: 4,
278
- labelDirection: 'positive',
267
+ gridDirection: 'negative',
279
268
  labelAutoRotate: false,
269
+ labelDirection: 'positive',
270
+ labelSpacing: 4,
280
271
  tickDirection: 'positive',
281
- gridDirection: 'negative',
272
+ titlePosition: 'left',
273
+ titleSpacing: 10,
274
+ titleTextBaseline: 'middle',
275
+ titleTransform: `translate(50%, 0) rotate(-90)`,
276
+ titleTransformOrigin: 'center',
282
277
  },
283
278
  axisRight: {
284
- titleTextBaseline: 'top',
285
- titleSpacing: 0,
286
- titlePosition: 'right',
287
- titleTransformOrigin: 'center',
288
- titleTransform: `translate(-50%, 0) rotate(-90)`,
289
- labelSpacing: 4,
279
+ gridDirection: 'positive',
290
280
  labelDirection: 'negative',
281
+ labelSpacing: 4,
291
282
  tickDirection: 'negative',
292
- gridDirection: 'positive',
283
+ titlePosition: 'right',
284
+ titleSpacing: 0,
285
+ titleTextBaseline: 'top',
286
+ titleTransform: `translate(-50%, 0) rotate(-90)`,
287
+ titleTransformOrigin: 'center',
293
288
  },
294
289
  axisLinear: {
295
- titlePosition: 'top',
296
- titleTextBaseline: 'bottom',
297
- gridDirection: 'negative',
290
+ girdClosed: true,
298
291
  gridConnect: 'arc',
292
+ gridDirection: 'negative',
299
293
  gridType: 'surround',
300
- girdClosed: true,
294
+ titlePosition: 'top',
295
+ titleTextBaseline: 'bottom',
301
296
  },
302
297
  axisRadar: {
303
- titlePosition: 'start',
304
- showTick: false,
305
- showLabel: false,
306
- gridType: 'surround',
307
298
  girdClosed: true,
308
299
  gridStrokeOpacity: 0.3,
300
+ gridType: 'surround',
301
+ label: false,
302
+ tick: false,
303
+ titlePosition: 'start',
309
304
  },
310
305
  legend: {
311
- padding: 8,
312
- showTitle: false,
313
- titleFill: COLORS.BLACK,
314
- titleFillOpacity: 0.45,
315
- titleFontSize: 12,
316
- titleFontWeight: 'normal',
317
- titleSpacing: 4,
318
- // legend marker
319
- // itemMarkerFill: DEFAULT_COLOR,
320
- itemMarkerFillOpacity: 1,
321
- itemMarkerSize: 8,
322
- itemSpacing: [5, 8],
306
+ backgroundFill: 'transparent',
307
+ itemBackgroundFill: 'transparent',
323
308
  itemLabelFill: COLORS.BLACK,
324
309
  itemLabelFillOpacity: 0.65,
325
310
  itemLabelFontSize: 12,
326
311
  itemLabelFontWeight: 'normal',
312
+ itemMarkerFillOpacity: 1,
313
+ itemMarkerSize: 8,
314
+ itemSpacing: [5, 8],
327
315
  itemValueFill: COLORS.BLACK,
328
316
  itemValueFillOpacity: 0.65,
329
317
  itemValueFontSize: 12,
330
318
  itemValueFontWeight: 'normal',
331
- itemBackgroundFill: 'transparent',
332
319
  navButtonFill: COLORS.BLACK,
333
320
  navButtonFillOpacity: 0.45,
334
321
  navPageNumFill: COLORS.BLACK,
335
322
  navPageNumFillOpacity: 0.45,
336
323
  navPageNumFontSize: 12,
337
- // others
338
- backgroundFill: 'transparent',
324
+ padding: 8,
325
+ title: false,
326
+ titleFill: COLORS.BLACK,
327
+ titleFillOpacity: 0.45,
328
+ titleFontSize: 12,
329
+ titleFontWeight: 'normal',
330
+ titleSpacing: 4,
339
331
  },
340
332
  continuousLegend: {
341
- labelFill: COLORS.BLACK,
342
- labelFillOpacity: 0.45,
343
- labelFontSize: 12,
344
- labelFontWeight: 'normal',
345
- handleWidth: 10,
346
333
  handleHeight: 12,
347
- handleMarkerFill: COLORS.BLACK,
348
- handleMarkerFillOpacity: 0.6,
349
- handleMarkerStroke: COLORS.BLACK,
350
- handleMarkerStrokeOpacity: 0.25,
351
- handleMarkerLineWidth: 1,
352
334
  handleLabelFill: COLORS.BLACK,
353
335
  handleLabelFillOpacity: 0.45,
354
336
  handleLabelFontSize: 12,
355
337
  handleLabelFontWeight: 'normal',
338
+ handleMarkerFill: COLORS.BLACK,
339
+ handleMarkerFillOpacity: 0.6,
340
+ handleMarkerLineWidth: 1,
341
+ handleMarkerStroke: COLORS.BLACK,
342
+ handleMarkerStrokeOpacity: 0.25,
343
+ handleWidth: 10,
344
+ labelFill: COLORS.BLACK,
345
+ labelFillOpacity: 0.45,
346
+ labelFontSize: 12,
347
+ labelFontWeight: 'normal',
356
348
  // [todo] legend rail
357
349
  },
358
350
  label: {
@@ -412,6 +404,4 @@ export const Dark: TC<DarkOptions> = (options) => {
412
404
  return Object.assign({}, defaultOptions, options);
413
405
  };
414
406
 
415
- Dark.props = {};
416
-
417
- Dark.props = {};
407
+ ClassicDark.props = {};
@@ -1,3 +1,3 @@
1
- export { Light } from './light';
2
- export { Dark } from './dark';
1
+ export { Classic } from './classic';
2
+ export { ClassicDark } from './classicDark';
3
3
  export { Academy } from './academy';
@@ -25,11 +25,15 @@ export const MaybeTitle: TC<MaybeTitleOptions> = (options = {}) => {
25
25
  .filter(([T]) => T)
26
26
  .map((d) => d[0]);
27
27
  if (titles.length === 0) return [I, mark];
28
+ const T = [];
29
+ for (const i of I) {
30
+ T[i] = { value: titles.map((t) => t[i]).join(', ') };
31
+ }
28
32
  return [
29
33
  I,
30
34
  deepMix({}, mark, {
31
35
  tooltip: {
32
- title: I.map((i) => ({ value: titles.map((t) => t[i]).join(', ') })),
36
+ title: T,
33
37
  },
34
38
  }),
35
39
  ];