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