@visactor/vseed 0.4.12 → 0.4.14

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 (176) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/dataReshape/dataReshapeByEncoding.d.ts +2 -1
  4. package/dist/esm/dataReshape/dataReshapeByEncoding.js +7 -2
  5. package/dist/esm/dataReshape/dataReshapeByEncoding.js.map +1 -1
  6. package/dist/esm/dataReshape/unfoldDimensions.d.ts +1 -0
  7. package/dist/esm/dataReshape/unfoldDimensions.js +5 -4
  8. package/dist/esm/dataReshape/unfoldDimensions.js.map +1 -1
  9. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js +11 -3
  10. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -1
  11. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js +4 -2
  12. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js.map +1 -1
  13. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js +2 -1
  14. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js.map +1 -1
  15. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js +8 -3
  16. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js.map +1 -1
  17. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js +4 -2
  18. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js.map +1 -1
  19. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.js +11 -2
  20. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.js.map +1 -1
  21. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js +4 -2
  22. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js.map +1 -1
  23. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js +2 -1
  24. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js.map +1 -1
  25. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js +8 -2
  26. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js.map +1 -1
  27. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js +4 -2
  28. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js.map +1 -1
  29. package/dist/esm/pipeline/spec/chart/pipeline/area.js +6 -2
  30. package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
  31. package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +6 -2
  32. package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
  33. package/dist/esm/pipeline/spec/chart/pipeline/bar.js +6 -2
  34. package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
  35. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +6 -2
  36. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
  37. package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +6 -2
  38. package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
  39. package/dist/esm/pipeline/spec/chart/pipeline/column.js +6 -2
  40. package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
  41. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +6 -2
  42. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
  43. package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +6 -2
  44. package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
  45. package/dist/esm/pipeline/spec/chart/pipeline/donut.js +6 -2
  46. package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
  47. package/dist/esm/pipeline/spec/chart/pipeline/funnel.js +6 -2
  48. package/dist/esm/pipeline/spec/chart/pipeline/funnel.js.map +1 -1
  49. package/dist/esm/pipeline/spec/chart/pipeline/line.js +6 -2
  50. package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
  51. package/dist/esm/pipeline/spec/chart/pipeline/pie.js +6 -2
  52. package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
  53. package/dist/esm/pipeline/spec/chart/pipeline/raceBar.js +3 -1
  54. package/dist/esm/pipeline/spec/chart/pipeline/raceBar.js.map +1 -1
  55. package/dist/esm/pipeline/spec/chart/pipeline/raceColumn.js +3 -1
  56. package/dist/esm/pipeline/spec/chart/pipeline/raceColumn.js.map +1 -1
  57. package/dist/esm/pipeline/spec/chart/pipeline/raceDonut.js +3 -1
  58. package/dist/esm/pipeline/spec/chart/pipeline/raceDonut.js.map +1 -1
  59. package/dist/esm/pipeline/spec/chart/pipeline/raceLine.js +3 -1
  60. package/dist/esm/pipeline/spec/chart/pipeline/raceLine.js.map +1 -1
  61. package/dist/esm/pipeline/spec/chart/pipeline/racePie.js +3 -1
  62. package/dist/esm/pipeline/spec/chart/pipeline/racePie.js.map +1 -1
  63. package/dist/esm/pipeline/spec/chart/pipeline/radar.js +6 -2
  64. package/dist/esm/pipeline/spec/chart/pipeline/radar.js.map +1 -1
  65. package/dist/esm/pipeline/spec/chart/pipeline/rose.js +6 -2
  66. package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
  67. package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js +6 -2
  68. package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
  69. package/dist/esm/pipeline/spec/chart/pipes/axes/heatmapBandAxis.js +14 -0
  70. package/dist/esm/pipeline/spec/chart/pipes/axes/heatmapBandAxis.js.map +1 -1
  71. package/dist/esm/pipeline/spec/chart/pipes/axes/radarAngle.js +27 -1
  72. package/dist/esm/pipeline/spec/chart/pipes/axes/radarAngle.js.map +1 -1
  73. package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js +15 -2
  74. package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js.map +1 -1
  75. package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js +15 -2
  76. package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js.map +1 -1
  77. package/dist/esm/pipeline/spec/chart/pipes/label/label.d.ts +3 -3
  78. package/dist/esm/pipeline/spec/chart/pipes/label/label.js +4 -3
  79. package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
  80. package/dist/esm/pipeline/spec/chart/pipes/label/labelBoxPlot.js +1 -1
  81. package/dist/esm/pipeline/spec/chart/pipes/label/labelBoxPlot.js.map +1 -1
  82. package/dist/esm/pipeline/spec/chart/pipes/label/labelCirclePacking.js +18 -1
  83. package/dist/esm/pipeline/spec/chart/pipes/label/labelCirclePacking.js.map +1 -1
  84. package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js +1 -1
  85. package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js.map +1 -1
  86. package/dist/esm/pipeline/spec/chart/pipes/label/labelPie.js +1 -1
  87. package/dist/esm/pipeline/spec/chart/pipes/label/labelPie.js.map +1 -1
  88. package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js +1 -1
  89. package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js.map +1 -1
  90. package/dist/esm/pipeline/spec/chart/pipes/label/labelSunburst.js +18 -1
  91. package/dist/esm/pipeline/spec/chart/pipes/label/labelSunburst.js.map +1 -1
  92. package/dist/esm/pipeline/spec/chart/pipes/label/labelTreeMapGroup.js +12 -4
  93. package/dist/esm/pipeline/spec/chart/pipes/label/labelTreeMapGroup.js.map +1 -1
  94. package/dist/esm/pipeline/spec/chart/pipes/label/labelTreeMapLeaf.js +4 -2
  95. package/dist/esm/pipeline/spec/chart/pipes/label/labelTreeMapLeaf.js.map +1 -1
  96. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js +5 -0
  97. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js.map +1 -1
  98. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js +5 -0
  99. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js.map +1 -1
  100. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.d.ts +5 -3
  101. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +51 -32
  102. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
  103. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js +8 -7
  104. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js.map +1 -1
  105. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js +15 -2
  106. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js.map +1 -1
  107. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js +3 -2
  108. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js.map +1 -1
  109. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHierarchy.js +6 -5
  110. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHierarchy.js.map +1 -1
  111. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js +3 -2
  112. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
  113. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipTreeMap.js +14 -6
  114. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipTreeMap.js.map +1 -1
  115. package/dist/esm/pipeline/spec/table/pipes/columns/dimensionsToColumns.js +6 -2
  116. package/dist/esm/pipeline/spec/table/pipes/columns/dimensionsToColumns.js.map +1 -1
  117. package/dist/esm/pipeline/spec/table/pipes/columns/pivotColumns.js +8 -3
  118. package/dist/esm/pipeline/spec/table/pipes/columns/pivotColumns.js.map +1 -1
  119. package/dist/esm/pipeline/spec/table/pipes/rows/pivotRows.js +8 -3
  120. package/dist/esm/pipeline/spec/table/pipes/rows/pivotRows.js.map +1 -1
  121. package/dist/esm/pipeline/utils/constant.d.ts +1 -0
  122. package/dist/esm/pipeline/utils/constant.js +1 -0
  123. package/dist/esm/pipeline/utils/constant.js.map +1 -1
  124. package/dist/esm/pipeline/utils/format/createFormatterByDimension.d.ts +2 -0
  125. package/dist/esm/pipeline/utils/format/createFormatterByDimension.js +10 -0
  126. package/dist/esm/pipeline/utils/format/createFormatterByDimension.js.map +1 -0
  127. package/dist/esm/pipeline/utils/format/createTimeFormatter.d.ts +2 -0
  128. package/dist/esm/pipeline/utils/format/createTimeFormatter.js +154 -0
  129. package/dist/esm/pipeline/utils/format/createTimeFormatter.js.map +1 -0
  130. package/dist/esm/pipeline/utils/format/index.d.ts +2 -0
  131. package/dist/esm/pipeline/utils/format/index.js +2 -0
  132. package/dist/esm/types/chartType/area/zArea.d.ts +12 -0
  133. package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +12 -0
  134. package/dist/esm/types/chartType/bar/zBar.d.ts +12 -0
  135. package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +12 -0
  136. package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +12 -0
  137. package/dist/esm/types/chartType/boxPlot/zBoxPlot.d.ts +12 -0
  138. package/dist/esm/types/chartType/circlePacking/zCirclePacking.d.ts +12 -0
  139. package/dist/esm/types/chartType/column/zColumn.d.ts +12 -0
  140. package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +12 -0
  141. package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +12 -0
  142. package/dist/esm/types/chartType/donut/zDonut.d.ts +12 -0
  143. package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +12 -0
  144. package/dist/esm/types/chartType/funnel/zFunnel.d.ts +12 -0
  145. package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +12 -0
  146. package/dist/esm/types/chartType/histogram/zHistogram.d.ts +12 -0
  147. package/dist/esm/types/chartType/line/zLine.d.ts +12 -0
  148. package/dist/esm/types/chartType/pie/zPie.d.ts +12 -0
  149. package/dist/esm/types/chartType/pivotTable/zPivotTable.d.ts +12 -0
  150. package/dist/esm/types/chartType/raceBar/zRaceBar.d.ts +12 -0
  151. package/dist/esm/types/chartType/raceColumn/zRaceColumn.d.ts +12 -0
  152. package/dist/esm/types/chartType/raceDonut/zRaceDonut.d.ts +12 -0
  153. package/dist/esm/types/chartType/raceLine/zRaceLine.d.ts +12 -0
  154. package/dist/esm/types/chartType/racePie/zRacePie.d.ts +12 -0
  155. package/dist/esm/types/chartType/raceScatter/zRaceScatter.d.ts +12 -0
  156. package/dist/esm/types/chartType/radar/zRadar.d.ts +12 -0
  157. package/dist/esm/types/chartType/rose/zRose.d.ts +12 -0
  158. package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +12 -0
  159. package/dist/esm/types/chartType/scatter/zScatter.d.ts +12 -0
  160. package/dist/esm/types/chartType/sunburst/zSunburst.d.ts +12 -0
  161. package/dist/esm/types/chartType/table/zTable.d.ts +12 -0
  162. package/dist/esm/types/chartType/treeMap/zTreeMap.d.ts +12 -0
  163. package/dist/esm/types/properties/cellStyle/bodyCellStyle.d.ts +1 -1
  164. package/dist/esm/types/properties/cellStyle/bodyCellStyle.js.map +1 -1
  165. package/dist/esm/types/properties/dimensions/baseDimension.d.ts +5 -0
  166. package/dist/esm/types/properties/dimensions/zDimensions.d.ts +36 -0
  167. package/dist/esm/types/properties/dimensions/zDimensions.js +3 -1
  168. package/dist/esm/types/properties/dimensions/zDimensions.js.map +1 -1
  169. package/dist/esm/types/properties/format/index.d.ts +1 -0
  170. package/dist/esm/types/properties/format/index.js +1 -0
  171. package/dist/esm/types/properties/format/timeFormat.d.ts +20 -0
  172. package/dist/esm/types/properties/format/timeFormat.js +16 -0
  173. package/dist/esm/types/properties/format/timeFormat.js.map +1 -0
  174. package/dist/umd/index.js +592 -147
  175. package/dist/umd/index.js.map +1 -1
  176. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -1092,6 +1092,7 @@
1092
1092
  zMeasures: ()=>zMeasures,
1093
1093
  darkTheme: ()=>darkTheme,
1094
1094
  isFieldSelector: ()=>isFieldSelector,
1095
+ zTimeFormat: ()=>zTimeFormat,
1095
1096
  selectByField: ()=>selectByField,
1096
1097
  isVTable: ()=>isVTable,
1097
1098
  terminateWorkerPool: ()=>terminateWorkerPool,
@@ -1166,10 +1167,10 @@
1166
1167
  selectByPartial: ()=>selectByPartial,
1167
1168
  columnPercentSpecPipeline: ()=>columnPercentSpecPipeline,
1168
1169
  areaAdvancedPipeline: ()=>areaAdvancedPipeline,
1169
- areaPercentSpecPipeline: ()=>areaPercentSpecPipeline,
1170
+ barParallelSpecPipeline: ()=>barParallelSpecPipeline,
1170
1171
  isRowWithFieldDynamicFilter: ()=>isRowWithFieldDynamicFilter,
1171
1172
  executeFilterCode: ()=>executeFilterCode,
1172
- barParallelSpecPipeline: ()=>barParallelSpecPipeline,
1173
+ areaPercentSpecPipeline: ()=>areaPercentSpecPipeline,
1173
1174
  BAND_AXIS_INNER_OFFSET_IN_PIVOT: ()=>2,
1174
1175
  zBar: ()=>zBar,
1175
1176
  pieAdvancedPipeline: ()=>pieAdvancedPipeline,
@@ -1250,12 +1251,12 @@
1250
1251
  Builder: ()=>Builder,
1251
1252
  zWhiskersConfig: ()=>zWhiskersConfig,
1252
1253
  matchDynamicFilterResult: ()=>matchDynamicFilterResult,
1254
+ createTimeFormatter: ()=>createTimeFormatter,
1253
1255
  revisedBoxPlotFieldKey: ()=>revisedBoxPlotFieldKey,
1254
- sunburstSpecPipeline: ()=>sunburstSpecPipeline,
1255
1256
  radarSpecPipeline: ()=>radarSpecPipeline,
1256
1257
  OutliersMeasureId: ()=>OutliersMeasureId,
1258
+ sunburstSpecPipeline: ()=>sunburstSpecPipeline,
1257
1259
  zRadar: ()=>zRadar,
1258
- zTable: ()=>zTable,
1259
1260
  histogramSpecPipeline: ()=>histogramSpecPipeline,
1260
1261
  isValueDynamicFilter: ()=>isValueDynamicFilter,
1261
1262
  racePieAdvancedPipeline: ()=>racePieAdvancedPipeline,
@@ -1274,6 +1275,7 @@
1274
1275
  createNumFormatter: ()=>createNumFormatter,
1275
1276
  HAS_BUILTIN_UTILS: ()=>HAS_BUILTIN_UTILS,
1276
1277
  zAreaConfig: ()=>zAreaConfig,
1278
+ zTable: ()=>zTable,
1277
1279
  zUnfoldInfo: ()=>zUnfoldInfo,
1278
1280
  zPage: ()=>zPage,
1279
1281
  zLine: ()=>zLine,
@@ -1339,18 +1341,19 @@
1339
1341
  zScatterConfig: ()=>zScatterConfig,
1340
1342
  zRaceLine: ()=>zRaceLine,
1341
1343
  zTooltip: ()=>zTooltip,
1344
+ isDualAxisChartType: ()=>isDualAxisChartType,
1342
1345
  isBarLikeChart: ()=>isBarLikeChart,
1343
- barParallelAdvancedPipeline: ()=>barParallelAdvancedPipeline,
1344
1346
  deleteMeasureTreeByCallback: ()=>deleteMeasureTreeByCallback,
1347
+ barParallelAdvancedPipeline: ()=>barParallelAdvancedPipeline,
1345
1348
  barPercentSpecPipeline: ()=>barPercentSpecPipeline,
1346
- circlePackingAdvancedPipeline: ()=>circlePackingAdvancedPipeline,
1347
1349
  dataReshapeByEncoding: ()=>dataReshapeByEncoding,
1348
1350
  lineSpecPipeline: ()=>lineSpecPipeline,
1349
- isDualAxisChartType: ()=>isDualAxisChartType,
1351
+ circlePackingAdvancedPipeline: ()=>circlePackingAdvancedPipeline,
1350
1352
  matchesFieldSelector: ()=>matchesFieldSelector,
1351
1353
  raceBarAdvancedPipeline: ()=>raceBarAdvancedPipeline,
1352
1354
  raceColumnAdvancedPipeline: ()=>raceColumnAdvancedPipeline,
1353
1355
  isPositionMeasure: ()=>isPositionMeasure,
1356
+ createFormatterByDimension: ()=>createFormatterByDimension,
1354
1357
  zBarPercentConfig: ()=>zBarPercentConfig,
1355
1358
  zDimensionGroup: ()=>zDimensionGroup,
1356
1359
  zRacePie: ()=>zRacePie
@@ -3108,6 +3111,7 @@ self.R = R;
3108
3111
  RaceBar: 'raceBar',
3109
3112
  RaceColumn: 'raceColumn',
3110
3113
  RaceScatter: 'raceScatter',
3114
+ RaceLine: 'raceLine',
3111
3115
  BarPercent: 'barPercent',
3112
3116
  BarParallel: 'barParallel',
3113
3117
  Area: 'area',
@@ -3755,6 +3759,161 @@ self.R = R;
3755
3759
  }
3756
3760
  };
3757
3761
  };
3762
+ const DEFAULT_SEPARATOR = '-';
3763
+ const parseTimeValue = (value)=>{
3764
+ if (null == value) return;
3765
+ if ('number' == typeof value && Number.isFinite(value)) {
3766
+ const date = new Date(value);
3767
+ return Number.isNaN(date.getTime()) ? void 0 : date;
3768
+ }
3769
+ const text = String(value).trim();
3770
+ if (!text) return;
3771
+ const timestamp = Number(text);
3772
+ if (!Number.isNaN(timestamp)) {
3773
+ const date = new Date(timestamp);
3774
+ return Number.isNaN(date.getTime()) ? void 0 : date;
3775
+ }
3776
+ const date = new Date(text);
3777
+ return Number.isNaN(date.getTime()) ? void 0 : date;
3778
+ };
3779
+ const parseTextParts = (value)=>{
3780
+ if (null == value) return;
3781
+ const text = String(value).trim();
3782
+ if (!text) return;
3783
+ const match = text.match(/^\\s*(\\d{4})-(\\d{2})-(\\d{2})(?:[T\\s](\\d{2}):(\\d{2}):(\\d{2}))?\\s*$/);
3784
+ if (!match) return;
3785
+ const [, year, month, day, hour, minute, second] = match;
3786
+ return {
3787
+ year: Number(year),
3788
+ month: Number(month),
3789
+ day: Number(day),
3790
+ hour: hour ? Number(hour) : 0,
3791
+ minute: minute ? Number(minute) : 0,
3792
+ second: second ? Number(second) : 0
3793
+ };
3794
+ };
3795
+ const pad2 = (value)=>String(value).padStart(2, '0');
3796
+ const getWeekNumber = (date)=>{
3797
+ const utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
3798
+ const day = utcDate.getUTCDay() || 7;
3799
+ utcDate.setUTCDate(utcDate.getUTCDate() + 4 - day);
3800
+ const yearStart = new Date(Date.UTC(utcDate.getUTCFullYear(), 0, 1));
3801
+ const week = Math.ceil(((utcDate.getTime() - yearStart.getTime()) / 86400000 + 1) / 7);
3802
+ return {
3803
+ year: utcDate.getUTCFullYear(),
3804
+ week
3805
+ };
3806
+ };
3807
+ const getIntlFormatter = (granularity, locale)=>{
3808
+ const options = {};
3809
+ switch(granularity){
3810
+ case 'year':
3811
+ options.year = 'numeric';
3812
+ break;
3813
+ case 'quarter':
3814
+ options.year = 'numeric';
3815
+ options.month = '2-digit';
3816
+ break;
3817
+ case 'month':
3818
+ options.year = 'numeric';
3819
+ options.month = '2-digit';
3820
+ break;
3821
+ case 'week':
3822
+ options.year = 'numeric';
3823
+ options.month = '2-digit';
3824
+ options.day = '2-digit';
3825
+ break;
3826
+ case 'day':
3827
+ options.year = 'numeric';
3828
+ options.month = '2-digit';
3829
+ options.day = '2-digit';
3830
+ break;
3831
+ case 'hour':
3832
+ options.year = 'numeric';
3833
+ options.month = '2-digit';
3834
+ options.day = '2-digit';
3835
+ options.hour = '2-digit';
3836
+ break;
3837
+ case 'minute':
3838
+ options.year = 'numeric';
3839
+ options.month = '2-digit';
3840
+ options.day = '2-digit';
3841
+ options.hour = '2-digit';
3842
+ options.minute = '2-digit';
3843
+ break;
3844
+ case 'second':
3845
+ options.year = 'numeric';
3846
+ options.month = '2-digit';
3847
+ options.day = '2-digit';
3848
+ options.hour = '2-digit';
3849
+ options.minute = '2-digit';
3850
+ options.second = '2-digit';
3851
+ break;
3852
+ }
3853
+ return new Intl.DateTimeFormat(locale, options);
3854
+ };
3855
+ const formatQuarter = (date, locale, rawText)=>{
3856
+ const parts = rawText ? parseTextParts(rawText) : void 0;
3857
+ const year = parts?.year ?? date.getFullYear();
3858
+ const month = parts?.month ?? date.getMonth() + 1;
3859
+ const quarter = Math.floor((month - 1) / 3) + 1;
3860
+ return 'zh-CN' === locale ? `${year}年Q${quarter}` : `${year} Q${quarter}`;
3861
+ };
3862
+ const formatWeek = (date, locale, rawText)=>{
3863
+ const parts = rawText ? parseTextParts(rawText) : void 0;
3864
+ const weekInfo = parts ? getWeekNumber(new Date(Date.UTC(parts.year, parts.month - 1, parts.day))) : getWeekNumber(date);
3865
+ return 'zh-CN' === locale ? `${weekInfo.year}年第${weekInfo.week}周` : `${weekInfo.year} W${weekInfo.week}`;
3866
+ };
3867
+ const formatDefault = (date, granularity, formatter, locale, rawText)=>{
3868
+ if ('quarter' === granularity) return formatQuarter(date, locale, rawText);
3869
+ if ('week' === granularity) return formatWeek(date, locale, rawText);
3870
+ const parts = formatter.formatToParts(date);
3871
+ const map = parts.reduce((prev, part)=>{
3872
+ prev[part.type] = part.value;
3873
+ return prev;
3874
+ }, {});
3875
+ const rawParts = rawText ? parseTextParts(rawText) : void 0;
3876
+ const year = map.year ?? String(rawParts?.year ?? date.getFullYear());
3877
+ const month = map.month ?? pad2(rawParts?.month ?? date.getMonth() + 1);
3878
+ const day = map.day ?? pad2(rawParts?.day ?? date.getDate());
3879
+ const hour = map.hour ?? pad2(rawParts?.hour ?? date.getHours());
3880
+ const minute = map.minute ?? pad2(rawParts?.minute ?? date.getMinutes());
3881
+ const second = map.second ?? pad2(rawParts?.second ?? date.getSeconds());
3882
+ switch(granularity){
3883
+ case 'year':
3884
+ return year;
3885
+ case 'month':
3886
+ return `${year}-${month}`;
3887
+ case 'day':
3888
+ return `${year}-${month}-${day}`;
3889
+ case 'hour':
3890
+ return `${year}-${month}-${day} ${hour}`;
3891
+ case 'minute':
3892
+ return `${year}-${month}-${day} ${hour}:${minute}`;
3893
+ case 'second':
3894
+ return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
3895
+ default:
3896
+ return formatter.format(date);
3897
+ }
3898
+ };
3899
+ const createTimeFormatter = (format, fallbackLocale = intl.getLocale())=>{
3900
+ if (!format) return (value)=>String(value);
3901
+ const { type } = format;
3902
+ const finalLocale = fallbackLocale;
3903
+ const intlFormatter = getIntlFormatter(type, finalLocale);
3904
+ return (value)=>{
3905
+ const date = parseTimeValue(value);
3906
+ if (!date) return String(value);
3907
+ const rawText = null == value ? void 0 : String(value);
3908
+ const formatted = formatDefault(date, type, intlFormatter, finalLocale, rawText);
3909
+ return formatted.replaceAll('/', DEFAULT_SEPARATOR).replaceAll('.', DEFAULT_SEPARATOR);
3910
+ };
3911
+ };
3912
+ const createFormatterByDimension = (dimension, locale = intl.getLocale())=>{
3913
+ if (!dimension) return (v)=>String(v);
3914
+ if (dimension.timeFormat) return createTimeFormatter(dimension.timeFormat, locale);
3915
+ return (v)=>String(v);
3916
+ };
3758
3917
  function extractLeafIds(tree) {
3759
3918
  const leafNodes = findTreeNodesBy(tree, ()=>true);
3760
3919
  return new Set(leafNodes.map((node)=>node.id));
@@ -3794,7 +3953,11 @@ self.R = R;
3794
3953
  };
3795
3954
  const eachNode = (node)=>{
3796
3955
  if (isMeasure(node)) return {
3797
- width: 'auto'
3956
+ width: 'auto',
3957
+ fieldFormat: (datum)=>{
3958
+ const formatter = createFormatterByDimension(node, advancedVSeed.locale);
3959
+ return formatter(datum[node.id]);
3960
+ }
3798
3961
  };
3799
3962
  return {};
3800
3963
  };
@@ -4471,11 +4634,15 @@ self.R = R;
4471
4634
  const columns = dimensions.filter((item)=>encoding.column?.includes(item.id));
4472
4635
  return {
4473
4636
  ...spec,
4474
- columns: columns.map((item)=>({
4637
+ columns: columns.map((item)=>{
4638
+ const formatter = createFormatterByDimension(item, advancedVSeed.locale);
4639
+ return {
4475
4640
  dimensionKey: item.id,
4476
4641
  title: item.alias || item.id,
4477
- width: 'auto'
4478
- }))
4642
+ width: 'auto',
4643
+ headerFormat: (value)=>formatter(value)
4644
+ };
4645
+ })
4479
4646
  };
4480
4647
  };
4481
4648
  const pivotRows = (spec, context)=>{
@@ -4485,11 +4652,15 @@ self.R = R;
4485
4652
  const rows = dimensions.filter((item)=>encoding.row?.includes(item.id));
4486
4653
  return {
4487
4654
  ...spec,
4488
- rows: rows.map((item)=>({
4655
+ rows: rows.map((item)=>{
4656
+ const formatter = createFormatterByDimension(item, advancedVSeed.locale);
4657
+ return {
4489
4658
  dimensionKey: item.id,
4490
4659
  title: item.alias || item.id,
4491
- width: 'auto'
4492
- }))
4660
+ width: 'auto',
4661
+ headerFormat: (value)=>formatter(value)
4662
+ };
4663
+ })
4493
4664
  };
4494
4665
  };
4495
4666
  const pivotIndicators = (spec, context)=>{
@@ -5082,7 +5253,7 @@ self.R = R;
5082
5253
  };
5083
5254
  };
5084
5255
  const unfoldDimensions = (dataset, dimensions, encoding, options)=>{
5085
- const { separator } = options;
5256
+ const { separator, formatDimensionValue } = options;
5086
5257
  const unfoldInfo = {
5087
5258
  encodingAngle: AngleEncoding,
5088
5259
  encodingX: XEncoding,
@@ -5119,7 +5290,7 @@ self.R = R;
5119
5290
  datum[ColorIdEncoding] = colorId;
5120
5291
  colorIdMap[colorId] = {
5121
5292
  id: colorId,
5122
- alias: getColorAliasItem(ColorEncoding, colorDimensions, datum, separator)
5293
+ alias: getColorAliasItem(ColorEncoding, colorDimensions, datum, separator, formatDimensionValue)
5123
5294
  };
5124
5295
  colorItems.add(colorId);
5125
5296
  }
@@ -5133,15 +5304,16 @@ self.R = R;
5133
5304
  const applyEncoding = (encoding, dimensions, datum, separator)=>{
5134
5305
  if (encoding && dimensions.length) datum[encoding] = dimensions.map((dim)=>String(datum[dim.id])).join(separator);
5135
5306
  };
5136
- const getColorAliasItem = (encoding, dimensions, datum, separator)=>{
5307
+ const getColorAliasItem = (encoding, dimensions, datum, separator, formatDimensionValue)=>{
5137
5308
  if (encoding && dimensions.length) return dimensions.map((dim)=>{
5138
5309
  if (dim.id === MeasureId) return String(datum[MeasureName]);
5139
- return String(datum[dim.id]);
5310
+ const rawValue = datum[dim.id];
5311
+ return formatDimensionValue ? formatDimensionValue(dim, rawValue) : String(rawValue);
5140
5312
  }).join(separator);
5141
5313
  return '';
5142
5314
  };
5143
5315
  const dataReshapeByEncoding = (dataset, dimensions, measures, encoding, options)=>{
5144
- const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, colorItemAsId = false, colorMeasureId, omitIds } = options || {};
5316
+ const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, colorItemAsId = false, colorMeasureId, locale, omitIds } = options || {};
5145
5317
  const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, {
5146
5318
  measureId: foldMeasureId,
5147
5319
  measureName: foldMeasureName,
@@ -5152,7 +5324,11 @@ self.R = R;
5152
5324
  const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, dimensions, encoding, {
5153
5325
  foldMeasureId,
5154
5326
  separator: "-",
5155
- colorItemAsId
5327
+ colorItemAsId,
5328
+ formatDimensionValue: (dimension, value)=>{
5329
+ const formatter = createFormatterByDimension(dimension, locale);
5330
+ return formatter(value);
5331
+ }
5156
5332
  });
5157
5333
  return {
5158
5334
  dataset: finalDataset,
@@ -5192,7 +5368,8 @@ self.R = R;
5192
5368
  const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeByEncoding(dataset, T(advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [], (item)=>item.id), T(advancedVSeed.reshapeMeasures?.[0] ?? [], (item)=>item.id), encoding, {
5193
5369
  colorItemAsId: false,
5194
5370
  colorMeasureId,
5195
- omitIds: allMeasuresIds
5371
+ omitIds: allMeasuresIds,
5372
+ locale: advancedVSeed.locale
5196
5373
  });
5197
5374
  return {
5198
5375
  ...result,
@@ -5226,7 +5403,8 @@ self.R = R;
5226
5403
  colorItemAsId: false,
5227
5404
  foldMeasureValue: `${FoldMeasureValue}${groupId}`,
5228
5405
  colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
5229
- omitIds: allMeasuresIds
5406
+ omitIds: allMeasuresIds,
5407
+ locale: advancedVSeed.locale
5230
5408
  });
5231
5409
  const reshapeInfo = {
5232
5410
  id: `${groupId}`,
@@ -5660,13 +5838,25 @@ self.R = R;
5660
5838
  0.1
5661
5839
  ];
5662
5840
  if (common_isNil(bandAxis.title?.text)) bandAxis.title.text = defaultTitleText(measures, dimensions, encoding.x);
5663
- if (onlyMeasureId && bandAxis.label) {
5841
+ if (bandAxis.label) {
5664
5842
  const allDatasetReshapeInfo = pivotAllDatasetReshapeInfo || datasetReshapeInfo;
5665
5843
  const colorIdMap = allDatasetReshapeInfo.reduce((prev, cur)=>({
5666
5844
  ...prev,
5667
5845
  ...cur.unfoldInfo.colorIdMap
5668
5846
  }), {});
5669
- bandAxis.label.formatMethod = (text)=>common_isArray(text) ? text : colorIdMap[String(text)]?.alias ?? text;
5847
+ const dimensionMap = new Map(dimensions.map((item)=>[
5848
+ item.id,
5849
+ item
5850
+ ]));
5851
+ const dimIds = (encoding.x || []).filter((v)=>v !== MeasureId);
5852
+ const dimFormatter = dimIds.length ? createFormatterByDimension(dimensionMap.get(dimIds[0]), advancedVSeed.locale) : null;
5853
+ bandAxis.label.formatMethod = (text)=>{
5854
+ if (common_isArray(text)) return text;
5855
+ if (onlyMeasureId) return colorIdMap[String(text)]?.alias ?? text;
5856
+ const rawText = String(text ?? '');
5857
+ if (!dimFormatter) return rawText;
5858
+ return dimFormatter(rawText);
5859
+ };
5670
5860
  }
5671
5861
  result.axes = [
5672
5862
  ...result.axes,
@@ -6340,7 +6530,7 @@ self.R = R;
6340
6530
  const percentValue = num / sum;
6341
6531
  return formatter(percentValue);
6342
6532
  };
6343
- const buildLabel = (label, vseedMeasures = [], vseedDimensions = [], advancedVSeedDimensions, advancedVSeedMeasures, encoding, foldInfoList)=>{
6533
+ const buildLabel = (label, vseedMeasures = [], vseedDimensions = [], advancedVSeedDimensions, advancedVSeedMeasures, encoding, foldInfoList, locale = 'zh-CN')=>{
6344
6534
  const { enable, wrap, showValue, showValuePercent, showDimension, labelOverlap, labelColorSmartInvert, labelStroke, labelColor, labelFontSize, labelFontWeight, labelBackgroundColor, labelPosition, autoFormat, numFormat = {} } = label;
6345
6535
  const hasDimLabelEncoding = vseedDimensions.some((item)=>encoding.label?.includes(item.id));
6346
6536
  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);
@@ -6360,7 +6550,8 @@ self.R = R;
6360
6550
  const result = [];
6361
6551
  const dimLabels = labelDims.map((item)=>{
6362
6552
  const id = item.id;
6363
- return datum[id];
6553
+ const formatter = createFormatterByDimension(item, locale);
6554
+ return formatter(datum[id]);
6364
6555
  });
6365
6556
  const meaLabels = labelMeas.map((item)=>generateMeasureValue(datum[item.id], item, autoFormat, numFormat));
6366
6557
  result.push(...dimLabels);
@@ -6481,37 +6672,55 @@ self.R = R;
6481
6672
  const color = actualTooltip.content[0].shapeFill ?? 'transparent';
6482
6673
  setWholeIcon(shapeContainer, color);
6483
6674
  };
6484
- const tooltip_tooltip = (spec, context)=>{
6485
- const result = {
6486
- ...spec
6487
- };
6488
- const { advancedVSeed, vseed } = context;
6489
- const { measures = [], datasetReshapeInfo, chartType, dimensions = [], encoding, reshapeMeasures = [] } = advancedVSeed;
6490
- const baseConfig = advancedVSeed.config[chartType];
6491
- const { tooltip = {
6492
- enable: true
6493
- } } = baseConfig;
6494
- const { enable = true } = tooltip;
6495
- const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
6496
- result.tooltip = {
6497
- style: getTooltipStyle(tooltip),
6498
- visible: !!enable,
6499
- mark: {
6500
- title: {
6501
- visible: false
6675
+ const tooltip_tooltip = (tooltipOptions)=>(spec, context)=>{
6676
+ const result = {
6677
+ ...spec
6678
+ };
6679
+ if (!context) return result;
6680
+ const { advancedVSeed, vseed } = context;
6681
+ const { measures = [], datasetReshapeInfo, chartType, dimensions = [], encoding, reshapeMeasures = [] } = advancedVSeed;
6682
+ const baseConfig = advancedVSeed.config?.[chartType];
6683
+ const { tooltip = {
6684
+ enable: true
6685
+ } } = baseConfig ?? {};
6686
+ const { enable = true } = tooltip;
6687
+ const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
6688
+ const { titleEncoding } = tooltipOptions || {};
6689
+ result.tooltip = {
6690
+ style: getTooltipStyle(tooltip),
6691
+ visible: !!enable,
6692
+ group: {
6693
+ title: {
6694
+ visible: false
6695
+ }
6502
6696
  },
6503
- content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, foldInfo, unfoldInfo)
6504
- },
6505
- dimension: {
6506
- title: {
6507
- visible: true
6697
+ mark: {
6698
+ title: {
6699
+ visible: false
6700
+ },
6701
+ content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, foldInfo, unfoldInfo, advancedVSeed.locale)
6508
6702
  },
6509
- content: createDimensionContent(encoding.tooltip || [], encoding.color || [], measures, foldInfo, unfoldInfo, reshapeMeasures.length > 1)
6510
- },
6511
- updateElement: updateTooltipElement
6703
+ dimension: {
6704
+ title: {
6705
+ visible: true,
6706
+ value: titleEncoding ? (datum)=>{
6707
+ if (!datum) return '';
6708
+ const dimIds = encoding[titleEncoding] || [];
6709
+ const formatted = dimIds.map((id)=>{
6710
+ const dim = dimensions.find((item)=>item.id === id);
6711
+ if (!dim) return datum?.[id];
6712
+ const formatter = createFormatterByDimension(dim, advancedVSeed.locale);
6713
+ return formatter(datum?.[id]);
6714
+ });
6715
+ return formatted.join("-");
6716
+ } : void 0
6717
+ },
6718
+ content: createDimensionContent(encoding.tooltip || [], encoding.color || [], measures, foldInfo, unfoldInfo, reshapeMeasures.length > 1)
6719
+ },
6720
+ updateElement: updateTooltipElement
6721
+ };
6722
+ return result;
6512
6723
  };
6513
- return result;
6514
- };
6515
6724
  const createDimensionContent = (tooltips, colors, measures = [], foldInfo, unfoldInfo, hasMultiMeasureGroup)=>{
6516
6725
  const { measureId, measureValue, foldMap } = foldInfo;
6517
6726
  const { encodingColor } = unfoldInfo;
@@ -6552,7 +6761,7 @@ self.R = R;
6552
6761
  }
6553
6762
  ];
6554
6763
  };
6555
- const createMarkContent = (tooltip, dimensions = [], measures = [], foldInfo, unfoldInfo)=>{
6764
+ const createMarkContent = (tooltip, dimensions = [], measures = [], foldInfo, unfoldInfo, locale)=>{
6556
6765
  const dims = C(dimensions.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias));
6557
6766
  const meas = C(measures.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias));
6558
6767
  const dimContent = dims.map((item)=>({
@@ -6566,7 +6775,8 @@ self.R = R;
6566
6775
  },
6567
6776
  value: (v)=>{
6568
6777
  const datum = v;
6569
- return datum && datum[item.id];
6778
+ const formatter = createFormatterByDimension(item, locale);
6779
+ return datum ? formatter(datum[item.id]) : '';
6570
6780
  }
6571
6781
  }));
6572
6782
  const meaContent = meas.map((item)=>({
@@ -8084,6 +8294,10 @@ self.R = R;
8084
8294
  const measure = measures.find((m)=>m.id === title);
8085
8295
  return measure ? measure.alias ?? measure.id : title;
8086
8296
  };
8297
+ else if (dim.timeFormat) {
8298
+ const formatter = createFormatterByDimension(dim, advancedVSeed.locale);
8299
+ baseConfig.headerFormat = (value)=>formatter(value);
8300
+ }
8087
8301
  return baseConfig;
8088
8302
  });
8089
8303
  return {
@@ -8109,6 +8323,10 @@ self.R = R;
8109
8323
  const measure = measures.find((m)=>m.id === title);
8110
8324
  return measure ? measure.alias ?? measure.id : title;
8111
8325
  };
8326
+ else if (dim.timeFormat) {
8327
+ const formatter = createFormatterByDimension(dim, advancedVSeed.locale);
8328
+ baseConfig.headerFormat = (value)=>formatter(value);
8329
+ }
8112
8330
  return baseConfig;
8113
8331
  });
8114
8332
  return {
@@ -8405,7 +8623,9 @@ self.R = R;
8405
8623
  pointStateDimensionHover,
8406
8624
  colorLineStyleFill(lineStyle_lineStyle),
8407
8625
  label_label,
8408
- tooltip_tooltip,
8626
+ tooltip_tooltip({
8627
+ titleEncoding: 'x'
8628
+ }),
8409
8629
  annotationPoint_annotationPoint,
8410
8630
  annotationVerticalLine_annotationVerticalLine,
8411
8631
  annotationHorizontalLine_annotationHorizontalLine,
@@ -8431,7 +8651,9 @@ self.R = R;
8431
8651
  pointStateDimensionHover,
8432
8652
  colorLineStyleFill(lineStyle_lineStyle),
8433
8653
  label_label,
8434
- tooltip_tooltip,
8654
+ tooltip_tooltip({
8655
+ titleEncoding: 'x'
8656
+ }),
8435
8657
  annotationPoint_annotationPoint,
8436
8658
  annotationVerticalLine_annotationVerticalLine,
8437
8659
  annotationHorizontalLine_annotationHorizontalLine,
@@ -9391,7 +9613,9 @@ self.R = R;
9391
9613
  yLinear,
9392
9614
  label_label,
9393
9615
  brush_brush,
9394
- tooltip_tooltip,
9616
+ tooltip_tooltip({
9617
+ titleEncoding: 'x'
9618
+ }),
9395
9619
  verticalCrosshairRect,
9396
9620
  colorAdapter(discreteLegend, colorLegend),
9397
9621
  colorBarStyleFill(barStyle_barStyle),
@@ -9419,7 +9643,9 @@ self.R = R;
9419
9643
  pivotAxisStyle(yLinear),
9420
9644
  brush_brush,
9421
9645
  label_label,
9422
- tooltip_tooltip,
9646
+ tooltip_tooltip({
9647
+ titleEncoding: 'x'
9648
+ }),
9423
9649
  verticalCrosshairRect,
9424
9650
  colorBarStyleFill(barStyle_barStyle),
9425
9651
  annotationPoint_annotationPoint,
@@ -9600,7 +9826,9 @@ self.R = R;
9600
9826
  yLinear,
9601
9827
  label_label,
9602
9828
  brush_brush,
9603
- tooltip_tooltip,
9829
+ tooltip_tooltip({
9830
+ titleEncoding: 'x'
9831
+ }),
9604
9832
  colorAdapter(discreteLegend, colorLegend),
9605
9833
  verticalCrosshairRect,
9606
9834
  colorBarStyleFill(barStyle_barStyle),
@@ -9626,7 +9854,9 @@ self.R = R;
9626
9854
  pivotAxisStyle(yLinear),
9627
9855
  brush_brush,
9628
9856
  label_label,
9629
- tooltip_tooltip,
9857
+ tooltip_tooltip({
9858
+ titleEncoding: 'x'
9859
+ }),
9630
9860
  verticalCrosshairRect,
9631
9861
  colorBarStyleFill(barStyle_barStyle),
9632
9862
  annotationPoint_annotationPoint,
@@ -9700,7 +9930,9 @@ self.R = R;
9700
9930
  yLinear,
9701
9931
  label_label,
9702
9932
  brush_brush,
9703
- tooltip_tooltip,
9933
+ tooltip_tooltip({
9934
+ titleEncoding: 'x'
9935
+ }),
9704
9936
  colorAdapter(discreteLegend, colorLegend),
9705
9937
  verticalCrosshairRect,
9706
9938
  colorBarStyleFill(barStyle_barStyle),
@@ -9728,7 +9960,9 @@ self.R = R;
9728
9960
  pivotAxisStyle(yLinear),
9729
9961
  brush_brush,
9730
9962
  label_label,
9731
- tooltip_tooltip,
9963
+ tooltip_tooltip({
9964
+ titleEncoding: 'x'
9965
+ }),
9732
9966
  verticalCrosshairRect,
9733
9967
  colorBarStyleFill(barStyle_barStyle),
9734
9968
  annotationPoint_annotationPoint,
@@ -9991,13 +10225,25 @@ self.R = R;
9991
10225
  0.1
9992
10226
  ];
9993
10227
  if (common_isNil(bandAxis.title?.text)) bandAxis.title.text = defaultTitleText(measures, dimensions, encoding.y);
9994
- if (onlyMeasureId && bandAxis.label) {
10228
+ if (bandAxis.label) {
9995
10229
  const allDatasetReshapeInfo = pivotAllDatasetReshapeInfo || datasetReshapeInfo;
9996
10230
  const colorIdMap = allDatasetReshapeInfo.reduce((prev, cur)=>({
9997
10231
  ...prev,
9998
10232
  ...cur.unfoldInfo.colorIdMap
9999
10233
  }), {});
10000
- bandAxis.label.formatMethod = (text)=>common_isArray(text) ? text : colorIdMap[String(text)]?.alias ?? text;
10234
+ const dimensionMap = new Map(dimensions.map((item)=>[
10235
+ item.id,
10236
+ item
10237
+ ]));
10238
+ const dimIds = (encoding.y || []).filter((v)=>v !== MeasureId);
10239
+ const dimFormatter = dimIds.length ? createFormatterByDimension(dimensionMap.get(dimIds[0]), advancedVSeed.locale) : null;
10240
+ bandAxis.label.formatMethod = (text)=>{
10241
+ if (common_isArray(text)) return text;
10242
+ if (onlyMeasureId) return colorIdMap[String(text)]?.alias ?? text;
10243
+ const rawText = String(text ?? '');
10244
+ if (!dimFormatter) return rawText;
10245
+ return dimFormatter(rawText);
10246
+ };
10001
10247
  }
10002
10248
  result.axes = [
10003
10249
  ...result.axes,
@@ -10060,7 +10306,9 @@ self.R = R;
10060
10306
  yBand,
10061
10307
  label_label,
10062
10308
  brush_brush,
10063
- tooltip_tooltip,
10309
+ tooltip_tooltip({
10310
+ titleEncoding: 'y'
10311
+ }),
10064
10312
  colorAdapter(discreteLegend, colorLegend),
10065
10313
  horizontalCrosshairRect,
10066
10314
  colorBarStyleFill(barStyle_barStyle),
@@ -10086,7 +10334,9 @@ self.R = R;
10086
10334
  pivotAxisStyle(yBand),
10087
10335
  label_label,
10088
10336
  brush_brush,
10089
- tooltip_tooltip,
10337
+ tooltip_tooltip({
10338
+ titleEncoding: 'y'
10339
+ }),
10090
10340
  colorBarStyleFill(barStyle_barStyle),
10091
10341
  horizontalCrosshairRect,
10092
10342
  annotationPoint_annotationPoint,
@@ -10422,7 +10672,9 @@ self.R = R;
10422
10672
  yBand,
10423
10673
  label_label,
10424
10674
  brush_brush,
10425
- tooltip_tooltip,
10675
+ tooltip_tooltip({
10676
+ titleEncoding: 'y'
10677
+ }),
10426
10678
  colorAdapter(discreteLegend, colorLegend),
10427
10679
  horizontalCrosshairRect,
10428
10680
  colorBarStyleFill(barStyle_barStyle),
@@ -10745,7 +10997,9 @@ self.R = R;
10745
10997
  yLinear,
10746
10998
  label_label,
10747
10999
  brush_brush,
10748
- tooltip_tooltip,
11000
+ tooltip_tooltip({
11001
+ titleEncoding: 'x'
11002
+ }),
10749
11003
  colorAdapter(discreteLegend, colorLegend),
10750
11004
  horizontalCrosshairRect,
10751
11005
  colorBarStyleFill(barStyle_barStyle),
@@ -10911,7 +11165,8 @@ self.R = R;
10911
11165
  foldMeasureId: FoldXMeasureId,
10912
11166
  colorItemAsId: true,
10913
11167
  colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
10914
- omitIds: xMeasures.map((m)=>m.id).filter((id)=>!sizeEncodingIds.includes(id))
11168
+ omitIds: xMeasures.map((m)=>m.id).filter((id)=>!sizeEncodingIds.includes(id)),
11169
+ locale: advancedVSeed.locale
10915
11170
  });
10916
11171
  datasets.push(xResult.dataset);
10917
11172
  foldInfoList.push(xResult.foldInfo);
@@ -10921,7 +11176,8 @@ self.R = R;
10921
11176
  foldMeasureId: FoldYMeasureId,
10922
11177
  colorItemAsId: true,
10923
11178
  colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
10924
- omitIds: yMeasures.map((m)=>m.id).filter((id)=>!sizeEncodingIds.includes(id))
11179
+ omitIds: yMeasures.map((m)=>m.id).filter((id)=>!sizeEncodingIds.includes(id)),
11180
+ locale: advancedVSeed.locale
10925
11181
  });
10926
11182
  datasets[0] = yResult.dataset;
10927
11183
  foldInfoList.push(yResult.foldInfo);
@@ -10972,7 +11228,8 @@ self.R = R;
10972
11228
  foldMeasureId: FoldXMeasureId,
10973
11229
  colorItemAsId: true,
10974
11230
  colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
10975
- omitIds: allMeasuresIds
11231
+ omitIds: allMeasuresIds,
11232
+ locale: advancedVSeed.locale
10976
11233
  });
10977
11234
  datasets.push(xResult.dataset);
10978
11235
  foldInfoList.push(xResult.foldInfo);
@@ -10982,7 +11239,8 @@ self.R = R;
10982
11239
  foldMeasureId: FoldYMeasureId,
10983
11240
  colorItemAsId: true,
10984
11241
  colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
10985
- omitIds: allMeasuresIds
11242
+ omitIds: allMeasuresIds,
11243
+ locale: advancedVSeed.locale
10986
11244
  });
10987
11245
  datasets.push(yResult.dataset);
10988
11246
  foldInfoList.push(yResult.foldInfo);
@@ -11312,7 +11570,7 @@ self.R = R;
11312
11570
  const baseConfig = advancedVSeed.config[chartType];
11313
11571
  const foldInfoList = datasetReshapeInfo[0].foldInfoList;
11314
11572
  const { label } = baseConfig;
11315
- result.label = buildLabel(label, vseed.measures, vseed.dimensions, advancedVSeed.dimensions, advancedVSeed.measures, encoding, foldInfoList);
11573
+ result.label = buildLabel(label, vseed.measures, vseed.dimensions, advancedVSeed.dimensions, advancedVSeed.measures, encoding, foldInfoList, advancedVSeed?.locale);
11316
11574
  return result;
11317
11575
  };
11318
11576
  const tooltipScatter = (spec, context)=>{
@@ -11358,7 +11616,8 @@ self.R = R;
11358
11616
  },
11359
11617
  value: (v)=>{
11360
11618
  const datum = v;
11361
- return datum && datum[item.id];
11619
+ const formatter = createFormatterByDimension(item, locale);
11620
+ return datum ? formatter(datum[item.id]) : '';
11362
11621
  }
11363
11622
  }));
11364
11623
  const meaContent = meas.map((item)=>({
@@ -12195,7 +12454,9 @@ self.R = R;
12195
12454
  colorAdapter(discreteLegend, colorLegend),
12196
12455
  colorLineStyleFill(lineStyle_lineStyle),
12197
12456
  label_label,
12198
- tooltip_tooltip,
12457
+ tooltip_tooltip({
12458
+ titleEncoding: 'x'
12459
+ }),
12199
12460
  annotationPoint_annotationPoint,
12200
12461
  annotationVerticalLine_annotationVerticalLine,
12201
12462
  annotationHorizontalLine_annotationHorizontalLine,
@@ -12540,7 +12801,7 @@ self.R = R;
12540
12801
  const { label } = baseConfig;
12541
12802
  result.label = buildLabel(label, vseed.measures, vseed.dimensions, advancedVSeed.dimensions, advancedVSeed.measures, encoding, [
12542
12803
  foldInfo
12543
- ]);
12804
+ ], advancedVSeed?.locale);
12544
12805
  if (label.labelLayout) result.label.layout = {
12545
12806
  align: label.labelLayout
12546
12807
  };
@@ -12556,7 +12817,9 @@ self.R = R;
12556
12817
  colorPieStyleFill(pieStyle),
12557
12818
  colorAdapter(discreteLegend, colorLegend),
12558
12819
  labelPie,
12559
- tooltip_tooltip,
12820
+ tooltip_tooltip({
12821
+ titleEncoding: 'color'
12822
+ }),
12560
12823
  annotationPoint_annotationPoint,
12561
12824
  annotationVerticalLine_annotationVerticalLine,
12562
12825
  annotationHorizontalLine_annotationHorizontalLine,
@@ -12693,7 +12956,9 @@ self.R = R;
12693
12956
  labelPie,
12694
12957
  colorPieStyleFill(pieStyle),
12695
12958
  colorAdapter(discreteLegend, colorLegend),
12696
- tooltip_tooltip,
12959
+ tooltip_tooltip({
12960
+ titleEncoding: 'color'
12961
+ }),
12697
12962
  annotationPoint_annotationPoint,
12698
12963
  annotationVerticalLine_annotationVerticalLine,
12699
12964
  annotationHorizontalLine_annotationHorizontalLine,
@@ -12777,7 +13042,9 @@ self.R = R;
12777
13042
  yBand,
12778
13043
  label_label,
12779
13044
  brush_brush,
12780
- tooltip_tooltip,
13045
+ tooltip_tooltip({
13046
+ titleEncoding: 'y'
13047
+ }),
12781
13048
  colorAdapter(discreteLegend, colorLegend),
12782
13049
  horizontalCrosshairRect,
12783
13050
  colorBarStyleFill(barStyle_barStyle),
@@ -12802,7 +13069,9 @@ self.R = R;
12802
13069
  pivotAxisStyle(yBand),
12803
13070
  brush_brush,
12804
13071
  label_label,
12805
- tooltip_tooltip,
13072
+ tooltip_tooltip({
13073
+ titleEncoding: 'y'
13074
+ }),
12806
13075
  colorBarStyleFill(barStyle_barStyle),
12807
13076
  horizontalCrosshairRect,
12808
13077
  annotationPoint_annotationPoint,
@@ -12868,7 +13137,9 @@ self.R = R;
12868
13137
  yBand,
12869
13138
  label_label,
12870
13139
  brush_brush,
12871
- tooltip_tooltip,
13140
+ tooltip_tooltip({
13141
+ titleEncoding: 'y'
13142
+ }),
12872
13143
  colorAdapter(discreteLegend, colorLegend),
12873
13144
  horizontalCrosshairRect,
12874
13145
  colorBarStyleFill(barStyle_barStyle),
@@ -12894,7 +13165,9 @@ self.R = R;
12894
13165
  pivotAxisStyle(yBand),
12895
13166
  brush_brush,
12896
13167
  label_label,
12897
- tooltip_tooltip,
13168
+ tooltip_tooltip({
13169
+ titleEncoding: 'y'
13170
+ }),
12898
13171
  colorBarStyleFill(barStyle_barStyle),
12899
13172
  horizontalCrosshairRect,
12900
13173
  annotationPoint_annotationPoint,
@@ -13047,7 +13320,9 @@ self.R = R;
13047
13320
  yLinear,
13048
13321
  label_label,
13049
13322
  brush_brush,
13050
- tooltip_tooltip,
13323
+ tooltip_tooltip({
13324
+ titleEncoding: 'x'
13325
+ }),
13051
13326
  colorAdapter(discreteLegend, colorLegend),
13052
13327
  verticalCrosshairLine,
13053
13328
  colorPointStyleFill(pointStyle_pointStyle),
@@ -13076,7 +13351,9 @@ self.R = R;
13076
13351
  pivotAxisStyle(yLinear),
13077
13352
  label_label,
13078
13353
  brush_brush,
13079
- tooltip_tooltip,
13354
+ tooltip_tooltip({
13355
+ titleEncoding: 'x'
13356
+ }),
13080
13357
  verticalCrosshairLine,
13081
13358
  colorPointStyleFill(pointStyle_pointStyle),
13082
13359
  pointStateDimensionHover,
@@ -13145,7 +13422,9 @@ self.R = R;
13145
13422
  yLinear,
13146
13423
  label_label,
13147
13424
  brush_brush,
13148
- tooltip_tooltip,
13425
+ tooltip_tooltip({
13426
+ titleEncoding: 'x'
13427
+ }),
13149
13428
  colorAdapter(discreteLegend, colorLegend),
13150
13429
  verticalCrosshairLine,
13151
13430
  colorPointStyleFill(pointStyle_pointStyle),
@@ -13174,7 +13453,9 @@ self.R = R;
13174
13453
  pivotAxisStyle(yLinear),
13175
13454
  label_label,
13176
13455
  brush_brush,
13177
- tooltip_tooltip,
13456
+ tooltip_tooltip({
13457
+ titleEncoding: 'x'
13458
+ }),
13178
13459
  verticalCrosshairLine,
13179
13460
  colorPointStyleFill(pointStyle_pointStyle),
13180
13461
  pointStateDimensionHover,
@@ -13490,7 +13771,8 @@ self.R = R;
13490
13771
  colorItemAsId: false,
13491
13772
  foldMeasureValue: FoldPrimaryMeasureValue,
13492
13773
  colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
13493
- omitIds: allMeasuresIds
13774
+ omitIds: allMeasuresIds,
13775
+ locale: advancedVSeed.locale
13494
13776
  });
13495
13777
  primaryResult.dataset.forEach((row)=>{
13496
13778
  row[DimAxisType] = 'primaryYAxis';
@@ -13504,7 +13786,8 @@ self.R = R;
13504
13786
  colorItemAsId: false,
13505
13787
  foldMeasureValue: FoldSecondaryMeasureValue,
13506
13788
  colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
13507
- omitIds: allMeasuresIds
13789
+ omitIds: allMeasuresIds,
13790
+ locale: advancedVSeed.locale
13508
13791
  });
13509
13792
  secondaryResult.dataset.forEach((row)=>{
13510
13793
  row[DimAxisType] = 'secondaryYAxis';
@@ -13562,7 +13845,8 @@ self.R = R;
13562
13845
  colorItemAsId: false,
13563
13846
  foldMeasureValue: `${FoldPrimaryMeasureValue}${index}`,
13564
13847
  colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
13565
- omitIds: allMeasuresIds
13848
+ omitIds: allMeasuresIds,
13849
+ locale: advancedVSeed.locale
13566
13850
  });
13567
13851
  primaryResult.dataset.forEach((row)=>{
13568
13852
  row[DimAxisType] = 'primaryYAxis';
@@ -13576,7 +13860,8 @@ self.R = R;
13576
13860
  colorItemAsId: false,
13577
13861
  foldMeasureValue: `${FoldSecondaryMeasureValue}${index}`,
13578
13862
  colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
13579
- omitIds: allMeasuresIds
13863
+ omitIds: allMeasuresIds,
13864
+ locale: advancedVSeed.locale
13580
13865
  });
13581
13866
  secondaryResult.dataset.forEach((row)=>{
13582
13867
  row[DimAxisType] = 'secondaryYAxis';
@@ -13856,7 +14141,7 @@ self.R = R;
13856
14141
  const baseConfig = advancedVSeed.config[chartType];
13857
14142
  result.label = buildLabel(baseConfig.label, vseed.measures, vseed.dimensions, advancedVSeed.dimensions, advancedVSeed.measures, encoding, [
13858
14143
  options.foldInfo
13859
- ]);
14144
+ ], advancedVSeed?.locale);
13860
14145
  result.label.zIndex = 1002;
13861
14146
  return result;
13862
14147
  };
@@ -13878,11 +14163,22 @@ self.R = R;
13878
14163
  title: {
13879
14164
  visible: false
13880
14165
  },
13881
- content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, options.foldInfo, unfoldInfo)
14166
+ content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, options.foldInfo, unfoldInfo, advancedVSeed.locale)
13882
14167
  },
13883
14168
  dimension: {
13884
14169
  title: {
13885
- visible: true
14170
+ visible: true,
14171
+ value: (datum)=>{
14172
+ if (!datum) return '';
14173
+ const dimIds = encoding.x || [];
14174
+ const formatted = dimIds.map((id)=>{
14175
+ const dim = dimensions.find((item)=>item.id === id);
14176
+ if (!dim) return datum?.[id];
14177
+ const formatter = createFormatterByDimension(dim, advancedVSeed.locale);
14178
+ return formatter(datum?.[id]);
14179
+ });
14180
+ return formatted.join("-");
14181
+ }
13886
14182
  },
13887
14183
  content: createDimensionContent(encoding.tooltip || [], encoding.color || [], measures, options.foldInfo, unfoldInfo, reshapeMeasures.length > 1)
13888
14184
  }
@@ -14056,21 +14352,21 @@ self.R = R;
14056
14352
  };
14057
14353
  const isObjectLike = (value)=>"object" == typeof value && null !== value;
14058
14354
  const common_isObjectLike = isObjectLike;
14059
- const isPlainObject_isPlainObject = function(value) {
14355
+ const isPlainObject = function(value) {
14060
14356
  if (!common_isObjectLike(value) || !isType(value, "Object")) return !1;
14061
14357
  if (null === Object.getPrototypeOf(value)) return !0;
14062
14358
  let proto = value;
14063
14359
  for(; null !== Object.getPrototypeOf(proto);)proto = Object.getPrototypeOf(proto);
14064
14360
  return Object.getPrototypeOf(value) === proto;
14065
14361
  };
14066
- const isPlainObject = isPlainObject_isPlainObject;
14362
+ const common_isPlainObject = isPlainObject;
14067
14363
  const isString_isString = (value, fuzzy = !1)=>{
14068
14364
  const type = typeof value;
14069
14365
  return fuzzy ? "string" === type : "string" === type || isType(value, "String");
14070
14366
  };
14071
14367
  const isString = isString_isString;
14072
14368
  function pickWithout(obj, keys) {
14073
- if (!obj || !isPlainObject(obj)) return obj;
14369
+ if (!obj || !common_isPlainObject(obj)) return obj;
14074
14370
  const result = {};
14075
14371
  return Object.keys(obj).forEach((k)=>{
14076
14372
  const v = obj[k];
@@ -14302,7 +14598,9 @@ self.R = R;
14302
14598
  colorPieStyleFill(pieStyle),
14303
14599
  colorAdapter(discreteLegend, colorLegend),
14304
14600
  labelPie,
14305
- tooltip_tooltip,
14601
+ tooltip_tooltip({
14602
+ titleEncoding: 'color'
14603
+ }),
14306
14604
  annotationPoint_annotationPoint,
14307
14605
  annotationVerticalLine_annotationVerticalLine,
14308
14606
  annotationHorizontalLine_annotationHorizontalLine,
@@ -14323,7 +14621,9 @@ self.R = R;
14323
14621
  brush_brush,
14324
14622
  colorPieStyleFill(pieStyle),
14325
14623
  labelPie,
14326
- tooltip_tooltip,
14624
+ tooltip_tooltip({
14625
+ titleEncoding: 'color'
14626
+ }),
14327
14627
  annotationPoint_annotationPoint,
14328
14628
  annotationVerticalLine_annotationVerticalLine,
14329
14629
  annotationHorizontalLine_annotationHorizontalLine,
@@ -14382,7 +14682,9 @@ self.R = R;
14382
14682
  labelPie,
14383
14683
  colorPieStyleFill(pieStyle),
14384
14684
  colorAdapter(discreteLegend, colorLegend),
14385
- tooltip_tooltip,
14685
+ tooltip_tooltip({
14686
+ titleEncoding: 'color'
14687
+ }),
14386
14688
  annotationPoint_annotationPoint,
14387
14689
  annotationVerticalLine_annotationVerticalLine,
14388
14690
  annotationHorizontalLine_annotationHorizontalLine,
@@ -14404,7 +14706,9 @@ self.R = R;
14404
14706
  brush_brush,
14405
14707
  labelPie,
14406
14708
  colorPieStyleFill(pieStyle),
14407
- tooltip_tooltip,
14709
+ tooltip_tooltip({
14710
+ titleEncoding: 'color'
14711
+ }),
14408
14712
  annotationPoint_annotationPoint,
14409
14713
  annotationVerticalLine_annotationVerticalLine,
14410
14714
  annotationHorizontalLine_annotationHorizontalLine,
@@ -14611,7 +14915,9 @@ self.R = R;
14611
14915
  colorRoseStyleFill(roseStyle),
14612
14916
  colorAdapter(discreteLegend, colorLegend),
14613
14917
  labelPie,
14614
- tooltip_tooltip
14918
+ tooltip_tooltip({
14919
+ titleEncoding: 'angle'
14920
+ })
14615
14921
  ];
14616
14922
  const pivotRose = [
14617
14923
  initPivot,
@@ -14632,7 +14938,9 @@ self.R = R;
14632
14938
  verticalCrosshairRect,
14633
14939
  colorRoseStyleFill(roseStyle),
14634
14940
  labelPie,
14635
- tooltip_tooltip
14941
+ tooltip_tooltip({
14942
+ titleEncoding: 'angle'
14943
+ })
14636
14944
  ]),
14637
14945
  pivotRowDimensions,
14638
14946
  pivotColumnDimensions,
@@ -14731,7 +15039,9 @@ self.R = R;
14731
15039
  colorRoseStyleFill(roseStyle),
14732
15040
  colorAdapter(discreteLegend, colorLegend),
14733
15041
  labelPie,
14734
- tooltip_tooltip,
15042
+ tooltip_tooltip({
15043
+ titleEncoding: 'angle'
15044
+ }),
14735
15045
  verticalCrosshairRect,
14736
15046
  annotationPoint_annotationPoint,
14737
15047
  annotationVerticalLine_annotationVerticalLine,
@@ -14756,7 +15066,9 @@ self.R = R;
14756
15066
  verticalCrosshairRect,
14757
15067
  colorRoseStyleFill(roseStyle),
14758
15068
  labelPie,
14759
- tooltip_tooltip,
15069
+ tooltip_tooltip({
15070
+ titleEncoding: 'angle'
15071
+ }),
14760
15072
  annotationPoint_annotationPoint,
14761
15073
  annotationVerticalLine_annotationVerticalLine,
14762
15074
  annotationHorizontalLine_annotationHorizontalLine,
@@ -14896,16 +15208,39 @@ self.R = R;
14896
15208
  result.animation = true;
14897
15209
  return result;
14898
15210
  };
14899
- const radarAngleAxis = (spec)=>{
15211
+ const radarAngleAxis = (spec, context)=>{
14900
15212
  const result = {
14901
15213
  ...spec
14902
15214
  };
15215
+ const { advancedVSeed } = context;
15216
+ const { dimensions = [], encoding, datasetReshapeInfo, pivotAllDatasetReshapeInfo } = advancedVSeed;
14903
15217
  if (!result.axes) result.axes = [];
15218
+ const onlyMeasureId = 0 === (encoding.angle || []).filter((v)=>v !== MeasureId).length;
15219
+ const dimensionMap = new Map(dimensions.map((item)=>[
15220
+ item.id,
15221
+ item
15222
+ ]));
15223
+ const dimIds = (encoding.angle || []).filter((v)=>v !== MeasureId);
15224
+ const dimFormatter = dimIds.length ? createFormatterByDimension(dimensionMap.get(dimIds[0]), advancedVSeed.locale) : null;
15225
+ const allDatasetReshapeInfo = pivotAllDatasetReshapeInfo || datasetReshapeInfo;
15226
+ const colorIdMap = allDatasetReshapeInfo.reduce((prev, cur)=>({
15227
+ ...prev,
15228
+ ...cur.unfoldInfo.colorIdMap
15229
+ }), {});
14904
15230
  result.axes.push({
14905
15231
  orient: 'angle',
14906
15232
  visible: true,
14907
15233
  zero: true,
14908
15234
  nice: true,
15235
+ label: {
15236
+ formatMethod: (text)=>{
15237
+ if (common_isArray(text)) return text;
15238
+ if (onlyMeasureId) return colorIdMap[String(text)]?.alias ?? text;
15239
+ const rawText = String(text ?? '');
15240
+ if (!dimFormatter) return rawText;
15241
+ return dimFormatter(rawText);
15242
+ }
15243
+ },
14909
15244
  grid: {
14910
15245
  visible: true
14911
15246
  },
@@ -14952,7 +15287,9 @@ self.R = R;
14952
15287
  radarAngleAxis,
14953
15288
  radarRadiusAxis,
14954
15289
  label_label,
14955
- tooltip_tooltip,
15290
+ tooltip_tooltip({
15291
+ titleEncoding: 'angle'
15292
+ }),
14956
15293
  colorAdapter(discreteLegend, colorLegend),
14957
15294
  verticalCrosshairLine,
14958
15295
  colorPointStyleFill(pointStyle_pointStyle),
@@ -14976,7 +15313,9 @@ self.R = R;
14976
15313
  radarAngleAxis,
14977
15314
  radarRadiusAxis,
14978
15315
  label_label,
14979
- tooltip_tooltip,
15316
+ tooltip_tooltip({
15317
+ titleEncoding: 'angle'
15318
+ }),
14980
15319
  verticalCrosshairLine,
14981
15320
  colorPointStyleFill(pointStyle_pointStyle),
14982
15321
  pointStateDimensionHover,
@@ -15176,7 +15515,9 @@ self.R = R;
15176
15515
  colorAdapter(discreteLegend, colorLegend),
15177
15516
  colorFunnelStyleFill(funnelStyle),
15178
15517
  funnelTransformStyle,
15179
- tooltip_tooltip,
15518
+ tooltip_tooltip({
15519
+ titleEncoding: 'color'
15520
+ }),
15180
15521
  annotationPoint_annotationPoint,
15181
15522
  annotationVerticalLine_annotationVerticalLine,
15182
15523
  annotationHorizontalLine_annotationHorizontalLine,
@@ -15195,7 +15536,9 @@ self.R = R;
15195
15536
  datasetXY,
15196
15537
  colorAdapter(color_color, linearColor),
15197
15538
  label_label,
15198
- tooltip_tooltip,
15539
+ tooltip_tooltip({
15540
+ titleEncoding: 'color'
15541
+ }),
15199
15542
  colorFunnelStyleFill(funnelStyle),
15200
15543
  funnelTransformStyle,
15201
15544
  annotationPoint_annotationPoint,
@@ -15350,6 +15693,7 @@ self.R = R;
15350
15693
  };
15351
15694
  const { advancedVSeed, vseed } = context;
15352
15695
  const { chartType } = vseed;
15696
+ const { dimensions = [], encoding } = advancedVSeed;
15353
15697
  const xAxisConfig = advancedVSeed.config?.[chartType]?.xAxis ?? {};
15354
15698
  const yAxisConfig = advancedVSeed.config?.[chartType]?.yAxis ?? {};
15355
15699
  const xBandAxis = bandAxisStyle(xAxisConfig);
@@ -15358,6 +15702,18 @@ self.R = R;
15358
15702
  xBandAxis.bandPadding = 0;
15359
15703
  yBandAxis.orient = 'left';
15360
15704
  yBandAxis.bandPadding = 0;
15705
+ const formatBandLabel = (axis)=>{
15706
+ const dimIds = ('x' === axis ? encoding.x : encoding.y) || [];
15707
+ const dimFormatter = dimIds.length ? createFormatterByDimension(dimensions.find((item)=>item.id === dimIds[0]), advancedVSeed.locale) : null;
15708
+ return (text)=>{
15709
+ if (Array.isArray(text)) return text;
15710
+ const rawText = String(text ?? '');
15711
+ if (!dimFormatter) return rawText;
15712
+ return dimFormatter(rawText);
15713
+ };
15714
+ };
15715
+ if (xBandAxis.label) xBandAxis.label.formatMethod = formatBandLabel('x');
15716
+ if (yBandAxis.label) yBandAxis.label.formatMethod = formatBandLabel('y');
15361
15717
  result.axes = [
15362
15718
  xBandAxis,
15363
15719
  yBandAxis
@@ -15450,7 +15806,8 @@ self.R = R;
15450
15806
  },
15451
15807
  value: (v)=>{
15452
15808
  const datum = v;
15453
- return datum && datum[item.id];
15809
+ const formatter = createFormatterByDimension(item, locale);
15810
+ return datum ? formatter(datum[item.id]) : '';
15454
15811
  }
15455
15812
  }));
15456
15813
  const meaContent = meas.map((item)=>({
@@ -15784,7 +16141,11 @@ self.R = R;
15784
16141
  const res = unfoldDimensions(boxPlotDataList, uniqDims, encoding, {
15785
16142
  foldMeasureId: FoldMeasureId,
15786
16143
  separator: "-",
15787
- colorItemAsId: false
16144
+ colorItemAsId: false,
16145
+ formatDimensionValue: (dimension, value)=>{
16146
+ const formatter = createFormatterByDimension(dimension, advancedVSeed.locale);
16147
+ return formatter(value);
16148
+ }
15788
16149
  });
15789
16150
  res.dataset.forEach((d)=>{
15790
16151
  newDatasets.push(d);
@@ -15794,7 +16155,11 @@ self.R = R;
15794
16155
  const res = unfoldDimensions(dataset, uniqDims, encoding, {
15795
16156
  foldMeasureId: FoldMeasureId,
15796
16157
  separator: "-",
15797
- colorItemAsId: false
16158
+ colorItemAsId: false,
16159
+ formatDimensionValue: (dimension, value)=>{
16160
+ const formatter = createFormatterByDimension(dimension, advancedVSeed.locale);
16161
+ return formatter(value);
16162
+ }
15798
16163
  });
15799
16164
  res.dataset.forEach((datum)=>{
15800
16165
  datum[UpperWhisker] = datum[encoding.max[0]];
@@ -15881,7 +16246,11 @@ self.R = R;
15881
16246
  const res = unfoldDimensions(boxPlotDataList, uniqDims, encoding, {
15882
16247
  foldMeasureId: FoldMeasureId,
15883
16248
  separator: "-",
15884
- colorItemAsId: false
16249
+ colorItemAsId: false,
16250
+ formatDimensionValue: (dimension, value)=>{
16251
+ const formatter = createFormatterByDimension(dimension, advancedVSeed.locale);
16252
+ return formatter(value);
16253
+ }
15885
16254
  });
15886
16255
  res.dataset.forEach((d)=>{
15887
16256
  newDatasets.push(d);
@@ -15891,7 +16260,11 @@ self.R = R;
15891
16260
  const res = unfoldDimensions(dataset, uniqDims, encoding, {
15892
16261
  foldMeasureId: FoldMeasureId,
15893
16262
  separator: "-",
15894
- colorItemAsId: false
16263
+ colorItemAsId: false,
16264
+ formatDimensionValue: (dimension, value)=>{
16265
+ const formatter = createFormatterByDimension(dimension, advancedVSeed.locale);
16266
+ return formatter(value);
16267
+ }
15895
16268
  });
15896
16269
  res.dataset.forEach((datum)=>{
15897
16270
  datum[UpperWhisker] = datum[encoding.max[0]];
@@ -16045,7 +16418,7 @@ self.R = R;
16045
16418
  measureId: FoldMeasureId,
16046
16419
  measureValue: MedianMeasureId
16047
16420
  }
16048
- ]);
16421
+ ], advancedVSeed?.locale);
16049
16422
  return result;
16050
16423
  };
16051
16424
  const boxPlotMeasureKeys = [
@@ -16061,7 +16434,7 @@ self.R = R;
16061
16434
  ...spec
16062
16435
  };
16063
16436
  const { advancedVSeed, vseed } = context;
16064
- const { chartType, dimensions = [], encoding, datasetReshapeInfo } = advancedVSeed;
16437
+ const { chartType, dimensions = [], encoding, datasetReshapeInfo, locale } = advancedVSeed;
16065
16438
  const baseConfig = advancedVSeed.config[chartType];
16066
16439
  const { tooltip = {
16067
16440
  enable: true
@@ -16086,7 +16459,7 @@ self.R = R;
16086
16459
  title: {
16087
16460
  visible: false
16088
16461
  },
16089
- content: tooltipBoxplot_createMarkContent(encoding.tooltip || [], dimensions, encoding),
16462
+ content: tooltipBoxplot_createMarkContent(encoding.tooltip || [], dimensions, encoding, locale),
16090
16463
  updateContent: (prev, data)=>{
16091
16464
  const datum = data?.[0]?.datum?.[0];
16092
16465
  if (!chunk_JK3VNB42_n(datum?.[VCHART_OUTLIER_KEY])) {
@@ -16118,13 +16491,13 @@ self.R = R;
16118
16491
  title: {
16119
16492
  visible: true
16120
16493
  },
16121
- content: tooltipBoxplot_createDimensionContent(dimensions, meas, unfoldInfo, measureAliasMapping[MedianMeasureId])
16494
+ content: tooltipBoxplot_createDimensionContent(dimensions, meas, unfoldInfo, measureAliasMapping[MedianMeasureId], locale)
16122
16495
  },
16123
16496
  updateElement: updateTooltipElement
16124
16497
  };
16125
16498
  return result;
16126
16499
  };
16127
- const tooltipBoxplot_createMarkContent = (tooltip, dimensions, encoding)=>{
16500
+ const tooltipBoxplot_createMarkContent = (tooltip, dimensions, encoding, locale)=>{
16128
16501
  const dims = C(dimensions.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias));
16129
16502
  const dimContent = dims.map((item)=>({
16130
16503
  visible: true,
@@ -16136,7 +16509,8 @@ self.R = R;
16136
16509
  if (encoding.color?.includes(item.id)) return datum?.[ColorEncoding];
16137
16510
  if (encoding.x?.includes(item.id)) return datum?.[XEncoding];
16138
16511
  }
16139
- return datum?.[item.id];
16512
+ const formatter = createFormatterByDimension(item, locale);
16513
+ return formatter(datum?.[item.id]);
16140
16514
  }
16141
16515
  }));
16142
16516
  const defaultContent = boxPlotMeasureKeys.map((key)=>({
@@ -16154,7 +16528,7 @@ self.R = R;
16154
16528
  defaultContent
16155
16529
  ];
16156
16530
  };
16157
- const tooltipBoxplot_createDimensionContent = (dimensions, measures, unfoldInfo, medianAlias, hasMultiMeasureGroup)=>{
16531
+ const tooltipBoxplot_createDimensionContent = (dimensions, measures, unfoldInfo, medianAlias, locale, hasMultiMeasureGroup)=>{
16158
16532
  const { encodingColor } = unfoldInfo;
16159
16533
  return [
16160
16534
  {
@@ -16406,7 +16780,7 @@ self.R = R;
16406
16780
  const length = objValue.length;
16407
16781
  for(; ++index < length;)newValue[index] = objValue[index];
16408
16782
  }
16409
- } else isPlainObject(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
16783
+ } else common_isPlainObject(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
16410
16784
  isCommon && baseMerge(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue(target, key, newValue);
16411
16785
  }
16412
16786
  function assignMergeValue(target, key, value) {
@@ -16768,7 +17142,11 @@ self.R = R;
16768
17142
  const res = unfoldDimensions(binData, uniqDims, encoding, {
16769
17143
  foldMeasureId: FoldMeasureId,
16770
17144
  separator: "-",
16771
- colorItemAsId: false
17145
+ colorItemAsId: false,
17146
+ formatDimensionValue: (dimension, value)=>{
17147
+ const formatter = createFormatterByDimension(dimension, advancedVSeed.locale);
17148
+ return formatter(value);
17149
+ }
16772
17150
  });
16773
17151
  res.dataset.forEach((d)=>{
16774
17152
  newDatasets.push(d);
@@ -16778,7 +17156,8 @@ self.R = R;
16778
17156
  const res = dataReshapeByEncoding(dataset, T(dimensions, (item)=>item.id), measures.filter((item)=>encoding.y?.includes(item.id)).slice(0, 1), encoding, {
16779
17157
  colorItemAsId: false,
16780
17158
  colorMeasureId,
16781
- omitIds: []
17159
+ omitIds: [],
17160
+ locale: advancedVSeed.locale
16782
17161
  });
16783
17162
  res.dataset.forEach((datum)=>{
16784
17163
  datum[BinStartMeasureId] = datum[encoding.x0[0]];
@@ -16872,7 +17251,11 @@ self.R = R;
16872
17251
  const res = unfoldDimensions(binData, uniqDims, encoding, {
16873
17252
  foldMeasureId: FoldMeasureId,
16874
17253
  separator: "-",
16875
- colorItemAsId: false
17254
+ colorItemAsId: false,
17255
+ formatDimensionValue: (dimension, value)=>{
17256
+ const formatter = createFormatterByDimension(dimension, advancedVSeed.locale);
17257
+ return formatter(value);
17258
+ }
16876
17259
  });
16877
17260
  res.dataset.forEach((d)=>{
16878
17261
  newDatasets.push(d);
@@ -16882,7 +17265,8 @@ self.R = R;
16882
17265
  const res = dataReshapeByEncoding(dataset, T(dimensions, (item)=>item.id), subMeasures.filter((item)=>encoding.y?.includes(item.id)).slice(0, 1), encoding, {
16883
17266
  colorItemAsId: false,
16884
17267
  colorMeasureId,
16885
- omitIds: []
17268
+ omitIds: [],
17269
+ locale: advancedVSeed.locale
16886
17270
  });
16887
17271
  res.dataset.forEach((datum)=>{
16888
17272
  datum[BinStartMeasureId] = datum[encoding.x0[0]];
@@ -17875,7 +18259,9 @@ self.R = R;
17875
18259
  const resultText = [];
17876
18260
  const dimLabels = labelDims.map((item)=>{
17877
18261
  const id = item.id;
17878
- return realDatum[id] ?? realDatum.__OriginalData__?.[id];
18262
+ const rawValue = realDatum[id] ?? realDatum.__OriginalData__?.[id];
18263
+ const formatter = createFormatterByDimension(item, advancedVSeed.locale);
18264
+ return formatter(rawValue);
17879
18265
  }).filter((v)=>null != v && '' !== v);
17880
18266
  resultText.push(...dimLabels);
17881
18267
  const meaLabels = labelMeas.map((item)=>generateMeasureValue(realDatum[item.id] ?? realDatum.__OriginalData__?.[item.id], item, autoFormat, numFormat));
@@ -17903,13 +18289,22 @@ self.R = R;
17903
18289
  ...spec
17904
18290
  };
17905
18291
  const { advancedVSeed } = context;
17906
- const { chartType } = advancedVSeed;
18292
+ const { chartType, dimensions = [], encoding } = advancedVSeed;
17907
18293
  const baseConfig = advancedVSeed.config[chartType];
17908
18294
  const { label } = baseConfig;
17909
18295
  if (!label.enable) return result;
17910
18296
  result.nonLeaf = {
17911
18297
  visible: true
17912
18298
  };
18299
+ const dimIds = encoding.hierarchy || [];
18300
+ const dimFormatters = dimIds.map((id)=>{
18301
+ const dim = dimensions.find((item)=>item.id === id);
18302
+ return createFormatterByDimension(dim, advancedVSeed.locale);
18303
+ });
18304
+ const formatHierarchyName = (name, depth)=>{
18305
+ if (!dimFormatters?.[depth]) return name;
18306
+ return dimFormatters[depth](name);
18307
+ };
17913
18308
  result.nonLeafLabel = {
17914
18309
  visible: true,
17915
18310
  position: 'top',
@@ -17917,9 +18312,7 @@ self.R = R;
17917
18312
  style: {
17918
18313
  x: (data)=>(data.labelRect?.x0 || 0) + 4,
17919
18314
  textAlign: 'left',
17920
- text: (data)=>[
17921
- data.name
17922
- ],
18315
+ text: (data)=>formatHierarchyName(String(data.name ?? ''), data.depth),
17923
18316
  fontSize: 12,
17924
18317
  fill: '#000'
17925
18318
  }
@@ -17993,23 +18386,30 @@ self.R = R;
17993
18386
  return result;
17994
18387
  }
17995
18388
  const tooltipTreeMap = (spec, context)=>{
17996
- const result = tooltip_tooltip(spec, context);
18389
+ const result = tooltip_tooltip()(spec, context);
17997
18390
  const { advancedVSeed, vseed } = context;
17998
18391
  const { datasetReshapeInfo, dimensions = [], encoding } = advancedVSeed;
17999
18392
  const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
18000
18393
  if (result.tooltip) {
18001
18394
  if (!result.tooltip.mark) result.tooltip.mark = {};
18395
+ const formatterList = (encoding.hierarchy || []).map((id)=>{
18396
+ const dim = dimensions.find((item)=>item.id === id);
18397
+ return createFormatterByDimension(dim, advancedVSeed.locale);
18398
+ });
18002
18399
  result.tooltip.mark = {
18003
18400
  title: {
18004
18401
  visible: true,
18005
- value: (val)=>val?.datum?.map((data)=>data.name).join(' / ')
18402
+ value: (val)=>val?.datum?.map((data, index)=>{
18403
+ if (formatterList[index]) return formatterList[index](data.name);
18404
+ return data.name;
18405
+ }).join(' / ')
18006
18406
  },
18007
- content: tooltipTreeMap_createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, foldInfo, unfoldInfo)
18407
+ content: tooltipTreeMap_createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, foldInfo, unfoldInfo, advancedVSeed.locale)
18008
18408
  };
18009
18409
  }
18010
18410
  return result;
18011
18411
  };
18012
- const tooltipTreeMap_createMarkContent = (tooltip, dimensions = [], measures = [], foldInfo, unfoldInfo)=>{
18412
+ const tooltipTreeMap_createMarkContent = (tooltip, dimensions = [], measures = [], foldInfo, unfoldInfo, locale)=>{
18013
18413
  const dims = C(dimensions.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias), T((item)=>item.alias));
18014
18414
  const meas = C(measures.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias));
18015
18415
  const dimContent = dims.map((item)=>({
@@ -18029,7 +18429,8 @@ self.R = R;
18029
18429
  value: (v)=>{
18030
18430
  const { depth } = v;
18031
18431
  const datum = v?.datum[depth];
18032
- return datum && datum[item.id];
18432
+ const formatter = createFormatterByDimension(item, locale);
18433
+ return datum ? formatter(datum[item.id]) : '';
18033
18434
  }
18034
18435
  }));
18035
18436
  const defaultContent = {
@@ -18209,7 +18610,7 @@ self.R = R;
18209
18610
  return result;
18210
18611
  };
18211
18612
  const tooltipHierarchy = (spec, context)=>{
18212
- const result = tooltip_tooltip(spec, context);
18613
+ const result = tooltip_tooltip()(spec, context);
18213
18614
  const { advancedVSeed, vseed } = context;
18214
18615
  const { datasetReshapeInfo, dimensions = [], encoding } = advancedVSeed;
18215
18616
  const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
@@ -18220,12 +18621,12 @@ self.R = R;
18220
18621
  visible: true,
18221
18622
  value: (val)=>val?.datum?.map((data)=>data.name).join(' / ')
18222
18623
  },
18223
- content: tooltipHierarchy_createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, foldInfo, unfoldInfo)
18624
+ content: tooltipHierarchy_createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, foldInfo, unfoldInfo, advancedVSeed.locale)
18224
18625
  };
18225
18626
  }
18226
18627
  return result;
18227
18628
  };
18228
- const tooltipHierarchy_createMarkContent = (tooltip, dimensions = [], measures = [], foldInfo, unfoldInfo)=>{
18629
+ const tooltipHierarchy_createMarkContent = (tooltip, dimensions = [], measures = [], foldInfo, unfoldInfo, locale)=>{
18229
18630
  const dims = C(dimensions.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias), T((item)=>item.alias));
18230
18631
  const meas = C(measures.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias));
18231
18632
  const dimContent = dims.map((item)=>({
@@ -18239,7 +18640,8 @@ self.R = R;
18239
18640
  },
18240
18641
  value: (v)=>{
18241
18642
  const datum = v;
18242
- return datum && datum[item.id];
18643
+ const formatter = createFormatterByDimension(item, locale);
18644
+ return datum ? formatter(datum[item.id]) : '';
18243
18645
  }
18244
18646
  }));
18245
18647
  const defaultContent = {
@@ -18288,14 +18690,29 @@ self.R = R;
18288
18690
  };
18289
18691
  const labelSunburst = (spec, context)=>{
18290
18692
  const { advancedVSeed } = context;
18291
- const { chartType, encoding } = advancedVSeed;
18693
+ const { chartType, encoding, dimensions = [] } = advancedVSeed;
18292
18694
  const baseConfig = advancedVSeed.config[chartType];
18293
18695
  const { label } = baseConfig;
18294
18696
  const result = label_label(spec, context);
18295
18697
  if (label?.enable) {
18296
18698
  const labelSpec = result.label;
18699
+ const formatHierarchyName = (name)=>{
18700
+ const dimIds = encoding.hierarchy || [];
18701
+ if (!dimIds.length) return name;
18702
+ const dimFormatters = dimIds.map((id)=>{
18703
+ const dim = dimensions.find((item)=>item.id === id);
18704
+ return createFormatterByDimension(dim, advancedVSeed.locale);
18705
+ });
18706
+ const parts = String(name ?? '').split("-");
18707
+ const formatted = parts.map((part, index)=>{
18708
+ const formatter = dimFormatters[index] || ((v)=>v);
18709
+ return formatter(part);
18710
+ });
18711
+ return formatted.join("-");
18712
+ };
18297
18713
  result.label = {
18298
18714
  ...labelSpec,
18715
+ formatMethod: (_, datum)=>formatHierarchyName(String(datum?.name ?? '')),
18299
18716
  style: {
18300
18717
  ...labelSpec?.style,
18301
18718
  fontSize: 12,
@@ -18429,14 +18846,29 @@ self.R = R;
18429
18846
  };
18430
18847
  const labelCirclePacking = (spec, context)=>{
18431
18848
  const { advancedVSeed } = context;
18432
- const { chartType } = advancedVSeed;
18849
+ const { chartType, encoding, dimensions = [] } = advancedVSeed;
18433
18850
  const baseConfig = advancedVSeed.config[chartType];
18434
18851
  const { label } = baseConfig;
18435
18852
  const result = label_label(spec, context);
18436
18853
  if (label?.enable) {
18437
18854
  const labelSpec = result.label;
18855
+ const formatHierarchyName = (name)=>{
18856
+ const dimIds = encoding.hierarchy || [];
18857
+ if (!dimIds.length) return name;
18858
+ const dimFormatters = dimIds.map((id)=>{
18859
+ const dim = dimensions.find((item)=>item.id === id);
18860
+ return createFormatterByDimension(dim, advancedVSeed.locale);
18861
+ });
18862
+ const parts = String(name ?? '').split("-");
18863
+ const formatted = parts.map((part, index)=>{
18864
+ const formatter = dimFormatters[index] || ((v)=>v);
18865
+ return formatter(part);
18866
+ });
18867
+ return formatted.join("-");
18868
+ };
18438
18869
  result.label = {
18439
18870
  ...labelSpec,
18871
+ formatMethod: (_, datum)=>formatHierarchyName(String(datum?.name ?? '')),
18440
18872
  style: {
18441
18873
  ...labelSpec?.style,
18442
18874
  fontSize: 10,
@@ -20547,7 +20979,7 @@ self.R = R;
20547
20979
  const hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
20548
20980
  const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
20549
20981
  const dateSource = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";
20550
- const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
20982
+ const regexes_date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
20551
20983
  function timeSource(args) {
20552
20984
  const hhmm = "(?:[01]\\d|2[0-3]):[0-5]\\d";
20553
20985
  const regex = "number" == typeof args.precision ? -1 === args.precision ? `${hhmm}` : 0 === args.precision ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
@@ -21665,7 +22097,7 @@ self.R = R;
21665
22097
  $ZodStringFormat.init(inst, def);
21666
22098
  });
21667
22099
  const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def)=>{
21668
- def.pattern ?? (def.pattern = date);
22100
+ def.pattern ?? (def.pattern = regexes_date);
21669
22101
  $ZodStringFormat.init(inst, def);
21670
22102
  });
21671
22103
  const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def)=>{
@@ -23815,10 +24247,23 @@ self.R = R;
23815
24247
  player: 'player',
23816
24248
  hierarchy: 'hierarchy'
23817
24249
  };
24250
+ const zTimeFormat = schemas_object({
24251
+ type: schemas_enum([
24252
+ 'year',
24253
+ 'quarter',
24254
+ 'month',
24255
+ 'week',
24256
+ 'day',
24257
+ 'hour',
24258
+ 'minute',
24259
+ 'second'
24260
+ ])
24261
+ }).optional();
23818
24262
  const zDimension = schemas_object({
23819
24263
  id: schemas_string(),
23820
24264
  alias: schemas_string().optional(),
23821
- encoding: zDimensionEncoding.optional()
24265
+ encoding: zDimensionEncoding.optional(),
24266
+ timeFormat: zTimeFormat.optional()
23822
24267
  });
23823
24268
  const zDimensionGroup = schemas_object({
23824
24269
  id: schemas_string(),