@visactor/vseed 0.0.31 → 0.0.33

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.
package/dist/index.js CHANGED
@@ -175,7 +175,7 @@ const autoMeasures = (advancedVSeed, context)=>{
175
175
  const { measures, dataset } = vseed;
176
176
  if (!dataset) throw new Error('dataset is required');
177
177
  if (0 === dataset.length) return result;
178
- if (measures && measures.length > 0) {
178
+ if (measures) {
179
179
  result.measures = measures;
180
180
  return result;
181
181
  }
@@ -255,7 +255,7 @@ const autoDimensions = (advancedVSeed, context)=>{
255
255
  const measures = findAllMeasures(advancedVSeed.measures);
256
256
  if (!dataset) throw new Error('dataset is required');
257
257
  if (0 === dataset.length) return result;
258
- if (dimensions && dimensions.length > 0) {
258
+ if (dimensions) {
259
259
  result.dimensions = dimensions;
260
260
  return result;
261
261
  }
@@ -552,7 +552,7 @@ const autoPivotMeasures = (advancedVSeed, context)=>{
552
552
  const measures = findAllMeasures(vseed.measures);
553
553
  if (!dataset) throw new Error('dataset is required');
554
554
  if (0 === dataset.length) return result;
555
- if (measures && measures.length > 0) {
555
+ if (measures) {
556
556
  result.measures = findAllMeasures(measures);
557
557
  return result;
558
558
  }
@@ -615,7 +615,7 @@ const autoPivotDimensions = (advancedVSeed, context)=>{
615
615
  const measures = findAllMeasures(advancedVSeed.measures);
616
616
  if (!dataset) throw new Error('dataset is required');
617
617
  if (0 === dataset.length) return result;
618
- if (dimensions && dimensions.length > 0) {
618
+ if (dimensions) {
619
619
  const newDimensions = findAllDimensions(dimensions);
620
620
  result.dimensions = newDimensions.map((item, index)=>{
621
621
  if ('rowDimension' === item.location || 'columnDimension' === item.location) return item;
@@ -1206,7 +1206,7 @@ const encodingXY = (advancedVSeed)=>{
1206
1206
  };
1207
1207
  const { datasetReshapeInfo, dimensions } = advancedVSeed;
1208
1208
  if (!datasetReshapeInfo || !dimensions) return result;
1209
- const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
1209
+ const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location) || dimensions[0];
1210
1210
  const isZeroDimension = 0 === dimensions.length;
1211
1211
  const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
1212
1212
  const { foldInfo, unfoldInfo } = cur;
@@ -1954,7 +1954,7 @@ const discreteLegend = (spec, context)=>{
1954
1954
  const baseConfig = advancedVSeed.config[chartType];
1955
1955
  if (!baseConfig || !baseConfig.legend) return result;
1956
1956
  const { legend } = baseConfig;
1957
- const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize, border, shapeType = 'rectRound' } = legend || {};
1957
+ const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
1958
1958
  const orient = [
1959
1959
  'bottom',
1960
1960
  'bottomLeft',
@@ -1996,8 +1996,8 @@ const discreteLegend = (spec, context)=>{
1996
1996
  result.legends = {
1997
1997
  type: 'discrete',
1998
1998
  visible: enable,
1999
- maxCol: maxSize,
2000
- maxRow: maxSize,
1999
+ maxCol: Math.max(1, maxSize),
2000
+ maxRow: Math.max(1, maxSize),
2001
2001
  autoPage: true,
2002
2002
  orient,
2003
2003
  position: legendPosition,
@@ -2011,7 +2011,7 @@ const discreteLegend = (spec, context)=>{
2011
2011
  }) : void 0,
2012
2012
  item: {
2013
2013
  focus: true,
2014
- maxWidth: 260,
2014
+ maxWidth: '30%',
2015
2015
  focusIconStyle: {
2016
2016
  size: labelFontSize + 2,
2017
2017
  fill: labelFontColor,
@@ -2303,7 +2303,7 @@ const annotationPoint_annotationPoint = (spec, context)=>{
2303
2303
  annotationPoint
2304
2304
  ];
2305
2305
  const markPoint = annotationPointList.flatMap((annotationPoint)=>{
2306
- const { selector: selectorPoint, text = '', textColor = '#cccccc', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'middle', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true, offsetX = 0, offsetY = 0 } = annotationPoint;
2306
+ const { selector: selectorPoint, text = '', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true, offsetX = 0, offsetY = 0 } = annotationPoint;
2307
2307
  const dataset = advancedVSeed.dataset.flat();
2308
2308
  const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
2309
2309
  return selectedData.map((datum)=>({
@@ -2335,7 +2335,8 @@ const annotationPoint_annotationPoint = (spec, context)=>{
2335
2335
  stroke: backgroundColor,
2336
2336
  lineWidth: 1,
2337
2337
  fontSize: textFontSize,
2338
- fontWeight: textFontWeight
2338
+ fontWeight: textFontWeight,
2339
+ dy: textFontSize
2339
2340
  },
2340
2341
  labelBackground: {
2341
2342
  visible: backgroundVisible,
@@ -2344,7 +2345,8 @@ const annotationPoint_annotationPoint = (spec, context)=>{
2344
2345
  cornerRadius: backgroundBorderRadius ?? 4,
2345
2346
  fill: backgroundColor,
2346
2347
  stroke: backgroundBorderColor,
2347
- lineWidth: backgroundBorderWidth
2348
+ lineWidth: backgroundBorderWidth,
2349
+ dy: textFontSize
2348
2350
  }
2349
2351
  }
2350
2352
  }
@@ -2373,7 +2375,7 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
2373
2375
  insideEnd: 'insideEndTop'
2374
2376
  };
2375
2377
  const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
2376
- const { selector: selectorPoint, xValue, text = '', textPosition = 'insideEnd', textColor = '#cccccc', textFontSize = 12, textFontWeight = 400, textAlign = 'right', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true, lineColor = '#212121', lineStyle = 'dashed', lineVisible = true, lineWidth = 1, offsetX = 0, offsetY = 0 } = annotationVerticalLine;
2378
+ const { selector: selectorPoint, xValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'right', textBaseline = 'top', backgroundVisible = true, backgroundBorderColor = '#212121', backgroundColor = '#212121', backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundPadding = 2, lineVisible = true, lineColor = '#212121', lineWidth = 1, lineStyle = 'dashed', offsetX = 0, offsetY = 0 } = annotationVerticalLine;
2377
2379
  const dataset = advancedVSeed.dataset.flat();
2378
2380
  const generateOneMarkLine = (x)=>({
2379
2381
  x: x,
@@ -2415,6 +2417,7 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
2415
2417
  visible: backgroundVisible,
2416
2418
  padding: backgroundPadding,
2417
2419
  style: {
2420
+ dy: textFontSize,
2418
2421
  cornerRadius: backgroundBorderRadius ?? 4,
2419
2422
  fill: backgroundColor,
2420
2423
  stroke: backgroundBorderColor,
@@ -2424,6 +2427,7 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
2424
2427
  },
2425
2428
  endSymbol: {
2426
2429
  visible: true,
2430
+ size: 10 + lineWidth,
2427
2431
  style: {
2428
2432
  dy: 4,
2429
2433
  fill: lineColor
@@ -2470,7 +2474,7 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
2470
2474
  insideEnd: 'insideEndTop'
2471
2475
  };
2472
2476
  const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
2473
- const { selector: selectorPoint, yValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'bottom', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true, lineColor = '#212121', lineStyle = 'dashed', lineVisible = true, lineWidth = 1, offsetX = 0, offsetY = 0 } = annotationVerticalLine;
2477
+ const { selector: selectorPoint, yValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'right', textBaseline = 'top', lineColor = '#212121', lineStyle = 'dashed', lineVisible = true, lineWidth = 1, backgroundVisible = true, backgroundColor = '#212121', backgroundBorderColor = '#212121', backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundPadding = 2, offsetX = 0, offsetY = 0 } = annotationVerticalLine;
2474
2478
  const dataset = advancedVSeed.dataset.flat();
2475
2479
  const generateOneMarkLine = (y)=>({
2476
2480
  y,
@@ -2512,6 +2516,7 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
2512
2516
  visible: backgroundVisible,
2513
2517
  padding: backgroundPadding,
2514
2518
  style: {
2519
+ dy: textFontSize,
2515
2520
  cornerRadius: backgroundBorderRadius ?? 4,
2516
2521
  fill: backgroundColor,
2517
2522
  stroke: backgroundBorderColor,
@@ -2521,6 +2526,7 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
2521
2526
  },
2522
2527
  endSymbol: {
2523
2528
  visible: true,
2529
+ size: 10 + lineWidth,
2524
2530
  style: {
2525
2531
  dx: -4,
2526
2532
  fill: lineColor
@@ -2569,7 +2575,7 @@ const annotationArea_annotationArea = (spec, context)=>{
2569
2575
  right: 'insideRight'
2570
2576
  };
2571
2577
  const markArea = annotationAreaList.flatMap((annotationArea)=>{
2572
- const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#191d24', backgroundPadding = 10, backgroundVisible = true, outerPadding = 4, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor, areaBorderRadius, areaBorderWidth, offsetX = 0, offsetY = 0 } = annotationArea;
2578
+ const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundVisible = true, backgroundColor = '#191d24', backgroundBorderColor = '#191d24', backgroundBorderWidth = 1, backgroundBorderRadius = 4, backgroundPadding = 4, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor = '#888888', areaBorderRadius = 4, areaBorderWidth = 1, outerPadding = 4, offsetX = 0, offsetY = 0 } = annotationArea;
2573
2579
  const dataset = advancedVSeed.dataset.flat();
2574
2580
  const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
2575
2581
  return {
@@ -2639,6 +2645,7 @@ const annotationArea_annotationArea = (spec, context)=>{
2639
2645
  visible: true,
2640
2646
  text: text,
2641
2647
  style: {
2648
+ dy: textFontSize,
2642
2649
  textAlign: textAlign,
2643
2650
  textBaseline: textBaseline,
2644
2651
  fill: textColor,
@@ -2651,6 +2658,7 @@ const annotationArea_annotationArea = (spec, context)=>{
2651
2658
  visible: backgroundVisible,
2652
2659
  padding: backgroundPadding,
2653
2660
  style: {
2661
+ dy: textFontSize,
2654
2662
  cornerRadius: backgroundBorderRadius ?? 4,
2655
2663
  fill: backgroundColor,
2656
2664
  stroke: backgroundBorderColor,
@@ -2944,7 +2952,7 @@ const pivotDiscreteLegend = (spec, context)=>{
2944
2952
  }), {});
2945
2953
  const { legend, color } = baseConfig;
2946
2954
  const { colorScheme } = color;
2947
- const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400, maxSize, border, shapeType = 'rectRound' } = legend || {};
2955
+ const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
2948
2956
  const orient = [
2949
2957
  'bottom',
2950
2958
  'bottomLeft',
@@ -2988,8 +2996,8 @@ const pivotDiscreteLegend = (spec, context)=>{
2988
2996
  type: 'discrete',
2989
2997
  orient,
2990
2998
  position: legendPosition,
2991
- maxCol: maxSize,
2992
- maxRow: maxSize,
2999
+ maxCol: Math.max(1, maxSize),
3000
+ maxRow: Math.max(1, maxSize),
2993
3001
  data: colorItems.map((d, index)=>({
2994
3002
  label: d,
2995
3003
  shape: {
@@ -3003,7 +3011,7 @@ const pivotDiscreteLegend = (spec, context)=>{
3003
3011
  })),
3004
3012
  item: {
3005
3013
  focus: true,
3006
- maxWidth: 260,
3014
+ maxWidth: '30%',
3007
3015
  focusIconStyle: {
3008
3016
  size: labelFontSize + 2,
3009
3017
  fill: labelFontColor,
@@ -3406,7 +3414,7 @@ const annotationAreaBand = (spec, context)=>{
3406
3414
  right: 'insideRight'
3407
3415
  };
3408
3416
  const markArea = annotationAreaList.flatMap((annotationArea)=>{
3409
- const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#191d24', backgroundPadding = 4, backgroundVisible = true, outerPadding = 8, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor, areaBorderRadius, areaBorderWidth, offsetX, offsetY } = annotationArea;
3417
+ const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundVisible = true, backgroundColor = '#191d24', backgroundBorderColor = '#191d24', backgroundBorderWidth = 1, backgroundBorderRadius = 4, backgroundPadding = 4, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor = '#888888', areaBorderRadius = 4, areaBorderWidth = 1, outerPadding = 4, offsetX = 0, offsetY = 0 } = annotationArea;
3410
3418
  const dataset = advancedVSeed.dataset.flat();
3411
3419
  const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
3412
3420
  return {
@@ -3480,6 +3488,7 @@ const annotationAreaBand = (spec, context)=>{
3480
3488
  visible: true,
3481
3489
  text: text,
3482
3490
  style: {
3491
+ dy: textFontSize,
3483
3492
  textAlign: textAlign,
3484
3493
  textBaseline: textBaseline,
3485
3494
  stroke: backgroundColor,
@@ -3492,6 +3501,7 @@ const annotationAreaBand = (spec, context)=>{
3492
3501
  visible: backgroundVisible,
3493
3502
  padding: backgroundPadding,
3494
3503
  style: {
3504
+ dy: textFontSize,
3495
3505
  cornerRadius: backgroundBorderRadius ?? 4,
3496
3506
  fill: backgroundColor,
3497
3507
  stroke: backgroundBorderColor,
@@ -3753,7 +3763,7 @@ const encodingYX = (advancedVSeed)=>{
3753
3763
  };
3754
3764
  const { datasetReshapeInfo, dimensions } = advancedVSeed;
3755
3765
  if (!datasetReshapeInfo || !dimensions) return result;
3756
- const yDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
3766
+ const yDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location) || dimensions[0];
3757
3767
  const isZeroDimension = 0 === dimensions.length;
3758
3768
  const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
3759
3769
  const { foldInfo, unfoldInfo } = cur;
@@ -4673,8 +4683,8 @@ const encodingXYY = (advancedVSeed)=>{
4673
4683
  const result = {
4674
4684
  ...advancedVSeed
4675
4685
  };
4676
- const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
4677
- if (!datasetReshapeInfo || !dimensions || !measures) return result;
4686
+ const { datasetReshapeInfo, measures } = advancedVSeed;
4687
+ if (!datasetReshapeInfo || !measures) return result;
4678
4688
  const encoding = datasetReshapeInfo.reduce((prev, cur, index)=>{
4679
4689
  const measure = measures[index];
4680
4690
  if ('children' in measure) {
@@ -5409,8 +5419,8 @@ const encodingPie = (advancedVSeed)=>{
5409
5419
  const result = {
5410
5420
  ...advancedVSeed
5411
5421
  };
5412
- const { datasetReshapeInfo, dimensions } = advancedVSeed;
5413
- if (!datasetReshapeInfo || !dimensions) return result;
5422
+ const { datasetReshapeInfo } = advancedVSeed;
5423
+ if (!datasetReshapeInfo) return result;
5414
5424
  const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
5415
5425
  const { foldInfo, unfoldInfo } = cur;
5416
5426
  const radius = [
@@ -5629,7 +5639,7 @@ const encodingRose = (advancedVSeed)=>{
5629
5639
  };
5630
5640
  const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
5631
5641
  if (!datasetReshapeInfo || !dimensions || !measures) return result;
5632
- const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
5642
+ const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location) || dimensions[0];
5633
5643
  const is1D1M = 1 === dimensions.length && 1 === measures.length;
5634
5644
  const isZeroDimension = 0 === dimensions.length;
5635
5645
  const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
@@ -5943,7 +5953,7 @@ const encodingAR = (advancedVSeed)=>{
5943
5953
  };
5944
5954
  const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
5945
5955
  if (!datasetReshapeInfo || !dimensions || !measures) return result;
5946
- const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
5956
+ const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location) || dimensions[0];
5947
5957
  const isZeroDimension = 0 === dimensions.length;
5948
5958
  const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
5949
5959
  const { foldInfo, unfoldInfo } = cur;
@@ -6116,8 +6126,8 @@ const encodingFunnel = (advancedVSeed)=>{
6116
6126
  const result = {
6117
6127
  ...advancedVSeed
6118
6128
  };
6119
- const { datasetReshapeInfo, dimensions } = advancedVSeed;
6120
- if (!datasetReshapeInfo || !dimensions) return result;
6129
+ const { datasetReshapeInfo } = advancedVSeed;
6130
+ if (!datasetReshapeInfo) return result;
6121
6131
  const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
6122
6132
  const { foldInfo, unfoldInfo } = cur;
6123
6133
  const size = [
@@ -6329,7 +6339,7 @@ const encodingMatrix = (advancedVSeed)=>{
6329
6339
  };
6330
6340
  const { datasetReshapeInfo, dimensions } = advancedVSeed;
6331
6341
  if (!datasetReshapeInfo || !dimensions) return result;
6332
- const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
6342
+ const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location) || dimensions[0];
6333
6343
  const isZeroDimension = 0 === dimensions.length;
6334
6344
  const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
6335
6345
  const { foldInfo, unfoldInfo } = cur;
@@ -7826,20 +7836,20 @@ const zAnnotationVerticalLine = z.object({
7826
7836
  'middle',
7827
7837
  'bottom'
7828
7838
  ]).default('top').optional(),
7829
- lineVisible: z.boolean().optional(),
7830
- lineColor: z.string().optional(),
7831
- lineWidth: z.number().optional(),
7839
+ lineVisible: z.boolean().default(true).optional(),
7840
+ lineColor: z.string().default('#212121').optional(),
7841
+ lineWidth: z.number().default(1).optional(),
7832
7842
  lineStyle: z.union([
7833
7843
  z.literal('solid'),
7834
7844
  z.literal('dashed'),
7835
7845
  z.literal('dotted')
7836
- ]).optional(),
7846
+ ]).default('dashed').optional(),
7837
7847
  backgroundVisible: z.boolean().default(true).optional(),
7838
7848
  backgroundColor: z.string().default('#212121').optional(),
7839
- backgroundBorderColor: z.string().optional(),
7840
- backgroundBorderWidth: z.number().default(1).optional(),
7849
+ backgroundBorderColor: z.string().default('#212121').optional(),
7841
7850
  backgroundBorderRadius: z.number().default(4).optional(),
7842
- backgroundPadding: z.number().optional(),
7851
+ backgroundBorderWidth: z.number().default(1).optional(),
7852
+ backgroundPadding: z.number().default(2).optional(),
7843
7853
  offsetX: z.number().default(0),
7844
7854
  offsetY: z.number().default(0)
7845
7855
  });
@@ -7864,7 +7874,7 @@ const zAnnotationHorizontalLine = z.object({
7864
7874
  'insideStart',
7865
7875
  'insideMiddle',
7866
7876
  'insideEnd'
7867
- ]).default('insideMiddle').optional(),
7877
+ ]).default('insideEnd').optional(),
7868
7878
  textColor: z.string().default('#ffffff').optional(),
7869
7879
  textFontSize: z.number().default(12).optional(),
7870
7880
  textFontWeight: z.number().default(400).optional(),
@@ -7872,26 +7882,26 @@ const zAnnotationHorizontalLine = z.object({
7872
7882
  'left',
7873
7883
  'right',
7874
7884
  'center'
7875
- ]).default('center').optional(),
7885
+ ]).default('right').optional(),
7876
7886
  textBaseline: z["enum"]([
7877
7887
  'top',
7878
7888
  'middle',
7879
7889
  'bottom'
7880
- ]).default('bottom').optional(),
7881
- lineVisible: z.boolean().optional(),
7882
- lineColor: z.string().optional(),
7883
- lineWidth: z.number().optional(),
7890
+ ]).default('top').optional(),
7891
+ lineVisible: z.boolean().default(true).optional(),
7892
+ lineColor: z.string().default('#212121').optional(),
7893
+ lineWidth: z.number().default(1).optional(),
7884
7894
  lineStyle: z.union([
7885
7895
  z.literal('solid'),
7886
7896
  z.literal('dashed'),
7887
7897
  z.literal('dotted')
7888
- ]).optional(),
7898
+ ]).default('dashed').optional(),
7889
7899
  backgroundVisible: z.boolean().default(true).optional(),
7890
7900
  backgroundColor: z.string().default('#212121').optional(),
7891
- backgroundBorderColor: z.string().optional(),
7892
- backgroundBorderWidth: z.number().default(1).optional(),
7901
+ backgroundBorderColor: z.string().default('#212121').optional(),
7893
7902
  backgroundBorderRadius: z.number().default(4).optional(),
7894
- backgroundPadding: z.number().optional(),
7903
+ backgroundBorderWidth: z.number().default(1).optional(),
7904
+ backgroundPadding: z.number().default(2).optional(),
7895
7905
  offsetX: z.number().default(0),
7896
7906
  offsetY: z.number().default(0)
7897
7907
  });
@@ -7923,21 +7933,21 @@ const zAnnotationArea = z.object({
7923
7933
  'top',
7924
7934
  'middle',
7925
7935
  'bottom'
7926
- ]).default('middle').optional(),
7936
+ ]).default('top').optional(),
7927
7937
  backgroundVisible: z.boolean().default(true).optional(),
7928
- backgroundColor: z.string().default('#212121').optional(),
7929
- backgroundBorderColor: z.string().optional(),
7938
+ backgroundColor: z.string().default('#191d24').optional(),
7939
+ backgroundBorderColor: z.string().default('#191d24').optional(),
7930
7940
  backgroundBorderWidth: z.number().default(1).optional(),
7931
7941
  backgroundBorderRadius: z.number().default(4).optional(),
7932
- backgroundPadding: z.number().optional(),
7933
- areaColor: z.string().default('red').optional(),
7934
- areaColorOpacity: z.number().default(0.5).optional(),
7935
- areaBorderColor: z.number().optional(),
7936
- areaBorderWidth: z.number().default(2).optional(),
7942
+ backgroundPadding: z.number().default(4).optional(),
7943
+ areaColor: z.string().default('#888888').optional(),
7944
+ areaColorOpacity: z.number().default(0.15).optional(),
7945
+ areaBorderColor: z.string().default('#888888').optional(),
7946
+ areaBorderWidth: z.number().default(1).optional(),
7937
7947
  areaBorderRadius: z.number().default(4).optional(),
7938
- outerPadding: z.number().optional(),
7939
- offsetX: z.number().optional(),
7940
- offsetY: z.number().optional()
7948
+ outerPadding: z.number().default(4).optional(),
7949
+ offsetX: z.number().default(0).optional(),
7950
+ offsetY: z.number().default(0).optional()
7941
7951
  });
7942
7952
  const zAnnotation = z.object({
7943
7953
  annotationPoint: zAnnotationPoint.or(z.array(zAnnotationPoint)).optional(),