@lobehub/charts 4.0.2 → 4.0.3

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.
@@ -17,8 +17,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
19
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
- import { Flexbox } from '@lobehub/ui';
21
- import { Skeleton } from 'antd';
20
+ import { Flexbox, Skeleton } from '@lobehub/ui';
22
21
  import { css, cssVar, cx } from 'antd-style';
23
22
  import { forwardRef, useMemo, useState } from 'react';
24
23
  import { Bar, CartesianGrid, ErrorBar, Label, LabelList, Legend, BarChart as ReChartsBarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
@@ -135,13 +134,10 @@ var AccuracyBarChart = /*#__PURE__*/forwardRef(function (props, ref) {
135
134
  valueFormatter: xAxisLabelFormatter
136
135
  });
137
136
  }, [yAxisWidth, layout, data, xAxisLabelFormatter, index]);
138
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Button, {
137
+ if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Block, {
139
138
  active: true,
140
- block: true,
141
- style: {
142
- height: height,
143
- width: width
144
- }
139
+ height: height,
140
+ width: width
145
141
  });
146
142
  var CustomTooltip = customTooltip;
147
143
  var paddingValue = !showXAxis && !showYAxis ? 0 : 20;
@@ -17,8 +17,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
19
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
- import { Flexbox } from '@lobehub/ui';
21
- import { Skeleton } from 'antd';
20
+ import { Flexbox, Skeleton } from '@lobehub/ui';
22
21
  import { css, cssVar, cx } from 'antd-style';
23
22
  import { Fragment, forwardRef, useMemo, useState } from 'react';
24
23
  import { Area, CartesianGrid, Dot, Label, Legend, Line, AreaChart as ReChartsAreaChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
@@ -121,13 +120,10 @@ var AreaChart = /*#__PURE__*/forwardRef(function (props, ref) {
121
120
  valueFormatter: valueFormatter
122
121
  });
123
122
  }, [yAxisWidth, data, valueFormatter, index]);
124
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Button, {
123
+ if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Block, {
125
124
  active: true,
126
- block: true,
127
- style: {
128
- height: height,
129
- width: width
130
- }
125
+ height: height,
126
+ width: width
131
127
  });
132
128
  var CustomTooltip = customTooltip;
133
129
  var paddingValue = !showXAxis && !showYAxis || startEndOnly && !showYAxis ? 0 : 20;
@@ -17,8 +17,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
19
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
- import { Flexbox } from '@lobehub/ui';
21
- import { Skeleton } from 'antd';
20
+ import { Flexbox, Skeleton } from '@lobehub/ui';
22
21
  import { css, cssVar, cx } from 'antd-style';
23
22
  import { forwardRef, useMemo, useState } from 'react';
24
23
  import { Bar, CartesianGrid, Label, Legend, BarChart as ReChartsBarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
@@ -118,13 +117,10 @@ var BarChart = /*#__PURE__*/forwardRef(function (props, ref) {
118
117
  valueFormatter: valueFormatter
119
118
  });
120
119
  }, [yAxisWidth, layout, data, valueFormatter, index]);
121
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Button, {
120
+ if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Block, {
122
121
  active: true,
123
- block: true,
124
- style: {
125
- height: height,
126
- width: width
127
- }
122
+ height: height,
123
+ width: width
128
124
  });
129
125
  var CustomTooltip = customTooltip;
130
126
  var paddingValue = !showXAxis && !showYAxis ? 0 : 20;
@@ -15,23 +15,20 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
15
15
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
16
16
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
17
17
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
18
- import { A, Flexbox } from '@lobehub/ui';
19
- import { Skeleton } from 'antd';
20
- import { cx } from 'antd-style';
18
+ import { A, Flexbox, Skeleton } from '@lobehub/ui';
19
+ import { cssVar, cx } from 'antd-style';
21
20
  import React, { forwardRef, useMemo } from 'react';
22
21
  import NoData from "../common/NoData";
23
- import { useThemeColorRange } from "../hooks/useThemeColorRange";
24
22
  import { defaultValueFormatter } from "../utils";
25
23
  import { styles } from "./styles";
26
24
  import { jsx as _jsx } from "react/jsx-runtime";
27
25
  import { jsxs as _jsxs } from "react/jsx-runtime";
28
26
  var prefixCls = 'ant';
29
27
  var BarList = /*#__PURE__*/forwardRef(function (props, ref) {
30
- var themeColorRange = useThemeColorRange();
31
28
  var _props$data = props.data,
32
29
  data = _props$data === void 0 ? [] : _props$data,
33
30
  _props$color = props.color,
34
- color = _props$color === void 0 ? themeColorRange[0] : _props$color,
31
+ color = _props$color === void 0 ? cssVar.colorTextQuaternary : _props$color,
35
32
  _props$valueFormatter = props.valueFormatter,
36
33
  valueFormatter = _props$valueFormatter === void 0 ? defaultValueFormatter : _props$valueFormatter,
37
34
  _props$showAnimation = props.showAnimation,
@@ -65,13 +62,10 @@ var BarList = /*#__PURE__*/forwardRef(function (props, ref) {
65
62
  return item.value === 0 ? 0 : Math.max(item.value / maxValue * 100, 2);
66
63
  });
67
64
  }, [sortedData]);
68
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Button, {
65
+ if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Block, {
69
66
  active: true,
70
- block: true,
71
- style: {
72
- height: height,
73
- width: width
74
- }
67
+ height: height,
68
+ width: width
75
69
  });
76
70
  var rowHeight = 32;
77
71
  var labelHeight = 20;
@@ -18,8 +18,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
18
18
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
19
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
20
20
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
21
- import { Flexbox } from '@lobehub/ui';
22
- import { Skeleton } from 'antd';
21
+ import { Flexbox, Skeleton } from '@lobehub/ui';
23
22
  import { css, cssVar, cx, useThemeMode } from 'antd-style';
24
23
  import { forwardRef, useEffect, useState } from 'react';
25
24
  import { Pie, PieChart as ReChartsDonutChart, ResponsiveContainer, Tooltip } from 'recharts';
@@ -97,13 +96,10 @@ var DonutChart = /*#__PURE__*/forwardRef(function (props, ref) {
97
96
  }
98
97
  }
99
98
  }, [activeIndex]);
100
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Button, {
99
+ if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Block, {
101
100
  active: true,
102
- block: true,
103
- style: {
104
- height: height,
105
- width: width
106
- }
101
+ height: height,
102
+ width: width
107
103
  });
108
104
  var onShapeClick = function onShapeClick(data, index, event) {
109
105
  event.stopPropagation();
@@ -22,9 +22,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
22
22
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
23
23
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
24
24
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
25
- import { Flexbox } from '@lobehub/ui';
25
+ import { Flexbox, Skeleton } from '@lobehub/ui';
26
26
  import { useSize } from 'ahooks';
27
- import { Skeleton } from 'antd';
28
27
  import { css, cssVar, cx } from 'antd-style';
29
28
  import { Fragment, forwardRef, useEffect, useMemo, useRef, useState } from 'react';
30
29
  import ArrowRightIcon from "./ArrowRightIcon";
@@ -254,13 +253,10 @@ var FunnelChart = /*#__PURE__*/forwardRef(function (props, ref) {
254
253
  y: closestBar.startY
255
254
  });
256
255
  };
257
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Button, {
256
+ if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Block, {
258
257
  active: true,
259
- block: true,
260
- style: {
261
- height: height,
262
- width: width
263
- }
258
+ height: height,
259
+ width: width
264
260
  });
265
261
  var errorMessage = data ? validateData(data, calculateFrom) : null;
266
262
  if (errorMessage) {
@@ -17,8 +17,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
19
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
- import { Flexbox } from '@lobehub/ui';
21
- import { Skeleton } from 'antd';
20
+ import { Flexbox, Skeleton } from '@lobehub/ui';
22
21
  import { css, cssVar, cx } from 'antd-style';
23
22
  import { Fragment, forwardRef, useMemo, useState } from 'react';
24
23
  import { CartesianGrid, Dot, Label, Legend, Line, LineChart as ReChartsLineChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
@@ -117,13 +116,10 @@ var LineChart = /*#__PURE__*/forwardRef(function (props, ref) {
117
116
  valueFormatter: valueFormatter
118
117
  });
119
118
  }, [yAxisWidth, data, valueFormatter, index]);
120
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Button, {
119
+ if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Block, {
121
120
  active: true,
122
- block: true,
123
- style: {
124
- height: height,
125
- width: width
126
- }
121
+ height: height,
122
+ width: width
127
123
  });
128
124
  var CustomTooltip = customTooltip;
129
125
  var paddingValue = !showXAxis && !showYAxis ? 0 : 20;
@@ -17,8 +17,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
19
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
- import { Flexbox } from '@lobehub/ui';
21
- import { Skeleton } from 'antd';
20
+ import { Flexbox, Skeleton } from '@lobehub/ui';
22
21
  import { css, cssVar, cx } from 'antd-style';
23
22
  import { forwardRef, useMemo, useState } from 'react';
24
23
  import { CartesianGrid, Label, Legend, ScatterChart as ReChartsScatterChart, ResponsiveContainer, Scatter, Tooltip, XAxis, YAxis, ZAxis } from 'recharts';
@@ -126,13 +125,10 @@ var ScatterChart = /*#__PURE__*/forwardRef(function (props, ref) {
126
125
  valueFormatter: valueFormatter === null || valueFormatter === void 0 ? void 0 : valueFormatter.y
127
126
  });
128
127
  }, [yAxisWidth, data, valueFormatter, y]);
129
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Button, {
128
+ if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Block, {
130
129
  active: true,
131
- block: true,
132
- style: {
133
- height: height,
134
- width: width
135
- }
130
+ height: height,
131
+ width: width
136
132
  });
137
133
  var CustomTooltip = customTooltip;
138
134
  var hasOnValueChange = !!onValueChange;
@@ -11,8 +11,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
11
11
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
12
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
13
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
- import { Flexbox } from '@lobehub/ui';
15
- import { Skeleton } from 'antd';
14
+ import { Flexbox, Skeleton } from '@lobehub/ui';
16
15
  import { css, cssVar, cx } from 'antd-style';
17
16
  import { forwardRef } from 'react';
18
17
  import { Area, AreaChart as ReChartsAreaChart, ResponsiveContainer, XAxis, YAxis } from 'recharts';
@@ -56,13 +55,10 @@ var SparkAreaChart = /*#__PURE__*/forwardRef(function (props, ref) {
56
55
  height = _props$height === void 0 ? 48 : _props$height,
57
56
  style = props.style,
58
57
  rest = _objectWithoutProperties(props, _excluded);
59
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Button, {
58
+ if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Block, {
60
59
  active: true,
61
- block: true,
62
- style: {
63
- height: height,
64
- width: width
65
- }
60
+ height: height,
61
+ width: width
66
62
  });
67
63
  var categoryColors = constructCategoryColors(categories, colors);
68
64
  var yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);
@@ -11,8 +11,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
11
11
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
12
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
13
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
- import { Flexbox } from '@lobehub/ui';
15
- import { Skeleton } from 'antd';
14
+ import { Flexbox, Skeleton } from '@lobehub/ui';
16
15
  import { css, cssVar, cx } from 'antd-style';
17
16
  import { forwardRef } from 'react';
18
17
  import { Bar, BarChart as ReChartsBarChart, ResponsiveContainer, XAxis, YAxis } from 'recharts';
@@ -52,13 +51,10 @@ var SparkBarChart = /*#__PURE__*/forwardRef(function (props, ref) {
52
51
  height = _props$height === void 0 ? 48 : _props$height,
53
52
  style = props.style,
54
53
  rest = _objectWithoutProperties(props, _excluded);
55
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Button, {
54
+ if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Block, {
56
55
  active: true,
57
- block: true,
58
- style: {
59
- height: height,
60
- width: width
61
- }
56
+ height: height,
57
+ width: width
62
58
  });
63
59
  var categoryColors = constructCategoryColors(categories, colors);
64
60
  var yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);
@@ -11,8 +11,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
11
11
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
12
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
13
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
- import { Flexbox } from '@lobehub/ui';
15
- import { Skeleton } from 'antd';
14
+ import { Flexbox, Skeleton } from '@lobehub/ui';
16
15
  import { css, cssVar, cx } from 'antd-style';
17
16
  import { forwardRef } from 'react';
18
17
  import { Line, LineChart as ReChartsLineChart, ResponsiveContainer, XAxis, YAxis } from 'recharts';
@@ -52,13 +51,10 @@ var SparkLineChart = /*#__PURE__*/forwardRef(function (props, ref) {
52
51
  style = props.style,
53
52
  loading = props.loading,
54
53
  rest = _objectWithoutProperties(props, _excluded);
55
- if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Button, {
54
+ if (loading || !data) return /*#__PURE__*/_jsx(Skeleton.Block, {
56
55
  active: true,
57
- block: true,
58
- style: {
59
- height: height,
60
- width: width
61
- }
56
+ height: height,
57
+ width: width
62
58
  });
63
59
  var categoryColors = constructCategoryColors(categories, colors);
64
60
  var yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);
@@ -9,7 +9,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
9
9
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
10
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
11
11
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12
- import { Flexbox } from '@lobehub/ui';
12
+ import { Flexbox, TooltipGroup } from '@lobehub/ui';
13
13
  import { cx } from 'antd-style';
14
14
  import { forwardRef } from 'react';
15
15
  import TrackerBlock from "./TrackerBlock";
@@ -35,20 +35,22 @@ var Tracker = /*#__PURE__*/forwardRef(function (props, ref) {
35
35
  rightLabel = props.rightLabel,
36
36
  style = props.style,
37
37
  rest = _objectWithoutProperties(props, _excluded);
38
- var content = data.map(function (item, idx) {
39
- var _item$key;
40
- return /*#__PURE__*/_jsx(TrackerBlock, {
41
- color: item.color,
42
- height: blockHeight,
43
- onClick: function onClick() {
44
- return onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(item);
45
- },
46
- style: {
47
- cursor: onValueChange ? 'pointer' : 'default'
48
- },
49
- tooltip: customTooltip ? customTooltip(item) : item.tooltip,
50
- width: blockWidth
51
- }, (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : idx);
38
+ var content = /*#__PURE__*/_jsx(TooltipGroup, {
39
+ children: data.map(function (item, idx) {
40
+ var _item$key;
41
+ return /*#__PURE__*/_jsx(TrackerBlock, {
42
+ color: item.color,
43
+ height: blockHeight,
44
+ onClick: function onClick() {
45
+ return onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(item);
46
+ },
47
+ style: {
48
+ cursor: onValueChange ? 'pointer' : 'default'
49
+ },
50
+ tooltip: customTooltip ? customTooltip(item) : item.tooltip,
51
+ width: blockWidth
52
+ }, (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : idx);
53
+ })
52
54
  });
53
55
  if (leftLabel || rightLabel) {
54
56
  return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/charts",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "React modern charts components built on recharts",
5
5
  "keywords": [
6
6
  "lobehub",