@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.
- package/lib/components/AnimateData.js +13 -22
- package/lib/components/Axis.js +106 -153
- package/lib/components/Background.js +18 -27
- package/lib/components/Band.js +78 -104
- package/lib/components/BaseLine.js +38 -52
- package/lib/components/Brush.js +31 -49
- package/lib/components/Carousel.js +20 -48
- package/lib/components/CartesianChart.js +136 -195
- package/lib/components/Chart.js +37 -59
- package/lib/components/ChartContainer.js +23 -33
- package/lib/components/ConicalGradient.js +38 -72
- package/lib/components/Control.js +61 -101
- package/lib/components/ExtentData.js +13 -22
- package/lib/components/FilterData.js +20 -32
- package/lib/components/Indicator.js +18 -26
- package/lib/components/Label.js +90 -121
- package/lib/components/Legend.js +48 -74
- package/lib/components/Lighter.js +22 -52
- package/lib/components/Line.js +41 -62
- package/lib/components/LinearGradient.js +16 -23
- package/lib/components/Mapping.js +15 -41
- package/lib/components/Marquee.js +23 -40
- package/lib/components/PieChart.js +352 -456
- package/lib/components/StackData.js +12 -23
- package/lib/components/StereoBar.js +69 -110
- package/lib/components/TextOverflow.js +17 -31
- package/lib/components/Tooltip.js +50 -65
- package/lib/components/index.js +1 -31
- package/lib/components/pieTooltip.js +46 -74
- package/lib/context/index.js +1 -4
- package/lib/css/index.module.css +1 -1
- package/lib/element/ConicGradient.js +31 -37
- package/lib/element/Line.js +11 -16
- package/lib/element/index.js +0 -2
- package/lib/formatter/index.js +0 -2
- package/lib/formatter/legend.js +48 -48
- package/lib/hooks/index.js +0 -9
- package/lib/hooks/useAiData.js +16 -27
- package/lib/hooks/useAnimateData.js +7 -21
- package/lib/hooks/useAxes.js +89 -151
- package/lib/hooks/useCarouselAxisX.js +30 -64
- package/lib/hooks/useExtentData.js +24 -65
- package/lib/hooks/useFilterData.js +16 -42
- package/lib/hooks/useStackData.js +11 -35
- package/lib/hooks/useTooltip.js +29 -47
- package/lib/index.js +2 -17
- package/lib/utils/index.js +144 -328
- package/package.json +1 -1
- package/src/css/index.module.css +1 -1
- package/src/formatter/legend.js +13 -1
- package/src/utils/index.js +13 -10
package/package.json
CHANGED
package/src/css/index.module.css
CHANGED
package/src/formatter/legend.js
CHANGED
|
@@ -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:
|
|
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
|
>
|
package/src/utils/index.js
CHANGED
|
@@ -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
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
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
|
|