@visactor/vtable 0.9.2 → 0.9.3-alpha.0

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