@visactor/vtable 0.9.2 → 0.9.3-alpha.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 (664) hide show
  1. package/README.md +15 -15
  2. package/cjs/ListTable.d.ts +2 -1
  3. package/cjs/ListTable.js +17 -13
  4. package/cjs/ListTable.js.map +1 -1
  5. package/cjs/PivotChart.d.ts +69 -0
  6. package/cjs/PivotChart.js +445 -0
  7. package/cjs/PivotChart.js.map +1 -0
  8. package/cjs/PivotTable.d.ts +2 -1
  9. package/cjs/PivotTable.js +18 -13
  10. package/cjs/PivotTable.js.map +1 -1
  11. package/cjs/body-helper/style/MultilineTextStyle.js +2 -2
  12. package/cjs/body-helper/style/MultilineTextStyle.js.map +1 -1
  13. package/cjs/body-helper/style/ProgressBarStyle.js +15 -15
  14. package/cjs/body-helper/style/ProgressBarStyle.js.map +1 -1
  15. package/cjs/body-helper/style/Style.d.ts +0 -1
  16. package/cjs/body-helper/style/Style.js +25 -28
  17. package/cjs/body-helper/style/Style.js.map +1 -1
  18. package/cjs/chartModule.js +14 -0
  19. package/cjs/chartModule.js.map +1 -0
  20. package/cjs/components/axis/axis.d.ts +45 -0
  21. package/cjs/components/axis/axis.js +146 -0
  22. package/cjs/components/axis/axis.js.map +1 -0
  23. package/cjs/components/axis/band-scale.d.ts +18 -0
  24. package/cjs/components/axis/band-scale.js +54 -0
  25. package/cjs/components/axis/band-scale.js.map +1 -0
  26. package/cjs/components/axis/get-axis-attributes.d.ts +136 -0
  27. package/cjs/components/axis/get-axis-attributes.js +169 -0
  28. package/cjs/components/axis/get-axis-attributes.js.map +1 -0
  29. package/cjs/components/axis/label-overlap.d.ts +3 -0
  30. package/cjs/components/axis/label-overlap.js +46 -0
  31. package/cjs/components/axis/label-overlap.js.map +1 -0
  32. package/cjs/components/axis/linear-scale.d.ts +45 -0
  33. package/cjs/components/axis/linear-scale.js +120 -0
  34. package/cjs/components/axis/linear-scale.js.map +1 -0
  35. package/cjs/components/legend/get-legend-attributes.d.ts +5 -0
  36. package/cjs/components/legend/get-legend-attributes.js +90 -0
  37. package/cjs/components/legend/get-legend-attributes.js.map +1 -0
  38. package/cjs/components/legend/legend.d.ts +23 -0
  39. package/cjs/components/legend/legend.js +94 -0
  40. package/cjs/components/legend/legend.js.map +1 -0
  41. package/{es → cjs/components}/menu/dom/BaseMenu.d.ts +2 -2
  42. package/cjs/components/menu/dom/BaseMenu.js.map +1 -0
  43. package/cjs/components/menu/dom/Menu.js.map +1 -0
  44. package/cjs/{menu → components/menu}/dom/MenuHandler.d.ts +2 -2
  45. package/cjs/{menu → components/menu}/dom/MenuHandler.js +1 -1
  46. package/cjs/components/menu/dom/MenuHandler.js.map +1 -0
  47. package/cjs/{menu → components/menu}/dom/logic/MenuContainer.d.ts +2 -2
  48. package/cjs/{menu → components/menu}/dom/logic/MenuContainer.js +2 -2
  49. package/cjs/components/menu/dom/logic/MenuContainer.js.map +1 -0
  50. package/cjs/{menu → components/menu}/dom/logic/MenuElement.d.ts +2 -2
  51. package/cjs/{menu → components/menu}/dom/logic/MenuElement.js +4 -4
  52. package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -0
  53. package/cjs/components/menu/dom/logic/MenuElementStyle.js.map +1 -0
  54. package/cjs/components/title/title.d.ts +12 -0
  55. package/cjs/components/title/title.js +66 -0
  56. package/cjs/components/title/title.js.map +1 -0
  57. package/{es → cjs/components}/tooltip/BaseTooltip.d.ts +3 -3
  58. package/cjs/components/tooltip/BaseTooltip.js.map +1 -0
  59. package/cjs/components/tooltip/Tooltip.js.map +1 -0
  60. package/cjs/{tooltip → components/tooltip}/TooltipHandler.d.ts +4 -4
  61. package/cjs/{tooltip → components/tooltip}/TooltipHandler.js +1 -1
  62. package/cjs/components/tooltip/TooltipHandler.js.map +1 -0
  63. package/{es → cjs/components}/tooltip/logic/BubbleTooltipElement.d.ts +4 -4
  64. package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElement.js +1 -1
  65. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -0
  66. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -0
  67. package/cjs/components/util/orient.d.ts +3 -0
  68. package/cjs/components/util/orient.js +14 -0
  69. package/cjs/components/util/orient.js.map +1 -0
  70. package/cjs/components/util/register.d.ts +3 -0
  71. package/cjs/components/util/register.js +15 -0
  72. package/cjs/components/util/register.js.map +1 -0
  73. package/cjs/components/util/tick-data/config.d.ts +1 -0
  74. package/cjs/components/util/tick-data/config.js +6 -0
  75. package/cjs/components/util/tick-data/config.js.map +1 -0
  76. package/cjs/components/util/tick-data/continuous.d.ts +2 -0
  77. package/cjs/components/util/tick-data/continuous.js +39 -0
  78. package/cjs/components/util/tick-data/continuous.js.map +1 -0
  79. package/cjs/components/util/tick-data/discrete/linear.d.ts +2 -0
  80. package/cjs/components/util/tick-data/discrete/linear.js +66 -0
  81. package/cjs/components/util/tick-data/discrete/linear.js.map +1 -0
  82. package/cjs/components/util/tick-data/discrete/polar-angle.d.ts +2 -0
  83. package/cjs/components/util/tick-data/discrete/polar-angle.js +46 -0
  84. package/cjs/components/util/tick-data/discrete/polar-angle.js.map +1 -0
  85. package/cjs/components/util/tick-data/index.d.ts +2 -0
  86. package/cjs/components/util/tick-data/index.js +17 -0
  87. package/cjs/components/util/tick-data/index.js.map +1 -0
  88. package/cjs/components/util/tick-data/util.d.ts +21 -0
  89. package/cjs/components/util/tick-data/util.js +115 -0
  90. package/cjs/components/util/tick-data/util.js.map +1 -0
  91. package/cjs/components/util/transform.d.ts +5 -0
  92. package/cjs/components/util/transform.js +45 -0
  93. package/cjs/components/util/transform.js.map +1 -0
  94. package/cjs/core/BaseTable.d.ts +18 -5
  95. package/cjs/core/BaseTable.js +115 -41
  96. package/cjs/core/BaseTable.js.map +1 -1
  97. package/cjs/core/TABLE_EVENT_TYPE.d.ts +5 -0
  98. package/cjs/core/TABLE_EVENT_TYPE.js +6 -1
  99. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  100. package/cjs/core/style.js +1 -1
  101. package/cjs/core/style.js.map +1 -1
  102. package/cjs/core/tableHelper.js +1 -2
  103. package/cjs/data/CachedDataSource.js +2 -1
  104. package/cjs/data/DataSource.js +2 -2
  105. package/cjs/data/DataSource.js.map +1 -1
  106. package/cjs/dataset/dataset-pivot-table.d.ts +60 -0
  107. package/cjs/dataset/dataset-pivot-table.js +387 -0
  108. package/cjs/dataset/dataset-pivot-table.js.map +1 -0
  109. package/cjs/dataset/dataset.d.ts +15 -19
  110. package/cjs/dataset/dataset.js +191 -200
  111. package/cjs/dataset/dataset.js.map +1 -1
  112. package/cjs/dataset/statistics-helper.d.ts +67 -0
  113. package/cjs/dataset/statistics-helper.js +173 -0
  114. package/cjs/dataset/statistics-helper.js.map +1 -0
  115. package/cjs/dataset/util/zero-align.d.ts +10 -0
  116. package/cjs/dataset/util/zero-align.js +119 -0
  117. package/cjs/dataset/util/zero-align.js.map +1 -0
  118. package/cjs/event/EventHandler.js.map +1 -1
  119. package/cjs/event/EventTarget.d.ts +5 -5
  120. package/cjs/event/EventTarget.js +2 -2
  121. package/cjs/event/EventTarget.js.map +1 -1
  122. package/cjs/event/VChartEventProxy.d.ts +1 -0
  123. package/cjs/event/VChartEventProxy.js +1 -0
  124. package/cjs/event/VChartEventProxy.js.map +1 -0
  125. package/cjs/event/event.js +7 -4
  126. package/cjs/event/event.js.map +1 -1
  127. package/cjs/event/listener/table-group.js +8 -6
  128. package/cjs/event/listener/table-group.js.map +1 -1
  129. package/cjs/event/pivot-chart/axis-click.d.ts +2 -0
  130. package/cjs/event/pivot-chart/axis-click.js +42 -0
  131. package/cjs/event/pivot-chart/axis-click.js.map +1 -0
  132. package/cjs/event/pivot-chart/axis-hover.d.ts +2 -0
  133. package/cjs/event/pivot-chart/axis-hover.js +41 -0
  134. package/cjs/event/pivot-chart/axis-hover.js.map +1 -0
  135. package/cjs/event/scroll.js +4 -3
  136. package/cjs/event/scroll.js.map +1 -1
  137. package/cjs/event/sparkline-event.js +1 -2
  138. package/cjs/event/sparkline-event.js.map +1 -1
  139. package/cjs/header-helper/header-helper.js +1 -1
  140. package/cjs/header-helper/header-helper.js.map +1 -1
  141. package/cjs/header-helper/style/MultilineTextHeaderStyle.js +2 -2
  142. package/cjs/header-helper/style/MultilineTextHeaderStyle.js.map +1 -1
  143. package/cjs/header-helper/style/Style.d.ts +0 -1
  144. package/cjs/header-helper/style/Style.js +25 -28
  145. package/cjs/header-helper/style/Style.js.map +1 -1
  146. package/cjs/index.d.ts +4 -3
  147. package/cjs/index.js +11 -2
  148. package/cjs/index.js.map +1 -1
  149. package/cjs/layout/chart-helper/get-axis-config.d.ts +2 -0
  150. package/cjs/layout/chart-helper/get-axis-config.js +128 -0
  151. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -0
  152. package/cjs/layout/chart-helper/get-chart-spec.d.ts +7 -0
  153. package/cjs/layout/chart-helper/get-chart-spec.js +141 -0
  154. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -0
  155. package/cjs/layout/index.js +2 -1
  156. package/cjs/layout/pivot-header-layout.d.ts +13 -5
  157. package/cjs/layout/pivot-header-layout.js +50 -14
  158. package/cjs/layout/pivot-header-layout.js.map +1 -1
  159. package/cjs/layout/pivot-layout.d.ts +55 -8
  160. package/cjs/layout/pivot-layout.js +406 -92
  161. package/cjs/layout/pivot-layout.js.map +1 -1
  162. package/cjs/layout/simple-header-layout.d.ts +10 -0
  163. package/cjs/layout/simple-header-layout.js +43 -2
  164. package/cjs/layout/simple-header-layout.js.map +1 -1
  165. package/cjs/plugins/{chartTypes.js → chartModules.js} +1 -1
  166. package/cjs/plugins/chartModules.js.map +1 -0
  167. package/cjs/register.d.ts +1 -1
  168. package/cjs/register.js +6 -6
  169. package/cjs/register.js.map +1 -1
  170. package/cjs/render/layout/text.d.ts +33 -4
  171. package/cjs/render/layout/text.js +9 -3
  172. package/cjs/render/layout/text.js.map +1 -1
  173. package/cjs/scenegraph/component/custom.js +17 -16
  174. package/cjs/scenegraph/component/custom.js.map +1 -1
  175. package/cjs/scenegraph/component/menu.d.ts +41 -0
  176. package/cjs/scenegraph/component/table-component.js +3 -3
  177. package/cjs/scenegraph/component/table-component.js.map +1 -1
  178. package/cjs/scenegraph/graphic/chart.d.ts +4 -1
  179. package/cjs/scenegraph/graphic/chart.js +29 -17
  180. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  181. package/cjs/scenegraph/graphic/contributions/chart-render.js +22 -3
  182. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  183. package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +9 -9
  184. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +48 -29
  185. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  186. package/cjs/scenegraph/graphic/contributions/image-contribution-render.d.ts +3 -3
  187. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js +2 -2
  188. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  189. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +3 -3
  190. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +2 -2
  191. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  192. package/cjs/scenegraph/graphic/text.d.ts +15 -0
  193. package/cjs/scenegraph/group-creater/cell-helper.js +9 -3
  194. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  195. package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
  196. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +6 -5
  197. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  198. package/cjs/scenegraph/group-creater/column-helper.js +1 -1
  199. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  200. package/cjs/scenegraph/group-creater/column.js.map +1 -1
  201. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.d.ts +3 -0
  202. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +71 -0
  203. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -0
  204. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +2 -2
  205. package/cjs/scenegraph/group-creater/progress/proxy.js +45 -55
  206. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  207. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +1 -0
  208. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +60 -26
  209. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  210. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +1 -0
  211. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +94 -40
  212. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  213. package/cjs/scenegraph/layout/compute-col-width.js +23 -15
  214. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  215. package/cjs/scenegraph/layout/compute-row-height.js +20 -9
  216. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  217. package/cjs/scenegraph/layout/move-cell.js +1 -1
  218. package/cjs/scenegraph/layout/move-cell.js.map +1 -1
  219. package/cjs/scenegraph/layout/update-cell.js +3 -2
  220. package/cjs/scenegraph/layout/update-cell.js.map +1 -1
  221. package/cjs/scenegraph/layout/update-height.js +1 -1
  222. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  223. package/cjs/scenegraph/layout/update-row.js +1 -1
  224. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  225. package/cjs/scenegraph/layout/update-width.js +34 -3
  226. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  227. package/cjs/scenegraph/refresh-node/update-chart.d.ts +3 -0
  228. package/cjs/scenegraph/refresh-node/update-chart.js +76 -7
  229. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  230. package/cjs/scenegraph/scenegraph.d.ts +8 -0
  231. package/cjs/scenegraph/scenegraph.js +118 -21
  232. package/cjs/scenegraph/scenegraph.js.map +1 -1
  233. package/cjs/scenegraph/stick-text/index.js +10 -8
  234. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  235. package/cjs/scenegraph/style/corner-cell.d.ts +3 -0
  236. package/cjs/scenegraph/style/corner-cell.js +29 -0
  237. package/cjs/scenegraph/style/corner-cell.js.map +1 -0
  238. package/cjs/scenegraph/style/frame-border.d.ts +1 -0
  239. package/cjs/scenegraph/style/frame-border.js +3 -7
  240. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  241. package/cjs/scenegraph/utils/get-cell-merge.js +2 -1
  242. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  243. package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
  244. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  245. package/cjs/state/state.js +1 -1
  246. package/cjs/state/state.js.map +1 -1
  247. package/cjs/themes/DARK.js +1 -2
  248. package/cjs/themes/theme.d.ts +10 -0
  249. package/cjs/themes/theme.js +50 -4
  250. package/cjs/themes/theme.js.map +1 -1
  251. package/cjs/tools/LimitPromiseQueue.js +2 -1
  252. package/cjs/tools/calc.d.ts +3 -0
  253. package/cjs/tools/calc.js +11 -3
  254. package/cjs/tools/calc.js.map +1 -1
  255. package/cjs/tools/debounce.js +1 -1
  256. package/cjs/tools/diff-cell.js +2 -2
  257. package/cjs/tools/dom.js +1 -1
  258. package/cjs/tools/env.js +1 -1
  259. package/cjs/ts-types/base-table.d.ts +29 -12
  260. package/cjs/ts-types/base-table.js.map +1 -1
  261. package/cjs/ts-types/column/style.d.ts +0 -1
  262. package/cjs/ts-types/column/style.js.map +1 -1
  263. package/cjs/ts-types/component/axis.d.ts +12 -0
  264. package/cjs/ts-types/component/axis.js +6 -0
  265. package/cjs/ts-types/component/axis.js.map +1 -0
  266. package/cjs/ts-types/component/legend.d.ts +5 -0
  267. package/cjs/ts-types/component/legend.js +6 -0
  268. package/cjs/ts-types/component/legend.js.map +1 -0
  269. package/cjs/ts-types/component/title.d.ts +47 -0
  270. package/cjs/ts-types/component/title.js +6 -0
  271. package/cjs/ts-types/component/title.js.map +1 -0
  272. package/cjs/ts-types/component/util.d.ts +1 -0
  273. package/cjs/ts-types/component/util.js +6 -0
  274. package/cjs/ts-types/component/util.js.map +1 -0
  275. package/cjs/ts-types/customElement.d.ts +2 -0
  276. package/cjs/ts-types/customElement.js.map +1 -1
  277. package/cjs/ts-types/events.d.ts +108 -83
  278. package/cjs/ts-types/events.js.map +1 -1
  279. package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
  280. package/cjs/ts-types/list-table/define/chart-define.d.ts +1 -1
  281. package/cjs/ts-types/list-table/define/chart-define.js.map +1 -1
  282. package/cjs/ts-types/list-table/layout-map/api.d.ts +4 -2
  283. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  284. package/cjs/ts-types/new-data-set.d.ts +21 -7
  285. package/cjs/ts-types/new-data-set.js +2 -2
  286. package/cjs/ts-types/new-data-set.js.map +1 -1
  287. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +4 -0
  288. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +3 -1
  289. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -1
  290. package/cjs/ts-types/pivot-table/corner.d.ts +3 -3
  291. package/cjs/ts-types/pivot-table/corner.js.map +1 -1
  292. package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  293. package/cjs/ts-types/pivot-table/indicator/chart-indicator.d.ts +1 -1
  294. package/cjs/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -1
  295. package/cjs/ts-types/pivot-table/indicator/index.d.ts +1 -0
  296. package/cjs/ts-types/pivot-table/indicator/index.js.map +1 -1
  297. package/cjs/ts-types/pivot-table/title.d.ts +1 -1
  298. package/cjs/ts-types/pivot-table/title.js.map +1 -1
  299. package/cjs/ts-types/table-engine.d.ts +27 -3
  300. package/cjs/ts-types/table-engine.js.map +1 -1
  301. package/cjs/ts-types/theme.d.ts +5 -0
  302. package/cjs/ts-types/theme.js.map +1 -1
  303. package/dist/vtable.js +37485 -24091
  304. package/dist/vtable.min.js +4 -2
  305. package/es/ListTable.d.ts +2 -1
  306. package/es/ListTable.js +17 -13
  307. package/es/ListTable.js.map +1 -1
  308. package/es/PivotChart.d.ts +69 -0
  309. package/es/PivotChart.js +455 -0
  310. package/es/PivotChart.js.map +1 -0
  311. package/es/PivotTable.d.ts +2 -1
  312. package/es/PivotTable.js +19 -14
  313. package/es/PivotTable.js.map +1 -1
  314. package/es/body-helper/style/MultilineTextStyle.js +2 -2
  315. package/es/body-helper/style/MultilineTextStyle.js.map +1 -1
  316. package/es/body-helper/style/ProgressBarStyle.js +15 -15
  317. package/es/body-helper/style/ProgressBarStyle.js.map +1 -1
  318. package/es/body-helper/style/Style.d.ts +0 -1
  319. package/es/body-helper/style/Style.js +25 -28
  320. package/es/body-helper/style/Style.js.map +1 -1
  321. package/es/{chartType.js → chartModule.js} +2 -2
  322. package/es/chartModule.js.map +1 -0
  323. package/es/components/axis/axis.d.ts +45 -0
  324. package/es/components/axis/axis.js +155 -0
  325. package/es/components/axis/axis.js.map +1 -0
  326. package/es/components/axis/band-scale.d.ts +18 -0
  327. package/es/components/axis/band-scale.js +46 -0
  328. package/es/components/axis/band-scale.js.map +1 -0
  329. package/es/components/axis/get-axis-attributes.d.ts +136 -0
  330. package/es/components/axis/get-axis-attributes.js +166 -0
  331. package/es/components/axis/get-axis-attributes.js.map +1 -0
  332. package/es/components/axis/label-overlap.d.ts +3 -0
  333. package/es/components/axis/label-overlap.js +39 -0
  334. package/es/components/axis/label-overlap.js.map +1 -0
  335. package/es/components/axis/linear-scale.d.ts +45 -0
  336. package/es/components/axis/linear-scale.js +104 -0
  337. package/es/components/axis/linear-scale.js.map +1 -0
  338. package/es/components/legend/get-legend-attributes.d.ts +5 -0
  339. package/es/components/legend/get-legend-attributes.js +84 -0
  340. package/es/components/legend/get-legend-attributes.js.map +1 -0
  341. package/es/components/legend/legend.d.ts +23 -0
  342. package/es/components/legend/legend.js +93 -0
  343. package/es/components/legend/legend.js.map +1 -0
  344. package/{cjs → es/components}/menu/dom/BaseMenu.d.ts +2 -2
  345. package/es/components/menu/dom/BaseMenu.js.map +1 -0
  346. package/es/components/menu/dom/Menu.js.map +1 -0
  347. package/es/{menu → components/menu}/dom/MenuHandler.d.ts +2 -2
  348. package/es/{menu → components/menu}/dom/MenuHandler.js +2 -2
  349. package/es/components/menu/dom/MenuHandler.js.map +1 -0
  350. package/es/{menu → components/menu}/dom/logic/MenuContainer.d.ts +2 -2
  351. package/es/{menu → components/menu}/dom/logic/MenuContainer.js +4 -4
  352. package/es/components/menu/dom/logic/MenuContainer.js.map +1 -0
  353. package/es/{menu → components/menu}/dom/logic/MenuElement.d.ts +2 -2
  354. package/es/{menu → components/menu}/dom/logic/MenuElement.js +9 -9
  355. package/es/components/menu/dom/logic/MenuElement.js.map +1 -0
  356. package/es/components/menu/dom/logic/MenuElementStyle.js.map +1 -0
  357. package/es/components/title/title.d.ts +12 -0
  358. package/es/components/title/title.js +61 -0
  359. package/es/components/title/title.js.map +1 -0
  360. package/{cjs → es/components}/tooltip/BaseTooltip.d.ts +3 -3
  361. package/es/components/tooltip/BaseTooltip.js.map +1 -0
  362. package/es/components/tooltip/Tooltip.js.map +1 -0
  363. package/es/{tooltip → components/tooltip}/TooltipHandler.d.ts +4 -4
  364. package/es/{tooltip → components/tooltip}/TooltipHandler.js +4 -4
  365. package/es/components/tooltip/TooltipHandler.js.map +1 -0
  366. package/{cjs → es/components}/tooltip/logic/BubbleTooltipElement.d.ts +4 -4
  367. package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElement.js +4 -4
  368. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -0
  369. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -0
  370. package/es/components/util/orient.d.ts +3 -0
  371. package/es/components/util/orient.js +8 -0
  372. package/es/components/util/orient.js.map +1 -0
  373. package/es/components/util/register.d.ts +3 -0
  374. package/es/components/util/register.js +8 -0
  375. package/es/components/util/register.js.map +1 -0
  376. package/es/components/util/tick-data/config.d.ts +1 -0
  377. package/es/components/util/tick-data/config.js +2 -0
  378. package/es/components/util/tick-data/config.js.map +1 -0
  379. package/es/components/util/tick-data/continuous.d.ts +2 -0
  380. package/es/components/util/tick-data/continuous.js +38 -0
  381. package/es/components/util/tick-data/continuous.js.map +1 -0
  382. package/es/components/util/tick-data/discrete/linear.d.ts +2 -0
  383. package/es/components/util/tick-data/discrete/linear.js +59 -0
  384. package/es/components/util/tick-data/discrete/linear.js.map +1 -0
  385. package/es/components/util/tick-data/discrete/polar-angle.d.ts +2 -0
  386. package/es/components/util/tick-data/discrete/polar-angle.js +39 -0
  387. package/es/components/util/tick-data/discrete/polar-angle.js.map +1 -0
  388. package/es/components/util/tick-data/index.d.ts +2 -0
  389. package/es/components/util/tick-data/index.js +19 -0
  390. package/es/components/util/tick-data/index.js.map +1 -0
  391. package/es/components/util/tick-data/util.d.ts +21 -0
  392. package/es/components/util/tick-data/util.js +104 -0
  393. package/es/components/util/tick-data/util.js.map +1 -0
  394. package/es/components/util/transform.d.ts +5 -0
  395. package/es/components/util/transform.js +34 -0
  396. package/es/components/util/transform.js.map +1 -0
  397. package/es/core/BaseTable.d.ts +18 -5
  398. package/es/core/BaseTable.js +119 -43
  399. package/es/core/BaseTable.js.map +1 -1
  400. package/es/core/TABLE_EVENT_TYPE.d.ts +5 -0
  401. package/es/core/TABLE_EVENT_TYPE.js +6 -1
  402. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  403. package/es/core/style.js +1 -1
  404. package/es/core/style.js.map +1 -1
  405. package/es/core/tableHelper.js +1 -2
  406. package/es/data/CachedDataSource.js +2 -1
  407. package/es/data/DataSource.js +2 -2
  408. package/es/data/DataSource.js.map +1 -1
  409. package/es/dataset/dataset-pivot-table.d.ts +60 -0
  410. package/es/dataset/dataset-pivot-table.js +378 -0
  411. package/es/dataset/dataset-pivot-table.js.map +1 -0
  412. package/es/dataset/dataset.d.ts +15 -19
  413. package/es/dataset/dataset.js +183 -190
  414. package/es/dataset/dataset.js.map +1 -1
  415. package/es/dataset/statistics-helper.d.ts +67 -0
  416. package/es/dataset/statistics-helper.js +152 -0
  417. package/es/dataset/statistics-helper.js.map +1 -0
  418. package/es/dataset/util/zero-align.d.ts +10 -0
  419. package/es/dataset/util/zero-align.js +111 -0
  420. package/es/dataset/util/zero-align.js.map +1 -0
  421. package/es/event/EventHandler.js.map +1 -1
  422. package/es/event/EventTarget.d.ts +5 -5
  423. package/es/event/EventTarget.js +2 -2
  424. package/es/event/EventTarget.js.map +1 -1
  425. package/es/event/VChartEventProxy.d.ts +1 -0
  426. package/es/event/VChartEventProxy.js +1 -0
  427. package/es/event/VChartEventProxy.js.map +1 -0
  428. package/es/event/event.js +10 -3
  429. package/es/event/event.js.map +1 -1
  430. package/es/event/listener/table-group.js +8 -6
  431. package/es/event/listener/table-group.js.map +1 -1
  432. package/es/event/pivot-chart/axis-click.d.ts +2 -0
  433. package/es/event/pivot-chart/axis-click.js +36 -0
  434. package/es/event/pivot-chart/axis-click.js.map +1 -0
  435. package/es/event/pivot-chart/axis-hover.d.ts +2 -0
  436. package/es/event/pivot-chart/axis-hover.js +33 -0
  437. package/es/event/pivot-chart/axis-hover.js.map +1 -0
  438. package/es/event/scroll.js +4 -3
  439. package/es/event/scroll.js.map +1 -1
  440. package/es/event/sparkline-event.js +1 -2
  441. package/es/event/sparkline-event.js.map +1 -1
  442. package/es/header-helper/header-helper.js +1 -1
  443. package/es/header-helper/header-helper.js.map +1 -1
  444. package/es/header-helper/style/MultilineTextHeaderStyle.js +2 -2
  445. package/es/header-helper/style/MultilineTextHeaderStyle.js.map +1 -1
  446. package/es/header-helper/style/Style.d.ts +0 -1
  447. package/es/header-helper/style/Style.js +25 -28
  448. package/es/header-helper/style/Style.js.map +1 -1
  449. package/es/index.d.ts +4 -3
  450. package/es/index.js +4 -2
  451. package/es/index.js.map +1 -1
  452. package/es/layout/chart-helper/get-axis-config.d.ts +2 -0
  453. package/es/layout/chart-helper/get-axis-config.js +120 -0
  454. package/es/layout/chart-helper/get-axis-config.js.map +1 -0
  455. package/es/layout/chart-helper/get-chart-spec.d.ts +7 -0
  456. package/es/layout/chart-helper/get-chart-spec.js +132 -0
  457. package/es/layout/chart-helper/get-chart-spec.js.map +1 -0
  458. package/es/layout/index.js +2 -1
  459. package/es/layout/pivot-header-layout.d.ts +13 -5
  460. package/es/layout/pivot-header-layout.js +50 -12
  461. package/es/layout/pivot-header-layout.js.map +1 -1
  462. package/es/layout/pivot-layout.d.ts +55 -8
  463. package/es/layout/pivot-layout.js +409 -90
  464. package/es/layout/pivot-layout.js.map +1 -1
  465. package/es/layout/simple-header-layout.d.ts +10 -0
  466. package/es/layout/simple-header-layout.js +44 -1
  467. package/es/layout/simple-header-layout.js.map +1 -1
  468. package/es/plugins/chartModules.js +2 -0
  469. package/es/plugins/chartModules.js.map +1 -0
  470. package/es/register.d.ts +1 -1
  471. package/es/register.js +3 -3
  472. package/es/register.js.map +1 -1
  473. package/es/render/layout/text.d.ts +33 -4
  474. package/es/render/layout/text.js +9 -3
  475. package/es/render/layout/text.js.map +1 -1
  476. package/es/scenegraph/component/custom.js +17 -16
  477. package/es/scenegraph/component/custom.js.map +1 -1
  478. package/es/scenegraph/component/menu.d.ts +41 -0
  479. package/es/scenegraph/component/table-component.js +3 -3
  480. package/es/scenegraph/component/table-component.js.map +1 -1
  481. package/es/scenegraph/graphic/chart.d.ts +4 -1
  482. package/es/scenegraph/graphic/chart.js +29 -15
  483. package/es/scenegraph/graphic/chart.js.map +1 -1
  484. package/es/scenegraph/graphic/contributions/chart-render.js +22 -3
  485. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  486. package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +9 -9
  487. package/es/scenegraph/graphic/contributions/group-contribution-render.js +48 -29
  488. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  489. package/es/scenegraph/graphic/contributions/image-contribution-render.d.ts +3 -3
  490. package/es/scenegraph/graphic/contributions/image-contribution-render.js +2 -2
  491. package/es/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  492. package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +3 -3
  493. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +2 -2
  494. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  495. package/es/scenegraph/graphic/text.d.ts +15 -0
  496. package/es/scenegraph/group-creater/cell-helper.js +10 -2
  497. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  498. package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
  499. package/es/scenegraph/group-creater/cell-type/chart-cell.js +6 -5
  500. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  501. package/es/scenegraph/group-creater/column-helper.js +1 -1
  502. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  503. package/es/scenegraph/group-creater/column.js.map +1 -1
  504. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.d.ts +3 -0
  505. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +65 -0
  506. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -0
  507. package/es/scenegraph/group-creater/progress/proxy.d.ts +2 -2
  508. package/es/scenegraph/group-creater/progress/proxy.js +42 -55
  509. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  510. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +1 -0
  511. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +59 -23
  512. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  513. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +1 -0
  514. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +94 -37
  515. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  516. package/es/scenegraph/layout/compute-col-width.js +23 -15
  517. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  518. package/es/scenegraph/layout/compute-row-height.js +20 -9
  519. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  520. package/es/scenegraph/layout/move-cell.js +1 -1
  521. package/es/scenegraph/layout/move-cell.js.map +1 -1
  522. package/es/scenegraph/layout/update-cell.js +3 -1
  523. package/es/scenegraph/layout/update-cell.js.map +1 -1
  524. package/es/scenegraph/layout/update-height.js +1 -1
  525. package/es/scenegraph/layout/update-height.js.map +1 -1
  526. package/es/scenegraph/layout/update-row.js +1 -1
  527. package/es/scenegraph/layout/update-row.js.map +1 -1
  528. package/es/scenegraph/layout/update-width.js +35 -2
  529. package/es/scenegraph/layout/update-width.js.map +1 -1
  530. package/es/scenegraph/refresh-node/update-chart.d.ts +3 -0
  531. package/es/scenegraph/refresh-node/update-chart.js +70 -4
  532. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  533. package/es/scenegraph/scenegraph.d.ts +8 -0
  534. package/es/scenegraph/scenegraph.js +120 -21
  535. package/es/scenegraph/scenegraph.js.map +1 -1
  536. package/es/scenegraph/stick-text/index.js +10 -8
  537. package/es/scenegraph/stick-text/index.js.map +1 -1
  538. package/es/scenegraph/style/corner-cell.d.ts +3 -0
  539. package/es/scenegraph/style/corner-cell.js +25 -0
  540. package/es/scenegraph/style/corner-cell.js.map +1 -0
  541. package/es/scenegraph/style/frame-border.d.ts +1 -0
  542. package/es/scenegraph/style/frame-border.js +2 -6
  543. package/es/scenegraph/style/frame-border.js.map +1 -1
  544. package/es/scenegraph/utils/get-cell-merge.js +2 -1
  545. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  546. package/es/scenegraph/utils/text-icon-layout.js +1 -1
  547. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  548. package/es/state/state.js +1 -1
  549. package/es/state/state.js.map +1 -1
  550. package/es/themes/DARK.js +1 -2
  551. package/es/themes/theme.d.ts +10 -0
  552. package/es/themes/theme.js +50 -4
  553. package/es/themes/theme.js.map +1 -1
  554. package/es/tools/LimitPromiseQueue.js +2 -1
  555. package/es/tools/calc.d.ts +3 -0
  556. package/es/tools/calc.js +10 -0
  557. package/es/tools/calc.js.map +1 -1
  558. package/es/tools/debounce.js +1 -1
  559. package/es/tools/diff-cell.js +1 -1
  560. package/es/tools/dom.js +1 -1
  561. package/es/tools/env.js +1 -1
  562. package/es/ts-types/base-table.d.ts +29 -12
  563. package/es/ts-types/base-table.js.map +1 -1
  564. package/es/ts-types/column/style.d.ts +0 -1
  565. package/es/ts-types/column/style.js.map +1 -1
  566. package/es/ts-types/component/axis.d.ts +12 -0
  567. package/es/ts-types/component/axis.js +2 -0
  568. package/es/ts-types/component/axis.js.map +1 -0
  569. package/es/ts-types/component/legend.d.ts +5 -0
  570. package/es/ts-types/component/legend.js +2 -0
  571. package/es/ts-types/component/legend.js.map +1 -0
  572. package/es/ts-types/component/title.d.ts +47 -0
  573. package/es/ts-types/component/title.js +2 -0
  574. package/es/ts-types/component/title.js.map +1 -0
  575. package/es/ts-types/component/util.d.ts +1 -0
  576. package/es/ts-types/component/util.js +2 -0
  577. package/es/ts-types/component/util.js.map +1 -0
  578. package/es/ts-types/customElement.d.ts +2 -0
  579. package/es/ts-types/customElement.js.map +1 -1
  580. package/es/ts-types/events.d.ts +108 -83
  581. package/es/ts-types/events.js.map +1 -1
  582. package/es/ts-types/list-table/define/basic-define.js.map +1 -1
  583. package/es/ts-types/list-table/define/chart-define.d.ts +1 -1
  584. package/es/ts-types/list-table/define/chart-define.js.map +1 -1
  585. package/es/ts-types/list-table/layout-map/api.d.ts +4 -2
  586. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  587. package/es/ts-types/new-data-set.d.ts +21 -7
  588. package/es/ts-types/new-data-set.js +2 -2
  589. package/es/ts-types/new-data-set.js.map +1 -1
  590. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +4 -0
  591. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +4 -0
  592. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -1
  593. package/es/ts-types/pivot-table/corner.d.ts +3 -3
  594. package/es/ts-types/pivot-table/corner.js.map +1 -1
  595. package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  596. package/es/ts-types/pivot-table/indicator/chart-indicator.d.ts +1 -1
  597. package/es/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -1
  598. package/es/ts-types/pivot-table/indicator/index.d.ts +1 -0
  599. package/es/ts-types/pivot-table/indicator/index.js.map +1 -1
  600. package/es/ts-types/pivot-table/title.d.ts +1 -1
  601. package/es/ts-types/pivot-table/title.js.map +1 -1
  602. package/es/ts-types/table-engine.d.ts +27 -3
  603. package/es/ts-types/table-engine.js.map +1 -1
  604. package/es/ts-types/theme.d.ts +5 -0
  605. package/es/ts-types/theme.js.map +1 -1
  606. package/package.json +14 -8
  607. package/cjs/chartType.js +0 -14
  608. package/cjs/chartType.js.map +0 -1
  609. package/cjs/menu/dom/BaseMenu.js.map +0 -1
  610. package/cjs/menu/dom/Menu.js.map +0 -1
  611. package/cjs/menu/dom/MenuHandler.js.map +0 -1
  612. package/cjs/menu/dom/logic/MenuContainer.js.map +0 -1
  613. package/cjs/menu/dom/logic/MenuElement.js.map +0 -1
  614. package/cjs/menu/dom/logic/MenuElementStyle.js.map +0 -1
  615. package/cjs/plugins/chartTypes.js.map +0 -1
  616. package/cjs/scenegraph/layout/auto-width.d.ts +0 -2
  617. package/cjs/scenegraph/layout/auto-width.js +0 -85
  618. package/cjs/scenegraph/layout/auto-width.js.map +0 -1
  619. package/cjs/tooltip/BaseTooltip.js.map +0 -1
  620. package/cjs/tooltip/Tooltip.js.map +0 -1
  621. package/cjs/tooltip/TooltipHandler.js.map +0 -1
  622. package/cjs/tooltip/logic/BubbleTooltipElement.js.map +0 -1
  623. package/cjs/tooltip/logic/BubbleTooltipElementStyle.js.map +0 -1
  624. package/es/chartType.js.map +0 -1
  625. package/es/menu/dom/BaseMenu.js.map +0 -1
  626. package/es/menu/dom/Menu.js.map +0 -1
  627. package/es/menu/dom/MenuHandler.js.map +0 -1
  628. package/es/menu/dom/logic/MenuContainer.js.map +0 -1
  629. package/es/menu/dom/logic/MenuElement.js.map +0 -1
  630. package/es/menu/dom/logic/MenuElementStyle.js.map +0 -1
  631. package/es/plugins/chartTypes.js +0 -2
  632. package/es/plugins/chartTypes.js.map +0 -1
  633. package/es/scenegraph/layout/auto-width.d.ts +0 -2
  634. package/es/scenegraph/layout/auto-width.js +0 -82
  635. package/es/scenegraph/layout/auto-width.js.map +0 -1
  636. package/es/tooltip/BaseTooltip.js.map +0 -1
  637. package/es/tooltip/Tooltip.js.map +0 -1
  638. package/es/tooltip/TooltipHandler.js.map +0 -1
  639. package/es/tooltip/logic/BubbleTooltipElement.js.map +0 -1
  640. package/es/tooltip/logic/BubbleTooltipElementStyle.js.map +0 -1
  641. /package/cjs/{chartType.d.ts → chartModule.d.ts} +0 -0
  642. /package/cjs/{menu → components/menu}/dom/BaseMenu.js +0 -0
  643. /package/cjs/{menu → components/menu}/dom/Menu.d.ts +0 -0
  644. /package/cjs/{menu → components/menu}/dom/Menu.js +0 -0
  645. /package/cjs/{menu → components/menu}/dom/logic/MenuElementStyle.d.ts +0 -0
  646. /package/cjs/{menu → components/menu}/dom/logic/MenuElementStyle.js +0 -0
  647. /package/cjs/{tooltip → components/tooltip}/BaseTooltip.js +0 -0
  648. /package/cjs/{tooltip → components/tooltip}/Tooltip.d.ts +0 -0
  649. /package/cjs/{tooltip → components/tooltip}/Tooltip.js +0 -0
  650. /package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.d.ts +0 -0
  651. /package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.js +0 -0
  652. /package/cjs/plugins/{chartTypes.d.ts → chartModules.d.ts} +0 -0
  653. /package/es/{chartType.d.ts → chartModule.d.ts} +0 -0
  654. /package/es/{menu → components/menu}/dom/BaseMenu.js +0 -0
  655. /package/es/{menu → components/menu}/dom/Menu.d.ts +0 -0
  656. /package/es/{menu → components/menu}/dom/Menu.js +0 -0
  657. /package/es/{menu → components/menu}/dom/logic/MenuElementStyle.d.ts +0 -0
  658. /package/es/{menu → components/menu}/dom/logic/MenuElementStyle.js +0 -0
  659. /package/es/{tooltip → components/tooltip}/BaseTooltip.js +0 -0
  660. /package/es/{tooltip → components/tooltip}/Tooltip.d.ts +0 -0
  661. /package/es/{tooltip → components/tooltip}/Tooltip.js +0 -0
  662. /package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.d.ts +0 -0
  663. /package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.js +0 -0
  664. /package/es/plugins/{chartTypes.d.ts → chartModules.d.ts} +0 -0
@@ -1,32 +1,46 @@
1
+ import { isArray } from "@visactor/vutils";
2
+
3
+ import { isValid } from "../tools/util";
4
+
1
5
  import { AggregationType, SortType } from "../ts-types";
2
6
 
7
+ import { AvgAggregator, CountAggregator, MaxAggregator, MinAggregator, RecordAggregator, SumAggregator, naturalSort, sortBy, typeSort } from "./statistics-helper";
8
+
9
+ import { getNewRangeToAlign } from "./util/zero-align";
10
+
3
11
  export class Dataset {
4
- constructor(dataConfig, rows, columns, indicators, records) {
5
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
12
+ constructor(dataConfig, rows, columns, indicatorKeys, records, customColTree, customRowTree) {
13
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
6
14
  this.tree = {}, this.colFlatKeys = {}, this.rowFlatKeys = {}, this.colKeys = [],
7
15
  this.rowKeys = [], this.rowOrder = "key_a_to_z", this.colOrder = "key_a_to_z", this.sorted = !1,
8
16
  this.indicatorStatistics = [], this.aggregators = {}, this.stringJoinChar = String.fromCharCode(0),
9
- this.rowsIsTotal = [], this.colsIsTotal = [], this.registerAggregators(), this.dataConfig = dataConfig,
10
- this.sortRules = this.dataConfig.sortRules, this.aggregationRules = this.dataConfig.aggregationRules,
11
- this.derivedFieldRules = this.dataConfig.derivedFieldRules, this.mappingRules = this.dataConfig.mappingRules,
12
- this.totals = dataConfig.totals, this.rows = rows, this.columns = columns, this.indicators = indicators,
13
- this.colGrandTotalLabel = null !== (_c = null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.column) || void 0 === _b ? void 0 : _b.grandTotalLabel) && void 0 !== _c ? _c : "总计",
14
- this.colSubTotalLabel = null !== (_f = null === (_e = null === (_d = this.totals) || void 0 === _d ? void 0 : _d.column) || void 0 === _e ? void 0 : _e.subTotalLabel) && void 0 !== _f ? _f : "小计",
15
- this.rowGrandTotalLabel = null !== (_j = null === (_h = null === (_g = this.totals) || void 0 === _g ? void 0 : _g.row) || void 0 === _h ? void 0 : _h.grandTotalLabel) && void 0 !== _j ? _j : "总计",
16
- this.rowSubTotalLabel = null !== (_m = null === (_l = null === (_k = this.totals) || void 0 === _k ? void 0 : _k.row) || void 0 === _l ? void 0 : _l.subTotalLabel) && void 0 !== _m ? _m : "小计",
17
- this.rowsIsTotal = new Array(this.rows.length).fill(!1), this.colsIsTotal = new Array(this.columns.length).fill(!1);
18
- for (let i = 0, len = null === (_q = null === (_p = null === (_o = this.totals) || void 0 === _o ? void 0 : _o.row) || void 0 === _p ? void 0 : _p.subTotalsDimensions) || void 0 === _q ? void 0 : _q.length; i < len; i++) {
17
+ this.rowsIsTotal = [], this.colsIsTotal = [], this.collectedValues = {}, this.cacheCollectedValues = {},
18
+ this.registerAggregators(), this.dataConfig = dataConfig, this.sortRules = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.sortRules,
19
+ this.aggregationRules = null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.aggregationRules,
20
+ this.derivedFieldRules = null === (_c = this.dataConfig) || void 0 === _c ? void 0 : _c.derivedFieldRules,
21
+ this.mappingRules = null === (_d = this.dataConfig) || void 0 === _d ? void 0 : _d.mappingRules,
22
+ this.totals = null === (_e = this.dataConfig) || void 0 === _e ? void 0 : _e.totals,
23
+ this.rows = rows, this.columns = columns, this.indicatorKeys = indicatorKeys, this.colGrandTotalLabel = null !== (_h = null === (_g = null === (_f = this.totals) || void 0 === _f ? void 0 : _f.column) || void 0 === _g ? void 0 : _g.grandTotalLabel) && void 0 !== _h ? _h : "总计",
24
+ this.colSubTotalLabel = null !== (_l = null === (_k = null === (_j = this.totals) || void 0 === _j ? void 0 : _j.column) || void 0 === _k ? void 0 : _k.subTotalLabel) && void 0 !== _l ? _l : "小计",
25
+ this.rowGrandTotalLabel = null !== (_p = null === (_o = null === (_m = this.totals) || void 0 === _m ? void 0 : _m.row) || void 0 === _o ? void 0 : _o.grandTotalLabel) && void 0 !== _p ? _p : "总计",
26
+ this.rowSubTotalLabel = null !== (_s = null === (_r = null === (_q = this.totals) || void 0 === _q ? void 0 : _q.row) || void 0 === _r ? void 0 : _r.subTotalLabel) && void 0 !== _s ? _s : "小计",
27
+ this.collectValuesBy = null !== (_u = null === (_t = this.dataConfig) || void 0 === _t ? void 0 : _t.collectValuesBy) && void 0 !== _u ? _u : {
28
+ 230417170554008: {
29
+ by: [ "230417171050031", "230417171050028" ]
30
+ }
31
+ }, this.rowsIsTotal = new Array(this.rows.length).fill(!1), this.colsIsTotal = new Array(this.columns.length).fill(!1);
32
+ for (let i = 0, len = null === (_x = null === (_w = null === (_v = this.totals) || void 0 === _v ? void 0 : _v.row) || void 0 === _w ? void 0 : _w.subTotalsDimensions) || void 0 === _x ? void 0 : _x.length; i < len; i++) {
19
33
  const dimension = this.totals.row.subTotalsDimensions[i], dimensionIndex = this.rows.indexOf(dimension);
20
34
  this.rowsIsTotal[dimensionIndex] = !0;
21
35
  }
22
- for (let i = 0, len = null === (_t = null === (_s = null === (_r = this.totals) || void 0 === _r ? void 0 : _r.column) || void 0 === _s ? void 0 : _s.subTotalsDimensions) || void 0 === _t ? void 0 : _t.length; i < len; i++) {
36
+ for (let i = 0, len = null === (_0 = null === (_z = null === (_y = this.totals) || void 0 === _y ? void 0 : _y.column) || void 0 === _z ? void 0 : _z.subTotalsDimensions) || void 0 === _0 ? void 0 : _0.length; i < len; i++) {
23
37
  const dimension = this.totals.column.subTotalsDimensions[i], dimensionIndex = this.columns.indexOf(dimension);
24
38
  this.colsIsTotal[dimensionIndex] = !0;
25
39
  }
26
40
  if (records) {
27
41
  this.records = records;
28
42
  const t0 = "undefined" != typeof window ? window.performance.now() : 0;
29
- this.setRecords(records);
43
+ this.setRecords(records), this.processCollectedValuesWithSumBy(), this.processCollectedValuesWithSortBy();
30
44
  const t1 = "undefined" != typeof window ? window.performance.now() : 0;
31
45
  console.log("processRecords:", t1 - t0);
32
46
  const t4 = "undefined" != typeof window ? window.performance.now() : 0;
@@ -38,36 +52,61 @@ export class Dataset {
38
52
  const t3 = "undefined" != typeof window ? window.performance.now() : 0;
39
53
  console.log("sortKeys:", t3 - t2);
40
54
  const t7 = "undefined" != typeof window ? window.performance.now() : 0;
41
- this.rowKeysPath = this.TreeToArr(this.ArrToTree(this.rowKeys, this.rowsIsTotal, (null === (_v = null === (_u = null == this ? void 0 : this.totals) || void 0 === _u ? void 0 : _u.row) || void 0 === _v ? void 0 : _v.showGrandTotals) || 0 === this.columns.length, this.rowGrandTotalLabel, this.rowSubTotalLabel)),
42
- this.colKeysPath = this.TreeToArr(this.ArrToTree(this.colKeys, this.colsIsTotal, (null === (_x = null === (_w = this.totals) || void 0 === _w ? void 0 : _w.column) || void 0 === _x ? void 0 : _x.showGrandTotals) || 0 === this.rows.length, this.colGrandTotalLabel, this.colSubTotalLabel));
55
+ this.rowKeysPath = customRowTree ? this.TreeToArr2(customRowTree) : this.TreeToArr(this.ArrToTree(this.rowKeys, this.rowsIsTotal, null === (_2 = null === (_1 = null == this ? void 0 : this.totals) || void 0 === _1 ? void 0 : _1.row) || void 0 === _2 ? void 0 : _2.showGrandTotals, this.rowGrandTotalLabel, this.rowSubTotalLabel)),
56
+ this.colKeysPath = customColTree ? this.TreeToArr2(customColTree) : this.TreeToArr(this.ArrToTree(this.colKeys, this.colsIsTotal, null === (_4 = null === (_3 = this.totals) || void 0 === _3 ? void 0 : _3.column) || void 0 === _4 ? void 0 : _4.showGrandTotals, this.colGrandTotalLabel, this.colSubTotalLabel));
43
57
  const t8 = "undefined" != typeof window ? window.performance.now() : 0;
44
- console.log("TreeToArr:", t8 - t7);
58
+ console.log("TreeToArr:", t8 - t7), this.dataConfig.isPivotChart && (this.dealWithZeroAlign(),
59
+ this.cacheDeminsionCollectedValues());
45
60
  }
46
- delete this.rowFlatKeys, delete this.colFlatKeys;
47
61
  }
48
62
  registerAggregator(type, aggregator) {
49
63
  this.aggregators[type] = aggregator;
50
64
  }
51
65
  registerAggregators() {
52
- this.registerAggregator(AggregationType.SUM, SumAggregator), this.registerAggregator(AggregationType.COUNT, CountAggregator),
53
- this.registerAggregator(AggregationType.MAX, MaxAggregator), this.registerAggregator(AggregationType.MIN, MinAggregator),
54
- this.registerAggregator(AggregationType.AVG, AvgAggregator);
66
+ this.registerAggregator(AggregationType.RECORD, RecordAggregator), this.registerAggregator(AggregationType.SUM, SumAggregator),
67
+ this.registerAggregator(AggregationType.COUNT, CountAggregator), this.registerAggregator(AggregationType.MAX, MaxAggregator),
68
+ this.registerAggregator(AggregationType.MIN, MinAggregator), this.registerAggregator(AggregationType.AVG, AvgAggregator);
55
69
  }
56
70
  setRecords(records) {
57
71
  this.processRecords();
58
72
  }
73
+ processCollectedValuesWithSumBy() {
74
+ var _a;
75
+ for (const field in this.collectedValues) if (null === (_a = this.collectValuesBy[field]) || void 0 === _a ? void 0 : _a.sumBy) for (const byKeys in this.collectedValues[field]) {
76
+ const max = Object.values(this.collectedValues[field][byKeys]).reduce(((acc, cur) => cur.value() > acc ? cur.value() : acc), Number.MIN_SAFE_INTEGER), min = Object.values(this.collectedValues[field][byKeys]).reduce(((acc, cur) => cur.value() < acc ? cur.value() : acc), Number.MAX_SAFE_INTEGER);
77
+ this.collectedValues[field][byKeys] = {}, this.collectedValues[field][byKeys].max = max,
78
+ this.collectedValues[field][byKeys].min = min;
79
+ }
80
+ }
81
+ processCollectedValuesWithSortBy() {
82
+ var _a;
83
+ for (const field in this.collectedValues) if (null === (_a = this.collectValuesBy[field]) || void 0 === _a ? void 0 : _a.sortBy) for (const byKeys in this.collectedValues[field]) this.collectedValues[field][byKeys] = this.collectedValues[field][byKeys].sort(((a, b) => {
84
+ var _a, _b;
85
+ return (null === (_a = this.collectValuesBy[field]) || void 0 === _a ? void 0 : _a.sortBy.indexOf(a)) - (null === (_b = this.collectValuesBy[field]) || void 0 === _b ? void 0 : _b.sortBy.indexOf(b));
86
+ }));
87
+ }
59
88
  processRecords() {
89
+ var _a, _b;
90
+ let isNeedFilter = !1;
91
+ (null === (_b = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules) || void 0 === _b ? void 0 : _b.length) >= 1 && (isNeedFilter = !0);
60
92
  for (let i = 0, len = this.records.length; i < len; i++) {
61
93
  const record = this.records[i];
62
- this.filterRecord(record) && this.processRecord(record);
94
+ isNeedFilter && !this.filterRecord(record) || this.processRecord(record);
63
95
  }
96
+ this.rowFlatKeys = {}, this.colFlatKeys = {};
64
97
  }
65
98
  filterRecord(record) {
66
99
  var _a, _b;
67
100
  let isReserved = !0;
68
- for (let i = 0; i < (null === (_a = this.dataConfig.filterRules) || void 0 === _a ? void 0 : _a.length); i++) {
69
- const filterRule = this.dataConfig.filterRules[i];
70
- if (!(null === (_b = filterRule.filterFunc) || void 0 === _b ? void 0 : _b.call(filterRule, record))) {
101
+ for (let i = 0; i < this.dataConfig.filterRules.length; i++) {
102
+ const filterRule = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules[i];
103
+ if (filterRule.filterKey) {
104
+ const filterValue = record[filterRule.filterKey];
105
+ if (-1 === filterRule.filteredValues.indexOf(filterValue)) {
106
+ isReserved = !1;
107
+ break;
108
+ }
109
+ } else if (!(null === (_b = filterRule.filterFunc) || void 0 === _b ? void 0 : _b.call(filterRule, record))) {
71
110
  isReserved = !1;
72
111
  break;
73
112
  }
@@ -75,7 +114,7 @@ export class Dataset {
75
114
  return isReserved;
76
115
  }
77
116
  processRecord(record) {
78
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
117
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
79
118
  null === (_a = this.derivedFieldRules) || void 0 === _a || _a.forEach(((derivedFieldRule, i) => {
80
119
  record[derivedFieldRule.fieldName] = derivedFieldRule.derivedFunc(record);
81
120
  }));
@@ -88,30 +127,47 @@ export class Dataset {
88
127
  const colAttr = this.columns[n];
89
128
  colKey.push(record[colAttr]);
90
129
  }
130
+ for (const field in this.collectValuesBy) if (record[field]) {
131
+ this.collectedValues[field] || (this.collectedValues[field] = {});
132
+ const collectKeys = this.collectValuesBy[field].by.map((byField => record[byField])).join(this.stringJoinChar);
133
+ if (this.collectedValues[field][collectKeys] || (this.collectValuesBy[field].sumBy ? this.collectedValues[field][collectKeys] = {} : this.collectValuesBy[field].range ? this.collectedValues[field][collectKeys] = {
134
+ min: Number.MAX_SAFE_INTEGER,
135
+ max: Number.MIN_SAFE_INTEGER
136
+ } : this.collectedValues[field][collectKeys] = []), this.collectValuesBy[field].sumBy) {
137
+ const sumByKeys = this.collectValuesBy[field].sumBy.map((byField => record[byField])).join(this.stringJoinChar);
138
+ this.collectedValues[field][collectKeys][sumByKeys] || (this.collectedValues[field][collectKeys][sumByKeys] = new this.aggregators[AggregationType.SUM](field)),
139
+ this.collectedValues[field][collectKeys][sumByKeys].push(record);
140
+ } else if (this.collectValuesBy[field].range) {
141
+ const fieldRange = this.collectedValues[field][collectKeys];
142
+ fieldRange.max = Math.max(record[field], fieldRange.max), fieldRange.min = Math.min(record[field], fieldRange.min);
143
+ } else {
144
+ const fieldRange = this.collectedValues[field][collectKeys];
145
+ -1 === fieldRange.indexOf(record[field]) && fieldRange.push(record[field]);
146
+ }
147
+ }
91
148
  const flatRowKey = rowKey.join(this.stringJoinChar), flatColKey = colKey.join(this.stringJoinChar);
92
- if (0 !== rowKey.length && (this.rowFlatKeys[flatRowKey] || (this.rowKeys.push(rowKey),
149
+ 0 !== rowKey.length && (this.rowFlatKeys[flatRowKey] || (this.rowKeys.push(rowKey),
93
150
  this.rowFlatKeys[flatRowKey] = 1)), 0 !== colKey.length && (this.colFlatKeys[flatColKey] || (this.colKeys.push(colKey),
94
- this.colFlatKeys[flatColKey] = 1)), 0 !== colKey.length || 0 !== rowKey.length) {
95
- this.tree[flatRowKey] || (this.tree[flatRowKey] = {}), (null === (_b = this.tree[flatRowKey]) || void 0 === _b ? void 0 : _b[flatColKey]) || (this.tree[flatRowKey][flatColKey] = []);
96
- for (let i = 0; i < this.indicators.length; i++) {
97
- if (!(null === (_d = null === (_c = this.tree[flatRowKey]) || void 0 === _c ? void 0 : _c[flatColKey]) || void 0 === _d ? void 0 : _d[i])) {
98
- const aggRule = this.getAggregatorRule(this.indicators[i]);
99
- this.tree[flatRowKey][flatColKey][i] = new this.aggregators[null !== (_e = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _e ? _e : AggregationType.SUM](null !== (_f = null == aggRule ? void 0 : aggRule.field) && void 0 !== _f ? _f : this.indicators[i], null == aggRule ? void 0 : aggRule.formatFun);
100
- }
101
- null === (_h = null === (_g = this.tree[flatRowKey]) || void 0 === _g ? void 0 : _g[flatColKey]) || void 0 === _h || _h[i].push(record);
102
- }
151
+ this.colFlatKeys[flatColKey] = 1)), this.tree[flatRowKey] || (this.tree[flatRowKey] = {}),
152
+ (null === (_b = this.tree[flatRowKey]) || void 0 === _b ? void 0 : _b[flatColKey]) || (this.tree[flatRowKey][flatColKey] = []);
153
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
154
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
155
+ if ((null === (_d = null === (_c = this.tree[flatRowKey]) || void 0 === _c ? void 0 : _c[flatColKey]) || void 0 === _d ? void 0 : _d[i]) || (this.tree[flatRowKey][flatColKey][i] = new this.aggregators[null !== (_e = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _e ? _e : AggregationType.SUM](null !== (_f = null == aggRule ? void 0 : aggRule.field) && void 0 !== _f ? _f : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun)),
156
+ null == aggRule ? void 0 : aggRule.field) if ("string" == typeof (null == aggRule ? void 0 : aggRule.field)) isValid(record[null == aggRule ? void 0 : aggRule.field]) && (null === (_h = null === (_g = this.tree[flatRowKey]) || void 0 === _g ? void 0 : _g[flatColKey]) || void 0 === _h || _h[i].push(record)); else {
157
+ (null == aggRule ? void 0 : aggRule.field.find((field => record[field]))) && (null === (_k = null === (_j = this.tree[flatRowKey]) || void 0 === _j ? void 0 : _j[flatColKey]) || void 0 === _k || _k[i].push(record));
158
+ } else isValid(record[this.indicatorKeys[i]]) && (null === (_m = null === (_l = this.tree[flatRowKey]) || void 0 === _l ? void 0 : _l[flatColKey]) || void 0 === _m || _m[i].push(record));
103
159
  }
104
- if (this.mappingRules) for (let i = 0; i < this.indicators.length; i++) {
160
+ if (this.mappingRules) for (let i = 0; i < this.indicatorKeys.length; i++) {
105
161
  if (!this.indicatorStatistics[i]) {
106
- const aggRule = this.getAggregatorRule(this.indicators[i]);
162
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
107
163
  this.indicatorStatistics[i] = {
108
- max: new this.aggregators[AggregationType.MAX](this.indicators[i]),
109
- min: new this.aggregators[AggregationType.MIN](this.indicators[i]),
110
- total: new this.aggregators[null !== (_j = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _j ? _j : AggregationType.SUM](null !== (_k = null == aggRule ? void 0 : aggRule.field) && void 0 !== _k ? _k : this.indicators[i], null == aggRule ? void 0 : aggRule.formatFun)
164
+ max: new this.aggregators[AggregationType.MAX](this.indicatorKeys[i]),
165
+ min: new this.aggregators[AggregationType.MIN](this.indicatorKeys[i]),
166
+ total: new this.aggregators[null !== (_o = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _o ? _o : AggregationType.SUM](null !== (_p = null == aggRule ? void 0 : aggRule.field) && void 0 !== _p ? _p : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun)
111
167
  };
112
168
  }
113
- this.indicatorStatistics[i].max.push(null === (_m = null === (_l = this.tree[flatRowKey]) || void 0 === _l ? void 0 : _l[flatColKey]) || void 0 === _m ? void 0 : _m[i].value()),
114
- this.indicatorStatistics[i].min.push(null === (_p = null === (_o = this.tree[flatRowKey]) || void 0 === _o ? void 0 : _o[flatColKey]) || void 0 === _p ? void 0 : _p[i].value()),
169
+ this.indicatorStatistics[i].max.push(null === (_r = null === (_q = this.tree[flatRowKey]) || void 0 === _q ? void 0 : _q[flatColKey]) || void 0 === _r ? void 0 : _r[i].value()),
170
+ this.indicatorStatistics[i].min.push(null === (_t = null === (_s = this.tree[flatRowKey]) || void 0 === _s ? void 0 : _s[flatColKey]) || void 0 === _t ? void 0 : _t[i].value()),
115
171
  this.indicatorStatistics[i].total.push(record);
116
172
  }
117
173
  }
@@ -120,22 +176,28 @@ export class Dataset {
120
176
  this.sorted = !1, this.sortRules = sortRules, this.sortKeys(), this.rowKeysPath = this.TreeToArr(this.ArrToTree(this.rowKeys, this.rowsIsTotal, (null === (_b = null === (_a = null == this ? void 0 : this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || 0 === this.columns.length, this.rowGrandTotalLabel, this.rowSubTotalLabel)),
121
177
  this.colKeysPath = this.TreeToArr(this.ArrToTree(this.colKeys, this.colsIsTotal, (null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.column) || void 0 === _d ? void 0 : _d.showGrandTotals) || 0 === this.rows.length, this.colGrandTotalLabel, this.colSubTotalLabel));
122
178
  }
179
+ updateFilterRules(filterRules, isResetTree = !1) {
180
+ if (this.filterRules = filterRules, isResetTree) this.tree = {}; else for (const treeRowKey in this.tree) for (const treeColKey in this.tree[treeRowKey]) for (let i = 0; i < this.tree[treeRowKey][treeColKey].length; i++) this.tree[treeRowKey][treeColKey][i].reset();
181
+ this.collectedValues = {}, this.processRecords(), this.processCollectedValuesWithSumBy(),
182
+ this.dataConfig.isPivotChart && this.dealWithZeroAlign();
183
+ }
123
184
  getAggregatorRule(indicatorKey) {
124
185
  var _a;
125
186
  return null === (_a = this.aggregationRules) || void 0 === _a ? void 0 : _a.find(((value, index) => indicatorKey === value.indicatorKey));
126
187
  }
127
188
  getAggregator(rowKey = [], colKey = [], indicator) {
128
189
  var _a, _b;
129
- const indicatorIndex = this.indicators.indexOf(indicator);
190
+ const indicatorIndex = this.indicatorKeys.indexOf(indicator);
130
191
  let agg, flatRowKey, flatColKey;
131
192
  return flatRowKey = "string" == typeof rowKey ? rowKey : rowKey.join(this.stringJoinChar),
132
193
  flatColKey = "string" == typeof colKey ? colKey : colKey.join(this.stringJoinChar),
133
- 0 === rowKey.length && 0 === colKey.length || (agg = null === (_b = null === (_a = this.tree[flatRowKey]) || void 0 === _a ? void 0 : _a[flatColKey]) || void 0 === _b ? void 0 : _b[indicatorIndex]),
194
+ agg = null === (_b = null === (_a = this.tree[flatRowKey]) || void 0 === _a ? void 0 : _a[flatColKey]) || void 0 === _b ? void 0 : _b[indicatorIndex],
134
195
  agg || {
135
196
  className: "",
136
197
  push() {},
137
198
  value: () => null,
138
- formatValue: () => ""
199
+ formatValue: () => "",
200
+ reset() {}
139
201
  };
140
202
  }
141
203
  sortKeys() {
@@ -232,7 +294,7 @@ export class Dataset {
232
294
  totalStatistics() {
233
295
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
234
296
  const that = this;
235
- if ((null === (_b = null === (_a = null == that ? void 0 : that.totals) || void 0 === _a ? void 0 : _a.column) || void 0 === _b ? void 0 : _b.showSubTotals) && (null === (_e = null === (_d = null === (_c = null == that ? void 0 : that.totals) || void 0 === _c ? void 0 : _c.column) || void 0 === _d ? void 0 : _d.subTotalsDimensions) || void 0 === _e ? void 0 : _e.length) >= 1 || (null === (_g = null === (_f = null == that ? void 0 : that.totals) || void 0 === _f ? void 0 : _f.row) || void 0 === _g ? void 0 : _g.showSubTotals) && (null === (_k = null === (_j = null === (_h = null == that ? void 0 : that.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.subTotalsDimensions) || void 0 === _k ? void 0 : _k.length) >= 1 || (null === (_m = null === (_l = null == that ? void 0 : that.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || (null === (_p = null === (_o = null == that ? void 0 : that.totals) || void 0 === _o ? void 0 : _o.row) || void 0 === _p ? void 0 : _p.showGrandTotals) || 0 === that.rows.length || 0 === that.columns.length) {
297
+ if ((null === (_b = null === (_a = null == that ? void 0 : that.totals) || void 0 === _a ? void 0 : _a.column) || void 0 === _b ? void 0 : _b.showSubTotals) && (null === (_e = null === (_d = null === (_c = null == that ? void 0 : that.totals) || void 0 === _c ? void 0 : _c.column) || void 0 === _d ? void 0 : _d.subTotalsDimensions) || void 0 === _e ? void 0 : _e.length) >= 1 || (null === (_g = null === (_f = null == that ? void 0 : that.totals) || void 0 === _f ? void 0 : _f.row) || void 0 === _g ? void 0 : _g.showSubTotals) && (null === (_k = null === (_j = null === (_h = null == that ? void 0 : that.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.subTotalsDimensions) || void 0 === _k ? void 0 : _k.length) >= 1 || (null === (_m = null === (_l = null == that ? void 0 : that.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || (null === (_p = null === (_o = null == that ? void 0 : that.totals) || void 0 === _o ? void 0 : _o.row) || void 0 === _p ? void 0 : _p.showGrandTotals)) {
236
298
  const rowTotalKeys = [], colCompute = (flatRowKey, flatColKey) => {
237
299
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
238
300
  const colKey = flatColKey.split(this.stringJoinChar);
@@ -243,10 +305,10 @@ export class Dataset {
243
305
  colTotalKey.push(null !== (_f = null === (_e = null === (_d = that.totals) || void 0 === _d ? void 0 : _d.column) || void 0 === _e ? void 0 : _e.subTotalLabel) && void 0 !== _f ? _f : "小计");
244
306
  const flatColTotalKey = colTotalKey.join(this.stringJoinChar);
245
307
  this.tree[flatRowKey][flatColTotalKey] || (this.tree[flatRowKey][flatColTotalKey] = []);
246
- for (let i = 0; i < this.indicators.length; i++) {
308
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
247
309
  if (!this.tree[flatRowKey][flatColTotalKey][i]) {
248
- const aggRule = this.getAggregatorRule(this.indicators[i]);
249
- this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[null !== (_g = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _g ? _g : AggregationType.SUM](null !== (_h = null == aggRule ? void 0 : aggRule.field) && void 0 !== _h ? _h : this.indicators[i], null == aggRule ? void 0 : aggRule.formatFun);
310
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
311
+ this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[null !== (_g = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _g ? _g : AggregationType.SUM](null !== (_h = null == aggRule ? void 0 : aggRule.field) && void 0 !== _h ? _h : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun);
250
312
  }
251
313
  this.tree[flatRowKey][flatColTotalKey][i].push(null === (_k = null === (_j = that.tree[flatRowKey]) || void 0 === _j ? void 0 : _j[flatColKey]) || void 0 === _k ? void 0 : _k[i]);
252
314
  }
@@ -255,10 +317,10 @@ export class Dataset {
255
317
  if ((null === (_m = null === (_l = that.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || 0 === this.rows.length) {
256
318
  const flatColTotalKey = that.colGrandTotalLabel;
257
319
  this.tree[flatRowKey][flatColTotalKey] || (this.tree[flatRowKey][flatColTotalKey] = []);
258
- for (let i = 0; i < this.indicators.length; i++) {
320
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
259
321
  if (!this.tree[flatRowKey][flatColTotalKey][i]) {
260
- const aggRule = this.getAggregatorRule(this.indicators[i]);
261
- this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[null !== (_o = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _o ? _o : AggregationType.SUM](null !== (_p = null == aggRule ? void 0 : aggRule.field) && void 0 !== _p ? _p : this.indicators[i], null == aggRule ? void 0 : aggRule.formatFun);
322
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
323
+ this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[null !== (_o = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _o ? _o : AggregationType.SUM](null !== (_p = null == aggRule ? void 0 : aggRule.field) && void 0 !== _p ? _p : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun);
262
324
  }
263
325
  this.tree[flatRowKey][flatColTotalKey][i].push(null === (_r = null === (_q = that.tree[flatRowKey]) || void 0 === _q ? void 0 : _q[flatColKey]) || void 0 === _r ? void 0 : _r[i]);
264
326
  }
@@ -277,29 +339,29 @@ export class Dataset {
277
339
  if (this.tree[flatRowTotalKey] || (this.tree[flatRowTotalKey] = {}, rowTotalKeys.push(flatRowTotalKey)),
278
340
  !this.tree[flatRowTotalKey][flatColKey]) {
279
341
  this.tree[flatRowTotalKey][flatColKey] = [];
280
- for (let i = 0; i < this.indicators.length; i++) {
342
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
281
343
  if (!this.tree[flatRowTotalKey][flatColKey][i]) {
282
- const aggRule = this.getAggregatorRule(this.indicators[i]);
283
- this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[null !== (_g = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _g ? _g : AggregationType.SUM](null !== (_h = null == aggRule ? void 0 : aggRule.field) && void 0 !== _h ? _h : this.indicators[i], null == aggRule ? void 0 : aggRule.formatFun);
344
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
345
+ this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[null !== (_g = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _g ? _g : AggregationType.SUM](null !== (_h = null == aggRule ? void 0 : aggRule.field) && void 0 !== _h ? _h : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun);
284
346
  }
285
347
  this.tree[flatRowTotalKey][flatColKey][i].push(null === (_k = null === (_j = that.tree[flatRowKey]) || void 0 === _j ? void 0 : _j[flatColKey]) || void 0 === _k ? void 0 : _k[i]);
286
348
  }
287
349
  }
288
350
  }
289
- if ((null === (_m = null === (_l = that.totals) || void 0 === _l ? void 0 : _l.row) || void 0 === _m ? void 0 : _m.showGrandTotals) || 0 === this.columns.length) {
290
- const flatRowTotalKey = that.rowGrandTotalLabel;
291
- this.tree[flatRowTotalKey] || (this.tree[flatRowTotalKey] = {}, rowTotalKeys.push(flatRowTotalKey)),
292
- this.tree[flatRowTotalKey][flatColKey] || (this.tree[flatRowTotalKey][flatColKey] = []);
293
- for (let i = 0; i < this.indicators.length; i++) {
294
- if (!this.tree[flatRowTotalKey][flatColKey][i]) {
295
- const aggRule = this.getAggregatorRule(this.indicators[i]);
296
- this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[null !== (_o = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _o ? _o : AggregationType.SUM](null !== (_p = null == aggRule ? void 0 : aggRule.field) && void 0 !== _p ? _p : this.indicators[i], null == aggRule ? void 0 : aggRule.formatFun);
297
- }
298
- this.tree[flatRowTotalKey][flatColKey][i].push(null === (_r = null === (_q = that.tree[flatRowKey]) || void 0 === _q ? void 0 : _q[flatColKey]) || void 0 === _r ? void 0 : _r[i]);
351
+ }
352
+ if ((null === (_m = null === (_l = that.totals) || void 0 === _l ? void 0 : _l.row) || void 0 === _m ? void 0 : _m.showGrandTotals) || 0 === this.columns.length) {
353
+ const flatRowTotalKey = that.rowGrandTotalLabel;
354
+ this.tree[flatRowTotalKey] || (this.tree[flatRowTotalKey] = {}, rowTotalKeys.push(flatRowTotalKey)),
355
+ this.tree[flatRowTotalKey][flatColKey] || (this.tree[flatRowTotalKey][flatColKey] = []);
356
+ for (let i = 0; i < this.indicatorKeys.length; i++) {
357
+ if (!this.tree[flatRowTotalKey][flatColKey][i]) {
358
+ const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
359
+ this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[null !== (_o = null == aggRule ? void 0 : aggRule.aggregationType) && void 0 !== _o ? _o : AggregationType.SUM](null !== (_p = null == aggRule ? void 0 : aggRule.field) && void 0 !== _p ? _p : this.indicatorKeys[i], null == aggRule ? void 0 : aggRule.formatFun);
299
360
  }
361
+ this.tree[flatRowTotalKey][flatColKey][i].push(null === (_r = null === (_q = that.tree[flatRowKey]) || void 0 === _q ? void 0 : _q[flatColKey]) || void 0 === _r ? void 0 : _r[i]);
300
362
  }
301
- colCompute(flatRowKey, flatColKey);
302
363
  }
364
+ colCompute(flatRowKey, flatColKey);
303
365
  }));
304
366
  })), rowTotalKeys.forEach((flatRowKey => {
305
367
  Object.keys(that.tree[flatRowKey]).forEach((flatColKey => {
@@ -320,33 +382,33 @@ export class Dataset {
320
382
  if (!item) {
321
383
  if (item = {
322
384
  id: flatKey,
323
- child: []
385
+ children: []
324
386
  }, subTotalFlags[index]) {
325
- let curChild = item.child;
387
+ let curChild = item.children;
326
388
  for (let i = index; i < list.length - 1; i++) {
327
389
  const totalChild = {
328
390
  id: `${flatKey}${concatStr}${subTotalLabel}`,
329
- child: []
391
+ children: []
330
392
  };
331
- curChild.push(totalChild), curChild = totalChild.child;
393
+ curChild.push(totalChild), curChild = totalChild.children;
332
394
  }
333
395
  }
334
- map.set(flatKey, item), node ? subTotalFlags[index - 1] ? node.child.splice(node.child.length - 1, 0, item) : node.child.push(item) : result.push(item);
396
+ map.set(flatKey, item), node ? subTotalFlags[index - 1] ? node.children.splice(node.children.length - 1, 0, item) : node.children.push(item) : result.push(item);
335
397
  }
336
398
  node = item;
337
399
  }));
338
400
  }(item))), isGrandTotal) {
339
401
  const node = {
340
402
  id: grandTotalLabel,
341
- child: []
403
+ children: []
342
404
  };
343
- let curChild = node.child;
405
+ let curChild = node.children;
344
406
  for (let i = 1; i < subTotalFlags.length; i++) {
345
407
  const totalChild = {
346
408
  id: grandTotalLabel,
347
- child: []
409
+ children: []
348
410
  };
349
- curChild.push(totalChild), curChild = totalChild.child;
411
+ curChild.push(totalChild), curChild = totalChild.children;
350
412
  }
351
413
  result.push(node);
352
414
  }
@@ -356,127 +418,58 @@ export class Dataset {
356
418
  const result = [];
357
419
  function getPath(node, arr) {
358
420
  var _a;
359
- arr.push(node.id), node.child.length > 0 ? null === (_a = node.child) || void 0 === _a || _a.forEach((childItem => getPath(childItem, [ ...arr ]))) : result.push(arr);
421
+ arr.push(node.id), node.children.length > 0 ? null === (_a = node.children) || void 0 === _a || _a.forEach((childItem => getPath(childItem, [ ...arr ]))) : result.push(arr);
360
422
  }
361
423
  return tree.forEach((treeNode => getPath(treeNode, []))), result;
362
424
  }
363
- }
364
-
365
- class Aggregator {
366
- constructor(dimension, formatFun, isRecord) {
367
- this.className = "Aggregator", this.isRecord = !0, this.records = [], this.field = dimension,
368
- this.formatFun = formatFun, this.isRecord = null != isRecord ? isRecord : this.isRecord;
369
- }
370
- formatValue() {
371
- return this._formatedValue || (this.formatFun ? this._formatedValue = this.formatFun(this.value()) : this._formatedValue = this.value()),
372
- this._formatedValue;
373
- }
374
- }
375
-
376
- class SumAggregator extends Aggregator {
377
- constructor() {
378
- super(...arguments), this.type = AggregationType.SUM, this.sum = 0;
379
- }
380
- push(record) {
381
- this.isRecord && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)),
382
- "Aggregator" === record.className ? this.sum += record.value() : isNaN(parseFloat(record[this.field])) || (this.sum += parseFloat(record[this.field]));
383
- }
384
- value() {
385
- return this.sum;
386
- }
387
- }
388
-
389
- class CountAggregator extends Aggregator {
390
- constructor() {
391
- super(...arguments), this.type = AggregationType.COUNT, this.count = 0;
392
- }
393
- push(record) {
394
- this.isRecord && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)),
395
- "Aggregator" === record.className ? this.count += record.value() : this.count++;
396
- }
397
- value() {
398
- return this.count;
399
- }
400
- }
401
-
402
- class AvgAggregator extends Aggregator {
403
- constructor() {
404
- super(...arguments), this.type = AggregationType.AVG, this.sum = 0, this.count = 0;
405
- }
406
- push(record) {
407
- this.isRecord && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)),
408
- "Aggregator" === record.className && record.type === AggregationType.AVG ? (this.sum += record.sum,
409
- this.count += record.count) : isNaN(parseFloat(record[this.field])) || (this.sum += parseFloat(record[this.field]),
410
- this.count++);
411
- }
412
- value() {
413
- return this.sum / this.count;
414
- }
415
- }
416
-
417
- class MaxAggregator extends Aggregator {
418
- constructor() {
419
- super(...arguments), this.type = AggregationType.MAX, this.max = Number.MIN_SAFE_INTEGER,
420
- this.isRecord = !1;
421
- }
422
- push(record) {
423
- this.isRecord && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)),
424
- "number" == typeof record ? this.max = record > this.max ? record : this.max : "number" == typeof record[this.field] ? this.max = record[this.field] > this.max ? record[this.field] : this.max : isNaN(record[this.field]) || (this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max);
425
- }
426
- value() {
427
- return this.max;
428
- }
429
- }
430
-
431
- class MinAggregator extends Aggregator {
432
- constructor() {
433
- super(...arguments), this.type = AggregationType.MIN, this.min = Number.MAX_SAFE_INTEGER,
434
- this.isRecord = !1;
425
+ TreeToArr2(tree) {
426
+ const result = [];
427
+ function getPath(node, arr) {
428
+ var _a, _b;
429
+ arr.push(arr.length > 0 ? [ arr[arr.length - 1], node.value ].join(String.fromCharCode(0)) : node.value),
430
+ (null === (_a = node.children) || void 0 === _a ? void 0 : _a.length) > 0 && !node.children[0].indicatorKey ? null === (_b = node.children) || void 0 === _b || _b.forEach((childItem => getPath(childItem, [ ...arr ]))) : result.push(arr);
431
+ }
432
+ return tree.forEach((treeNode => getPath(treeNode, []))), result;
435
433
  }
436
- push(record) {
437
- this.isRecord && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)),
438
- "number" == typeof record ? this.min = record < this.min ? record : this.min : "number" == typeof record[this.field] && (this.min = record[this.field] < this.min ? record[this.field] : this.min);
434
+ dealWithZeroAlign() {
435
+ const indicatorsToAlign = [];
436
+ for (let i = 0; i < this.aggregationRules.length; i++) {
437
+ const rule = this.aggregationRules[i];
438
+ isArray(rule.field) && 2 === rule.field.length && indicatorsToAlign.push(rule.field);
439
+ }
440
+ indicatorsToAlign.forEach((indicatorToAlign => {
441
+ const indicator1 = indicatorToAlign[0], indicator2 = indicatorToAlign[1], collectedValue1 = this.collectedValues[indicator1], collectedValue2 = this.collectedValues[indicator2];
442
+ this.collectedValues[indicator1 + "_align"] = {}, this.collectedValues[indicator2 + "_align"] = {};
443
+ for (const key in collectedValue1) {
444
+ const range1 = collectedValue1[key], range2 = collectedValue2[key], newRanges = getNewRangeToAlign(range1, range2);
445
+ if (newRanges) {
446
+ const {range1: newRange1, range2: newRange2} = newRanges;
447
+ this.collectedValues[indicator1 + "_align"][key] = {
448
+ min: newRange1[0],
449
+ max: newRange1[1]
450
+ }, this.collectedValues[indicator2 + "_align"][key] = {
451
+ min: newRange2[0],
452
+ max: newRange2[1]
453
+ };
454
+ } else this.collectedValues[indicator1 + "_align"][key] = {
455
+ min: range1.min,
456
+ max: range1.max
457
+ }, this.collectedValues[indicator2 + "_align"][key] = {
458
+ min: range2.min,
459
+ max: range2.max
460
+ };
461
+ }
462
+ }));
439
463
  }
440
- value() {
441
- return this.min;
464
+ cacheDeminsionCollectedValues() {
465
+ for (const key in this.collectValuesBy) "xField" !== this.collectValuesBy[key].type && "yField" !== this.collectValuesBy[key].type || (this.dataConfig.dimensionSortArray ? this.cacheCollectedValues[key] = arraySortByAnotherArray(this.collectedValues[key], this.dataConfig.dimensionSortArray) : this.cacheCollectedValues[key] = this.collectedValues[key]);
442
466
  }
443
467
  }
444
468
 
445
- function indicatorSort(a, b) {
446
- return a && b ? a.toString().localeCompare(b.toString(), "zh") : a ? 1 : -1;
447
- }
448
-
449
- function typeSort(a, b) {
450
- return a && b ? a.toString().localeCompare(b.toString(), "zh") : a ? 1 : -1;
451
- }
452
-
453
- function naturalSort(as, bs) {
454
- const rx = /(\d+)|(\D+)/g, rd = /\d/, rz = /^0/;
455
- let a, a1, b, b1, nas = 0, nbs = 0;
456
- if (null !== bs && null === as) return -1;
457
- if (null !== as && null === bs) return 1;
458
- if ("number" == typeof as && isNaN(as)) return -1;
459
- if ("number" == typeof bs && isNaN(bs)) return 1;
460
- if (nas = +as, nbs = +bs, nas < nbs) return -1;
461
- if (nas > nbs) return 1;
462
- if ("number" == typeof as && "number" != typeof bs) return -1;
463
- if ("number" == typeof bs && "number" != typeof as) return 1;
464
- if ("number" == typeof as && "number" == typeof bs) return 0;
465
- if (isNaN(nbs) && !isNaN(nas)) return -1;
466
- if (isNaN(nas) && !isNaN(nbs)) return 1;
467
- if (a = String(as), b = String(bs), a === b) return 0;
468
- if (!rd.test(a) || !rd.test(b)) return a > b ? 1 : -1;
469
- for (a = a.match(rx), b = b.match(rx); a.length && b.length; ) if (a1 = a.shift(),
470
- b1 = b.shift(), a1 !== b1) return rd.test(a1) && rd.test(b1) ? a1.replace(rz, ".0") - b1.replace(rz, ".0") : a1 > b1 ? 1 : -1;
471
- return a.length - b.length;
472
- }
473
-
474
- function sortBy(order) {
475
- let x;
476
- const mapping = {}, lowercase_mapping = {};
477
- for (let i = 0; i < order.length; i++) x = order[i], mapping[x] = i, "string" == typeof x && (lowercase_mapping[x.toLowerCase()] = i);
478
- return function(a, b) {
479
- return null !== mapping[a] && void 0 !== mapping[a] && null !== mapping[b] && void 0 !== mapping[b] ? mapping[a] - mapping[b] : null !== mapping[a] && void 0 !== mapping[a] ? -1 : null !== mapping[b] && void 0 !== mapping[b] ? 1 : null !== lowercase_mapping[a] && void 0 !== mapping[a] && null !== lowercase_mapping[b] && void 0 !== mapping[b] ? lowercase_mapping[a] - lowercase_mapping[b] : null === lowercase_mapping[a] || void 0 === mapping[a] || null === lowercase_mapping[b] || void 0 === mapping[b] ? 0 : null !== lowercase_mapping[a] && void 0 !== mapping[a] ? -1 : null !== lowercase_mapping[b] && void 0 !== mapping[b] ? 1 : naturalSort(a, b);
480
- };
469
+ function arraySortByAnotherArray(array, sortArray) {
470
+ return array.sort(((a, b) => {
471
+ const aIndex = sortArray.indexOf(a), bIndex = sortArray.indexOf(b);
472
+ return aIndex < bIndex ? -1 : aIndex > bIndex ? 1 : 0;
473
+ }));
481
474
  }
482
475
  //# sourceMappingURL=dataset.js.map