@easyv/charts 1.7.34 → 1.7.36
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/Band.js
CHANGED
|
@@ -197,7 +197,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
197
197
|
borderWidth = _ref6$borderWidth === void 0 ? 0 : _ref6$borderWidth;
|
|
198
198
|
var borderStr = "".concat(pure, " solid ").concat(borderWidth, "px");
|
|
199
199
|
var borderImageSource = (0, _utils.getMultiColorStr)(linear);
|
|
200
|
-
var positionX = xScaler(x) - step / 2 + seriesStart + index * seriesStep;
|
|
200
|
+
var positionX = _data.length == 1 ? xScaler(x) - seriesStart / 2 : xScaler(x) - step / 2 + seriesStart + index * seriesStep;
|
|
201
201
|
var showHead, headType, headUrl, headVideo, headWidth, headHeight, headTranslate;
|
|
202
202
|
if (headDecorate) {
|
|
203
203
|
showHead = headDecorate.show, headType = headDecorate.type, headUrl = headDecorate.url, headVideo = headDecorate.video, headWidth = headDecorate.size.width, headHeight = headDecorate.size.height, headTranslate = headDecorate.translate;
|
package/lib/components/Chart.js
CHANGED
|
@@ -55,7 +55,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
|
|
|
55
55
|
props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
|
|
56
56
|
var width = props.width,
|
|
57
57
|
height = props.height;
|
|
58
|
-
var isIOS = (0, _react.useRef)(/iPad|iPhone|iPod|iOS
|
|
58
|
+
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));
|
|
59
59
|
var svg = /*#__PURE__*/(0, _react.createRef)();
|
|
60
60
|
var chartWidth = width - marginLeft - marginRight;
|
|
61
61
|
var chartHeight = height - marginTop - marginBottom;
|
|
@@ -25,6 +25,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(/*#__PURE__*/(
|
|
|
25
25
|
setControlWidth = _props$actions.setControlWidth,
|
|
26
26
|
_props$props = props.props,
|
|
27
27
|
_props$props$control = _props$props.control,
|
|
28
|
+
thumbnail = _props$props$control.thumbnail,
|
|
28
29
|
height = _props$props$control.height,
|
|
29
30
|
color = _props$props$control.color,
|
|
30
31
|
gap = _props$props$control.gap,
|
|
@@ -237,7 +238,10 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(/*#__PURE__*/(
|
|
|
237
238
|
}
|
|
238
239
|
}, /*#__PURE__*/_react["default"].createElement("svg", {
|
|
239
240
|
width: "100%",
|
|
240
|
-
height: "100%"
|
|
241
|
+
height: "100%",
|
|
242
|
+
style: {
|
|
243
|
+
display: thumbnail ? "block" : "none"
|
|
244
|
+
}
|
|
241
245
|
}, series.map(function (_ref, index) {
|
|
242
246
|
var Component = _ref.Component,
|
|
243
247
|
yOrZ = _ref.yOrZ,
|
package/package.json
CHANGED
package/src/components/Band.tsx
CHANGED
|
@@ -164,8 +164,8 @@ export default memo(
|
|
|
164
164
|
}, borderWidth=0 } = border || {};
|
|
165
165
|
const borderStr = `${pure} solid ${borderWidth}px`;
|
|
166
166
|
const borderImageSource = getMultiColorStr(linear);
|
|
167
|
-
const positionX = xScaler(x) - step / 2 + seriesStart + index * seriesStep;
|
|
168
|
-
|
|
167
|
+
const positionX =_data.length==1? xScaler(x) -seriesStart/2 :xScaler(x) - step / 2 + seriesStart + index * seriesStep;
|
|
168
|
+
|
|
169
169
|
let showHead, headType, headUrl, headVideo, headWidth, headHeight, headTranslate;
|
|
170
170
|
if (headDecorate) {
|
|
171
171
|
(showHead = headDecorate.show),
|
package/src/components/Chart.js
CHANGED
|
@@ -37,7 +37,11 @@ const Chart = memo(
|
|
|
37
37
|
...props
|
|
38
38
|
}) => {
|
|
39
39
|
const { width, height } = props;
|
|
40
|
-
const isIOS = useRef(
|
|
40
|
+
const isIOS = useRef(
|
|
41
|
+
/iPad|iPhone|iPod|iOS/i.test(navigator.userAgent) ||
|
|
42
|
+
(/Mac OS X/i.test(navigator.userAgent) &&
|
|
43
|
+
!/Chrome/i.test(navigator.userAgent))
|
|
44
|
+
);
|
|
41
45
|
const svg = createRef();
|
|
42
46
|
const chartWidth = width - marginLeft - marginRight;
|
|
43
47
|
const chartHeight = height - marginTop - marginBottom;
|
|
@@ -7,7 +7,7 @@ export default memo(forwardRef((props, ref) => {
|
|
|
7
7
|
const {
|
|
8
8
|
actions:{ setX, setWorking, setControlWidth },
|
|
9
9
|
props: {
|
|
10
|
-
control:{ height, color, gap, drag:{ color:dragColor }, margin:{ left } },
|
|
10
|
+
control:{thumbnail, height, color, gap, drag:{ color:dragColor }, margin:{ left } },
|
|
11
11
|
controlInfo:{ cWidth, cBarWidth },
|
|
12
12
|
axes, series, top, bandLength
|
|
13
13
|
}
|
|
@@ -16,7 +16,7 @@ export default memo(forwardRef((props, ref) => {
|
|
|
16
16
|
const scale = context.scale;
|
|
17
17
|
const xAxis = axes.get("x");
|
|
18
18
|
const barRef = useRef();
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
const barStyle={
|
|
21
21
|
position:"absolute",
|
|
22
22
|
top:0,
|
|
@@ -207,7 +207,7 @@ export default memo(forwardRef((props, ref) => {
|
|
|
207
207
|
transform: `translate(${left}px,${top-height+gap}px)`,
|
|
208
208
|
}}
|
|
209
209
|
>
|
|
210
|
-
<svg width="100%" height="100%">
|
|
210
|
+
<svg width="100%" height="100%" style={{display:thumbnail?"block":"none"}} >
|
|
211
211
|
{series.map(({ Component, yOrZ, ...config }, index) => {
|
|
212
212
|
const yAxis = axes.get(yOrZ);
|
|
213
213
|
const cloneYAxis = JSON.parse(JSON.stringify(yAxis));
|