@visactor/vseed 0.0.32 → 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/umd/index.js CHANGED
@@ -489,7 +489,7 @@
489
489
  const { measures, dataset } = vseed;
490
490
  if (!dataset) throw new Error('dataset is required');
491
491
  if (0 === dataset.length) return result;
492
- if (measures && measures.length > 0) {
492
+ if (measures) {
493
493
  result.measures = measures;
494
494
  return result;
495
495
  }
@@ -569,7 +569,7 @@
569
569
  const measures = findAllMeasures(advancedVSeed.measures);
570
570
  if (!dataset) throw new Error('dataset is required');
571
571
  if (0 === dataset.length) return result;
572
- if (dimensions && dimensions.length > 0) {
572
+ if (dimensions) {
573
573
  result.dimensions = dimensions;
574
574
  return result;
575
575
  }
@@ -924,7 +924,7 @@
924
924
  const measures = findAllMeasures(vseed.measures);
925
925
  if (!dataset) throw new Error('dataset is required');
926
926
  if (0 === dataset.length) return result;
927
- if (measures && measures.length > 0) {
927
+ if (measures) {
928
928
  result.measures = findAllMeasures(measures);
929
929
  return result;
930
930
  }
@@ -987,7 +987,7 @@
987
987
  const measures = findAllMeasures(advancedVSeed.measures);
988
988
  if (!dataset) throw new Error('dataset is required');
989
989
  if (0 === dataset.length) return result;
990
- if (dimensions && dimensions.length > 0) {
990
+ if (dimensions) {
991
991
  const newDimensions = findAllDimensions(dimensions);
992
992
  result.dimensions = newDimensions.map((item, index)=>{
993
993
  if ('rowDimension' === item.location || 'columnDimension' === item.location) return item;
@@ -2735,7 +2735,7 @@
2735
2735
  annotationPoint
2736
2736
  ];
2737
2737
  const markPoint = annotationPointList.flatMap((annotationPoint)=>{
2738
- const { selector: selectorPoint, text = '', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'middle', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true, offsetX = 0, offsetY = 0 } = annotationPoint;
2738
+ 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;
2739
2739
  const dataset = advancedVSeed.dataset.flat();
2740
2740
  const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
2741
2741
  return selectedData.map((datum)=>({
@@ -2767,7 +2767,8 @@
2767
2767
  stroke: backgroundColor,
2768
2768
  lineWidth: 1,
2769
2769
  fontSize: textFontSize,
2770
- fontWeight: textFontWeight
2770
+ fontWeight: textFontWeight,
2771
+ dy: textFontSize
2771
2772
  },
2772
2773
  labelBackground: {
2773
2774
  visible: backgroundVisible,
@@ -2776,7 +2777,8 @@
2776
2777
  cornerRadius: backgroundBorderRadius ?? 4,
2777
2778
  fill: backgroundColor,
2778
2779
  stroke: backgroundBorderColor,
2779
- lineWidth: backgroundBorderWidth
2780
+ lineWidth: backgroundBorderWidth,
2781
+ dy: textFontSize
2780
2782
  }
2781
2783
  }
2782
2784
  }
@@ -2811,7 +2813,7 @@
2811
2813
  insideEnd: 'insideEndTop'
2812
2814
  };
2813
2815
  const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
2814
- const { selector: selectorPoint, xValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', 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;
2816
+ 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;
2815
2817
  const dataset = advancedVSeed.dataset.flat();
2816
2818
  const generateOneMarkLine = (x)=>({
2817
2819
  x: x,
@@ -2910,7 +2912,7 @@
2910
2912
  insideEnd: 'insideEndTop'
2911
2913
  };
2912
2914
  const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
2913
- const { selector: selectorPoint, yValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', 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;
2915
+ 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;
2914
2916
  const dataset = advancedVSeed.dataset.flat();
2915
2917
  const generateOneMarkLine = (y)=>({
2916
2918
  y,
@@ -3011,7 +3013,7 @@
3011
3013
  right: 'insideRight'
3012
3014
  };
3013
3015
  const markArea = annotationAreaList.flatMap((annotationArea)=>{
3014
- 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;
3016
+ 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;
3015
3017
  const dataset = advancedVSeed.dataset.flat();
3016
3018
  const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
3017
3019
  return {
@@ -3081,6 +3083,7 @@
3081
3083
  visible: true,
3082
3084
  text: text,
3083
3085
  style: {
3086
+ dy: textFontSize,
3084
3087
  textAlign: textAlign,
3085
3088
  textBaseline: textBaseline,
3086
3089
  fill: textColor,
@@ -3093,6 +3096,7 @@
3093
3096
  visible: backgroundVisible,
3094
3097
  padding: backgroundPadding,
3095
3098
  style: {
3099
+ dy: textFontSize,
3096
3100
  cornerRadius: backgroundBorderRadius ?? 4,
3097
3101
  fill: backgroundColor,
3098
3102
  stroke: backgroundBorderColor,
@@ -3848,7 +3852,7 @@
3848
3852
  right: 'insideRight'
3849
3853
  };
3850
3854
  const markArea = annotationAreaList.flatMap((annotationArea)=>{
3851
- 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;
3855
+ 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;
3852
3856
  const dataset = advancedVSeed.dataset.flat();
3853
3857
  const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
3854
3858
  return {
@@ -3922,6 +3926,7 @@
3922
3926
  visible: true,
3923
3927
  text: text,
3924
3928
  style: {
3929
+ dy: textFontSize,
3925
3930
  textAlign: textAlign,
3926
3931
  textBaseline: textBaseline,
3927
3932
  stroke: backgroundColor,
@@ -3934,6 +3939,7 @@
3934
3939
  visible: backgroundVisible,
3935
3940
  padding: backgroundPadding,
3936
3941
  style: {
3942
+ dy: textFontSize,
3937
3943
  cornerRadius: backgroundBorderRadius ?? 4,
3938
3944
  fill: backgroundColor,
3939
3945
  stroke: backgroundBorderColor,
@@ -11551,20 +11557,20 @@
11551
11557
  'middle',
11552
11558
  'bottom'
11553
11559
  ]).default('top').optional(),
11554
- lineVisible: schemas_boolean().optional(),
11555
- lineColor: schemas_string().optional(),
11556
- lineWidth: schemas_number().optional(),
11560
+ lineVisible: schemas_boolean().default(true).optional(),
11561
+ lineColor: schemas_string().default('#212121').optional(),
11562
+ lineWidth: schemas_number().default(1).optional(),
11557
11563
  lineStyle: union([
11558
11564
  literal('solid'),
11559
11565
  literal('dashed'),
11560
11566
  literal('dotted')
11561
- ]).optional(),
11567
+ ]).default('dashed').optional(),
11562
11568
  backgroundVisible: schemas_boolean().default(true).optional(),
11563
11569
  backgroundColor: schemas_string().default('#212121').optional(),
11564
- backgroundBorderColor: schemas_string().optional(),
11565
- backgroundBorderWidth: schemas_number().default(1).optional(),
11570
+ backgroundBorderColor: schemas_string().default('#212121').optional(),
11566
11571
  backgroundBorderRadius: schemas_number().default(4).optional(),
11567
- backgroundPadding: schemas_number().optional(),
11572
+ backgroundBorderWidth: schemas_number().default(1).optional(),
11573
+ backgroundPadding: schemas_number().default(2).optional(),
11568
11574
  offsetX: schemas_number().default(0),
11569
11575
  offsetY: schemas_number().default(0)
11570
11576
  });
@@ -11589,7 +11595,7 @@
11589
11595
  'insideStart',
11590
11596
  'insideMiddle',
11591
11597
  'insideEnd'
11592
- ]).default('insideMiddle').optional(),
11598
+ ]).default('insideEnd').optional(),
11593
11599
  textColor: schemas_string().default('#ffffff').optional(),
11594
11600
  textFontSize: schemas_number().default(12).optional(),
11595
11601
  textFontWeight: schemas_number().default(400).optional(),
@@ -11597,26 +11603,26 @@
11597
11603
  'left',
11598
11604
  'right',
11599
11605
  'center'
11600
- ]).default('center').optional(),
11606
+ ]).default('right').optional(),
11601
11607
  textBaseline: schemas_enum([
11602
11608
  'top',
11603
11609
  'middle',
11604
11610
  'bottom'
11605
- ]).default('bottom').optional(),
11606
- lineVisible: schemas_boolean().optional(),
11607
- lineColor: schemas_string().optional(),
11608
- lineWidth: schemas_number().optional(),
11611
+ ]).default('top').optional(),
11612
+ lineVisible: schemas_boolean().default(true).optional(),
11613
+ lineColor: schemas_string().default('#212121').optional(),
11614
+ lineWidth: schemas_number().default(1).optional(),
11609
11615
  lineStyle: union([
11610
11616
  literal('solid'),
11611
11617
  literal('dashed'),
11612
11618
  literal('dotted')
11613
- ]).optional(),
11619
+ ]).default('dashed').optional(),
11614
11620
  backgroundVisible: schemas_boolean().default(true).optional(),
11615
11621
  backgroundColor: schemas_string().default('#212121').optional(),
11616
- backgroundBorderColor: schemas_string().optional(),
11617
- backgroundBorderWidth: schemas_number().default(1).optional(),
11622
+ backgroundBorderColor: schemas_string().default('#212121').optional(),
11618
11623
  backgroundBorderRadius: schemas_number().default(4).optional(),
11619
- backgroundPadding: schemas_number().optional(),
11624
+ backgroundBorderWidth: schemas_number().default(1).optional(),
11625
+ backgroundPadding: schemas_number().default(2).optional(),
11620
11626
  offsetX: schemas_number().default(0),
11621
11627
  offsetY: schemas_number().default(0)
11622
11628
  });
@@ -11648,21 +11654,21 @@
11648
11654
  'top',
11649
11655
  'middle',
11650
11656
  'bottom'
11651
- ]).default('middle').optional(),
11657
+ ]).default('top').optional(),
11652
11658
  backgroundVisible: schemas_boolean().default(true).optional(),
11653
- backgroundColor: schemas_string().default('#212121').optional(),
11654
- backgroundBorderColor: schemas_string().optional(),
11659
+ backgroundColor: schemas_string().default('#191d24').optional(),
11660
+ backgroundBorderColor: schemas_string().default('#191d24').optional(),
11655
11661
  backgroundBorderWidth: schemas_number().default(1).optional(),
11656
11662
  backgroundBorderRadius: schemas_number().default(4).optional(),
11657
- backgroundPadding: schemas_number().optional(),
11658
- areaColor: schemas_string().default('red').optional(),
11659
- areaColorOpacity: schemas_number().default(0.5).optional(),
11660
- areaBorderColor: schemas_number().optional(),
11661
- areaBorderWidth: schemas_number().default(2).optional(),
11663
+ backgroundPadding: schemas_number().default(4).optional(),
11664
+ areaColor: schemas_string().default('#888888').optional(),
11665
+ areaColorOpacity: schemas_number().default(0.15).optional(),
11666
+ areaBorderColor: schemas_string().default('#888888').optional(),
11667
+ areaBorderWidth: schemas_number().default(1).optional(),
11662
11668
  areaBorderRadius: schemas_number().default(4).optional(),
11663
- outerPadding: schemas_number().optional(),
11664
- offsetX: schemas_number().optional(),
11665
- offsetY: schemas_number().optional()
11669
+ outerPadding: schemas_number().default(4).optional(),
11670
+ offsetX: schemas_number().default(0).optional(),
11671
+ offsetY: schemas_number().default(0).optional()
11666
11672
  });
11667
11673
  const zAnnotation = schemas_object({
11668
11674
  annotationPoint: zAnnotationPoint.or(schemas_array(zAnnotationPoint)).optional(),