@visactor/vseed 0.0.19 → 0.0.21

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 (243) hide show
  1. package/dist/builder/builder/advanced/colorItems.d.ts +2 -0
  2. package/dist/builder/builder/advanced/index.d.ts +1 -0
  3. package/dist/builder/builder/builder.d.ts +259 -145
  4. package/dist/builder/register/chartType.d.ts +2 -0
  5. package/dist/builder/register/index.d.ts +1 -1
  6. package/dist/dataReshape/foldMeasures.d.ts +3 -3
  7. package/dist/index.cjs +930 -142
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.js +845 -135
  10. package/dist/index.js.map +1 -1
  11. package/dist/pipeline/advanced/chart/index.d.ts +1 -0
  12. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/area.d.ts +1 -1
  13. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/areaPercent.d.ts +1 -1
  14. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/bar.d.ts +1 -1
  15. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/barParallel.d.ts +1 -1
  16. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/barPercent.d.ts +1 -1
  17. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/column.d.ts +1 -1
  18. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/columnParallel.d.ts +1 -1
  19. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/columnPercent.d.ts +1 -1
  20. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/donut.d.ts +1 -1
  21. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/funnel.d.ts +1 -1
  22. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/line.d.ts +1 -1
  23. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/pie.d.ts +1 -1
  24. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/rose.d.ts +1 -1
  25. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/roseParallel.d.ts +1 -1
  26. package/dist/pipeline/advanced/{pipeline → chart/pipeline}/scatter.d.ts +1 -1
  27. package/dist/pipeline/advanced/chart/pipes/annotation/annotation.d.ts +2 -0
  28. package/dist/pipeline/advanced/{pipes → chart/pipes}/config/config.d.ts +1 -1
  29. package/dist/pipeline/advanced/chart/pipes/encoding/encodingFunnel.d.ts +2 -0
  30. package/dist/pipeline/advanced/chart/pipes/encoding/encodingPie.d.ts +2 -0
  31. package/dist/pipeline/advanced/chart/pipes/encoding/encodingRose.d.ts +2 -0
  32. package/dist/pipeline/advanced/chart/pipes/encoding/encodingXY.d.ts +2 -0
  33. package/dist/pipeline/advanced/chart/pipes/encoding/encodingYX.d.ts +2 -0
  34. package/dist/pipeline/advanced/chart/pipes/encoding/encodingYY.d.ts +2 -0
  35. package/dist/pipeline/advanced/{pipes → chart/pipes}/encoding/index.d.ts +1 -0
  36. package/dist/pipeline/advanced/{pipes → chart/pipes}/index.d.ts +0 -1
  37. package/dist/pipeline/advanced/chart/pipes/init/autoDimensions.d.ts +2 -0
  38. package/dist/pipeline/advanced/chart/pipes/init/autoMeasures.d.ts +2 -0
  39. package/dist/pipeline/advanced/chart/pipes/init/initAdvancedVSeed.d.ts +2 -0
  40. package/dist/pipeline/advanced/chart/pipes/markStyle/markStyle.d.ts +2 -0
  41. package/dist/pipeline/advanced/{pipes → chart/pipes}/pivot/pivotAdapter.d.ts +1 -1
  42. package/dist/pipeline/advanced/{pipes → chart/pipes}/reshape/pivotReshapeTo1D1M.d.ts +1 -1
  43. package/dist/pipeline/advanced/{pipes → chart/pipes}/reshape/pivotReshapeTo1D2M.d.ts +1 -1
  44. package/dist/pipeline/advanced/{pipes → chart/pipes}/reshape/pivotReshapeTo2D1M.d.ts +1 -1
  45. package/dist/pipeline/advanced/{pipes → chart/pipes}/reshape/reshapeTo1D1M.d.ts +1 -1
  46. package/dist/pipeline/advanced/{pipes → chart/pipes}/reshape/reshapeTo1D2M.d.ts +1 -1
  47. package/dist/pipeline/advanced/{pipes → chart/pipes}/reshape/reshapeTo2D1M.d.ts +1 -1
  48. package/dist/pipeline/advanced/chart/pipes/theme/theme.d.ts +2 -0
  49. package/dist/pipeline/advanced/index.d.ts +2 -1
  50. package/dist/pipeline/advanced/table/index.d.ts +1 -0
  51. package/dist/pipeline/advanced/table/pipeline/index.d.ts +2 -0
  52. package/dist/pipeline/advanced/table/pipeline/pivotTable.d.ts +2 -0
  53. package/dist/pipeline/advanced/table/pipeline/table.d.ts +2 -0
  54. package/dist/pipeline/advanced/table/pipes/index.d.ts +2 -0
  55. package/dist/pipeline/advanced/table/pipes/init/autoDimensions.d.ts +2 -0
  56. package/dist/pipeline/advanced/table/pipes/init/autoMeasures.d.ts +2 -0
  57. package/dist/pipeline/advanced/table/pipes/init/autoPivotDimensions.d.ts +2 -0
  58. package/dist/pipeline/advanced/table/pipes/init/autoPivotMeasures.d.ts +2 -0
  59. package/dist/pipeline/advanced/table/pipes/init/index.d.ts +5 -0
  60. package/dist/pipeline/advanced/table/pipes/init/initAdvancedVSeed.d.ts +2 -0
  61. package/dist/pipeline/advanced/table/pipes/records/index.d.ts +1 -0
  62. package/dist/pipeline/advanced/table/pipes/records/records.d.ts +2 -0
  63. package/dist/pipeline/spec/chart/index.d.ts +1 -0
  64. package/dist/pipeline/spec/chart/pipeline/area.d.ts +1 -0
  65. package/dist/pipeline/spec/chart/pipeline/areaPercent.d.ts +1 -0
  66. package/dist/pipeline/spec/chart/pipeline/bar.d.ts +2 -0
  67. package/dist/pipeline/spec/{pipeline → chart/pipeline}/barParallel.d.ts +1 -1
  68. package/dist/pipeline/spec/{pipeline → chart/pipeline}/barPercent.d.ts +1 -1
  69. package/dist/pipeline/spec/chart/pipeline/column.d.ts +1 -0
  70. package/dist/pipeline/spec/{pipeline → chart/pipeline}/columnParallel.d.ts +1 -1
  71. package/dist/pipeline/spec/{pipeline → chart/pipeline}/columnPercent.d.ts +1 -1
  72. package/dist/pipeline/spec/chart/pipeline/donut.d.ts +2 -0
  73. package/dist/pipeline/spec/{pipeline → chart/pipeline}/funnel.d.ts +1 -1
  74. package/dist/pipeline/spec/chart/pipeline/line.d.ts +2 -0
  75. package/dist/pipeline/spec/chart/pipeline/pie.d.ts +2 -0
  76. package/dist/pipeline/spec/chart/pipeline/rose.d.ts +1 -0
  77. package/dist/pipeline/spec/{pipeline → chart/pipeline}/roseParallel.d.ts +1 -1
  78. package/dist/pipeline/spec/{pipeline → chart/pipeline}/scatter.d.ts +1 -1
  79. package/dist/pipeline/spec/chart/pipes/index.d.ts +14 -0
  80. package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/index.d.ts +1 -0
  81. package/dist/pipeline/spec/index.d.ts +2 -1
  82. package/dist/pipeline/spec/table/index.d.ts +1 -0
  83. package/dist/pipeline/spec/table/pipeline/index.d.ts +2 -0
  84. package/dist/pipeline/spec/table/pipeline/pivotTable.d.ts +2 -0
  85. package/dist/pipeline/spec/table/pipeline/table.d.ts +2 -0
  86. package/dist/pipeline/spec/table/pipes/columns/index.d.ts +2 -0
  87. package/dist/pipeline/spec/table/pipes/columns/measuresToColumns.d.ts +3 -0
  88. package/dist/pipeline/spec/table/pipes/columns/pivotColumns.d.ts +2 -0
  89. package/dist/pipeline/spec/table/pipes/index.d.ts +5 -0
  90. package/dist/pipeline/spec/table/pipes/indicators/index.d.ts +1 -0
  91. package/dist/pipeline/spec/table/pipes/indicators/pivotIndicators.d.ts +2 -0
  92. package/dist/pipeline/spec/table/pipes/init/index.d.ts +2 -0
  93. package/dist/pipeline/spec/table/pipes/init/pivotTable.d.ts +2 -0
  94. package/dist/pipeline/spec/table/pipes/init/table.d.ts +2 -0
  95. package/dist/pipeline/spec/table/pipes/rows/index.d.ts +1 -0
  96. package/dist/pipeline/spec/table/pipes/rows/pivotRows.d.ts +2 -0
  97. package/dist/pipeline/spec/table/pipes/theme/bodyStyle.d.ts +2 -0
  98. package/dist/pipeline/spec/table/pipes/theme/cornerHeaderStyle.d.ts +2 -0
  99. package/dist/pipeline/spec/table/pipes/theme/frameStyle.d.ts +2 -0
  100. package/dist/pipeline/spec/table/pipes/theme/headerStyle.d.ts +2 -0
  101. package/dist/pipeline/spec/table/pipes/theme/index.d.ts +6 -0
  102. package/dist/pipeline/spec/table/pipes/theme/rowHeaderStyle.d.ts +2 -0
  103. package/dist/pipeline/spec/table/pipes/theme/scrollStyle.d.ts +2 -0
  104. package/dist/pipeline/spec/table/pipes/theme/selectionStyle.d.ts +2 -0
  105. package/dist/pipeline/utils/chatType.d.ts +4 -2
  106. package/dist/pipeline/utils/dimensions/find.d.ts +4 -0
  107. package/dist/pipeline/utils/dimensions/index.d.ts +1 -0
  108. package/dist/pipeline/utils/index.d.ts +2 -0
  109. package/dist/pipeline/utils/measures/find.d.ts +4 -0
  110. package/dist/pipeline/utils/measures/index.d.ts +1 -1
  111. package/dist/pipeline/utils/tree/index.d.ts +1 -0
  112. package/dist/pipeline/utils/tree/traverse.d.ts +11 -0
  113. package/dist/types/advancedVSeed.d.ts +57 -52
  114. package/dist/types/builder/builder.d.ts +1 -0
  115. package/dist/types/chartType/area/area.d.ts +12 -51
  116. package/dist/types/chartType/areaPercent/areaPercent.d.ts +12 -51
  117. package/dist/types/chartType/bar/bar.d.ts +13 -51
  118. package/dist/types/chartType/barParallel/barParallel.d.ts +12 -51
  119. package/dist/types/chartType/barPercent/barPercent.d.ts +12 -51
  120. package/dist/types/chartType/column/column.d.ts +12 -51
  121. package/dist/types/chartType/columnParallel/columnParallel.d.ts +12 -51
  122. package/dist/types/chartType/columnPercent/columnPercent.d.ts +12 -51
  123. package/dist/types/chartType/donut/donut.d.ts +12 -51
  124. package/dist/types/chartType/dualAxis/dualAxis.d.ts +3 -3
  125. package/dist/types/chartType/funnel/funnel.d.ts +12 -51
  126. package/dist/types/chartType/index.d.ts +3 -3
  127. package/dist/types/chartType/line/line.d.ts +12 -51
  128. package/dist/types/chartType/pie/pie.d.ts +12 -51
  129. package/dist/types/chartType/pivotTable/index.d.ts +1 -1
  130. package/dist/types/chartType/pivotTable/pivotTable.d.ts +58 -2
  131. package/dist/types/chartType/rose/rose.d.ts +12 -50
  132. package/dist/types/chartType/roseParallel/roseParallel.d.ts +13 -51
  133. package/dist/types/chartType/scatter/scatter.d.ts +12 -51
  134. package/dist/types/chartType/table/index.d.ts +1 -1
  135. package/dist/types/chartType/table/table.d.ts +60 -4
  136. package/dist/types/properties/config/config.d.ts +50 -2
  137. package/dist/types/properties/dimensions/dimensions.d.ts +28 -10
  138. package/dist/types/properties/dimensions/index.d.ts +1 -2
  139. package/dist/types/properties/measures/measures.d.ts +44 -84
  140. package/dist/types/properties/theme/customTheme.d.ts +48 -4
  141. package/dist/types/vseed.d.ts +241 -720
  142. package/dist/umd/index.js +1202 -144
  143. package/dist/umd/index.js.map +1 -1
  144. package/package.json +1 -1
  145. package/dist/pipeline/advanced/pipes/annotation/annotation.d.ts +0 -2
  146. package/dist/pipeline/advanced/pipes/encoding/encodingFunnel.d.ts +0 -2
  147. package/dist/pipeline/advanced/pipes/encoding/encodingPie.d.ts +0 -2
  148. package/dist/pipeline/advanced/pipes/encoding/encodingRose.d.ts +0 -2
  149. package/dist/pipeline/advanced/pipes/encoding/encodingXY.d.ts +0 -2
  150. package/dist/pipeline/advanced/pipes/encoding/encodingYX.d.ts +0 -2
  151. package/dist/pipeline/advanced/pipes/encoding/encodingYY.d.ts +0 -2
  152. package/dist/pipeline/advanced/pipes/i18n/index.d.ts +0 -1
  153. package/dist/pipeline/advanced/pipes/i18n/locale.d.ts +0 -2
  154. package/dist/pipeline/advanced/pipes/init/autoDimensions.d.ts +0 -2
  155. package/dist/pipeline/advanced/pipes/init/autoMeasures.d.ts +0 -2
  156. package/dist/pipeline/advanced/pipes/init/initAdvancedVSeed.d.ts +0 -2
  157. package/dist/pipeline/advanced/pipes/init/utils.d.ts +0 -1
  158. package/dist/pipeline/advanced/pipes/markStyle/markStyle.d.ts +0 -2
  159. package/dist/pipeline/advanced/pipes/theme/theme.d.ts +0 -2
  160. package/dist/pipeline/spec/pipeline/area.d.ts +0 -1
  161. package/dist/pipeline/spec/pipeline/areaPercent.d.ts +0 -1
  162. package/dist/pipeline/spec/pipeline/bar.d.ts +0 -2
  163. package/dist/pipeline/spec/pipeline/column.d.ts +0 -1
  164. package/dist/pipeline/spec/pipeline/donut.d.ts +0 -2
  165. package/dist/pipeline/spec/pipeline/line.d.ts +0 -2
  166. package/dist/pipeline/spec/pipeline/pie.d.ts +0 -2
  167. package/dist/pipeline/spec/pipeline/rose.d.ts +0 -1
  168. package/dist/pipeline/spec/pipes/index.d.ts +0 -14
  169. package/dist/pipeline/utils/measures/findMeasureById.d.ts +0 -3
  170. /package/dist/pipeline/advanced/{pipeline → chart/pipeline}/index.d.ts +0 -0
  171. /package/dist/pipeline/advanced/{pipes → chart/pipes}/annotation/index.d.ts +0 -0
  172. /package/dist/pipeline/advanced/{pipes → chart/pipes}/config/index.d.ts +0 -0
  173. /package/dist/pipeline/advanced/{pipes → chart/pipes}/init/index.d.ts +0 -0
  174. /package/dist/pipeline/advanced/{pipes → chart/pipes}/markStyle/index.d.ts +0 -0
  175. /package/dist/pipeline/advanced/{pipes → chart/pipes}/pivot/index.d.ts +0 -0
  176. /package/dist/pipeline/advanced/{pipes → chart/pipes}/reshape/index.d.ts +0 -0
  177. /package/dist/pipeline/advanced/{pipes → chart/pipes}/theme/index.d.ts +0 -0
  178. /package/dist/pipeline/spec/{pipeline → chart/pipeline}/index.d.ts +0 -0
  179. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/annotation/annotationArea.d.ts +0 -0
  180. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/annotation/annotationAreaBand.d.ts +0 -0
  181. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/annotation/annotationHorizontalLine.d.ts +0 -0
  182. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/annotation/annotationPoint.d.ts +0 -0
  183. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/annotation/annotationVerticalLine.d.ts +0 -0
  184. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/annotation/index.d.ts +0 -0
  185. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/annotation/utils.d.ts +0 -0
  186. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/axes/a.d.ts +0 -0
  187. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/axes/angle.d.ts +0 -0
  188. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/axes/index.d.ts +0 -0
  189. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/axes/radius.d.ts +0 -0
  190. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/axes/xBand.d.ts +0 -0
  191. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/axes/xLinear.d.ts +0 -0
  192. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/axes/yBand.d.ts +0 -0
  193. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/axes/yLinear.d.ts +0 -0
  194. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/backgroundColor/background.d.ts +0 -0
  195. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/backgroundColor/index.d.ts +0 -0
  196. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/color/color.d.ts +0 -0
  197. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/color/index.d.ts +0 -0
  198. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/crosshair/horizontalCrosshairLine.d.ts +0 -0
  199. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/crosshair/horizontalCrosshairRect.d.ts +0 -0
  200. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/crosshair/index.d.ts +0 -0
  201. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/crosshair/verticalCrosshairLine.d.ts +0 -0
  202. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/crosshair/verticalCrosshairRect.d.ts +0 -0
  203. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/dataset/dataset.d.ts +0 -0
  204. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/dataset/datasetPivot.d.ts +0 -0
  205. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/dataset/index.d.ts +0 -0
  206. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/area.d.ts +0 -0
  207. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/bar.d.ts +0 -0
  208. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/barParallel.d.ts +0 -0
  209. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/column.d.ts +0 -0
  210. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/columnParallel.d.ts +0 -0
  211. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/donut.d.ts +0 -0
  212. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/funnel.d.ts +0 -0
  213. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/line.d.ts +0 -0
  214. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/pie.d.ts +0 -0
  215. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/pivot.d.ts +0 -0
  216. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/rose.d.ts +0 -0
  217. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/roseParallel.d.ts +0 -0
  218. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/init/scatter.d.ts +0 -0
  219. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/label/index.d.ts +0 -0
  220. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/label/label.d.ts +0 -0
  221. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/legend/discreteLegend.d.ts +0 -0
  222. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/legend/index.d.ts +0 -0
  223. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/legend/pivotDiscreteLegend.d.ts +0 -0
  224. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/markStyle/areaStyle.d.ts +0 -0
  225. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/markStyle/barStyle.d.ts +0 -0
  226. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/markStyle/index.d.ts +0 -0
  227. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/markStyle/lineStyle.d.ts +0 -0
  228. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/markStyle/pointState.d.ts +0 -0
  229. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/markStyle/pointStyle.d.ts +0 -0
  230. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/percent/index.d.ts +0 -0
  231. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/percent/percent.d.ts +0 -0
  232. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/pivotChart/index.d.ts +0 -0
  233. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/pivotChart/pivotAdapter.d.ts +0 -0
  234. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/pivotChart/pivotColumnDimensions.d.ts +0 -0
  235. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/pivotChart/pivotGridStyle.d.ts +0 -0
  236. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/pivotChart/pivotIndicators.d.ts +0 -0
  237. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/pivotChart/pivotRowDimensions.d.ts +0 -0
  238. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/stack/index.d.ts +0 -0
  239. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/stack/stack.d.ts +0 -0
  240. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/stack/stackCornerRadius.d.ts +0 -0
  241. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/tooltip/index.d.ts +0 -0
  242. /package/dist/pipeline/spec/{pipes/vchart → chart/pipes}/tooltip/tooltip.d.ts +0 -0
  243. /package/dist/pipeline/{constant.d.ts → utils/constant.d.ts} +0 -0
package/dist/umd/index.js CHANGED
@@ -36,6 +36,7 @@
36
36
  pieAdvancedPipeline: ()=>pieAdvancedPipeline,
37
37
  execPipeline: ()=>execPipeline,
38
38
  areaSpecPipeline: ()=>areaSpecPipeline,
39
+ isTable: ()=>isTable,
39
40
  zDonut: ()=>zDonut,
40
41
  zRoseConfig: ()=>zRoseConfig,
41
42
  findFirstMeasure: ()=>findFirstMeasure,
@@ -46,16 +47,21 @@
46
47
  columnPercentAdvancedPipeline: ()=>columnPercentAdvancedPipeline,
47
48
  zColumnConfig: ()=>zColumnConfig,
48
49
  zAnnotation: ()=>zAnnotation,
50
+ pivotTableAdvancedPipeline: ()=>pivotTableAdvancedPipeline,
49
51
  zYBandAxis: ()=>zYBandAxis,
50
52
  dataReshapeFor1D2M: ()=>dataReshapeFor1D2M,
51
53
  zAnnotationHorizontalLine: ()=>zAnnotationHorizontalLine,
52
54
  zMarkStyle: ()=>zMarkStyle,
53
- zYLinearAxis: ()=>zYLinearAxis,
55
+ registerFunnel: ()=>registerFunnel,
54
56
  Separator: ()=>Separator,
57
+ zYLinearAxis: ()=>zYLinearAxis,
55
58
  columnAdvancedPipeline: ()=>columnAdvancedPipeline,
56
59
  zLabel: ()=>zLabel,
57
60
  registerColumn: ()=>registerColumn,
61
+ findAllMeasures: ()=>findAllMeasures,
58
62
  funnelSpecPipeline: ()=>funnelSpecPipeline,
63
+ preorderTraverse: ()=>preorderTraverse,
64
+ zDimensionTree: ()=>zDimensionTree,
59
65
  roseParallelSpecPipeline: ()=>roseParallelSpecPipeline,
60
66
  zLineStyle: ()=>zLineStyle,
61
67
  dataReshapeFor1D1M: ()=>dataReshapeFor1D1M,
@@ -65,6 +71,9 @@
65
71
  UnfoldDimensionGroupId: ()=>UnfoldDimensionGroupId,
66
72
  zNumFormat: ()=>zNumFormat,
67
73
  barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
74
+ findAllDimensions: ()=>findAllDimensions,
75
+ findDimensionById: ()=>findDimensionById,
76
+ zPivotTableConfig: ()=>zPivotTableConfig,
68
77
  zArea: ()=>zArea,
69
78
  zColumnParallel: ()=>zColumnParallel,
70
79
  zDimensions: ()=>zDimensions,
@@ -82,29 +91,39 @@
82
91
  zCrosshairLine: ()=>zCrosshairLine,
83
92
  registerBarPercent: ()=>registerBarPercent,
84
93
  roseSpecPipeline: ()=>roseSpecPipeline,
94
+ zPivotTable: ()=>zPivotTable,
85
95
  registerLightTheme: ()=>registerLightTheme,
86
96
  roseAdvancedPipeline: ()=>roseAdvancedPipeline,
87
97
  zBarParallel: ()=>zBarParallel,
98
+ zAnnotationVerticalLine: ()=>zAnnotationVerticalLine,
88
99
  zChartType: ()=>zChartType,
100
+ tableAdvancedPipeline: ()=>tableAdvancedPipeline,
89
101
  registerDarkTheme: ()=>registerDarkTheme,
90
- zAnnotationVerticalLine: ()=>zAnnotationVerticalLine,
102
+ registerPivotTable: ()=>registerPivotTable,
91
103
  pieSpecPipeline: ()=>pieSpecPipeline,
92
- zStackCornerRadius: ()=>zStackCornerRadius,
104
+ zMeasureTree: ()=>zMeasureTree,
93
105
  barSpecPipeline: ()=>barSpecPipeline,
106
+ zStackCornerRadius: ()=>zStackCornerRadius,
107
+ registerRose: ()=>registerRose,
94
108
  zRose: ()=>zRose,
95
109
  unfoldDimensions: ()=>unfoldDimensions,
96
110
  roseParallelAdvancedPipeline: ()=>roseParallelAdvancedPipeline,
97
- zPieConfig: ()=>zPieConfig,
111
+ registerTable: ()=>registerTable,
98
112
  autoFormatter: ()=>autoFormatter,
113
+ findFirstDimension: ()=>findFirstDimension,
99
114
  Builder: ()=>Builder,
100
- registerBar: ()=>registerBar,
101
115
  registerAll: ()=>registerAll,
116
+ registerBar: ()=>registerBar,
102
117
  isVChart: ()=>isVChart,
118
+ zPieConfig: ()=>zPieConfig,
119
+ zTable: ()=>zTable,
103
120
  registerLine: ()=>registerLine,
104
121
  registerCustomTheme: ()=>registerCustomTheme,
105
122
  zColor: ()=>zColor,
106
- zMeasureGroup: ()=>zMeasureGroup,
123
+ registerRoseParallel: ()=>registerRoseParallel,
124
+ registerDonut: ()=>registerDonut,
107
125
  zDonutConfig: ()=>zDonutConfig,
126
+ zMeasureGroup: ()=>zMeasureGroup,
108
127
  zUnfoldInfo: ()=>zUnfoldInfo,
109
128
  zFunnelConfig: ()=>zFunnelConfig,
110
129
  zMeasures: ()=>zMeasures,
@@ -134,6 +153,7 @@
134
153
  zColumn: ()=>zColumn,
135
154
  zCustomTheme: ()=>zCustomTheme,
136
155
  zLineConfig: ()=>zLineConfig,
156
+ zTableConfig: ()=>zTableConfig,
137
157
  zXBandAxis: ()=>zXBandAxis,
138
158
  zColumnPercentConfig: ()=>zColumnPercentConfig,
139
159
  findMeasureById: ()=>findMeasureById,
@@ -144,13 +164,16 @@
144
164
  registerBarParallel: ()=>registerBarParallel,
145
165
  zMeasure: ()=>zMeasure,
146
166
  zLocale: ()=>zLocale,
167
+ pivotTableSpecPipeline: ()=>pivotTableSpecPipeline,
168
+ registerScatter: ()=>registerScatter,
147
169
  zEncoding: ()=>zEncoding,
148
170
  autoNumFormatter: ()=>autoNumFormatter,
149
171
  zAdvancedVSeed: ()=>zAdvancedVSeed,
150
- zXLinearAxis: ()=>zXLinearAxis,
172
+ tableSpecPipeline: ()=>tableSpecPipeline,
151
173
  zConfig: ()=>zConfig,
152
174
  zRoseParallelConfig: ()=>zRoseParallelConfig,
153
175
  zBarStyle: ()=>zBarStyle,
176
+ zXLinearAxis: ()=>zXLinearAxis,
154
177
  zAreaPercent: ()=>zAreaPercent,
155
178
  columnParallelAdvancedPipeline: ()=>columnParallelAdvancedPipeline,
156
179
  zColumnPercent: ()=>zColumnPercent,
@@ -158,9 +181,10 @@
158
181
  zScatter: ()=>zScatter,
159
182
  foldMeasures: ()=>foldMeasures,
160
183
  dataReshapeFor2D1M: ()=>dataReshapeFor2D1M,
184
+ isPivotTable: ()=>isPivotTable,
185
+ registerPie: ()=>registerPie,
161
186
  zFunnel: ()=>zFunnel,
162
187
  zScatterConfig: ()=>zScatterConfig,
163
- zTooltip: ()=>zTooltip,
164
188
  zBarParallelConfig: ()=>zBarParallelConfig,
165
189
  barParallelAdvancedPipeline: ()=>barParallelAdvancedPipeline,
166
190
  FoldMeasureValue: ()=>FoldMeasureValue,
@@ -168,7 +192,9 @@
168
192
  barPercentSpecPipeline: ()=>barPercentSpecPipeline,
169
193
  lineAdvancedPipeline: ()=>lineAdvancedPipeline,
170
194
  lineSpecPipeline: ()=>lineSpecPipeline,
195
+ zTooltip: ()=>zTooltip,
171
196
  createFormatter: ()=>createFormatter,
197
+ zDimensionGroup: ()=>zDimensionGroup,
172
198
  columnPercentSpecPipeline: ()=>columnPercentSpecPipeline,
173
199
  areaAdvancedPipeline: ()=>areaAdvancedPipeline,
174
200
  areaPercentSpecPipeline: ()=>areaPercentSpecPipeline,
@@ -177,23 +203,27 @@
177
203
  });
178
204
  const initAdvancedVSeed = (advancedVSeed, context)=>{
179
205
  const { vseed } = context;
180
- const { chartType } = vseed;
206
+ const { chartType, locale } = vseed;
181
207
  return {
182
208
  ...advancedVSeed,
183
- chartType
209
+ chartType,
210
+ locale: locale || 'zh-CN'
184
211
  };
185
212
  };
186
213
  const execPipeline = (pipeline, context, initialValue = {})=>{
187
214
  const result = pipeline.reduce((prev, cur)=>cur(prev, context), initialValue);
188
215
  return result;
189
216
  };
217
+ const isTable = (vseed)=>'table' === vseed.chartType;
218
+ const isPivotTable = (vseed)=>'pivotTable' === vseed.chartType;
190
219
  const isVTable = (vseed)=>[
191
220
  'table',
192
221
  'pivotTable'
193
222
  ].includes(vseed.chartType);
194
223
  const isVChart = (vseed)=>!isVTable(vseed);
195
224
  const isPivotChart = (vseed)=>{
196
- const { measures, dimensions } = vseed;
225
+ if (isVTable(vseed)) return false;
226
+ const { measures = [], dimensions = [] } = vseed;
197
227
  const hasRowOrColumnDimension = dimensions && dimensions.some((dimension)=>'rowDimension' === dimension.location || 'columnDimension' === dimension.location);
198
228
  const hasMeasureGroup = measures && measures.find((measure)=>measure && measure.children);
199
229
  return hasRowOrColumnDimension || hasMeasureGroup;
@@ -289,32 +319,92 @@
289
319
  };
290
320
  const createFormatter = (format)=>createNumFormatter(format);
291
321
  const autoFormatter = (value, locale)=>autoNumFormatter(value, locale);
292
- const findMeasureById = (measures = [], id)=>{
293
- if (!measures) return;
322
+ const preorderTraverse = (tree, callback)=>{
323
+ if (!tree || 0 === tree.length) return;
294
324
  const stack = [
295
- ...measures
296
- ];
325
+ ...tree
326
+ ].reverse();
297
327
  while(stack.length > 0){
298
- const current = stack.pop();
299
- if (!current) continue;
300
- if (current.id === id && !('children' in current)) return current;
301
- if ('children' in current && current.children) stack.push(...current.children);
328
+ const node = stack.pop();
329
+ const stop = callback(node);
330
+ if (true === stop) return;
331
+ if (!('children' in node)) continue;
332
+ const children = node.children;
333
+ if (children && children.length > 0) for(let i = children.length - 1; i >= 0; i--){
334
+ const child = children[i];
335
+ stack.push(child);
336
+ }
302
337
  }
303
338
  };
339
+ const findMeasureById = (measures = [], id)=>{
340
+ if (!measures) return;
341
+ let result;
342
+ preorderTraverse(measures, (node)=>{
343
+ if (!('children' in node)) {
344
+ if (node.id === id) {
345
+ result = node;
346
+ return true;
347
+ }
348
+ }
349
+ return false;
350
+ });
351
+ return result;
352
+ };
304
353
  const findFirstMeasure = (measures = [])=>{
305
354
  if (!measures) return;
306
- const stack = [
307
- ...measures
308
- ].reverse();
309
- while(stack.length > 0){
310
- const current = stack.pop();
311
- if (!current) continue;
312
- if (!('children' in current)) return current;
313
- if ('children' in current && current.children) {
314
- const children = (current.children || []).reverse();
315
- stack.push(...children);
355
+ let result;
356
+ preorderTraverse(measures, (node)=>{
357
+ if (!('children' in node)) {
358
+ result = node;
359
+ return true;
316
360
  }
317
- }
361
+ return false;
362
+ });
363
+ return result;
364
+ };
365
+ const findAllMeasures = (measures = [])=>{
366
+ if (!measures) return [];
367
+ const result = [];
368
+ preorderTraverse(measures, (node)=>{
369
+ if (!('children' in node)) result.push(node);
370
+ return false;
371
+ });
372
+ return result;
373
+ };
374
+ const findDimensionById = (dimensions = [], id)=>{
375
+ if (!dimensions) return;
376
+ let result;
377
+ preorderTraverse(dimensions, (node)=>{
378
+ if (!('children' in node)) {
379
+ if (node.id === id) {
380
+ result = node;
381
+ return true;
382
+ }
383
+ }
384
+ return false;
385
+ });
386
+ return result;
387
+ };
388
+ const findFirstDimension = (dimensions = [])=>{
389
+ if (!dimensions) return;
390
+ let result;
391
+ preorderTraverse(dimensions, (node)=>{
392
+ if (!('children' in node)) {
393
+ result = node;
394
+ return true;
395
+ }
396
+ return false;
397
+ });
398
+ return result;
399
+ };
400
+ const findAllDimensions = (dimensions = [])=>{
401
+ if (!dimensions) return [];
402
+ const result = [];
403
+ preorderTraverse(dimensions, (node)=>{
404
+ if (!('children' in node)) result.push(node);
405
+ return false;
406
+ });
407
+ return result;
318
408
  };
319
409
  const autoMeasures = (advancedVSeed, context)=>{
320
410
  const result = {
@@ -393,7 +483,7 @@
393
483
  };
394
484
  const { vseed } = context;
395
485
  const { dimensions, dataset } = vseed;
396
- const { measures = [] } = advancedVSeed;
486
+ const measures = findAllMeasures(advancedVSeed.measures);
397
487
  if (!dataset) throw new Error('dataset is required');
398
488
  if (0 === dataset.length) return result;
399
489
  if (dimensions) {
@@ -527,7 +617,10 @@
527
617
  for(let i = 0; i < dataset.length; i++){
528
618
  const datum = dataset[i];
529
619
  const colorName = generateDimGroupName(dimensionsToBeUnfolded, datum, dimensionsSeparator);
530
- const colorId = colorName + (datum[foldMeasureId] || '');
620
+ const colorId = [
621
+ colorName,
622
+ datum[foldMeasureId] || 'id'
623
+ ].join(dimensionsSeparator);
531
624
  datum[unfoldGroupName] = colorName;
532
625
  datum[unfoldGroupId] = colorId;
533
626
  colorItems.push(colorId);
@@ -861,7 +954,8 @@
861
954
  };
862
955
  const { vseed } = context;
863
956
  const { dataset } = vseed;
864
- const { dimensions, measures } = advancedVSeed;
957
+ const { measures } = advancedVSeed;
958
+ const dimensions = advancedVSeed.dimensions;
865
959
  if (!measures || !dimensions) return result;
866
960
  const measureGroups = [];
867
961
  if (measures) measures.forEach((measure)=>{
@@ -900,7 +994,8 @@
900
994
  };
901
995
  const { vseed } = context;
902
996
  const { dataset } = vseed;
903
- const { dimensions, measures } = advancedVSeed;
997
+ const { measures } = advancedVSeed;
998
+ const dimensions = advancedVSeed.dimensions;
904
999
  if (!measures || !dimensions) return result;
905
1000
  const measureGroups = [];
906
1001
  if (measures) measures.forEach((measure)=>{
@@ -939,7 +1034,8 @@
939
1034
  };
940
1035
  const { vseed } = context;
941
1036
  const { dataset } = vseed;
942
- const { dimensions, measures } = advancedVSeed;
1037
+ const { measures } = advancedVSeed;
1038
+ const dimensions = advancedVSeed.dimensions;
943
1039
  if (!measures || !dimensions) return result;
944
1040
  const measureGroups = [];
945
1041
  if (measures) measures.forEach((measure)=>{
@@ -1044,6 +1140,42 @@
1044
1140
  encoding
1045
1141
  };
1046
1142
  };
1143
+ const encodingYY = (advancedVSeed)=>{
1144
+ const result = {
1145
+ ...advancedVSeed
1146
+ };
1147
+ const { datasetReshapeInfo, measures } = advancedVSeed;
1148
+ if (!datasetReshapeInfo || !measures) return result;
1149
+ const firstMeasure = findFirstMeasure(measures);
1150
+ const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
1151
+ const { foldInfo, unfoldInfo } = cur;
1152
+ const x = [
1153
+ firstMeasure?.id
1154
+ ];
1155
+ const y = [
1156
+ foldInfo.measureValue
1157
+ ];
1158
+ const group = [
1159
+ unfoldInfo.groupId
1160
+ ];
1161
+ const color = [
1162
+ unfoldInfo.groupId
1163
+ ];
1164
+ return [
1165
+ ...prev,
1166
+ {
1167
+ x,
1168
+ y,
1169
+ group,
1170
+ color
1171
+ }
1172
+ ];
1173
+ }, []);
1174
+ return {
1175
+ ...result,
1176
+ encoding
1177
+ };
1178
+ };
1047
1179
  const encodingRose = (advancedVSeed)=>{
1048
1180
  const result = {
1049
1181
  ...advancedVSeed
@@ -1337,17 +1469,8 @@
1337
1469
  annotation
1338
1470
  };
1339
1471
  };
1340
- const locale_locale = (advancedVSeed, context)=>{
1341
- const { vseed } = context;
1342
- const { locale } = vseed;
1343
- return {
1344
- ...advancedVSeed,
1345
- locale: locale || 'zh-CN'
1346
- };
1347
- };
1348
1472
  const lineAdvancedPipeline = [
1349
1473
  initAdvancedVSeed,
1350
- locale_locale,
1351
1474
  autoMeasures,
1352
1475
  autoDimensions,
1353
1476
  pivotAdapter([
@@ -1363,7 +1486,6 @@
1363
1486
  ];
1364
1487
  const barAdvancedPipeline = [
1365
1488
  initAdvancedVSeed,
1366
- locale_locale,
1367
1489
  autoMeasures,
1368
1490
  autoDimensions,
1369
1491
  pivotAdapter([
@@ -1379,7 +1501,6 @@
1379
1501
  ];
1380
1502
  const barParallelAdvancedPipeline = [
1381
1503
  initAdvancedVSeed,
1382
- locale_locale,
1383
1504
  autoMeasures,
1384
1505
  autoDimensions,
1385
1506
  pivotAdapter([
@@ -1395,7 +1516,6 @@
1395
1516
  ];
1396
1517
  const barPercentAdvancedPipeline = [
1397
1518
  initAdvancedVSeed,
1398
- locale_locale,
1399
1519
  autoMeasures,
1400
1520
  autoDimensions,
1401
1521
  pivotAdapter([
@@ -1411,7 +1531,6 @@
1411
1531
  ];
1412
1532
  const columnAdvancedPipeline = [
1413
1533
  initAdvancedVSeed,
1414
- locale_locale,
1415
1534
  autoMeasures,
1416
1535
  autoDimensions,
1417
1536
  pivotAdapter([
@@ -1427,7 +1546,6 @@
1427
1546
  ];
1428
1547
  const columnParallelAdvancedPipeline = [
1429
1548
  initAdvancedVSeed,
1430
- locale_locale,
1431
1549
  autoMeasures,
1432
1550
  autoDimensions,
1433
1551
  pivotAdapter([
@@ -1443,7 +1561,6 @@
1443
1561
  ];
1444
1562
  const columnPercentAdvancedPipeline = [
1445
1563
  initAdvancedVSeed,
1446
- locale_locale,
1447
1564
  autoMeasures,
1448
1565
  autoDimensions,
1449
1566
  pivotAdapter([
@@ -1459,7 +1576,6 @@
1459
1576
  ];
1460
1577
  const areaAdvancedPipeline = [
1461
1578
  initAdvancedVSeed,
1462
- locale_locale,
1463
1579
  autoMeasures,
1464
1580
  autoDimensions,
1465
1581
  pivotAdapter([
@@ -1475,7 +1591,6 @@
1475
1591
  ];
1476
1592
  const areaPercentAdvancedPipeline = [
1477
1593
  initAdvancedVSeed,
1478
- locale_locale,
1479
1594
  autoMeasures,
1480
1595
  autoDimensions,
1481
1596
  pivotAdapter([
@@ -1491,7 +1606,6 @@
1491
1606
  ];
1492
1607
  const pieAdvancedPipeline = [
1493
1608
  initAdvancedVSeed,
1494
- locale_locale,
1495
1609
  autoMeasures,
1496
1610
  autoDimensions,
1497
1611
  pivotAdapter([
@@ -1506,7 +1620,6 @@
1506
1620
  ];
1507
1621
  const donutAdvancedPipeline = [
1508
1622
  initAdvancedVSeed,
1509
- locale_locale,
1510
1623
  autoMeasures,
1511
1624
  autoDimensions,
1512
1625
  pivotAdapter([
@@ -1521,7 +1634,6 @@
1521
1634
  ];
1522
1635
  const roseAdvancedPipeline = [
1523
1636
  initAdvancedVSeed,
1524
- locale_locale,
1525
1637
  autoMeasures,
1526
1638
  autoDimensions,
1527
1639
  pivotAdapter([
@@ -1537,7 +1649,6 @@
1537
1649
  ];
1538
1650
  const roseParallelAdvancedPipeline = [
1539
1651
  initAdvancedVSeed,
1540
- locale_locale,
1541
1652
  autoMeasures,
1542
1653
  autoDimensions,
1543
1654
  pivotAdapter([
@@ -1553,7 +1664,6 @@
1553
1664
  ];
1554
1665
  const funnelAdvancedPipeline = [
1555
1666
  initAdvancedVSeed,
1556
- locale_locale,
1557
1667
  autoMeasures,
1558
1668
  autoDimensions,
1559
1669
  pivotAdapter([
@@ -1566,45 +1676,8 @@
1566
1676
  theme_theme,
1567
1677
  annotation_annotation
1568
1678
  ];
1569
- const encodingYY = (advancedVSeed)=>{
1570
- const result = {
1571
- ...advancedVSeed
1572
- };
1573
- const { datasetReshapeInfo, measures } = advancedVSeed;
1574
- if (!datasetReshapeInfo || !measures) return result;
1575
- const firstMeasure = findFirstMeasure(measures);
1576
- const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
1577
- const { foldInfo, unfoldInfo } = cur;
1578
- const x = [
1579
- firstMeasure?.id
1580
- ];
1581
- const y = [
1582
- foldInfo.measureValue
1583
- ];
1584
- const group = [
1585
- unfoldInfo.groupId
1586
- ];
1587
- const color = [
1588
- unfoldInfo.groupId
1589
- ];
1590
- return [
1591
- ...prev,
1592
- {
1593
- x,
1594
- y,
1595
- group,
1596
- color
1597
- }
1598
- ];
1599
- }, []);
1600
- return {
1601
- ...result,
1602
- encoding
1603
- };
1604
- };
1605
1679
  const scatterAdvancedPipeline = [
1606
1680
  initAdvancedVSeed,
1607
- locale_locale,
1608
1681
  autoMeasures,
1609
1682
  autoDimensions,
1610
1683
  pivotAdapter([
@@ -1618,6 +1691,158 @@
1618
1691
  markStyle_markStyle,
1619
1692
  annotation_annotation
1620
1693
  ];
1694
+ const autoMeasures_autoMeasures = (advancedVSeed, context)=>{
1695
+ const result = {
1696
+ ...advancedVSeed
1697
+ };
1698
+ const { vseed } = context;
1699
+ const { measures, dataset } = vseed;
1700
+ if (!dataset) throw new Error('dataset is required');
1701
+ if (0 === dataset.length) return result;
1702
+ if (measures && measures.length > 0) {
1703
+ result.measures = measures;
1704
+ return result;
1705
+ }
1706
+ const top100dataset = dataset.slice(0, 100);
1707
+ const sample = top100dataset.reduce((prev, cur)=>({
1708
+ ...prev,
1709
+ ...cur
1710
+ }), {});
1711
+ result.measures = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'number' == typeof item[key]) && ![
1712
+ '',
1713
+ null,
1714
+ void 0
1715
+ ].includes(key)).map((measure)=>({
1716
+ id: measure,
1717
+ alias: measure
1718
+ }));
1719
+ return result;
1720
+ };
1721
+ const autoDimensions_autoDimensions = (advancedVSeed, context)=>{
1722
+ const result = {
1723
+ ...advancedVSeed
1724
+ };
1725
+ const { vseed } = context;
1726
+ const { dimensions, dataset } = vseed;
1727
+ const measures = findAllMeasures(advancedVSeed.measures);
1728
+ if (!dataset) throw new Error('dataset is required');
1729
+ if (0 === dataset.length) return result;
1730
+ if (dimensions && dimensions.length > 0) {
1731
+ result.dimensions = dimensions;
1732
+ return result;
1733
+ }
1734
+ const top100dataset = dataset.slice(0, 100);
1735
+ const sample = top100dataset.reduce((prev, cur)=>({
1736
+ ...prev,
1737
+ ...cur
1738
+ }), {});
1739
+ result.dimensions = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'string' == typeof item[key]) && ![
1740
+ '',
1741
+ null,
1742
+ void 0
1743
+ ].includes(key) && !measures.some((measure)=>measure.id === key)).map((dim)=>({
1744
+ id: dim,
1745
+ alias: dim,
1746
+ location: 'dimension'
1747
+ }));
1748
+ return result;
1749
+ };
1750
+ const autoPivotDimensions = (advancedVSeed, context)=>{
1751
+ const result = {
1752
+ ...advancedVSeed
1753
+ };
1754
+ const { vseed } = context;
1755
+ const { dimensions, dataset } = vseed;
1756
+ const measures = findAllMeasures(advancedVSeed.measures);
1757
+ if (!dataset) throw new Error('dataset is required');
1758
+ if (0 === dataset.length) return result;
1759
+ if (dimensions && dimensions.length > 0) {
1760
+ const newDimensions = findAllDimensions(dimensions);
1761
+ result.dimensions = newDimensions.map((item, index)=>{
1762
+ if ('rowDimension' === item.location || 'columnDimension' === item.location) return item;
1763
+ return {
1764
+ ...item,
1765
+ location: index % 2 === 0 ? 'columnDimension' : 'rowDimension'
1766
+ };
1767
+ });
1768
+ return result;
1769
+ }
1770
+ const top100dataset = dataset.slice(0, 100);
1771
+ const sample = top100dataset.reduce((prev, cur)=>({
1772
+ ...prev,
1773
+ ...cur
1774
+ }), {});
1775
+ let i = 0;
1776
+ result.dimensions = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'string' == typeof item[key]) && ![
1777
+ '',
1778
+ null,
1779
+ void 0
1780
+ ].includes(key) && !measures.some((measure)=>measure.id === key)).map((dim)=>({
1781
+ id: dim,
1782
+ alias: dim,
1783
+ location: i++ % 2 === 0 ? 'columnDimension' : 'rowDimension'
1784
+ }));
1785
+ return result;
1786
+ };
1787
+ const autoPivotMeasures = (advancedVSeed, context)=>{
1788
+ const result = {
1789
+ ...advancedVSeed
1790
+ };
1791
+ const { vseed } = context;
1792
+ const { dataset } = vseed;
1793
+ const measures = findAllMeasures(vseed.measures);
1794
+ if (!dataset) throw new Error('dataset is required');
1795
+ if (0 === dataset.length) return result;
1796
+ if (measures && measures.length > 0) {
1797
+ result.measures = findAllMeasures(measures);
1798
+ return result;
1799
+ }
1800
+ const top100dataset = dataset.slice(0, 100);
1801
+ const sample = top100dataset.reduce((prev, cur)=>({
1802
+ ...prev,
1803
+ ...cur
1804
+ }), {});
1805
+ result.measures = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'number' == typeof item[key]) && ![
1806
+ '',
1807
+ null,
1808
+ void 0
1809
+ ].includes(key)).map((measure)=>({
1810
+ id: measure,
1811
+ alias: measure
1812
+ }));
1813
+ return result;
1814
+ };
1815
+ const initAdvancedVSeed_initAdvancedVSeed = (advancedVSeed, context)=>{
1816
+ const { vseed } = context;
1817
+ const { chartType, locale } = vseed;
1818
+ return {
1819
+ ...advancedVSeed,
1820
+ chartType,
1821
+ locale: locale || 'zh-CN'
1822
+ };
1823
+ };
1824
+ const records_records = (advancedVSeed, context)=>{
1825
+ const { vseed } = context;
1826
+ const { dataset } = vseed;
1827
+ return {
1828
+ ...advancedVSeed,
1829
+ dataset
1830
+ };
1831
+ };
1832
+ const pivotTableAdvancedPipeline = [
1833
+ initAdvancedVSeed_initAdvancedVSeed,
1834
+ autoPivotMeasures,
1835
+ autoPivotDimensions,
1836
+ records_records,
1837
+ theme_theme
1838
+ ];
1839
+ const tableAdvancedPipeline = [
1840
+ initAdvancedVSeed_initAdvancedVSeed,
1841
+ autoMeasures_autoMeasures,
1842
+ autoDimensions_autoDimensions,
1843
+ records_records,
1844
+ theme_theme
1845
+ ];
1621
1846
  const dataset_dataset = (spec, context)=>{
1622
1847
  const { advancedVSeed } = context;
1623
1848
  const { encoding } = advancedVSeed;
@@ -1995,6 +2220,27 @@
1995
2220
  result.animation = true;
1996
2221
  return result;
1997
2222
  };
2223
+ const initScatter = (spec, context)=>{
2224
+ const result = {
2225
+ ...spec
2226
+ };
2227
+ const { advancedVSeed } = context;
2228
+ const { encoding } = advancedVSeed;
2229
+ if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
2230
+ result.type = 'scatter';
2231
+ result.direction = 'vertical';
2232
+ result.xField = encoding[0].x[0];
2233
+ result.yField = encoding[0].y[0];
2234
+ result.seriesField = encoding[0].group[0];
2235
+ result.padding = 0;
2236
+ result.region = [
2237
+ {
2238
+ clip: true
2239
+ }
2240
+ ];
2241
+ result.animation = true;
2242
+ return result;
2243
+ };
1998
2244
  const xBand = (spec, context)=>{
1999
2245
  const result = {
2000
2246
  ...spec
@@ -2993,7 +3239,7 @@
2993
3239
  ...spec
2994
3240
  };
2995
3241
  const { advancedVSeed } = context;
2996
- const { dimensions } = advancedVSeed;
3242
+ const dimensions = advancedVSeed.dimensions;
2997
3243
  if (!dimensions) return result;
2998
3244
  const columnDimensions = dimensions.filter((dim)=>'columnDimension' === dim.location);
2999
3245
  const columns = columnDimensions.map((dim)=>({
@@ -3010,7 +3256,7 @@
3010
3256
  ...spec
3011
3257
  };
3012
3258
  const { advancedVSeed } = context;
3013
- const { dimensions } = advancedVSeed;
3259
+ const dimensions = advancedVSeed.dimensions;
3014
3260
  if (!dimensions) return result;
3015
3261
  const rowDimensions = dimensions.filter((dim)=>'rowDimension' === dim.location);
3016
3262
  const rows = rowDimensions.map((dim)=>({
@@ -4669,27 +4915,6 @@
4669
4915
  const funnelSpecPipeline = [
4670
4916
  pivotAdapter_pivotAdapter(funnel, pivotFunnel)
4671
4917
  ];
4672
- const initScatter = (spec, context)=>{
4673
- const result = {
4674
- ...spec
4675
- };
4676
- const { advancedVSeed } = context;
4677
- const { encoding } = advancedVSeed;
4678
- if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
4679
- result.type = 'scatter';
4680
- result.direction = 'vertical';
4681
- result.xField = encoding[0].x[0];
4682
- result.yField = encoding[0].y[0];
4683
- result.seriesField = encoding[0].group[0];
4684
- result.padding = 0;
4685
- result.region = [
4686
- {
4687
- clip: true
4688
- }
4689
- ];
4690
- result.animation = true;
4691
- return result;
4692
- };
4693
4918
  const scatter = [
4694
4919
  initScatter,
4695
4920
  color_color,
@@ -4739,6 +4964,748 @@
4739
4964
  const scatterSpecPipeline = [
4740
4965
  pivotAdapter_pivotAdapter(scatter, pivotScatter)
4741
4966
  ];
4967
+ const initTable = (spec, context)=>{
4968
+ const { advancedVSeed } = context;
4969
+ const { dataset } = advancedVSeed;
4970
+ return {
4971
+ ...spec,
4972
+ records: dataset,
4973
+ widthMode: 'standard',
4974
+ heightMode: 'autoHeight',
4975
+ autoWrapText: true,
4976
+ columnResizeMode: 'all',
4977
+ showHeader: true,
4978
+ tooltip: {
4979
+ isShowOverflowTextTooltip: true
4980
+ },
4981
+ animationAppear: {
4982
+ duration: 300,
4983
+ delay: 250,
4984
+ type: 'one-by-one',
4985
+ direction: 'row'
4986
+ },
4987
+ theme: {
4988
+ underlayBackgroundColor: 'transparent'
4989
+ }
4990
+ };
4991
+ };
4992
+ const initPivotTable = (spec, context)=>{
4993
+ const { advancedVSeed } = context;
4994
+ const { dataset } = advancedVSeed;
4995
+ return {
4996
+ ...spec,
4997
+ records: dataset,
4998
+ widthMode: 'standard',
4999
+ heightMode: 'autoHeight',
5000
+ autoWrapText: true,
5001
+ columnResizeMode: 'all',
5002
+ columnResizeType: 'column',
5003
+ showColumnHeader: true,
5004
+ showRowHeader: true,
5005
+ select: {
5006
+ highlightMode: 'cell',
5007
+ headerSelectMode: 'inline'
5008
+ },
5009
+ hover: {
5010
+ highlightMode: 'cross'
5011
+ },
5012
+ tooltip: {
5013
+ isShowOverflowTextTooltip: true
5014
+ },
5015
+ widthAdaptiveMode: 'all',
5016
+ animationAppear: {
5017
+ duration: 300,
5018
+ delay: 250,
5019
+ type: 'one-by-one',
5020
+ direction: 'row'
5021
+ },
5022
+ theme: {
5023
+ underlayBackgroundColor: 'transparent'
5024
+ }
5025
+ };
5026
+ };
5027
+ const measureTreeToColumns = (spec, context)=>{
5028
+ const { advancedVSeed } = context;
5029
+ const measures = advancedVSeed.measures;
5030
+ const result = {
5031
+ ...spec
5032
+ };
5033
+ const eachNode = (node)=>{
5034
+ if ('children' in node) return {};
5035
+ return {
5036
+ width: 'auto'
5037
+ };
5038
+ };
5039
+ const columns = treeTreeToColumns(measures, eachNode);
5040
+ return {
5041
+ ...result,
5042
+ columns: [
5043
+ ...result.columns || [],
5044
+ ...columns
5045
+ ]
5046
+ };
5047
+ };
5048
+ const dimensionTreeToColumns = (spec, context)=>{
5049
+ const { advancedVSeed } = context;
5050
+ const dimensions = advancedVSeed.dimensions;
5051
+ const result = {
5052
+ ...spec
5053
+ };
5054
+ const eachNode = (node)=>{
5055
+ if ('children' in node) return {};
5056
+ return {
5057
+ width: 'auto'
5058
+ };
5059
+ };
5060
+ const columns = treeTreeToColumns(dimensions, eachNode);
5061
+ return {
5062
+ ...result,
5063
+ columns: [
5064
+ ...result.columns || [],
5065
+ ...columns
5066
+ ]
5067
+ };
5068
+ };
5069
+ const treeTreeToColumns = (tree, callback)=>{
5070
+ const result = tree.map((item)=>{
5071
+ if ('children' in item && Array.isArray(item.children)) {
5072
+ const groupNode = item;
5073
+ const field = groupNode.id;
5074
+ const title = groupNode.alias ?? groupNode.id;
5075
+ const props = callback?.(groupNode) || {};
5076
+ return {
5077
+ field,
5078
+ title,
5079
+ columns: treeTreeToColumns(item.children, callback),
5080
+ ...props
5081
+ };
5082
+ }
5083
+ {
5084
+ const field = item.id;
5085
+ const title = item.alias ?? item.id;
5086
+ const props = callback?.(item) || {};
5087
+ return {
5088
+ field,
5089
+ title,
5090
+ ...props
5091
+ };
5092
+ }
5093
+ });
5094
+ return result || [];
5095
+ };
5096
+ const pivotColumns = (spec, context)=>{
5097
+ const { advancedVSeed } = context;
5098
+ const dimensions = advancedVSeed.dimensions;
5099
+ const columns = dimensions.filter((item)=>'columnDimension' === item['location']);
5100
+ return {
5101
+ ...spec,
5102
+ columns: columns.map((item)=>({
5103
+ dimensionKey: item.id,
5104
+ title: item.alias || item.id,
5105
+ width: 'auto'
5106
+ }))
5107
+ };
5108
+ };
5109
+ const pivotRows = (spec, context)=>{
5110
+ const { advancedVSeed } = context;
5111
+ const dimensions = advancedVSeed.dimensions;
5112
+ const rows = dimensions.filter((item)=>'rowDimension' === item['location']);
5113
+ return {
5114
+ ...spec,
5115
+ rows: rows.map((item)=>({
5116
+ dimensionKey: item.id,
5117
+ title: item.alias || item.id,
5118
+ width: 'auto'
5119
+ }))
5120
+ };
5121
+ };
5122
+ const pivotIndicators_pivotIndicators = (spec, context)=>{
5123
+ const { advancedVSeed } = context;
5124
+ const measures = advancedVSeed.measures;
5125
+ return {
5126
+ ...spec,
5127
+ indicatorsAsCol: true,
5128
+ indicatorTitle: intl.i18n`指标名称`,
5129
+ indicators: measures.map((item)=>({
5130
+ cellType: 'text',
5131
+ indicatorKey: item.id,
5132
+ title: item.alias || item.id,
5133
+ width: 'auto'
5134
+ }))
5135
+ };
5136
+ };
5137
+ function src_define(constructor, factory, prototype) {
5138
+ constructor.prototype = factory.prototype = prototype;
5139
+ prototype.constructor = constructor;
5140
+ }
5141
+ function extend(parent, definition) {
5142
+ var prototype = Object.create(parent.prototype);
5143
+ for(var key in definition)prototype[key] = definition[key];
5144
+ return prototype;
5145
+ }
5146
+ function Color() {}
5147
+ var darker = 0.7;
5148
+ var brighter = 1 / darker;
5149
+ var reI = "\\s*([+-]?\\d+)\\s*", reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", reHex = /^#([0-9a-f]{3,8})$/, reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`), reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`), reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`), reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`), reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`), reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
5150
+ var named = {
5151
+ aliceblue: 0xf0f8ff,
5152
+ antiquewhite: 0xfaebd7,
5153
+ aqua: 0x00ffff,
5154
+ aquamarine: 0x7fffd4,
5155
+ azure: 0xf0ffff,
5156
+ beige: 0xf5f5dc,
5157
+ bisque: 0xffe4c4,
5158
+ black: 0x000000,
5159
+ blanchedalmond: 0xffebcd,
5160
+ blue: 0x0000ff,
5161
+ blueviolet: 0x8a2be2,
5162
+ brown: 0xa52a2a,
5163
+ burlywood: 0xdeb887,
5164
+ cadetblue: 0x5f9ea0,
5165
+ chartreuse: 0x7fff00,
5166
+ chocolate: 0xd2691e,
5167
+ coral: 0xff7f50,
5168
+ cornflowerblue: 0x6495ed,
5169
+ cornsilk: 0xfff8dc,
5170
+ crimson: 0xdc143c,
5171
+ cyan: 0x00ffff,
5172
+ darkblue: 0x00008b,
5173
+ darkcyan: 0x008b8b,
5174
+ darkgoldenrod: 0xb8860b,
5175
+ darkgray: 0xa9a9a9,
5176
+ darkgreen: 0x006400,
5177
+ darkgrey: 0xa9a9a9,
5178
+ darkkhaki: 0xbdb76b,
5179
+ darkmagenta: 0x8b008b,
5180
+ darkolivegreen: 0x556b2f,
5181
+ darkorange: 0xff8c00,
5182
+ darkorchid: 0x9932cc,
5183
+ darkred: 0x8b0000,
5184
+ darksalmon: 0xe9967a,
5185
+ darkseagreen: 0x8fbc8f,
5186
+ darkslateblue: 0x483d8b,
5187
+ darkslategray: 0x2f4f4f,
5188
+ darkslategrey: 0x2f4f4f,
5189
+ darkturquoise: 0x00ced1,
5190
+ darkviolet: 0x9400d3,
5191
+ deeppink: 0xff1493,
5192
+ deepskyblue: 0x00bfff,
5193
+ dimgray: 0x696969,
5194
+ dimgrey: 0x696969,
5195
+ dodgerblue: 0x1e90ff,
5196
+ firebrick: 0xb22222,
5197
+ floralwhite: 0xfffaf0,
5198
+ forestgreen: 0x228b22,
5199
+ fuchsia: 0xff00ff,
5200
+ gainsboro: 0xdcdcdc,
5201
+ ghostwhite: 0xf8f8ff,
5202
+ gold: 0xffd700,
5203
+ goldenrod: 0xdaa520,
5204
+ gray: 0x808080,
5205
+ green: 0x008000,
5206
+ greenyellow: 0xadff2f,
5207
+ grey: 0x808080,
5208
+ honeydew: 0xf0fff0,
5209
+ hotpink: 0xff69b4,
5210
+ indianred: 0xcd5c5c,
5211
+ indigo: 0x4b0082,
5212
+ ivory: 0xfffff0,
5213
+ khaki: 0xf0e68c,
5214
+ lavender: 0xe6e6fa,
5215
+ lavenderblush: 0xfff0f5,
5216
+ lawngreen: 0x7cfc00,
5217
+ lemonchiffon: 0xfffacd,
5218
+ lightblue: 0xadd8e6,
5219
+ lightcoral: 0xf08080,
5220
+ lightcyan: 0xe0ffff,
5221
+ lightgoldenrodyellow: 0xfafad2,
5222
+ lightgray: 0xd3d3d3,
5223
+ lightgreen: 0x90ee90,
5224
+ lightgrey: 0xd3d3d3,
5225
+ lightpink: 0xffb6c1,
5226
+ lightsalmon: 0xffa07a,
5227
+ lightseagreen: 0x20b2aa,
5228
+ lightskyblue: 0x87cefa,
5229
+ lightslategray: 0x778899,
5230
+ lightslategrey: 0x778899,
5231
+ lightsteelblue: 0xb0c4de,
5232
+ lightyellow: 0xffffe0,
5233
+ lime: 0x00ff00,
5234
+ limegreen: 0x32cd32,
5235
+ linen: 0xfaf0e6,
5236
+ magenta: 0xff00ff,
5237
+ maroon: 0x800000,
5238
+ mediumaquamarine: 0x66cdaa,
5239
+ mediumblue: 0x0000cd,
5240
+ mediumorchid: 0xba55d3,
5241
+ mediumpurple: 0x9370db,
5242
+ mediumseagreen: 0x3cb371,
5243
+ mediumslateblue: 0x7b68ee,
5244
+ mediumspringgreen: 0x00fa9a,
5245
+ mediumturquoise: 0x48d1cc,
5246
+ mediumvioletred: 0xc71585,
5247
+ midnightblue: 0x191970,
5248
+ mintcream: 0xf5fffa,
5249
+ mistyrose: 0xffe4e1,
5250
+ moccasin: 0xffe4b5,
5251
+ navajowhite: 0xffdead,
5252
+ navy: 0x000080,
5253
+ oldlace: 0xfdf5e6,
5254
+ olive: 0x808000,
5255
+ olivedrab: 0x6b8e23,
5256
+ orange: 0xffa500,
5257
+ orangered: 0xff4500,
5258
+ orchid: 0xda70d6,
5259
+ palegoldenrod: 0xeee8aa,
5260
+ palegreen: 0x98fb98,
5261
+ paleturquoise: 0xafeeee,
5262
+ palevioletred: 0xdb7093,
5263
+ papayawhip: 0xffefd5,
5264
+ peachpuff: 0xffdab9,
5265
+ peru: 0xcd853f,
5266
+ pink: 0xffc0cb,
5267
+ plum: 0xdda0dd,
5268
+ powderblue: 0xb0e0e6,
5269
+ purple: 0x800080,
5270
+ rebeccapurple: 0x663399,
5271
+ red: 0xff0000,
5272
+ rosybrown: 0xbc8f8f,
5273
+ royalblue: 0x4169e1,
5274
+ saddlebrown: 0x8b4513,
5275
+ salmon: 0xfa8072,
5276
+ sandybrown: 0xf4a460,
5277
+ seagreen: 0x2e8b57,
5278
+ seashell: 0xfff5ee,
5279
+ sienna: 0xa0522d,
5280
+ silver: 0xc0c0c0,
5281
+ skyblue: 0x87ceeb,
5282
+ slateblue: 0x6a5acd,
5283
+ slategray: 0x708090,
5284
+ slategrey: 0x708090,
5285
+ snow: 0xfffafa,
5286
+ springgreen: 0x00ff7f,
5287
+ steelblue: 0x4682b4,
5288
+ tan: 0xd2b48c,
5289
+ teal: 0x008080,
5290
+ thistle: 0xd8bfd8,
5291
+ tomato: 0xff6347,
5292
+ turquoise: 0x40e0d0,
5293
+ violet: 0xee82ee,
5294
+ wheat: 0xf5deb3,
5295
+ white: 0xffffff,
5296
+ whitesmoke: 0xf5f5f5,
5297
+ yellow: 0xffff00,
5298
+ yellowgreen: 0x9acd32
5299
+ };
5300
+ src_define(Color, src_color_color, {
5301
+ copy (channels) {
5302
+ return Object.assign(new this.constructor, this, channels);
5303
+ },
5304
+ displayable () {
5305
+ return this.rgb().displayable();
5306
+ },
5307
+ hex: color_formatHex,
5308
+ formatHex: color_formatHex,
5309
+ formatHex8: color_formatHex8,
5310
+ formatHsl: color_formatHsl,
5311
+ formatRgb: color_formatRgb,
5312
+ toString: color_formatRgb
5313
+ });
5314
+ function color_formatHex() {
5315
+ return this.rgb().formatHex();
5316
+ }
5317
+ function color_formatHex8() {
5318
+ return this.rgb().formatHex8();
5319
+ }
5320
+ function color_formatHsl() {
5321
+ return hslConvert(this).formatHsl();
5322
+ }
5323
+ function color_formatRgb() {
5324
+ return this.rgb().formatRgb();
5325
+ }
5326
+ function src_color_color(format) {
5327
+ var m, l;
5328
+ format = (format + "").trim().toLowerCase();
5329
+ return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), 6 === l ? rgbn(m) : 3 === l ? new Rgb(m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | 0xf0 & m, (0xf & m) << 4 | 0xf & m, 1) : 8 === l ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (0xff & m) / 0xff) : 4 === l ? rgba(m >> 12 & 0xf | m >> 8 & 0xf0, m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | 0xf0 & m, ((0xf & m) << 4 | 0xf & m) / 0xff) : null) : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format)) ? new Rgb(255 * m[1] / 100, 255 * m[2] / 100, 255 * m[3] / 100, 1) : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format)) ? rgba(255 * m[1] / 100, 255 * m[2] / 100, 255 * m[3] / 100, m[4]) : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format) ? rgbn(named[format]) : "transparent" === format ? new Rgb(NaN, NaN, NaN, 0) : null;
5330
+ }
5331
+ function rgbn(n) {
5332
+ return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, 0xff & n, 1);
5333
+ }
5334
+ function rgba(r, g, b, a) {
5335
+ if (a <= 0) r = g = b = NaN;
5336
+ return new Rgb(r, g, b, a);
5337
+ }
5338
+ function rgbConvert(o) {
5339
+ if (!(o instanceof Color)) o = src_color_color(o);
5340
+ if (!o) return new Rgb;
5341
+ o = o.rgb();
5342
+ return new Rgb(o.r, o.g, o.b, o.opacity);
5343
+ }
5344
+ function rgb(r, g, b, opacity) {
5345
+ return 1 === arguments.length ? rgbConvert(r) : new Rgb(r, g, b, null == opacity ? 1 : opacity);
5346
+ }
5347
+ function Rgb(r, g, b, opacity) {
5348
+ this.r = +r;
5349
+ this.g = +g;
5350
+ this.b = +b;
5351
+ this.opacity = +opacity;
5352
+ }
5353
+ src_define(Rgb, rgb, extend(Color, {
5354
+ brighter (k) {
5355
+ k = null == k ? brighter : Math.pow(brighter, k);
5356
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
5357
+ },
5358
+ darker (k) {
5359
+ k = null == k ? darker : Math.pow(darker, k);
5360
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
5361
+ },
5362
+ rgb () {
5363
+ return this;
5364
+ },
5365
+ clamp () {
5366
+ return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
5367
+ },
5368
+ displayable () {
5369
+ return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
5370
+ },
5371
+ hex: rgb_formatHex,
5372
+ formatHex: rgb_formatHex,
5373
+ formatHex8: rgb_formatHex8,
5374
+ formatRgb: rgb_formatRgb,
5375
+ toString: rgb_formatRgb
5376
+ }));
5377
+ function rgb_formatHex() {
5378
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
5379
+ }
5380
+ function rgb_formatHex8() {
5381
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
5382
+ }
5383
+ function rgb_formatRgb() {
5384
+ const a = clampa(this.opacity);
5385
+ return `${1 === a ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${1 === a ? ")" : `, ${a})`}`;
5386
+ }
5387
+ function clampa(opacity) {
5388
+ return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
5389
+ }
5390
+ function clampi(value) {
5391
+ return Math.max(0, Math.min(255, Math.round(value) || 0));
5392
+ }
5393
+ function hex(value) {
5394
+ value = clampi(value);
5395
+ return (value < 16 ? "0" : "") + value.toString(16);
5396
+ }
5397
+ function hsla(h, s, l, a) {
5398
+ if (a <= 0) h = s = l = NaN;
5399
+ else if (l <= 0 || l >= 1) h = s = NaN;
5400
+ else if (s <= 0) h = NaN;
5401
+ return new Hsl(h, s, l, a);
5402
+ }
5403
+ function hslConvert(o) {
5404
+ if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
5405
+ if (!(o instanceof Color)) o = src_color_color(o);
5406
+ if (!o) return new Hsl;
5407
+ if (o instanceof Hsl) return o;
5408
+ o = o.rgb();
5409
+ var r = o.r / 255, g = o.g / 255, b = o.b / 255, min = Math.min(r, g, b), max = Math.max(r, g, b), h = NaN, s = max - min, l = (max + min) / 2;
5410
+ if (s) {
5411
+ h = r === max ? (g - b) / s + (g < b) * 6 : g === max ? (b - r) / s + 2 : (r - g) / s + 4;
5412
+ s /= l < 0.5 ? max + min : 2 - max - min;
5413
+ h *= 60;
5414
+ } else s = l > 0 && l < 1 ? 0 : h;
5415
+ return new Hsl(h, s, l, o.opacity);
5416
+ }
5417
+ function hsl(h, s, l, opacity) {
5418
+ return 1 === arguments.length ? hslConvert(h) : new Hsl(h, s, l, null == opacity ? 1 : opacity);
5419
+ }
5420
+ function Hsl(h, s, l, opacity) {
5421
+ this.h = +h;
5422
+ this.s = +s;
5423
+ this.l = +l;
5424
+ this.opacity = +opacity;
5425
+ }
5426
+ src_define(Hsl, hsl, extend(Color, {
5427
+ brighter (k) {
5428
+ k = null == k ? brighter : Math.pow(brighter, k);
5429
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
5430
+ },
5431
+ darker (k) {
5432
+ k = null == k ? darker : Math.pow(darker, k);
5433
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
5434
+ },
5435
+ rgb () {
5436
+ var h = this.h % 360 + (this.h < 0) * 360, s = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s, m1 = 2 * l - m2;
5437
+ return new Rgb(hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb(h, m1, m2), hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity);
5438
+ },
5439
+ clamp () {
5440
+ return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
5441
+ },
5442
+ displayable () {
5443
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
5444
+ },
5445
+ formatHsl () {
5446
+ const a = clampa(this.opacity);
5447
+ return `${1 === a ? "hsl(" : "hsla("}${clamph(this.h)}, ${100 * clampt(this.s)}%, ${100 * clampt(this.l)}%${1 === a ? ")" : `, ${a})`}`;
5448
+ }
5449
+ }));
5450
+ function clamph(value) {
5451
+ value = (value || 0) % 360;
5452
+ return value < 0 ? value + 360 : value;
5453
+ }
5454
+ function clampt(value) {
5455
+ return Math.max(0, Math.min(1, value || 0));
5456
+ }
5457
+ function hsl2rgb(h, m1, m2) {
5458
+ return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
5459
+ }
5460
+ const bodyStyle = (spec, context)=>{
5461
+ const result = {
5462
+ ...spec
5463
+ };
5464
+ const { advancedVSeed } = context;
5465
+ const { customTheme, chartType } = advancedVSeed;
5466
+ const themConfig = customTheme?.config?.[chartType];
5467
+ if (!result.theme || !themConfig) return result;
5468
+ const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
5469
+ const backgroundColor = themConfig.bodyBackgroundColor || '#fff';
5470
+ const fontColor = themConfig.bodyFontColor || '#1B1F23';
5471
+ const fontSize = themConfig.bodyFontSize || 12;
5472
+ const hoverCellBgColor = themConfig.hoverBodyBackgroundColor || '#bedaff';
5473
+ const hoverInlineColor = src_color_color(hoverCellBgColor)?.copy({
5474
+ opacity: 0.1
5475
+ }).toString();
5476
+ result.theme.bodyStyle = {
5477
+ borderColor: borderColor,
5478
+ borderLineWidth: 1,
5479
+ padding: [
5480
+ 8.6,
5481
+ 12,
5482
+ 8.6,
5483
+ 12
5484
+ ],
5485
+ textAlign: 'right',
5486
+ hover: {
5487
+ cellBgColor: hoverCellBgColor,
5488
+ inlineRowBgColor: hoverInlineColor,
5489
+ inlineColumnBgColor: hoverInlineColor
5490
+ },
5491
+ color: fontColor,
5492
+ fontSize: fontSize,
5493
+ fontStyle: 'normal',
5494
+ fontWeight: 'normal',
5495
+ fontVariant: 'normal',
5496
+ bgColor: backgroundColor,
5497
+ lineHeight: 1.5 * fontSize
5498
+ };
5499
+ return result;
5500
+ };
5501
+ const headerStyle = (spec, context)=>{
5502
+ const result = {
5503
+ ...spec
5504
+ };
5505
+ const { advancedVSeed } = context;
5506
+ const { customTheme, chartType } = advancedVSeed;
5507
+ const themConfig = customTheme?.config?.[chartType];
5508
+ if (!result.theme || !themConfig) return result;
5509
+ const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
5510
+ const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
5511
+ const fontColor = themConfig.headerFontColor || '#1B1F23';
5512
+ const fontSize = themConfig.headerFontSize || 12;
5513
+ const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
5514
+ const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
5515
+ result.theme.headerStyle = {
5516
+ borderColor: borderColor,
5517
+ borderLineWidth: 1,
5518
+ padding: [
5519
+ 8,
5520
+ 12,
5521
+ 8,
5522
+ 12
5523
+ ],
5524
+ textAlign: 'center',
5525
+ hover: {
5526
+ cellBgColor: src_color_color(hoverCellBgColor)?.copy({
5527
+ opacity: 1
5528
+ }).brighter(0.5).toString(),
5529
+ inlineRowBgColor: hoverInlineColor,
5530
+ inlineColumnBgColor: hoverInlineColor
5531
+ },
5532
+ frameStyle: {
5533
+ borderColor: [
5534
+ null,
5535
+ null,
5536
+ borderColor,
5537
+ null
5538
+ ],
5539
+ borderLineWidth: 1
5540
+ },
5541
+ fontSize: fontSize,
5542
+ fontVariant: 'normal',
5543
+ fontStyle: 'normal',
5544
+ fontWeight: 'bold',
5545
+ color: fontColor,
5546
+ bgColor: backgroundColor,
5547
+ lineHeight: 1.5 * fontSize
5548
+ };
5549
+ return result;
5550
+ };
5551
+ const rowHeaderStyle = (spec, context)=>{
5552
+ const result = {
5553
+ ...spec
5554
+ };
5555
+ const { advancedVSeed } = context;
5556
+ const { customTheme, chartType } = advancedVSeed;
5557
+ const themConfig = customTheme?.config?.[chartType];
5558
+ if (!result.theme || !themConfig) return result;
5559
+ const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
5560
+ const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
5561
+ const fontColor = themConfig.headerFontColor || '#1B1F23';
5562
+ const fontSize = themConfig.headerFontSize || 12;
5563
+ const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
5564
+ const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
5565
+ result.theme.rowHeaderStyle = {
5566
+ borderColor: borderColor,
5567
+ borderLineWidth: 1,
5568
+ padding: [
5569
+ 8.6,
5570
+ 12,
5571
+ 8.6,
5572
+ 12
5573
+ ],
5574
+ textAlign: 'left',
5575
+ hover: {
5576
+ cellBgColor: src_color_color(hoverCellBgColor)?.copy({
5577
+ opacity: 1
5578
+ }).brighter(0.5).toString(),
5579
+ inlineRowBgColor: hoverInlineColor,
5580
+ inlineColumnBgColor: hoverInlineColor
5581
+ },
5582
+ frameStyle: {
5583
+ borderColor: [
5584
+ null,
5585
+ borderColor,
5586
+ null,
5587
+ null
5588
+ ],
5589
+ borderLineWidth: 1
5590
+ },
5591
+ fontSize: fontSize,
5592
+ fontVariant: 'normal',
5593
+ fontStyle: 'normal',
5594
+ fontWeight: 'bold',
5595
+ color: fontColor,
5596
+ bgColor: backgroundColor,
5597
+ lineHeight: 1.5 * fontSize
5598
+ };
5599
+ return result;
5600
+ };
5601
+ const cornerHeaderStyle = (spec, context)=>{
5602
+ const result = {
5603
+ ...spec
5604
+ };
5605
+ const { advancedVSeed } = context;
5606
+ const { customTheme, chartType } = advancedVSeed;
5607
+ const themConfig = customTheme?.config?.[chartType];
5608
+ if (!result.theme || !themConfig) return result;
5609
+ const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
5610
+ const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
5611
+ const fontColor = themConfig.headerFontColor || '#1B1F23';
5612
+ const fontSize = themConfig.headerFontSize || 12;
5613
+ const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
5614
+ const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
5615
+ result.theme.cornerHeaderStyle = {
5616
+ borderColor: [
5617
+ borderColor,
5618
+ borderColor
5619
+ ],
5620
+ borderLineWidth: 1,
5621
+ padding: [
5622
+ 8,
5623
+ 12,
5624
+ 8,
5625
+ 12
5626
+ ],
5627
+ textAlign: 'left',
5628
+ hover: {
5629
+ cellBgColor: src_color_color(hoverCellBgColor)?.copy({
5630
+ opacity: 1
5631
+ }).brighter(0.5).toString(),
5632
+ inlineRowBgColor: hoverInlineColor,
5633
+ inlineColumnBgColor: hoverInlineColor
5634
+ },
5635
+ frameStyle: {
5636
+ borderColor: [
5637
+ null,
5638
+ borderColor,
5639
+ borderColor,
5640
+ null
5641
+ ],
5642
+ borderLineWidth: 1
5643
+ },
5644
+ fontSize: fontSize,
5645
+ fontVariant: 'normal',
5646
+ fontStyle: 'normal',
5647
+ fontWeight: 'bold',
5648
+ color: fontColor,
5649
+ bgColor: backgroundColor,
5650
+ lineHeight: 1.5 * fontSize
5651
+ };
5652
+ return result;
5653
+ };
5654
+ const frameStyle = (spec, context)=>{
5655
+ const result = {
5656
+ ...spec
5657
+ };
5658
+ const { advancedVSeed } = context;
5659
+ const { customTheme, chartType } = advancedVSeed;
5660
+ const themConfig = customTheme?.config?.[chartType];
5661
+ if (!result.theme || !themConfig) return result;
5662
+ const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
5663
+ result.theme.frameStyle = {
5664
+ borderColor,
5665
+ borderLineWidth: 0,
5666
+ cornerRadius: 0
5667
+ };
5668
+ return result;
5669
+ };
5670
+ const selectionStyle = (spec, context)=>{
5671
+ const result = {
5672
+ ...spec
5673
+ };
5674
+ const { advancedVSeed } = context;
5675
+ const { customTheme, chartType } = advancedVSeed;
5676
+ const themConfig = customTheme?.config?.[chartType];
5677
+ if (!result.theme || !themConfig) return result;
5678
+ const borderColor = themConfig.selectedBorderColor || 'rgb(224, 224, 224)';
5679
+ result.theme.selectionStyle = {
5680
+ cellBorderColor: borderColor,
5681
+ cellBorderLineWidth: 2,
5682
+ cellBgColor: src_color_color(borderColor)?.copy({
5683
+ opacity: 0.15
5684
+ }).toString()
5685
+ };
5686
+ return result;
5687
+ };
5688
+ const tableSpecPipeline = [
5689
+ initTable,
5690
+ dimensionTreeToColumns,
5691
+ measureTreeToColumns,
5692
+ bodyStyle,
5693
+ headerStyle,
5694
+ frameStyle,
5695
+ selectionStyle
5696
+ ];
5697
+ const pivotTableSpecPipeline = [
5698
+ initPivotTable,
5699
+ pivotColumns,
5700
+ pivotRows,
5701
+ pivotIndicators_pivotIndicators,
5702
+ bodyStyle,
5703
+ headerStyle,
5704
+ rowHeaderStyle,
5705
+ cornerHeaderStyle,
5706
+ frameStyle,
5707
+ selectionStyle
5708
+ ];
4742
5709
  const buildAdvanced = (builder)=>{
4743
5710
  const { chartType } = builder.vseed;
4744
5711
  if (!chartType) throw new Error('chartType is nil in buildAdvanced');
@@ -4779,6 +5746,17 @@
4779
5746
  builder.spec = spec;
4780
5747
  return spec;
4781
5748
  };
5749
+ const getColorItems = (builder)=>{
5750
+ const advancedVSeed = builder.advancedVSeed;
5751
+ if (!advancedVSeed) return [];
5752
+ const { datasetReshapeInfo } = advancedVSeed;
5753
+ const colorItems = chunk_QJLMYOTX_i(datasetReshapeInfo.flatMap((d)=>d.unfoldInfo.colorItems));
5754
+ const colorIdMap = datasetReshapeInfo.reduce((prev, cur)=>({
5755
+ ...prev,
5756
+ ...cur.unfoldInfo.colorIdMap
5757
+ }), {});
5758
+ return colorItems.map((d)=>colorIdMap[d]);
5759
+ };
4782
5760
  class Builder {
4783
5761
  _vseed;
4784
5762
  _advancedVSeed = null;
@@ -4794,6 +5772,7 @@
4794
5772
  getSpecPipeline = (chartType)=>Builder._specPipelineMap[chartType];
4795
5773
  getTheme = (themeKey)=>Builder._themeMap[themeKey];
4796
5774
  getThemeMap = ()=>Builder._themeMap;
5775
+ getColorItems = ()=>getColorItems(this);
4797
5776
  get vseed() {
4798
5777
  return this._vseed;
4799
5778
  }
@@ -4877,6 +5856,14 @@
4877
5856
  Builder._advancedPipelineMap.scatter = scatterAdvancedPipeline;
4878
5857
  Builder._specPipelineMap.scatter = scatterSpecPipeline;
4879
5858
  };
5859
+ const registerTable = ()=>{
5860
+ Builder._advancedPipelineMap.table = tableAdvancedPipeline;
5861
+ Builder._specPipelineMap.table = tableSpecPipeline;
5862
+ };
5863
+ const registerPivotTable = ()=>{
5864
+ Builder._advancedPipelineMap.pivotTable = pivotTableAdvancedPipeline;
5865
+ Builder._specPipelineMap.pivotTable = pivotTableSpecPipeline;
5866
+ };
4880
5867
  const lightTheme = ()=>{
4881
5868
  const linearAxis = {
4882
5869
  nice: true,
@@ -5015,8 +6002,22 @@
5015
6002
  labelFontWeight: 400
5016
6003
  }
5017
6004
  };
6005
+ const tableConfig = {
6006
+ borderColor: '#e3e5eb',
6007
+ bodyFontSize: 12,
6008
+ bodyFontColor: '#141414',
6009
+ bodyBackgroundColor: 'transparent',
6010
+ headerFontSize: 12,
6011
+ headerFontColor: '#21252c',
6012
+ headerBackgroundColor: '#f6f7f9',
6013
+ hoverBodyBackgroundColor: '#bedaff',
6014
+ hoverHeaderBackgroundColor: '#D9DDE488',
6015
+ selectedBorderColor: '#4080ff'
6016
+ };
5018
6017
  return {
5019
6018
  config: {
6019
+ table: tableConfig,
6020
+ pivotTable: tableConfig,
5020
6021
  line: {
5021
6022
  ...baseConfig,
5022
6023
  xAxis: bandAxis,
@@ -5294,8 +6295,22 @@
5294
6295
  labelFontWeight: 400
5295
6296
  }
5296
6297
  };
6298
+ const tableConfig = {
6299
+ borderColor: '#4b4e53',
6300
+ bodyFontSize: 12,
6301
+ bodyFontColor: '#fdfdfd',
6302
+ bodyBackgroundColor: 'transparent',
6303
+ headerFontSize: 12,
6304
+ headerFontColor: '#fdfdfd',
6305
+ headerBackgroundColor: '#36393e',
6306
+ hoverBodyBackgroundColor: '#4284ff66',
6307
+ hoverHeaderBackgroundColor: '#5f5f5f88',
6308
+ selectedBorderColor: '#3073F2'
6309
+ };
5297
6310
  return {
5298
6311
  config: {
6312
+ table: tableConfig,
6313
+ pivotTable: tableConfig,
5299
6314
  line: {
5300
6315
  ...baseConfig,
5301
6316
  xAxis: bandAxis,
@@ -5465,6 +6480,8 @@
5465
6480
  registerRoseParallel();
5466
6481
  registerFunnel();
5467
6482
  registerScatter();
6483
+ registerTable();
6484
+ registerPivotTable();
5468
6485
  registerLightTheme();
5469
6486
  registerDarkTheme();
5470
6487
  };
@@ -5787,7 +6804,7 @@
5787
6804
  });
5788
6805
  return clone(schema, def);
5789
6806
  }
5790
- function extend(schema, shape) {
6807
+ function util_extend(schema, shape) {
5791
6808
  if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
5792
6809
  const def = mergeDefs(schema._zod.def, {
5793
6810
  get shape () {
@@ -8480,7 +9497,7 @@
8480
9497
  ...inst._zod.def,
8481
9498
  catchall: void 0
8482
9499
  });
8483
- inst.extend = (incoming)=>extend(inst, incoming);
9500
+ inst.extend = (incoming)=>util_extend(inst, incoming);
8484
9501
  inst.merge = (other)=>merge(inst, other);
8485
9502
  inst.pick = (mask)=>pick(inst, mask);
8486
9503
  inst.omit = (mask)=>omit(inst, mask);
@@ -8776,14 +9793,21 @@
8776
9793
  const zDimension = schemas_object({
8777
9794
  id: schemas_string(),
8778
9795
  alias: schemas_string().optional(),
8779
- visible: schemas_boolean().default(true).optional(),
8780
9796
  location: schemas_enum([
8781
9797
  'dimension',
8782
9798
  'rowDimension',
8783
9799
  'columnDimension'
8784
- ]).default('dimension').optional()
9800
+ ]).default('dimension')
8785
9801
  });
8786
- const zDimensions = schemas_array(zDimension).optional();
9802
+ const zDimensionGroup = schemas_object({
9803
+ id: schemas_string(),
9804
+ alias: schemas_string().optional(),
9805
+ get children () {
9806
+ return schemas_array(zDimensionGroup.or(zDimension)).optional();
9807
+ }
9808
+ });
9809
+ const zDimensions = schemas_array(zDimension);
9810
+ const zDimensionTree = schemas_array(zDimensionGroup.or(zDimension));
8787
9811
  const zNumFormat = schemas_object({
8788
9812
  type: schemas_enum([
8789
9813
  'number',
@@ -8817,8 +9841,8 @@
8817
9841
  const zMeasure = schemas_object({
8818
9842
  id: schemas_string(),
8819
9843
  alias: schemas_string().optional(),
8820
- autoFormat: schemas_boolean().default(true).optional(),
8821
- format: zNumFormat["default"]({}).optional()
9844
+ autoFormat: schemas_boolean().default(true),
9845
+ format: zNumFormat["default"]({})
8822
9846
  });
8823
9847
  const zMeasureGroup = schemas_object({
8824
9848
  id: schemas_string(),
@@ -8827,7 +9851,8 @@
8827
9851
  return schemas_array(zMeasureGroup.or(zMeasure)).optional();
8828
9852
  }
8829
9853
  });
8830
- const zMeasures = schemas_array(zMeasureGroup.or(zMeasure)).optional();
9854
+ const zMeasures = schemas_array(zMeasure);
9855
+ const zMeasureTree = schemas_array(zMeasureGroup.or(zMeasure));
8831
9856
  const zFoldInfo = schemas_object({
8832
9857
  foldMap: record(schemas_string(), schemas_string().or(schemas_undefined())),
8833
9858
  measureId: schemas_string(),
@@ -9025,6 +10050,19 @@
9025
10050
  const zTooltip = schemas_object({
9026
10051
  enable: schemas_boolean().default(true).optional()
9027
10052
  });
10053
+ const zTableConfig = schemas_object({
10054
+ borderColor: schemas_string().optional(),
10055
+ bodyFontSize: schemas_number().optional(),
10056
+ bodyFontColor: schemas_string().optional(),
10057
+ bodyBackgroundColor: schemas_string().optional(),
10058
+ hoverBodyBackgroundColor: schemas_string().optional(),
10059
+ headerFontSize: schemas_number().optional(),
10060
+ headerFontColor: schemas_string().optional(),
10061
+ headerBackgroundColor: schemas_string().optional(),
10062
+ hoverHeaderBackgroundColor: schemas_string().optional(),
10063
+ selectedBorderColor: schemas_string().optional()
10064
+ });
10065
+ const zPivotTableConfig = zTableConfig;
9028
10066
  const zLineConfig = schemas_object({
9029
10067
  backgroundColor: zBackgroundColor.optional(),
9030
10068
  label: zLabel.optional(),
@@ -9113,8 +10151,8 @@
9113
10151
  legend: zLegend.optional()
9114
10152
  });
9115
10153
  const zConfig = schemas_object({
9116
- table: schemas_object({}).optional(),
9117
- pivotTable: schemas_object({}).optional(),
10154
+ table: zTableConfig.optional(),
10155
+ pivotTable: zPivotTableConfig.optional(),
9118
10156
  line: zLineConfig.optional(),
9119
10157
  column: zColumnConfig.optional(),
9120
10158
  columnParallel: zColumnParallelConfig.optional(),
@@ -9490,11 +10528,29 @@
9490
10528
  'zh-CN',
9491
10529
  'en-US'
9492
10530
  ]).default('zh-CN');
10531
+ const zTable = schemas_object({
10532
+ chartType: literal('table'),
10533
+ dataset: zDataset.optional(),
10534
+ dimensions: zDimensions.optional(),
10535
+ measures: zMeasureTree.optional(),
10536
+ backgroundColor: zBackgroundColor.optional(),
10537
+ theme: zTheme.optional(),
10538
+ locale: zLocale.optional()
10539
+ });
10540
+ const zPivotTable = schemas_object({
10541
+ chartType: literal('pivotTable'),
10542
+ dataset: zDataset.optional(),
10543
+ dimensions: zDimensions.optional(),
10544
+ measures: zMeasures.optional(),
10545
+ backgroundColor: zBackgroundColor.optional(),
10546
+ theme: zTheme.optional(),
10547
+ locale: zLocale.optional()
10548
+ });
9493
10549
  const zLine = schemas_object({
9494
10550
  chartType: literal('line'),
9495
10551
  dataset: zDataset.optional(),
9496
10552
  dimensions: zDimensions.optional(),
9497
- measures: zMeasures.optional(),
10553
+ measures: zMeasureTree.optional(),
9498
10554
  backgroundColor: zBackgroundColor.optional(),
9499
10555
  color: zColor.optional(),
9500
10556
  label: zLabel.optional(),
@@ -9516,7 +10572,7 @@
9516
10572
  chartType: literal('column'),
9517
10573
  dataset: zDataset.optional(),
9518
10574
  dimensions: zDimensions.optional(),
9519
- measures: zMeasures.optional(),
10575
+ measures: zMeasureTree.optional(),
9520
10576
  backgroundColor: zBackgroundColor.optional(),
9521
10577
  color: zColor.optional(),
9522
10578
  label: zLabel.optional(),
@@ -9538,7 +10594,7 @@
9538
10594
  chartType: literal('columnParallel'),
9539
10595
  dataset: zDataset.optional(),
9540
10596
  dimensions: zDimensions.optional(),
9541
- measures: zMeasures.optional(),
10597
+ measures: zMeasureTree.optional(),
9542
10598
  backgroundColor: zBackgroundColor.optional(),
9543
10599
  color: zColor.optional(),
9544
10600
  label: zLabel.optional(),
@@ -9560,7 +10616,7 @@
9560
10616
  chartType: literal('columnPercent'),
9561
10617
  dataset: zDataset.optional(),
9562
10618
  dimensions: zDimensions.optional(),
9563
- measures: zMeasures.optional(),
10619
+ measures: zMeasureTree.optional(),
9564
10620
  backgroundColor: zBackgroundColor.optional(),
9565
10621
  color: zColor.optional(),
9566
10622
  label: zLabel.optional(),
@@ -9582,7 +10638,7 @@
9582
10638
  chartType: literal('bar'),
9583
10639
  dataset: zDataset.optional(),
9584
10640
  dimensions: zDimensions.optional(),
9585
- measures: zMeasures.optional(),
10641
+ measures: zMeasureTree.optional(),
9586
10642
  backgroundColor: zBackgroundColor.optional(),
9587
10643
  color: zColor.optional(),
9588
10644
  label: zLabel.optional(),
@@ -9604,7 +10660,7 @@
9604
10660
  chartType: literal('barParallel'),
9605
10661
  dataset: zDataset.optional(),
9606
10662
  dimensions: zDimensions.optional(),
9607
- measures: zMeasures.optional(),
10663
+ measures: zMeasureTree.optional(),
9608
10664
  backgroundColor: zBackgroundColor.optional(),
9609
10665
  color: zColor.optional(),
9610
10666
  label: zLabel.optional(),
@@ -9626,7 +10682,7 @@
9626
10682
  chartType: literal('barPercent'),
9627
10683
  dataset: zDataset.optional(),
9628
10684
  dimensions: zDimensions.optional(),
9629
- measures: zMeasures.optional(),
10685
+ measures: zMeasureTree.optional(),
9630
10686
  backgroundColor: zBackgroundColor.optional(),
9631
10687
  color: zColor.optional(),
9632
10688
  label: zLabel.optional(),
@@ -9648,7 +10704,7 @@
9648
10704
  chartType: literal('area'),
9649
10705
  dataset: zDataset.optional(),
9650
10706
  dimensions: zDimensions.optional(),
9651
- measures: zMeasures.optional(),
10707
+ measures: zMeasureTree.optional(),
9652
10708
  backgroundColor: zBackgroundColor.optional(),
9653
10709
  color: zColor.optional(),
9654
10710
  label: zLabel.optional(),
@@ -9671,7 +10727,7 @@
9671
10727
  chartType: literal('areaPercent'),
9672
10728
  dataset: zDataset.optional(),
9673
10729
  dimensions: zDimensions.optional(),
9674
- measures: zMeasures.optional(),
10730
+ measures: zMeasureTree.optional(),
9675
10731
  backgroundColor: zBackgroundColor.optional(),
9676
10732
  color: zColor.optional(),
9677
10733
  label: zLabel.optional(),
@@ -9694,7 +10750,7 @@
9694
10750
  chartType: literal('rose'),
9695
10751
  dataset: zDataset.optional(),
9696
10752
  dimensions: zDimensions.optional(),
9697
- measures: zMeasures.optional(),
10753
+ measures: zMeasureTree.optional(),
9698
10754
  backgroundColor: zBackgroundColor.optional(),
9699
10755
  color: zColor.optional(),
9700
10756
  label: zLabel.optional(),
@@ -9707,7 +10763,7 @@
9707
10763
  chartType: literal('roseParallel'),
9708
10764
  dataset: zDataset.optional(),
9709
10765
  dimensions: zDimensions.optional(),
9710
- measures: zMeasures.optional(),
10766
+ measures: zMeasureTree.optional(),
9711
10767
  backgroundColor: zBackgroundColor.optional(),
9712
10768
  color: zColor.optional(),
9713
10769
  label: zLabel.optional(),
@@ -9720,7 +10776,7 @@
9720
10776
  chartType: literal('pie'),
9721
10777
  dataset: zDataset.optional(),
9722
10778
  dimensions: zDimensions.optional(),
9723
- measures: zMeasures.optional(),
10779
+ measures: zMeasureTree.optional(),
9724
10780
  backgroundColor: zBackgroundColor.optional(),
9725
10781
  color: zColor.optional(),
9726
10782
  label: zLabel.optional(),
@@ -9733,7 +10789,7 @@
9733
10789
  chartType: literal('donut'),
9734
10790
  dataset: zDataset.optional(),
9735
10791
  dimensions: zDimensions.optional(),
9736
- measures: zMeasures.optional(),
10792
+ measures: zMeasureTree.optional(),
9737
10793
  backgroundColor: zBackgroundColor.optional(),
9738
10794
  color: zColor.optional(),
9739
10795
  label: zLabel.optional(),
@@ -9746,7 +10802,7 @@
9746
10802
  chartType: literal('scatter'),
9747
10803
  dataset: zDataset.optional(),
9748
10804
  dimensions: zDimensions.optional(),
9749
- measures: zMeasures.optional(),
10805
+ measures: zMeasureTree.optional(),
9750
10806
  backgroundColor: zBackgroundColor.optional(),
9751
10807
  color: zColor.optional(),
9752
10808
  label: zLabel.optional(),
@@ -9767,7 +10823,7 @@
9767
10823
  chartType: literal('funnel'),
9768
10824
  dataset: zDataset.optional(),
9769
10825
  dimensions: zDimensions.optional(),
9770
- measures: zMeasures.optional(),
10826
+ measures: zMeasureTree.optional(),
9771
10827
  backgroundColor: zBackgroundColor.optional(),
9772
10828
  color: zColor.optional(),
9773
10829
  label: zLabel.optional(),
@@ -9777,6 +10833,8 @@
9777
10833
  locale: zLocale.optional()
9778
10834
  });
9779
10835
  const zVSeed = discriminatedUnion('chartType', [
10836
+ zTable,
10837
+ zPivotTable,
9780
10838
  zLine,
9781
10839
  zColumn,
9782
10840
  zColumnParallel,
@@ -9797,8 +10855,8 @@
9797
10855
  chartType: zChartType,
9798
10856
  dataset: zDataset,
9799
10857
  datasetReshapeInfo: zDatasetReshapeInfo,
9800
- dimensions: zDimensions,
9801
- measures: zMeasures,
10858
+ dimensions: zDimensionTree,
10859
+ measures: zMeasureTree,
9802
10860
  encoding: zEncoding,
9803
10861
  config: zConfig,
9804
10862
  theme: zTheme,