@visactor/vtable 0.9.2 → 0.9.3-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (664) hide show
  1. package/README.md +15 -15
  2. package/cjs/ListTable.d.ts +2 -1
  3. package/cjs/ListTable.js +17 -13
  4. package/cjs/ListTable.js.map +1 -1
  5. package/cjs/PivotChart.d.ts +69 -0
  6. package/cjs/PivotChart.js +445 -0
  7. package/cjs/PivotChart.js.map +1 -0
  8. package/cjs/PivotTable.d.ts +2 -1
  9. package/cjs/PivotTable.js +18 -13
  10. package/cjs/PivotTable.js.map +1 -1
  11. package/cjs/body-helper/style/MultilineTextStyle.js +2 -2
  12. package/cjs/body-helper/style/MultilineTextStyle.js.map +1 -1
  13. package/cjs/body-helper/style/ProgressBarStyle.js +15 -15
  14. package/cjs/body-helper/style/ProgressBarStyle.js.map +1 -1
  15. package/cjs/body-helper/style/Style.d.ts +0 -1
  16. package/cjs/body-helper/style/Style.js +25 -28
  17. package/cjs/body-helper/style/Style.js.map +1 -1
  18. package/cjs/chartModule.js +14 -0
  19. package/cjs/chartModule.js.map +1 -0
  20. package/cjs/components/axis/axis.d.ts +45 -0
  21. package/cjs/components/axis/axis.js +146 -0
  22. package/cjs/components/axis/axis.js.map +1 -0
  23. package/cjs/components/axis/band-scale.d.ts +18 -0
  24. package/cjs/components/axis/band-scale.js +54 -0
  25. package/cjs/components/axis/band-scale.js.map +1 -0
  26. package/cjs/components/axis/get-axis-attributes.d.ts +136 -0
  27. package/cjs/components/axis/get-axis-attributes.js +169 -0
  28. package/cjs/components/axis/get-axis-attributes.js.map +1 -0
  29. package/cjs/components/axis/label-overlap.d.ts +3 -0
  30. package/cjs/components/axis/label-overlap.js +46 -0
  31. package/cjs/components/axis/label-overlap.js.map +1 -0
  32. package/cjs/components/axis/linear-scale.d.ts +45 -0
  33. package/cjs/components/axis/linear-scale.js +120 -0
  34. package/cjs/components/axis/linear-scale.js.map +1 -0
  35. package/cjs/components/legend/get-legend-attributes.d.ts +5 -0
  36. package/cjs/components/legend/get-legend-attributes.js +90 -0
  37. package/cjs/components/legend/get-legend-attributes.js.map +1 -0
  38. package/cjs/components/legend/legend.d.ts +23 -0
  39. package/cjs/components/legend/legend.js +94 -0
  40. package/cjs/components/legend/legend.js.map +1 -0
  41. package/{es → cjs/components}/menu/dom/BaseMenu.d.ts +2 -2
  42. package/cjs/components/menu/dom/BaseMenu.js.map +1 -0
  43. package/cjs/components/menu/dom/Menu.js.map +1 -0
  44. package/cjs/{menu → components/menu}/dom/MenuHandler.d.ts +2 -2
  45. package/cjs/{menu → components/menu}/dom/MenuHandler.js +1 -1
  46. package/cjs/components/menu/dom/MenuHandler.js.map +1 -0
  47. package/cjs/{menu → components/menu}/dom/logic/MenuContainer.d.ts +2 -2
  48. package/cjs/{menu → components/menu}/dom/logic/MenuContainer.js +2 -2
  49. package/cjs/components/menu/dom/logic/MenuContainer.js.map +1 -0
  50. package/cjs/{menu → components/menu}/dom/logic/MenuElement.d.ts +2 -2
  51. package/cjs/{menu → components/menu}/dom/logic/MenuElement.js +4 -4
  52. package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -0
  53. package/cjs/components/menu/dom/logic/MenuElementStyle.js.map +1 -0
  54. package/cjs/components/title/title.d.ts +12 -0
  55. package/cjs/components/title/title.js +66 -0
  56. package/cjs/components/title/title.js.map +1 -0
  57. package/{es → cjs/components}/tooltip/BaseTooltip.d.ts +3 -3
  58. package/cjs/components/tooltip/BaseTooltip.js.map +1 -0
  59. package/cjs/components/tooltip/Tooltip.js.map +1 -0
  60. package/cjs/{tooltip → components/tooltip}/TooltipHandler.d.ts +4 -4
  61. package/cjs/{tooltip → components/tooltip}/TooltipHandler.js +1 -1
  62. package/cjs/components/tooltip/TooltipHandler.js.map +1 -0
  63. package/{es → cjs/components}/tooltip/logic/BubbleTooltipElement.d.ts +4 -4
  64. package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElement.js +1 -1
  65. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -0
  66. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -0
  67. package/cjs/components/util/orient.d.ts +3 -0
  68. package/cjs/components/util/orient.js +14 -0
  69. package/cjs/components/util/orient.js.map +1 -0
  70. package/cjs/components/util/register.d.ts +3 -0
  71. package/cjs/components/util/register.js +15 -0
  72. package/cjs/components/util/register.js.map +1 -0
  73. package/cjs/components/util/tick-data/config.d.ts +1 -0
  74. package/cjs/components/util/tick-data/config.js +6 -0
  75. package/cjs/components/util/tick-data/config.js.map +1 -0
  76. package/cjs/components/util/tick-data/continuous.d.ts +2 -0
  77. package/cjs/components/util/tick-data/continuous.js +39 -0
  78. package/cjs/components/util/tick-data/continuous.js.map +1 -0
  79. package/cjs/components/util/tick-data/discrete/linear.d.ts +2 -0
  80. package/cjs/components/util/tick-data/discrete/linear.js +66 -0
  81. package/cjs/components/util/tick-data/discrete/linear.js.map +1 -0
  82. package/cjs/components/util/tick-data/discrete/polar-angle.d.ts +2 -0
  83. package/cjs/components/util/tick-data/discrete/polar-angle.js +46 -0
  84. package/cjs/components/util/tick-data/discrete/polar-angle.js.map +1 -0
  85. package/cjs/components/util/tick-data/index.d.ts +2 -0
  86. package/cjs/components/util/tick-data/index.js +17 -0
  87. package/cjs/components/util/tick-data/index.js.map +1 -0
  88. package/cjs/components/util/tick-data/util.d.ts +21 -0
  89. package/cjs/components/util/tick-data/util.js +115 -0
  90. package/cjs/components/util/tick-data/util.js.map +1 -0
  91. package/cjs/components/util/transform.d.ts +5 -0
  92. package/cjs/components/util/transform.js +45 -0
  93. package/cjs/components/util/transform.js.map +1 -0
  94. package/cjs/core/BaseTable.d.ts +18 -5
  95. package/cjs/core/BaseTable.js +115 -41
  96. package/cjs/core/BaseTable.js.map +1 -1
  97. package/cjs/core/TABLE_EVENT_TYPE.d.ts +5 -0
  98. package/cjs/core/TABLE_EVENT_TYPE.js +6 -1
  99. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  100. package/cjs/core/style.js +1 -1
  101. package/cjs/core/style.js.map +1 -1
  102. package/cjs/core/tableHelper.js +1 -2
  103. package/cjs/data/CachedDataSource.js +2 -1
  104. package/cjs/data/DataSource.js +2 -2
  105. package/cjs/data/DataSource.js.map +1 -1
  106. package/cjs/dataset/dataset-pivot-table.d.ts +60 -0
  107. package/cjs/dataset/dataset-pivot-table.js +387 -0
  108. package/cjs/dataset/dataset-pivot-table.js.map +1 -0
  109. package/cjs/dataset/dataset.d.ts +15 -19
  110. package/cjs/dataset/dataset.js +191 -200
  111. package/cjs/dataset/dataset.js.map +1 -1
  112. package/cjs/dataset/statistics-helper.d.ts +67 -0
  113. package/cjs/dataset/statistics-helper.js +173 -0
  114. package/cjs/dataset/statistics-helper.js.map +1 -0
  115. package/cjs/dataset/util/zero-align.d.ts +10 -0
  116. package/cjs/dataset/util/zero-align.js +119 -0
  117. package/cjs/dataset/util/zero-align.js.map +1 -0
  118. package/cjs/event/EventHandler.js.map +1 -1
  119. package/cjs/event/EventTarget.d.ts +5 -5
  120. package/cjs/event/EventTarget.js +2 -2
  121. package/cjs/event/EventTarget.js.map +1 -1
  122. package/cjs/event/VChartEventProxy.d.ts +1 -0
  123. package/cjs/event/VChartEventProxy.js +1 -0
  124. package/cjs/event/VChartEventProxy.js.map +1 -0
  125. package/cjs/event/event.js +7 -4
  126. package/cjs/event/event.js.map +1 -1
  127. package/cjs/event/listener/table-group.js +8 -6
  128. package/cjs/event/listener/table-group.js.map +1 -1
  129. package/cjs/event/pivot-chart/axis-click.d.ts +2 -0
  130. package/cjs/event/pivot-chart/axis-click.js +42 -0
  131. package/cjs/event/pivot-chart/axis-click.js.map +1 -0
  132. package/cjs/event/pivot-chart/axis-hover.d.ts +2 -0
  133. package/cjs/event/pivot-chart/axis-hover.js +41 -0
  134. package/cjs/event/pivot-chart/axis-hover.js.map +1 -0
  135. package/cjs/event/scroll.js +4 -3
  136. package/cjs/event/scroll.js.map +1 -1
  137. package/cjs/event/sparkline-event.js +1 -2
  138. package/cjs/event/sparkline-event.js.map +1 -1
  139. package/cjs/header-helper/header-helper.js +1 -1
  140. package/cjs/header-helper/header-helper.js.map +1 -1
  141. package/cjs/header-helper/style/MultilineTextHeaderStyle.js +2 -2
  142. package/cjs/header-helper/style/MultilineTextHeaderStyle.js.map +1 -1
  143. package/cjs/header-helper/style/Style.d.ts +0 -1
  144. package/cjs/header-helper/style/Style.js +25 -28
  145. package/cjs/header-helper/style/Style.js.map +1 -1
  146. package/cjs/index.d.ts +4 -3
  147. package/cjs/index.js +11 -2
  148. package/cjs/index.js.map +1 -1
  149. package/cjs/layout/chart-helper/get-axis-config.d.ts +2 -0
  150. package/cjs/layout/chart-helper/get-axis-config.js +128 -0
  151. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -0
  152. package/cjs/layout/chart-helper/get-chart-spec.d.ts +7 -0
  153. package/cjs/layout/chart-helper/get-chart-spec.js +141 -0
  154. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -0
  155. package/cjs/layout/index.js +2 -1
  156. package/cjs/layout/pivot-header-layout.d.ts +13 -5
  157. package/cjs/layout/pivot-header-layout.js +50 -14
  158. package/cjs/layout/pivot-header-layout.js.map +1 -1
  159. package/cjs/layout/pivot-layout.d.ts +55 -8
  160. package/cjs/layout/pivot-layout.js +406 -92
  161. package/cjs/layout/pivot-layout.js.map +1 -1
  162. package/cjs/layout/simple-header-layout.d.ts +10 -0
  163. package/cjs/layout/simple-header-layout.js +43 -2
  164. package/cjs/layout/simple-header-layout.js.map +1 -1
  165. package/cjs/plugins/{chartTypes.js → chartModules.js} +1 -1
  166. package/cjs/plugins/chartModules.js.map +1 -0
  167. package/cjs/register.d.ts +1 -1
  168. package/cjs/register.js +6 -6
  169. package/cjs/register.js.map +1 -1
  170. package/cjs/render/layout/text.d.ts +33 -4
  171. package/cjs/render/layout/text.js +9 -3
  172. package/cjs/render/layout/text.js.map +1 -1
  173. package/cjs/scenegraph/component/custom.js +17 -16
  174. package/cjs/scenegraph/component/custom.js.map +1 -1
  175. package/cjs/scenegraph/component/menu.d.ts +41 -0
  176. package/cjs/scenegraph/component/table-component.js +3 -3
  177. package/cjs/scenegraph/component/table-component.js.map +1 -1
  178. package/cjs/scenegraph/graphic/chart.d.ts +4 -1
  179. package/cjs/scenegraph/graphic/chart.js +29 -17
  180. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  181. package/cjs/scenegraph/graphic/contributions/chart-render.js +22 -3
  182. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  183. package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +9 -9
  184. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +48 -29
  185. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  186. package/cjs/scenegraph/graphic/contributions/image-contribution-render.d.ts +3 -3
  187. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js +2 -2
  188. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  189. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +3 -3
  190. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +2 -2
  191. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  192. package/cjs/scenegraph/graphic/text.d.ts +15 -0
  193. package/cjs/scenegraph/group-creater/cell-helper.js +9 -3
  194. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  195. package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
  196. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +6 -5
  197. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  198. package/cjs/scenegraph/group-creater/column-helper.js +1 -1
  199. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  200. package/cjs/scenegraph/group-creater/column.js.map +1 -1
  201. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.d.ts +3 -0
  202. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +71 -0
  203. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -0
  204. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +2 -2
  205. package/cjs/scenegraph/group-creater/progress/proxy.js +45 -55
  206. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  207. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +1 -0
  208. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +60 -26
  209. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  210. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +1 -0
  211. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +94 -40
  212. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  213. package/cjs/scenegraph/layout/compute-col-width.js +23 -15
  214. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  215. package/cjs/scenegraph/layout/compute-row-height.js +20 -9
  216. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  217. package/cjs/scenegraph/layout/move-cell.js +1 -1
  218. package/cjs/scenegraph/layout/move-cell.js.map +1 -1
  219. package/cjs/scenegraph/layout/update-cell.js +3 -2
  220. package/cjs/scenegraph/layout/update-cell.js.map +1 -1
  221. package/cjs/scenegraph/layout/update-height.js +1 -1
  222. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  223. package/cjs/scenegraph/layout/update-row.js +1 -1
  224. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  225. package/cjs/scenegraph/layout/update-width.js +34 -3
  226. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  227. package/cjs/scenegraph/refresh-node/update-chart.d.ts +3 -0
  228. package/cjs/scenegraph/refresh-node/update-chart.js +76 -7
  229. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  230. package/cjs/scenegraph/scenegraph.d.ts +8 -0
  231. package/cjs/scenegraph/scenegraph.js +118 -21
  232. package/cjs/scenegraph/scenegraph.js.map +1 -1
  233. package/cjs/scenegraph/stick-text/index.js +10 -8
  234. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  235. package/cjs/scenegraph/style/corner-cell.d.ts +3 -0
  236. package/cjs/scenegraph/style/corner-cell.js +29 -0
  237. package/cjs/scenegraph/style/corner-cell.js.map +1 -0
  238. package/cjs/scenegraph/style/frame-border.d.ts +1 -0
  239. package/cjs/scenegraph/style/frame-border.js +3 -7
  240. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  241. package/cjs/scenegraph/utils/get-cell-merge.js +2 -1
  242. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  243. package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
  244. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  245. package/cjs/state/state.js +1 -1
  246. package/cjs/state/state.js.map +1 -1
  247. package/cjs/themes/DARK.js +1 -2
  248. package/cjs/themes/theme.d.ts +10 -0
  249. package/cjs/themes/theme.js +50 -4
  250. package/cjs/themes/theme.js.map +1 -1
  251. package/cjs/tools/LimitPromiseQueue.js +2 -1
  252. package/cjs/tools/calc.d.ts +3 -0
  253. package/cjs/tools/calc.js +11 -3
  254. package/cjs/tools/calc.js.map +1 -1
  255. package/cjs/tools/debounce.js +1 -1
  256. package/cjs/tools/diff-cell.js +2 -2
  257. package/cjs/tools/dom.js +1 -1
  258. package/cjs/tools/env.js +1 -1
  259. package/cjs/ts-types/base-table.d.ts +29 -12
  260. package/cjs/ts-types/base-table.js.map +1 -1
  261. package/cjs/ts-types/column/style.d.ts +0 -1
  262. package/cjs/ts-types/column/style.js.map +1 -1
  263. package/cjs/ts-types/component/axis.d.ts +12 -0
  264. package/cjs/ts-types/component/axis.js +6 -0
  265. package/cjs/ts-types/component/axis.js.map +1 -0
  266. package/cjs/ts-types/component/legend.d.ts +5 -0
  267. package/cjs/ts-types/component/legend.js +6 -0
  268. package/cjs/ts-types/component/legend.js.map +1 -0
  269. package/cjs/ts-types/component/title.d.ts +47 -0
  270. package/cjs/ts-types/component/title.js +6 -0
  271. package/cjs/ts-types/component/title.js.map +1 -0
  272. package/cjs/ts-types/component/util.d.ts +1 -0
  273. package/cjs/ts-types/component/util.js +6 -0
  274. package/cjs/ts-types/component/util.js.map +1 -0
  275. package/cjs/ts-types/customElement.d.ts +2 -0
  276. package/cjs/ts-types/customElement.js.map +1 -1
  277. package/cjs/ts-types/events.d.ts +108 -83
  278. package/cjs/ts-types/events.js.map +1 -1
  279. package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
  280. package/cjs/ts-types/list-table/define/chart-define.d.ts +1 -1
  281. package/cjs/ts-types/list-table/define/chart-define.js.map +1 -1
  282. package/cjs/ts-types/list-table/layout-map/api.d.ts +4 -2
  283. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  284. package/cjs/ts-types/new-data-set.d.ts +21 -7
  285. package/cjs/ts-types/new-data-set.js +2 -2
  286. package/cjs/ts-types/new-data-set.js.map +1 -1
  287. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +4 -0
  288. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +3 -1
  289. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -1
  290. package/cjs/ts-types/pivot-table/corner.d.ts +3 -3
  291. package/cjs/ts-types/pivot-table/corner.js.map +1 -1
  292. package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  293. package/cjs/ts-types/pivot-table/indicator/chart-indicator.d.ts +1 -1
  294. package/cjs/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -1
  295. package/cjs/ts-types/pivot-table/indicator/index.d.ts +1 -0
  296. package/cjs/ts-types/pivot-table/indicator/index.js.map +1 -1
  297. package/cjs/ts-types/pivot-table/title.d.ts +1 -1
  298. package/cjs/ts-types/pivot-table/title.js.map +1 -1
  299. package/cjs/ts-types/table-engine.d.ts +27 -3
  300. package/cjs/ts-types/table-engine.js.map +1 -1
  301. package/cjs/ts-types/theme.d.ts +5 -0
  302. package/cjs/ts-types/theme.js.map +1 -1
  303. package/dist/vtable.js +37485 -24091
  304. package/dist/vtable.min.js +4 -2
  305. package/es/ListTable.d.ts +2 -1
  306. package/es/ListTable.js +17 -13
  307. package/es/ListTable.js.map +1 -1
  308. package/es/PivotChart.d.ts +69 -0
  309. package/es/PivotChart.js +455 -0
  310. package/es/PivotChart.js.map +1 -0
  311. package/es/PivotTable.d.ts +2 -1
  312. package/es/PivotTable.js +19 -14
  313. package/es/PivotTable.js.map +1 -1
  314. package/es/body-helper/style/MultilineTextStyle.js +2 -2
  315. package/es/body-helper/style/MultilineTextStyle.js.map +1 -1
  316. package/es/body-helper/style/ProgressBarStyle.js +15 -15
  317. package/es/body-helper/style/ProgressBarStyle.js.map +1 -1
  318. package/es/body-helper/style/Style.d.ts +0 -1
  319. package/es/body-helper/style/Style.js +25 -28
  320. package/es/body-helper/style/Style.js.map +1 -1
  321. package/es/{chartType.js → chartModule.js} +2 -2
  322. package/es/chartModule.js.map +1 -0
  323. package/es/components/axis/axis.d.ts +45 -0
  324. package/es/components/axis/axis.js +155 -0
  325. package/es/components/axis/axis.js.map +1 -0
  326. package/es/components/axis/band-scale.d.ts +18 -0
  327. package/es/components/axis/band-scale.js +46 -0
  328. package/es/components/axis/band-scale.js.map +1 -0
  329. package/es/components/axis/get-axis-attributes.d.ts +136 -0
  330. package/es/components/axis/get-axis-attributes.js +166 -0
  331. package/es/components/axis/get-axis-attributes.js.map +1 -0
  332. package/es/components/axis/label-overlap.d.ts +3 -0
  333. package/es/components/axis/label-overlap.js +39 -0
  334. package/es/components/axis/label-overlap.js.map +1 -0
  335. package/es/components/axis/linear-scale.d.ts +45 -0
  336. package/es/components/axis/linear-scale.js +104 -0
  337. package/es/components/axis/linear-scale.js.map +1 -0
  338. package/es/components/legend/get-legend-attributes.d.ts +5 -0
  339. package/es/components/legend/get-legend-attributes.js +84 -0
  340. package/es/components/legend/get-legend-attributes.js.map +1 -0
  341. package/es/components/legend/legend.d.ts +23 -0
  342. package/es/components/legend/legend.js +93 -0
  343. package/es/components/legend/legend.js.map +1 -0
  344. package/{cjs → es/components}/menu/dom/BaseMenu.d.ts +2 -2
  345. package/es/components/menu/dom/BaseMenu.js.map +1 -0
  346. package/es/components/menu/dom/Menu.js.map +1 -0
  347. package/es/{menu → components/menu}/dom/MenuHandler.d.ts +2 -2
  348. package/es/{menu → components/menu}/dom/MenuHandler.js +2 -2
  349. package/es/components/menu/dom/MenuHandler.js.map +1 -0
  350. package/es/{menu → components/menu}/dom/logic/MenuContainer.d.ts +2 -2
  351. package/es/{menu → components/menu}/dom/logic/MenuContainer.js +4 -4
  352. package/es/components/menu/dom/logic/MenuContainer.js.map +1 -0
  353. package/es/{menu → components/menu}/dom/logic/MenuElement.d.ts +2 -2
  354. package/es/{menu → components/menu}/dom/logic/MenuElement.js +9 -9
  355. package/es/components/menu/dom/logic/MenuElement.js.map +1 -0
  356. package/es/components/menu/dom/logic/MenuElementStyle.js.map +1 -0
  357. package/es/components/title/title.d.ts +12 -0
  358. package/es/components/title/title.js +61 -0
  359. package/es/components/title/title.js.map +1 -0
  360. package/{cjs → es/components}/tooltip/BaseTooltip.d.ts +3 -3
  361. package/es/components/tooltip/BaseTooltip.js.map +1 -0
  362. package/es/components/tooltip/Tooltip.js.map +1 -0
  363. package/es/{tooltip → components/tooltip}/TooltipHandler.d.ts +4 -4
  364. package/es/{tooltip → components/tooltip}/TooltipHandler.js +4 -4
  365. package/es/components/tooltip/TooltipHandler.js.map +1 -0
  366. package/{cjs → es/components}/tooltip/logic/BubbleTooltipElement.d.ts +4 -4
  367. package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElement.js +4 -4
  368. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -0
  369. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -0
  370. package/es/components/util/orient.d.ts +3 -0
  371. package/es/components/util/orient.js +8 -0
  372. package/es/components/util/orient.js.map +1 -0
  373. package/es/components/util/register.d.ts +3 -0
  374. package/es/components/util/register.js +8 -0
  375. package/es/components/util/register.js.map +1 -0
  376. package/es/components/util/tick-data/config.d.ts +1 -0
  377. package/es/components/util/tick-data/config.js +2 -0
  378. package/es/components/util/tick-data/config.js.map +1 -0
  379. package/es/components/util/tick-data/continuous.d.ts +2 -0
  380. package/es/components/util/tick-data/continuous.js +38 -0
  381. package/es/components/util/tick-data/continuous.js.map +1 -0
  382. package/es/components/util/tick-data/discrete/linear.d.ts +2 -0
  383. package/es/components/util/tick-data/discrete/linear.js +59 -0
  384. package/es/components/util/tick-data/discrete/linear.js.map +1 -0
  385. package/es/components/util/tick-data/discrete/polar-angle.d.ts +2 -0
  386. package/es/components/util/tick-data/discrete/polar-angle.js +39 -0
  387. package/es/components/util/tick-data/discrete/polar-angle.js.map +1 -0
  388. package/es/components/util/tick-data/index.d.ts +2 -0
  389. package/es/components/util/tick-data/index.js +19 -0
  390. package/es/components/util/tick-data/index.js.map +1 -0
  391. package/es/components/util/tick-data/util.d.ts +21 -0
  392. package/es/components/util/tick-data/util.js +104 -0
  393. package/es/components/util/tick-data/util.js.map +1 -0
  394. package/es/components/util/transform.d.ts +5 -0
  395. package/es/components/util/transform.js +34 -0
  396. package/es/components/util/transform.js.map +1 -0
  397. package/es/core/BaseTable.d.ts +18 -5
  398. package/es/core/BaseTable.js +119 -43
  399. package/es/core/BaseTable.js.map +1 -1
  400. package/es/core/TABLE_EVENT_TYPE.d.ts +5 -0
  401. package/es/core/TABLE_EVENT_TYPE.js +6 -1
  402. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  403. package/es/core/style.js +1 -1
  404. package/es/core/style.js.map +1 -1
  405. package/es/core/tableHelper.js +1 -2
  406. package/es/data/CachedDataSource.js +2 -1
  407. package/es/data/DataSource.js +2 -2
  408. package/es/data/DataSource.js.map +1 -1
  409. package/es/dataset/dataset-pivot-table.d.ts +60 -0
  410. package/es/dataset/dataset-pivot-table.js +378 -0
  411. package/es/dataset/dataset-pivot-table.js.map +1 -0
  412. package/es/dataset/dataset.d.ts +15 -19
  413. package/es/dataset/dataset.js +183 -190
  414. package/es/dataset/dataset.js.map +1 -1
  415. package/es/dataset/statistics-helper.d.ts +67 -0
  416. package/es/dataset/statistics-helper.js +152 -0
  417. package/es/dataset/statistics-helper.js.map +1 -0
  418. package/es/dataset/util/zero-align.d.ts +10 -0
  419. package/es/dataset/util/zero-align.js +111 -0
  420. package/es/dataset/util/zero-align.js.map +1 -0
  421. package/es/event/EventHandler.js.map +1 -1
  422. package/es/event/EventTarget.d.ts +5 -5
  423. package/es/event/EventTarget.js +2 -2
  424. package/es/event/EventTarget.js.map +1 -1
  425. package/es/event/VChartEventProxy.d.ts +1 -0
  426. package/es/event/VChartEventProxy.js +1 -0
  427. package/es/event/VChartEventProxy.js.map +1 -0
  428. package/es/event/event.js +10 -3
  429. package/es/event/event.js.map +1 -1
  430. package/es/event/listener/table-group.js +8 -6
  431. package/es/event/listener/table-group.js.map +1 -1
  432. package/es/event/pivot-chart/axis-click.d.ts +2 -0
  433. package/es/event/pivot-chart/axis-click.js +36 -0
  434. package/es/event/pivot-chart/axis-click.js.map +1 -0
  435. package/es/event/pivot-chart/axis-hover.d.ts +2 -0
  436. package/es/event/pivot-chart/axis-hover.js +33 -0
  437. package/es/event/pivot-chart/axis-hover.js.map +1 -0
  438. package/es/event/scroll.js +4 -3
  439. package/es/event/scroll.js.map +1 -1
  440. package/es/event/sparkline-event.js +1 -2
  441. package/es/event/sparkline-event.js.map +1 -1
  442. package/es/header-helper/header-helper.js +1 -1
  443. package/es/header-helper/header-helper.js.map +1 -1
  444. package/es/header-helper/style/MultilineTextHeaderStyle.js +2 -2
  445. package/es/header-helper/style/MultilineTextHeaderStyle.js.map +1 -1
  446. package/es/header-helper/style/Style.d.ts +0 -1
  447. package/es/header-helper/style/Style.js +25 -28
  448. package/es/header-helper/style/Style.js.map +1 -1
  449. package/es/index.d.ts +4 -3
  450. package/es/index.js +4 -2
  451. package/es/index.js.map +1 -1
  452. package/es/layout/chart-helper/get-axis-config.d.ts +2 -0
  453. package/es/layout/chart-helper/get-axis-config.js +120 -0
  454. package/es/layout/chart-helper/get-axis-config.js.map +1 -0
  455. package/es/layout/chart-helper/get-chart-spec.d.ts +7 -0
  456. package/es/layout/chart-helper/get-chart-spec.js +132 -0
  457. package/es/layout/chart-helper/get-chart-spec.js.map +1 -0
  458. package/es/layout/index.js +2 -1
  459. package/es/layout/pivot-header-layout.d.ts +13 -5
  460. package/es/layout/pivot-header-layout.js +50 -12
  461. package/es/layout/pivot-header-layout.js.map +1 -1
  462. package/es/layout/pivot-layout.d.ts +55 -8
  463. package/es/layout/pivot-layout.js +409 -90
  464. package/es/layout/pivot-layout.js.map +1 -1
  465. package/es/layout/simple-header-layout.d.ts +10 -0
  466. package/es/layout/simple-header-layout.js +44 -1
  467. package/es/layout/simple-header-layout.js.map +1 -1
  468. package/es/plugins/chartModules.js +2 -0
  469. package/es/plugins/chartModules.js.map +1 -0
  470. package/es/register.d.ts +1 -1
  471. package/es/register.js +3 -3
  472. package/es/register.js.map +1 -1
  473. package/es/render/layout/text.d.ts +33 -4
  474. package/es/render/layout/text.js +9 -3
  475. package/es/render/layout/text.js.map +1 -1
  476. package/es/scenegraph/component/custom.js +17 -16
  477. package/es/scenegraph/component/custom.js.map +1 -1
  478. package/es/scenegraph/component/menu.d.ts +41 -0
  479. package/es/scenegraph/component/table-component.js +3 -3
  480. package/es/scenegraph/component/table-component.js.map +1 -1
  481. package/es/scenegraph/graphic/chart.d.ts +4 -1
  482. package/es/scenegraph/graphic/chart.js +29 -15
  483. package/es/scenegraph/graphic/chart.js.map +1 -1
  484. package/es/scenegraph/graphic/contributions/chart-render.js +22 -3
  485. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  486. package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +9 -9
  487. package/es/scenegraph/graphic/contributions/group-contribution-render.js +48 -29
  488. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  489. package/es/scenegraph/graphic/contributions/image-contribution-render.d.ts +3 -3
  490. package/es/scenegraph/graphic/contributions/image-contribution-render.js +2 -2
  491. package/es/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  492. package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +3 -3
  493. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +2 -2
  494. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  495. package/es/scenegraph/graphic/text.d.ts +15 -0
  496. package/es/scenegraph/group-creater/cell-helper.js +10 -2
  497. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  498. package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
  499. package/es/scenegraph/group-creater/cell-type/chart-cell.js +6 -5
  500. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  501. package/es/scenegraph/group-creater/column-helper.js +1 -1
  502. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  503. package/es/scenegraph/group-creater/column.js.map +1 -1
  504. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.d.ts +3 -0
  505. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +65 -0
  506. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -0
  507. package/es/scenegraph/group-creater/progress/proxy.d.ts +2 -2
  508. package/es/scenegraph/group-creater/progress/proxy.js +42 -55
  509. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  510. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +1 -0
  511. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +59 -23
  512. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  513. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +1 -0
  514. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +94 -37
  515. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  516. package/es/scenegraph/layout/compute-col-width.js +23 -15
  517. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  518. package/es/scenegraph/layout/compute-row-height.js +20 -9
  519. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  520. package/es/scenegraph/layout/move-cell.js +1 -1
  521. package/es/scenegraph/layout/move-cell.js.map +1 -1
  522. package/es/scenegraph/layout/update-cell.js +3 -1
  523. package/es/scenegraph/layout/update-cell.js.map +1 -1
  524. package/es/scenegraph/layout/update-height.js +1 -1
  525. package/es/scenegraph/layout/update-height.js.map +1 -1
  526. package/es/scenegraph/layout/update-row.js +1 -1
  527. package/es/scenegraph/layout/update-row.js.map +1 -1
  528. package/es/scenegraph/layout/update-width.js +35 -2
  529. package/es/scenegraph/layout/update-width.js.map +1 -1
  530. package/es/scenegraph/refresh-node/update-chart.d.ts +3 -0
  531. package/es/scenegraph/refresh-node/update-chart.js +70 -4
  532. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  533. package/es/scenegraph/scenegraph.d.ts +8 -0
  534. package/es/scenegraph/scenegraph.js +120 -21
  535. package/es/scenegraph/scenegraph.js.map +1 -1
  536. package/es/scenegraph/stick-text/index.js +10 -8
  537. package/es/scenegraph/stick-text/index.js.map +1 -1
  538. package/es/scenegraph/style/corner-cell.d.ts +3 -0
  539. package/es/scenegraph/style/corner-cell.js +25 -0
  540. package/es/scenegraph/style/corner-cell.js.map +1 -0
  541. package/es/scenegraph/style/frame-border.d.ts +1 -0
  542. package/es/scenegraph/style/frame-border.js +2 -6
  543. package/es/scenegraph/style/frame-border.js.map +1 -1
  544. package/es/scenegraph/utils/get-cell-merge.js +2 -1
  545. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  546. package/es/scenegraph/utils/text-icon-layout.js +1 -1
  547. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  548. package/es/state/state.js +1 -1
  549. package/es/state/state.js.map +1 -1
  550. package/es/themes/DARK.js +1 -2
  551. package/es/themes/theme.d.ts +10 -0
  552. package/es/themes/theme.js +50 -4
  553. package/es/themes/theme.js.map +1 -1
  554. package/es/tools/LimitPromiseQueue.js +2 -1
  555. package/es/tools/calc.d.ts +3 -0
  556. package/es/tools/calc.js +10 -0
  557. package/es/tools/calc.js.map +1 -1
  558. package/es/tools/debounce.js +1 -1
  559. package/es/tools/diff-cell.js +1 -1
  560. package/es/tools/dom.js +1 -1
  561. package/es/tools/env.js +1 -1
  562. package/es/ts-types/base-table.d.ts +29 -12
  563. package/es/ts-types/base-table.js.map +1 -1
  564. package/es/ts-types/column/style.d.ts +0 -1
  565. package/es/ts-types/column/style.js.map +1 -1
  566. package/es/ts-types/component/axis.d.ts +12 -0
  567. package/es/ts-types/component/axis.js +2 -0
  568. package/es/ts-types/component/axis.js.map +1 -0
  569. package/es/ts-types/component/legend.d.ts +5 -0
  570. package/es/ts-types/component/legend.js +2 -0
  571. package/es/ts-types/component/legend.js.map +1 -0
  572. package/es/ts-types/component/title.d.ts +47 -0
  573. package/es/ts-types/component/title.js +2 -0
  574. package/es/ts-types/component/title.js.map +1 -0
  575. package/es/ts-types/component/util.d.ts +1 -0
  576. package/es/ts-types/component/util.js +2 -0
  577. package/es/ts-types/component/util.js.map +1 -0
  578. package/es/ts-types/customElement.d.ts +2 -0
  579. package/es/ts-types/customElement.js.map +1 -1
  580. package/es/ts-types/events.d.ts +108 -83
  581. package/es/ts-types/events.js.map +1 -1
  582. package/es/ts-types/list-table/define/basic-define.js.map +1 -1
  583. package/es/ts-types/list-table/define/chart-define.d.ts +1 -1
  584. package/es/ts-types/list-table/define/chart-define.js.map +1 -1
  585. package/es/ts-types/list-table/layout-map/api.d.ts +4 -2
  586. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  587. package/es/ts-types/new-data-set.d.ts +21 -7
  588. package/es/ts-types/new-data-set.js +2 -2
  589. package/es/ts-types/new-data-set.js.map +1 -1
  590. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +4 -0
  591. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +4 -0
  592. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -1
  593. package/es/ts-types/pivot-table/corner.d.ts +3 -3
  594. package/es/ts-types/pivot-table/corner.js.map +1 -1
  595. package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  596. package/es/ts-types/pivot-table/indicator/chart-indicator.d.ts +1 -1
  597. package/es/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -1
  598. package/es/ts-types/pivot-table/indicator/index.d.ts +1 -0
  599. package/es/ts-types/pivot-table/indicator/index.js.map +1 -1
  600. package/es/ts-types/pivot-table/title.d.ts +1 -1
  601. package/es/ts-types/pivot-table/title.js.map +1 -1
  602. package/es/ts-types/table-engine.d.ts +27 -3
  603. package/es/ts-types/table-engine.js.map +1 -1
  604. package/es/ts-types/theme.d.ts +5 -0
  605. package/es/ts-types/theme.js.map +1 -1
  606. package/package.json +14 -8
  607. package/cjs/chartType.js +0 -14
  608. package/cjs/chartType.js.map +0 -1
  609. package/cjs/menu/dom/BaseMenu.js.map +0 -1
  610. package/cjs/menu/dom/Menu.js.map +0 -1
  611. package/cjs/menu/dom/MenuHandler.js.map +0 -1
  612. package/cjs/menu/dom/logic/MenuContainer.js.map +0 -1
  613. package/cjs/menu/dom/logic/MenuElement.js.map +0 -1
  614. package/cjs/menu/dom/logic/MenuElementStyle.js.map +0 -1
  615. package/cjs/plugins/chartTypes.js.map +0 -1
  616. package/cjs/scenegraph/layout/auto-width.d.ts +0 -2
  617. package/cjs/scenegraph/layout/auto-width.js +0 -85
  618. package/cjs/scenegraph/layout/auto-width.js.map +0 -1
  619. package/cjs/tooltip/BaseTooltip.js.map +0 -1
  620. package/cjs/tooltip/Tooltip.js.map +0 -1
  621. package/cjs/tooltip/TooltipHandler.js.map +0 -1
  622. package/cjs/tooltip/logic/BubbleTooltipElement.js.map +0 -1
  623. package/cjs/tooltip/logic/BubbleTooltipElementStyle.js.map +0 -1
  624. package/es/chartType.js.map +0 -1
  625. package/es/menu/dom/BaseMenu.js.map +0 -1
  626. package/es/menu/dom/Menu.js.map +0 -1
  627. package/es/menu/dom/MenuHandler.js.map +0 -1
  628. package/es/menu/dom/logic/MenuContainer.js.map +0 -1
  629. package/es/menu/dom/logic/MenuElement.js.map +0 -1
  630. package/es/menu/dom/logic/MenuElementStyle.js.map +0 -1
  631. package/es/plugins/chartTypes.js +0 -2
  632. package/es/plugins/chartTypes.js.map +0 -1
  633. package/es/scenegraph/layout/auto-width.d.ts +0 -2
  634. package/es/scenegraph/layout/auto-width.js +0 -82
  635. package/es/scenegraph/layout/auto-width.js.map +0 -1
  636. package/es/tooltip/BaseTooltip.js.map +0 -1
  637. package/es/tooltip/Tooltip.js.map +0 -1
  638. package/es/tooltip/TooltipHandler.js.map +0 -1
  639. package/es/tooltip/logic/BubbleTooltipElement.js.map +0 -1
  640. package/es/tooltip/logic/BubbleTooltipElementStyle.js.map +0 -1
  641. /package/cjs/{chartType.d.ts → chartModule.d.ts} +0 -0
  642. /package/cjs/{menu → components/menu}/dom/BaseMenu.js +0 -0
  643. /package/cjs/{menu → components/menu}/dom/Menu.d.ts +0 -0
  644. /package/cjs/{menu → components/menu}/dom/Menu.js +0 -0
  645. /package/cjs/{menu → components/menu}/dom/logic/MenuElementStyle.d.ts +0 -0
  646. /package/cjs/{menu → components/menu}/dom/logic/MenuElementStyle.js +0 -0
  647. /package/cjs/{tooltip → components/tooltip}/BaseTooltip.js +0 -0
  648. /package/cjs/{tooltip → components/tooltip}/Tooltip.d.ts +0 -0
  649. /package/cjs/{tooltip → components/tooltip}/Tooltip.js +0 -0
  650. /package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.d.ts +0 -0
  651. /package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.js +0 -0
  652. /package/cjs/plugins/{chartTypes.d.ts → chartModules.d.ts} +0 -0
  653. /package/es/{chartType.d.ts → chartModule.d.ts} +0 -0
  654. /package/es/{menu → components/menu}/dom/BaseMenu.js +0 -0
  655. /package/es/{menu → components/menu}/dom/Menu.d.ts +0 -0
  656. /package/es/{menu → components/menu}/dom/Menu.js +0 -0
  657. /package/es/{menu → components/menu}/dom/logic/MenuElementStyle.d.ts +0 -0
  658. /package/es/{menu → components/menu}/dom/logic/MenuElementStyle.js +0 -0
  659. /package/es/{tooltip → components/tooltip}/BaseTooltip.js +0 -0
  660. /package/es/{tooltip → components/tooltip}/Tooltip.d.ts +0 -0
  661. /package/es/{tooltip → components/tooltip}/Tooltip.js +0 -0
  662. /package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.d.ts +0 -0
  663. /package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.js +0 -0
  664. /package/es/plugins/{chartTypes.d.ts → chartModules.d.ts} +0 -0
@@ -2,35 +2,148 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.PivoLayoutMap = void 0;
5
+ }), exports.PivotLayoutMap = void 0;
6
6
 
7
- const util_1 = require("../tools/util"), global_1 = require("../tools/global");
7
+ const util_1 = require("../tools/util"), global_1 = require("../tools/global"), get_axis_config_1 = require("./chart-helper/get-axis-config"), get_chart_spec_1 = require("./chart-helper/get-chart-spec"), EMPTY_HEADER = {
8
+ isEmpty: !0,
9
+ id: void 0,
10
+ field: void 0,
11
+ headerType: void 0,
12
+ define: void 0
13
+ };
8
14
 
9
- class PivoLayoutMap {
15
+ class PivotLayoutMap {
10
16
  constructor(table, dataset) {
11
- var _a, _b, _c, _d, _e, _f;
17
+ var _a, _b, _c, _d, _e, _f, _g, _h;
12
18
  this._headerObjects = [], this._headerObjectMap = {}, this._indicatorObjects = [],
13
- this._showRowHeader = !0, this._showColumnHeader = !0, this._indicatorShowType = "column",
14
- this.indicatorsAsCol = !0, this.hideIndicatorName = !1, this._table = table, this.rowsDefine = null !== (_a = table.options.rows) && void 0 !== _a ? _a : [],
19
+ this._columnWidths = [], this._showRowHeader = !0, this._showColumnHeader = !0,
20
+ this._indicatorShowType = "column", this.indicatorsAsCol = !0, this.hideIndicatorName = !1,
21
+ this.indicatorDimensionKey = global_1.IndicatorDimensionKeyPlaceholder, this._table = table,
22
+ this._chartItemSpanSize = 0, this.rowTree = table.options.rowTree, this.columnTree = table.options.columnTree,
23
+ this.rowsDefine = null !== (_a = table.options.rows) && void 0 !== _a ? _a : [],
15
24
  this.columnsDefine = null !== (_b = table.options.columns) && void 0 !== _b ? _b : [],
16
25
  this.indicatorsDefine = null !== (_c = table.options.indicators) && void 0 !== _c ? _c : [],
17
26
  this.indicatorTitle = table.options.indicatorTitle, this.dataset = dataset, this.dataConfig = dataset.dataConfig,
18
- this.indicators = dataset.indicators, this.indicatorsAsCol = null === (_d = table.options.indicatorsAsCol) || void 0 === _d || _d,
27
+ this.indicatorKeys = dataset.indicatorKeys, this.indicatorsAsCol = null === (_d = table.options.indicatorsAsCol) || void 0 === _d || _d,
19
28
  this.hideIndicatorName = null !== (_e = table.options.hideIndicatorName) && void 0 !== _e && _e,
20
- this.indicatorDimensionKey = global_1.IndicatorDimensionKeyPlaceholder, this.cornerSetting = null !== (_f = table.options.corner) && void 0 !== _f ? _f : {
29
+ this.showRowHeader = null === (_f = table.options.showRowHeader) || void 0 === _f || _f,
30
+ this.showColumnHeader = null === (_g = table.options.showColumnHeader) || void 0 === _g || _g,
31
+ this.rowHeaderTitle = table.options.rowHeaderTitle, this.columnHeaderTitle = table.options.columnHeaderTitle,
32
+ this.cornerSetting = null !== (_h = table.options.corner) && void 0 !== _h ? _h : {
21
33
  titleOnDimension: "column"
22
34
  }, this.columns = dataset.columns, this.rows = dataset.rows, this.rowKeysPath = dataset.rowKeysPath,
23
- this.colKeysPath = dataset.colKeysPath, this.convertColKeys = (0, util_1.transpose)(this.colKeysPath),
24
- this.tree = dataset.tree, this.initState();
35
+ this.colKeysPath = dataset.colKeysPath, this.tree = dataset.tree, this.initState(),
36
+ this.convertColKeys = (0, util_1.transpose)(this.colKeysPath);
25
37
  }
26
38
  initState() {
27
- this.indicatorsAsCol && !this.hideIndicatorName ? this._indicatorShowType = "column" : this.indicatorsAsCol || this.hideIndicatorName ? this._indicatorShowType = "none" : this._indicatorShowType = "row",
28
- this.colShowAttrs = "column" === this._indicatorShowType ? this.columns.concat(this.indicatorDimensionKey) : this.columns,
29
- this.rowShowAttrs = "row" === this._indicatorShowType ? this.rows.concat(this.indicatorDimensionKey) : this.rows,
30
- this._colCount = (0 === this.colKeysPath.length ? 1 : this.colKeysPath.length) * (this.indicatorsAsCol ? this.indicators.length : 1) + this.rowHeaderLevelCount,
31
- this._rowCount = (0 === this.rowKeysPath.length ? 1 : this.rowKeysPath.length) * (this.indicatorsAsCol ? 1 : this.indicators.length) + this.columnHeaderLevelCount,
32
- this._bodyRowCount = this.rowKeysPath.length * (this.indicatorsAsCol ? 1 : this.indicators.length),
33
- this.initHeaderObjects(), this.initIndicatorObjects();
39
+ var _a, _b, _c, _d, _e;
40
+ if (this.indicatorsAsCol && !this.hideIndicatorName ? this._indicatorShowType = "column" : this.indicatorsAsCol || this.hideIndicatorName ? this._indicatorShowType = "none" : this._indicatorShowType = "row",
41
+ this.colShowAttrs = "column" === this._indicatorShowType ? this.columns.concat(this.indicatorDimensionKey) : Array.from(this.columns),
42
+ this.rowShowAttrs = "row" === this._indicatorShowType ? this.rows.concat(this.indicatorDimensionKey) : Array.from(this.rows),
43
+ this._bodyRowCount = this.rowKeysPath.length * (this.indicatorsAsCol ? 1 : this.indicatorKeys.length),
44
+ this.initHeaderObjects(), this.initIndicatorObjects(), this.rowHeaderTitle) {
45
+ const cell_id = "rowHeaderTitle", caption = "string" == typeof this.rowHeaderTitle.title ? this.rowHeaderTitle.title : this.rowsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.dimensionTitle}` : `${value.dimensionTitle}`)), "");
46
+ this._headerObjectMap[caption] = {
47
+ id: caption,
48
+ caption: caption,
49
+ field: cell_id,
50
+ headerType: null !== (_a = this.rowHeaderTitle.headerType) && void 0 !== _a ? _a : "text",
51
+ style: this.rowHeaderTitle.headerStyle,
52
+ define: {}
53
+ }, this._headerObjectMap[cell_id] = {
54
+ id: cell_id,
55
+ caption: "",
56
+ field: cell_id,
57
+ headerType: null !== (_b = this.cornerSetting.headerType) && void 0 !== _b ? _b : "text",
58
+ style: this.cornerSetting.headerStyle,
59
+ define: {}
60
+ }, this._headerObjects.push(this._headerObjectMap[caption]), this._headerObjects.push(this._headerObjectMap[cell_id]),
61
+ this.rowShowAttrs.unshift(cell_id), this.rowKeysPath.forEach(((rowKey, index) => {
62
+ rowKey.unshift(caption);
63
+ }));
64
+ }
65
+ if (this.columnHeaderTitle) {
66
+ const cell_id = "columnHeaderTitleCell", caption = "string" == typeof this.columnHeaderTitle.title ? this.columnHeaderTitle.title : this.columnsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.dimensionTitle}` : `${value.dimensionTitle}`)), "");
67
+ this._headerObjectMap[caption] = {
68
+ id: caption,
69
+ caption: caption,
70
+ field: cell_id,
71
+ headerType: null !== (_c = this.columnHeaderTitle.headerType) && void 0 !== _c ? _c : "text",
72
+ style: this.columnHeaderTitle.headerStyle,
73
+ define: {}
74
+ }, this._headerObjectMap[cell_id] = {
75
+ id: cell_id,
76
+ caption: "",
77
+ field: cell_id,
78
+ headerType: null !== (_d = this.cornerSetting.headerType) && void 0 !== _d ? _d : "text",
79
+ style: this.cornerSetting.headerStyle,
80
+ define: {}
81
+ }, this._headerObjects.push(this._headerObjectMap[caption]), this._headerObjects.push(this._headerObjectMap[cell_id]),
82
+ this.colShowAttrs.unshift(cell_id), this.colKeysPath.forEach(((columnKey, index) => {
83
+ columnKey.unshift(caption);
84
+ }));
85
+ }
86
+ if (this._table.isPivotChart()) if (this.hasTwoIndicatorAxes = this._indicatorObjects.some((indicatorObject => !!(indicatorObject.chartSpec && indicatorObject.chartSpec.series && indicatorObject.chartSpec.series.length > 1))),
87
+ this._chartItemSpanSize = 0, this._indicatorObjects.find((indicatorObject => {
88
+ var _a, _b, _c;
89
+ return (null === (_a = indicatorObject.chartSpec) || void 0 === _a ? void 0 : _a.barWidth) && (this._chartItemSpanSize = null === (_b = indicatorObject.chartSpec) || void 0 === _b ? void 0 : _b.barWidth),
90
+ this._chartItemSpanSize > 0 || (null === (_c = indicatorObject.chartSpec.series) || void 0 === _c || _c.find((seriesObject => (seriesObject.barWidth && (this._chartItemSpanSize = seriesObject.barWidth),
91
+ this._chartItemSpanSize > 0))), this._chartItemSpanSize > 0);
92
+ })), this.indicatorsAsCol) {
93
+ const cell_id = "rowHeaderEmpty";
94
+ this._headerObjectMap[cell_id] = {
95
+ id: cell_id,
96
+ caption: "",
97
+ field: cell_id,
98
+ headerType: null !== (_e = this.cornerSetting.headerType) && void 0 !== _e ? _e : "text",
99
+ style: this.cornerSetting.headerStyle,
100
+ define: {}
101
+ }, this._headerObjects.push(this._headerObjectMap[cell_id]), this.rowShowAttrs.push(cell_id),
102
+ this.hasTwoIndicatorAxes || this.colShowAttrs.pop();
103
+ } else {
104
+ const axisOption = this._table.pivotChartAxes.find((axisOption => "left" === axisOption.orient));
105
+ !1 === (null == axisOption ? void 0 : axisOption.visible) && this.rowShowAttrs.pop();
106
+ }
107
+ this._colCount = (0 === this.colKeysPath.length ? 1 : this.colKeysPath.length) * (this.indicatorsAsCol ? this.indicatorKeys.length : 1) + this.rowHeaderLevelCount + this.rightFrozenColCount,
108
+ this._rowCount = (0 === this.rowKeysPath.length ? 1 : this.rowKeysPath.length) * (this.indicatorsAsCol ? 1 : this.indicatorKeys.length) + this.columnHeaderLevelCount + this.bottomFrozenRowCount,
109
+ this.setColumnWidths();
110
+ }
111
+ setColumnWidths() {
112
+ const returnWidths = new Array(this.colCount).fill(void 0);
113
+ if (this.showRowHeader && (this.rowHeaderTitle && (returnWidths[0] = {}), this.rowShowAttrs.forEach(((objKey, index) => {
114
+ var _a;
115
+ const dimension = null === (_a = this.rowsDefine) || void 0 === _a ? void 0 : _a.find((dimension => "string" != typeof dimension && dimension.dimensionKey === objKey));
116
+ dimension && (returnWidths[index + (this.rowHeaderTitle ? 1 : 0)] = {
117
+ width: dimension.width,
118
+ minWidth: dimension.minWidth,
119
+ maxWidth: dimension.maxWidth
120
+ });
121
+ }))), this.indicatorsAsCol) for (let i = this.rowHeaderLevelCount; i < this.colCount; i++) {
122
+ const cellDefine = this.getBody(i, this.columnHeaderLevelCount);
123
+ returnWidths[i] = {
124
+ width: null == cellDefine ? void 0 : cellDefine.width,
125
+ minWidth: null == cellDefine ? void 0 : cellDefine.minWidth,
126
+ maxWidth: null == cellDefine ? void 0 : cellDefine.maxWidth
127
+ };
128
+ } else {
129
+ let maxWidth, minWidth, isAuto, width = 0;
130
+ this._indicatorObjects.forEach(((obj, index) => {
131
+ "number" == typeof obj.width ? width = Math.max(obj.width, width) : "auto" === obj.width && (isAuto = !0),
132
+ "number" == typeof obj.minWidth && (minWidth = Math.max(obj.minWidth, minWidth)),
133
+ "number" == typeof obj.maxWidth && (maxWidth = Math.max(obj.maxWidth, maxWidth));
134
+ })), width = width > 0 ? width : isAuto ? "auto" : void 0, returnWidths.fill({
135
+ width: width,
136
+ minWidth: minWidth,
137
+ maxWidth: maxWidth
138
+ }, this.rowHeaderLevelCount, this.colCount - this.rightFrozenColCount);
139
+ }
140
+ this._columnWidths = returnWidths;
141
+ }
142
+ get columnWidths() {
143
+ return this._columnWidths;
144
+ }
145
+ getColumnWidthDefined(col) {
146
+ return this._columnWidths[col];
34
147
  }
35
148
  getDimensionInfo(dimensionKey) {
36
149
  var _a, _b, _c;
@@ -40,6 +153,12 @@ class PivoLayoutMap {
40
153
  var _a;
41
154
  return null === (_a = this.indicatorsDefine) || void 0 === _a ? void 0 : _a.find((indicator => "string" != typeof indicator && (indicatorKey ? indicator.indicatorKey === indicatorKey : !!indicatorValue && indicator.caption === indicatorValue)));
42
155
  }
156
+ getColKeysPath() {
157
+ return this.colKeysPath;
158
+ }
159
+ getRowKeysPath() {
160
+ return this.rowKeysPath;
161
+ }
43
162
  initHeaderObjects() {
44
163
  var _a, _b, _c, _d, _e, _f, _g, _h;
45
164
  for (let i = 0, len = this.rowKeysPath.length; i <= len - 1; i++) {
@@ -86,24 +205,24 @@ class PivoLayoutMap {
86
205
  }
87
206
  let cornerAttrs;
88
207
  this.indicatorsDefine.forEach((indicator => {
89
- var _a, _b;
208
+ var _a, _b, _c;
90
209
  const indicatorKey = "string" == typeof indicator ? indicator : indicator.indicatorKey, indicatorInfo = "string" == typeof indicator ? void 0 : indicator;
91
210
  this._headerObjectMap[indicatorKey] || (this._headerObjectMap[indicatorKey] = {
92
211
  id: indicatorKey,
93
212
  field: this.indicatorDimensionKey,
94
- caption: indicatorKey,
213
+ caption: null !== (_a = indicatorInfo.caption) && void 0 !== _a ? _a : indicatorKey,
95
214
  style: null == indicatorInfo ? void 0 : indicatorInfo.headerStyle,
96
215
  define: {
97
216
  field: this.indicatorDimensionKey,
98
- headerType: null !== (_a = null == indicatorInfo ? void 0 : indicatorInfo.headerType) && void 0 !== _a ? _a : "text",
217
+ headerType: null !== (_b = null == indicatorInfo ? void 0 : indicatorInfo.headerType) && void 0 !== _b ? _b : "text",
99
218
  columnType: "text"
100
219
  },
101
220
  dropDownMenu: null == indicatorInfo ? void 0 : indicatorInfo.dropDownMenu,
102
- headerType: null !== (_b = null == indicatorInfo ? void 0 : indicatorInfo.headerType) && void 0 !== _b ? _b : "text",
221
+ headerType: null !== (_c = null == indicatorInfo ? void 0 : indicatorInfo.headerType) && void 0 !== _c ? _c : "text",
103
222
  width: null == indicatorInfo ? void 0 : indicatorInfo.width
104
223
  }, this._headerObjects.push(this._headerObjectMap[indicatorKey]));
105
224
  })), "column" === this.cornerSetting.titleOnDimension ? cornerAttrs = this.colShowAttrs : "row" === this.cornerSetting.titleOnDimension && (cornerAttrs = this.rowShowAttrs),
106
- cornerAttrs.forEach((cornerAttrStr => {
225
+ null == cornerAttrs || cornerAttrs.forEach((cornerAttrStr => {
107
226
  var _a, _b, _c, _d, _e, _f;
108
227
  if (!this._headerObjectMap[cornerAttrStr]) {
109
228
  const dimensionInfo = this.getDimensionInfo(cornerAttrStr);
@@ -125,41 +244,32 @@ class PivoLayoutMap {
125
244
  }));
126
245
  }
127
246
  initIndicatorObjects() {
128
- this.indicators.forEach((indicatorStr => {
247
+ this.indicatorKeys.forEach((indicatorKey => {
129
248
  var _a, _b, _c;
130
- const indicatorInfo = null === (_a = this.indicatorsDefine) || void 0 === _a ? void 0 : _a.find((indicator => "string" != typeof indicator && indicator.caption === indicatorStr));
249
+ const indicatorInfo = null === (_a = this.indicatorsDefine) || void 0 === _a ? void 0 : _a.find((indicator => "string" != typeof indicator && indicator.indicatorKey === indicatorKey));
131
250
  this._indicatorObjects.push({
132
- id: indicatorStr,
133
- indicatorKey: indicatorStr,
134
- field: indicatorStr,
135
- define: {
136
- field: indicatorStr,
251
+ id: indicatorKey,
252
+ indicatorKey: indicatorKey,
253
+ field: indicatorKey,
254
+ define: Object.assign({
255
+ field: indicatorKey,
137
256
  headerType: "text",
138
257
  columnType: null !== (_b = null == indicatorInfo ? void 0 : indicatorInfo.columnType) && void 0 !== _b ? _b : "text"
139
- },
258
+ }, indicatorInfo),
140
259
  fieldFormat: null == indicatorInfo ? void 0 : indicatorInfo.format,
141
260
  columnType: null !== (_c = null == indicatorInfo ? void 0 : indicatorInfo.columnType) && void 0 !== _c ? _c : "text",
142
- style: null == indicatorInfo ? void 0 : indicatorInfo.style
261
+ chartModule: indicatorInfo && ("chartModule" in indicatorInfo ? indicatorInfo.chartModule : null),
262
+ chartSpec: indicatorInfo && ("chartSpec" in indicatorInfo ? indicatorInfo.chartSpec : null),
263
+ sparklineSpec: "sparklineSpec" in indicatorInfo ? indicatorInfo.sparklineSpec : null,
264
+ style: null == indicatorInfo ? void 0 : indicatorInfo.style,
265
+ icon: null == indicatorInfo ? void 0 : indicatorInfo.icon,
266
+ width: null == indicatorInfo ? void 0 : indicatorInfo.width,
267
+ minWidth: null == indicatorInfo ? void 0 : indicatorInfo.minWidth,
268
+ maxWidth: null == indicatorInfo ? void 0 : indicatorInfo.maxWidth,
269
+ disableColumnResize: null == indicatorInfo ? void 0 : indicatorInfo.disableColumnResize
143
270
  });
144
271
  }));
145
272
  }
146
- get columnWidths() {
147
- var _a;
148
- const returnWidths = [];
149
- for (let i = 0; i < this.rowHeaderLevelCount; i++) {
150
- const dimension = null !== (_a = this.getDimensionInfo(this.rowShowAttrs[i])) && void 0 !== _a ? _a : this.getIndicatorInfo(this.rowShowAttrs[i]);
151
- returnWidths.push({
152
- width: null == dimension ? void 0 : dimension.width
153
- });
154
- }
155
- for (let j = 0; j < this.colCount - this.rowHeaderLevelCount; j++) {
156
- const indicator = this._indicatorObjects[j % this._indicatorObjects.length];
157
- returnWidths.push({
158
- width: null == indicator ? void 0 : indicator.width
159
- });
160
- }
161
- return returnWidths;
162
- }
163
273
  get showColumnHeader() {
164
274
  return this._showColumnHeader;
165
275
  }
@@ -172,11 +282,23 @@ class PivoLayoutMap {
172
282
  set showRowHeader(_showRowHeader) {
173
283
  this._showRowHeader = _showRowHeader;
174
284
  }
285
+ get columnHeaderTitle() {
286
+ return this._columnHeaderTitle;
287
+ }
288
+ set columnHeaderTitle(_columnHeaderTitle) {
289
+ this._columnHeaderTitle = _columnHeaderTitle;
290
+ }
291
+ get rowHeaderTitle() {
292
+ return this._rowHeaderTitle;
293
+ }
294
+ set rowHeaderTitle(_rowHeaderTitle) {
295
+ this._rowHeaderTitle = _rowHeaderTitle;
296
+ }
175
297
  getCellType(col, row) {
176
298
  return this.isCornerHeader(col, row) ? "cornerHeader" : this.isColumnHeader(col, row) ? "columnHeader" : this.isRowHeader(col, row) ? "rowHeader" : "body";
177
299
  }
178
300
  isHeader(col, row) {
179
- return col < this.rowHeaderLevelCount || row < this.columnHeaderLevelCount;
301
+ return col < this.rowHeaderLevelCount || (row < this.columnHeaderLevelCount || (col >= this.colCount - this.rightFrozenColCount || row >= this.rowCount - this.bottomFrozenRowCount));
180
302
  }
181
303
  isCornerHeader(col, row) {
182
304
  return col < this.rowHeaderLevelCount && row < this.columnHeaderLevelCount;
@@ -184,6 +306,12 @@ class PivoLayoutMap {
184
306
  isColumnHeader(col, row) {
185
307
  return col >= this.rowHeaderLevelCount && row < this.columnHeaderLevelCount;
186
308
  }
309
+ isRightFrozenColumn(col, row) {
310
+ return col >= this.colCount - this.rightFrozenColCount && row >= this.columnHeaderLevelCount && row < this.rowCount - this.bottomFrozenRowCount;
311
+ }
312
+ isBottomFrozenRow(col, row) {
313
+ return col >= this.rowHeaderLevelCount && row >= this.rowCount - this.bottomFrozenRowCount && col < this.colCount - this.rightFrozenColCount;
314
+ }
187
315
  isRowHeader(col, row) {
188
316
  return col < this.rowHeaderLevelCount && row >= this.columnHeaderLevelCount;
189
317
  }
@@ -250,11 +378,17 @@ class PivoLayoutMap {
250
378
  }
251
379
  get columnHeaderLevelCount() {
252
380
  const colLevelCount = this.colShowAttrs.length;
253
- return this.showColumnHeader ? colLevelCount : 0;
381
+ if (this.showColumnHeader) {
382
+ return this.indicatorsAsCol && this.hideIndicatorName && this.colShowAttrs[this.colShowAttrs.length - 1] === this.indicatorDimensionKey ? colLevelCount - 1 : colLevelCount;
383
+ }
384
+ return this.indicatorsAsCol ? this.hideIndicatorName ? 0 : 1 : 0;
254
385
  }
255
386
  get rowHeaderLevelCount() {
256
387
  const rowLevelCount = this.rowShowAttrs.length;
257
- return this.showRowHeader ? rowLevelCount : 0;
388
+ if (this.showRowHeader) {
389
+ return this.indicatorsAsCol ? rowLevelCount : this.hideIndicatorName && this.rowShowAttrs[this.rowShowAttrs.length - 1] === this.indicatorDimensionKey ? rowLevelCount - 1 : rowLevelCount;
390
+ }
391
+ return this.indicatorsAsCol || this.hideIndicatorName ? 0 : 1;
258
392
  }
259
393
  get colCount() {
260
394
  return this._colCount;
@@ -265,6 +399,34 @@ class PivoLayoutMap {
265
399
  get bodyRowCount() {
266
400
  return this._bodyRowCount;
267
401
  }
402
+ get bottomFrozenRowCount() {
403
+ if (!this._table.isPivotChart()) return 0;
404
+ const axisOption = this._table.pivotChartAxes.find((axisOption => "bottom" === axisOption.orient));
405
+ return !1 === (null == axisOption ? void 0 : axisOption.visible) ? 0 : (this.indicatorsAsCol,
406
+ 1);
407
+ }
408
+ get rightFrozenColCount() {
409
+ if (!this._table.isPivotChart()) return 0;
410
+ const axisOption = this._table.pivotChartAxes.find((axisOption => "right" === axisOption.orient));
411
+ return !1 === (null == axisOption ? void 0 : axisOption.visible) || this.indicatorsAsCol ? 0 : this.hasTwoIndicatorAxes ? 1 : 0;
412
+ }
413
+ get leftAxesCount() {
414
+ if (!this._table.isPivotChart()) return 0;
415
+ const axisOption = this._table.pivotChartAxes.find((axisOption => "left" === axisOption.orient));
416
+ return !1 === (null == axisOption ? void 0 : axisOption.visible) ? 0 : (this.indicatorsAsCol,
417
+ 1);
418
+ }
419
+ get topAxesCount() {
420
+ if (!this._table.isPivotChart()) return 0;
421
+ const axisOption = this._table.pivotChartAxes.find((axisOption => "top" === axisOption.orient));
422
+ return !1 === (null == axisOption ? void 0 : axisOption.visible) ? 0 : this.indicatorsAsCol && this.hasTwoIndicatorAxes ? 1 : 0;
423
+ }
424
+ get rightAxesCount() {
425
+ return this.rightFrozenColCount;
426
+ }
427
+ get bottomAxesCount() {
428
+ return this.bottomFrozenRowCount;
429
+ }
268
430
  get headerObjects() {
269
431
  return this._headerObjects;
270
432
  }
@@ -272,27 +434,31 @@ class PivoLayoutMap {
272
434
  return this._indicatorObjects;
273
435
  }
274
436
  getCellId(col, row) {
437
+ if (col < this.rowHeaderLevelCount && row >= this.rowCount - this.bottomFrozenRowCount || row < this.columnHeaderLevelCount && col >= this.colCount - this.rightFrozenColCount) return 0;
275
438
  if (row >= 0 && col >= 0) if (this.isCornerHeader(col, row)) {
276
439
  if ("column" === this.cornerSetting.titleOnDimension) return this.colShowAttrs[row];
277
440
  if ("row" === this.cornerSetting.titleOnDimension) return this.rowShowAttrs[col];
278
441
  } else {
279
- if (this.isColumnHeader(col, row)) return row < this.columns.length ? this.convertColKeys[row][this.indicatorsAsCol ? Math.floor((col - this.rowHeaderLevelCount) / this.indicators.length) : col - this.rowHeaderLevelCount] : this.indicators[(col - this.rowHeaderLevelCount) % this.indicators.length];
280
- if (this.isRowHeader(col, row)) return col < this.rows.length ? this.rowKeysPath[this.indicatorsAsCol ? row - this.columnHeaderLevelCount : Math.floor((row - this.columnHeaderLevelCount) / this.indicators.length)][col] : this.indicators[(row - this.columnHeaderLevelCount) % this.indicators.length];
442
+ if (this.isColumnHeader(col, row)) return row < this.columns.length + (this.columnHeaderTitle ? 1 : 0) ? this.convertColKeys[row][this.indicatorsAsCol ? Math.floor((col - this.rowHeaderLevelCount) / this.indicatorKeys.length) : col - this.rowHeaderLevelCount] : this.indicatorKeys[(col - this.rowHeaderLevelCount) % this.indicatorKeys.length];
443
+ if (this.isRowHeader(col, row)) return col < this.rows.length + (this.rowHeaderTitle ? 1 : 0) ? this.rowKeysPath[this.indicatorsAsCol ? row - this.columnHeaderLevelCount : Math.floor((row - this.columnHeaderLevelCount) / this.indicatorKeys.length)][col] : this.indicatorKeys[(row - this.columnHeaderLevelCount) % this.indicatorKeys.length];
444
+ if (this.isRightFrozenColumn(col, row)) return this.indicatorsAsCol ? this.rowKeysPath[row - this.columnHeaderLevelCount][this.rowHeaderLevelCount - 1] : this.indicatorKeys[(row - this.columnHeaderLevelCount) % this.indicatorKeys.length];
445
+ if (this.isBottomFrozenRow(col, row)) return this.indicatorsAsCol ? this.indicatorKeys[(col - this.rowHeaderLevelCount) % this.indicatorKeys.length] : this.convertColKeys[this.convertColKeys.length - 1][Math.floor((col - this.rowHeaderLevelCount) / this.indicatorKeys.length)];
281
446
  }
282
447
  return 0;
283
448
  }
284
- getIndicatorName(col, row) {
449
+ getIndicatorKey(col, row) {
285
450
  if (this.isHeader(col, row)) return "";
286
451
  if (this.indicatorsAsCol) {
287
452
  const bodyCol = col - this.rowHeaderLevelCount;
288
- return this.indicators[bodyCol % this.indicators.length];
453
+ return this.indicatorKeys[bodyCol % this.indicatorKeys.length];
289
454
  }
290
455
  const bodyRow = row - this.columnHeaderLevelCount;
291
- return this.indicators[bodyRow % this.indicators.length];
456
+ return this.indicatorKeys[bodyRow % this.indicatorKeys.length];
292
457
  }
293
458
  getHeader(col, row) {
459
+ var _a;
294
460
  const id = this.getCellId(col, row);
295
- return this._headerObjectMap[id];
461
+ return null !== (_a = this._headerObjectMap[id]) && void 0 !== _a ? _a : EMPTY_HEADER;
296
462
  }
297
463
  getHeaderField(col, row) {
298
464
  var _a, _b;
@@ -305,20 +471,25 @@ class PivoLayoutMap {
305
471
  throw new Error(`Method not implemented.${field}`);
306
472
  }
307
473
  getBody(_col, _row) {
308
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
309
- let indicatorInfo;
310
- return indicatorInfo = this.indicatorsAsCol ? this.getIndicatorInfo(null === (_a = null == this ? void 0 : this.indicators) || void 0 === _a ? void 0 : _a[(_col - this.rowHeaderLevelCount) % (null !== (_c = null === (_b = this.indicators) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0)]) : this.getIndicatorInfo(null === (_d = null == this ? void 0 : this.indicators) || void 0 === _d ? void 0 : _d[(_row - this.columnHeaderLevelCount) % (null !== (_f = null === (_e = this.indicators) || void 0 === _e ? void 0 : _e.length) && void 0 !== _f ? _f : 0)]),
311
- {
312
- id: 0,
313
- indicatorKey: this.indicators[(_col - this.rowHeaderLevelCount) % (null !== (_h = null === (_g = this.indicators) || void 0 === _g ? void 0 : _g.length) && void 0 !== _h ? _h : 0)],
314
- field: this.indicators[(_col - this.rowHeaderLevelCount) % (null !== (_k = null === (_j = this.indicators) || void 0 === _j ? void 0 : _j.length) && void 0 !== _k ? _k : 0)],
315
- columnType: null !== (_l = null == indicatorInfo ? void 0 : indicatorInfo.columnType) && void 0 !== _l ? _l : "text",
316
- style: null == indicatorInfo ? void 0 : indicatorInfo.style,
317
- define: {
318
- field: this.indicators[(_col - this.rowHeaderLevelCount) % (null !== (_o = null === (_m = this.indicators) || void 0 === _m ? void 0 : _m.length) && void 0 !== _o ? _o : 0)],
319
- headerType: "text",
320
- columnType: null !== (_p = null == indicatorInfo ? void 0 : indicatorInfo.columnType) && void 0 !== _p ? _p : "text"
321
- }
474
+ var _a, _b, _c, _d, _e, _f;
475
+ const paths = this.getCellHeaderPaths(_col, _row);
476
+ if (this.indicatorsAsCol) {
477
+ const indicatorKey = null === (_a = paths.colHeaderPaths.find((colPath => colPath.indicatorKey))) || void 0 === _a ? void 0 : _a.indicatorKey;
478
+ return null !== (_c = null !== (_b = this._indicatorObjects.find((indicator => indicator.indicatorKey === indicatorKey))) && void 0 !== _b ? _b : this._indicatorObjects[0]) && void 0 !== _c ? _c : {
479
+ id: "",
480
+ field: void 0,
481
+ indicatorKey: void 0,
482
+ columnType: void 0,
483
+ define: void 0
484
+ };
485
+ }
486
+ const indicatorKey = null === (_d = paths.rowHeaderPaths.find((rowPath => rowPath.indicatorKey))) || void 0 === _d ? void 0 : _d.indicatorKey;
487
+ return null !== (_f = null !== (_e = this._indicatorObjects.find((indicator => indicator.indicatorKey === indicatorKey))) && void 0 !== _e ? _e : this._indicatorObjects[0]) && void 0 !== _f ? _f : {
488
+ id: "",
489
+ field: void 0,
490
+ indicatorKey: void 0,
491
+ columnType: void 0,
492
+ define: void 0
322
493
  };
323
494
  }
324
495
  getBodyLayoutRangeById(id) {
@@ -348,6 +519,7 @@ class PivoLayoutMap {
348
519
  }
349
520
  };
350
521
  if (!this.isHeader(col, row) || -1 === col || -1 === row || this.isIndicatorHeader(col, row)) return result;
522
+ if (this.isRightFrozenColumn(col, row) || this.isBottomFrozenRow(col, row)) return result;
351
523
  const id = this.getCellId(col, row);
352
524
  for (let c = col - 1; c >= 0 && id === this.getCellId(c, row); c--) result.start.col = c;
353
525
  for (let c = col + 1; c < (null !== (_a = this.colCount) && void 0 !== _a ? _a : 0) && id === this.getCellId(c, row); c++) result.end.col = c;
@@ -360,10 +532,10 @@ class PivoLayoutMap {
360
532
  return range1.start.col === range2.start.col && range1.end.col === range2.end.col && range1.start.row === range2.start.row && range1.end.row === range2.end.row;
361
533
  }
362
534
  getRecordIndexByRow(row) {
363
- return row < this.columnHeaderLevelCount ? -1 : this.indicatorsAsCol ? row - this.columnHeaderLevelCount : Math.floor((row - this.columnHeaderLevelCount) / this.indicators.length);
535
+ return row < this.columnHeaderLevelCount ? -1 : this.indicatorsAsCol ? row - this.columnHeaderLevelCount : Math.floor((row - this.columnHeaderLevelCount) / this.indicatorKeys.length);
364
536
  }
365
537
  getRecordIndexByCol(col) {
366
- return col < this.rowHeaderLevelCount ? -1 : this.indicatorsAsCol ? Math.floor((col - this.rowHeaderLevelCount) / this.indicators.length) : col - this.rowHeaderLevelCount;
538
+ return col < this.rowHeaderLevelCount ? -1 : this.indicatorsAsCol ? Math.floor((col - this.rowHeaderLevelCount) / this.indicatorKeys.length) : col - this.rowHeaderLevelCount;
367
539
  }
368
540
  getRecordStartRowByRecordIndex(index) {
369
541
  return this.columnHeaderLevelCount + index;
@@ -373,32 +545,85 @@ class PivoLayoutMap {
373
545
  const recordCol = this.getRecordIndexByCol(col), recordRow = this.getRecordIndexByRow(row);
374
546
  let colPath, rowPath, colHeaderPaths, rowHeaderPaths;
375
547
  return recordCol >= 0 && (colPath = this.colKeysPath[recordCol], colHeaderPaths = null === (_a = null == colPath ? void 0 : colPath[colPath.length - 1]) || void 0 === _a ? void 0 : _a.split(this.dataset.stringJoinChar),
376
- row < this.columns.length - 1 && (colHeaderPaths = colHeaderPaths.slice(0, row + 1))),
548
+ colHeaderPaths && this.showColumnHeader && row < this.columns.length - 1 && (colHeaderPaths = colHeaderPaths.slice(0, row + 1))),
377
549
  recordRow >= 0 && (rowPath = this.rowKeysPath[recordRow], rowHeaderPaths = null === (_b = null == rowPath ? void 0 : rowPath[rowPath.length - 1]) || void 0 === _b ? void 0 : _b.split(this.dataset.stringJoinChar),
378
- col < this.rows.length - 1 && (rowHeaderPaths = rowHeaderPaths.slice(0, col + 1))),
550
+ rowHeaderPaths && this.showRowHeader && col < this.rows.length - 1 && (rowHeaderPaths = rowHeaderPaths.slice(0, col + 1))),
551
+ colHeaderPaths && this.indicatorsAsCol && col >= this.rowHeaderLevelCount ? colHeaderPaths.push(this.indicatorKeys[(col - this.rowHeaderLevelCount) % this.indicatorKeys.length]) : rowHeaderPaths && row >= this.columnHeaderLevelCount && rowHeaderPaths.push(this.indicatorKeys[(row - this.columnHeaderLevelCount) % this.indicatorKeys.length]),
379
552
  {
380
- colHeaderPaths: null !== (_c = colHeaderPaths.map((key => {
381
- const isIndicatorKey = this._indicatorObjects.find((indicator => {
382
- indicator.indicatorKey;
383
- }));
553
+ colHeaderPaths: null !== (_c = null == colHeaderPaths ? void 0 : colHeaderPaths.map(((key, index) => {
554
+ const indicatorObject = this._indicatorObjects.find((indicator => indicator.indicatorKey === key));
384
555
  return {
385
- dimensionKey: isIndicatorKey ? void 0 : key,
386
- indicatorKey: isIndicatorKey ? key : void 0,
387
- value: key
556
+ dimensionKey: indicatorObject ? void 0 : this.colShowAttrs[index],
557
+ indicatorKey: indicatorObject ? key : void 0,
558
+ value: indicatorObject ? indicatorObject.define.caption : key
388
559
  };
389
560
  }))) && void 0 !== _c ? _c : [],
390
- rowHeaderPaths: null !== (_d = rowHeaderPaths.map((key => {
391
- const isIndicatorKey = this._indicatorObjects.find((indicator => {
392
- indicator.indicatorKey;
393
- }));
561
+ rowHeaderPaths: null !== (_d = null == rowHeaderPaths ? void 0 : rowHeaderPaths.map(((key, index) => {
562
+ const indicatorObject = this._indicatorObjects.find((indicator => indicator.indicatorKey === key));
394
563
  return {
395
- dimensionKey: isIndicatorKey ? void 0 : key,
396
- indicatorKey: isIndicatorKey ? key : void 0,
397
- value: key
564
+ dimensionKey: indicatorObject ? void 0 : this.rowShowAttrs[index],
565
+ indicatorKey: indicatorObject ? key : void 0,
566
+ value: indicatorObject ? indicatorObject.define.caption : key
398
567
  };
399
568
  }))) && void 0 !== _d ? _d : []
400
569
  };
401
570
  }
571
+ getCellAdressByHeaderPath(dimensionPaths) {
572
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
573
+ let colHeaderPaths, rowHeaderPaths;
574
+ if (Array.isArray(dimensionPaths)) {
575
+ if (dimensionPaths.length > this.rowShowAttrs.length + this.colShowAttrs.length) return;
576
+ colHeaderPaths = dimensionPaths.filter((path => this.colShowAttrs.indexOf(path.dimensionKey) >= 0)),
577
+ rowHeaderPaths = dimensionPaths.filter((path => this.rowShowAttrs.indexOf(path.dimensionKey) >= 0));
578
+ } else colHeaderPaths = dimensionPaths.colHeaderPaths, rowHeaderPaths = dimensionPaths.rowHeaderPaths;
579
+ if (!Array.isArray(colHeaderPaths) && !Array.isArray(rowHeaderPaths)) return;
580
+ null == colHeaderPaths || colHeaderPaths.sort(((a, b) => {
581
+ var _a, _b;
582
+ return this.colShowAttrs.indexOf(null !== (_a = a.dimensionKey) && void 0 !== _a ? _a : this.indicatorDimensionKey) - this.colShowAttrs.indexOf(null !== (_b = b.dimensionKey) && void 0 !== _b ? _b : this.indicatorDimensionKey);
583
+ })), null == rowHeaderPaths || rowHeaderPaths.sort(((a, b) => {
584
+ var _a, _b;
585
+ return this.rowShowAttrs.indexOf(null !== (_a = a.dimensionKey) && void 0 !== _a ? _a : this.indicatorDimensionKey) - this.rowShowAttrs.indexOf(null !== (_b = b.dimensionKey) && void 0 !== _b ? _b : this.indicatorDimensionKey);
586
+ }));
587
+ let needLowestLevel = !1;
588
+ (null == colHeaderPaths ? void 0 : colHeaderPaths.length) >= 1 && (null == rowHeaderPaths ? void 0 : rowHeaderPaths.length) >= 1 && (needLowestLevel = !0);
589
+ let toFindIndicator, col = 0, row = 0, rowTree = this.rowTree, columnTree = this.columnTree;
590
+ if (colHeaderPaths) for (let i = 0; i < colHeaderPaths.length; i++) {
591
+ const colDimension = colHeaderPaths[i];
592
+ if (colDimension.indicatorKey) {
593
+ toFindIndicator = colDimension.indicatorKey;
594
+ break;
595
+ }
596
+ for (let j = 0; j < columnTree.length; j++) {
597
+ const dimension = columnTree[j];
598
+ if (!(0, util_1.isValid)(colDimension.indicatorKey) && dimension.dimensionKey === colDimension.dimensionKey && dimension.value === colDimension.value) {
599
+ columnTree = dimension.children, columnTree && 0 !== columnTree.length && !(null === (_a = null == columnTree ? void 0 : columnTree[0]) || void 0 === _a ? void 0 : _a.indicatorKey) || (col += j);
600
+ break;
601
+ }
602
+ col += (null === (_c = null === (_b = dimension.children) || void 0 === _b ? void 0 : _b[0]) || void 0 === _c ? void 0 : _c.indicatorKey) ? 0 : null !== (_e = null === (_d = dimension.children) || void 0 === _d ? void 0 : _d.length) && void 0 !== _e ? _e : 0;
603
+ }
604
+ }
605
+ if (rowHeaderPaths) for (let i = 0; i < rowHeaderPaths.length; i++) {
606
+ const rowDimension = rowHeaderPaths[i];
607
+ if (rowDimension.indicatorKey) {
608
+ toFindIndicator = rowDimension.indicatorKey;
609
+ break;
610
+ }
611
+ for (let j = 0; j < rowTree.length; j++) {
612
+ const dimension = rowTree[j];
613
+ if (!(0, util_1.isValid)(rowDimension.indicatorKey) && dimension.dimensionKey === rowDimension.dimensionKey && dimension.value === rowDimension.value) {
614
+ rowTree = dimension.children, rowTree && 0 !== rowTree.length && !(null === (_f = null == rowTree ? void 0 : rowTree[0]) || void 0 === _f ? void 0 : _f.indicatorKey) || (row += j);
615
+ break;
616
+ }
617
+ row += (null === (_h = null === (_g = dimension.children) || void 0 === _g ? void 0 : _g[0]) || void 0 === _h ? void 0 : _h.indicatorKey) ? 0 : null !== (_k = null === (_j = dimension.children) || void 0 === _j ? void 0 : _j.length) && void 0 !== _k ? _k : 0;
618
+ }
619
+ }
620
+ return col = (this.indicatorsAsCol ? col * this.indicatorKeys.length + this.indicatorKeys.indexOf(toFindIndicator) : col) + this.rowHeaderLevelCount,
621
+ row = (this.indicatorsAsCol ? row : row * this.indicatorKeys.length + this.indicatorKeys.indexOf(toFindIndicator)) + this.columnHeaderLevelCount,
622
+ (0, util_1.isValid)(col) || (0, util_1.isValid)(row) ? {
623
+ col: null != col ? col : undefined,
624
+ row: null != row ? row : undefined
625
+ } : void 0;
626
+ }
402
627
  getHeaderDimension(col, row) {
403
628
  var _a, _b, _c;
404
629
  if (this.isHeader(col, row)) {
@@ -408,8 +633,9 @@ class PivoLayoutMap {
408
633
  }
409
634
  updateDataset(dataset) {
410
635
  this.dataset = dataset, this.dataConfig = dataset.dataConfig, this.rowKeysPath = dataset.rowKeysPath,
411
- this.colKeysPath = dataset.colKeysPath, this.convertColKeys = (0, util_1.transpose)(this.colKeysPath),
412
- this.tree = dataset.tree, this.initState();
636
+ this.colKeysPath = dataset.colKeysPath, this.tree = dataset.tree, this._indicatorObjects = [],
637
+ this._headerObjects = [], this._headerObjectMap = {}, this.initState(), this.convertColKeys = (0,
638
+ util_1.transpose)(this.colKeysPath);
413
639
  }
414
640
  isHeaderForColWidth(col, row) {
415
641
  return this.isHeader(col, row);
@@ -443,7 +669,95 @@ class PivoLayoutMap {
443
669
  }
444
670
  return null == indicatorObj ? void 0 : indicatorObj.chartInstance;
445
671
  }
672
+ _generateChartState() {
673
+ return {
674
+ vtable_selected: {
675
+ filter: datum => {
676
+ if (this._table._selectedDataItemsInChart.length >= 1) {
677
+ return !!this._table._selectedDataItemsInChart.find((item => {
678
+ for (const itemKey in item) if (item[itemKey] !== datum[itemKey]) return !1;
679
+ return !0;
680
+ }));
681
+ }
682
+ if (this._table._selectedDimensionInChart.length) {
683
+ return !!this._table._selectedDimensionInChart.every((item => datum[item.key] === item.value));
684
+ }
685
+ return !1;
686
+ }
687
+ },
688
+ vtable_selected_reverse: {
689
+ filter: datum => {
690
+ if (this._table._selectedDataItemsInChart.length >= 1) {
691
+ return !this._table._selectedDataItemsInChart.find((item => {
692
+ for (const itemKey in item) if (item[itemKey] !== datum[itemKey]) return !1;
693
+ return !0;
694
+ }));
695
+ }
696
+ if (this._table._selectedDimensionInChart.length) {
697
+ return !this._table._selectedDimensionInChart.every((item => datum[item.key] === item.value));
698
+ }
699
+ return !1;
700
+ }
701
+ }
702
+ };
703
+ }
704
+ updateDataStateToChartInstance(activeChartInstance) {
705
+ activeChartInstance || (activeChartInstance = this._table._getActiveChartInstance());
706
+ const state = this._generateChartState();
707
+ this._indicatorObjects.forEach((_indicatorObject => {
708
+ _indicatorObject.chartInstance.updateState(state);
709
+ })), null == activeChartInstance || activeChartInstance.updateState(state);
710
+ }
711
+ updateDataStateToActiveChartInstance(activeChartInstance) {
712
+ activeChartInstance || (activeChartInstance = this._table._getActiveChartInstance());
713
+ const state = this._generateChartState();
714
+ null == activeChartInstance || activeChartInstance.updateState(state);
715
+ }
716
+ getOptimunWidthForChart(col) {
717
+ var _a;
718
+ const path = this.getCellHeaderPaths(col, this.columnHeaderLevelCount).colHeaderPaths;
719
+ let collectedValues;
720
+ for (const key in this.dataset.collectValuesBy) if ("xField" === this.dataset.collectValuesBy[key].type && !this.dataset.collectValuesBy[key].range) {
721
+ collectedValues = this.dataset.collectedValues[key][path.map((pathObj => pathObj.value)).join(this.dataset.stringJoinChar)];
722
+ break;
723
+ }
724
+ const barWidth = this._chartItemSpanSize || 25;
725
+ return (null !== (_a = null == collectedValues ? void 0 : collectedValues.length) && void 0 !== _a ? _a : 0) * (barWidth + barWidth / 3);
726
+ }
727
+ getIndicatorKeyInChartSpec(_col, _row) {
728
+ const chartSpec = this.getRawChartSpec(_col, _row), indicatorKeys = [];
729
+ return chartSpec ? (!1 === this.indicatorsAsCol ? chartSpec.series ? chartSpec.series.forEach((chartSeries => {
730
+ const yField = chartSeries.yField;
731
+ indicatorKeys.push(yField);
732
+ })) : indicatorKeys.push(chartSpec.yField) : chartSpec.series ? chartSpec.series.forEach((chartSeries => {
733
+ const xField = chartSeries.xField;
734
+ indicatorKeys.push(xField);
735
+ })) : indicatorKeys.push(chartSpec.xField), indicatorKeys) : null;
736
+ }
737
+ getDimensionKeyInChartSpec(_col, _row) {
738
+ const chartSpec = this.getRawChartSpec(_col, _row), dimensionKeys = [];
739
+ return chartSpec ? (!1 === this.indicatorsAsCol ? dimensionKeys.push(chartSpec.xField) : dimensionKeys.push(chartSpec.yField),
740
+ dimensionKeys) : null;
741
+ }
742
+ getAxisConfigInPivotChart(col, row) {
743
+ return (0, get_axis_config_1.getAxisConfigInPivotChart)(col, row, this);
744
+ }
745
+ getRawChartSpec(col, row) {
746
+ return (0, get_chart_spec_1.getRawChartSpec)(col, row, this);
747
+ }
748
+ getChartSpec(col, row) {
749
+ return (0, get_chart_spec_1.getChartSpec)(col, row, this);
750
+ }
751
+ getChartAxes(col, row) {
752
+ return (0, get_chart_spec_1.getChartAxes)(col, row, this);
753
+ }
754
+ getChartDataId(col, row) {
755
+ return (0, get_chart_spec_1.getChartDataId)(col, row, this);
756
+ }
757
+ isEmpty(col, row) {
758
+ return !!this._table.isPivotChart() && (col > this.colCount - this.rightFrozenColCount - 1 || row > this.rowCount - this.bottomFrozenRowCount - 1 || !(!this.hasTwoIndicatorAxes || !this.indicatorsAsCol || row !== this.columnHeaderLevelCount - 1));
759
+ }
446
760
  }
447
761
 
448
- exports.PivoLayoutMap = PivoLayoutMap;
762
+ exports.PivotLayoutMap = PivotLayoutMap;
449
763
  //# sourceMappingURL=pivot-layout.js.map