@visactor/vseed 0.0.20 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/builder/builder/builder.d.ts +210 -118
  2. package/dist/index.cjs +383 -38
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.js +363 -24
  5. package/dist/index.js.map +1 -1
  6. package/dist/pipeline/spec/table/pipes/index.d.ts +1 -0
  7. package/dist/pipeline/spec/table/pipes/theme/bodyStyle.d.ts +2 -0
  8. package/dist/pipeline/spec/table/pipes/theme/cornerHeaderStyle.d.ts +2 -0
  9. package/dist/pipeline/spec/table/pipes/theme/frameStyle.d.ts +2 -0
  10. package/dist/pipeline/spec/table/pipes/theme/headerStyle.d.ts +2 -0
  11. package/dist/pipeline/spec/table/pipes/theme/index.d.ts +6 -0
  12. package/dist/pipeline/spec/table/pipes/theme/rowHeaderStyle.d.ts +2 -0
  13. package/dist/pipeline/spec/table/pipes/theme/scrollStyle.d.ts +2 -0
  14. package/dist/pipeline/spec/table/pipes/theme/selectionStyle.d.ts +2 -0
  15. package/dist/types/advancedVSeed.d.ts +55 -61
  16. package/dist/types/chartType/area/area.d.ts +8 -46
  17. package/dist/types/chartType/areaPercent/areaPercent.d.ts +8 -46
  18. package/dist/types/chartType/bar/bar.d.ts +9 -46
  19. package/dist/types/chartType/barParallel/barParallel.d.ts +8 -46
  20. package/dist/types/chartType/barPercent/barPercent.d.ts +8 -46
  21. package/dist/types/chartType/column/column.d.ts +8 -46
  22. package/dist/types/chartType/columnParallel/columnParallel.d.ts +8 -46
  23. package/dist/types/chartType/columnPercent/columnPercent.d.ts +8 -46
  24. package/dist/types/chartType/donut/donut.d.ts +8 -46
  25. package/dist/types/chartType/dualAxis/dualAxis.d.ts +2 -2
  26. package/dist/types/chartType/funnel/funnel.d.ts +8 -46
  27. package/dist/types/chartType/line/line.d.ts +8 -46
  28. package/dist/types/chartType/pie/pie.d.ts +8 -46
  29. package/dist/types/chartType/pivotTable/pivotTable.d.ts +8 -7
  30. package/dist/types/chartType/rose/rose.d.ts +9 -46
  31. package/dist/types/chartType/roseParallel/roseParallel.d.ts +10 -47
  32. package/dist/types/chartType/scatter/scatter.d.ts +8 -46
  33. package/dist/types/chartType/table/table.d.ts +6 -44
  34. package/dist/types/properties/config/config.d.ts +50 -2
  35. package/dist/types/properties/dimensions/dimensions.d.ts +20 -44
  36. package/dist/types/properties/measures/measures.d.ts +11 -87
  37. package/dist/types/properties/theme/customTheme.d.ts +48 -4
  38. package/dist/types/vseed.d.ts +101 -709
  39. package/dist/umd/index.js +703 -40
  40. package/dist/umd/index.js.map +1 -1
  41. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -73,6 +73,7 @@
73
73
  barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
74
74
  findAllDimensions: ()=>findAllDimensions,
75
75
  findDimensionById: ()=>findDimensionById,
76
+ zPivotTableConfig: ()=>zPivotTableConfig,
76
77
  zArea: ()=>zArea,
77
78
  zColumnParallel: ()=>zColumnParallel,
78
79
  zDimensions: ()=>zDimensions,
@@ -152,6 +153,7 @@
152
153
  zColumn: ()=>zColumn,
153
154
  zCustomTheme: ()=>zCustomTheme,
154
155
  zLineConfig: ()=>zLineConfig,
156
+ zTableConfig: ()=>zTableConfig,
155
157
  zXBandAxis: ()=>zXBandAxis,
156
158
  zColumnPercentConfig: ()=>zColumnPercentConfig,
157
159
  findMeasureById: ()=>findMeasureById,
@@ -4972,7 +4974,54 @@
4972
4974
  heightMode: 'autoHeight',
4973
4975
  autoWrapText: true,
4974
4976
  columnResizeMode: 'all',
4975
- showHeader: true
4977
+ showHeader: true,
4978
+ tooltip: {
4979
+ isShowOverflowTextTooltip: true
4980
+ },
4981
+ animationAppear: {
4982
+ duration: 300,
4983
+ delay: 250,
4984
+ type: 'one-by-one',
4985
+ direction: 'row'
4986
+ },
4987
+ theme: {
4988
+ underlayBackgroundColor: 'transparent'
4989
+ }
4990
+ };
4991
+ };
4992
+ const initPivotTable = (spec, context)=>{
4993
+ const { advancedVSeed } = context;
4994
+ const { dataset } = advancedVSeed;
4995
+ return {
4996
+ ...spec,
4997
+ records: dataset,
4998
+ widthMode: 'standard',
4999
+ heightMode: 'autoHeight',
5000
+ autoWrapText: true,
5001
+ columnResizeMode: 'all',
5002
+ columnResizeType: 'column',
5003
+ showColumnHeader: true,
5004
+ showRowHeader: true,
5005
+ select: {
5006
+ highlightMode: 'cell',
5007
+ headerSelectMode: 'inline'
5008
+ },
5009
+ hover: {
5010
+ highlightMode: 'cross'
5011
+ },
5012
+ tooltip: {
5013
+ isShowOverflowTextTooltip: true
5014
+ },
5015
+ widthAdaptiveMode: 'all',
5016
+ animationAppear: {
5017
+ duration: 300,
5018
+ delay: 250,
5019
+ type: 'one-by-one',
5020
+ direction: 'row'
5021
+ },
5022
+ theme: {
5023
+ underlayBackgroundColor: 'transparent'
5024
+ }
4976
5025
  };
4977
5026
  };
4978
5027
  const measureTreeToColumns = (spec, context)=>{
@@ -4981,7 +5030,13 @@
4981
5030
  const result = {
4982
5031
  ...spec
4983
5032
  };
4984
- const columns = treeTreeToColumns(measures);
5033
+ const eachNode = (node)=>{
5034
+ if ('children' in node) return {};
5035
+ return {
5036
+ width: 'auto'
5037
+ };
5038
+ };
5039
+ const columns = treeTreeToColumns(measures, eachNode);
4985
5040
  return {
4986
5041
  ...result,
4987
5042
  columns: [
@@ -4996,7 +5051,13 @@
4996
5051
  const result = {
4997
5052
  ...spec
4998
5053
  };
4999
- const columns = treeTreeToColumns(dimensions);
5054
+ const eachNode = (node)=>{
5055
+ if ('children' in node) return {};
5056
+ return {
5057
+ width: 'auto'
5058
+ };
5059
+ };
5060
+ const columns = treeTreeToColumns(dimensions, eachNode);
5000
5061
  return {
5001
5062
  ...result,
5002
5063
  columns: [
@@ -5005,39 +5066,33 @@
5005
5066
  ]
5006
5067
  };
5007
5068
  };
5008
- const treeTreeToColumns = (tree = [])=>{
5069
+ const treeTreeToColumns = (tree, callback)=>{
5009
5070
  const result = tree.map((item)=>{
5010
- const field = item.id;
5011
- const title = item.alias ?? item.id;
5012
- if ('children' in item && Array.isArray(item.children)) return {
5013
- field,
5014
- title,
5015
- columns: treeTreeToColumns(item.children)
5016
- };
5017
- return {
5018
- field,
5019
- title
5020
- };
5071
+ if ('children' in item && Array.isArray(item.children)) {
5072
+ const groupNode = item;
5073
+ const field = groupNode.id;
5074
+ const title = groupNode.alias ?? groupNode.id;
5075
+ const props = callback?.(groupNode) || {};
5076
+ return {
5077
+ field,
5078
+ title,
5079
+ columns: treeTreeToColumns(item.children, callback),
5080
+ ...props
5081
+ };
5082
+ }
5083
+ {
5084
+ const field = item.id;
5085
+ const title = item.alias ?? item.id;
5086
+ const props = callback?.(item) || {};
5087
+ return {
5088
+ field,
5089
+ title,
5090
+ ...props
5091
+ };
5092
+ }
5021
5093
  });
5022
5094
  return result || [];
5023
5095
  };
5024
- const tableSpecPipeline = [
5025
- initTable,
5026
- dimensionTreeToColumns,
5027
- measureTreeToColumns
5028
- ];
5029
- const initPivotTable = (spec, context)=>{
5030
- const { advancedVSeed } = context;
5031
- const { dataset } = advancedVSeed;
5032
- return {
5033
- ...spec,
5034
- records: dataset,
5035
- widthMode: 'standard',
5036
- heightMode: 'autoHeight',
5037
- autoWrapText: true,
5038
- columnResizeMode: 'all'
5039
- };
5040
- };
5041
5096
  const pivotColumns = (spec, context)=>{
5042
5097
  const { advancedVSeed } = context;
5043
5098
  const dimensions = advancedVSeed.dimensions;
@@ -5070,6 +5125,7 @@
5070
5125
  return {
5071
5126
  ...spec,
5072
5127
  indicatorsAsCol: true,
5128
+ indicatorTitle: intl.i18n`指标名称`,
5073
5129
  indicators: measures.map((item)=>({
5074
5130
  cellType: 'text',
5075
5131
  indicatorKey: item.id,
@@ -5078,11 +5134,577 @@
5078
5134
  }))
5079
5135
  };
5080
5136
  };
5137
+ function src_define(constructor, factory, prototype) {
5138
+ constructor.prototype = factory.prototype = prototype;
5139
+ prototype.constructor = constructor;
5140
+ }
5141
+ function extend(parent, definition) {
5142
+ var prototype = Object.create(parent.prototype);
5143
+ for(var key in definition)prototype[key] = definition[key];
5144
+ return prototype;
5145
+ }
5146
+ function Color() {}
5147
+ var darker = 0.7;
5148
+ var brighter = 1 / darker;
5149
+ var reI = "\\s*([+-]?\\d+)\\s*", reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", reHex = /^#([0-9a-f]{3,8})$/, reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`), reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`), reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`), reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`), reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`), reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
5150
+ var named = {
5151
+ aliceblue: 0xf0f8ff,
5152
+ antiquewhite: 0xfaebd7,
5153
+ aqua: 0x00ffff,
5154
+ aquamarine: 0x7fffd4,
5155
+ azure: 0xf0ffff,
5156
+ beige: 0xf5f5dc,
5157
+ bisque: 0xffe4c4,
5158
+ black: 0x000000,
5159
+ blanchedalmond: 0xffebcd,
5160
+ blue: 0x0000ff,
5161
+ blueviolet: 0x8a2be2,
5162
+ brown: 0xa52a2a,
5163
+ burlywood: 0xdeb887,
5164
+ cadetblue: 0x5f9ea0,
5165
+ chartreuse: 0x7fff00,
5166
+ chocolate: 0xd2691e,
5167
+ coral: 0xff7f50,
5168
+ cornflowerblue: 0x6495ed,
5169
+ cornsilk: 0xfff8dc,
5170
+ crimson: 0xdc143c,
5171
+ cyan: 0x00ffff,
5172
+ darkblue: 0x00008b,
5173
+ darkcyan: 0x008b8b,
5174
+ darkgoldenrod: 0xb8860b,
5175
+ darkgray: 0xa9a9a9,
5176
+ darkgreen: 0x006400,
5177
+ darkgrey: 0xa9a9a9,
5178
+ darkkhaki: 0xbdb76b,
5179
+ darkmagenta: 0x8b008b,
5180
+ darkolivegreen: 0x556b2f,
5181
+ darkorange: 0xff8c00,
5182
+ darkorchid: 0x9932cc,
5183
+ darkred: 0x8b0000,
5184
+ darksalmon: 0xe9967a,
5185
+ darkseagreen: 0x8fbc8f,
5186
+ darkslateblue: 0x483d8b,
5187
+ darkslategray: 0x2f4f4f,
5188
+ darkslategrey: 0x2f4f4f,
5189
+ darkturquoise: 0x00ced1,
5190
+ darkviolet: 0x9400d3,
5191
+ deeppink: 0xff1493,
5192
+ deepskyblue: 0x00bfff,
5193
+ dimgray: 0x696969,
5194
+ dimgrey: 0x696969,
5195
+ dodgerblue: 0x1e90ff,
5196
+ firebrick: 0xb22222,
5197
+ floralwhite: 0xfffaf0,
5198
+ forestgreen: 0x228b22,
5199
+ fuchsia: 0xff00ff,
5200
+ gainsboro: 0xdcdcdc,
5201
+ ghostwhite: 0xf8f8ff,
5202
+ gold: 0xffd700,
5203
+ goldenrod: 0xdaa520,
5204
+ gray: 0x808080,
5205
+ green: 0x008000,
5206
+ greenyellow: 0xadff2f,
5207
+ grey: 0x808080,
5208
+ honeydew: 0xf0fff0,
5209
+ hotpink: 0xff69b4,
5210
+ indianred: 0xcd5c5c,
5211
+ indigo: 0x4b0082,
5212
+ ivory: 0xfffff0,
5213
+ khaki: 0xf0e68c,
5214
+ lavender: 0xe6e6fa,
5215
+ lavenderblush: 0xfff0f5,
5216
+ lawngreen: 0x7cfc00,
5217
+ lemonchiffon: 0xfffacd,
5218
+ lightblue: 0xadd8e6,
5219
+ lightcoral: 0xf08080,
5220
+ lightcyan: 0xe0ffff,
5221
+ lightgoldenrodyellow: 0xfafad2,
5222
+ lightgray: 0xd3d3d3,
5223
+ lightgreen: 0x90ee90,
5224
+ lightgrey: 0xd3d3d3,
5225
+ lightpink: 0xffb6c1,
5226
+ lightsalmon: 0xffa07a,
5227
+ lightseagreen: 0x20b2aa,
5228
+ lightskyblue: 0x87cefa,
5229
+ lightslategray: 0x778899,
5230
+ lightslategrey: 0x778899,
5231
+ lightsteelblue: 0xb0c4de,
5232
+ lightyellow: 0xffffe0,
5233
+ lime: 0x00ff00,
5234
+ limegreen: 0x32cd32,
5235
+ linen: 0xfaf0e6,
5236
+ magenta: 0xff00ff,
5237
+ maroon: 0x800000,
5238
+ mediumaquamarine: 0x66cdaa,
5239
+ mediumblue: 0x0000cd,
5240
+ mediumorchid: 0xba55d3,
5241
+ mediumpurple: 0x9370db,
5242
+ mediumseagreen: 0x3cb371,
5243
+ mediumslateblue: 0x7b68ee,
5244
+ mediumspringgreen: 0x00fa9a,
5245
+ mediumturquoise: 0x48d1cc,
5246
+ mediumvioletred: 0xc71585,
5247
+ midnightblue: 0x191970,
5248
+ mintcream: 0xf5fffa,
5249
+ mistyrose: 0xffe4e1,
5250
+ moccasin: 0xffe4b5,
5251
+ navajowhite: 0xffdead,
5252
+ navy: 0x000080,
5253
+ oldlace: 0xfdf5e6,
5254
+ olive: 0x808000,
5255
+ olivedrab: 0x6b8e23,
5256
+ orange: 0xffa500,
5257
+ orangered: 0xff4500,
5258
+ orchid: 0xda70d6,
5259
+ palegoldenrod: 0xeee8aa,
5260
+ palegreen: 0x98fb98,
5261
+ paleturquoise: 0xafeeee,
5262
+ palevioletred: 0xdb7093,
5263
+ papayawhip: 0xffefd5,
5264
+ peachpuff: 0xffdab9,
5265
+ peru: 0xcd853f,
5266
+ pink: 0xffc0cb,
5267
+ plum: 0xdda0dd,
5268
+ powderblue: 0xb0e0e6,
5269
+ purple: 0x800080,
5270
+ rebeccapurple: 0x663399,
5271
+ red: 0xff0000,
5272
+ rosybrown: 0xbc8f8f,
5273
+ royalblue: 0x4169e1,
5274
+ saddlebrown: 0x8b4513,
5275
+ salmon: 0xfa8072,
5276
+ sandybrown: 0xf4a460,
5277
+ seagreen: 0x2e8b57,
5278
+ seashell: 0xfff5ee,
5279
+ sienna: 0xa0522d,
5280
+ silver: 0xc0c0c0,
5281
+ skyblue: 0x87ceeb,
5282
+ slateblue: 0x6a5acd,
5283
+ slategray: 0x708090,
5284
+ slategrey: 0x708090,
5285
+ snow: 0xfffafa,
5286
+ springgreen: 0x00ff7f,
5287
+ steelblue: 0x4682b4,
5288
+ tan: 0xd2b48c,
5289
+ teal: 0x008080,
5290
+ thistle: 0xd8bfd8,
5291
+ tomato: 0xff6347,
5292
+ turquoise: 0x40e0d0,
5293
+ violet: 0xee82ee,
5294
+ wheat: 0xf5deb3,
5295
+ white: 0xffffff,
5296
+ whitesmoke: 0xf5f5f5,
5297
+ yellow: 0xffff00,
5298
+ yellowgreen: 0x9acd32
5299
+ };
5300
+ src_define(Color, src_color_color, {
5301
+ copy (channels) {
5302
+ return Object.assign(new this.constructor, this, channels);
5303
+ },
5304
+ displayable () {
5305
+ return this.rgb().displayable();
5306
+ },
5307
+ hex: color_formatHex,
5308
+ formatHex: color_formatHex,
5309
+ formatHex8: color_formatHex8,
5310
+ formatHsl: color_formatHsl,
5311
+ formatRgb: color_formatRgb,
5312
+ toString: color_formatRgb
5313
+ });
5314
+ function color_formatHex() {
5315
+ return this.rgb().formatHex();
5316
+ }
5317
+ function color_formatHex8() {
5318
+ return this.rgb().formatHex8();
5319
+ }
5320
+ function color_formatHsl() {
5321
+ return hslConvert(this).formatHsl();
5322
+ }
5323
+ function color_formatRgb() {
5324
+ return this.rgb().formatRgb();
5325
+ }
5326
+ function src_color_color(format) {
5327
+ var m, l;
5328
+ format = (format + "").trim().toLowerCase();
5329
+ return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), 6 === l ? rgbn(m) : 3 === l ? new Rgb(m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | 0xf0 & m, (0xf & m) << 4 | 0xf & m, 1) : 8 === l ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (0xff & m) / 0xff) : 4 === l ? rgba(m >> 12 & 0xf | m >> 8 & 0xf0, m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | 0xf0 & m, ((0xf & m) << 4 | 0xf & m) / 0xff) : null) : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format)) ? new Rgb(255 * m[1] / 100, 255 * m[2] / 100, 255 * m[3] / 100, 1) : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format)) ? rgba(255 * m[1] / 100, 255 * m[2] / 100, 255 * m[3] / 100, m[4]) : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format) ? rgbn(named[format]) : "transparent" === format ? new Rgb(NaN, NaN, NaN, 0) : null;
5330
+ }
5331
+ function rgbn(n) {
5332
+ return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, 0xff & n, 1);
5333
+ }
5334
+ function rgba(r, g, b, a) {
5335
+ if (a <= 0) r = g = b = NaN;
5336
+ return new Rgb(r, g, b, a);
5337
+ }
5338
+ function rgbConvert(o) {
5339
+ if (!(o instanceof Color)) o = src_color_color(o);
5340
+ if (!o) return new Rgb;
5341
+ o = o.rgb();
5342
+ return new Rgb(o.r, o.g, o.b, o.opacity);
5343
+ }
5344
+ function rgb(r, g, b, opacity) {
5345
+ return 1 === arguments.length ? rgbConvert(r) : new Rgb(r, g, b, null == opacity ? 1 : opacity);
5346
+ }
5347
+ function Rgb(r, g, b, opacity) {
5348
+ this.r = +r;
5349
+ this.g = +g;
5350
+ this.b = +b;
5351
+ this.opacity = +opacity;
5352
+ }
5353
+ src_define(Rgb, rgb, extend(Color, {
5354
+ brighter (k) {
5355
+ k = null == k ? brighter : Math.pow(brighter, k);
5356
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
5357
+ },
5358
+ darker (k) {
5359
+ k = null == k ? darker : Math.pow(darker, k);
5360
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
5361
+ },
5362
+ rgb () {
5363
+ return this;
5364
+ },
5365
+ clamp () {
5366
+ return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
5367
+ },
5368
+ displayable () {
5369
+ return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
5370
+ },
5371
+ hex: rgb_formatHex,
5372
+ formatHex: rgb_formatHex,
5373
+ formatHex8: rgb_formatHex8,
5374
+ formatRgb: rgb_formatRgb,
5375
+ toString: rgb_formatRgb
5376
+ }));
5377
+ function rgb_formatHex() {
5378
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
5379
+ }
5380
+ function rgb_formatHex8() {
5381
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
5382
+ }
5383
+ function rgb_formatRgb() {
5384
+ const a = clampa(this.opacity);
5385
+ return `${1 === a ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${1 === a ? ")" : `, ${a})`}`;
5386
+ }
5387
+ function clampa(opacity) {
5388
+ return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
5389
+ }
5390
+ function clampi(value) {
5391
+ return Math.max(0, Math.min(255, Math.round(value) || 0));
5392
+ }
5393
+ function hex(value) {
5394
+ value = clampi(value);
5395
+ return (value < 16 ? "0" : "") + value.toString(16);
5396
+ }
5397
+ function hsla(h, s, l, a) {
5398
+ if (a <= 0) h = s = l = NaN;
5399
+ else if (l <= 0 || l >= 1) h = s = NaN;
5400
+ else if (s <= 0) h = NaN;
5401
+ return new Hsl(h, s, l, a);
5402
+ }
5403
+ function hslConvert(o) {
5404
+ if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
5405
+ if (!(o instanceof Color)) o = src_color_color(o);
5406
+ if (!o) return new Hsl;
5407
+ if (o instanceof Hsl) return o;
5408
+ o = o.rgb();
5409
+ var r = o.r / 255, g = o.g / 255, b = o.b / 255, min = Math.min(r, g, b), max = Math.max(r, g, b), h = NaN, s = max - min, l = (max + min) / 2;
5410
+ if (s) {
5411
+ h = r === max ? (g - b) / s + (g < b) * 6 : g === max ? (b - r) / s + 2 : (r - g) / s + 4;
5412
+ s /= l < 0.5 ? max + min : 2 - max - min;
5413
+ h *= 60;
5414
+ } else s = l > 0 && l < 1 ? 0 : h;
5415
+ return new Hsl(h, s, l, o.opacity);
5416
+ }
5417
+ function hsl(h, s, l, opacity) {
5418
+ return 1 === arguments.length ? hslConvert(h) : new Hsl(h, s, l, null == opacity ? 1 : opacity);
5419
+ }
5420
+ function Hsl(h, s, l, opacity) {
5421
+ this.h = +h;
5422
+ this.s = +s;
5423
+ this.l = +l;
5424
+ this.opacity = +opacity;
5425
+ }
5426
+ src_define(Hsl, hsl, extend(Color, {
5427
+ brighter (k) {
5428
+ k = null == k ? brighter : Math.pow(brighter, k);
5429
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
5430
+ },
5431
+ darker (k) {
5432
+ k = null == k ? darker : Math.pow(darker, k);
5433
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
5434
+ },
5435
+ rgb () {
5436
+ var h = this.h % 360 + (this.h < 0) * 360, s = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s, m1 = 2 * l - m2;
5437
+ return new Rgb(hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb(h, m1, m2), hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity);
5438
+ },
5439
+ clamp () {
5440
+ return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
5441
+ },
5442
+ displayable () {
5443
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
5444
+ },
5445
+ formatHsl () {
5446
+ const a = clampa(this.opacity);
5447
+ return `${1 === a ? "hsl(" : "hsla("}${clamph(this.h)}, ${100 * clampt(this.s)}%, ${100 * clampt(this.l)}%${1 === a ? ")" : `, ${a})`}`;
5448
+ }
5449
+ }));
5450
+ function clamph(value) {
5451
+ value = (value || 0) % 360;
5452
+ return value < 0 ? value + 360 : value;
5453
+ }
5454
+ function clampt(value) {
5455
+ return Math.max(0, Math.min(1, value || 0));
5456
+ }
5457
+ function hsl2rgb(h, m1, m2) {
5458
+ return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
5459
+ }
5460
+ const bodyStyle = (spec, context)=>{
5461
+ const result = {
5462
+ ...spec
5463
+ };
5464
+ const { advancedVSeed } = context;
5465
+ const { customTheme, chartType } = advancedVSeed;
5466
+ const themConfig = customTheme?.config?.[chartType];
5467
+ if (!result.theme || !themConfig) return result;
5468
+ const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
5469
+ const backgroundColor = themConfig.bodyBackgroundColor || '#fff';
5470
+ const fontColor = themConfig.bodyFontColor || '#1B1F23';
5471
+ const fontSize = themConfig.bodyFontSize || 12;
5472
+ const hoverCellBgColor = themConfig.hoverBodyBackgroundColor || '#bedaff';
5473
+ const hoverInlineColor = src_color_color(hoverCellBgColor)?.copy({
5474
+ opacity: 0.1
5475
+ }).toString();
5476
+ result.theme.bodyStyle = {
5477
+ borderColor: borderColor,
5478
+ borderLineWidth: 1,
5479
+ padding: [
5480
+ 8.6,
5481
+ 12,
5482
+ 8.6,
5483
+ 12
5484
+ ],
5485
+ textAlign: 'right',
5486
+ hover: {
5487
+ cellBgColor: hoverCellBgColor,
5488
+ inlineRowBgColor: hoverInlineColor,
5489
+ inlineColumnBgColor: hoverInlineColor
5490
+ },
5491
+ color: fontColor,
5492
+ fontSize: fontSize,
5493
+ fontStyle: 'normal',
5494
+ fontWeight: 'normal',
5495
+ fontVariant: 'normal',
5496
+ bgColor: backgroundColor,
5497
+ lineHeight: 1.5 * fontSize
5498
+ };
5499
+ return result;
5500
+ };
5501
+ const headerStyle = (spec, context)=>{
5502
+ const result = {
5503
+ ...spec
5504
+ };
5505
+ const { advancedVSeed } = context;
5506
+ const { customTheme, chartType } = advancedVSeed;
5507
+ const themConfig = customTheme?.config?.[chartType];
5508
+ if (!result.theme || !themConfig) return result;
5509
+ const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
5510
+ const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
5511
+ const fontColor = themConfig.headerFontColor || '#1B1F23';
5512
+ const fontSize = themConfig.headerFontSize || 12;
5513
+ const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
5514
+ const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
5515
+ result.theme.headerStyle = {
5516
+ borderColor: borderColor,
5517
+ borderLineWidth: 1,
5518
+ padding: [
5519
+ 8,
5520
+ 12,
5521
+ 8,
5522
+ 12
5523
+ ],
5524
+ textAlign: 'center',
5525
+ hover: {
5526
+ cellBgColor: src_color_color(hoverCellBgColor)?.copy({
5527
+ opacity: 1
5528
+ }).brighter(0.5).toString(),
5529
+ inlineRowBgColor: hoverInlineColor,
5530
+ inlineColumnBgColor: hoverInlineColor
5531
+ },
5532
+ frameStyle: {
5533
+ borderColor: [
5534
+ null,
5535
+ null,
5536
+ borderColor,
5537
+ null
5538
+ ],
5539
+ borderLineWidth: 1
5540
+ },
5541
+ fontSize: fontSize,
5542
+ fontVariant: 'normal',
5543
+ fontStyle: 'normal',
5544
+ fontWeight: 'bold',
5545
+ color: fontColor,
5546
+ bgColor: backgroundColor,
5547
+ lineHeight: 1.5 * fontSize
5548
+ };
5549
+ return result;
5550
+ };
5551
+ const rowHeaderStyle = (spec, context)=>{
5552
+ const result = {
5553
+ ...spec
5554
+ };
5555
+ const { advancedVSeed } = context;
5556
+ const { customTheme, chartType } = advancedVSeed;
5557
+ const themConfig = customTheme?.config?.[chartType];
5558
+ if (!result.theme || !themConfig) return result;
5559
+ const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
5560
+ const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
5561
+ const fontColor = themConfig.headerFontColor || '#1B1F23';
5562
+ const fontSize = themConfig.headerFontSize || 12;
5563
+ const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
5564
+ const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
5565
+ result.theme.rowHeaderStyle = {
5566
+ borderColor: borderColor,
5567
+ borderLineWidth: 1,
5568
+ padding: [
5569
+ 8.6,
5570
+ 12,
5571
+ 8.6,
5572
+ 12
5573
+ ],
5574
+ textAlign: 'left',
5575
+ hover: {
5576
+ cellBgColor: src_color_color(hoverCellBgColor)?.copy({
5577
+ opacity: 1
5578
+ }).brighter(0.5).toString(),
5579
+ inlineRowBgColor: hoverInlineColor,
5580
+ inlineColumnBgColor: hoverInlineColor
5581
+ },
5582
+ frameStyle: {
5583
+ borderColor: [
5584
+ null,
5585
+ borderColor,
5586
+ null,
5587
+ null
5588
+ ],
5589
+ borderLineWidth: 1
5590
+ },
5591
+ fontSize: fontSize,
5592
+ fontVariant: 'normal',
5593
+ fontStyle: 'normal',
5594
+ fontWeight: 'bold',
5595
+ color: fontColor,
5596
+ bgColor: backgroundColor,
5597
+ lineHeight: 1.5 * fontSize
5598
+ };
5599
+ return result;
5600
+ };
5601
+ const cornerHeaderStyle = (spec, context)=>{
5602
+ const result = {
5603
+ ...spec
5604
+ };
5605
+ const { advancedVSeed } = context;
5606
+ const { customTheme, chartType } = advancedVSeed;
5607
+ const themConfig = customTheme?.config?.[chartType];
5608
+ if (!result.theme || !themConfig) return result;
5609
+ const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
5610
+ const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
5611
+ const fontColor = themConfig.headerFontColor || '#1B1F23';
5612
+ const fontSize = themConfig.headerFontSize || 12;
5613
+ const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
5614
+ const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
5615
+ result.theme.cornerHeaderStyle = {
5616
+ borderColor: [
5617
+ borderColor,
5618
+ borderColor
5619
+ ],
5620
+ borderLineWidth: 1,
5621
+ padding: [
5622
+ 8,
5623
+ 12,
5624
+ 8,
5625
+ 12
5626
+ ],
5627
+ textAlign: 'left',
5628
+ hover: {
5629
+ cellBgColor: src_color_color(hoverCellBgColor)?.copy({
5630
+ opacity: 1
5631
+ }).brighter(0.5).toString(),
5632
+ inlineRowBgColor: hoverInlineColor,
5633
+ inlineColumnBgColor: hoverInlineColor
5634
+ },
5635
+ frameStyle: {
5636
+ borderColor: [
5637
+ null,
5638
+ borderColor,
5639
+ borderColor,
5640
+ null
5641
+ ],
5642
+ borderLineWidth: 1
5643
+ },
5644
+ fontSize: fontSize,
5645
+ fontVariant: 'normal',
5646
+ fontStyle: 'normal',
5647
+ fontWeight: 'bold',
5648
+ color: fontColor,
5649
+ bgColor: backgroundColor,
5650
+ lineHeight: 1.5 * fontSize
5651
+ };
5652
+ return result;
5653
+ };
5654
+ const frameStyle = (spec, context)=>{
5655
+ const result = {
5656
+ ...spec
5657
+ };
5658
+ const { advancedVSeed } = context;
5659
+ const { customTheme, chartType } = advancedVSeed;
5660
+ const themConfig = customTheme?.config?.[chartType];
5661
+ if (!result.theme || !themConfig) return result;
5662
+ const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
5663
+ result.theme.frameStyle = {
5664
+ borderColor,
5665
+ borderLineWidth: 0,
5666
+ cornerRadius: 0
5667
+ };
5668
+ return result;
5669
+ };
5670
+ const selectionStyle = (spec, context)=>{
5671
+ const result = {
5672
+ ...spec
5673
+ };
5674
+ const { advancedVSeed } = context;
5675
+ const { customTheme, chartType } = advancedVSeed;
5676
+ const themConfig = customTheme?.config?.[chartType];
5677
+ if (!result.theme || !themConfig) return result;
5678
+ const borderColor = themConfig.selectedBorderColor || 'rgb(224, 224, 224)';
5679
+ result.theme.selectionStyle = {
5680
+ cellBorderColor: borderColor,
5681
+ cellBorderLineWidth: 2,
5682
+ cellBgColor: src_color_color(borderColor)?.copy({
5683
+ opacity: 0.15
5684
+ }).toString()
5685
+ };
5686
+ return result;
5687
+ };
5688
+ const tableSpecPipeline = [
5689
+ initTable,
5690
+ dimensionTreeToColumns,
5691
+ measureTreeToColumns,
5692
+ bodyStyle,
5693
+ headerStyle,
5694
+ frameStyle,
5695
+ selectionStyle
5696
+ ];
5081
5697
  const pivotTableSpecPipeline = [
5082
5698
  initPivotTable,
5083
5699
  pivotColumns,
5084
5700
  pivotRows,
5085
- pivotIndicators_pivotIndicators
5701
+ pivotIndicators_pivotIndicators,
5702
+ bodyStyle,
5703
+ headerStyle,
5704
+ rowHeaderStyle,
5705
+ cornerHeaderStyle,
5706
+ frameStyle,
5707
+ selectionStyle
5086
5708
  ];
5087
5709
  const buildAdvanced = (builder)=>{
5088
5710
  const { chartType } = builder.vseed;
@@ -5380,8 +6002,22 @@
5380
6002
  labelFontWeight: 400
5381
6003
  }
5382
6004
  };
6005
+ const tableConfig = {
6006
+ borderColor: '#e3e5eb',
6007
+ bodyFontSize: 12,
6008
+ bodyFontColor: '#141414',
6009
+ bodyBackgroundColor: 'transparent',
6010
+ headerFontSize: 12,
6011
+ headerFontColor: '#21252c',
6012
+ headerBackgroundColor: '#f6f7f9',
6013
+ hoverBodyBackgroundColor: '#bedaff',
6014
+ hoverHeaderBackgroundColor: '#D9DDE488',
6015
+ selectedBorderColor: '#4080ff'
6016
+ };
5383
6017
  return {
5384
6018
  config: {
6019
+ table: tableConfig,
6020
+ pivotTable: tableConfig,
5385
6021
  line: {
5386
6022
  ...baseConfig,
5387
6023
  xAxis: bandAxis,
@@ -5659,8 +6295,22 @@
5659
6295
  labelFontWeight: 400
5660
6296
  }
5661
6297
  };
6298
+ const tableConfig = {
6299
+ borderColor: '#4b4e53',
6300
+ bodyFontSize: 12,
6301
+ bodyFontColor: '#fdfdfd',
6302
+ bodyBackgroundColor: 'transparent',
6303
+ headerFontSize: 12,
6304
+ headerFontColor: '#fdfdfd',
6305
+ headerBackgroundColor: '#36393e',
6306
+ hoverBodyBackgroundColor: '#4284ff66',
6307
+ hoverHeaderBackgroundColor: '#5f5f5f88',
6308
+ selectedBorderColor: '#3073F2'
6309
+ };
5662
6310
  return {
5663
6311
  config: {
6312
+ table: tableConfig,
6313
+ pivotTable: tableConfig,
5664
6314
  line: {
5665
6315
  ...baseConfig,
5666
6316
  xAxis: bandAxis,
@@ -6154,7 +6804,7 @@
6154
6804
  });
6155
6805
  return clone(schema, def);
6156
6806
  }
6157
- function extend(schema, shape) {
6807
+ function util_extend(schema, shape) {
6158
6808
  if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
6159
6809
  const def = mergeDefs(schema._zod.def, {
6160
6810
  get shape () {
@@ -8847,7 +9497,7 @@
8847
9497
  ...inst._zod.def,
8848
9498
  catchall: void 0
8849
9499
  });
8850
- inst.extend = (incoming)=>extend(inst, incoming);
9500
+ inst.extend = (incoming)=>util_extend(inst, incoming);
8851
9501
  inst.merge = (other)=>merge(inst, other);
8852
9502
  inst.pick = (mask)=>pick(inst, mask);
8853
9503
  inst.omit = (mask)=>omit(inst, mask);
@@ -9147,7 +9797,7 @@
9147
9797
  'dimension',
9148
9798
  'rowDimension',
9149
9799
  'columnDimension'
9150
- ]).default('dimension').optional()
9800
+ ]).default('dimension')
9151
9801
  });
9152
9802
  const zDimensionGroup = schemas_object({
9153
9803
  id: schemas_string(),
@@ -9191,8 +9841,8 @@
9191
9841
  const zMeasure = schemas_object({
9192
9842
  id: schemas_string(),
9193
9843
  alias: schemas_string().optional(),
9194
- autoFormat: schemas_boolean().default(true).optional(),
9195
- format: zNumFormat["default"]({}).optional()
9844
+ autoFormat: schemas_boolean().default(true),
9845
+ format: zNumFormat["default"]({})
9196
9846
  });
9197
9847
  const zMeasureGroup = schemas_object({
9198
9848
  id: schemas_string(),
@@ -9400,6 +10050,19 @@
9400
10050
  const zTooltip = schemas_object({
9401
10051
  enable: schemas_boolean().default(true).optional()
9402
10052
  });
10053
+ const zTableConfig = schemas_object({
10054
+ borderColor: schemas_string().optional(),
10055
+ bodyFontSize: schemas_number().optional(),
10056
+ bodyFontColor: schemas_string().optional(),
10057
+ bodyBackgroundColor: schemas_string().optional(),
10058
+ hoverBodyBackgroundColor: schemas_string().optional(),
10059
+ headerFontSize: schemas_number().optional(),
10060
+ headerFontColor: schemas_string().optional(),
10061
+ headerBackgroundColor: schemas_string().optional(),
10062
+ hoverHeaderBackgroundColor: schemas_string().optional(),
10063
+ selectedBorderColor: schemas_string().optional()
10064
+ });
10065
+ const zPivotTableConfig = zTableConfig;
9403
10066
  const zLineConfig = schemas_object({
9404
10067
  backgroundColor: zBackgroundColor.optional(),
9405
10068
  label: zLabel.optional(),
@@ -9488,8 +10151,8 @@
9488
10151
  legend: zLegend.optional()
9489
10152
  });
9490
10153
  const zConfig = schemas_object({
9491
- table: schemas_object({}).optional(),
9492
- pivotTable: schemas_object({}).optional(),
10154
+ table: zTableConfig.optional(),
10155
+ pivotTable: zPivotTableConfig.optional(),
9493
10156
  line: zLineConfig.optional(),
9494
10157
  column: zColumnConfig.optional(),
9495
10158
  columnParallel: zColumnParallelConfig.optional(),