@easyv/charts 1.9.4 → 1.9.5
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/Chart.js +1 -0
- package/lib/formatter/legend.js +0 -1
- package/lib/utils/index.js +0 -6
- package/package.json +1 -1
- package/src/components/Chart.js +2 -0
- package/src/formatter/legend.js +0 -1
- package/src/utils/index.js +2 -10
package/lib/components/Chart.js
CHANGED
|
@@ -53,6 +53,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
|
|
|
53
53
|
emit = _ref2.emit,
|
|
54
54
|
emitEvent = _ref2.emitEvent,
|
|
55
55
|
props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
|
|
56
|
+
console.log("888");
|
|
56
57
|
var width = props.width,
|
|
57
58
|
height = props.height;
|
|
58
59
|
var isIOS = (0, _react.useRef)(/iPad|iPhone|iPod|iOS/i.test(navigator.userAgent) || /Mac OS X/i.test(navigator.userAgent) && !/Chrome/i.test(navigator.userAgent));
|
package/lib/formatter/legend.js
CHANGED
|
@@ -97,7 +97,6 @@ var pieLegendFormatter = exports.pieLegendFormatter = function pieLegendFormatte
|
|
|
97
97
|
alignItems: 'center',
|
|
98
98
|
justifyContent: valueAlign == "left" ? "flex-start" : valueAlign == "right" ? "flex-end" : 'center',
|
|
99
99
|
textAlign: valueAlign === "left" ? "left" : valueAlign === "right" ? "right" : "center"
|
|
100
|
-
//------------
|
|
101
100
|
})
|
|
102
101
|
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(_components.SplitText, {
|
|
103
102
|
value: data.y,
|
package/lib/utils/index.js
CHANGED
|
@@ -103,8 +103,6 @@ var renderCanvasBackground = exports.renderCanvasBackground = function renderCan
|
|
|
103
103
|
// 5. 转换为 DataURL(替代 SVG DataURL)
|
|
104
104
|
return canvas.toDataURL('image/png');
|
|
105
105
|
};
|
|
106
|
-
|
|
107
|
-
// 原 SvgBackground 组件保留(兼容旧逻辑,也可删除)
|
|
108
106
|
var SvgBackground = exports.SvgBackground = function SvgBackground(_ref3) {
|
|
109
107
|
var _ref3$fill = _ref3.fill,
|
|
110
108
|
type = _ref3$fill.type,
|
|
@@ -152,8 +150,6 @@ var SvgBackground = exports.SvgBackground = function SvgBackground(_ref3) {
|
|
|
152
150
|
strokeWidth: boderWidth
|
|
153
151
|
}));
|
|
154
152
|
};
|
|
155
|
-
|
|
156
|
-
// ===================== 原有方法(仅改造 getBandBackground) =====================
|
|
157
153
|
var getColorList = exports.getColorList = function getColorList(_ref5) {
|
|
158
154
|
var type = _ref5.type,
|
|
159
155
|
pure = _ref5.pure,
|
|
@@ -639,8 +635,6 @@ var reverseGradientStops = function reverseGradientStops(gradient) {
|
|
|
639
635
|
})
|
|
640
636
|
});
|
|
641
637
|
};
|
|
642
|
-
|
|
643
|
-
// ===================== 核心改动:改造 getBandBackground 方法 =====================
|
|
644
638
|
var getBandBackground = exports.getBandBackground = function getBandBackground(pattern, fill, y) {
|
|
645
639
|
if (!(pattern && pattern.path)) {
|
|
646
640
|
return (0, _utils.getColor)(y < 0 ? reverseGradientStops(fill) : fill); //小于0颜色翻转
|
package/package.json
CHANGED
package/src/components/Chart.js
CHANGED
package/src/formatter/legend.js
CHANGED
|
@@ -84,7 +84,6 @@ export const pieLegendFormatter = (
|
|
|
84
84
|
alignItems: 'center',
|
|
85
85
|
justifyContent: valueAlign=="left"?"flex-start":valueAlign=="right"?"flex-end":'center',
|
|
86
86
|
textAlign: valueAlign === "left" ? "left" : valueAlign === "right" ? "right" : "center",
|
|
87
|
-
//------------
|
|
88
87
|
}}
|
|
89
88
|
>
|
|
90
89
|
<span><SplitText value={data.y} config={splitConfig} /></span>
|
package/src/utils/index.js
CHANGED
|
@@ -86,8 +86,6 @@ const renderCanvasBackground = ({
|
|
|
86
86
|
// 5. 转换为 DataURL(替代 SVG DataURL)
|
|
87
87
|
return canvas.toDataURL('image/png');
|
|
88
88
|
};
|
|
89
|
-
|
|
90
|
-
// 原 SvgBackground 组件保留(兼容旧逻辑,也可删除)
|
|
91
89
|
const SvgBackground = ({
|
|
92
90
|
fill: {
|
|
93
91
|
type,
|
|
@@ -137,8 +135,6 @@ const SvgBackground = ({
|
|
|
137
135
|
</svg>
|
|
138
136
|
);
|
|
139
137
|
};
|
|
140
|
-
|
|
141
|
-
// ===================== 原有方法(仅改造 getBandBackground) =====================
|
|
142
138
|
const getColorList = ({ type, pure, linear: { stops, angle, opacity } }) => {
|
|
143
139
|
if (type == 'pure') {
|
|
144
140
|
return [
|
|
@@ -148,7 +144,6 @@ const getColorList = ({ type, pure, linear: { stops, angle, opacity } }) => {
|
|
|
148
144
|
}
|
|
149
145
|
return stops.map(({ color, offset }) => ({ color, offset: offset / 100 }));
|
|
150
146
|
};
|
|
151
|
-
|
|
152
147
|
const getMultiColorStr = (colors) => {
|
|
153
148
|
if (colors) {
|
|
154
149
|
const { stops, angle } = colors;
|
|
@@ -299,7 +294,6 @@ const getTickCoord = ({
|
|
|
299
294
|
}
|
|
300
295
|
return { x1, x2, y1, y2 };
|
|
301
296
|
};
|
|
302
|
-
|
|
303
297
|
const getGridCoord = ({ orientation, coordinate, end }) => {
|
|
304
298
|
let x1, x2, y1, y2;
|
|
305
299
|
switch (orientation) {
|
|
@@ -617,8 +611,6 @@ const reverseGradientStops = (gradient) => {
|
|
|
617
611
|
}
|
|
618
612
|
};
|
|
619
613
|
};
|
|
620
|
-
|
|
621
|
-
// ===================== 核心改动:改造 getBandBackground 方法 =====================
|
|
622
614
|
const getBandBackground = (pattern, fill, y) => {
|
|
623
615
|
if (!(pattern && pattern.path)) {
|
|
624
616
|
return getColor(y < 0 ? reverseGradientStops(fill) : fill);//小于0颜色翻转
|
|
@@ -895,6 +887,6 @@ export {
|
|
|
895
887
|
reduceConfig,
|
|
896
888
|
getSeriesInfo,
|
|
897
889
|
mathR,
|
|
898
|
-
renderCanvasBackground, // 导出 Canvas
|
|
899
|
-
SvgBackground
|
|
890
|
+
renderCanvasBackground, // 导出 Canvas 绘制方法
|
|
891
|
+
SvgBackground
|
|
900
892
|
};
|