@easyv/charts 1.9.14 → 1.9.16

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.
@@ -57,10 +57,10 @@ var getAttr = function getAttr(_ref) {
57
57
  var len = length ? length : 0.1; //柱子长度
58
58
  if (isVertical) {
59
59
  return {
60
- width: maxWidth ? Math.min(Math.max(0, len), maxWidth) : Math.max(0, len),
61
- height: Math.max(0, seriesWidth),
60
+ width: Math.max(0, len),
61
+ height: maxWidth ? Math.min(Math.max(0, seriesWidth), maxWidth) : Math.max(0, seriesWidth),
62
62
  x: y,
63
- y: x,
63
+ y: maxWidth ? seriesWidth > maxWidth ? x + (seriesWidth - maxWidth) / 2 : x : x,
64
64
  bgAttr: {
65
65
  x: 0,
66
66
  y: x,
@@ -73,8 +73,6 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
73
73
  filterData = _ref.filterData,
74
74
  aiFormatter = _ref.aiFormatter,
75
75
  id = _ref.id;
76
- console.log("chart", chart);
77
- console.log("bar", bar);
78
76
  var context = (0, _react.useContext)(_context.chartContext);
79
77
  var _useState = (0, _react.useState)(false),
80
78
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
@@ -53,7 +53,6 @@ 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("hhh");
57
56
  var width = props.width,
58
57
  height = props.height;
59
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));
@@ -229,7 +229,6 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(/*#__PURE__*/(
229
229
  });
230
230
  document.addEventListener("touchend", _up4);
231
231
  };
232
- console.log("series", series);
233
232
  return /*#__PURE__*/_react["default"].createElement("div", {
234
233
  style: {
235
234
  width: cWidth,
@@ -51,10 +51,10 @@ var getAttr = function getAttr(_ref) {
51
51
  y = _ref.y,
52
52
  maxWidth = _ref.maxWidth;
53
53
  if (isVertical) return {
54
- width: maxWidth ? Math.min(Math.max(0, length), maxWidth) : Math.max(0, length),
55
- height: seriesWidth,
54
+ width: length,
55
+ height: maxWidth ? Math.min(Math.max(0, seriesWidth), maxWidth) : Math.max(0, seriesWidth),
56
56
  x: y,
57
- y: x
57
+ y: maxWidth ? seriesWidth > maxWidth ? x + (seriesWidth - maxWidth) / 2 : x : x
58
58
  };
59
59
  return {
60
60
  x: maxWidth ? seriesWidth > maxWidth ? x + (seriesWidth - maxWidth) / 2 : x : x,
@@ -96,9 +96,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
96
96
  direction = _ref3$xAxis.direction,
97
97
  yScaler = _ref3.yAxis.scaler,
98
98
  name = _ref3.name;
99
- console.log("config", BarProp);
100
99
  var maxWidth = maxWidth1 ? maxWidth1 : config.maxWidth;
101
- console.log("maxWidth", maxWidth);
102
100
  if (!data.length) return null;
103
101
  var _getSeriesInfo = (0, _utils.getSeriesInfo)({
104
102
  step: step,
@@ -161,7 +159,6 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
161
159
  seriesWidth: seriesWidth,
162
160
  maxWidth: maxWidth
163
161
  });
164
- console.log("attr", attr);
165
162
  return /*#__PURE__*/_react["default"].createElement("g", {
166
163
  key: i,
167
164
  onClick: triggerClick,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.9.14",
3
+ "version": "1.9.16",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -42,10 +42,16 @@ const getAttr = ({
42
42
  const len = length ? length : 0.1; //柱子长度
43
43
  if (isVertical) {
44
44
  return {
45
- width: maxWidth ? Math.min(Math.max(0, len), maxWidth) : Math.max(0, len),
46
- height: Math.max(0, seriesWidth),
45
+ width: Math.max(0, len),
46
+ height: maxWidth
47
+ ? Math.min(Math.max(0, seriesWidth), maxWidth)
48
+ : Math.max(0, seriesWidth),
47
49
  x: y,
48
- y: x,
50
+ y: maxWidth
51
+ ? seriesWidth > maxWidth
52
+ ? x + (seriesWidth - maxWidth) / 2
53
+ : x
54
+ : x,
49
55
  bgAttr: {
50
56
  x: 0,
51
57
  y: x,
@@ -41,12 +41,16 @@ const getAttr = ({
41
41
  }) => {
42
42
  if (isVertical)
43
43
  return {
44
- width: maxWidth
45
- ? Math.min(Math.max(0, length), maxWidth)
46
- : Math.max(0, length),
47
- height: seriesWidth,
44
+ width: length,
45
+ height: maxWidth
46
+ ? Math.min(Math.max(0, seriesWidth), maxWidth)
47
+ : Math.max(0, seriesWidth),
48
48
  x: y,
49
- y: x,
49
+ y: maxWidth
50
+ ? seriesWidth > maxWidth
51
+ ? x + (seriesWidth - maxWidth) / 2
52
+ : x
53
+ : x,
50
54
  };
51
55
  return {
52
56
  x: maxWidth