@visactor/vseed 0.5.4 → 0.5.6

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 (217) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/builder/register/all.js +3 -1
  4. package/dist/esm/builder/register/all.js.map +1 -1
  5. package/dist/esm/builder/register/chartType/hierarchySankey.d.ts +4 -0
  6. package/dist/esm/builder/register/chartType/hierarchySankey.js +9 -0
  7. package/dist/esm/builder/register/chartType/hierarchySankey.js.map +1 -0
  8. package/dist/esm/builder/register/chartType/index.d.ts +2 -0
  9. package/dist/esm/builder/register/chartType/index.js +2 -0
  10. package/dist/esm/builder/register/chartType/sankey.d.ts +1 -0
  11. package/dist/esm/builder/register/chartType/sankey.js +9 -0
  12. package/dist/esm/builder/register/chartType/sankey.js.map +1 -0
  13. package/dist/esm/dataReshape/constant.d.ts +2 -0
  14. package/dist/esm/dataReshape/constant.js +3 -1
  15. package/dist/esm/dataReshape/constant.js.map +1 -1
  16. package/dist/esm/dataReshape/unfoldDimensions.js +8 -2
  17. package/dist/esm/dataReshape/unfoldDimensions.js.map +1 -1
  18. package/dist/esm/index.d.ts +1 -1
  19. package/dist/esm/index.js +1 -1
  20. package/dist/esm/pipeline/advanced/chart/pipeline/hierarchySankey.d.ts +2 -0
  21. package/dist/esm/pipeline/advanced/chart/pipeline/hierarchySankey.js +33 -0
  22. package/dist/esm/pipeline/advanced/chart/pipeline/hierarchySankey.js.map +1 -0
  23. package/dist/esm/pipeline/advanced/chart/pipeline/index.d.ts +2 -0
  24. package/dist/esm/pipeline/advanced/chart/pipeline/index.js +2 -0
  25. package/dist/esm/pipeline/advanced/chart/pipeline/sankey.d.ts +2 -0
  26. package/dist/esm/pipeline/advanced/chart/pipeline/sankey.js +33 -0
  27. package/dist/esm/pipeline/advanced/chart/pipeline/sankey.js.map +1 -0
  28. package/dist/esm/pipeline/advanced/chart/pipes/config/hierarchySankey.d.ts +2 -0
  29. package/dist/esm/pipeline/advanced/chart/pipes/config/hierarchySankey.js +27 -0
  30. package/dist/esm/pipeline/advanced/chart/pipes/config/hierarchySankey.js.map +1 -0
  31. package/dist/esm/pipeline/advanced/chart/pipes/config/index.d.ts +2 -0
  32. package/dist/esm/pipeline/advanced/chart/pipes/config/index.js +2 -0
  33. package/dist/esm/pipeline/advanced/chart/pipes/config/index.js.map +1 -1
  34. package/dist/esm/pipeline/advanced/chart/pipes/config/sankey.d.ts +2 -0
  35. package/dist/esm/pipeline/advanced/chart/pipes/config/sankey.js +27 -0
  36. package/dist/esm/pipeline/advanced/chart/pipes/config/sankey.js.map +1 -0
  37. package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.d.ts +1 -0
  38. package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.js +1 -0
  39. package/dist/esm/pipeline/advanced/chart/pipes/encoding/sankey.d.ts +3 -0
  40. package/dist/esm/pipeline/advanced/chart/pipes/encoding/sankey.js +83 -0
  41. package/dist/esm/pipeline/advanced/chart/pipes/encoding/sankey.js.map +1 -0
  42. package/dist/esm/pipeline/spec/chart/pipeline/hierarchySankey.d.ts +1 -0
  43. package/dist/esm/pipeline/spec/chart/pipeline/hierarchySankey.js +39 -0
  44. package/dist/esm/pipeline/spec/chart/pipeline/hierarchySankey.js.map +1 -0
  45. package/dist/esm/pipeline/spec/chart/pipeline/index.d.ts +2 -0
  46. package/dist/esm/pipeline/spec/chart/pipeline/index.js +2 -0
  47. package/dist/esm/pipeline/spec/chart/pipeline/sankey.d.ts +1 -0
  48. package/dist/esm/pipeline/spec/chart/pipeline/sankey.js +39 -0
  49. package/dist/esm/pipeline/spec/chart/pipeline/sankey.js.map +1 -0
  50. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js +11 -2
  51. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js.map +1 -1
  52. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHierarchy.js +5 -2
  53. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHierarchy.js.map +1 -1
  54. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHierarchySankey.d.ts +4 -0
  55. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHierarchySankey.js +136 -0
  56. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHierarchySankey.js.map +1 -0
  57. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivotHierarchy.d.ts +1 -0
  58. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivotHierarchy.js +1 -1
  59. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivotHierarchy.js.map +1 -1
  60. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivotHierarchySankey.d.ts +2 -0
  61. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivotHierarchySankey.js +44 -0
  62. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivotHierarchySankey.js.map +1 -0
  63. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivotSankey.d.ts +2 -0
  64. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivotSankey.js +50 -0
  65. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivotSankey.js.map +1 -0
  66. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetSankey.d.ts +16 -0
  67. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetSankey.js +97 -0
  68. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetSankey.js.map +1 -0
  69. package/dist/esm/pipeline/spec/chart/pipes/dataset/index.d.ts +4 -0
  70. package/dist/esm/pipeline/spec/chart/pipes/dataset/index.js +4 -0
  71. package/dist/esm/pipeline/spec/chart/pipes/init/circlePacking.js +1 -1
  72. package/dist/esm/pipeline/spec/chart/pipes/init/circlePacking.js.map +1 -1
  73. package/dist/esm/pipeline/spec/chart/pipes/init/hierarchySankey.d.ts +2 -0
  74. package/dist/esm/pipeline/spec/chart/pipes/init/hierarchySankey.js +32 -0
  75. package/dist/esm/pipeline/spec/chart/pipes/init/hierarchySankey.js.map +1 -0
  76. package/dist/esm/pipeline/spec/chart/pipes/init/index.d.ts +2 -0
  77. package/dist/esm/pipeline/spec/chart/pipes/init/index.js +2 -0
  78. package/dist/esm/pipeline/spec/chart/pipes/init/sankey.d.ts +2 -0
  79. package/dist/esm/pipeline/spec/chart/pipes/init/sankey.js +33 -0
  80. package/dist/esm/pipeline/spec/chart/pipes/init/sankey.js.map +1 -0
  81. package/dist/esm/pipeline/spec/chart/pipes/init/sunburst.js +1 -1
  82. package/dist/esm/pipeline/spec/chart/pipes/init/sunburst.js.map +1 -1
  83. package/dist/esm/pipeline/spec/chart/pipes/init/treeMap.js +1 -1
  84. package/dist/esm/pipeline/spec/chart/pipes/init/treeMap.js.map +1 -1
  85. package/dist/esm/pipeline/spec/chart/pipes/label/index.d.ts +2 -0
  86. package/dist/esm/pipeline/spec/chart/pipes/label/index.js +2 -0
  87. package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
  88. package/dist/esm/pipeline/spec/chart/pipes/label/labelHierarchySankey.d.ts +17 -0
  89. package/dist/esm/pipeline/spec/chart/pipes/label/labelHierarchySankey.js +92 -0
  90. package/dist/esm/pipeline/spec/chart/pipes/label/labelHierarchySankey.js.map +1 -0
  91. package/dist/esm/pipeline/spec/chart/pipes/label/labelSankey.d.ts +2 -0
  92. package/dist/esm/pipeline/spec/chart/pipes/label/labelSankey.js +78 -0
  93. package/dist/esm/pipeline/spec/chart/pipes/label/labelSankey.js.map +1 -0
  94. package/dist/esm/pipeline/spec/chart/pipes/label/labelTreeMapLeaf.js +4 -4
  95. package/dist/esm/pipeline/spec/chart/pipes/label/labelTreeMapLeaf.js.map +1 -1
  96. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js +1 -1
  97. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js.map +1 -1
  98. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js +1 -1
  99. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js.map +1 -1
  100. package/dist/esm/pipeline/spec/chart/pipes/markStyle/index.d.ts +1 -0
  101. package/dist/esm/pipeline/spec/chart/pipes/markStyle/index.js +1 -0
  102. package/dist/esm/pipeline/spec/chart/pipes/markStyle/sankeyInteractive.d.ts +2 -0
  103. package/dist/esm/pipeline/spec/chart/pipes/markStyle/sankeyInteractive.js +33 -0
  104. package/dist/esm/pipeline/spec/chart/pipes/markStyle/sankeyInteractive.js.map +1 -0
  105. package/dist/esm/pipeline/spec/chart/pipes/tooltip/index.d.ts +2 -0
  106. package/dist/esm/pipeline/spec/chart/pipes/tooltip/index.js +2 -0
  107. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHierarchySankey.d.ts +2 -0
  108. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHierarchySankey.js +150 -0
  109. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHierarchySankey.js.map +1 -0
  110. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipSankey.d.ts +2 -0
  111. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipSankey.js +75 -0
  112. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipSankey.js.map +1 -0
  113. package/dist/esm/pipeline/utils/chatType.d.ts +2 -0
  114. package/dist/esm/pipeline/utils/chatType.js +3 -1
  115. package/dist/esm/pipeline/utils/chatType.js.map +1 -1
  116. package/dist/esm/pipeline/utils/constant.d.ts +2 -0
  117. package/dist/esm/pipeline/utils/constant.js +2 -0
  118. package/dist/esm/pipeline/utils/constant.js.map +1 -1
  119. package/dist/esm/pipeline/utils/measures/typeGuard.js +1 -1
  120. package/dist/esm/pipeline/utils/measures/typeGuard.js.map +1 -1
  121. package/dist/esm/theme/dark/dark.js +3 -1
  122. package/dist/esm/theme/dark/dark.js.map +1 -1
  123. package/dist/esm/theme/dark/hierarchy.d.ts +132 -0
  124. package/dist/esm/theme/dark/hierarchy.js +3 -1
  125. package/dist/esm/theme/dark/hierarchy.js.map +1 -1
  126. package/dist/esm/theme/light/hierarchy.d.ts +132 -0
  127. package/dist/esm/theme/light/hierarchy.js +3 -1
  128. package/dist/esm/theme/light/hierarchy.js.map +1 -1
  129. package/dist/esm/theme/light/light.js +3 -1
  130. package/dist/esm/theme/light/light.js.map +1 -1
  131. package/dist/esm/types/chartType/area/zArea.d.ts +4 -0
  132. package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +4 -0
  133. package/dist/esm/types/chartType/bar/zBar.d.ts +4 -0
  134. package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +4 -0
  135. package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +4 -0
  136. package/dist/esm/types/chartType/boxPlot/zBoxPlot.d.ts +4 -0
  137. package/dist/esm/types/chartType/circlePacking/zCirclePacking.d.ts +2 -0
  138. package/dist/esm/types/chartType/column/zColumn.d.ts +4 -0
  139. package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +4 -0
  140. package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +4 -0
  141. package/dist/esm/types/chartType/donut/zDonut.d.ts +4 -0
  142. package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +2 -0
  143. package/dist/esm/types/chartType/funnel/zFunnel.d.ts +4 -0
  144. package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +2 -0
  145. package/dist/esm/types/chartType/hierarchySankey/hierarchySankey.d.ts +92 -0
  146. package/dist/esm/types/chartType/hierarchySankey/hierarchySankey.js +0 -0
  147. package/dist/esm/types/chartType/hierarchySankey/index.d.ts +2 -0
  148. package/dist/esm/types/chartType/hierarchySankey/index.js +1 -0
  149. package/dist/esm/types/chartType/hierarchySankey/zHierarchySankey.d.ts +422 -0
  150. package/dist/esm/types/chartType/hierarchySankey/zHierarchySankey.js +20 -0
  151. package/dist/esm/types/chartType/hierarchySankey/zHierarchySankey.js.map +1 -0
  152. package/dist/esm/types/chartType/histogram/zHistogram.d.ts +4 -0
  153. package/dist/esm/types/chartType/index.d.ts +2 -0
  154. package/dist/esm/types/chartType/index.js +2 -0
  155. package/dist/esm/types/chartType/line/zLine.d.ts +4 -0
  156. package/dist/esm/types/chartType/pie/zPie.d.ts +4 -0
  157. package/dist/esm/types/chartType/pivotTable/zPivotTable.d.ts +2 -0
  158. package/dist/esm/types/chartType/raceBar/zRaceBar.d.ts +4 -0
  159. package/dist/esm/types/chartType/raceColumn/zRaceColumn.d.ts +4 -0
  160. package/dist/esm/types/chartType/raceDonut/zRaceDonut.d.ts +4 -0
  161. package/dist/esm/types/chartType/raceLine/zRaceLine.d.ts +4 -0
  162. package/dist/esm/types/chartType/racePie/zRacePie.d.ts +4 -0
  163. package/dist/esm/types/chartType/raceScatter/zRaceScatter.d.ts +4 -0
  164. package/dist/esm/types/chartType/radar/zRadar.d.ts +4 -0
  165. package/dist/esm/types/chartType/rose/zRose.d.ts +4 -0
  166. package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +4 -0
  167. package/dist/esm/types/chartType/sankey/index.d.ts +2 -0
  168. package/dist/esm/types/chartType/sankey/index.js +1 -0
  169. package/dist/esm/types/chartType/sankey/sankey.d.ts +91 -0
  170. package/dist/esm/types/chartType/sankey/sankey.js +0 -0
  171. package/dist/esm/types/chartType/sankey/zSankey.d.ts +422 -0
  172. package/dist/esm/types/chartType/sankey/zSankey.js +20 -0
  173. package/dist/esm/types/chartType/sankey/zSankey.js.map +1 -0
  174. package/dist/esm/types/chartType/scatter/zScatter.d.ts +4 -0
  175. package/dist/esm/types/chartType/sunburst/zSunburst.d.ts +2 -0
  176. package/dist/esm/types/chartType/table/zTable.d.ts +2 -0
  177. package/dist/esm/types/chartType/treeMap/zTreeMap.d.ts +2 -0
  178. package/dist/esm/types/properties/chartType/chartType.d.ts +3 -1
  179. package/dist/esm/types/properties/chartType/chartType.js +2 -0
  180. package/dist/esm/types/properties/chartType/chartType.js.map +1 -1
  181. package/dist/esm/types/properties/config/config.d.ts +602 -0
  182. package/dist/esm/types/properties/config/config.js +4 -0
  183. package/dist/esm/types/properties/config/config.js.map +1 -1
  184. package/dist/esm/types/properties/config/hierarchySankey.d.ts +303 -0
  185. package/dist/esm/types/properties/config/hierarchySankey.js +18 -0
  186. package/dist/esm/types/properties/config/hierarchySankey.js.map +1 -0
  187. package/dist/esm/types/properties/config/index.d.ts +2 -0
  188. package/dist/esm/types/properties/config/index.js +2 -0
  189. package/dist/esm/types/properties/config/sankey.d.ts +303 -0
  190. package/dist/esm/types/properties/config/sankey.js +18 -0
  191. package/dist/esm/types/properties/config/sankey.js.map +1 -0
  192. package/dist/esm/types/properties/datasetReshapeInfo/datasetReshapeInfo.d.ts +2 -0
  193. package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.d.ts +4 -0
  194. package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.js +2 -0
  195. package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.js.map +1 -1
  196. package/dist/esm/types/properties/dimensions/index.d.ts +1 -0
  197. package/dist/esm/types/properties/dimensions/sankeyDimension.d.ts +15 -0
  198. package/dist/esm/types/properties/dimensions/sankeyDimension.js +0 -0
  199. package/dist/esm/types/properties/dimensions/zDimensions.d.ts +6 -0
  200. package/dist/esm/types/properties/encoding/dimensionEncoding.d.ts +3 -1
  201. package/dist/esm/types/properties/encoding/encoding.d.ts +8 -0
  202. package/dist/esm/types/properties/encoding/zDimensionEncoding.d.ts +4 -0
  203. package/dist/esm/types/properties/encoding/zDimensionEncoding.js +6 -2
  204. package/dist/esm/types/properties/encoding/zDimensionEncoding.js.map +1 -1
  205. package/dist/esm/types/properties/encoding/zEncoding.d.ts +4 -0
  206. package/dist/esm/types/properties/encoding/zEncoding.js +5 -1
  207. package/dist/esm/types/properties/encoding/zEncoding.js.map +1 -1
  208. package/dist/esm/types/properties/measures/index.d.ts +1 -0
  209. package/dist/esm/types/properties/measures/sankeyMeasure.d.ts +11 -0
  210. package/dist/esm/types/properties/measures/sankeyMeasure.js +0 -0
  211. package/dist/esm/types/properties/theme/customTheme.d.ts +3752 -2548
  212. package/dist/esm/types/vseed.d.ts +2 -2
  213. package/dist/esm/types/zVseed.js +3 -1
  214. package/dist/esm/types/zVseed.js.map +1 -1
  215. package/dist/umd/index.js +1309 -182
  216. package/dist/umd/index.js.map +1 -1
  217. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -995,9 +995,11 @@
995
995
  donutAdvancedPipeline: ()=>donutAdvancedPipeline,
996
996
  scatterAdvancedPipeline: ()=>scatterAdvancedPipeline,
997
997
  zLineConfig: ()=>zLineConfig,
998
- zScatter: ()=>zScatter,
998
+ zSankeyConfig: ()=>zSankeyConfig,
999
999
  FoldXMeasureValue: ()=>FoldXMeasureValue,
1000
+ zScatter: ()=>zScatter,
1000
1001
  zSelectors: ()=>zSelectors,
1002
+ SourceEncoding: ()=>SourceEncoding,
1001
1003
  pivotTableAdvancedPipeline: ()=>pivotTableAdvancedPipeline,
1002
1004
  zAnnotationAreaConfig: ()=>zAnnotationAreaConfig,
1003
1005
  selectByPartial: ()=>selectByPartial,
@@ -1013,6 +1015,7 @@
1013
1015
  findAllMeasures: ()=>findAllMeasures,
1014
1016
  zFunnelConfig: ()=>zFunnelConfig,
1015
1017
  zUnfoldInfo: ()=>zUnfoldInfo,
1018
+ hierarchySankeySpecPipeline: ()=>hierarchySankeySpecPipeline,
1016
1019
  registerColumnPercent: ()=>registerColumnPercent,
1017
1020
  zPivotTableConfig: ()=>zPivotTableConfig,
1018
1021
  registerRose: ()=>registerRose,
@@ -1038,6 +1041,7 @@
1038
1041
  zCustomThemeConfig: ()=>zCustomThemeConfig,
1039
1042
  zScatterAnimation: ()=>zScatterAnimation,
1040
1043
  zSunburstConfig: ()=>zSunburstConfig,
1044
+ zSankey: ()=>zSankey,
1041
1045
  zFieldSelector: ()=>zFieldSelector,
1042
1046
  zMeasureEncoding: ()=>zMeasureEncoding,
1043
1047
  raceLineSpecPipeline: ()=>raceLineSpecPipeline,
@@ -1116,6 +1120,7 @@
1116
1120
  columnSpecPipeline: ()=>columnSpecPipeline,
1117
1121
  isRectungularCoordinate: ()=>isRectungularCoordinate,
1118
1122
  BinCountMeasureId: ()=>BinCountMeasureId,
1123
+ isSankey: ()=>isSankey,
1119
1124
  pivotTableSpecPipeline: ()=>pivotTableSpecPipeline,
1120
1125
  registerRoseParallel: ()=>registerRoseParallel,
1121
1126
  terminateWorkerPool: ()=>terminateWorkerPool,
@@ -1152,6 +1157,7 @@
1152
1157
  registerColumnParallel: ()=>registerColumnParallel,
1153
1158
  zRaceScatter: ()=>zRaceScatter,
1154
1159
  zRowOrColumnTotalConfig: ()=>zRowOrColumnTotalConfig,
1160
+ isHierarchySankey: ()=>isHierarchySankey,
1155
1161
  isDimensionSelector: ()=>isDimensionSelector,
1156
1162
  isRowWithFieldDynamicFilter: ()=>isRowWithFieldDynamicFilter,
1157
1163
  BAND_AXIS_INNER_OFFSET_IN_PIVOT: ()=>2,
@@ -1243,6 +1249,7 @@
1243
1249
  checkVSeed: ()=>checkVSeed,
1244
1250
  zDimensionEncoding: ()=>zDimensionEncoding,
1245
1251
  zBodyCellStyle: ()=>zBodyCellStyle,
1252
+ sankeySpecPipeline: ()=>sankeySpecPipeline,
1246
1253
  barAdvancedPipeline: ()=>barAdvancedPipeline,
1247
1254
  zDifferenceSelector: ()=>zDifferenceSelector,
1248
1255
  zTreeMap: ()=>zTreeMap,
@@ -1262,16 +1269,16 @@
1262
1269
  raceBarAdvancedPipeline: ()=>raceBarAdvancedPipeline,
1263
1270
  Builder: ()=>Builder,
1264
1271
  tableAdvancedPipeline: ()=>tableAdvancedPipeline,
1265
- selectByValue: ()=>selectByValue,
1272
+ registerHierarchySankey: ()=>registerHierarchySankey,
1266
1273
  raceDonutSpecPipeline: ()=>raceDonutSpecPipeline,
1267
- zDimensionGroup: ()=>zDimensionGroup,
1274
+ selectByValue: ()=>selectByValue,
1268
1275
  MeasureId: ()=>MeasureId,
1269
1276
  registerBarParallel: ()=>registerBarParallel,
1270
1277
  zAnnotationVerticalLine: ()=>zAnnotationVerticalLine,
1271
- zMeasureTree: ()=>zMeasureTree,
1278
+ zDimensionGroup: ()=>zDimensionGroup,
1272
1279
  registerDonut: ()=>registerDonut,
1273
1280
  findTreeNodesBy: ()=>findTreeNodesBy,
1274
- zRadar: ()=>zRadar,
1281
+ zMeasureTree: ()=>zMeasureTree,
1275
1282
  registerBoxPlot: ()=>registerBoxPlot,
1276
1283
  sunburstSpecPipeline: ()=>sunburstSpecPipeline,
1277
1284
  zAnnotation: ()=>zAnnotation,
@@ -1279,31 +1286,34 @@
1279
1286
  ANNOTATION_Z_INDEX: ()=>1000,
1280
1287
  pieAdvancedPipeline: ()=>pieAdvancedPipeline,
1281
1288
  zColumnPercent: ()=>zColumnPercent,
1282
- zTable: ()=>zTable,
1289
+ zRadar: ()=>zRadar,
1283
1290
  createFormatter: ()=>createFormatter,
1284
- zTotalType: ()=>zTotalType,
1291
+ zTable: ()=>zTable,
1285
1292
  columnPercentSpecPipeline: ()=>columnPercentSpecPipeline,
1286
1293
  racePieSpecPipeline: ()=>racePieSpecPipeline,
1287
1294
  a: ()=>i18n_a,
1288
1295
  zSelector: ()=>zSelector,
1289
- zXBandAxis: ()=>zXBandAxis,
1296
+ zTotalType: ()=>zTotalType,
1290
1297
  registerHeatmap: ()=>registerHeatmap,
1298
+ zXBandAxis: ()=>zXBandAxis,
1291
1299
  zMeasures: ()=>zMeasures,
1292
1300
  zLine: ()=>zLine,
1293
1301
  FoldMeasureName: ()=>FoldMeasureName,
1294
1302
  zPage: ()=>zPage,
1295
1303
  zRaceDonut: ()=>zRaceDonut,
1296
1304
  pieSpecPipeline: ()=>pieSpecPipeline,
1297
- zBarGapInGroup: ()=>zBarGapInGroup,
1305
+ registerSankey: ()=>registerSankey,
1298
1306
  barPercentSpecPipeline: ()=>barPercentSpecPipeline,
1307
+ zBarGapInGroup: ()=>zBarGapInGroup,
1299
1308
  zColumnParallel: ()=>zColumnParallel,
1300
1309
  zDatasetReshapeInfo: ()=>zDatasetReshapeInfo,
1301
1310
  zAnalysis: ()=>zAnalysis,
1302
1311
  heatmapSpecPipeline: ()=>heatmapSpecPipeline,
1303
1312
  isPivot: ()=>chatType_isPivot,
1304
1313
  raceBarSpecPipeline: ()=>raceBarSpecPipeline,
1305
- registerColumn: ()=>registerColumn,
1314
+ hierarchySankeyAdvancedPipeline: ()=>hierarchySankeyAdvancedPipeline,
1306
1315
  updateAdvanced: ()=>updateAdvanced,
1316
+ registerColumn: ()=>registerColumn,
1307
1317
  zPlayer: ()=>zPlayer,
1308
1318
  zDimensionLinkage: ()=>zDimensionLinkage,
1309
1319
  preorderTraverse: ()=>preorderTraverse,
@@ -1321,7 +1331,9 @@
1321
1331
  zColumn: ()=>zColumn,
1322
1332
  PlayerEncoding: ()=>PlayerEncoding,
1323
1333
  radarAdvancedPipeline: ()=>radarAdvancedPipeline,
1334
+ TargetEncoding: ()=>TargetEncoding,
1324
1335
  zBarParallelConfig: ()=>zBarParallelConfig,
1336
+ zHierarchySankeyConfig: ()=>zHierarchySankeyConfig,
1325
1337
  zAnnotationConfig: ()=>zAnnotationConfig,
1326
1338
  selectorWithDynamicFilter: ()=>selectorWithDynamicFilter,
1327
1339
  registerCustomTheme: ()=>registerCustomTheme,
@@ -1349,11 +1361,13 @@
1349
1361
  isBarLikeChart: ()=>isBarLikeChart,
1350
1362
  columnParallelAdvancedPipeline: ()=>columnParallelAdvancedPipeline,
1351
1363
  deleteDimensionTreeByCallback: ()=>deleteDimensionTreeByCallback,
1364
+ sankeyAdvancedPipeline: ()=>sankeyAdvancedPipeline,
1352
1365
  zBarConfig: ()=>zBarConfig,
1353
1366
  zChartDynamicFilter: ()=>zChartDynamicFilter,
1354
1367
  zNumFormat: ()=>zNumFormat,
1355
1368
  zPieLabel: ()=>zPieLabel,
1356
1369
  zStackCornerRadius: ()=>zStackCornerRadius,
1370
+ zHierarchySankey: ()=>zHierarchySankey,
1357
1371
  zDualAxisConfig: ()=>zDualAxisConfig,
1358
1372
  columnPercentAdvancedPipeline: ()=>columnPercentAdvancedPipeline,
1359
1373
  barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
@@ -1537,6 +1551,8 @@
1537
1551
  const ColorEncoding = '__Dim_Color__';
1538
1552
  const ColorIdEncoding = '__Dim_ColorId__';
1539
1553
  const HierarchyEncoding = '__Dim_Hierarchy__';
1554
+ const SourceEncoding = '__Dim_Source__';
1555
+ const TargetEncoding = '__Dim_Target__';
1540
1556
  const BoxPlotPivotIndicator = '__BoxPlot_Pivot_Indicator__';
1541
1557
  const LowerWhisker = '__Lower_Whisker__';
1542
1558
  const UpperWhisker = '__Upper_Whisker__';
@@ -3134,6 +3150,8 @@ self.R = R;
3134
3150
  Donut: 'donut',
3135
3151
  Radar: 'radar',
3136
3152
  CirclePacking: 'circlePacking',
3153
+ Sankey: 'sankey',
3154
+ HierarchySankey: 'hierarchySankey',
3137
3155
  Sunburst: 'sunburst',
3138
3156
  TreeMap: 'treeMap',
3139
3157
  RaceBar: 'raceBar',
@@ -3153,7 +3171,7 @@ self.R = R;
3153
3171
  const isMeasures = (measures)=>measures.every(isMeasure);
3154
3172
  const isPositionMeasure = (measure, chartType)=>{
3155
3173
  if (!measure.encoding) return true;
3156
- if (ChartTypeEnum.Funnel === chartType || ChartTypeEnum.CirclePacking === chartType || ChartTypeEnum.Sunburst === chartType || ChartTypeEnum.TreeMap === chartType) return 'size' === measure.encoding;
3174
+ if (ChartTypeEnum.Funnel === chartType || ChartTypeEnum.CirclePacking === chartType || ChartTypeEnum.Sankey === chartType || ChartTypeEnum.HierarchySankey === chartType || ChartTypeEnum.Sunburst === chartType || ChartTypeEnum.TreeMap === chartType) return 'size' === measure.encoding;
3157
3175
  if (chartType === ChartTypeEnum.Heatmap) return 'color' === measure.encoding;
3158
3176
  if ([
3159
3177
  ChartTypeEnum.Pie,
@@ -3202,6 +3220,8 @@ self.R = R;
3202
3220
  const isAreaPercent = (vseed)=>vseed.chartType === ChartTypeEnum.AreaPercent;
3203
3221
  const isColumnPercent = (vseed)=>vseed.chartType === ChartTypeEnum.ColumnPercent;
3204
3222
  const isBarPercent = (vseed)=>vseed.chartType === ChartTypeEnum.BarPercent;
3223
+ const isSankey = (vseed)=>vseed.chartType === ChartTypeEnum.Sankey;
3224
+ const isHierarchySankey = (vseed)=>vseed.chartType === ChartTypeEnum.HierarchySankey;
3205
3225
  const isBarLikeChart = (vseed)=>vseed.chartType === ChartTypeEnum.Bar || vseed.chartType === ChartTypeEnum.RaceBar || vseed.chartType === ChartTypeEnum.BarPercent || vseed.chartType === ChartTypeEnum.BarParallel;
3206
3226
  const isVTable = (vseed)=>[
3207
3227
  'table',
@@ -5439,10 +5459,12 @@ self.R = R;
5439
5459
  encodingColorId: ColorIdEncoding,
5440
5460
  encodingPlayer: PlayerEncoding,
5441
5461
  encodingHierarchy: HierarchyEncoding,
5462
+ encodingSource: SourceEncoding,
5463
+ encodingTarget: TargetEncoding,
5442
5464
  colorItems: [],
5443
5465
  colorIdMap: {}
5444
5466
  };
5445
- const { color, x, y, detail, angle, player, hierarchy } = encoding;
5467
+ const { color, x, y, detail, angle, player, hierarchy, source, target } = encoding;
5446
5468
  const angleDimensions = angle ? dimensions.filter((dim)=>angle.includes(dim.id)) : [];
5447
5469
  const xDimensions = x ? dimensions.filter((dim)=>x.includes(dim.id)) : [];
5448
5470
  const yDimensions = y ? dimensions.filter((dim)=>y.includes(dim.id)) : [];
@@ -5450,6 +5472,8 @@ self.R = R;
5450
5472
  const detailDimensions = detail ? dimensions.filter((dim)=>detail.includes(dim.id)) : [];
5451
5473
  const playerDimensions = player ? dimensions.filter((dim)=>player.includes(dim.id)) : [];
5452
5474
  const hierarchyDimensions = hierarchy ? dimensions.filter((dim)=>hierarchy.includes(dim.id)) : [];
5475
+ const sourceDimensions = source ? dimensions.filter((dim)=>source.includes(dim.id)) : [];
5476
+ const targetDimensions = target ? dimensions.filter((dim)=>target.includes(dim.id)) : [];
5453
5477
  const colorItems = new Set();
5454
5478
  const colorIdMap = {};
5455
5479
  for(let i = 0; i < dataset.length; i++){
@@ -5461,6 +5485,8 @@ self.R = R;
5461
5485
  applyEncoding(DetailEncoding, detailDimensions, datum, separator);
5462
5486
  applyEncoding(PlayerEncoding, playerDimensions, datum, separator);
5463
5487
  applyEncoding(HierarchyEncoding, hierarchyDimensions, datum, separator);
5488
+ applyEncoding(SourceEncoding, sourceDimensions, datum, separator);
5489
+ applyEncoding(TargetEncoding, targetDimensions, datum, separator);
5464
5490
  if (!colorDimensions.length || !datum[ColorEncoding]) continue;
5465
5491
  const colorId = String(datum[ColorEncoding] ?? '');
5466
5492
  datum[ColorIdEncoding] = colorId;
@@ -13017,7 +13043,7 @@ self.R = R;
13017
13043
  const { advancedVSeed } = context;
13018
13044
  const { chartType } = advancedVSeed;
13019
13045
  const baseConfig = advancedVSeed.config[chartType];
13020
- if (!baseConfig || !baseConfig.legend) return result;
13046
+ if (!baseConfig || !baseConfig.legend || !baseConfig.color) return result;
13021
13047
  const { datasetReshapeInfo } = advancedVSeed;
13022
13048
  const colorItems = chunk_QJLMYOTX_i(datasetReshapeInfo.flatMap((d)=>d.unfoldInfo.colorItems));
13023
13049
  const colorIdMap = datasetReshapeInfo.reduce((prev, cur)=>({
@@ -13133,7 +13159,7 @@ self.R = R;
13133
13159
  const { advancedVSeed } = context;
13134
13160
  const { chartType } = advancedVSeed;
13135
13161
  const baseConfig = advancedVSeed.config[chartType];
13136
- if (!baseConfig || !baseConfig.legend) return result;
13162
+ if (!baseConfig || !baseConfig.legend || !baseConfig.color) return result;
13137
13163
  const { datasetReshapeInfo } = advancedVSeed;
13138
13164
  const max = Math.max(...datasetReshapeInfo.map((d)=>d.foldInfo.statistics.colorMax));
13139
13165
  const min = Math.min(...datasetReshapeInfo.map((d)=>d.foldInfo.statistics.colorMin));
@@ -19172,6 +19198,10 @@ self.R = R;
19172
19198
  }), match || (result[k] = v);
19173
19199
  }), result;
19174
19200
  }
19201
+ const getSeriesMeasureIds = (context, seriesIndex)=>{
19202
+ const foldInfo = context.advancedVSeed.datasetReshapeInfo?.[0]?.foldInfoList?.[seriesIndex];
19203
+ return Object.keys(foldInfo?.foldMap ?? {});
19204
+ };
19175
19205
  const annotationPointOfDualAxis = generateAnnotationPointPipe({
19176
19206
  findSelectedDatas: (options)=>{
19177
19207
  const { dataset, selector: s, measureId, dynamicFilter, context } = options;
@@ -19187,10 +19217,15 @@ self.R = R;
19187
19217
  generateMarkPoint: (datum, spec, context)=>{
19188
19218
  const { advancedVSeed } = context;
19189
19219
  const allMeasureIds = flatReshapeMeasures(advancedVSeed.reshapeMeasures ?? []).map((m)=>m.id);
19190
- return spec.series?.map((s, index)=>({
19220
+ const selectedMeasureId = datum[MeasureId];
19221
+ return spec.series?.flatMap((_series, index)=>{
19222
+ const seriesMeasureIds = getSeriesMeasureIds(context, index);
19223
+ if (selectedMeasureId && seriesMeasureIds.length && !seriesMeasureIds.includes(String(selectedMeasureId))) return [];
19224
+ return {
19191
19225
  relativeSeriesIndex: index,
19192
19226
  coordinate: (data)=>data.find((item)=>isSubset(datum, item, allMeasureIds.filter((id)=>id !== item[MeasureId])))
19193
- }));
19227
+ };
19228
+ });
19194
19229
  }
19195
19230
  });
19196
19231
  const dualAxis = [
@@ -22914,7 +22949,7 @@ self.R = R;
22914
22949
  const { datasetReshapeInfo } = advancedVSeed;
22915
22950
  const { foldInfo } = datasetReshapeInfo[0];
22916
22951
  result.type = 'treemap';
22917
- result.categoryField = 'name';
22952
+ result.categoryField = 'key';
22918
22953
  result.valueField = foldInfo.measureValue;
22919
22954
  result.padding = 0;
22920
22955
  result.animationEnter = {
@@ -22977,10 +23012,13 @@ self.R = R;
22977
23012
  for(let i = 0; i < hierarchyFields.length; i++){
22978
23013
  const field = hierarchyFields[i];
22979
23014
  const value = String(datum[field]);
22980
- let child = currentNode.children.find((c)=>c.name === value);
23015
+ const nodeName = field === measureId && measureName && void 0 !== datum[measureName] ? String(datum[measureName]) : value;
23016
+ let child = currentNode.children.find((c)=>String(c[field]) === value);
22981
23017
  if (!child) {
22982
23018
  child = {
22983
- name: value,
23019
+ name: nodeName,
23020
+ key: value,
23021
+ field,
22984
23022
  children: []
22985
23023
  };
22986
23024
  for(let j = 0; j <= i; j++)child[hierarchyFields[j]] = datum[hierarchyFields[j]];
@@ -23067,14 +23105,14 @@ self.R = R;
23067
23105
  });
23068
23106
  const percentFormatter = createFormatter(percentFormat);
23069
23107
  if (result.label) result.label.formatMethod = (_, datum)=>{
23070
- const nodeName = datum.name;
23108
+ const nodeName = datum.value;
23071
23109
  const dataArray = datum.datum;
23072
23110
  if (!dataArray || !Array.isArray(dataArray)) return '';
23073
- const findDataNode = (nodes, name)=>{
23111
+ const findDataNode = (nodes, value)=>{
23074
23112
  for (const node of nodes){
23075
- if (node.name === name) return node;
23113
+ if (node.value === value) return node;
23076
23114
  if (node.children) {
23077
- const found = findDataNode(node.children, name);
23115
+ const found = findDataNode(node.children, value);
23078
23116
  if (found) return found;
23079
23117
  }
23080
23118
  }
@@ -23405,7 +23443,7 @@ self.R = R;
23405
23443
  const { datasetReshapeInfo, encoding } = advancedVSeed;
23406
23444
  const { foldInfo } = datasetReshapeInfo[0];
23407
23445
  result.type = 'sunburst';
23408
- result.categoryField = 'name';
23446
+ result.categoryField = 'key';
23409
23447
  result.valueField = foldInfo.measureValue;
23410
23448
  result.outerRadius = 1;
23411
23449
  result.innerRadius = 0;
@@ -23650,7 +23688,7 @@ self.R = R;
23650
23688
  const { datasetReshapeInfo } = advancedVSeed;
23651
23689
  const { foldInfo } = datasetReshapeInfo[0];
23652
23690
  result.type = 'circlePacking';
23653
- result.categoryField = 'name';
23691
+ result.categoryField = 'key';
23654
23692
  result.valueField = foldInfo.measureValue;
23655
23693
  result.circlePacking = {
23656
23694
  style: {
@@ -23746,164 +23784,1183 @@ self.R = R;
23746
23784
  Builder.registerAdvancedPipeline('circlePacking', circlePackingAdvancedPipeline);
23747
23785
  Builder.registerSpecPipeline('circlePacking', circlePackingSpecPipeline);
23748
23786
  };
23749
- const getDefaultTableConfig = ()=>({
23750
- bodyFontSize: 12,
23751
- bodyBackgroundColor: 'transparent',
23752
- headerFontSize: 12,
23753
- barHeight: '100%',
23754
- barMarkInBar: false,
23755
- barMarkWidth: 2,
23756
- barPadding: [
23757
- '25%',
23758
- 10
23759
- ],
23760
- barRightToLeft: false,
23761
- barPositiveColor: 'rgba(188,220,194, 0.5)',
23762
- barNegativeColor: 'rgba(241,188,191, 0.5)',
23763
- backgroundColorScale: {
23764
- minColor: '#D8CFFF',
23765
- maxColor: '#6B4FD7'
23787
+ const hierarchySankeyConfig = (advancedVSeed, context)=>{
23788
+ const { vseed } = context;
23789
+ const { chartType } = vseed;
23790
+ const result = {
23791
+ ...advancedVSeed
23792
+ };
23793
+ const pickedConfig = chunk_2T7K3PFL_i(vseed, [
23794
+ 'backgroundColor',
23795
+ 'color',
23796
+ 'label',
23797
+ 'legend',
23798
+ 'tooltip'
23799
+ ]);
23800
+ const config = replaceNullToUndefined(pickedConfig);
23801
+ result.config = {
23802
+ ...result.config,
23803
+ [chartType]: {
23804
+ ...config
23766
23805
  }
23767
- });
23768
- const getLightTableConfig = ()=>({
23769
- ...getDefaultTableConfig(),
23770
- borderColor: '#e3e5eb',
23771
- bodyFontColor: '#141414',
23772
- headerFontColor: '#21252c',
23773
- headerBackgroundColor: '#f6f7f9',
23774
- hoverBodyBackgroundColor: '#bedaff',
23775
- hoverBodyInlineBackgroundColor: '#bedaff33',
23776
- hoverHeaderBackgroundColor: '#D9DDE4',
23777
- hoverHeaderInlineBackgroundColor: '#D9DDE455',
23778
- selectedBorderColor: '#4080ff',
23779
- selectedBackgroundColor: '#bedaff33',
23780
- backgroundColor: 'transparent',
23781
- barAxisColor: '#9EAFC6'
23782
- });
23783
- const getDarkTableConfig = ()=>({
23784
- ...getDefaultTableConfig(),
23785
- borderColor: '#4b4e53',
23786
- bodyFontColor: '#fdfdfd',
23787
- headerFontColor: '#fdfdfd',
23788
- headerBackgroundColor: '#36393e',
23789
- hoverBodyBackgroundColor: '#4284ff66',
23790
- hoverBodyInlineBackgroundColor: '#4284ff10',
23791
- hoverHeaderBackgroundColor: '#6f7984cc',
23792
- hoverHeaderInlineBackgroundColor: '#4b4f54',
23793
- selectedBorderColor: '#3073f2',
23794
- selectedBackgroundColor: '#4284ff33',
23795
- barAxisColor: '#9EAFC6'
23796
- });
23797
- const pickPivotChartGridConfig = (tableConfig)=>({
23798
- outlineBorderLineWidth: 0,
23799
- frameCornerRadius: 0,
23800
- borderColor: tableConfig.borderColor,
23801
- bodyFontColor: tableConfig.bodyFontColor,
23802
- headerFontColor: tableConfig.headerFontColor,
23803
- headerBackgroundColor: 'transparent',
23804
- hoverHeaderBackgroundColor: tableConfig.hoverHeaderBackgroundColor,
23805
- hoverHeaderInlineBackgroundColor: tableConfig.hoverHeaderInlineBackgroundColor,
23806
- titleFontColor: tableConfig.headerFontColor,
23807
- titleFontSize: tableConfig.headerFontSize,
23808
- titleFontWeight: 'bold'
23809
- });
23810
- const getLightPivotChartGridConfig = ()=>{
23811
- const res = pickPivotChartGridConfig(getLightTableConfig());
23812
- res.hoverHeaderInlineBackgroundColor = '#D9DDE446';
23813
- res.chartGridColor = '#F0F1F6';
23814
- res.axisLabelColor = '#BCC1CB';
23815
- return res;
23806
+ };
23807
+ return result;
23816
23808
  };
23817
- const getDarkPivotChartGridConfig = ()=>{
23818
- const res = pickPivotChartGridConfig(getDarkTableConfig());
23819
- res.hoverHeaderInlineBackgroundColor = '#4b4f5446';
23820
- return res;
23809
+ const hierarchySankeyAdvancedPipeline = [
23810
+ page_page_page,
23811
+ initAdvancedVSeed_initAdvancedVSeed,
23812
+ default_defaultMeasures_defaultMeasures,
23813
+ defaultDimensions_defaultDimensions,
23814
+ defaultMeasureId,
23815
+ encodingAdapter([
23816
+ buildMeasures([
23817
+ 'size',
23818
+ 'detail'
23819
+ ]),
23820
+ defaultEncodingForHierarchy
23821
+ ], [
23822
+ buildMeasures([
23823
+ 'size',
23824
+ 'detail'
23825
+ ]),
23826
+ encodingForHierarchy,
23827
+ pickDimensionsForReshape
23828
+ ]),
23829
+ pivotAdapter([
23830
+ reshapeWithEncoding
23831
+ ], [
23832
+ pivotReshapeWithEncoding
23833
+ ]),
23834
+ hierarchySankeyConfig,
23835
+ theme_theme,
23836
+ annotation_annotation
23837
+ ];
23838
+ const initHierarchySankey = (spec, context)=>{
23839
+ const result = {
23840
+ ...spec
23841
+ };
23842
+ const { advancedVSeed } = context;
23843
+ const { datasetReshapeInfo } = advancedVSeed;
23844
+ const { foldInfo } = datasetReshapeInfo[0];
23845
+ result.type = 'sankey';
23846
+ result.nodeKey = (datum)=>datum?.key;
23847
+ result.categoryField = 'key';
23848
+ result.valueField = foldInfo.measureValue;
23849
+ result.nodeAlign = 'justify';
23850
+ result.nodeGap = 8;
23851
+ result.nodeWidth = 12;
23852
+ result.minNodeHeight = 4;
23853
+ result.iterations = 0;
23854
+ result.padding = {
23855
+ top: 0,
23856
+ left: 2,
23857
+ bottom: 0,
23858
+ right: 2
23859
+ };
23860
+ result.link = {
23861
+ style: {
23862
+ pathType: 'smooth'
23863
+ }
23864
+ };
23865
+ return result;
23821
23866
  };
23822
- const getDarkCrosshairLine = ()=>({
23823
- visible: true,
23824
- labelVisible: true,
23825
- labelColor: '#ffffff',
23826
- labelBackgroundColor: '#404349',
23827
- lineColor: '#55595F'
23828
- });
23829
- const getDarkCrosshairRect = ()=>({
23830
- visible: true,
23831
- labelVisible: true,
23832
- labelColor: '#ffffff',
23833
- labelBackgroundColor: '#404349',
23834
- rectColor: '#4B4F54'
23835
- });
23836
- const getLightCrosshairLine = ()=>({
23837
- visible: true,
23838
- labelVisible: true,
23839
- labelColor: '#ffffff',
23840
- labelBackgroundColor: '#21252C',
23841
- lineColor: '#21252C'
23842
- });
23843
- const getLightCrosshairRect = ()=>({
23844
- visible: true,
23845
- labelVisible: true,
23846
- labelColor: '#ffffff',
23847
- labelBackgroundColor: '#364159',
23848
- rectColor: '#D9DDE4'
23849
- });
23850
- const getLightColorScheme = ()=>[
23851
- '#8D72F6',
23852
- '#5766EC',
23853
- '#66A3FE',
23854
- '#51D5E6',
23855
- '#4EC0B3',
23856
- '#F9DF90',
23857
- '#F9AD71',
23858
- '#ED8888',
23859
- '#E9A0C3',
23860
- '#D77DD3'
23861
- ];
23862
- const getDarkColorScheme = ()=>[
23863
- '#2E62F1',
23864
- '#4DC36A',
23865
- '#FF8406',
23866
- '#FFCC00',
23867
- '#4F44CF',
23868
- '#5AC8FA',
23869
- '#003A8C',
23870
- '#B08AE2',
23871
- '#FF6341',
23872
- '#98DD62'
23873
- ];
23874
- const getLightLinearColorScheme = ()=>[
23875
- '#C2CEFF',
23876
- '#5766EC'
23877
- ];
23878
- const getDarkLinearColorScheme = ()=>[
23879
- '#A0CEFF',
23880
- '#2E62F1'
23867
+ const datasetHierarchySankey = (spec, context)=>{
23868
+ const result = {
23869
+ ...spec
23870
+ };
23871
+ const { advancedVSeed } = context;
23872
+ const { dataset, datasetReshapeInfo, measures } = advancedVSeed;
23873
+ const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
23874
+ const hierarchyFields = advancedVSeed.encoding?.hierarchy || [];
23875
+ const measureKeys = findAllMeasures(measures).map((m)=>m.id);
23876
+ const nodes = buildHierarchySankeyNodes(dataset, hierarchyFields, foldInfo, unfoldInfo, measureKeys);
23877
+ result.data = [
23878
+ {
23879
+ id: 'data',
23880
+ values: [
23881
+ {
23882
+ nodes
23883
+ }
23884
+ ]
23885
+ }
23881
23886
  ];
23882
- const getLightColor = ()=>({
23883
- linearColorScheme: getLightLinearColorScheme(),
23884
- colorScheme: getLightColorScheme(),
23885
- positiveColor: '#7E5DFF',
23886
- negativeColor: '#EB3373'
23887
- });
23888
- const getDarkColor = ()=>({
23889
- linearColorScheme: getDarkLinearColorScheme(),
23890
- colorScheme: getDarkColorScheme(),
23891
- positiveColor: '#7E5DFF',
23892
- negativeColor: '#EB3373'
23893
- });
23894
- const getDefaultLabel = ()=>({
23895
- enable: true,
23896
- wrap: true,
23897
- showValue: true,
23898
- showValuePercent: false,
23899
- labelColorSmartInvert: false,
23900
- labelOverlap: true
23901
- });
23902
- const getDarkLabel = ()=>({
23903
- ...getDefaultLabel(),
23904
- labelStroke: '#21252C'
23905
- });
23906
- const getLightLabel = ()=>({
23887
+ return result;
23888
+ };
23889
+ const buildHierarchySankeyNodes = (dataset, hierarchyFields, foldInfo, unfoldInfo, measureKeys)=>{
23890
+ if (!hierarchyFields.length) return dataset;
23891
+ const { measureValue, measureId, measureName } = foldInfo;
23892
+ const { encodingColor, encodingColorId } = unfoldInfo;
23893
+ const collectFields = [
23894
+ measureId,
23895
+ measureName,
23896
+ encodingColor,
23897
+ encodingColorId
23898
+ ].filter(Boolean);
23899
+ const root = {
23900
+ name: 'root',
23901
+ children: []
23902
+ };
23903
+ dataset.forEach((datum)=>{
23904
+ let currentNode = root;
23905
+ for(let i = 0; i < hierarchyFields.length; i++){
23906
+ const field = hierarchyFields[i];
23907
+ const value = String(datum[field]);
23908
+ const nodeName = field === measureId && measureName && void 0 !== datum[measureName] ? String(datum[measureName]) : value;
23909
+ let child = currentNode.children.find((c)=>c.name === nodeName);
23910
+ if (!child) {
23911
+ const pathValues = hierarchyFields.slice(0, i + 1).map((key)=>String(datum[key]));
23912
+ child = {
23913
+ field: field,
23914
+ key: nodeName,
23915
+ name: nodeName,
23916
+ color: nodeName,
23917
+ path: pathValues.join("-"),
23918
+ children: []
23919
+ };
23920
+ for(let j = 0; j <= i; j++)child[hierarchyFields[j]] = datum[hierarchyFields[j]];
23921
+ currentNode.children.push(child);
23922
+ }
23923
+ currentNode = child;
23924
+ }
23925
+ if (!currentNode.isLeaf) {
23926
+ Object.assign(currentNode, datum);
23927
+ currentNode.isLeaf = true;
23928
+ if (measureValue) currentNode[measureValue] = 0;
23929
+ measureKeys.forEach((key)=>{
23930
+ currentNode[key] = 0;
23931
+ });
23932
+ collectFields.forEach((field)=>{
23933
+ currentNode[`_set_${field}`] = new Set();
23934
+ });
23935
+ }
23936
+ if (measureValue && void 0 !== datum[measureValue]) currentNode[measureValue] += Number(datum[measureValue]);
23937
+ measureKeys.forEach((key)=>{
23938
+ if (void 0 !== datum[key]) currentNode[key] = (currentNode[key] || 0) + Number(datum[key]);
23939
+ });
23940
+ collectFields.forEach((field)=>{
23941
+ if (datum[field]) currentNode[`_set_${field}`].add(datum[field]);
23942
+ });
23943
+ if (measureValue) currentNode.value = currentNode[measureValue];
23944
+ });
23945
+ const flattenSets = (node)=>{
23946
+ collectFields.forEach((field)=>{
23947
+ const setKey = `_set_${field}`;
23948
+ if (node[setKey]) {
23949
+ node[field] = Array.from(node[setKey]).join('+');
23950
+ delete node[setKey];
23951
+ }
23952
+ });
23953
+ };
23954
+ const mergeCollectFieldsFromChildren = (node)=>{
23955
+ collectFields.forEach((field)=>{
23956
+ const merged = new Set();
23957
+ node.children.forEach((child)=>{
23958
+ if (child[field]) child[field].split('+').forEach((v)=>merged.add(v));
23959
+ });
23960
+ if (merged.size > 0) node[field] = Array.from(merged).join('+');
23961
+ });
23962
+ };
23963
+ const aggregate = (node)=>{
23964
+ if (node.isLeaf) {
23965
+ flattenSets(node);
23966
+ node.outDegree = 0;
23967
+ return node.value || 0;
23968
+ }
23969
+ if (!node.children?.length) {
23970
+ node.outDegree = 0;
23971
+ return node.value || 0;
23972
+ }
23973
+ let sum = 0;
23974
+ node.children.forEach((child)=>{
23975
+ sum += aggregate(child);
23976
+ measureKeys.forEach((key)=>{
23977
+ node[key] = (node[key] || 0) + (child[key] || 0);
23978
+ });
23979
+ });
23980
+ node.value = sum;
23981
+ if (measureValue) node[measureValue] = sum;
23982
+ node.outDegree = node.children.length;
23983
+ mergeCollectFieldsFromChildren(node);
23984
+ return sum;
23985
+ };
23986
+ const fillInDegree = (node, parent)=>{
23987
+ node.inDegree = parent ? 1 : 0;
23988
+ node.children?.forEach((child)=>fillInDegree(child, node));
23989
+ };
23990
+ root.children.forEach(aggregate);
23991
+ root.children.forEach((child)=>fillInDegree(child));
23992
+ return root.children;
23993
+ };
23994
+ const getHierarchySankeyNodesFromSpec = (spec, fallback = [])=>{
23995
+ const nodes = spec.data?.[0]?.values?.[0]?.nodes;
23996
+ return Array.isArray(nodes) ? nodes : fallback;
23997
+ };
23998
+ const tooltipHierarchySankey = (spec, context)=>{
23999
+ const result = tooltip_tooltip()(spec, context);
24000
+ const { advancedVSeed, vseed } = context;
24001
+ const { datasetReshapeInfo, dimensions = [], encoding, dataset = [] } = advancedVSeed;
24002
+ const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
24003
+ const hierarchyDataset = getHierarchySankeyNodesFromSpec(result, dataset);
24004
+ if (result.tooltip) result.tooltip.mark = {
24005
+ title: {
24006
+ visible: true,
24007
+ value: (value)=>createTitle(value, dimensions, hierarchyDataset, advancedVSeed.locale)
24008
+ },
24009
+ content: tooltipHierarchySankey_createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, hierarchyDataset, foldInfo, unfoldInfo, advancedVSeed.locale)
24010
+ };
24011
+ return result;
24012
+ };
24013
+ const flattenHierarchyNodes = (nodes = [], depth = 0)=>nodes.flatMap((node)=>[
24014
+ {
24015
+ datum: node,
24016
+ depth
24017
+ },
24018
+ ...flattenHierarchyNodes(node.children || [], depth + 1)
24019
+ ]);
24020
+ const createNodeMetaMap = (dataset = [])=>flattenHierarchyNodes(dataset).reduce((prev, item)=>{
24021
+ const key = String(item.datum.key ?? '');
24022
+ if (key) prev[key] = item;
24023
+ return prev;
24024
+ }, {});
24025
+ const isLinkDatum = (value)=>{
24026
+ const datum = value;
24027
+ return !!datum && void 0 !== datum.source && void 0 !== datum.target;
24028
+ };
24029
+ const getHierarchyPath = (value)=>{
24030
+ const datum = value;
24031
+ if (!datum) return [];
24032
+ if (Array.isArray(datum.datum)) return datum.datum;
24033
+ if (datum.datum && Array.isArray(datum.datum.datum)) return datum.datum.datum;
24034
+ if (datum.datum && 'object' == typeof datum.datum) return [
24035
+ datum.datum
24036
+ ];
24037
+ return [
24038
+ datum
24039
+ ];
24040
+ };
24041
+ const getHierarchyDatum = (value)=>{
24042
+ const path = getHierarchyPath(value);
24043
+ if (!path.length) return;
24044
+ const datum = value;
24045
+ if ('number' == typeof datum?.depth && path[datum.depth]) return path[datum.depth];
24046
+ return path[path.length - 1];
24047
+ };
24048
+ const createTitle = (value, dimensions = [], dataset = [], locale)=>{
24049
+ if (isLinkDatum(value)) {
24050
+ const nodeMetaMap = createNodeMetaMap(dataset);
24051
+ const datum = value;
24052
+ const source = nodeMetaMap[String(datum.source ?? '')]?.datum;
24053
+ const target = nodeMetaMap[String(datum.target ?? '')]?.datum;
24054
+ return [
24055
+ source?.name,
24056
+ target?.name
24057
+ ].filter(Boolean).join(' -> ');
24058
+ }
24059
+ const path = getHierarchyPath(value);
24060
+ if (!path.length) return '';
24061
+ return path.map((item, index)=>{
24062
+ const dim = dimensions[index];
24063
+ const formatter = createFormatterByDimension(dim, locale);
24064
+ return formatter(String(item?.name ?? ''));
24065
+ }).join(' / ');
24066
+ };
24067
+ const tooltipHierarchySankey_createMarkContent = (tooltip, dimensions = [], measures = [], dataset = [], foldInfo, _unfoldInfo, locale)=>{
24068
+ const nodeMetaMap = createNodeMetaMap(dataset);
24069
+ const dims = C(dimensions.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias));
24070
+ const meas = C(measures.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias));
24071
+ const dimContent = dims.map((item)=>({
24072
+ visible: (value)=>{
24073
+ if (isLinkDatum(value)) return false;
24074
+ const datum = getHierarchyDatum(value);
24075
+ return datum?.[item.id] !== void 0 && datum?.[item.id] !== null;
24076
+ },
24077
+ hasShape: true,
24078
+ shapeType: 'rectRound',
24079
+ key: item.alias || item.id,
24080
+ value: (value)=>{
24081
+ const datum = getHierarchyDatum(value);
24082
+ const formatter = createFormatterByDimension(item, locale);
24083
+ return datum ? formatter(datum[item.id]) : '';
24084
+ }
24085
+ }));
24086
+ const measureContent = meas.map((item)=>({
24087
+ visible: (value)=>!isLinkDatum(value),
24088
+ hasShape: true,
24089
+ shapeType: 'rectRound',
24090
+ key: item.alias || item.id,
24091
+ value: (value)=>{
24092
+ const datum = getHierarchyDatum(value);
24093
+ if (!datum) return '';
24094
+ const measure = findMeasureById(measures, item.id);
24095
+ const formatter = createFormatterByMeasure(measure);
24096
+ const measureValue = datum[item.id] ?? datum[foldInfo.measureValue];
24097
+ return formatter(measureValue);
24098
+ }
24099
+ }));
24100
+ const linkDimensionContent = dims.map((item)=>({
24101
+ visible: (value)=>{
24102
+ if (!isLinkDatum(value)) return false;
24103
+ const datum = value;
24104
+ const sourceMeta = nodeMetaMap[String(datum.source ?? '')];
24105
+ const targetMeta = nodeMetaMap[String(datum.target ?? '')];
24106
+ return sourceMeta?.datum?.[item.id] !== void 0 || targetMeta?.datum?.[item.id] !== void 0;
24107
+ },
24108
+ hasShape: true,
24109
+ shapeType: 'rectRound',
24110
+ key: item.alias || item.id,
24111
+ value: (value)=>{
24112
+ const datum = value;
24113
+ const sourceMeta = nodeMetaMap[String(datum.source ?? '')];
24114
+ const targetMeta = nodeMetaMap[String(datum.target ?? '')];
24115
+ const matchedNode = sourceMeta?.depth !== void 0 && dimensions[sourceMeta.depth]?.id === item.id ? sourceMeta.datum : targetMeta?.depth !== void 0 && dimensions[targetMeta.depth]?.id === item.id ? targetMeta.datum : sourceMeta?.datum?.[item.id] !== void 0 ? sourceMeta.datum : targetMeta?.datum;
24116
+ const formatter = createFormatterByDimension(item, locale);
24117
+ const rawValue = matchedNode?.[item.id] ?? matchedNode?.name;
24118
+ return null != rawValue ? formatter(rawValue) : '';
24119
+ }
24120
+ }));
24121
+ const linkMeasureContent = meas.map((item)=>({
24122
+ visible: (value)=>isLinkDatum(value),
24123
+ hasShape: true,
24124
+ shapeType: 'rectRound',
24125
+ key: item.alias || item.id,
24126
+ value: (value)=>{
24127
+ const datum = value;
24128
+ const measure = findMeasureById(measures, item.id);
24129
+ const formatter = createFormatterByMeasure(measure);
24130
+ const measureValue = datum[item.id] ?? datum[foldInfo.measureValue] ?? datum.value;
24131
+ return formatter(measureValue);
24132
+ }
24133
+ }));
24134
+ return [
24135
+ ...dimContent,
24136
+ ...linkDimensionContent,
24137
+ ...measureContent,
24138
+ ...linkMeasureContent
24139
+ ];
24140
+ };
24141
+ const labelHierarchySankey = (spec, context)=>{
24142
+ const result = {
24143
+ ...spec
24144
+ };
24145
+ const { advancedVSeed, vseed } = context;
24146
+ const { datasetReshapeInfo } = advancedVSeed;
24147
+ const { chartType, encoding } = advancedVSeed;
24148
+ const baseConfig = advancedVSeed.config[chartType];
24149
+ const foldInfo = datasetReshapeInfo[0].foldInfo;
24150
+ const { label } = baseConfig;
24151
+ result.label = labelHierarchySankey_buildLabel(label, vseed.measures, vseed.dimensions, advancedVSeed.dimensions, advancedVSeed.measures, encoding, [
24152
+ foldInfo
24153
+ ]);
24154
+ return result;
24155
+ };
24156
+ const labelHierarchySankey_buildLabel = (label, vseedMeasures = [], vseedDimensions = [], advancedVSeedDimensions, advancedVSeedMeasures, encoding, foldInfoList, locale = 'zh-CN')=>{
24157
+ const { enable, wrap, showValue, showValuePercent, showDimension, labelOverlap, labelColorSmartInvert, labelStroke, labelColor, labelFontSize, labelFontWeight, labelBackgroundColor, labelPosition, autoFormat, numFormat = {} } = label;
24158
+ const hasDimLabelEncoding = vseedDimensions.some((item)=>encoding.label?.includes(item.id));
24159
+ const labelDims = T(hasDimLabelEncoding ? vseedDimensions.filter((item)=>encoding.label?.includes(item.id)) : showDimension ? advancedVSeedDimensions.filter((d)=>d.id !== MeasureId && 'row' !== d.encoding && 'column' !== d.encoding) : [], (item)=>item.id);
24160
+ const labelMeas = T(vseedMeasures.filter((item)=>encoding.label?.includes(item.id)), (item)=>item.id);
24161
+ const percentFormat = chunk_5S4PYKVY_t(numFormat, {
24162
+ type: 'percent'
24163
+ });
24164
+ const percentFormatter = createFormatter(percentFormat);
24165
+ const result = {
24166
+ visible: enable,
24167
+ dataFilter: (data)=>data.filter((entry)=>{
24168
+ if (entry.data?.[DATUM_HIDE_KEY]) return false;
24169
+ const shouldApply = label.dynamicFilter ? selectorWithDynamicFilter(entry.data, label.dynamicFilter, label.selector) : selector_selector(entry.data, label.selector, 'Or');
24170
+ return shouldApply;
24171
+ }),
24172
+ formatMethod: (_, datum)=>{
24173
+ const result = [];
24174
+ const dimLabels = labelDims.flatMap((item)=>{
24175
+ const id = item.id;
24176
+ const rawValue = datum[id];
24177
+ if (null == rawValue || '' === rawValue) return [];
24178
+ const formatter = createFormatterByDimension(item, locale);
24179
+ return [
24180
+ formatter(rawValue)
24181
+ ];
24182
+ });
24183
+ const meaLabels = labelMeas.flatMap((item)=>{
24184
+ const rawValue = datum[item.id];
24185
+ if (null == rawValue || '' === rawValue) return [];
24186
+ return [
24187
+ generateMeasureValue(rawValue, item, autoFormat, numFormat)
24188
+ ];
24189
+ });
24190
+ result.push(...dimLabels);
24191
+ foldInfoList.forEach((foldInfo)=>{
24192
+ const { measureId, measureValue, statistics } = foldInfo;
24193
+ const measure = findMeasureById(advancedVSeedMeasures, datum[measureId]);
24194
+ if (measure) {
24195
+ const measureValueLabel = generateMeasureValue(datum[measureValue], measure, autoFormat, numFormat);
24196
+ if (showValue) result.push(measureValueLabel);
24197
+ if (showValuePercent) {
24198
+ if (chunk_6GTAPB47_e(datum['__VCHART_ARC_RATIO'])) result.push(generateMeasurePercent(datum['__VCHART_ARC_RATIO'], 1, percentFormatter));
24199
+ else if (statistics && chunk_6GTAPB47_e(statistics.sum)) result.push(generateMeasurePercent(datum[measureValue], statistics.sum, percentFormatter));
24200
+ }
24201
+ }
24202
+ });
24203
+ result.push(...meaLabels);
24204
+ if (wrap) return result;
24205
+ return result.join(' ');
24206
+ },
24207
+ syncState: true,
24208
+ position: labelPosition,
24209
+ style: {
24210
+ stroke: labelStroke,
24211
+ fill: labelColor,
24212
+ fontSize: labelFontSize,
24213
+ fontWeight: labelFontWeight,
24214
+ background: labelBackgroundColor
24215
+ },
24216
+ smartInvert: labelColorSmartInvert
24217
+ };
24218
+ if (labelColorSmartInvert) result.style.lineWidth = 2;
24219
+ if (labelOverlap) result.overlap = {
24220
+ hideOnHit: true,
24221
+ clampForce: true
24222
+ };
24223
+ return result;
24224
+ };
24225
+ const sankeyInteractive = (spec, context)=>{
24226
+ const result = {
24227
+ ...spec
24228
+ };
24229
+ const { vseed } = context;
24230
+ result.emphasis = {
24231
+ enable: true,
24232
+ effect: isSankey(vseed) ? 'adjacency' : 'related'
24233
+ };
24234
+ result.node = {
24235
+ ...result.node || {},
24236
+ state: {
24237
+ ...result.node?.state || {},
24238
+ blur: {
24239
+ opacity: 0.2
24240
+ }
24241
+ }
24242
+ };
24243
+ result.link = {
24244
+ ...result.link || {},
24245
+ state: {
24246
+ ...result.link?.state || {},
24247
+ blur: {
24248
+ opacity: 0.05
24249
+ }
24250
+ }
24251
+ };
24252
+ return result;
24253
+ };
24254
+ const datasetPivotHierarchySankey = (spec, context)=>{
24255
+ const result = {
24256
+ ...spec
24257
+ };
24258
+ const { advancedVSeed } = context;
24259
+ const { dataset, datasetReshapeInfo, measures } = advancedVSeed;
24260
+ const measureKeys = findAllMeasures(measures).map((m)=>m.id);
24261
+ const hierarchyFields = advancedVSeed.encoding?.hierarchy || [];
24262
+ const rows = advancedVSeed.encoding?.row || [];
24263
+ const columns = advancedVSeed.encoding?.column || [];
24264
+ const pivotDims = [
24265
+ ...rows,
24266
+ ...columns
24267
+ ];
24268
+ const records = dataset.reduce((pre, cur, index)=>{
24269
+ const id = datasetReshapeInfo[index].id;
24270
+ const { foldInfo, unfoldInfo } = datasetReshapeInfo[index];
24271
+ if (pivotDims.length > 0) {
24272
+ const groupedDataset = groupByDimensions(cur, pivotDims);
24273
+ pre[id] = groupedDataset.map((data)=>({
24274
+ ...Object.fromEntries(pivotDims.map((dim)=>[
24275
+ dim,
24276
+ data[dim]
24277
+ ])),
24278
+ nodes: buildHierarchySankeyNodes(data.children, hierarchyFields, foldInfo, unfoldInfo, measureKeys)
24279
+ }));
24280
+ } else pre[id] = [
24281
+ {
24282
+ nodes: buildHierarchySankeyNodes(cur, hierarchyFields, foldInfo, unfoldInfo, measureKeys)
24283
+ }
24284
+ ];
24285
+ return pre;
24286
+ }, {});
24287
+ return {
24288
+ ...result,
24289
+ records
24290
+ };
24291
+ };
24292
+ const hierarchySankey = [
24293
+ fontFamilyTheme,
24294
+ initHierarchySankey,
24295
+ datasetHierarchySankey,
24296
+ colorAdapter(color_color, linearColor),
24297
+ background_backgroundColor,
24298
+ colorAdapter(discreteLegend, colorLegend),
24299
+ tooltipHierarchySankey,
24300
+ labelHierarchySankey,
24301
+ sankeyInteractive
24302
+ ];
24303
+ const pivotHierarchySankey = [
24304
+ initPivot,
24305
+ pivotGridStyle,
24306
+ pivotIndicatorsAsCol,
24307
+ pivotHideIndicatorName,
24308
+ datasetPivotHierarchySankey,
24309
+ pivotIndicators_pivotIndicators([
24310
+ fontFamilyTheme,
24311
+ initHierarchySankey,
24312
+ datasetHierarchySankey,
24313
+ colorAdapter(color_color, linearColor),
24314
+ background_backgroundColor,
24315
+ tooltipHierarchySankey,
24316
+ labelHierarchySankey,
24317
+ sankeyInteractive
24318
+ ]),
24319
+ pivotRowDimensions,
24320
+ pivotColumnDimensions,
24321
+ pivotTitle,
24322
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
24323
+ ];
24324
+ const hierarchySankeySpecPipeline = [
24325
+ pivotAdapter_pivotAdapter(hierarchySankey, pivotHierarchySankey)
24326
+ ];
24327
+ const registerHierarchySankey = ()=>{
24328
+ Builder.registerAdvancedPipeline('hierarchySankey', hierarchySankeyAdvancedPipeline);
24329
+ Builder.registerSpecPipeline('hierarchySankey', hierarchySankeySpecPipeline);
24330
+ };
24331
+ const defaultEncodingForSankey = (advancedVSeed)=>{
24332
+ const { measures = [], reshapeMeasures = [], dimensions = [] } = advancedVSeed;
24333
+ const encoding = {};
24334
+ sankey_generateDefaultDimensionEncoding(dimensions, encoding, hasMultipleMeasureInSingleView(reshapeMeasures));
24335
+ sankey_generateDefaultMeasureEncoding(measures, encoding);
24336
+ return {
24337
+ ...advancedVSeed,
24338
+ encoding
24339
+ };
24340
+ };
24341
+ const encodingForSankey = (advancedVSeed)=>{
24342
+ const { measures = [], reshapeMeasures = [], dimensions = [] } = advancedVSeed;
24343
+ const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
24344
+ const hasMeasureEncoding = measures.some((item)=>item.encoding);
24345
+ const encoding = {};
24346
+ const hasMulti = hasMultipleMeasureInSingleView(reshapeMeasures);
24347
+ if (hasDimensionEncoding) sankey_generateDimensionEncoding(dimensions, encoding, hasMulti);
24348
+ else sankey_generateDefaultDimensionEncoding(dimensions, encoding, hasMulti);
24349
+ if (hasMeasureEncoding) sankey_generateMeasureEncoding(measures, encoding);
24350
+ else sankey_generateDefaultMeasureEncoding(measures, encoding);
24351
+ return {
24352
+ ...advancedVSeed,
24353
+ encoding
24354
+ };
24355
+ };
24356
+ const sankey_generateDefaultDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
24357
+ const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
24358
+ const sourceTargetDimIds = isMultiMeasure ? uniqueDimIds : uniqueDimIds.filter((d)=>d !== MeasureId);
24359
+ encoding.source = sourceTargetDimIds.slice(0, 1);
24360
+ encoding.target = sourceTargetDimIds.slice(1);
24361
+ encoding.color = [];
24362
+ encoding.detail = [];
24363
+ encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
24364
+ encoding.label = [];
24365
+ encoding.row = [];
24366
+ encoding.column = [];
24367
+ };
24368
+ const sankey_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
24369
+ encoding.source = chunk_QJLMYOTX_i(dimensions.filter((item)=>'source' === item.encoding).map((item)=>item.id));
24370
+ encoding.target = chunk_QJLMYOTX_i(dimensions.filter((item)=>'target' === item.encoding).map((item)=>item.id));
24371
+ if (0 === encoding.source.length && dimensions[0]) encoding.source = [
24372
+ dimensions[0].id
24373
+ ];
24374
+ if (isMultiMeasure && !encoding.source.includes(MeasureId) && !encoding.target.includes(MeasureId)) encoding.target.push(MeasureId);
24375
+ encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
24376
+ encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id)).filter((d)=>d !== MeasureId);
24377
+ encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
24378
+ encoding.row = chunk_QJLMYOTX_i(dimensions.filter((item)=>'row' === item.encoding).map((item)=>item.id));
24379
+ encoding.column = chunk_QJLMYOTX_i(dimensions.filter((item)=>'column' === item.encoding).map((item)=>item.id));
24380
+ };
24381
+ const sankey_generateDefaultMeasureEncoding = (measures, encoding)=>{
24382
+ encoding.size = chunk_QJLMYOTX_i(measures.filter((item)=>'size' === item.encoding || !item.encoding).map((item)=>item.id));
24383
+ encoding.tooltip = chunk_QJLMYOTX_i([
24384
+ ...encoding.tooltip || [],
24385
+ ...measures.map((m)=>m.id)
24386
+ ]);
24387
+ };
24388
+ const sankey_generateMeasureEncoding = (measures, encoding)=>{
24389
+ encoding.size = chunk_QJLMYOTX_i(measures.filter((item)=>'size' === item.encoding || !item.encoding).map((item)=>item.id));
24390
+ const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
24391
+ encoding.label = chunk_QJLMYOTX_i([
24392
+ ...encoding.label || [],
24393
+ ...label
24394
+ ]);
24395
+ const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
24396
+ encoding.tooltip = chunk_QJLMYOTX_i([
24397
+ ...encoding.tooltip || [],
24398
+ ...label,
24399
+ ...tooltip,
24400
+ ...encoding.size
24401
+ ]);
24402
+ const detail = chunk_QJLMYOTX_i(measures.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
24403
+ encoding.detail = chunk_QJLMYOTX_i([
24404
+ ...encoding.detail || [],
24405
+ ...detail
24406
+ ]);
24407
+ };
24408
+ const sankeyConfig = (advancedVSeed, context)=>{
24409
+ const { vseed } = context;
24410
+ const { chartType } = vseed;
24411
+ const result = {
24412
+ ...advancedVSeed
24413
+ };
24414
+ const pickedConfig = chunk_2T7K3PFL_i(vseed, [
24415
+ 'backgroundColor',
24416
+ 'color',
24417
+ 'label',
24418
+ 'legend',
24419
+ 'tooltip'
24420
+ ]);
24421
+ const config = replaceNullToUndefined(pickedConfig);
24422
+ result.config = {
24423
+ ...result.config,
24424
+ [chartType]: {
24425
+ ...config
24426
+ }
24427
+ };
24428
+ return result;
24429
+ };
24430
+ const sankeyAdvancedPipeline = [
24431
+ page_page_page,
24432
+ initAdvancedVSeed_initAdvancedVSeed,
24433
+ default_defaultMeasures_defaultMeasures,
24434
+ defaultDimensions_defaultDimensions,
24435
+ defaultMeasureId,
24436
+ encodingAdapter([
24437
+ buildMeasures([
24438
+ 'size',
24439
+ 'detail'
24440
+ ]),
24441
+ defaultEncodingForSankey
24442
+ ], [
24443
+ buildMeasures([
24444
+ 'size',
24445
+ 'detail'
24446
+ ]),
24447
+ encodingForSankey,
24448
+ pickDimensionsForReshape
24449
+ ]),
24450
+ pivotAdapter([
24451
+ reshapeWithEncoding
24452
+ ], [
24453
+ pivotReshapeWithEncoding
24454
+ ]),
24455
+ sankeyConfig,
24456
+ theme_theme,
24457
+ annotation_annotation
24458
+ ];
24459
+ const initSankey = (spec, context)=>{
24460
+ const result = {
24461
+ ...spec
24462
+ };
24463
+ const { advancedVSeed } = context;
24464
+ const hasColorEncoding = (advancedVSeed.encoding?.color?.length || 0) > 0;
24465
+ result.type = 'sankey';
24466
+ result.categoryField = hasColorEncoding ? ColorEncoding : 'nodeName';
24467
+ result.valueField = 'value';
24468
+ result.sourceField = 'source';
24469
+ result.targetField = 'target';
24470
+ result.nodeAlign = 'justify';
24471
+ result.nodeGap = 8;
24472
+ result.nodeWidth = 12;
24473
+ result.minNodeHeight = 4;
24474
+ result.iterations = 0;
24475
+ result.padding = {
24476
+ top: 0,
24477
+ left: 2,
24478
+ bottom: 0,
24479
+ right: 2
24480
+ };
24481
+ result.link = {
24482
+ style: {
24483
+ pathType: 'smooth'
24484
+ }
24485
+ };
24486
+ return result;
24487
+ };
24488
+ const getNodeInfo = (datum, encodedField, sourceFields, foldInfo)=>{
24489
+ const id = String(datum[encodedField] ?? '');
24490
+ if (!sourceFields.length) return {
24491
+ id,
24492
+ nodeName: id
24493
+ };
24494
+ const nodeName = sourceFields.map((field)=>{
24495
+ const value = String(datum[field] ?? '');
24496
+ return field === foldInfo?.measureId && foldInfo.measureName && void 0 !== datum[foldInfo.measureName] ? String(datum[foldInfo.measureName]) : value;
24497
+ }).join("-");
24498
+ return {
24499
+ id,
24500
+ nodeName: nodeName || id
24501
+ };
24502
+ };
24503
+ const buildSankeyData = (dataset, sourceField, targetField, valueField, options = {})=>{
24504
+ const nodeIndexMap = new Map();
24505
+ const nodeNameMap = new Map();
24506
+ const nodeColorMap = new Map();
24507
+ const linksMap = new Map();
24508
+ const { foldInfo, sourceFields = [], targetFields = [] } = options;
24509
+ const ensureNode = (node)=>{
24510
+ const { id, nodeName } = node;
24511
+ if (!nodeIndexMap.has(id)) {
24512
+ nodeIndexMap.set(id, nodeIndexMap.size);
24513
+ nodeNameMap.set(id, nodeName);
24514
+ }
24515
+ return nodeIndexMap.get(id);
24516
+ };
24517
+ dataset.forEach((datum)=>{
24518
+ const sourceNode = getNodeInfo(datum, sourceField, sourceFields, foldInfo);
24519
+ const targetNode = getNodeInfo(datum, targetField, targetFields, foldInfo);
24520
+ const rawValue = Number(datum[valueField] ?? 0);
24521
+ const colorCategory = datum[ColorEncoding];
24522
+ const colorCategoryValue = null == colorCategory || '' === colorCategory ? void 0 : String(colorCategory);
24523
+ if (!sourceNode.id || !targetNode.id || Number.isNaN(rawValue)) return;
24524
+ const source = ensureNode(sourceNode);
24525
+ const target = ensureNode(targetNode);
24526
+ if (!nodeColorMap.has(sourceNode.id) && colorCategoryValue) nodeColorMap.set(sourceNode.id, colorCategoryValue);
24527
+ if (!nodeColorMap.has(targetNode.id) && colorCategoryValue) nodeColorMap.set(targetNode.id, colorCategoryValue);
24528
+ const linkKey = `${source}__${target}`;
24529
+ const prev = linksMap.get(linkKey);
24530
+ if (prev) prev.value += rawValue;
24531
+ else {
24532
+ const linkDatum = {
24533
+ source,
24534
+ target,
24535
+ value: rawValue,
24536
+ sourceNodeName: sourceNode.nodeName,
24537
+ targetNodeName: targetNode.nodeName
24538
+ };
24539
+ if (colorCategoryValue) linkDatum[ColorEncoding] = colorCategoryValue;
24540
+ linksMap.set(linkKey, linkDatum);
24541
+ }
24542
+ });
24543
+ const nodes = Array.from(nodeIndexMap.entries()).sort((a, b)=>a[1] - b[1]).map(([id])=>{
24544
+ const nodeDatum = {
24545
+ id,
24546
+ nodeName: nodeNameMap.get(id) || id
24547
+ };
24548
+ const nodeColor = nodeColorMap.get(id);
24549
+ if (nodeColor) nodeDatum[ColorEncoding] = nodeColor;
24550
+ return nodeDatum;
24551
+ });
24552
+ return {
24553
+ nodes,
24554
+ links: Array.from(linksMap.values())
24555
+ };
24556
+ };
24557
+ const datasetSankey = (spec, context)=>{
24558
+ const result = {
24559
+ ...spec
24560
+ };
24561
+ const { advancedVSeed } = context;
24562
+ const { dataset = [], datasetReshapeInfo } = advancedVSeed;
24563
+ const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
24564
+ const sourceFields = advancedVSeed.encoding?.source || [];
24565
+ const targetFields = advancedVSeed.encoding?.target || [];
24566
+ const graphData = buildSankeyData(dataset, unfoldInfo.encodingSource || 'source', unfoldInfo.encodingTarget || 'target', foldInfo.measureValue, {
24567
+ foldInfo,
24568
+ sourceFields,
24569
+ targetFields
24570
+ });
24571
+ result.data = [
24572
+ {
24573
+ id: 'data',
24574
+ values: [
24575
+ graphData
24576
+ ]
24577
+ }
24578
+ ];
24579
+ return result;
24580
+ };
24581
+ const tooltipSankey_isLinkDatum = (value)=>{
24582
+ const datum = value;
24583
+ return !!datum && void 0 !== datum.source && void 0 !== datum.target;
24584
+ };
24585
+ const getNodes = (spec)=>((spec.data || [])[0]?.values || [])[0]?.nodes || [];
24586
+ const getNodeNameByIndex = (nodes, index)=>{
24587
+ const node = nodes[Number(index)];
24588
+ return node?.nodeName ?? '';
24589
+ };
24590
+ const getWrappedDatum = (value)=>{
24591
+ const datum = value;
24592
+ const wrappedDatum = datum?.datum;
24593
+ if (Array.isArray(wrappedDatum)) return wrappedDatum[wrappedDatum.length - 1] || datum;
24594
+ if (wrappedDatum && 'object' == typeof wrappedDatum) return wrappedDatum;
24595
+ return datum;
24596
+ };
24597
+ const getNodeTitle = (value)=>{
24598
+ const datum = getWrappedDatum(value);
24599
+ return String(datum?.nodeName ?? datum?.name ?? datum?.id ?? '');
24600
+ };
24601
+ const getEncodingAlias = (dimensions, encodedIds, fallback, measureId)=>dimensions.find((dimension)=>(encodedIds || []).includes(dimension.id) && dimension.id !== measureId)?.alias || fallback;
24602
+ const tooltipSankey = (spec, context)=>{
24603
+ const result = tooltip_tooltip()(spec, context);
24604
+ const { advancedVSeed, vseed } = context;
24605
+ const { datasetReshapeInfo, dimensions = [] } = advancedVSeed;
24606
+ const { foldInfo } = datasetReshapeInfo[0];
24607
+ const nodes = getNodes(result);
24608
+ const measures = vseed.measures || [];
24609
+ const sourceAlias = getEncodingAlias(dimensions, advancedVSeed.encoding?.source, 'Source', foldInfo.measureId);
24610
+ if (result.tooltip) result.tooltip.mark = {
24611
+ title: {
24612
+ visible: true,
24613
+ value: (value)=>{
24614
+ const datum = value;
24615
+ if (tooltipSankey_isLinkDatum(value)) return `${getNodeNameByIndex(nodes, datum.source)} -> ${getNodeNameByIndex(nodes, datum.target)}`;
24616
+ return getNodeTitle(value);
24617
+ }
24618
+ },
24619
+ content: tooltipSankey_createMarkContent(nodes, measures, foldInfo, sourceAlias)
24620
+ };
24621
+ return result;
24622
+ };
24623
+ const tooltipSankey_createMarkContent = (nodes, measures = [], foldInfo, sourceAlias)=>{
24624
+ const fallbackMeasure = findMeasureById(measures, foldInfo.measureValue) || measures[0];
24625
+ const fallbackMeasureAlias = fallbackMeasure?.alias || fallbackMeasure?.id || 'Value';
24626
+ return [
24627
+ {
24628
+ visible: (value)=>tooltipSankey_isLinkDatum(value),
24629
+ hasShape: true,
24630
+ shapeType: 'rectRound',
24631
+ key: sourceAlias,
24632
+ value: (value)=>{
24633
+ const datum = value;
24634
+ return String(datum.sourceNodeName ?? getNodeNameByIndex(nodes, datum.source));
24635
+ }
24636
+ },
24637
+ {
24638
+ visible: ()=>true,
24639
+ hasShape: true,
24640
+ shapeType: 'rectRound',
24641
+ key: fallbackMeasureAlias,
24642
+ value: (value)=>{
24643
+ const datum = value;
24644
+ const measure = findMeasureById(measures, datum?.[foldInfo.measureId]) || fallbackMeasure;
24645
+ const formatter = createFormatterByMeasure(measure);
24646
+ return formatter((datum?.[foldInfo.measureValue] ?? datum?.value ?? 0) || 0);
24647
+ }
24648
+ }
24649
+ ];
24650
+ };
24651
+ const labelSankey = (spec, context)=>{
24652
+ const result = {
24653
+ ...spec
24654
+ };
24655
+ const { advancedVSeed, vseed } = context;
24656
+ const { datasetReshapeInfo, chartType, encoding } = advancedVSeed;
24657
+ const baseConfig = advancedVSeed.config[chartType];
24658
+ const foldInfo = datasetReshapeInfo[0].foldInfo;
24659
+ const label = baseConfig?.label;
24660
+ if (!label) return result;
24661
+ result.label = labelSankey_buildLabel(label, vseed.measures || advancedVSeed.measures || [], advancedVSeed.measures || [], encoding.label || [], foldInfo);
24662
+ return result;
24663
+ };
24664
+ const labelSankey_buildLabel = (label, vseedMeasures, advancedVSeedMeasures, labelEncodingIds, foldInfo)=>{
24665
+ const { enable, wrap, showValue, showValuePercent, showDimension, labelOverlap, labelColorSmartInvert, labelStroke, labelColor, labelFontSize, labelFontWeight, labelBackgroundColor, labelPosition, autoFormat, numFormat = {} } = label;
24666
+ const hasMeasureLabelEncoding = vseedMeasures.some((item)=>labelEncodingIds.includes(item.id));
24667
+ const labelMeasures = hasMeasureLabelEncoding ? vseedMeasures.filter((item)=>labelEncodingIds.includes(item.id)) : [];
24668
+ const percentFormat = chunk_5S4PYKVY_t(numFormat, {
24669
+ type: 'percent'
24670
+ });
24671
+ const percentFormatter = createFormatter(percentFormat);
24672
+ const result = {
24673
+ visible: enable,
24674
+ dataFilter: (data)=>data.filter((entry)=>{
24675
+ if (entry.data?.[DATUM_HIDE_KEY]) return false;
24676
+ const shouldApply = label.dynamicFilter ? selectorWithDynamicFilter(entry.data, label.dynamicFilter, label.selector) : selector_selector(entry.data, label.selector, 'Or');
24677
+ return shouldApply;
24678
+ }),
24679
+ formatMethod: (_, datum)=>{
24680
+ const parts = [];
24681
+ if (showDimension && datum?.nodeName) parts.push(String(datum.nodeName));
24682
+ if (showValue) {
24683
+ const { measureId, measureValue } = foldInfo;
24684
+ const measure = findMeasureById(advancedVSeedMeasures, datum[measureId]);
24685
+ if (measure && void 0 !== datum[measureValue] && null !== datum[measureValue]) parts.push(generateMeasureValue(datum[measureValue], measure, autoFormat, numFormat));
24686
+ else if (void 0 !== datum.value && null !== datum.value) {
24687
+ const fallbackMeasure = findMeasureById(advancedVSeedMeasures, foldInfo.measureId) || findMeasureById(vseedMeasures, foldInfo.measureId) || advancedVSeedMeasures[0];
24688
+ if (fallbackMeasure) parts.push(generateMeasureValue(datum.value, fallbackMeasure, autoFormat, numFormat));
24689
+ else parts.push(String(datum.value));
24690
+ }
24691
+ }
24692
+ if (showValuePercent) {
24693
+ const ratioValue = datum['__VCHART_ARC_RATIO'];
24694
+ if (chunk_6GTAPB47_e(ratioValue)) parts.push(generateMeasurePercent(ratioValue, 1, percentFormatter));
24695
+ else if (foldInfo.statistics && chunk_6GTAPB47_e(foldInfo.statistics.sum) && void 0 !== datum[foldInfo.measureValue] && null !== datum[foldInfo.measureValue]) parts.push(generateMeasurePercent(datum[foldInfo.measureValue], foldInfo.statistics.sum, percentFormatter));
24696
+ }
24697
+ labelMeasures.forEach((measure)=>{
24698
+ const rawValue = datum[measure.id];
24699
+ if (null == rawValue || '' === rawValue) return;
24700
+ parts.push(generateMeasureValue(rawValue, measure, autoFormat, numFormat));
24701
+ });
24702
+ return wrap ? parts : parts.join(' ');
24703
+ },
24704
+ syncState: true,
24705
+ position: labelPosition,
24706
+ style: {
24707
+ stroke: labelStroke,
24708
+ fill: labelColor,
24709
+ fontSize: labelFontSize,
24710
+ fontWeight: labelFontWeight,
24711
+ background: labelBackgroundColor
24712
+ },
24713
+ smartInvert: labelColorSmartInvert
24714
+ };
24715
+ if (labelColorSmartInvert) result.style.lineWidth = 2;
24716
+ if (labelOverlap) result.overlap = {
24717
+ hideOnHit: true,
24718
+ clampForce: true
24719
+ };
24720
+ return result;
24721
+ };
24722
+ const datasetPivotSankey = (spec, context)=>{
24723
+ const result = {
24724
+ ...spec
24725
+ };
24726
+ const { advancedVSeed } = context;
24727
+ const { dataset, datasetReshapeInfo } = advancedVSeed;
24728
+ const rows = advancedVSeed.encoding?.row || [];
24729
+ const columns = advancedVSeed.encoding?.column || [];
24730
+ const sourceFields = advancedVSeed.encoding?.source || [];
24731
+ const targetFields = advancedVSeed.encoding?.target || [];
24732
+ const pivotDims = [
24733
+ ...rows,
24734
+ ...columns
24735
+ ];
24736
+ const records = dataset.reduce((pre, cur, index)=>{
24737
+ const reshapeInfo = datasetReshapeInfo[index];
24738
+ const id = reshapeInfo.id;
24739
+ const { foldInfo, unfoldInfo } = reshapeInfo;
24740
+ if (pivotDims.length > 0) {
24741
+ const groupedDataset = groupByDimensions(cur, pivotDims);
24742
+ pre[id] = groupedDataset.map((data)=>({
24743
+ ...Object.fromEntries(pivotDims.map((dim)=>[
24744
+ dim,
24745
+ data[dim]
24746
+ ])),
24747
+ ...buildSankeyData(data.children || [], unfoldInfo.encodingSource || 'source', unfoldInfo.encodingTarget || 'target', foldInfo.measureValue, {
24748
+ foldInfo,
24749
+ sourceFields,
24750
+ targetFields
24751
+ })
24752
+ }));
24753
+ } else pre[id] = [
24754
+ buildSankeyData(cur, unfoldInfo.encodingSource || 'source', unfoldInfo.encodingTarget || 'target', foldInfo.measureValue, {
24755
+ foldInfo,
24756
+ sourceFields,
24757
+ targetFields
24758
+ })
24759
+ ];
24760
+ return pre;
24761
+ }, {});
24762
+ return {
24763
+ ...result,
24764
+ records
24765
+ };
24766
+ };
24767
+ const sankey = [
24768
+ fontFamilyTheme,
24769
+ initSankey,
24770
+ datasetSankey,
24771
+ colorAdapter(color_color, linearColor),
24772
+ background_backgroundColor,
24773
+ colorAdapter(discreteLegend, colorLegend),
24774
+ tooltipSankey,
24775
+ labelSankey,
24776
+ sankeyInteractive
24777
+ ];
24778
+ const pivotSankey = [
24779
+ initPivot,
24780
+ pivotGridStyle,
24781
+ pivotIndicatorsAsCol,
24782
+ pivotHideIndicatorName,
24783
+ datasetPivotSankey,
24784
+ pivotIndicators_pivotIndicators([
24785
+ fontFamilyTheme,
24786
+ initSankey,
24787
+ datasetSankey,
24788
+ colorAdapter(color_color, linearColor),
24789
+ background_backgroundColor,
24790
+ tooltipSankey,
24791
+ labelSankey,
24792
+ sankeyInteractive
24793
+ ]),
24794
+ pivotRowDimensions,
24795
+ pivotColumnDimensions,
24796
+ pivotTitle,
24797
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
24798
+ ];
24799
+ const sankeySpecPipeline = [
24800
+ pivotAdapter_pivotAdapter(sankey, pivotSankey)
24801
+ ];
24802
+ const registerSankey = ()=>{
24803
+ Builder.registerAdvancedPipeline('sankey', sankeyAdvancedPipeline);
24804
+ Builder.registerSpecPipeline('sankey', sankeySpecPipeline);
24805
+ };
24806
+ const getDefaultTableConfig = ()=>({
24807
+ bodyFontSize: 12,
24808
+ bodyBackgroundColor: 'transparent',
24809
+ headerFontSize: 12,
24810
+ barHeight: '100%',
24811
+ barMarkInBar: false,
24812
+ barMarkWidth: 2,
24813
+ barPadding: [
24814
+ '25%',
24815
+ 10
24816
+ ],
24817
+ barRightToLeft: false,
24818
+ barPositiveColor: 'rgba(188,220,194, 0.5)',
24819
+ barNegativeColor: 'rgba(241,188,191, 0.5)',
24820
+ backgroundColorScale: {
24821
+ minColor: '#D8CFFF',
24822
+ maxColor: '#6B4FD7'
24823
+ }
24824
+ });
24825
+ const getLightTableConfig = ()=>({
24826
+ ...getDefaultTableConfig(),
24827
+ borderColor: '#e3e5eb',
24828
+ bodyFontColor: '#141414',
24829
+ headerFontColor: '#21252c',
24830
+ headerBackgroundColor: '#f6f7f9',
24831
+ hoverBodyBackgroundColor: '#bedaff',
24832
+ hoverBodyInlineBackgroundColor: '#bedaff33',
24833
+ hoverHeaderBackgroundColor: '#D9DDE4',
24834
+ hoverHeaderInlineBackgroundColor: '#D9DDE455',
24835
+ selectedBorderColor: '#4080ff',
24836
+ selectedBackgroundColor: '#bedaff33',
24837
+ backgroundColor: 'transparent',
24838
+ barAxisColor: '#9EAFC6'
24839
+ });
24840
+ const getDarkTableConfig = ()=>({
24841
+ ...getDefaultTableConfig(),
24842
+ borderColor: '#4b4e53',
24843
+ bodyFontColor: '#fdfdfd',
24844
+ headerFontColor: '#fdfdfd',
24845
+ headerBackgroundColor: '#36393e',
24846
+ hoverBodyBackgroundColor: '#4284ff66',
24847
+ hoverBodyInlineBackgroundColor: '#4284ff10',
24848
+ hoverHeaderBackgroundColor: '#6f7984cc',
24849
+ hoverHeaderInlineBackgroundColor: '#4b4f54',
24850
+ selectedBorderColor: '#3073f2',
24851
+ selectedBackgroundColor: '#4284ff33',
24852
+ barAxisColor: '#9EAFC6'
24853
+ });
24854
+ const pickPivotChartGridConfig = (tableConfig)=>({
24855
+ outlineBorderLineWidth: 0,
24856
+ frameCornerRadius: 0,
24857
+ borderColor: tableConfig.borderColor,
24858
+ bodyFontColor: tableConfig.bodyFontColor,
24859
+ headerFontColor: tableConfig.headerFontColor,
24860
+ headerBackgroundColor: 'transparent',
24861
+ hoverHeaderBackgroundColor: tableConfig.hoverHeaderBackgroundColor,
24862
+ hoverHeaderInlineBackgroundColor: tableConfig.hoverHeaderInlineBackgroundColor,
24863
+ titleFontColor: tableConfig.headerFontColor,
24864
+ titleFontSize: tableConfig.headerFontSize,
24865
+ titleFontWeight: 'bold'
24866
+ });
24867
+ const getLightPivotChartGridConfig = ()=>{
24868
+ const res = pickPivotChartGridConfig(getLightTableConfig());
24869
+ res.hoverHeaderInlineBackgroundColor = '#D9DDE446';
24870
+ res.chartGridColor = '#F0F1F6';
24871
+ res.axisLabelColor = '#BCC1CB';
24872
+ return res;
24873
+ };
24874
+ const getDarkPivotChartGridConfig = ()=>{
24875
+ const res = pickPivotChartGridConfig(getDarkTableConfig());
24876
+ res.hoverHeaderInlineBackgroundColor = '#4b4f5446';
24877
+ return res;
24878
+ };
24879
+ const getDarkCrosshairLine = ()=>({
24880
+ visible: true,
24881
+ labelVisible: true,
24882
+ labelColor: '#ffffff',
24883
+ labelBackgroundColor: '#404349',
24884
+ lineColor: '#55595F'
24885
+ });
24886
+ const getDarkCrosshairRect = ()=>({
24887
+ visible: true,
24888
+ labelVisible: true,
24889
+ labelColor: '#ffffff',
24890
+ labelBackgroundColor: '#404349',
24891
+ rectColor: '#4B4F54'
24892
+ });
24893
+ const getLightCrosshairLine = ()=>({
24894
+ visible: true,
24895
+ labelVisible: true,
24896
+ labelColor: '#ffffff',
24897
+ labelBackgroundColor: '#21252C',
24898
+ lineColor: '#21252C'
24899
+ });
24900
+ const getLightCrosshairRect = ()=>({
24901
+ visible: true,
24902
+ labelVisible: true,
24903
+ labelColor: '#ffffff',
24904
+ labelBackgroundColor: '#364159',
24905
+ rectColor: '#D9DDE4'
24906
+ });
24907
+ const getLightColorScheme = ()=>[
24908
+ '#8D72F6',
24909
+ '#5766EC',
24910
+ '#66A3FE',
24911
+ '#51D5E6',
24912
+ '#4EC0B3',
24913
+ '#F9DF90',
24914
+ '#F9AD71',
24915
+ '#ED8888',
24916
+ '#E9A0C3',
24917
+ '#D77DD3'
24918
+ ];
24919
+ const getDarkColorScheme = ()=>[
24920
+ '#2E62F1',
24921
+ '#4DC36A',
24922
+ '#FF8406',
24923
+ '#FFCC00',
24924
+ '#4F44CF',
24925
+ '#5AC8FA',
24926
+ '#003A8C',
24927
+ '#B08AE2',
24928
+ '#FF6341',
24929
+ '#98DD62'
24930
+ ];
24931
+ const getLightLinearColorScheme = ()=>[
24932
+ '#C2CEFF',
24933
+ '#5766EC'
24934
+ ];
24935
+ const getDarkLinearColorScheme = ()=>[
24936
+ '#A0CEFF',
24937
+ '#2E62F1'
24938
+ ];
24939
+ const getLightColor = ()=>({
24940
+ linearColorScheme: getLightLinearColorScheme(),
24941
+ colorScheme: getLightColorScheme(),
24942
+ positiveColor: '#7E5DFF',
24943
+ negativeColor: '#EB3373'
24944
+ });
24945
+ const getDarkColor = ()=>({
24946
+ linearColorScheme: getDarkLinearColorScheme(),
24947
+ colorScheme: getDarkColorScheme(),
24948
+ positiveColor: '#7E5DFF',
24949
+ negativeColor: '#EB3373'
24950
+ });
24951
+ const getDefaultLabel = ()=>({
24952
+ enable: true,
24953
+ wrap: true,
24954
+ showValue: true,
24955
+ showValuePercent: false,
24956
+ labelColorSmartInvert: false,
24957
+ labelOverlap: true
24958
+ });
24959
+ const getDarkLabel = ()=>({
24960
+ ...getDefaultLabel(),
24961
+ labelStroke: '#21252C'
24962
+ });
24963
+ const getLightLabel = ()=>({
23907
24964
  ...getDefaultLabel(),
23908
24965
  labelStroke: '#fff'
23909
24966
  });
@@ -24737,6 +25794,8 @@ self.R = R;
24737
25794
  };
24738
25795
  const getSunburstTheme = ()=>getTreeMapTheme();
24739
25796
  const getCirclePackingTheme = ()=>getTreeMapTheme();
25797
+ const getHierarchySankeyTheme = ()=>getTreeMapTheme();
25798
+ const getSankeyTheme = ()=>getTreeMapTheme();
24740
25799
  const getDarkPlayer = ()=>{
24741
25800
  const primaryColor = getDarkColorScheme()[0];
24742
25801
  return {
@@ -25013,6 +26072,8 @@ self.R = R;
25013
26072
  treeMap: getTreeMapTheme(),
25014
26073
  sunburst: getSunburstTheme(),
25015
26074
  circlePacking: getCirclePackingTheme(),
26075
+ hierarchySankey: getHierarchySankeyTheme(),
26076
+ sankey: getSankeyTheme(),
25016
26077
  raceBar: getRaceBarTheme(),
25017
26078
  raceColumn: getRaceColumnTheme(),
25018
26079
  raceScatter: getRaceScatterTheme(),
@@ -25386,6 +26447,8 @@ self.R = R;
25386
26447
  };
25387
26448
  const hierarchy_getSunburstTheme = ()=>hierarchy_getTreeMapTheme();
25388
26449
  const hierarchy_getCirclePackingTheme = ()=>hierarchy_getTreeMapTheme();
26450
+ const hierarchy_getHierarchySankeyTheme = ()=>hierarchy_getTreeMapTheme();
26451
+ const hierarchy_getSankeyTheme = ()=>hierarchy_getTreeMapTheme();
25389
26452
  const race_getRaceBarTheme = ()=>{
25390
26453
  const linearAxis = getDarkLinearAxis();
25391
26454
  const bandAxis = getDarkBandAxis();
@@ -25588,6 +26651,8 @@ self.R = R;
25588
26651
  treeMap: hierarchy_getTreeMapTheme(),
25589
26652
  sunburst: hierarchy_getSunburstTheme(),
25590
26653
  circlePacking: hierarchy_getCirclePackingTheme(),
26654
+ hierarchySankey: hierarchy_getHierarchySankeyTheme(),
26655
+ sankey: hierarchy_getSankeyTheme(),
25591
26656
  raceBar: race_getRaceBarTheme(),
25592
26657
  raceColumn: race_getRaceColumnTheme(),
25593
26658
  raceScatter: race_getRaceScatterTheme(),
@@ -25646,6 +26711,8 @@ self.R = R;
25646
26711
  registerTreeMap();
25647
26712
  registerSunburst();
25648
26713
  registerCirclePacking();
26714
+ registerHierarchySankey();
26715
+ registerSankey();
25649
26716
  registerLightTheme();
25650
26717
  registerDarkTheme();
25651
26718
  };
@@ -29340,6 +30407,8 @@ self.R = R;
29340
30407
  'treeMap',
29341
30408
  'sunburst',
29342
30409
  'circlePacking',
30410
+ 'hierarchySankey',
30411
+ 'sankey',
29343
30412
  'funnel',
29344
30413
  'heatmap',
29345
30414
  'boxPlot',
@@ -29358,7 +30427,9 @@ self.R = R;
29358
30427
  'row',
29359
30428
  'column',
29360
30429
  'player',
29361
- 'hierarchy'
30430
+ 'hierarchy',
30431
+ 'source',
30432
+ 'target'
29362
30433
  ]);
29363
30434
  const DimensionEncodingEnum = {
29364
30435
  xAxis: 'xAxis',
@@ -29371,7 +30442,9 @@ self.R = R;
29371
30442
  row: 'row',
29372
30443
  column: 'column',
29373
30444
  player: 'player',
29374
- hierarchy: 'hierarchy'
30445
+ hierarchy: 'hierarchy',
30446
+ source: 'source',
30447
+ target: 'target'
29375
30448
  };
29376
30449
  const zTimeFormat = schemas_object({
29377
30450
  type: schemas_enum([
@@ -29519,6 +30592,8 @@ self.R = R;
29519
30592
  encodingAngle: schemas_string(),
29520
30593
  encodingPlayer: schemas_string(),
29521
30594
  encodingHierarchy: schemas_string(),
30595
+ encodingSource: schemas_string().optional(),
30596
+ encodingTarget: schemas_string().optional(),
29522
30597
  colorItems: schemas_array(schemas_string()),
29523
30598
  colorIdMap: record(schemas_string(), schemas_object({
29524
30599
  id: schemas_string(),
@@ -29546,6 +30621,8 @@ self.R = R;
29546
30621
  column: schemas_array(schemas_string()).nullish(),
29547
30622
  player: schemas_array(schemas_string()).nullish(),
29548
30623
  hierarchy: schemas_array(schemas_string()).nullish(),
30624
+ source: schemas_array(schemas_string()).nullish(),
30625
+ target: schemas_array(schemas_string()).nullish(),
29549
30626
  value: schemas_array(schemas_string()).nullish(),
29550
30627
  q1: schemas_array(schemas_string()).nullish(),
29551
30628
  q3: schemas_array(schemas_string()).nullish(),
@@ -29569,7 +30646,9 @@ self.R = R;
29569
30646
  row: 'row',
29570
30647
  column: 'column',
29571
30648
  player: 'player',
29572
- hierarchy: 'hierarchy'
30649
+ hierarchy: 'hierarchy',
30650
+ source: 'source',
30651
+ target: 'target'
29573
30652
  };
29574
30653
  const zMeasureEncoding = schemas_enum([
29575
30654
  'primaryYAxis',
@@ -30735,6 +31814,22 @@ self.R = R;
30735
31814
  legend: zLegend.nullish(),
30736
31815
  pivotGrid: zPivotChartGridConfig.nullish()
30737
31816
  });
31817
+ const zHierarchySankeyConfig = schemas_object({
31818
+ backgroundColor: zBackgroundColor.nullish(),
31819
+ label: zLabel.nullish(),
31820
+ color: zColor.nullish(),
31821
+ tooltip: zTooltip.nullish(),
31822
+ legend: zLegend.nullish(),
31823
+ pivotGrid: zPivotChartGridConfig.nullish()
31824
+ });
31825
+ const zSankeyConfig = schemas_object({
31826
+ backgroundColor: zBackgroundColor.nullish(),
31827
+ label: zLabel.nullish(),
31828
+ color: zColor.nullish(),
31829
+ tooltip: zTooltip.nullish(),
31830
+ legend: zLegend.nullish(),
31831
+ pivotGrid: zPivotChartGridConfig.nullish()
31832
+ });
30738
31833
  const zConfig = schemas_object({
30739
31834
  table: zTableConfig.nullish(),
30740
31835
  pivotTable: zPivotTableConfig.nullish(),
@@ -30763,6 +31858,8 @@ self.R = R;
30763
31858
  treeMap: zTreeMapConfig.nullish(),
30764
31859
  sunburst: zSunburstConfig.nullish(),
30765
31860
  circlePacking: zCirclePackingConfig.nullish(),
31861
+ hierarchySankey: zHierarchySankeyConfig.nullish(),
31862
+ sankey: zSankeyConfig.nullish(),
30766
31863
  funnel: zFunnelConfig.nullish(),
30767
31864
  heatmap: zHeatmapConfig.nullish(),
30768
31865
  boxPlot: zBoxplotConfig.nullish(),
@@ -31635,6 +32732,34 @@ self.R = R;
31635
32732
  theme: zTheme.nullish(),
31636
32733
  locale: zLocale.nullish()
31637
32734
  });
32735
+ const zHierarchySankey = schemas_object({
32736
+ chartType: literal('hierarchySankey'),
32737
+ dataset: zDataset.nullish(),
32738
+ dimensions: zDimensions.nullish(),
32739
+ measures: zMeasures.nullish(),
32740
+ page: zPage.nullish(),
32741
+ backgroundColor: zBackgroundColor.nullish(),
32742
+ color: zColor.nullish(),
32743
+ label: zLabel.nullish(),
32744
+ legend: zLegend.nullish(),
32745
+ tooltip: zTooltip.nullish(),
32746
+ theme: zTheme.nullish(),
32747
+ locale: zLocale.nullish()
32748
+ });
32749
+ const zSankey = schemas_object({
32750
+ chartType: literal('sankey'),
32751
+ dataset: zDataset.nullish(),
32752
+ dimensions: zDimensions.nullish(),
32753
+ measures: zMeasures.nullish(),
32754
+ page: zPage.nullish(),
32755
+ backgroundColor: zBackgroundColor.nullish(),
32756
+ color: zColor.nullish(),
32757
+ label: zLabel.nullish(),
32758
+ legend: zLegend.nullish(),
32759
+ tooltip: zTooltip.nullish(),
32760
+ theme: zTheme.nullish(),
32761
+ locale: zLocale.nullish()
32762
+ });
31638
32763
  const zRacePie = schemas_object({
31639
32764
  chartType: literal('racePie'),
31640
32765
  dataset: zDataset.nullish(),
@@ -31753,6 +32878,8 @@ self.R = R;
31753
32878
  zTreeMap,
31754
32879
  zSunburst,
31755
32880
  zCirclePacking,
32881
+ zHierarchySankey,
32882
+ zSankey,
31756
32883
  zRaceBar,
31757
32884
  zRaceColumn,
31758
32885
  zRaceScatter,