@easyv/charts 1.4.16 → 1.4.17

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 (46) hide show
  1. package/lib/components/AnimateData.js +16 -8
  2. package/lib/components/Axis.js +128 -82
  3. package/lib/components/Background.js +24 -16
  4. package/lib/components/Band.js +89 -62
  5. package/lib/components/BaseLine.js +41 -29
  6. package/lib/components/Brush.js +46 -29
  7. package/lib/components/Carousel.js +40 -13
  8. package/lib/components/CartesianChart.js +98 -78
  9. package/lib/components/Chart.js +36 -23
  10. package/lib/components/ChartContainer.js +27 -18
  11. package/lib/components/ConicalGradient.js +68 -35
  12. package/lib/components/ExtentData.js +17 -9
  13. package/lib/components/FilterData.js +27 -16
  14. package/lib/components/Indicator.js +8 -6
  15. package/lib/components/Label.js +112 -82
  16. package/lib/components/Legend.js +66 -41
  17. package/lib/components/Lighter.js +48 -19
  18. package/lib/components/Line.js +59 -39
  19. package/lib/components/LinearGradient.js +20 -14
  20. package/lib/components/Mapping.js +34 -9
  21. package/lib/components/Marquee.js +30 -14
  22. package/lib/components/PieChart.js +400 -306
  23. package/lib/components/StackData.js +18 -8
  24. package/lib/components/StereoBar.js +105 -65
  25. package/lib/components/TextOverflow.js +25 -9
  26. package/lib/components/Tooltip.js +55 -41
  27. package/lib/components/index.js +27 -0
  28. package/lib/context/index.js +2 -0
  29. package/lib/element/ConicGradient.js +35 -29
  30. package/lib/element/Line.js +13 -9
  31. package/lib/element/index.js +2 -0
  32. package/lib/formatter/index.js +2 -0
  33. package/lib/formatter/legend.js +41 -30
  34. package/lib/hooks/index.js +8 -0
  35. package/lib/hooks/useAnimateData.js +16 -3
  36. package/lib/hooks/useAxes.js +115 -65
  37. package/lib/hooks/useCarouselAxisX.js +56 -26
  38. package/lib/hooks/useExtentData.js +46 -14
  39. package/lib/hooks/useFilterData.js +29 -8
  40. package/lib/hooks/useStackData.js +30 -7
  41. package/lib/hooks/useTooltip.js +43 -26
  42. package/lib/index.js +15 -0
  43. package/lib/utils/index.js +247 -95
  44. package/package.json +1 -1
  45. package/src/components/CartesianChart.js +6 -6
  46. package/src/components/TextOverflow.tsx +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.4.16",
3
+ "version": "1.4.17",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -151,12 +151,6 @@ const Chart = memo(
151
151
  </svg>
152
152
  </foreignObject>
153
153
  )}
154
- {[...axes.values()].reverse().map((item, index) => {
155
- const config = item.axisType == 'x' ? axisX : item;
156
- return (
157
- <Axis triggerClick={onInteraction} xLineRange={xLineRange} yLineRange={yLineRange} {...config} key={index} />
158
- );
159
- })}
160
154
  {showTooltip && <Indicator {...indicator} {...indicatorAttr} />}
161
155
  <foreignObject style={isVertical?{
162
156
  width:xLineRange+marginRight+marginLeft,
@@ -203,6 +197,12 @@ const Chart = memo(
203
197
  })}
204
198
  </svg>
205
199
  </foreignObject>
200
+ {[...axes.values()].reverse().map((item, index) => {
201
+ const config = item.axisType == 'x' ? axisX : item;
202
+ return (
203
+ <Axis triggerClick={onInteraction} xLineRange={xLineRange} yLineRange={yLineRange} {...config} key={index} />
204
+ );
205
+ })}
206
206
  {baseLineData &&
207
207
  baseLineData.length > 0 &&
208
208
  baseLineData.map((item, index) => {
@@ -47,6 +47,9 @@ export default memo(forwardRef((props:flowText, ref:any) => {
47
47
  ...getTextOverflow(type),
48
48
  ...style
49
49
  }
50
+ const textDom = document.createElement("div");
51
+ textDom.innerHTML = value;
52
+ const text = textDom.innerText;
50
53
  return type == 'marquee' ? (
51
54
  <Marquee
52
55
  value={value}
@@ -54,6 +57,6 @@ export default memo(forwardRef((props:flowText, ref:any) => {
54
57
  style={styles}
55
58
  ref={ref} />
56
59
  ) : (
57
- <div style={styles} ref={ref} title={type=="ellipsis"?value.replace(/<\/?.+?>/g,"") || undefined:undefined} dangerouslySetInnerHTML={{__html:value}}></div>
60
+ <div style={styles} ref={ref} title={type=="ellipsis"?text || undefined:undefined} dangerouslySetInnerHTML={{__html:value}}></div>
58
61
  );
59
62
  }));