@easyv/charts 1.6.9 → 1.6.11

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 (51) hide show
  1. package/lib/components/AnimateData.js +13 -22
  2. package/lib/components/Axis.js +106 -153
  3. package/lib/components/Background.js +18 -27
  4. package/lib/components/Band.js +78 -104
  5. package/lib/components/BaseLine.js +38 -52
  6. package/lib/components/Brush.js +31 -49
  7. package/lib/components/Carousel.js +20 -48
  8. package/lib/components/CartesianChart.js +136 -195
  9. package/lib/components/Chart.js +37 -59
  10. package/lib/components/ChartContainer.js +23 -33
  11. package/lib/components/ConicalGradient.js +38 -72
  12. package/lib/components/Control.js +61 -101
  13. package/lib/components/ExtentData.js +13 -22
  14. package/lib/components/FilterData.js +20 -32
  15. package/lib/components/Indicator.js +18 -26
  16. package/lib/components/Label.js +90 -121
  17. package/lib/components/Legend.js +48 -74
  18. package/lib/components/Lighter.js +22 -52
  19. package/lib/components/Line.js +41 -62
  20. package/lib/components/LinearGradient.js +16 -23
  21. package/lib/components/Mapping.js +15 -41
  22. package/lib/components/Marquee.js +23 -40
  23. package/lib/components/PieChart.js +352 -456
  24. package/lib/components/StackData.js +12 -23
  25. package/lib/components/StereoBar.js +69 -110
  26. package/lib/components/TextOverflow.js +17 -31
  27. package/lib/components/Tooltip.js +50 -65
  28. package/lib/components/index.js +1 -31
  29. package/lib/components/pieTooltip.js +46 -74
  30. package/lib/context/index.js +1 -4
  31. package/lib/css/index.module.css +1 -1
  32. package/lib/element/ConicGradient.js +31 -37
  33. package/lib/element/Line.js +11 -16
  34. package/lib/element/index.js +0 -2
  35. package/lib/formatter/index.js +0 -2
  36. package/lib/formatter/legend.js +48 -48
  37. package/lib/hooks/index.js +0 -9
  38. package/lib/hooks/useAiData.js +16 -27
  39. package/lib/hooks/useAnimateData.js +7 -21
  40. package/lib/hooks/useAxes.js +89 -151
  41. package/lib/hooks/useCarouselAxisX.js +30 -64
  42. package/lib/hooks/useExtentData.js +24 -65
  43. package/lib/hooks/useFilterData.js +16 -42
  44. package/lib/hooks/useStackData.js +11 -35
  45. package/lib/hooks/useTooltip.js +29 -47
  46. package/lib/index.js +2 -17
  47. package/lib/utils/index.js +144 -328
  48. package/package.json +1 -1
  49. package/src/css/index.module.css +1 -1
  50. package/src/formatter/legend.js +13 -1
  51. package/src/utils/index.js +13 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.6.9",
3
+ "version": "1.6.11",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -35,7 +35,7 @@
35
35
 
36
36
  .notShowAllStyle {
37
37
  display: flex;
38
- /* width: 100%; */
38
+ width: 100%;
39
39
  /* flex:1; */
40
40
  align-items: center;
41
41
  flex-direction: row;
@@ -11,6 +11,7 @@ export const pieLegendFormatter = (
11
11
  font: valueFont,
12
12
  sameColor: valueSameColor,
13
13
  gap: valueGap,
14
+ align: valueAlign,
14
15
  suffix: {
15
16
  show: showSuffix,
16
17
  text,
@@ -23,6 +24,7 @@ export const pieLegendFormatter = (
23
24
  font: percentFont,
24
25
  sameColor: percentSameColor,
25
26
  gap: percentGap,
27
+ align: percentAlign
26
28
  },
27
29
  }
28
30
  ) => {
@@ -42,6 +44,9 @@ export const pieLegendFormatter = (
42
44
  ? css.showAllStyle
43
45
  : css.notShowAllStyle
44
46
  }
47
+ style={{
48
+ width:`calc( 100% + ${valueGap+percentGap}px )`
49
+ }}
45
50
  >
46
51
  {showName && (
47
52
  <TextOverflow value={displayName} type={textOverflow} speed={speed} style={{
@@ -54,10 +59,12 @@ export const pieLegendFormatter = (
54
59
  whiteSpace:"nowrap",
55
60
  ...getFontStyle(valueFont),
56
61
  marginLeft: valueGap,
62
+ // transform:`translateX(${valueGap}px)`,
57
63
  display: 'flex',
64
+ flex:1,
58
65
  color: valueSameColor ? _color : valueFont.color,
59
66
  alignItems: 'center',
60
- justifyContent: 'flex-start',
67
+ justifyContent: valueAlign=="left"?"flex-start":valueAlign=="right"?"flex-end":'center',
61
68
  }}
62
69
  >
63
70
  <span>{data.y}</span>
@@ -80,6 +87,11 @@ export const pieLegendFormatter = (
80
87
  whiteSpace:"nowrap",
81
88
  ...getFontStyle(percentFont),
82
89
  marginLeft: percentGap,
90
+ // transform:`translateX(${percentGap}px)`,
91
+ display:"flex",
92
+ flex:1,
93
+ alignItems: 'center',
94
+ justifyContent: percentAlign=="left"?"flex-start":percentAlign=="right"?"flex-end":'center',
83
95
  color: percentSameColor ? _color : percentFont.color,
84
96
  }}
85
97
  >
@@ -486,16 +486,19 @@ const getCurrentStack = (stack, stackMap) =>
486
486
 
487
487
  const getBandBackground = (pattern, fill) => {
488
488
  if (!(pattern && pattern.path)) return getColor(fill);
489
- const { backgroundSize = '100% 100%', ..._pattern } = pattern;
490
- return (
491
- 'center top / ' +
492
- backgroundSize +
493
- ' url("data:image/svg+xml,' +
494
- encodeURIComponent(
495
- renderToStaticMarkup(<SvgBackground fill={fill} pattern={_pattern} />)
496
- ) +
497
- '")'
498
- );
489
+ try{
490
+ const { backgroundSize = '100% 100%', ..._pattern } = pattern;
491
+ return (
492
+ 'center top / ' +
493
+ backgroundSize +
494
+ ' url("data:image/svg+xml,' +
495
+ encodeURIComponent(
496
+ renderToStaticMarkup(<SvgBackground fill={fill} pattern={_pattern} />)
497
+ ) +
498
+ '")'
499
+ );
500
+ }catch(e){}
501
+ return "";
499
502
  };
500
503
  const getBandwidth = (step, paddingOuter) => step * (1 - paddingOuter);
501
504