@visactor/vtable 0.9.2-alpha.3 → 0.9.2

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