@visactor/vseed 0.1.37 → 0.1.38

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 (249) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/builder/builder/buildAdvanced.js +1 -1
  4. package/dist/esm/builder/builder/buildAdvanced.js.map +1 -1
  5. package/dist/esm/builder/builder/builder.d.ts +4147 -965
  6. package/dist/esm/builder/register/all.js +3 -1
  7. package/dist/esm/builder/register/all.js.map +1 -1
  8. package/dist/esm/builder/register/chartType/boxplot.d.ts +1 -0
  9. package/dist/esm/builder/register/chartType/boxplot.js +9 -0
  10. package/dist/esm/builder/register/chartType/boxplot.js.map +1 -0
  11. package/dist/esm/builder/register/chartType/histogram.d.ts +1 -0
  12. package/dist/esm/builder/register/chartType/histogram.js +9 -0
  13. package/dist/esm/builder/register/chartType/histogram.js.map +1 -0
  14. package/dist/esm/builder/register/chartType/index.d.ts +2 -0
  15. package/dist/esm/builder/register/chartType/index.js +3 -1
  16. package/dist/esm/dataReshape/constant.d.ts +10 -0
  17. package/dist/esm/dataReshape/constant.js +11 -1
  18. package/dist/esm/dataReshape/constant.js.map +1 -1
  19. package/dist/esm/dataReshape/unfoldDimensions.js +2 -2
  20. package/dist/esm/dataReshape/unfoldDimensions.js.map +1 -1
  21. package/dist/esm/index.d.ts +1 -1
  22. package/dist/esm/index.js +2 -2
  23. package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.d.ts +2 -0
  24. package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.js +33 -0
  25. package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.js.map +1 -0
  26. package/dist/esm/pipeline/advanced/chart/pipeline/histogram.d.ts +2 -0
  27. package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js +34 -0
  28. package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js.map +1 -0
  29. package/dist/esm/pipeline/advanced/chart/pipeline/index.d.ts +2 -0
  30. package/dist/esm/pipeline/advanced/chart/pipeline/index.js +3 -1
  31. package/dist/esm/pipeline/advanced/chart/pipes/config/boxplot.d.ts +2 -0
  32. package/dist/esm/pipeline/advanced/chart/pipes/config/boxplot.js +31 -0
  33. package/dist/esm/pipeline/advanced/chart/pipes/config/boxplot.js.map +1 -0
  34. package/dist/esm/pipeline/advanced/chart/pipes/config/dualAxis.js +2 -1
  35. package/dist/esm/pipeline/advanced/chart/pipes/config/dualAxis.js.map +1 -1
  36. package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.d.ts +2 -0
  37. package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js +33 -0
  38. package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js.map +1 -0
  39. package/dist/esm/pipeline/advanced/chart/pipes/config/index.d.ts +3 -1
  40. package/dist/esm/pipeline/advanced/chart/pipes/config/index.js +3 -1
  41. package/dist/esm/pipeline/advanced/chart/pipes/config/index.js.map +1 -1
  42. package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.d.ts +3 -0
  43. package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.js +80 -0
  44. package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.js.map +1 -0
  45. package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.d.ts +3 -0
  46. package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.js +78 -0
  47. package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.js.map +1 -0
  48. package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.d.ts +2 -0
  49. package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.js +3 -1
  50. package/dist/esm/pipeline/advanced/chart/pipes/index.d.ts +1 -0
  51. package/dist/esm/pipeline/advanced/chart/pipes/index.js +1 -0
  52. package/dist/esm/pipeline/advanced/chart/pipes/measures/buildMeasures.js.map +1 -1
  53. package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/index.d.ts +1 -0
  54. package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/index.js +2 -0
  55. package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.d.ts +2 -0
  56. package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js +8 -0
  57. package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js.map +1 -0
  58. package/dist/esm/pipeline/advanced/chart/pipes/reshape/index.d.ts +4 -0
  59. package/dist/esm/pipeline/advanced/chart/pipes/reshape/index.js +5 -1
  60. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.d.ts +2 -0
  61. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js +96 -0
  62. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -0
  63. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.d.ts +2 -0
  64. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js +96 -0
  65. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js.map +1 -0
  66. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.d.ts +2 -0
  67. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.js +84 -0
  68. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.js.map +1 -0
  69. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.d.ts +2 -0
  70. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js +86 -0
  71. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js.map +1 -0
  72. package/dist/esm/pipeline/spec/chart/pipeline/bar.js +0 -1
  73. package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
  74. package/dist/esm/pipeline/spec/chart/pipeline/boxplot.d.ts +2 -0
  75. package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js +52 -0
  76. package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js.map +1 -0
  77. package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js +5 -1
  78. package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js.map +1 -1
  79. package/dist/esm/pipeline/spec/chart/pipeline/histogram.d.ts +2 -0
  80. package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +52 -0
  81. package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -0
  82. package/dist/esm/pipeline/spec/chart/pipeline/index.d.ts +2 -0
  83. package/dist/esm/pipeline/spec/chart/pipeline/index.js +3 -1
  84. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js.map +1 -1
  85. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPoint.js.map +1 -1
  86. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetBoxplot.d.ts +2 -0
  87. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetBoxplot.js +18 -0
  88. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetBoxplot.js.map +1 -0
  89. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHistogram.d.ts +2 -0
  90. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHistogram.js +18 -0
  91. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHistogram.js.map +1 -0
  92. package/dist/esm/pipeline/spec/chart/pipes/dataset/index.d.ts +2 -0
  93. package/dist/esm/pipeline/spec/chart/pipes/dataset/index.js +3 -1
  94. package/dist/esm/pipeline/spec/chart/pipes/dataset/progressive.js +4 -8
  95. package/dist/esm/pipeline/spec/chart/pipes/dataset/progressive.js.map +1 -1
  96. package/dist/esm/pipeline/spec/chart/pipes/index.d.ts +1 -0
  97. package/dist/esm/pipeline/spec/chart/pipes/index.js +1 -0
  98. package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.d.ts +2 -0
  99. package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js +37 -0
  100. package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js.map +1 -0
  101. package/dist/esm/pipeline/spec/chart/pipes/init/histogram.d.ts +2 -0
  102. package/dist/esm/pipeline/spec/chart/pipes/init/histogram.js +21 -0
  103. package/dist/esm/pipeline/spec/chart/pipes/init/histogram.js.map +1 -0
  104. package/dist/esm/pipeline/spec/chart/pipes/init/index.d.ts +2 -0
  105. package/dist/esm/pipeline/spec/chart/pipes/init/index.js +3 -1
  106. package/dist/esm/pipeline/spec/chart/pipes/label/label.d.ts +15 -4
  107. package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
  108. package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js.map +1 -1
  109. package/dist/esm/pipeline/spec/chart/pipes/label/labelPie.js.map +1 -1
  110. package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js.map +1 -1
  111. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js.map +1 -1
  112. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js.map +1 -1
  113. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointState.js.map +1 -1
  114. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js.map +1 -1
  115. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js +37 -14
  116. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js.map +1 -1
  117. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js.map +1 -1
  118. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js.map +1 -1
  119. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.d.ts +2 -0
  120. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.js +126 -0
  121. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.js.map +1 -0
  122. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/index.d.ts +1 -0
  123. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/index.js +1 -0
  124. package/dist/esm/pipeline/spec/chart/pipes/stack/stackCornerRadius.js +1 -0
  125. package/dist/esm/pipeline/spec/chart/pipes/stack/stackCornerRadius.js.map +1 -1
  126. package/dist/esm/pipeline/spec/chart/pipes/tooltip/index.d.ts +2 -0
  127. package/dist/esm/pipeline/spec/chart/pipes/tooltip/index.js +3 -1
  128. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.d.ts +2 -0
  129. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js +98 -0
  130. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js.map +1 -0
  131. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.d.ts +2 -0
  132. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js +69 -0
  133. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js.map +1 -0
  134. package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.js.map +1 -1
  135. package/dist/esm/pipeline/spec/table/pipes/indicators/pivotDataConfig.js +1 -2
  136. package/dist/esm/pipeline/spec/table/pipes/indicators/pivotDataConfig.js.map +1 -1
  137. package/dist/esm/pipeline/spec/table/pipes/indicators/pivotIndicators.js.map +1 -1
  138. package/dist/esm/pipeline/spec/table/pipes/theme/bodyStyle.js +1 -0
  139. package/dist/esm/pipeline/spec/table/pipes/theme/bodyStyle.js.map +1 -1
  140. package/dist/esm/pipeline/spec/table/pipes/theme/cornerHeaderStyle.js.map +1 -1
  141. package/dist/esm/pipeline/spec/table/pipes/theme/frameStyle.js.map +1 -1
  142. package/dist/esm/pipeline/spec/table/pipes/theme/headerStyle.js.map +1 -1
  143. package/dist/esm/pipeline/spec/table/pipes/theme/rowHeaderStyle.js.map +1 -1
  144. package/dist/esm/pipeline/spec/table/pipes/theme/scrollStyle.js.map +1 -1
  145. package/dist/esm/pipeline/spec/table/pipes/theme/selectionStyle.js.map +1 -1
  146. package/dist/esm/pipeline/spec/table/pipes/theme/type.d.ts +13 -0
  147. package/dist/esm/pipeline/spec/table/pipes/theme/type.js +0 -0
  148. package/dist/esm/pipeline/utils/constant.d.ts +2 -0
  149. package/dist/esm/pipeline/utils/constant.js +3 -1
  150. package/dist/esm/pipeline/utils/constant.js.map +1 -1
  151. package/dist/esm/theme/common/regressionLine.d.ts +4 -0
  152. package/dist/esm/theme/common/regressionLine.js +16 -0
  153. package/dist/esm/theme/common/regressionLine.js.map +1 -0
  154. package/dist/esm/theme/common/table.d.ts +17 -8
  155. package/dist/esm/theme/common/table.js +11 -8
  156. package/dist/esm/theme/common/table.js.map +1 -1
  157. package/dist/esm/theme/dark/dark.js +18 -0
  158. package/dist/esm/theme/dark/dark.js.map +1 -1
  159. package/dist/esm/theme/light/light.js +18 -0
  160. package/dist/esm/theme/light/light.js.map +1 -1
  161. package/dist/esm/types/advancedVSeed.d.ts +1441 -17
  162. package/dist/esm/types/advancedVSeed.js +3 -2
  163. package/dist/esm/types/advancedVSeed.js.map +1 -1
  164. package/dist/esm/types/chartType/area/zArea.d.ts +9 -0
  165. package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +9 -0
  166. package/dist/esm/types/chartType/bar/zBar.d.ts +9 -0
  167. package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +9 -0
  168. package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +9 -0
  169. package/dist/esm/types/chartType/boxplot/boxplot.d.ts +144 -0
  170. package/dist/esm/types/chartType/boxplot/boxplot.js +0 -0
  171. package/dist/esm/types/chartType/boxplot/index.d.ts +2 -0
  172. package/dist/esm/types/chartType/boxplot/index.js +1 -0
  173. package/dist/esm/types/chartType/boxplot/zBoxplot.d.ts +1185 -0
  174. package/dist/esm/types/chartType/boxplot/zBoxplot.js +30 -0
  175. package/dist/esm/types/chartType/boxplot/zBoxplot.js.map +1 -0
  176. package/dist/esm/types/chartType/column/zColumn.d.ts +25 -0
  177. package/dist/esm/types/chartType/column/zColumn.js +3 -1
  178. package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
  179. package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +9 -0
  180. package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +9 -0
  181. package/dist/esm/types/chartType/donut/zDonut.d.ts +9 -0
  182. package/dist/esm/types/chartType/funnel/zFunnel.d.ts +9 -0
  183. package/dist/esm/types/chartType/histogram/histogram.d.ts +127 -0
  184. package/dist/esm/types/chartType/histogram/histogram.js +0 -0
  185. package/dist/esm/types/chartType/histogram/index.d.ts +2 -0
  186. package/dist/esm/types/chartType/histogram/index.js +1 -0
  187. package/dist/esm/types/chartType/histogram/zHistogram.d.ts +1377 -0
  188. package/dist/esm/types/chartType/histogram/zHistogram.js +32 -0
  189. package/dist/esm/types/chartType/histogram/zHistogram.js.map +1 -0
  190. package/dist/esm/types/chartType/index.d.ts +3 -0
  191. package/dist/esm/types/chartType/index.js +2 -0
  192. package/dist/esm/types/chartType/line/zLine.d.ts +9 -0
  193. package/dist/esm/types/chartType/pie/zPie.d.ts +9 -0
  194. package/dist/esm/types/chartType/radar/zRadar.d.ts +9 -0
  195. package/dist/esm/types/chartType/rose/zRose.d.ts +9 -0
  196. package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +9 -0
  197. package/dist/esm/types/chartType/scatter/zScatter.d.ts +9 -0
  198. package/dist/esm/types/properties/chartType/chartType.d.ts +3 -1
  199. package/dist/esm/types/properties/chartType/chartType.js +3 -1
  200. package/dist/esm/types/properties/chartType/chartType.js.map +1 -1
  201. package/dist/esm/types/properties/config/area.d.ts +4 -0
  202. package/dist/esm/types/properties/config/bar.d.ts +6 -0
  203. package/dist/esm/types/properties/config/boxplot.d.ts +326 -0
  204. package/dist/esm/types/properties/config/boxplot.js +27 -0
  205. package/dist/esm/types/properties/config/boxplot.js.map +1 -0
  206. package/dist/esm/types/properties/config/column.d.ts +6 -0
  207. package/dist/esm/types/properties/config/config.d.ts +697 -0
  208. package/dist/esm/types/properties/config/config.js +5 -1
  209. package/dist/esm/types/properties/config/config.js.map +1 -1
  210. package/dist/esm/types/properties/config/dualAxis.d.ts +2 -0
  211. package/dist/esm/types/properties/config/funnel.d.ts +2 -0
  212. package/dist/esm/types/properties/config/heatmap.d.ts +2 -0
  213. package/dist/esm/types/properties/config/histogram.d.ts +339 -0
  214. package/dist/esm/types/properties/config/histogram.js +32 -0
  215. package/dist/esm/types/properties/config/histogram.js.map +1 -0
  216. package/dist/esm/types/properties/config/index.d.ts +1 -0
  217. package/dist/esm/types/properties/config/index.js +1 -0
  218. package/dist/esm/types/properties/config/line.d.ts +2 -0
  219. package/dist/esm/types/properties/config/pie.d.ts +6 -0
  220. package/dist/esm/types/properties/config/pivotGrid/pivotGrid.d.ts +2 -0
  221. package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js +3 -1
  222. package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js.map +1 -1
  223. package/dist/esm/types/properties/config/rose.d.ts +4 -0
  224. package/dist/esm/types/properties/config/scatter.d.ts +2 -0
  225. package/dist/esm/types/properties/config/whiskers/index.d.ts +3 -0
  226. package/dist/esm/types/properties/config/whiskers/index.js +5 -0
  227. package/dist/esm/types/properties/config/whiskers/index.js.map +1 -0
  228. package/dist/esm/types/properties/encoding/encoding.d.ts +36 -0
  229. package/dist/esm/types/properties/encoding/measureEncoding.d.ts +1 -1
  230. package/dist/esm/types/properties/encoding/zEncoding.d.ts +9 -0
  231. package/dist/esm/types/properties/encoding/zEncoding.js +10 -1
  232. package/dist/esm/types/properties/encoding/zEncoding.js.map +1 -1
  233. package/dist/esm/types/properties/index.d.ts +1 -0
  234. package/dist/esm/types/properties/index.js +1 -0
  235. package/dist/esm/types/properties/regressionLine/histogramRegressionLine.d.ts +45 -0
  236. package/dist/esm/types/properties/regressionLine/histogramRegressionLine.js +0 -0
  237. package/dist/esm/types/properties/regressionLine/index.d.ts +2 -0
  238. package/dist/esm/types/properties/regressionLine/index.js +1 -0
  239. package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.d.ts +11 -0
  240. package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.js +17 -0
  241. package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.js.map +1 -0
  242. package/dist/esm/types/properties/theme/customTheme.d.ts +1935 -541
  243. package/dist/esm/types/vseed.d.ts +2 -2
  244. package/dist/esm/types/zVseed.d.ts +2717 -0
  245. package/dist/esm/types/zVseed.js +4 -2
  246. package/dist/esm/types/zVseed.js.map +1 -1
  247. package/dist/umd/index.js +1741 -148
  248. package/dist/umd/index.js.map +1 -1
  249. package/package.json +6 -4
package/dist/umd/index.js CHANGED
@@ -68,6 +68,7 @@
68
68
  __webpack_require__.r(__webpack_exports__);
69
69
  __webpack_require__.d(__webpack_exports__, {
70
70
  funnelAdvancedPipeline: ()=>funnelAdvancedPipeline,
71
+ zBoxplot: ()=>zBoxplot,
71
72
  zHeatmapConfig: ()=>zHeatmapConfig,
72
73
  execPipeline: ()=>execPipeline,
73
74
  areaSpecPipeline: ()=>areaSpecPipeline,
@@ -88,6 +89,7 @@
88
89
  zYLinearAxis: ()=>zYLinearAxis,
89
90
  zMarkStyle: ()=>zMarkStyle,
90
91
  registerFunnel: ()=>registerFunnel,
92
+ zHistogramRegressionLine: ()=>zHistogramRegressionLine,
91
93
  columnAdvancedPipeline: ()=>columnAdvancedPipeline,
92
94
  zLabel: ()=>zLabel,
93
95
  registerColumn: ()=>registerColumn,
@@ -99,6 +101,7 @@
99
101
  zLineStyle: ()=>zLineStyle,
100
102
  registerArea: ()=>registerArea,
101
103
  zDataset: ()=>zDataset,
104
+ registerBoxplot: ()=>registerBoxplot,
102
105
  DimensionEncodingEnum: ()=>DimensionEncodingEnum,
103
106
  barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
104
107
  zColumnParallel: ()=>zColumnParallel,
@@ -110,6 +113,7 @@
110
113
  FoldXMeasureId: ()=>FoldXMeasureId,
111
114
  zAnnotationAreaConfig: ()=>zAnnotationAreaConfig,
112
115
  zAnnotationVerticalLineConfig: ()=>zAnnotationVerticalLineConfig,
116
+ zHistogram: ()=>zHistogram,
113
117
  zAnnotationConfig: ()=>zAnnotationConfig,
114
118
  registerBarPercent: ()=>registerBarPercent,
115
119
  ColorIdEncoding: ()=>ColorIdEncoding,
@@ -118,8 +122,9 @@
118
122
  roseAdvancedPipeline: ()=>roseAdvancedPipeline,
119
123
  zBarParallel: ()=>zBarParallel,
120
124
  registerDarkTheme: ()=>registerDarkTheme,
121
- zChartType: ()=>zChartType,
125
+ MedianMeasureId: ()=>MedianMeasureId,
122
126
  tableAdvancedPipeline: ()=>tableAdvancedPipeline,
127
+ zChartType: ()=>zChartType,
123
128
  zMeasureTree: ()=>zMeasureTree,
124
129
  zStackCornerRadius: ()=>zStackCornerRadius,
125
130
  registerRose: ()=>registerRose,
@@ -135,8 +140,9 @@
135
140
  registerBar: ()=>registerBar,
136
141
  zColor: ()=>zColor,
137
142
  registerDonut: ()=>registerDonut,
138
- heatmapSpecPipeline: ()=>heatmapSpecPipeline,
143
+ BinStartMeasureId: ()=>BinStartMeasureId,
139
144
  heatmapAdvancedPipeline: ()=>heatmapAdvancedPipeline,
145
+ heatmapSpecPipeline: ()=>heatmapSpecPipeline,
140
146
  zFunnelConfig: ()=>zFunnelConfig,
141
147
  zMeasures: ()=>zMeasures,
142
148
  zDualAxis: ()=>zDualAxis,
@@ -144,9 +150,11 @@
144
150
  zDualChartType: ()=>zDualChartType,
145
151
  darkTheme: ()=>darkTheme,
146
152
  isVTable: ()=>isVTable,
153
+ MaxMeasureId: ()=>MaxMeasureId,
147
154
  ORIGINAL_DATA: ()=>ORIGINAL_DATA,
148
- zAnnotationHorizontalLineConfig: ()=>zAnnotationHorizontalLineConfig,
155
+ MinMeasureId: ()=>MinMeasureId,
149
156
  columnParallelSpecPipeline: ()=>columnParallelSpecPipeline,
157
+ zAnnotationHorizontalLineConfig: ()=>zAnnotationHorizontalLineConfig,
150
158
  zAnnotationPoint: ()=>zAnnotationPoint,
151
159
  DATUM_HIDE_KEY: ()=>DATUM_HIDE_KEY,
152
160
  isMeasure: ()=>isMeasure,
@@ -154,6 +162,7 @@
154
162
  zSort: ()=>zSort,
155
163
  isPivotChart: ()=>isPivotChart,
156
164
  zDualAxisConfig: ()=>zDualAxisConfig,
165
+ Q1MeasureValue: ()=>"__Q1__",
157
166
  zLineConfig: ()=>zLineConfig,
158
167
  FoldPrimaryMeasureValue: ()=>FoldPrimaryMeasureValue,
159
168
  zXBandAxis: ()=>zXBandAxis,
@@ -168,6 +177,7 @@
168
177
  zLocale: ()=>zLocale,
169
178
  isDimension: ()=>isDimension,
170
179
  registerScatter: ()=>registerScatter,
180
+ boxplotSpecPipeline: ()=>boxplotSpecPipeline,
171
181
  autoNumFormatter: ()=>autoNumFormatter,
172
182
  tableSpecPipeline: ()=>tableSpecPipeline,
173
183
  isCombination: ()=>isCombination,
@@ -179,17 +189,18 @@
179
189
  columnParallelAdvancedPipeline: ()=>columnParallelAdvancedPipeline,
180
190
  zColumnPercent: ()=>zColumnPercent,
181
191
  foldMeasures: ()=>foldMeasures,
192
+ zFunnel: ()=>zFunnel,
182
193
  isPivotTable: ()=>isPivotTable,
183
194
  registerPie: ()=>registerPie,
184
195
  zDimensionEncoding: ()=>zDimensionEncoding,
185
- zFunnel: ()=>zFunnel,
186
196
  zBarParallelConfig: ()=>zBarParallelConfig,
187
197
  lineAdvancedPipeline: ()=>lineAdvancedPipeline,
188
198
  FoldMeasureValue: ()=>FoldMeasureValue,
189
199
  ANNOTATION_Z_INDEX: ()=>1000,
200
+ Q3MeasureValue: ()=>"__Q3__",
190
201
  createFormatter: ()=>createFormatter,
191
- isMeasureSelector: ()=>isMeasureSelector,
192
202
  columnPercentSpecPipeline: ()=>columnPercentSpecPipeline,
203
+ isMeasureSelector: ()=>isMeasureSelector,
193
204
  areaAdvancedPipeline: ()=>areaAdvancedPipeline,
194
205
  areaPercentSpecPipeline: ()=>areaPercentSpecPipeline,
195
206
  barParallelSpecPipeline: ()=>barParallelSpecPipeline,
@@ -211,12 +222,14 @@
211
222
  selector: ()=>selector_selector,
212
223
  isMeasures: ()=>isMeasures,
213
224
  zYBandAxis: ()=>zYBandAxis,
225
+ BinPercentageMeasureId: ()=>BinPercentageMeasureId,
214
226
  Separator: ()=>"-",
215
227
  findAllMeasures: ()=>findAllMeasures,
216
228
  zColorLegend: ()=>zColorLegend,
217
229
  EncodingEnum: ()=>EncodingEnum,
218
230
  preorderTraverse: ()=>preorderTraverse,
219
231
  roseParallelSpecPipeline: ()=>roseParallelSpecPipeline,
232
+ registerHistogram: ()=>registerHistogram,
220
233
  zRoseParallel: ()=>zRoseParallel,
221
234
  MeasureName: ()=>MeasureName,
222
235
  zNumFormat: ()=>zNumFormat,
@@ -251,9 +264,12 @@
251
264
  roseParallelAdvancedPipeline: ()=>roseParallelAdvancedPipeline,
252
265
  zPieConfig: ()=>zPieConfig,
253
266
  Builder: ()=>Builder,
267
+ zWhiskersConfig: ()=>zWhiskersConfig,
254
268
  radarSpecPipeline: ()=>radarSpecPipeline,
269
+ OutliersMeasureId: ()=>OutliersMeasureId,
255
270
  zRadar: ()=>zRadar,
256
271
  zTable: ()=>zTable,
272
+ histogramSpecPipeline: ()=>histogramSpecPipeline,
257
273
  registerLine: ()=>registerLine,
258
274
  registerCustomTheme: ()=>registerCustomTheme,
259
275
  zMeasureGroup: ()=>zMeasureGroup,
@@ -271,6 +287,7 @@
271
287
  zLinearColor: ()=>zLinearColor,
272
288
  DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX: ()=>1001,
273
289
  zAreaStyle: ()=>zAreaStyle,
290
+ BinEndMeasureId: ()=>BinEndMeasureId,
274
291
  zAnnotationArea: ()=>zAnnotationArea,
275
292
  DetailEncoding: ()=>DetailEncoding,
276
293
  isPivot: ()=>isPivot,
@@ -279,6 +296,7 @@
279
296
  lightTheme: ()=>lightTheme,
280
297
  registerColumnParallel: ()=>registerColumnParallel,
281
298
  updateAdvanced: ()=>updateAdvanced,
299
+ histogramAdvancedPipeline: ()=>histogramAdvancedPipeline,
282
300
  isAreaPercent: ()=>isAreaPercent,
283
301
  zColumn: ()=>zColumn,
284
302
  zCustomTheme: ()=>zCustomTheme,
@@ -288,15 +306,18 @@
288
306
  ChartTypeEnum: ()=>ChartTypeEnum,
289
307
  zVSeed: ()=>zVSeed,
290
308
  radarAdvancedPipeline: ()=>radarAdvancedPipeline,
309
+ registerDualAxis: ()=>registerDualAxis,
291
310
  registerBarParallel: ()=>registerBarParallel,
292
311
  pivotTableSpecPipeline: ()=>pivotTableSpecPipeline,
293
312
  DUAL_AXIS_LABEL_Z_INDEX: ()=>1002,
294
313
  MeasureEncodingEnum: ()=>MeasureEncodingEnum,
295
314
  FoldXMeasureValue: ()=>FoldXMeasureValue,
296
- dualAxisAdvancedPipeline: ()=>dualAxisAdvancedPipeline,
315
+ boxplotAdvancedPipeline: ()=>boxplotAdvancedPipeline,
297
316
  zEncoding: ()=>zEncoding,
317
+ dualAxisAdvancedPipeline: ()=>dualAxisAdvancedPipeline,
298
318
  ColorEncoding: ()=>ColorEncoding,
299
319
  measureDepth: ()=>measureDepth,
320
+ BinCountMeasureId: ()=>BinCountMeasureId,
300
321
  zAdvancedVSeed: ()=>zAdvancedVSeed,
301
322
  zAreaPercent: ()=>zAreaPercent,
302
323
  isValueSelector: ()=>isValueSelector,
@@ -306,9 +327,9 @@
306
327
  zTooltip: ()=>zTooltip,
307
328
  isBarLikeChart: ()=>isBarLikeChart,
308
329
  barParallelAdvancedPipeline: ()=>barParallelAdvancedPipeline,
309
- deleteMeasureTreeByCallback: ()=>deleteMeasureTreeByCallback,
310
- zBarPercentConfig: ()=>zBarPercentConfig,
311
330
  barPercentSpecPipeline: ()=>barPercentSpecPipeline,
331
+ zBarPercentConfig: ()=>zBarPercentConfig,
332
+ deleteMeasureTreeByCallback: ()=>deleteMeasureTreeByCallback,
312
333
  dataReshapeByEncoding: ()=>dataReshapeByEncoding,
313
334
  lineSpecPipeline: ()=>lineSpecPipeline,
314
335
  zDimensionGroup: ()=>zDimensionGroup
@@ -351,7 +372,7 @@
351
372
  const { chartType } = builder.vseed;
352
373
  if (!chartType) throw new Error('chartType is nil in buildAdvanced');
353
374
  const pipeline = Builder.getAdvancedPipeline(chartType);
354
- if (!pipeline) throw new Error(`no advanced pipeline for chartType ${chartType}`);
375
+ if (!pipeline) throw new Error(`please invoke registerAll or register ${chartType} before build, no advanced pipeline for chartType ${chartType}`);
355
376
  const context = {
356
377
  vseed: builder.vseed,
357
378
  customTheme: Builder.getThemeMap()
@@ -564,7 +585,9 @@
564
585
  Donut: 'donut',
565
586
  Radar: 'radar',
566
587
  Funnel: 'funnel',
567
- Heatmap: 'heatmap'
588
+ Heatmap: 'heatmap',
589
+ Boxplot: 'boxPlot',
590
+ Histogram: 'histogram'
568
591
  };
569
592
  const DATUM_HIDE_KEY = '__VSEED_HideItem__';
570
593
  const isTable = (vseed)=>vseed.chartType === ChartTypeEnum.Table;
@@ -1206,6 +1229,7 @@
1206
1229
  const fontSize = themeConfig.bodyFontSize || 12;
1207
1230
  const hoverCellBgColor = themeConfig.hoverBodyBackgroundColor || '#bedaff';
1208
1231
  const hoverInlineColor = themeConfig.hoverBodyInlineBackgroundColor || '#bedaff';
1232
+ if (!result.theme) result.theme = {};
1209
1233
  result.theme.bodyStyle = {
1210
1234
  borderColor: borderColor,
1211
1235
  borderLineWidth: 1,
@@ -1342,6 +1366,14 @@
1342
1366
  const DetailEncoding = '__Dim_Detail__';
1343
1367
  const ColorEncoding = '__Dim_Color__';
1344
1368
  const ColorIdEncoding = '__Dim_ColorId__';
1369
+ const MinMeasureId = '__Min__';
1370
+ const MaxMeasureId = '__Max__';
1371
+ const OutliersMeasureId = '__Outliers__';
1372
+ const MedianMeasureId = '__Meadian__';
1373
+ const BinStartMeasureId = '__BinStart__';
1374
+ const BinEndMeasureId = '__BinEnd__';
1375
+ const BinCountMeasureId = '__BinCount__';
1376
+ const BinPercentageMeasureId = '__BinPercentage__';
1345
1377
  const defaultMeasureName = (advancedVSeed)=>{
1346
1378
  const result = {
1347
1379
  ...advancedVSeed
@@ -1750,20 +1782,12 @@
1750
1782
  };
1751
1783
  return result;
1752
1784
  };
1753
- var new_data_set_AggregationType;
1754
- !function(AggregationType) {
1755
- AggregationType.RECORD = "RECORD", AggregationType.NONE = "NONE", AggregationType.SUM = "SUM", AggregationType.MIN = "MIN", AggregationType.MAX = "MAX", AggregationType.AVG = "AVG", AggregationType.COUNT = "COUNT", AggregationType.CUSTOM = "CUSTOM", AggregationType.RECALCULATE = "RECALCULATE";
1756
- }(new_data_set_AggregationType || (new_data_set_AggregationType = {}));
1757
- var new_data_set_SortType;
1758
- !function(SortType) {
1759
- SortType.ASC = "ASC", SortType.DESC = "DESC", SortType.NORMAL = "NORMAL", SortType.desc = "desc", SortType.asc = "asc", SortType.normal = "normal";
1760
- }(new_data_set_SortType || (new_data_set_SortType = {}));
1761
1785
  const dataConfig = (spec, context)=>{
1762
1786
  const { advancedVSeed } = context;
1763
1787
  const measures = findAllMeasures(advancedVSeed.measures);
1764
1788
  const aggregationRules = measures.map((measure)=>({
1765
1789
  field: measure.id,
1766
- aggregationType: new_data_set_AggregationType.NONE,
1790
+ aggregationType: 'NONE',
1767
1791
  indicatorKey: measure.id
1768
1792
  }));
1769
1793
  return {
@@ -2143,8 +2167,8 @@
2143
2167
  applyEncoding(ColorEncoding, colorDimensions, datum, separator);
2144
2168
  applyEncoding(DetailEncoding, detailDimensions, datum, separator);
2145
2169
  if (!colorDimensions.length || !datum[ColorEncoding]) continue;
2146
- const measureId = String(datum[foldMeasureId]);
2147
- const colorItem = String(datum[ColorEncoding]);
2170
+ const measureId = String(datum[foldMeasureId] ?? '');
2171
+ const colorItem = String(datum[ColorEncoding] ?? '');
2148
2172
  const colorId = colorItemAsId ? colorItem : measureId ? [
2149
2173
  colorItem,
2150
2174
  measureId
@@ -2605,18 +2629,14 @@
2605
2629
  }
2606
2630
  };
2607
2631
  };
2608
- const progressive = (spec, context)=>{
2632
+ const progressive = (spec)=>{
2609
2633
  const result = {
2610
2634
  ...spec
2611
2635
  };
2612
- const { advancedVSeed } = context;
2613
- const { dataset = [] } = advancedVSeed;
2614
- const size = dataset.length;
2615
- if (size < 5000) return result;
2616
- result.large = true;
2617
- result.largeThreshold = 5000;
2636
+ result.large = false;
2637
+ result.largeThreshold = 1 / 0;
2618
2638
  result.progressiveStep = 400;
2619
- result.progressiveThreshold = 8000;
2639
+ result.progressiveThreshold = 1 / 0;
2620
2640
  return result;
2621
2641
  };
2622
2642
  const defaultTitleText = (measures, dimensions, idList = [])=>{
@@ -3997,6 +4017,8 @@
3997
4017
  const headerBackgroundColor = themConfig.headerBackgroundColor ?? 'rgba(0,0,0,0)';
3998
4018
  const hoverHeaderBackgroundColor = onlyCombination ? transparent : themConfig.hoverHeaderBackgroundColor ?? '#D9DDE4';
3999
4019
  const hoverHeaderInlineBackgroundColor = onlyCombination ? transparent : themConfig.hoverHeaderInlineBackgroundColor ?? '#D9DDE455';
4020
+ const outlineBorderLineWidth = themConfig.outlineBorderLineWidth ?? 0;
4021
+ const frameCornerRadius = themConfig.frameCornerRadius ?? 0;
4000
4022
  return {
4001
4023
  ...result,
4002
4024
  theme: {
@@ -4006,8 +4028,8 @@
4006
4028
  color: bodyFontColor,
4007
4029
  borderLineWidth: [
4008
4030
  1,
4009
- 1,
4010
- 1,
4031
+ outlineBorderLineWidth,
4032
+ 0,
4011
4033
  1
4012
4034
  ],
4013
4035
  bgColor: transparent,
@@ -4018,7 +4040,12 @@
4018
4040
  headerStyle: {
4019
4041
  borderColor,
4020
4042
  fontSize: 12,
4021
- borderLineWidth: 1,
4043
+ borderLineWidth: [
4044
+ outlineBorderLineWidth,
4045
+ outlineBorderLineWidth,
4046
+ 1,
4047
+ 1
4048
+ ],
4022
4049
  color: headerFontColor,
4023
4050
  textAlign: 'center',
4024
4051
  bgColor: headerBackgroundColor,
@@ -4032,7 +4059,12 @@
4032
4059
  borderColor,
4033
4060
  fontSize: 12,
4034
4061
  color: headerFontColor,
4035
- borderLineWidth: 1,
4062
+ borderLineWidth: [
4063
+ 1,
4064
+ 1,
4065
+ 1,
4066
+ outlineBorderLineWidth
4067
+ ],
4036
4068
  bgColor: headerBackgroundColor,
4037
4069
  hover: {
4038
4070
  cellBgColor: hoverHeaderBackgroundColor,
@@ -4046,15 +4078,20 @@
4046
4078
  fontSize: 12,
4047
4079
  color: headerFontColor,
4048
4080
  fontWeight: 'bold',
4049
- borderLineWidth: 1,
4081
+ borderLineWidth: [
4082
+ outlineBorderLineWidth,
4083
+ 1,
4084
+ 1,
4085
+ outlineBorderLineWidth
4086
+ ],
4050
4087
  bgColor: headerBackgroundColor,
4051
4088
  frameStyle: {
4052
4089
  borderColor,
4053
4090
  borderLineWidth: [
4054
- 1,
4091
+ outlineBorderLineWidth,
4055
4092
  0,
4056
4093
  0,
4057
- 1
4094
+ outlineBorderLineWidth
4058
4095
  ]
4059
4096
  },
4060
4097
  hover: {
@@ -4069,7 +4106,7 @@
4069
4106
  frameStyle: {
4070
4107
  borderColor,
4071
4108
  borderLineWidth: [
4072
- 1,
4109
+ outlineBorderLineWidth,
4073
4110
  1,
4074
4111
  0,
4075
4112
  1
@@ -4085,8 +4122,8 @@
4085
4122
  borderLineWidth: [
4086
4123
  1,
4087
4124
  0,
4088
- 1,
4089
- 1
4125
+ outlineBorderLineWidth,
4126
+ outlineBorderLineWidth
4090
4127
  ],
4091
4128
  bgColor: headerBackgroundColor,
4092
4129
  frameStyle: {
@@ -4094,8 +4131,8 @@
4094
4131
  borderLineWidth: [
4095
4132
  1,
4096
4133
  0,
4097
- 1,
4098
- 1
4134
+ outlineBorderLineWidth,
4135
+ outlineBorderLineWidth
4099
4136
  ]
4100
4137
  },
4101
4138
  hover: {
@@ -4129,7 +4166,12 @@
4129
4166
  },
4130
4167
  bottomFrozenStyle: {
4131
4168
  borderColor,
4132
- borderLineWidth: 1,
4169
+ borderLineWidth: [
4170
+ 1,
4171
+ outlineBorderLineWidth,
4172
+ outlineBorderLineWidth,
4173
+ 1
4174
+ ],
4133
4175
  bgColor: headerBackgroundColor,
4134
4176
  hover: {
4135
4177
  cellBgColor: hoverHeaderBackgroundColor
@@ -4141,7 +4183,8 @@
4141
4183
  },
4142
4184
  frameStyle: {
4143
4185
  borderColor,
4144
- cornerRadius: 4
4186
+ cornerRadius: frameCornerRadius,
4187
+ borderLineWidth: outlineBorderLineWidth
4145
4188
  }
4146
4189
  }
4147
4190
  };
@@ -4672,6 +4715,7 @@
4672
4715
  const stackCornerRadius = advancedVSeed.config?.[chartType]?.stackCornerRadius;
4673
4716
  const { datasetReshapeInfo } = advancedVSeed;
4674
4717
  const { foldInfo } = datasetReshapeInfo[0];
4718
+ if ('dualAxis' === chartType && 'bar' !== spec.type) return spec;
4675
4719
  return {
4676
4720
  ...spec,
4677
4721
  stackCornerRadius: (_, datum)=>{
@@ -5249,7 +5293,7 @@
5249
5293
  markStyle_markStyle,
5250
5294
  annotation_annotation
5251
5295
  ];
5252
- const percent = (spec)=>{
5296
+ const percent_percent = (spec)=>{
5253
5297
  const result = {
5254
5298
  ...spec
5255
5299
  };
@@ -5263,7 +5307,7 @@
5263
5307
  barMaxWidth_barMaxWidth,
5264
5308
  colorAdapter(color_color, linearColor),
5265
5309
  background_backgroundColor,
5266
- percent,
5310
+ percent_percent,
5267
5311
  datasetXY,
5268
5312
  progressive,
5269
5313
  xBand,
@@ -5288,7 +5332,7 @@
5288
5332
  stackCornerRadius_stackCornerRadius,
5289
5333
  stackInverse,
5290
5334
  colorAdapter(color_color, linearColor),
5291
- percent,
5335
+ percent_percent,
5292
5336
  background_backgroundColor,
5293
5337
  datasetXY,
5294
5338
  progressive,
@@ -5734,7 +5778,6 @@
5734
5778
  xLinear,
5735
5779
  yBand,
5736
5780
  label_label,
5737
- label_label,
5738
5781
  tooltip_tooltip,
5739
5782
  colorBarStyleFill(barStyle_barStyle),
5740
5783
  horizontalCrosshairRect,
@@ -5902,7 +5945,7 @@
5902
5945
  barMaxWidth_barMaxWidth,
5903
5946
  colorAdapter(color_color, linearColor),
5904
5947
  background_backgroundColor,
5905
- percent,
5948
+ percent_percent,
5906
5949
  datasetYX,
5907
5950
  progressive,
5908
5951
  xLinear,
@@ -5927,7 +5970,7 @@
5927
5970
  stackCornerRadius_stackCornerRadius,
5928
5971
  colorAdapter(color_color, linearColor),
5929
5972
  background_backgroundColor,
5930
- percent,
5973
+ percent_percent,
5931
5974
  datasetYX,
5932
5975
  yBand,
5933
5976
  xLinear,
@@ -6180,7 +6223,7 @@
6180
6223
  stackInverse,
6181
6224
  colorAdapter(color_color, linearColor),
6182
6225
  background_backgroundColor,
6183
- percent,
6226
+ percent_percent,
6184
6227
  datasetXY,
6185
6228
  progressive,
6186
6229
  xBand,
@@ -6208,7 +6251,7 @@
6208
6251
  stackInverse,
6209
6252
  colorAdapter(color_color, linearColor),
6210
6253
  background_backgroundColor,
6211
- percent,
6254
+ percent_percent,
6212
6255
  datasetXY,
6213
6256
  progressive,
6214
6257
  xBand,
@@ -7144,7 +7187,8 @@
7144
7187
  'crosshairLine',
7145
7188
  'crosshairRect',
7146
7189
  'barGapInGroup',
7147
- 'barMaxWidth'
7190
+ 'barMaxWidth',
7191
+ 'stackCornerRadius'
7148
7192
  ]);
7149
7193
  const config = replaceNullToUndefined(pickedConfig);
7150
7194
  result.config = {
@@ -7185,7 +7229,7 @@
7185
7229
  markStyle_markStyle,
7186
7230
  annotation_annotation
7187
7231
  ];
7188
- const series = (...args)=>{
7232
+ const series_series = (...args)=>{
7189
7233
  const result = {
7190
7234
  type: 'common',
7191
7235
  padding: 0,
@@ -7768,6 +7812,7 @@
7768
7812
  progressive,
7769
7813
  barMaxWidth_barMaxWidth,
7770
7814
  barGapInGroup_barGapInGroup,
7815
+ stackCornerRadius_stackCornerRadius,
7771
7816
  colorBarStyleFill(barStyle_barStyle),
7772
7817
  colorPointStyleFill(pointStyle_pointStyle),
7773
7818
  pointStateDimensionHover,
@@ -7782,6 +7827,7 @@
7782
7827
  progressive,
7783
7828
  barMaxWidth_barMaxWidth,
7784
7829
  barGapInGroup_barGapInGroup,
7830
+ stackCornerRadius_stackCornerRadius,
7785
7831
  colorBarStyleFill(barStyle_barStyle),
7786
7832
  colorPointStyleFill(pointStyle_pointStyle),
7787
7833
  pointStateDimensionHover,
@@ -7806,13 +7852,14 @@
7806
7852
  pivotIndicatorsAsRow,
7807
7853
  datasetPivot,
7808
7854
  pivotIndicators_pivotIndicators([
7809
- series([
7855
+ series_series([
7810
7856
  initDualAxisPrimary,
7811
7857
  dualChartTypePrimary,
7812
7858
  datasetPrimary,
7813
7859
  labelPrimary,
7814
7860
  tooltipPrimary,
7815
7861
  progressive,
7862
+ stackCornerRadius_stackCornerRadius,
7816
7863
  barMaxWidth_barMaxWidth,
7817
7864
  barGapInGroup_barGapInGroup,
7818
7865
  colorBarStyleFill(barStyle_barStyle),
@@ -7827,6 +7874,7 @@
7827
7874
  labelSecondary,
7828
7875
  tooltipSecondary,
7829
7876
  progressive,
7877
+ stackCornerRadius_stackCornerRadius,
7830
7878
  barMaxWidth_barMaxWidth,
7831
7879
  barGapInGroup_barGapInGroup,
7832
7880
  colorBarStyleFill(barStyle_barStyle),
@@ -9263,91 +9311,1470 @@
9263
9311
  Builder._advancedPipelineMap.heatmap = heatmapAdvancedPipeline;
9264
9312
  Builder._specPipelineMap.heatmap = heatmapSpecPipeline;
9265
9313
  };
9266
- const getDarkCrosshairLine = ()=>({
9267
- visible: true,
9268
- labelVisible: true,
9269
- labelColor: '#ffffff',
9270
- labelBackgroundColor: '#404349',
9271
- lineColor: '#55595F'
9272
- });
9273
- const getDarkCrosshairRect = ()=>({
9274
- visible: true,
9275
- labelVisible: true,
9276
- labelColor: '#4B4F54',
9277
- labelBackgroundColor: '#ffffff',
9278
- rectColor: '#E2E3E6'
9279
- });
9280
- const getLightCrosshairLine = ()=>({
9281
- visible: true,
9282
- labelVisible: true,
9283
- labelColor: '#ffffff',
9284
- labelBackgroundColor: '#21252C',
9285
- lineColor: '#21252C'
9286
- });
9287
- const getLightCrosshairRect = ()=>({
9288
- visible: true,
9289
- labelVisible: true,
9290
- labelColor: '#ffffff',
9291
- labelBackgroundColor: '#364159',
9292
- rectColor: '#3641594d'
9293
- });
9294
- const getLightColorScheme = ()=>[
9295
- '#8D72F6',
9296
- '#5766EC',
9297
- '#66A3FE',
9298
- '#51D5E6',
9299
- '#4EC0B3',
9300
- '#F9DF90',
9301
- '#F9AD71',
9302
- '#ED8888',
9303
- '#E9A0C3',
9304
- '#D77DD3'
9305
- ];
9306
- const getDarkColorScheme = ()=>[
9307
- '#2E62F1',
9308
- '#4DC36A',
9309
- '#FF8406',
9310
- '#FFCC00',
9311
- '#4F44CF',
9312
- '#5AC8FA',
9313
- '#003A8C',
9314
- '#B08AE2',
9315
- '#FF6341',
9316
- '#98DD62'
9317
- ];
9318
- const getLightLinearColorScheme = ()=>[
9319
- '#C2CEFF',
9320
- '#5766EC'
9314
+ const boxplotConfig = (advancedVSeed, context)=>{
9315
+ const { vseed } = context;
9316
+ const { chartType } = vseed;
9317
+ const result = {
9318
+ ...advancedVSeed
9319
+ };
9320
+ const pickedConfig = chunk_2T7K3PFL_i(vseed, [
9321
+ 'backgroundColor',
9322
+ 'color',
9323
+ 'label',
9324
+ 'legend',
9325
+ 'tooltip',
9326
+ 'xAxis',
9327
+ 'yAxis',
9328
+ 'crosshairRect',
9329
+ 'whiskers'
9330
+ ]);
9331
+ const config = replaceNullToUndefined(pickedConfig);
9332
+ result.config = {
9333
+ ...result.config || {},
9334
+ [chartType]: {
9335
+ ...config
9336
+ }
9337
+ };
9338
+ return result;
9339
+ };
9340
+ const defaultEncodingForBoxplot = (advancedVSeed)=>{
9341
+ const { measures: vseedMeasures = [], dimensions = [] } = advancedVSeed;
9342
+ const measures = findAllMeasures(vseedMeasures);
9343
+ const encoding = {};
9344
+ boxplot_generateDefaultDimensionEncoding(dimensions, encoding);
9345
+ boxplot_generateDefaultMeasureEncoding(measures, encoding);
9346
+ return {
9347
+ ...advancedVSeed,
9348
+ encoding
9349
+ };
9350
+ };
9351
+ const encodingForBoxplot = (advancedVSeed)=>{
9352
+ const { measures: vseedMeasures = [], dimensions = [] } = advancedVSeed;
9353
+ const measures = findAllMeasures(vseedMeasures);
9354
+ const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
9355
+ const hasMeasureEncoding = measures.some((item)=>item.encoding);
9356
+ const encoding = {};
9357
+ if (hasDimensionEncoding) boxplot_generateDimensionEncoding(dimensions, encoding, measures.length > 1);
9358
+ else boxplot_generateDefaultDimensionEncoding(dimensions, encoding);
9359
+ if (hasMeasureEncoding) boxplot_generateMeasureEncoding(measures, encoding);
9360
+ else boxplot_generateDefaultMeasureEncoding(measures, encoding);
9361
+ if ((!encoding.value || encoding.value.length <= 1) && encoding.color && encoding.color.length > 1) encoding.color = encoding.color.filter((c)=>c !== MeasureName);
9362
+ return {
9363
+ ...advancedVSeed,
9364
+ encoding
9365
+ };
9366
+ };
9367
+ const boxplot_generateDefaultDimensionEncoding = (dimensions, encoding)=>{
9368
+ const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
9369
+ const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
9370
+ encoding.x = uniqueDimIds.slice(0, 1);
9371
+ encoding.color = uniqueDimIds.slice(onlyMeasureName ? 0 : 1);
9372
+ encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureName);
9373
+ encoding.label = [];
9374
+ encoding.row = [];
9375
+ encoding.column = [];
9376
+ };
9377
+ const boxplot_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
9378
+ encoding.x = chunk_QJLMYOTX_i(dimensions.filter((item)=>'xAxis' === item.encoding).map((item)=>item.id));
9379
+ if (0 === encoding.x.length) encoding.x = [
9380
+ dimensions[0].id
9321
9381
  ];
9322
- const getDarkLinearColorScheme = ()=>[
9323
- '#A0CEFF',
9324
- '#2E62F1'
9382
+ addColorToEncoding(dimensions, encoding, isMultiMeasure);
9383
+ encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
9384
+ encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
9385
+ encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
9386
+ encoding.label = encoding.label.filter((d)=>d !== MeasureName);
9387
+ };
9388
+ const boxplot_generateDefaultMeasureEncoding = (measures, encoding)=>{
9389
+ encoding.value = chunk_QJLMYOTX_i(measures.filter((item)=>'value' === item.encoding || !item.encoding).map((item)=>item.id));
9390
+ };
9391
+ const boxplot_generateMeasureEncoding = (measures, encoding)=>{
9392
+ encoding.value = chunk_QJLMYOTX_i(measures.filter((item)=>'value' === item.encoding || !item.encoding).map((item)=>item.id));
9393
+ encoding.q1 = chunk_QJLMYOTX_i(measures.filter((item)=>'q1' === item.encoding).map((item)=>item.id));
9394
+ encoding.median = chunk_QJLMYOTX_i(measures.filter((item)=>'median' === item.encoding).map((item)=>item.id));
9395
+ encoding.q3 = chunk_QJLMYOTX_i(measures.filter((item)=>'q3' === item.encoding).map((item)=>item.id));
9396
+ encoding.min = chunk_QJLMYOTX_i(measures.filter((item)=>'min' === item.encoding).map((item)=>item.id));
9397
+ encoding.max = chunk_QJLMYOTX_i(measures.filter((item)=>'max' === item.encoding).map((item)=>item.id));
9398
+ encoding.outliers = chunk_QJLMYOTX_i(measures.filter((item)=>'outliers' === item.encoding).map((item)=>item.id));
9399
+ const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
9400
+ if (color.length > 0) encoding.color = color;
9401
+ const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
9402
+ encoding.label = chunk_QJLMYOTX_i([
9403
+ ...encoding.label || [],
9404
+ ...label
9405
+ ]);
9406
+ const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
9407
+ encoding.tooltip = chunk_QJLMYOTX_i([
9408
+ ...encoding.tooltip || [],
9409
+ ...label,
9410
+ ...tooltip
9411
+ ]);
9412
+ };
9413
+ const isType_isType = (value, type)=>Object.prototype.toString.call(value) === `[object ${type}]`;
9414
+ const isType = isType_isType;
9415
+ const isArray = (value)=>Array.isArray ? Array.isArray(value) : isType(value, "Array");
9416
+ const common_isArray = isArray;
9417
+ const isNil = (value)=>null == value;
9418
+ const common_isNil = isNil;
9419
+ const clamp_clamp = function(input, min, max) {
9420
+ return input < min ? min : input > max ? max : input;
9421
+ };
9422
+ const clamp = clamp_clamp;
9423
+ function toNumber(a) {
9424
+ return Number(a);
9425
+ }
9426
+ function quantileSorted(values, percent, valueof = toNumber) {
9427
+ const n = values.length;
9428
+ if (!n) return;
9429
+ if (percent <= 0 || n < 2) return valueof(values[0], 0, values);
9430
+ if (percent >= 1) return valueof(values[n - 1], n - 1, values);
9431
+ const i = (n - 1) * percent, i0 = Math.floor(i), value0 = valueof(values[i0], i0, values);
9432
+ return value0 + (valueof(values[i0 + 1], i0 + 1, values) - value0) * (i - i0);
9433
+ }
9434
+ const boxplot_boxplot = (data, options)=>{
9435
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
9436
+ const field = null == options ? void 0 : options.field;
9437
+ if (!field) return [];
9438
+ const groupField = null == options ? void 0 : options.groupField;
9439
+ let whiskers = null != (_a = null == options ? void 0 : options.whiskers) ? _a : 1.5;
9440
+ const includeValues = !!(null == options ? void 0 : options.includeValues), names = null != (_b = null == options ? void 0 : options.outputNames) ? _b : {}, keyName = null != (_c = names.key) ? _c : common_isArray(groupField) ? null : null != (_d = groupField) ? _d : "key", countName = null != (_e = names.count) ? _e : "count", meanName = null != (_f = names.mean) ? _f : "mean", q1Name = null != (_g = names.q1) ? _g : "q1", medianName = null != (_h = names.median) ? _h : "median", q3Name = null != (_j = names.q3) ? _j : "q3", iqrName = null != (_k = names.iqr) ? _k : "iqr", minName = null != (_l = names.min) ? _l : "min", maxName = null != (_m = names.max) ? _m : "max", lowerWhiskerName = null != (_o = names.lowerWhisker) ? _o : "lowerWhisker", upperWhiskerName = null != (_p = names.upperWhisker) ? _p : "upperWhisker", outliersName = null != (_q = names.outliers) ? _q : "outliers", valuesName = null != (_r = names.values) ? _r : "values", groups = new Map, rawValues = new Map, keyToGroup = new Map, n = data.length;
9441
+ for(let i = 0; i < n; i++){
9442
+ const d = data[i], v = d[field];
9443
+ if (common_isNil(v)) continue;
9444
+ const num = +v;
9445
+ if (!Number.isFinite(num)) continue;
9446
+ let key;
9447
+ key = common_isArray(groupField) ? groupField.map((f)=>String(d[f])).join("||") : groupField ? String(d[groupField]) : "___all", groups.has(key) || (groups.set(key, []), includeValues && rawValues.set(key, []), common_isArray(groupField) ? keyToGroup.set(key, Object.fromEntries(groupField.map((f)=>[
9448
+ f,
9449
+ d[f]
9450
+ ]))) : keyToGroup.set(key, groupField ? d[groupField] : null));
9451
+ const arr = groups.get(key);
9452
+ if (arr && arr.push(num), includeValues) {
9453
+ const rv = rawValues.get(key);
9454
+ rv && rv.push(d);
9455
+ }
9456
+ }
9457
+ if (common_isArray(whiskers)) whiskers = [
9458
+ clamp(Math.min.apply(null, whiskers), 0, 1),
9459
+ clamp(Math.max.apply(null, whiskers), 0, 1)
9325
9460
  ];
9326
- const getLightColor = ()=>({
9327
- linearColorScheme: getLightLinearColorScheme(),
9328
- colorScheme: getLightColorScheme()
9329
- });
9330
- const getDarkColor = ()=>({
9331
- linearColorScheme: getDarkLinearColorScheme(),
9332
- colorScheme: getDarkColorScheme()
9333
- });
9334
- const getDefaultLabel = ()=>({
9335
- enable: true,
9336
- wrap: true,
9337
- showValue: true,
9338
- showValuePercent: false,
9339
- labelColorSmartInvert: false,
9340
- labelOverlap: true
9341
- });
9342
- const getDarkLabel = ()=>({
9343
- ...getDefaultLabel(),
9344
- labelStroke: '#21252C'
9461
+ const out = [];
9462
+ for (const [key, vals] of groups){
9463
+ if (!vals || 0 === vals.length) continue;
9464
+ const sorted = vals.slice().sort((a, b)=>a - b), count = sorted.length, dataMin = sorted[0], dataMax = sorted[sorted.length - 1];
9465
+ let sum = 0;
9466
+ for(let i = 0; i < sorted.length; i++)sum += sorted[i];
9467
+ const mean = sum / count, q1 = quantileSorted(sorted, .25), median = quantileSorted(sorted, .5), q3 = quantileSorted(sorted, .75), iqr = q3 - q1, lowerBound = common_isArray(whiskers) ? quantileSorted(sorted, whiskers[0]) : q1 - whiskers * iqr, upperBound = common_isArray(whiskers) ? quantileSorted(sorted, whiskers[1]) : q3 + whiskers * iqr;
9468
+ let lowerWhisker = dataMin;
9469
+ for(let i = 0; i < sorted.length; i++)if (sorted[i] >= lowerBound) {
9470
+ lowerWhisker = sorted[i];
9471
+ break;
9472
+ }
9473
+ let upperWhisker = dataMax;
9474
+ for(let i = sorted.length - 1; i >= 0; i--)if (sorted[i] <= upperBound) {
9475
+ upperWhisker = sorted[i];
9476
+ break;
9477
+ }
9478
+ const outliers = [];
9479
+ for(let i = 0; i < sorted.length; i++)(sorted[i] < lowerWhisker || sorted[i] > upperWhisker) && outliers.push(sorted[i]);
9480
+ const obj = {}, representative = keyToGroup.get(key);
9481
+ if (null !== keyName) obj[keyName] = representative;
9482
+ else if (common_isArray(groupField)) {
9483
+ const groupObj = representative || {};
9484
+ for (const f of groupField)obj[f] = groupObj[f];
9485
+ }
9486
+ obj[countName] = count, obj[meanName] = mean, obj[q1Name] = q1, obj[medianName] = median, obj[q3Name] = q3, obj[iqrName] = iqr, obj[minName] = dataMin, obj[maxName] = dataMax, obj[lowerWhiskerName] = lowerWhisker, obj[upperWhiskerName] = upperWhisker, obj[outliersName] = outliers, includeValues && (obj[valuesName] = rawValues.get(key) || []), out.push(obj);
9487
+ }
9488
+ return out;
9489
+ };
9490
+ const reshapeWithBoxplotEncoding = (advancedVSeed, context)=>{
9491
+ const result = {
9492
+ ...advancedVSeed
9493
+ };
9494
+ const { vseed } = context;
9495
+ const { dataset, chartType } = vseed;
9496
+ const { dimensions = [], measures = [], encoding = {}, config } = advancedVSeed;
9497
+ const uniqDims = T(dimensions, (item)=>item.id);
9498
+ const whiskers = config?.[chartType]?.whiskers;
9499
+ let newDatasets = [];
9500
+ let foldInfo = {};
9501
+ let unfoldInfo = {};
9502
+ const allMeasures = findAllMeasures(measures);
9503
+ if (encoding.value?.length) encoding.value.forEach((f)=>{
9504
+ const m = allMeasures.find((m)=>m.id === f);
9505
+ const boxPlotData = boxplot_boxplot(dataset, {
9506
+ field: f,
9507
+ groupField: [
9508
+ ...encoding.x ?? [],
9509
+ ...encoding.color ?? []
9510
+ ],
9511
+ whiskers,
9512
+ outputNames: {
9513
+ q1: "__Q1__",
9514
+ q3: "__Q3__",
9515
+ min: MinMeasureId,
9516
+ max: MaxMeasureId,
9517
+ median: MedianMeasureId,
9518
+ outliers: OutliersMeasureId
9519
+ }
9520
+ });
9521
+ boxPlotData.forEach((datum)=>{
9522
+ datum[FoldMeasureId] = f;
9523
+ datum[FoldMeasureName] = m?.alias ?? f;
9524
+ });
9525
+ const res = unfoldDimensions(boxPlotData, uniqDims, encoding, {
9526
+ foldMeasureId: FoldMeasureId,
9527
+ separator: "-",
9528
+ colorItemAsId: false
9529
+ });
9530
+ res.dataset.forEach((d)=>{
9531
+ newDatasets.push(d);
9532
+ });
9533
+ unfoldInfo = res.unfoldInfo;
9345
9534
  });
9346
- const getLightLabel = ()=>({
9347
- ...getDefaultLabel(),
9348
- labelStroke: '#fff'
9535
+ else if (encoding.q1?.length && encoding.q3?.length && encoding.min?.length && encoding.max?.length && encoding.median?.length) {
9536
+ const res = unfoldDimensions(dataset, uniqDims, encoding, {
9537
+ foldMeasureId: FoldMeasureId,
9538
+ separator: "-",
9539
+ colorItemAsId: false
9540
+ });
9541
+ res.dataset.forEach((datum)=>{
9542
+ datum[MaxMeasureId] = datum[encoding.max[0]];
9543
+ datum[MinMeasureId] = datum[encoding.min[0]];
9544
+ datum["__Q1__"] = datum[encoding.q1[0]];
9545
+ datum["__Q3__"] = datum[encoding.q3[0]];
9546
+ datum[MedianMeasureId] = datum[encoding.median[0]];
9547
+ });
9548
+ newDatasets = res.dataset;
9549
+ foldInfo = {};
9550
+ unfoldInfo = res.unfoldInfo;
9551
+ }
9552
+ return {
9553
+ ...result,
9554
+ dataset: newDatasets,
9555
+ datasetReshapeInfo: [
9556
+ {
9557
+ id: String(chartType),
9558
+ index: 0,
9559
+ foldInfo,
9560
+ unfoldInfo
9561
+ }
9562
+ ],
9563
+ dimensions,
9564
+ measures
9565
+ };
9566
+ };
9567
+ const pivotReshapeWithBoxplotEncoding = (advancedVSeed, context)=>{
9568
+ const result = {
9569
+ ...advancedVSeed
9570
+ };
9571
+ const { vseed } = context;
9572
+ const { dataset, chartType } = vseed;
9573
+ const { dimensions = [], measures = [], encoding = {}, config } = advancedVSeed;
9574
+ const uniqDims = T(dimensions, (item)=>item.id);
9575
+ const chartConfig = config?.[chartType];
9576
+ const whiskers = chartConfig?.whiskers;
9577
+ const measureGroups = [];
9578
+ if (measures) measures.forEach((measure)=>{
9579
+ if (measure.children && measure.children.length > 0) measureGroups.push(measure);
9349
9580
  });
9350
- const getDefaultLegend = ()=>({
9581
+ const rowColumnFields = T(dimensions.filter((dim)=>'row' === dim.encoding || 'column' === dim.encoding), (item)=>item.id);
9582
+ const datasets = [];
9583
+ const datasetReshapeInfo = [];
9584
+ measureGroups.forEach((measureGroup, index)=>{
9585
+ const subMeasures = measureGroup.children;
9586
+ if (!subMeasures) return;
9587
+ const groupId = measureGroup.id;
9588
+ let newDatasets = [];
9589
+ let foldInfo = {};
9590
+ let unfoldInfo = {};
9591
+ if (encoding.value?.length) encoding.value.forEach((f)=>{
9592
+ const m = subMeasures.find((m)=>m.id === f);
9593
+ const boxPlotData = boxplot_boxplot(dataset, {
9594
+ field: f,
9595
+ groupField: [
9596
+ ...encoding.x ?? [],
9597
+ ...encoding.color ?? [],
9598
+ ...rowColumnFields.map((item)=>item.id)
9599
+ ],
9600
+ whiskers,
9601
+ outputNames: {
9602
+ q1: "__Q1__",
9603
+ q3: "__Q3__",
9604
+ min: MinMeasureId,
9605
+ max: MaxMeasureId,
9606
+ median: MedianMeasureId,
9607
+ outliers: OutliersMeasureId
9608
+ }
9609
+ });
9610
+ boxPlotData.forEach((datum)=>{
9611
+ datum[FoldMeasureId] = f;
9612
+ datum[FoldMeasureName] = m?.alias ?? f;
9613
+ });
9614
+ const res = unfoldDimensions(boxPlotData, uniqDims, encoding, {
9615
+ foldMeasureId: FoldMeasureId,
9616
+ separator: "-",
9617
+ colorItemAsId: false
9618
+ });
9619
+ res.dataset.forEach((d)=>{
9620
+ newDatasets.push(d);
9621
+ });
9622
+ unfoldInfo = res.unfoldInfo;
9623
+ });
9624
+ else if (encoding.q1?.length && encoding.q3?.length && encoding.min?.length && encoding.max?.length && encoding.median?.length) {
9625
+ const res = unfoldDimensions(dataset, uniqDims, encoding, {
9626
+ foldMeasureId: FoldMeasureId,
9627
+ separator: "-",
9628
+ colorItemAsId: false
9629
+ });
9630
+ res.dataset.forEach((datum)=>{
9631
+ datum[MaxMeasureId] = datum[encoding.max[0]];
9632
+ datum[MinMeasureId] = datum[encoding.min[0]];
9633
+ datum["__Q1__"] = datum[encoding.q1[0]];
9634
+ datum["__Q3__"] = datum[encoding.q3[0]];
9635
+ datum[MedianMeasureId] = datum[encoding.median[0]];
9636
+ });
9637
+ newDatasets = res.dataset;
9638
+ foldInfo = {};
9639
+ unfoldInfo = res.unfoldInfo;
9640
+ }
9641
+ const reshapeInfo = {
9642
+ id: groupId,
9643
+ index,
9644
+ foldInfo,
9645
+ unfoldInfo
9646
+ };
9647
+ datasets.push(newDatasets);
9648
+ datasetReshapeInfo.push(reshapeInfo);
9649
+ });
9650
+ console.log(datasets);
9651
+ return {
9652
+ ...result,
9653
+ dataset: datasets,
9654
+ datasetReshapeInfo: datasetReshapeInfo
9655
+ };
9656
+ };
9657
+ const boxplotAdvancedPipeline = [
9658
+ initAdvancedVSeed_initAdvancedVSeed,
9659
+ default_defaultMeasures_defaultMeasures,
9660
+ defaultDimensions_defaultDimensions,
9661
+ defaultMeasureName_defaultMeasureName,
9662
+ boxplotConfig,
9663
+ encodingAdapter([
9664
+ defaultEncodingForBoxplot,
9665
+ buildMeasures
9666
+ ], [
9667
+ encodingForBoxplot,
9668
+ buildMeasures,
9669
+ deleteEncodingForMeasure([
9670
+ 'tooltip',
9671
+ 'label',
9672
+ 'color'
9673
+ ]),
9674
+ deleteTooltipAndLabelDimension
9675
+ ]),
9676
+ pivotAdapter([
9677
+ reshapeWithBoxplotEncoding
9678
+ ], [
9679
+ pivotReshapeWithBoxplotEncoding
9680
+ ]),
9681
+ sortLegend_sortLegend,
9682
+ theme_theme,
9683
+ markStyle_markStyle,
9684
+ annotation_annotation
9685
+ ];
9686
+ const initBoxplot = (spec, context)=>{
9687
+ const result = {
9688
+ ...spec
9689
+ };
9690
+ const { advancedVSeed } = context;
9691
+ const { datasetReshapeInfo, encoding } = advancedVSeed;
9692
+ const { unfoldInfo } = datasetReshapeInfo[0];
9693
+ result.type = 'boxPlot';
9694
+ result.minField = MinMeasureId;
9695
+ result.q1Field = "__Q1__";
9696
+ result.medianField = MedianMeasureId;
9697
+ result.maxField = MaxMeasureId;
9698
+ result.q3Field = "__Q3__";
9699
+ result.outliersField = OutliersMeasureId;
9700
+ result.xField = [
9701
+ unfoldInfo.encodingX
9702
+ ];
9703
+ result.seriesField = unfoldInfo.encodingColorId;
9704
+ const sameDimensionsMode = chunk_HGKLN5KY_k(encoding.x, encoding.color);
9705
+ if (!sameDimensionsMode) {
9706
+ result.xField.push(unfoldInfo.encodingColor);
9707
+ if (encoding.color?.[0] === MeasureName && encoding.value?.length === 1) result.xField.pop();
9708
+ }
9709
+ result.padding = 0;
9710
+ result.region = [
9711
+ {
9712
+ clip: true
9713
+ }
9714
+ ];
9715
+ result.animation = true;
9716
+ return result;
9717
+ };
9718
+ const datasetBoxplot = (spec, context)=>{
9719
+ const { advancedVSeed, vseed } = context;
9720
+ const { datasetReshapeInfo } = advancedVSeed;
9721
+ const { id } = datasetReshapeInfo[0];
9722
+ const fields = {};
9723
+ return {
9724
+ ...spec,
9725
+ data: {
9726
+ id,
9727
+ values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset.flat(),
9728
+ fields: fields
9729
+ }
9730
+ };
9731
+ };
9732
+ const boxPlotMeasureKeys = [
9733
+ MaxMeasureId,
9734
+ "__Q3__",
9735
+ MedianMeasureId,
9736
+ "__Q1__",
9737
+ MinMeasureId
9738
+ ];
9739
+ const VCHART_OUTLIER_KEY = '__VCHART_BOX_PLOT_OUTLIER_VALUE';
9740
+ const tooltipBoxplot = (spec, context)=>{
9741
+ const result = {
9742
+ ...spec
9743
+ };
9744
+ const { advancedVSeed, vseed } = context;
9745
+ const { chartType, dimensions, encoding } = advancedVSeed;
9746
+ const baseConfig = advancedVSeed.config[chartType];
9747
+ const { tooltip = {
9748
+ enable: true
9749
+ } } = baseConfig;
9750
+ const { enable } = tooltip;
9751
+ const meas = findAllMeasures(vseed.measures);
9752
+ const valueMeasure = meas.find((item)=>'value' === item.encoding || chunk_JK3VNB42_n(item.encoding));
9753
+ const defaultFormatter = valueMeasure ? createFormatterByMeasure(valueMeasure) : (v)=>v;
9754
+ result.tooltip = {
9755
+ visible: enable,
9756
+ mark: {
9757
+ title: {
9758
+ visible: false
9759
+ },
9760
+ content: tooltipBoxplot_createMarkContent(encoding.tooltip || [], dimensions, encoding),
9761
+ updateContent: (prev, data)=>{
9762
+ const datum = data?.[0]?.datum?.[0];
9763
+ if (!chunk_JK3VNB42_n(datum?.[VCHART_OUTLIER_KEY])) {
9764
+ const tooltipItems = (prev ?? []).filter((item)=>!boxPlotMeasureKeys.includes(item.key));
9765
+ const outerlierMeasure = meas.find((item)=>item.id === OutliersMeasureId);
9766
+ const formatter = outerlierMeasure ? createFormatterByMeasure(outerlierMeasure) : defaultFormatter;
9767
+ tooltipItems.push({
9768
+ ...tooltipItems[0],
9769
+ key: outerlierMeasure?.alias ?? OutliersMeasureId,
9770
+ value: formatter(datum?.[VCHART_OUTLIER_KEY])
9771
+ });
9772
+ return tooltipItems;
9773
+ }
9774
+ return (prev ?? []).map((entry)=>{
9775
+ if (boxPlotMeasureKeys.includes(entry.key)) {
9776
+ const mea = meas.find((item)=>item.id === entry.key);
9777
+ const formatter = mea ? createFormatterByMeasure(mea) : defaultFormatter;
9778
+ return {
9779
+ ...entry,
9780
+ value: formatter(datum?.[entry.key]),
9781
+ key: mea?.alias ?? entry.key
9782
+ };
9783
+ }
9784
+ return entry;
9785
+ });
9786
+ }
9787
+ },
9788
+ dimension: {
9789
+ visible: false
9790
+ }
9791
+ };
9792
+ return result;
9793
+ };
9794
+ const tooltipBoxplot_createMarkContent = (tooltip, dimensions, encoding)=>{
9795
+ const dims = C(dimensions.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias));
9796
+ const dimContent = dims.map((item)=>({
9797
+ visible: true,
9798
+ hasShape: true,
9799
+ shapeType: 'rectRound',
9800
+ key: item.alias ?? item.id,
9801
+ value: (datum)=>{
9802
+ if (!chunk_JK3VNB42_n(datum?.[VCHART_OUTLIER_KEY])) {
9803
+ if (encoding.color?.includes(item.id)) return datum?.[ColorEncoding];
9804
+ if (encoding.x?.includes(item.id)) return datum?.[XEncoding];
9805
+ }
9806
+ return datum?.[item.id];
9807
+ }
9808
+ }));
9809
+ const defaultContent = boxPlotMeasureKeys.map((key)=>({
9810
+ visible: true,
9811
+ hasShape: true,
9812
+ shapeType: 'rectRound',
9813
+ key,
9814
+ value: (datum)=>{
9815
+ if (!datum) return '';
9816
+ return datum[key];
9817
+ }
9818
+ }));
9819
+ return [
9820
+ ...dimContent,
9821
+ defaultContent
9822
+ ];
9823
+ };
9824
+ const pipeline_boxplot_boxplot = [
9825
+ initBoxplot,
9826
+ stackCornerRadius_stackCornerRadius,
9827
+ colorAdapter(color_color, linearColor),
9828
+ background_backgroundColor,
9829
+ datasetBoxplot,
9830
+ progressive,
9831
+ xBand,
9832
+ yLinear,
9833
+ label_label,
9834
+ tooltipBoxplot,
9835
+ colorAdapter(discreteLegend, colorLegend),
9836
+ verticalCrosshairRect,
9837
+ colorBarStyleFill(barStyle_barStyle),
9838
+ annotationPoint_annotationPoint,
9839
+ annotationVerticalLine_annotationVerticalLine,
9840
+ annotationHorizontalLine_annotationHorizontalLine,
9841
+ annotationAreaBand
9842
+ ];
9843
+ const pivotBoxplot = [
9844
+ initPivot,
9845
+ pivotGridStyle,
9846
+ datasetPivot,
9847
+ pivotIndicators_pivotIndicators([
9848
+ initBoxplot,
9849
+ stackCornerRadius_stackCornerRadius,
9850
+ colorAdapter(color_color, linearColor),
9851
+ background_backgroundColor,
9852
+ datasetBoxplot,
9853
+ progressive,
9854
+ xBand,
9855
+ yLinear,
9856
+ label_label,
9857
+ tooltipBoxplot,
9858
+ colorBarStyleFill(barStyle_barStyle),
9859
+ verticalCrosshairRect,
9860
+ annotationPoint_annotationPoint,
9861
+ annotationVerticalLine_annotationVerticalLine,
9862
+ annotationHorizontalLine_annotationHorizontalLine,
9863
+ annotationAreaBand
9864
+ ]),
9865
+ pivotRowDimensions,
9866
+ pivotColumnDimensions,
9867
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
9868
+ ];
9869
+ const boxplotSpecPipeline = [
9870
+ pivotAdapter_pivotAdapter(pipeline_boxplot_boxplot, pivotBoxplot)
9871
+ ];
9872
+ const registerBoxplot = ()=>{
9873
+ Builder._advancedPipelineMap.boxPlot = boxplotAdvancedPipeline;
9874
+ Builder._specPipelineMap.boxPlot = boxplotSpecPipeline;
9875
+ };
9876
+ const histogramConfig = (advancedVSeed, context)=>{
9877
+ const { vseed } = context;
9878
+ const { chartType } = vseed;
9879
+ const result = {
9880
+ ...advancedVSeed
9881
+ };
9882
+ const pickedConfig = chunk_2T7K3PFL_i(vseed, [
9883
+ 'backgroundColor',
9884
+ 'color',
9885
+ 'label',
9886
+ 'legend',
9887
+ 'tooltip',
9888
+ 'xAxis',
9889
+ 'yAxis',
9890
+ 'crosshairRect',
9891
+ 'binCount',
9892
+ 'binStep',
9893
+ 'binValueType'
9894
+ ]);
9895
+ const config = replaceNullToUndefined(pickedConfig);
9896
+ result.config = {
9897
+ ...result.config || {},
9898
+ [chartType]: {
9899
+ ...config
9900
+ }
9901
+ };
9902
+ return result;
9903
+ };
9904
+ const defaultEncodingForHistogram = (advancedVSeed)=>{
9905
+ const { measures: vseedMeasures = [], dimensions = [] } = advancedVSeed;
9906
+ const measures = findAllMeasures(vseedMeasures);
9907
+ const encoding = {};
9908
+ histogram_generateDefaultDimensionEncoding(dimensions, encoding);
9909
+ histogram_generateDefaultMeasureEncoding(measures, encoding);
9910
+ return {
9911
+ ...advancedVSeed,
9912
+ encoding
9913
+ };
9914
+ };
9915
+ const encodingForHistogram = (advancedVSeed)=>{
9916
+ const { measures: vseedMeasures = [], dimensions = [] } = advancedVSeed;
9917
+ const measures = findAllMeasures(vseedMeasures);
9918
+ const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
9919
+ const hasMeasureEncoding = measures.some((item)=>item.encoding);
9920
+ const encoding = {};
9921
+ if (hasDimensionEncoding) histogram_generateDimensionEncoding(dimensions, encoding, false);
9922
+ else histogram_generateDefaultDimensionEncoding(dimensions, encoding);
9923
+ if (hasMeasureEncoding) histogram_generateMeasureEncoding(measures, encoding);
9924
+ else histogram_generateDefaultMeasureEncoding(measures, encoding);
9925
+ return {
9926
+ ...advancedVSeed,
9927
+ encoding
9928
+ };
9929
+ };
9930
+ const histogram_generateDefaultDimensionEncoding = (dimensions, encoding)=>{
9931
+ const dimensionsWithoutMeasureName = dimensions.filter((item)=>item.id !== MeasureName);
9932
+ const uniqueDimIds = chunk_QJLMYOTX_i(dimensionsWithoutMeasureName.map((d)=>d.id));
9933
+ encoding.detail = encoding.color;
9934
+ encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureName);
9935
+ encoding.label = [];
9936
+ encoding.row = [];
9937
+ encoding.column = [];
9938
+ };
9939
+ const histogram_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
9940
+ addColorToEncoding(dimensions, encoding, isMultiMeasure);
9941
+ encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
9942
+ if (encoding.detail?.length === 0) encoding.detail = encoding.color;
9943
+ encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
9944
+ encoding.tooltip = encoding.tooltip?.filter((d)=>d !== MeasureName);
9945
+ encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
9946
+ encoding.label = encoding.label?.filter((d)=>d !== MeasureName);
9947
+ };
9948
+ const histogram_generateDefaultMeasureEncoding = (measures, encoding)=>{
9949
+ encoding.value = chunk_QJLMYOTX_i(measures.filter((item)=>'value' === item.encoding || !item.encoding).map((item)=>item.id));
9950
+ encoding.x0 = chunk_QJLMYOTX_i(measures.filter((item)=>'x0' === item.encoding).map((item)=>item.id));
9951
+ encoding.x1 = chunk_QJLMYOTX_i(measures.filter((item)=>'x1' === item.encoding).map((item)=>item.id));
9952
+ encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding).map((item)=>item.id));
9953
+ };
9954
+ const histogram_generateMeasureEncoding = (measures, encoding)=>{
9955
+ encoding.value = chunk_QJLMYOTX_i(measures.filter((item)=>'value' === item.encoding || !item.encoding).map((item)=>item.id));
9956
+ encoding.x0 = chunk_QJLMYOTX_i(measures.filter((item)=>'x0' === item.encoding).map((item)=>item.id));
9957
+ encoding.x1 = chunk_QJLMYOTX_i(measures.filter((item)=>'x1' === item.encoding).map((item)=>item.id));
9958
+ encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding).map((item)=>item.id));
9959
+ const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
9960
+ if (color.length > 0) encoding.color = [
9961
+ color[0]
9962
+ ];
9963
+ const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
9964
+ encoding.label = chunk_QJLMYOTX_i([
9965
+ ...encoding.label || [],
9966
+ ...label
9967
+ ]);
9968
+ const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
9969
+ encoding.tooltip = chunk_QJLMYOTX_i([
9970
+ ...encoding.tooltip || [],
9971
+ ...label,
9972
+ ...tooltip
9973
+ ]);
9974
+ };
9975
+ const bin_bin = (data, options)=>{
9976
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
9977
+ const field = null == options ? void 0 : options.field;
9978
+ if (!field) return [];
9979
+ const countField = options.countField, n = data.length;
9980
+ let thresholds, min = 1 / 0, max = -1 / 0;
9981
+ if (options.extent) min = options.extent[0], max = options.extent[1];
9982
+ else for(let i = 0; i < n; i++){
9983
+ const v = data[i][field];
9984
+ if (common_isNil(v)) continue;
9985
+ const num = +v;
9986
+ Number.isFinite(num) && (num < min && (min = num), num > max && (max = num));
9987
+ }
9988
+ if (!Number.isFinite(min) || !Number.isFinite(max) || 0 === n) return [];
9989
+ if (options.thresholds && options.thresholds.length) thresholds = options.thresholds.slice(), thresholds.sort((a, b)=>a - b);
9990
+ else if ("number" == typeof options.step && options.step > 0) {
9991
+ const stepSize = options.step;
9992
+ let startMin = min;
9993
+ for(options.extent || (startMin = Math.floor(min / stepSize) * stepSize), thresholds = [
9994
+ startMin
9995
+ ]; startMin < max;)startMin += stepSize, thresholds.push(startMin);
9996
+ } else {
9997
+ const bins = options.bins && options.bins > 0 ? Math.floor(options.bins) : 10;
9998
+ if (max - min > 1) {
9999
+ const start = Math.floor(min), stepSizeInt = Math.ceil((max - start) / bins);
10000
+ thresholds = new Array(bins + 1);
10001
+ for(let i = 0; i <= bins; i++)thresholds[i] = i === bins ? max : start + stepSizeInt * i;
10002
+ } else {
10003
+ const stepSize = (max - min) / bins;
10004
+ thresholds = new Array(bins + 1);
10005
+ for(let i = 0; i <= bins; i++)thresholds[i] = i === bins ? max : min + stepSize * i;
10006
+ }
10007
+ }
10008
+ const numBins = Math.max(0, thresholds.length - 1);
10009
+ if (0 === numBins) return [];
10010
+ const x0Name = null != (_b = null == (_a = options.outputNames) ? void 0 : _a.x0) ? _b : "x0", x1Name = null != (_d = null == (_c = options.outputNames) ? void 0 : _c.x1) ? _d : "x1", countName = null != (_f = null == (_e = options.outputNames) ? void 0 : _e.count) ? _f : "count", valuesName = null != (_h = null == (_g = options.outputNames) ? void 0 : _g.values) ? _h : "values", percentageName = null != (_k = null == (_j = options.outputNames) ? void 0 : _j.percentage) ? _k : "percentage", out = [];
10011
+ if (!options.groupField) for(let i = 0; i < numBins; i++){
10012
+ const rec = {
10013
+ [x0Name]: thresholds[i],
10014
+ [x1Name]: thresholds[i + 1],
10015
+ [countName]: 0
10016
+ };
10017
+ options.includeValues && (rec[valuesName] = []), out.push(rec);
10018
+ }
10019
+ const groupField = options.groupField, usingGroup = !!groupField, binGroupCounts = usingGroup ? new Array(numBins).fill(0).map(()=>new Map) : [], binGroupValues = usingGroup ? new Array(numBins).fill(0).map(()=>new Map) : [], binGroupRepr = usingGroup ? new Array(numBins).fill(0).map(()=>new Map) : [];
10020
+ for(let i = 0; i < n; i++){
10021
+ const v = data[i][field];
10022
+ if (null == v) continue;
10023
+ const num = +v;
10024
+ if (Number.isFinite(num)) for(let j = 0; j < numBins; j++){
10025
+ const left = thresholds[j], right = thresholds[j + 1];
10026
+ if (num >= left && num < right || j === numBins - 1 && num <= right) {
10027
+ const datumCount = null != (_l = data[i][countField]) ? _l : 1;
10028
+ if (usingGroup) {
10029
+ let gk;
10030
+ gk = common_isArray(groupField) ? groupField.map((f)=>String(data[i][f])).join("||") : String(data[i][groupField]);
10031
+ const m = binGroupCounts[j], prev = null != (_m = m.get(gk)) ? _m : 0;
10032
+ m.set(gk, prev + datumCount);
10033
+ const repMap = binGroupRepr[j];
10034
+ if (repMap.has(gk) || (common_isArray(groupField) ? repMap.set(gk, Object.fromEntries(groupField.map((f)=>[
10035
+ f,
10036
+ data[i][f]
10037
+ ]))) : repMap.set(gk, data[i][groupField])), options && options.includeValues) {
10038
+ const vv = binGroupValues[j];
10039
+ vv.has(gk) || vv.set(gk, []);
10040
+ const arr = vv.get(gk);
10041
+ arr && arr.push(data[i]);
10042
+ }
10043
+ } else out[j][countName] += datumCount;
10044
+ options && options.includeValues && !usingGroup && out[j][valuesName].push(data[i]);
10045
+ break;
10046
+ }
10047
+ }
10048
+ }
10049
+ let totalCount = 0;
10050
+ const finalOut = [];
10051
+ if (usingGroup) {
10052
+ for(let j = 0; j < numBins; j++){
10053
+ const m = binGroupCounts[j];
10054
+ for (const [gk, sum] of m){
10055
+ totalCount += sum;
10056
+ const rec = {
10057
+ [x0Name]: thresholds[j],
10058
+ [x1Name]: thresholds[j + 1],
10059
+ [countName]: sum
10060
+ }, repr = binGroupRepr[j].get(gk);
10061
+ if (common_isArray(groupField)) for (const f of groupField)rec[f] = repr[f];
10062
+ else rec[groupField] = repr;
10063
+ options && options.includeValues && (rec[valuesName] = binGroupValues[j].get(gk) || []), finalOut.push(rec);
10064
+ }
10065
+ }
10066
+ for (const r of finalOut)r[percentageName] = totalCount > 0 ? r[countName] / totalCount : 0;
10067
+ } else {
10068
+ for(let i = 0, len = out.length; i < len; i++)totalCount += out[i][countName];
10069
+ for(let i = 0, len = out.length; i < len; i++)out[i][percentageName] = totalCount > 0 ? out[i][countName] / totalCount : 0, finalOut.push(out[i]);
10070
+ }
10071
+ return finalOut;
10072
+ };
10073
+ const reshapeWithHistogramEncoding = (advancedVSeed, context)=>{
10074
+ const result = {
10075
+ ...advancedVSeed
10076
+ };
10077
+ const { vseed } = context;
10078
+ const { dataset, chartType } = vseed;
10079
+ const { dimensions = [], measures = [], encoding = {}, config } = advancedVSeed;
10080
+ const uniqDims = T(dimensions, (item)=>item.id);
10081
+ const chartConfig = config?.[chartType];
10082
+ const binCount = chartConfig?.binCount;
10083
+ const binStep = chartConfig?.binStep;
10084
+ const binValueType = chartConfig?.binValueType;
10085
+ let newDatasets = [];
10086
+ let foldInfo = {};
10087
+ let unfoldInfo = {};
10088
+ const colorMeasureId = getColorMeasureId(advancedVSeed, vseed);
10089
+ const allMeasures = findAllMeasures(measures);
10090
+ if (encoding.value?.length) {
10091
+ const valueField = encoding.value[0];
10092
+ const m = allMeasures.find((m)=>m.id === valueField);
10093
+ const binData = bin_bin(dataset, {
10094
+ field: valueField,
10095
+ groupField: [
10096
+ ...encoding.x ?? [],
10097
+ ...encoding.color ?? []
10098
+ ],
10099
+ bins: binCount,
10100
+ step: binStep,
10101
+ outputNames: {
10102
+ x0: BinStartMeasureId,
10103
+ x1: BinEndMeasureId,
10104
+ count: BinCountMeasureId,
10105
+ percentage: BinPercentageMeasureId
10106
+ }
10107
+ });
10108
+ binData.forEach((datum)=>{
10109
+ datum[FoldMeasureId] = valueField;
10110
+ datum[FoldMeasureName] = m?.alias ?? valueField;
10111
+ datum[FoldMeasureValue] = 'percentage' === binValueType ? datum[BinPercentageMeasureId] : datum[BinCountMeasureId];
10112
+ });
10113
+ const res = unfoldDimensions(binData, uniqDims, encoding, {
10114
+ foldMeasureId: FoldMeasureId,
10115
+ separator: "-",
10116
+ colorItemAsId: false
10117
+ });
10118
+ res.dataset.forEach((d)=>{
10119
+ newDatasets.push(d);
10120
+ });
10121
+ unfoldInfo = res.unfoldInfo;
10122
+ } else if (encoding.x0?.length && encoding.x1?.length && encoding.y?.length) {
10123
+ const res = dataReshapeByEncoding(dataset, T(dimensions, (item)=>item.id), findAllMeasures(measures).filter((item)=>encoding.y?.includes(item.id)).slice(0, 1), encoding, {
10124
+ colorItemAsId: false,
10125
+ colorMeasureId
10126
+ });
10127
+ res.dataset.forEach((datum)=>{
10128
+ datum[BinStartMeasureId] = datum[encoding.x0[0]];
10129
+ datum[BinEndMeasureId] = datum[encoding.x1[0]];
10130
+ datum[FoldMeasureId] = datum[encoding.y[0]];
10131
+ });
10132
+ newDatasets = res.dataset;
10133
+ foldInfo = res.foldInfo;
10134
+ unfoldInfo = res.unfoldInfo;
10135
+ }
10136
+ return {
10137
+ ...result,
10138
+ dataset: newDatasets,
10139
+ datasetReshapeInfo: [
10140
+ {
10141
+ id: String(chartType),
10142
+ index: 0,
10143
+ foldInfo,
10144
+ unfoldInfo
10145
+ }
10146
+ ],
10147
+ dimensions,
10148
+ measures
10149
+ };
10150
+ };
10151
+ const pivotReshapeWithHistogramEncoding = (advancedVSeed, context)=>{
10152
+ const result = {
10153
+ ...advancedVSeed
10154
+ };
10155
+ const { vseed } = context;
10156
+ const { dataset, chartType } = vseed;
10157
+ const { dimensions = [], measures = [], encoding = {}, config } = advancedVSeed;
10158
+ const colorMeasureId = getColorMeasureId(advancedVSeed, vseed);
10159
+ const uniqDims = T(dimensions, (item)=>item.id);
10160
+ const chartConfig = config?.[chartType];
10161
+ const binCount = chartConfig?.binCount;
10162
+ const binStep = chartConfig?.binStep;
10163
+ const binValueType = chartConfig?.binValueType;
10164
+ const measureGroups = [];
10165
+ if (measures) measures.forEach((measure)=>{
10166
+ if (measure.children && measure.children.length > 0) measureGroups.push(measure);
10167
+ });
10168
+ const rowColumnFields = T(dimensions.filter((dim)=>'row' === dim.encoding || 'column' === dim.encoding), (item)=>item.id);
10169
+ const datasets = [];
10170
+ const datasetReshapeInfo = [];
10171
+ measureGroups.forEach((measureGroup, index)=>{
10172
+ const subMeasures = measureGroup.children;
10173
+ if (!subMeasures) return;
10174
+ const groupId = measureGroup.id;
10175
+ let newDatasets = [];
10176
+ let foldInfo = {};
10177
+ let unfoldInfo = {};
10178
+ if (encoding.value?.length) {
10179
+ const valueField = encoding.value[0];
10180
+ const m = subMeasures.find((m)=>m.id === valueField);
10181
+ const binData = bin_bin(dataset, {
10182
+ field: valueField,
10183
+ groupField: [
10184
+ ...encoding.x ?? [],
10185
+ ...encoding.color ?? [],
10186
+ ...rowColumnFields.map((item)=>item.id)
10187
+ ],
10188
+ bins: binCount,
10189
+ step: binStep,
10190
+ outputNames: {
10191
+ x0: BinStartMeasureId,
10192
+ x1: BinEndMeasureId,
10193
+ count: BinCountMeasureId,
10194
+ percentage: BinPercentageMeasureId
10195
+ }
10196
+ });
10197
+ binData.forEach((datum)=>{
10198
+ datum[FoldMeasureId] = valueField;
10199
+ datum[FoldMeasureName] = m?.alias ?? valueField;
10200
+ datum[FoldMeasureValue] = 'percentage' === binValueType ? datum[BinPercentageMeasureId] : datum[BinCountMeasureId];
10201
+ });
10202
+ const res = unfoldDimensions(binData, uniqDims, encoding, {
10203
+ foldMeasureId: FoldMeasureId,
10204
+ separator: "-",
10205
+ colorItemAsId: false
10206
+ });
10207
+ res.dataset.forEach((d)=>{
10208
+ newDatasets.push(d);
10209
+ });
10210
+ unfoldInfo = res.unfoldInfo;
10211
+ } else if (encoding.x0?.length && encoding.x1?.length && encoding.y?.length) {
10212
+ const res = dataReshapeByEncoding(dataset, T(dimensions, (item)=>item.id), subMeasures.filter((item)=>encoding.y?.includes(item.id)).slice(0, 1), encoding, {
10213
+ colorItemAsId: false,
10214
+ colorMeasureId
10215
+ });
10216
+ res.dataset.forEach((datum)=>{
10217
+ datum[BinStartMeasureId] = datum[encoding.x0[0]];
10218
+ datum[BinEndMeasureId] = datum[encoding.x1[0]];
10219
+ datum[FoldMeasureId] = datum[encoding.y[0]];
10220
+ });
10221
+ newDatasets = res.dataset;
10222
+ foldInfo = res.foldInfo;
10223
+ unfoldInfo = res.unfoldInfo;
10224
+ }
10225
+ const reshapeInfo = {
10226
+ id: groupId,
10227
+ index,
10228
+ foldInfo,
10229
+ unfoldInfo
10230
+ };
10231
+ datasets.push(newDatasets);
10232
+ datasetReshapeInfo.push(reshapeInfo);
10233
+ });
10234
+ return {
10235
+ ...result,
10236
+ dataset: datasets,
10237
+ datasetReshapeInfo: datasetReshapeInfo
10238
+ };
10239
+ };
10240
+ const regressionLine = (advancedVSeed, context)=>{
10241
+ const { vseed } = context;
10242
+ if ('histogramRegressionLine' in vseed && 'histogram' === vseed.chartType) advancedVSeed.histogramRegressionLine = vseed.histogramRegressionLine;
10243
+ return advancedVSeed;
10244
+ };
10245
+ const histogramAdvancedPipeline = [
10246
+ initAdvancedVSeed_initAdvancedVSeed,
10247
+ default_defaultMeasures_defaultMeasures,
10248
+ defaultDimensions_defaultDimensions,
10249
+ defaultMeasureName_defaultMeasureName,
10250
+ histogramConfig,
10251
+ encodingAdapter([
10252
+ defaultEncodingForHistogram,
10253
+ buildMeasures
10254
+ ], [
10255
+ encodingForHistogram,
10256
+ buildMeasures,
10257
+ deleteEncodingForMeasure([
10258
+ 'tooltip',
10259
+ 'label',
10260
+ 'color'
10261
+ ]),
10262
+ deleteTooltipAndLabelDimension
10263
+ ]),
10264
+ pivotAdapter([
10265
+ reshapeWithHistogramEncoding
10266
+ ], [
10267
+ pivotReshapeWithHistogramEncoding
10268
+ ]),
10269
+ sortLegend_sortLegend,
10270
+ theme_theme,
10271
+ markStyle_markStyle,
10272
+ annotation_annotation,
10273
+ regressionLine
10274
+ ];
10275
+ const initHistogram = (spec)=>{
10276
+ const result = {
10277
+ ...spec
10278
+ };
10279
+ result.type = 'histogram';
10280
+ result.xField = BinStartMeasureId;
10281
+ result.x2Field = BinEndMeasureId;
10282
+ result.yField = FoldMeasureValue;
10283
+ result.padding = 0;
10284
+ result.region = [
10285
+ {
10286
+ clip: true
10287
+ }
10288
+ ];
10289
+ result.animation = true;
10290
+ return result;
10291
+ };
10292
+ const datasetHistogram = (spec, context)=>{
10293
+ const { advancedVSeed, vseed } = context;
10294
+ const { datasetReshapeInfo } = advancedVSeed;
10295
+ const { id } = datasetReshapeInfo[0];
10296
+ const fields = {};
10297
+ return {
10298
+ ...spec,
10299
+ data: {
10300
+ id,
10301
+ values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset.flat(),
10302
+ fields: fields
10303
+ }
10304
+ };
10305
+ };
10306
+ const tooltipHistogram_VCHART_OUTLIER_KEY = '__VCHART_BOX_PLOT_OUTLIER_VALUE';
10307
+ const tooltipHistogram = (spec, context)=>{
10308
+ const result = {
10309
+ ...spec
10310
+ };
10311
+ const { advancedVSeed } = context;
10312
+ const { chartType, dimensions, encoding } = advancedVSeed;
10313
+ const baseConfig = advancedVSeed.config[chartType];
10314
+ const { tooltip = {
10315
+ enable: true
10316
+ } } = baseConfig;
10317
+ const { enable } = tooltip;
10318
+ result.tooltip = {
10319
+ visible: enable,
10320
+ mark: {
10321
+ title: {
10322
+ visible: false
10323
+ },
10324
+ content: tooltipHistogram_createMarkContent(encoding.tooltip || [], dimensions, encoding)
10325
+ },
10326
+ dimension: {
10327
+ title: {
10328
+ visible: false
10329
+ },
10330
+ content: tooltipHistogram_createMarkContent(encoding.tooltip || [], dimensions, encoding)
10331
+ }
10332
+ };
10333
+ return result;
10334
+ };
10335
+ const tooltipHistogram_createMarkContent = (tooltip, dimensions, encoding)=>{
10336
+ const dims = C(dimensions.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias));
10337
+ const dimContent = dims.map((item)=>({
10338
+ visible: true,
10339
+ hasShape: true,
10340
+ shapeType: 'rectRound',
10341
+ key: item.alias ?? item.id,
10342
+ value: (datum)=>{
10343
+ if (!chunk_JK3VNB42_n(datum?.[tooltipHistogram_VCHART_OUTLIER_KEY])) {
10344
+ if (encoding.color?.includes(item.id)) return datum?.[ColorEncoding];
10345
+ if (encoding.x?.includes(item.id)) return datum?.[XEncoding];
10346
+ }
10347
+ return datum?.[item.id];
10348
+ }
10349
+ }));
10350
+ const defaultContent = [
10351
+ {
10352
+ visible: true,
10353
+ hasShape: true,
10354
+ shapeType: 'rectRound',
10355
+ key: (datum)=>{
10356
+ if (!datum) return '';
10357
+ return `${datum[BinStartMeasureId]} ~ ${datum[BinEndMeasureId]}`;
10358
+ },
10359
+ value: (datum)=>{
10360
+ if (!datum) return '';
10361
+ return datum[FoldMeasureValue];
10362
+ }
10363
+ }
10364
+ ];
10365
+ return [
10366
+ ...dimContent,
10367
+ defaultContent
10368
+ ];
10369
+ };
10370
+ const gaussian = (u)=>1 / Math.sqrt(2 * Math.PI) * Math.exp(-0.5 * u * u);
10371
+ function scott(n, std, dim = 1) {
10372
+ return n <= 0 || 0 === std ? 0 : std * Math.pow(n, -1 / (dim + 4));
10373
+ }
10374
+ function silverman(n, std, dim = 1) {
10375
+ if (n <= 0 || 0 === std) return 0;
10376
+ return Math.pow(4 / (dim + 2), 1 / (dim + 4)) * std * Math.pow(n, -1 / (dim + 4));
10377
+ }
10378
+ function kde_std(values) {
10379
+ const n = values.length;
10380
+ if (0 === n) return 0;
10381
+ let mean = 0;
10382
+ for(let i = 0; i < n; i++)mean += values[i];
10383
+ mean /= n;
10384
+ let s = 0;
10385
+ for(let i = 0; i < n; i++){
10386
+ const d = values[i] - mean;
10387
+ s += d * d;
10388
+ }
10389
+ return Math.sqrt(s / n);
10390
+ }
10391
+ function kde_kde(data, options = {}) {
10392
+ const n = data.length, kernel = options.kernel || gaussian;
10393
+ let h = options.bandwidth;
10394
+ if (!h || h <= 0) {
10395
+ const sd = kde_std(data) || 0, method = options.bandwidthMethod || "scott";
10396
+ h = "silverman" === method ? silverman(n, sd, 1) : scott(n, sd, 1);
10397
+ }
10398
+ if (!h || h <= 0) return {
10399
+ bandwidth: 0,
10400
+ kernel: kernel,
10401
+ evaluate: (x)=>{
10402
+ if (Array.isArray(x)) {
10403
+ const out = [];
10404
+ for(let i = 0; i < x.length; i++)out.push(0);
10405
+ return out;
10406
+ }
10407
+ return 0;
10408
+ },
10409
+ evaluateGrid: (N)=>{
10410
+ const out = [];
10411
+ if (N <= 0) return out;
10412
+ let min = 1 / 0, max = -1 / 0;
10413
+ for(let j = 0; j < n; j++){
10414
+ const v = data[j];
10415
+ v < min && (min = v), v > max && (max = v);
10416
+ }
10417
+ if (min === 1 / 0 || max === -1 / 0) {
10418
+ for(let i = 0; i < N; i++)out.push({
10419
+ x: 0,
10420
+ y: 0
10421
+ });
10422
+ return out;
10423
+ }
10424
+ for(let i = 0; i < N; i++)out.push({
10425
+ x: min,
10426
+ y: 0
10427
+ });
10428
+ return out;
10429
+ }
10430
+ };
10431
+ const invNh = 1 / (n * h);
10432
+ function evalPoint(x) {
10433
+ let sum = 0;
10434
+ for(let j = 0; j < n; j++)sum += kernel((x - data[j]) / h);
10435
+ return sum * invNh;
10436
+ }
10437
+ return {
10438
+ bandwidth: h,
10439
+ kernel: kernel,
10440
+ evaluate: function(x) {
10441
+ if (Array.isArray(x)) {
10442
+ const out = [];
10443
+ for(let i = 0; i < x.length; i++)out.push(evalPoint(x[i]));
10444
+ return out;
10445
+ }
10446
+ return evalPoint(x);
10447
+ },
10448
+ evaluateGrid (N) {
10449
+ const out = [];
10450
+ if (N <= 0) return out;
10451
+ let min = 1 / 0, max = -1 / 0;
10452
+ for(let i = 0; i < n; i++){
10453
+ const v = data[i];
10454
+ v < min && (min = v), v > max && (max = v);
10455
+ }
10456
+ if (min === 1 / 0 || max === -1 / 0) return out;
10457
+ if (min === max) {
10458
+ for(let i = 0; i < N; i++)out.push({
10459
+ x: min,
10460
+ y: evalPoint(min)
10461
+ });
10462
+ return out;
10463
+ }
10464
+ const step = (max - min) / (N - 1);
10465
+ for(let i = 0; i < N; i++){
10466
+ const x = i === N - 1 ? max : min + step * i;
10467
+ out.push({
10468
+ x: x,
10469
+ y: evalPoint(x)
10470
+ });
10471
+ }
10472
+ return out;
10473
+ }
10474
+ };
10475
+ }
10476
+ function ecdf(data) {
10477
+ const n = data.length, sorted = data.slice().sort((a, b)=>a - b);
10478
+ function evaluateSingle(x) {
10479
+ if (0 === n) return 0;
10480
+ let lo = 0, hi = n;
10481
+ for(; lo < hi;){
10482
+ const mid = lo + hi >>> 1;
10483
+ sorted[mid] <= x ? lo = mid + 1 : hi = mid;
10484
+ }
10485
+ return lo / n;
10486
+ }
10487
+ return {
10488
+ evaluate: function(x) {
10489
+ if (Array.isArray(x)) {
10490
+ const out = [];
10491
+ for(let i = 0; i < x.length; i++)out.push(evaluateSingle(x[i]));
10492
+ return out;
10493
+ }
10494
+ return evaluateSingle(x);
10495
+ },
10496
+ evaluateGrid: function(N) {
10497
+ const out = [];
10498
+ if (N <= 0) return out;
10499
+ if (0 === n) return out;
10500
+ const min = sorted[0], max = sorted[n - 1];
10501
+ if (min === max) {
10502
+ for(let i = 0; i < N; i++)out.push({
10503
+ x: min,
10504
+ y: 1
10505
+ });
10506
+ return out;
10507
+ }
10508
+ const step = (max - min) / (N - 1);
10509
+ for(let i = 0; i < N; i++){
10510
+ const x = i === N - 1 ? max : min + step * i;
10511
+ out.push({
10512
+ x: x,
10513
+ y: evaluateSingle(x)
10514
+ });
10515
+ }
10516
+ return out;
10517
+ },
10518
+ n: n
10519
+ };
10520
+ }
10521
+ const getRegressionByType = (type, data, kdeOptions)=>{
10522
+ switch(type){
10523
+ case 'kde':
10524
+ return kde_kde(data, kdeOptions);
10525
+ case 'ecdf':
10526
+ return ecdf(data);
10527
+ }
10528
+ };
10529
+ const histogramRegressionLine_histogramRegressionLine = (spec, context)=>{
10530
+ const result = {
10531
+ ...spec
10532
+ };
10533
+ const { advancedVSeed, vseed } = context;
10534
+ const { chartType, encoding = {}, dimensions, histogramRegressionLine } = advancedVSeed;
10535
+ const { dataset } = vseed;
10536
+ const theme = advancedVSeed.config[chartType]?.histogramRegressionLine;
10537
+ if (!histogramRegressionLine) return result;
10538
+ const rowColumnFields = T(dimensions.filter((dim)=>'row' === dim.encoding || 'column' === dim.encoding), (item)=>item.id);
10539
+ const lineList = Array.isArray(histogramRegressionLine) ? histogramRegressionLine : [
10540
+ histogramRegressionLine
10541
+ ];
10542
+ if (!result.customMark) result.customMark = [];
10543
+ lineList.forEach((line)=>{
10544
+ const { color, type, lineWidth, lineDash, text, textColor, textFontSize, textFontWeight } = line;
10545
+ result.customMark.push({
10546
+ type: 'line',
10547
+ interactive: false,
10548
+ zIndex: 500,
10549
+ style: {
10550
+ lineWidth: lineWidth ?? theme?.lineWidth,
10551
+ lineDash: lineDash ?? theme?.lineDash,
10552
+ stroke: color ?? ((datum, ctx)=>{
10553
+ const vchart = ctx.vchart;
10554
+ const chart = vchart.getChart();
10555
+ const series = chart.getAllSeries().filter((s)=>'bar' === s.type);
10556
+ return series.length ? series[0].getOption().globalScale.getScale('color')?.scale(series[0].getSeriesKeys()[0]) : void 0;
10557
+ }),
10558
+ points: (datum, ctx)=>{
10559
+ const vchart = ctx.vchart;
10560
+ const chart = vchart.getChart();
10561
+ const series = chart.getAllSeries().filter((s)=>'bar' === s.type);
10562
+ if (series && series.length) {
10563
+ const s = series[0];
10564
+ const region = s.getRegion().getLayoutStartPoint();
10565
+ const fieldX = s.fieldX?.[0];
10566
+ const scaleY = s.getYAxisHelper().getScale?.(0);
10567
+ const viewData = s.getViewData()?.latestData;
10568
+ if (!dataset || !dataset.length || !viewData || !viewData.length || !scaleY) return;
10569
+ const simpleData = dataset.filter((entry)=>rowColumnFields.length ? rowColumnFields.every((dim)=>entry[dim.id] === viewData[0][dim.id]) : true).map((d)=>d[encoding.value?.[0]]);
10570
+ const res = getRegressionByType(type, simpleData, 'kde' === type ? {
10571
+ bandwidth: Math.abs(viewData[0][BinEndMeasureId] - viewData[0][BinStartMeasureId])
10572
+ } : void 0);
10573
+ const N = Math.max(3, Math.floor(simpleData.length / 4));
10574
+ const lineData = res.evaluateGrid(N);
10575
+ const yRange = scaleY.range();
10576
+ const y0 = yRange[0];
10577
+ const y1 = yRange[yRange.length - 1];
10578
+ const scaleR = 'kde' === type ? (k)=>scaleY.scale(k * simpleData.length * res.bandwidth) : (e)=>y0 + (y1 - y0) * e;
10579
+ return lineData.map((ld)=>{
10580
+ const d = {
10581
+ [fieldX]: ld.x
10582
+ };
10583
+ return {
10584
+ x: s.dataToPositionX(d) + region.x,
10585
+ y: scaleR(ld.y) + region.y
10586
+ };
10587
+ });
10588
+ }
10589
+ return [];
10590
+ }
10591
+ }
10592
+ });
10593
+ if (!chunk_JK3VNB42_n(text)) result.customMark.push({
10594
+ type: 'text',
10595
+ interactive: false,
10596
+ zIndex: 500,
10597
+ style: {
10598
+ textAlign: 'end',
10599
+ fill: textColor ?? theme?.textColor,
10600
+ fontSize: textFontSize ?? theme?.textFontSize,
10601
+ fontWeight: textFontWeight ?? theme?.textFontWeight,
10602
+ text: text,
10603
+ x: (datum, ctx)=>{
10604
+ const vchart = ctx.vchart;
10605
+ const chart = vchart.getChart();
10606
+ const series = chart.getAllSeries().filter((s)=>'bar' === s.type);
10607
+ if (series && series.length) {
10608
+ const s = series[0];
10609
+ const startPoint = s.getRegion().getLayoutStartPoint();
10610
+ const fieldX = s.fieldX[0];
10611
+ const fieldX2 = s.fieldX2;
10612
+ const scaleY = s.getYAxisHelper().getScale?.(0);
10613
+ const viewData = s.getViewData()?.latestData;
10614
+ if (!dataset || !dataset.length || !viewData || !viewData.length || !scaleY) return;
10615
+ const maxX = Math.max.apply(null, viewData.map((d)=>Math.max(d[fieldX], d[fieldX2])));
10616
+ return startPoint.x + s.dataToPositionX({
10617
+ [fieldX]: maxX
10618
+ });
10619
+ }
10620
+ },
10621
+ y: (datum, ctx)=>{
10622
+ const vchart = ctx.vchart;
10623
+ const chart = vchart.getChart();
10624
+ const series = chart.getAllSeries().filter((s)=>'bar' === s.type);
10625
+ if (series && series.length) {
10626
+ const s = series[0];
10627
+ const startPoint = s.getRegion().getLayoutStartPoint();
10628
+ const fieldY = s.fieldY[0];
10629
+ const viewData = s.getViewData()?.latestData;
10630
+ if (!viewData || !viewData.length) return;
10631
+ return 'ecdf' === type ? startPoint.y + 12 : startPoint.y + s.dataToPositionY({
10632
+ [fieldY]: viewData[viewData.length - 1]?.[fieldY]
10633
+ });
10634
+ }
10635
+ }
10636
+ }
10637
+ });
10638
+ });
10639
+ return result;
10640
+ };
10641
+ const histogram = [
10642
+ initHistogram,
10643
+ colorAdapter(color_color, linearColor),
10644
+ background_backgroundColor,
10645
+ datasetHistogram,
10646
+ progressive,
10647
+ xLinear,
10648
+ yLinear,
10649
+ label_label,
10650
+ tooltipHistogram,
10651
+ colorAdapter(discreteLegend, colorLegend),
10652
+ verticalCrosshairRect,
10653
+ colorBarStyleFill(barStyle_barStyle),
10654
+ annotationPoint_annotationPoint,
10655
+ annotationVerticalLine_annotationVerticalLine,
10656
+ annotationHorizontalLine_annotationHorizontalLine,
10657
+ annotationAreaBand,
10658
+ histogramRegressionLine_histogramRegressionLine
10659
+ ];
10660
+ const pivotHistogram = [
10661
+ initPivot,
10662
+ pivotGridStyle,
10663
+ datasetPivot,
10664
+ pivotIndicators_pivotIndicators([
10665
+ initHistogram,
10666
+ colorAdapter(color_color, linearColor),
10667
+ background_backgroundColor,
10668
+ datasetHistogram,
10669
+ progressive,
10670
+ xLinear,
10671
+ yLinear,
10672
+ label_label,
10673
+ tooltipHistogram,
10674
+ colorBarStyleFill(barStyle_barStyle),
10675
+ verticalCrosshairRect,
10676
+ annotationPoint_annotationPoint,
10677
+ annotationVerticalLine_annotationVerticalLine,
10678
+ annotationHorizontalLine_annotationHorizontalLine,
10679
+ annotationAreaBand,
10680
+ histogramRegressionLine_histogramRegressionLine
10681
+ ]),
10682
+ pivotRowDimensions,
10683
+ pivotColumnDimensions,
10684
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
10685
+ ];
10686
+ const histogramSpecPipeline = [
10687
+ pivotAdapter_pivotAdapter(histogram, pivotHistogram)
10688
+ ];
10689
+ const registerHistogram = ()=>{
10690
+ Builder._advancedPipelineMap.histogram = histogramAdvancedPipeline;
10691
+ Builder._specPipelineMap.histogram = histogramSpecPipeline;
10692
+ };
10693
+ const getDarkCrosshairLine = ()=>({
10694
+ visible: true,
10695
+ labelVisible: true,
10696
+ labelColor: '#ffffff',
10697
+ labelBackgroundColor: '#404349',
10698
+ lineColor: '#55595F'
10699
+ });
10700
+ const getDarkCrosshairRect = ()=>({
10701
+ visible: true,
10702
+ labelVisible: true,
10703
+ labelColor: '#4B4F54',
10704
+ labelBackgroundColor: '#ffffff',
10705
+ rectColor: '#E2E3E6'
10706
+ });
10707
+ const getLightCrosshairLine = ()=>({
10708
+ visible: true,
10709
+ labelVisible: true,
10710
+ labelColor: '#ffffff',
10711
+ labelBackgroundColor: '#21252C',
10712
+ lineColor: '#21252C'
10713
+ });
10714
+ const getLightCrosshairRect = ()=>({
10715
+ visible: true,
10716
+ labelVisible: true,
10717
+ labelColor: '#ffffff',
10718
+ labelBackgroundColor: '#364159',
10719
+ rectColor: '#3641594d'
10720
+ });
10721
+ const getLightColorScheme = ()=>[
10722
+ '#8D72F6',
10723
+ '#5766EC',
10724
+ '#66A3FE',
10725
+ '#51D5E6',
10726
+ '#4EC0B3',
10727
+ '#F9DF90',
10728
+ '#F9AD71',
10729
+ '#ED8888',
10730
+ '#E9A0C3',
10731
+ '#D77DD3'
10732
+ ];
10733
+ const getDarkColorScheme = ()=>[
10734
+ '#2E62F1',
10735
+ '#4DC36A',
10736
+ '#FF8406',
10737
+ '#FFCC00',
10738
+ '#4F44CF',
10739
+ '#5AC8FA',
10740
+ '#003A8C',
10741
+ '#B08AE2',
10742
+ '#FF6341',
10743
+ '#98DD62'
10744
+ ];
10745
+ const getLightLinearColorScheme = ()=>[
10746
+ '#C2CEFF',
10747
+ '#5766EC'
10748
+ ];
10749
+ const getDarkLinearColorScheme = ()=>[
10750
+ '#A0CEFF',
10751
+ '#2E62F1'
10752
+ ];
10753
+ const getLightColor = ()=>({
10754
+ linearColorScheme: getLightLinearColorScheme(),
10755
+ colorScheme: getLightColorScheme()
10756
+ });
10757
+ const getDarkColor = ()=>({
10758
+ linearColorScheme: getDarkLinearColorScheme(),
10759
+ colorScheme: getDarkColorScheme()
10760
+ });
10761
+ const getDefaultLabel = ()=>({
10762
+ enable: true,
10763
+ wrap: true,
10764
+ showValue: true,
10765
+ showValuePercent: false,
10766
+ labelColorSmartInvert: false,
10767
+ labelOverlap: true
10768
+ });
10769
+ const getDarkLabel = ()=>({
10770
+ ...getDefaultLabel(),
10771
+ labelStroke: '#21252C'
10772
+ });
10773
+ const getLightLabel = ()=>({
10774
+ ...getDefaultLabel(),
10775
+ labelStroke: '#fff'
10776
+ });
10777
+ const getDefaultLegend = ()=>({
9351
10778
  enable: true,
9352
10779
  border: true,
9353
10780
  maxSize: 1,
@@ -9357,12 +10784,15 @@
9357
10784
  labelFontSize: 12,
9358
10785
  labelFontWeight: 400
9359
10786
  });
10787
+ const getDefaultTableConfig = ()=>({
10788
+ bodyFontSize: 12,
10789
+ bodyBackgroundColor: 'transparent',
10790
+ headerFontSize: 12
10791
+ });
9360
10792
  const getLightTableConfig = ()=>({
10793
+ ...getDefaultTableConfig(),
9361
10794
  borderColor: '#e3e5eb',
9362
- bodyFontSize: 12,
9363
10795
  bodyFontColor: '#141414',
9364
- bodyBackgroundColor: 'transparent',
9365
- headerFontSize: 12,
9366
10796
  headerFontColor: '#21252c',
9367
10797
  headerBackgroundColor: '#f6f7f9',
9368
10798
  hoverBodyBackgroundColor: '#bedaff',
@@ -9374,11 +10804,9 @@
9374
10804
  backgroundColor: 'transparent'
9375
10805
  });
9376
10806
  const getDarkTableConfig = ()=>({
10807
+ ...getDefaultTableConfig(),
9377
10808
  borderColor: '#4b4e53',
9378
- bodyFontSize: 12,
9379
10809
  bodyFontColor: '#fdfdfd',
9380
- bodyBackgroundColor: 'transparent',
9381
- headerFontSize: 12,
9382
10810
  headerFontColor: '#fdfdfd',
9383
10811
  headerBackgroundColor: '#36393e',
9384
10812
  hoverBodyBackgroundColor: '#4284ff66',
@@ -9389,10 +10817,12 @@
9389
10817
  selectedBackgroundColor: '#4284ff33'
9390
10818
  });
9391
10819
  const pickPivotChartGridConfig = (tableConfig)=>({
10820
+ outlineBorderLineWidth: 0,
10821
+ frameCornerRadius: 0,
9392
10822
  borderColor: tableConfig.borderColor,
9393
10823
  bodyFontColor: tableConfig.bodyFontColor,
9394
10824
  headerFontColor: tableConfig.headerFontColor,
9395
- headerBackgroundColor: tableConfig.headerBackgroundColor,
10825
+ headerBackgroundColor: 'transparent',
9396
10826
  hoverHeaderBackgroundColor: tableConfig.hoverHeaderBackgroundColor,
9397
10827
  hoverHeaderInlineBackgroundColor: tableConfig.hoverHeaderInlineBackgroundColor
9398
10828
  });
@@ -9678,6 +11108,19 @@
9678
11108
  const getDarkHeatmapCellTheme = ()=>({
9679
11109
  stroke: '#404349'
9680
11110
  });
11111
+ const getDefaultHistogramRegressionLine = ()=>({
11112
+ lineWidth: 2,
11113
+ textFontSize: 12,
11114
+ textFontWeight: 400
11115
+ });
11116
+ const getLightHistogramRegressionLine = ()=>({
11117
+ ...getDefaultHistogramRegressionLine(),
11118
+ textColor: '#364159'
11119
+ });
11120
+ const getDarkHistogramRegressionLine = ()=>({
11121
+ ...getDefaultHistogramRegressionLine(),
11122
+ textColor: '#ffffff'
11123
+ });
9681
11124
  const lightTheme = ()=>{
9682
11125
  const linearAxis = getLightLinearAxis();
9683
11126
  const bandAxis = getLightBandAxis();
@@ -9924,6 +11367,23 @@
9924
11367
  },
9925
11368
  cell: getLightHeatmapCellTheme(),
9926
11369
  pivotGrid: getLightPivotChartGridConfig()
11370
+ },
11371
+ histogram: {
11372
+ ...baseConfig,
11373
+ xAxis: linearAxis,
11374
+ yAxis: linearAxis,
11375
+ crosshairRect,
11376
+ pivotGrid: getLightPivotChartGridConfig(),
11377
+ annotation: getLightAnnotation(),
11378
+ histogramRegressionLine: getLightHistogramRegressionLine()
11379
+ },
11380
+ boxPlot: {
11381
+ ...baseConfig,
11382
+ xAxis: linearAxis,
11383
+ yAxis: linearAxis,
11384
+ crosshairRect,
11385
+ pivotGrid: getLightPivotChartGridConfig(),
11386
+ annotation: getLightAnnotation()
9927
11387
  }
9928
11388
  }
9929
11389
  };
@@ -10168,6 +11628,23 @@
10168
11628
  },
10169
11629
  cell: getDarkHeatmapCellTheme(),
10170
11630
  pivotGrid: getDarkPivotChartGridConfig()
11631
+ },
11632
+ histogram: {
11633
+ ...baseConfig,
11634
+ xAxis: linearAxis,
11635
+ yAxis: linearAxis,
11636
+ crosshairRect: crosshairRect,
11637
+ pivotGrid: getDarkPivotChartGridConfig(),
11638
+ annotation: getDarkAnnotation(),
11639
+ histogramRegressionLine: getDarkHistogramRegressionLine()
11640
+ },
11641
+ boxPlot: {
11642
+ ...baseConfig,
11643
+ xAxis: bandAxis,
11644
+ yAxis: linearAxis,
11645
+ crosshairRect: crosshairRect,
11646
+ pivotGrid: getDarkPivotChartGridConfig(),
11647
+ annotation: getDarkAnnotation()
10171
11648
  }
10172
11649
  }
10173
11650
  };
@@ -10206,6 +11683,8 @@
10206
11683
  registerRadar();
10207
11684
  registerFunnel();
10208
11685
  registerHeatmap();
11686
+ registerBoxplot();
11687
+ registerHistogram();
10209
11688
  registerLightTheme();
10210
11689
  registerDarkTheme();
10211
11690
  };
@@ -13518,7 +14997,9 @@
13518
14997
  'donut',
13519
14998
  'radar',
13520
14999
  'funnel',
13521
- 'heatmap'
15000
+ 'heatmap',
15001
+ 'boxPlot',
15002
+ 'histogram'
13522
15003
  ]);
13523
15004
  const zDualChartType = schemas_object({
13524
15005
  primary: schemas_enum([
@@ -13690,7 +15171,16 @@
13690
15171
  label: schemas_array(schemas_string()).nullish(),
13691
15172
  row: schemas_array(schemas_string()).nullish(),
13692
15173
  column: schemas_array(schemas_string()).nullish(),
13693
- group: schemas_array(schemas_string()).nullish().describe("\u5DF2\u5F03\u7528, \u8BF7\u4F7F\u7528\u989C\u8272\u66FF\u4EE3")
15174
+ group: schemas_array(schemas_string()).nullish().describe("\u5DF2\u5F03\u7528, \u8BF7\u4F7F\u7528\u989C\u8272\u66FF\u4EE3"),
15175
+ value: schemas_array(schemas_string()).nullish(),
15176
+ q1: schemas_array(schemas_string()).nullish(),
15177
+ q3: schemas_array(schemas_string()).nullish(),
15178
+ median: schemas_array(schemas_string()).nullish(),
15179
+ min: schemas_array(schemas_string()).nullish(),
15180
+ max: schemas_array(schemas_string()).nullish(),
15181
+ outliers: schemas_array(schemas_string()).nullish(),
15182
+ x0: schemas_array(schemas_string()).nullish(),
15183
+ x1: schemas_array(schemas_string()).nullish()
13694
15184
  });
13695
15185
  const EncodingEnum = {
13696
15186
  x: 'x',
@@ -14215,7 +15705,9 @@
14215
15705
  headerFontColor: schemas_string().nullish(),
14216
15706
  headerBackgroundColor: schemas_string().nullish(),
14217
15707
  hoverHeaderBackgroundColor: schemas_string().nullish(),
14218
- hoverHeaderInlineBackgroundColor: schemas_string().nullish()
15708
+ hoverHeaderInlineBackgroundColor: schemas_string().nullish(),
15709
+ outlineBorderLineWidth: schemas_number().nullish(),
15710
+ frameCornerRadius: schemas_number().nullish()
14219
15711
  });
14220
15712
  const zLineConfig = schemas_object({
14221
15713
  backgroundColor: zBackgroundColor.nullish(),
@@ -14366,6 +15858,50 @@
14366
15858
  cell: zHeatmapCell.nullish()
14367
15859
  });
14368
15860
  const zPivotTableConfig = zTableConfig;
15861
+ const zWhiskersConfig = schemas_number().or(schemas_array(schemas_number())).default(1.5);
15862
+ const zBoxplotConfig = schemas_object({
15863
+ backgroundColor: zBackgroundColor.nullish(),
15864
+ label: zLabel.nullish(),
15865
+ color: zColor.nullish(),
15866
+ tooltip: zTooltip.nullish(),
15867
+ legend: zLegend.nullish(),
15868
+ xAxis: zXBandAxis.nullish(),
15869
+ yAxis: zYLinearAxis.nullish(),
15870
+ crosshairRect: zCrosshairRect.nullish(),
15871
+ pivotGrid: zPivotChartGridConfig.nullish(),
15872
+ annotation: zAnnotationConfig.nullish(),
15873
+ whiskers: zWhiskersConfig.nullish()
15874
+ });
15875
+ const zHistogramRegressionLine = schemas_object({
15876
+ type: union([
15877
+ literal('kde'),
15878
+ literal('ecdf')
15879
+ ]).nullish(),
15880
+ color: schemas_string().nullish(),
15881
+ lineWidth: schemas_number().nullish(),
15882
+ lineDash: schemas_array(schemas_number()).nullish(),
15883
+ text: schemas_string().nullish(),
15884
+ textColor: schemas_string().nullish(),
15885
+ textFontSize: schemas_number().nullish(),
15886
+ textFontWeight: schemas_number().nullish()
15887
+ });
15888
+ const zHistogramConfig = schemas_object({
15889
+ backgroundColor: zBackgroundColor.nullish(),
15890
+ label: zLabel.nullish(),
15891
+ color: zColor.nullish(),
15892
+ tooltip: zTooltip.nullish(),
15893
+ legend: zLegend.nullish(),
15894
+ xAxis: zXBandAxis.nullish(),
15895
+ yAxis: zYLinearAxis.nullish(),
15896
+ crosshairRect: zCrosshairRect.nullish(),
15897
+ stackCornerRadius: zStackCornerRadius.nullish(),
15898
+ pivotGrid: zPivotChartGridConfig.nullish(),
15899
+ annotation: zAnnotationConfig.nullish(),
15900
+ binCount: schemas_number().positive().nullish(),
15901
+ binStep: schemas_number().positive().nullish(),
15902
+ binValueType: literal('count').or(literal('percentage')).nullish(),
15903
+ histogramRegressionLine: zHistogramRegressionLine.nullish()
15904
+ });
14369
15905
  const zConfig = schemas_object({
14370
15906
  table: zTableConfig.nullish(),
14371
15907
  pivotTable: zPivotTableConfig.nullish(),
@@ -14386,7 +15922,9 @@
14386
15922
  donut: zDonutConfig.nullish(),
14387
15923
  radar: zRadarConfig.nullish(),
14388
15924
  funnel: zFunnelConfig.nullish(),
14389
- heatmap: zHeatmapConfig.nullish()
15925
+ heatmap: zHeatmapConfig.nullish(),
15926
+ boxPlot: zBoxplotConfig.nullish(),
15927
+ histogram: zHistogramConfig.nullish()
14390
15928
  });
14391
15929
  const zCustomThemeConfig = schemas_object({
14392
15930
  config: zConfig.nullish()
@@ -14626,6 +16164,8 @@
14626
16164
  tooltip: zTooltip.nullish(),
14627
16165
  xAxis: zXBandAxis.nullish(),
14628
16166
  yAxis: zYLinearAxis.nullish(),
16167
+ sort: zSort.nullish(),
16168
+ sortLegent: zSortLegend.nullish(),
14629
16169
  crosshairRect: zCrosshairRect.nullish(),
14630
16170
  stackCornerRadius: zStackCornerRadius.nullish(),
14631
16171
  barMaxWidth: zBarMaxWidth.nullish(),
@@ -14864,6 +16404,32 @@
14864
16404
  annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).nullish(),
14865
16405
  locale: zLocale.nullish()
14866
16406
  });
16407
+ const zHistogram = schemas_object({
16408
+ chartType: literal('histogram'),
16409
+ dataset: zDataset.nullish(),
16410
+ encoding: zEncoding.nullish(),
16411
+ dimensions: zDimensions.nullish(),
16412
+ measures: zMeasureTree.nullish(),
16413
+ backgroundColor: zBackgroundColor.nullish(),
16414
+ color: zColor.nullish(),
16415
+ label: zLabel.nullish(),
16416
+ legend: zLegend.nullish(),
16417
+ tooltip: zTooltip.nullish(),
16418
+ xAxis: zXLinearAxis.nullish(),
16419
+ yAxis: zYLinearAxis.nullish(),
16420
+ crosshairRect: zCrosshairRect.nullish(),
16421
+ binCount: schemas_number().positive().nullish(),
16422
+ binStep: schemas_number().positive().nullish(),
16423
+ binValueType: literal('count').or(literal('percentage')).nullish(),
16424
+ theme: zTheme.nullish(),
16425
+ barStyle: schemas_array(zBarStyle).or(zBarStyle).nullish(),
16426
+ annotationPoint: schemas_array(zAnnotationPoint).or(zAnnotationPoint).nullish(),
16427
+ annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).nullish(),
16428
+ annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).nullish(),
16429
+ annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).nullish(),
16430
+ histogramRegressionLine: schemas_array(zHistogramRegressionLine).or(zHistogramRegressionLine).nullish(),
16431
+ locale: zLocale.nullish()
16432
+ });
14867
16433
  const zRose = schemas_object({
14868
16434
  chartType: literal('rose'),
14869
16435
  dataset: zDataset.nullish(),
@@ -14961,6 +16527,30 @@
14961
16527
  theme: zTheme.nullish(),
14962
16528
  locale: zLocale.nullish()
14963
16529
  });
16530
+ const zBoxplot = schemas_object({
16531
+ chartType: literal('boxPlot'),
16532
+ dataset: zDataset.nullish(),
16533
+ encoding: zEncoding.nullish(),
16534
+ dimensions: zDimensions.nullish(),
16535
+ measures: zMeasureTree.nullish(),
16536
+ backgroundColor: zBackgroundColor.nullish(),
16537
+ color: zColor.nullish(),
16538
+ label: zLabel.nullish(),
16539
+ legend: zLegend.nullish(),
16540
+ tooltip: zTooltip.nullish(),
16541
+ xAxis: zXBandAxis.nullish(),
16542
+ yAxis: zYLinearAxis.nullish(),
16543
+ sort: zSort.nullish(),
16544
+ sortLegent: zSortLegend.nullish(),
16545
+ crosshairRect: zCrosshairRect.nullish(),
16546
+ theme: zTheme.nullish(),
16547
+ whiskers: zWhiskersConfig.nullish(),
16548
+ annotationPoint: schemas_array(zAnnotationPoint).or(zAnnotationPoint).nullish(),
16549
+ annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).nullish(),
16550
+ annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).nullish(),
16551
+ annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).nullish(),
16552
+ locale: zLocale.nullish()
16553
+ });
14964
16554
  const zVSeed = discriminatedUnion('chartType', [
14965
16555
  zTable,
14966
16556
  zPivotTable,
@@ -14981,7 +16571,9 @@
14981
16571
  zRoseParallel,
14982
16572
  zRadar,
14983
16573
  zFunnel,
14984
- zHeatmap
16574
+ zHeatmap,
16575
+ zBoxplot,
16576
+ zHistogram
14985
16577
  ]);
14986
16578
  const zAdvancedVSeed = schemas_object({
14987
16579
  chartType: zChartType,
@@ -14996,7 +16588,8 @@
14996
16588
  markStyle: zMarkStyle,
14997
16589
  customTheme: zCustomThemeConfig,
14998
16590
  annotation: zAnnotation,
14999
- locale: zLocale
16591
+ locale: zLocale,
16592
+ histogramRegressionLine: zHistogramRegressionLine.or(schemas_array(zHistogramRegressionLine)).nullish()
15000
16593
  });
15001
16594
  return __webpack_exports__;
15002
16595
  })());