@easyv/charts 1.7.23 → 1.7.24

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.
@@ -24,13 +24,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
24
24
  * 轴类图表
25
25
  */
26
26
  var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
27
- var _ref$config = _ref.config,
27
+ var width = _ref.width,
28
+ height = _ref.height,
29
+ _ref$config = _ref.config,
28
30
  axesConfig = _ref$config.axes,
29
31
  background = _ref$config.background,
30
32
  _ref$config$chart = _ref$config.chart,
31
- _ref$config$chart$dim = _ref$config$chart.dimension.chartDimension,
32
- height = _ref$config$chart$dim.height,
33
- width = _ref$config$chart$dim.width,
34
33
  _ref$config$chart$mar = _ref$config$chart.margin,
35
34
  marginLeft = _ref$config$chart$mar.marginLeft,
36
35
  marginTop = _ref$config$chart$mar.marginTop,
@@ -39,11 +39,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
39
39
  config = _ref2.config,
40
40
  _ref2$config = _ref2.config,
41
41
  axes = _ref2$config.axes,
42
- _ref2$config$chart = _ref2$config.chart,
43
- _ref2$config$chart$di = _ref2$config$chart.dimension.chartDimension,
44
- height = _ref2$config$chart$di.height,
45
- width = _ref2$config$chart$di.width,
46
- _ref2$config$chart$ma = _ref2$config$chart.margin,
42
+ _ref2$config$chart$ma = _ref2$config.chart.margin,
47
43
  marginRight = _ref2$config$chart$ma.marginRight,
48
44
  marginLeft = _ref2$config$chart$ma.marginLeft,
49
45
  marginBottom = _ref2$config$chart$ma.marginBottom,
@@ -54,6 +50,8 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
54
50
  emit = _ref2.emit,
55
51
  emitEvent = _ref2.emitEvent,
56
52
  props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
53
+ var width = props.width,
54
+ height = props.height;
57
55
  var isIOS = (0, _react.useRef)(/iPad|iPhone|iPod|iOS|CriOS/i.test(navigator.userAgent));
58
56
  var svg = /*#__PURE__*/(0, _react.createRef)();
59
57
  var chartWidth = width - marginLeft - marginRight;
@@ -232,11 +232,10 @@ var getCircleScale = function getCircleScale() {
232
232
  }));
233
233
  };
234
234
  var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
235
- var _ref5$config = _ref5.config,
235
+ var width = _ref5.width,
236
+ height = _ref5.height,
237
+ _ref5$config = _ref5.config,
236
238
  _ref5$config$chart = _ref5$config.chart,
237
- _ref5$config$chart$di = _ref5$config$chart.dimension.chartDimension,
238
- width = _ref5$config$chart$di.width,
239
- height = _ref5$config$chart$di.height,
240
239
  label = _ref5$config$chart.label,
241
240
  _ref5$config$chart$le = _ref5$config$chart.legend,
242
241
  _ref5$config$chart$le2 = _ref5$config$chart$le.formatter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.7.23",
3
+ "version": "1.7.24",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@
32
32
  "standard-version": "^9.3.2"
33
33
  },
34
34
  "dependencies": {
35
- "@easyv/utils": "^0.0.45",
35
+ "@easyv/utils": "^0.0.50",
36
36
  "d3v7": "npm:d3@^7.0.0",
37
37
  "gitignore": "^0.7.0",
38
38
  "mrm": "^4.0.0",
@@ -33,13 +33,11 @@ import {
33
33
 
34
34
  const Chart = memo(
35
35
  ({
36
+ width, height,
36
37
  config: {
37
38
  axes: axesConfig,
38
39
  background,
39
40
  chart: {
40
- dimension: {
41
- chartDimension: { height, width },
42
- },
43
41
  margin: { marginLeft, marginTop, marginRight, marginBottom },
44
42
  animation,
45
43
  legend,
@@ -26,9 +26,6 @@ const Chart = memo(
26
26
  config: {
27
27
  axes,
28
28
  chart: {
29
- dimension: {
30
- chartDimension: { height, width },
31
- },
32
29
  margin: { marginRight, marginLeft, marginBottom, marginTop },
33
30
  },
34
31
  interaction,
@@ -39,6 +36,7 @@ const Chart = memo(
39
36
  emitEvent,
40
37
  ...props
41
38
  }) => {
39
+ const { width, height } = props;
42
40
  const isIOS = useRef(/iPad|iPhone|iPod|iOS|CriOS/i.test(navigator.userAgent));
43
41
  const svg = createRef();
44
42
  const chartWidth = width - marginLeft - marginRight;
@@ -247,11 +247,9 @@ const getCircleScale = ({ count, color, width, length } = tick, radius) => {
247
247
 
248
248
  const Component = memo(
249
249
  ({
250
+ width, height,
250
251
  config: {
251
252
  chart: {
252
- dimension: {
253
- chartDimension: { width, height },
254
- },
255
253
  label,
256
254
  legend: { formatter = legendFormatter, ...legend },
257
255
  animation: { ringDuration, labelDuration } = {},