@lobehub/charts 1.11.0 → 1.12.0

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.
@@ -100,7 +100,7 @@ var AreaChart = /*#__PURE__*/forwardRef(function (props, ref) {
100
100
  _props$width = props.width,
101
101
  width = _props$width === void 0 ? '100%' : _props$width,
102
102
  _props$height = props.height,
103
- height = _props$height === void 0 ? '20rem' : _props$height,
103
+ height = _props$height === void 0 ? 280 : _props$height,
104
104
  style = props.style,
105
105
  customCategories = props.customCategories,
106
106
  rest = _objectWithoutProperties(props, _excluded);
@@ -205,7 +205,6 @@ var AreaChart = /*#__PURE__*/forwardRef(function (props, ref) {
205
205
  dataKey: index,
206
206
  dy: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.verticalShift,
207
207
  fill: "",
208
- height: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.xAxisHeight,
209
208
  hide: !showXAxis,
210
209
  interval: startEndOnly ? 'preserveStartEnd' : intervalType,
211
210
  minTickGap: tickGap,
@@ -99,7 +99,7 @@ var BarChart = /*#__PURE__*/forwardRef(function (props, ref) {
99
99
  _props$width = props.width,
100
100
  width = _props$width === void 0 ? '100%' : _props$width,
101
101
  _props$height = props.height,
102
- height = _props$height === void 0 ? '20rem' : _props$height,
102
+ height = _props$height === void 0 ? 280 : _props$height,
103
103
  style = props.style,
104
104
  rest = _objectWithoutProperties(props, _excluded);
105
105
  var _useState = useState(),
@@ -209,7 +209,6 @@ var BarChart = /*#__PURE__*/forwardRef(function (props, ref) {
209
209
  domain: yAxisDomain,
210
210
  dy: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.verticalShift,
211
211
  fill: "",
212
- height: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.xAxisHeight,
213
212
  hide: !showXAxis,
214
213
  minTickGap: tickGap,
215
214
  stroke: "",
@@ -237,7 +236,6 @@ var BarChart = /*#__PURE__*/forwardRef(function (props, ref) {
237
236
  dataKey: index,
238
237
  dy: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.verticalShift,
239
238
  fill: "",
240
- height: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.xAxisHeight,
241
239
  hide: !showXAxis,
242
240
  interval: startEndOnly ? 'preserveStartEnd' : intervalType,
243
241
  minTickGap: tickGap,
@@ -6,7 +6,7 @@ export var useStyles = createStyles(function (_ref) {
6
6
  css = _ref.css,
7
7
  token = _ref.token;
8
8
  return {
9
- bar: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n\n max-width: 100%;\n height: 100%;\n\n opacity: 0.25;\n border-radius: ", "px;\n\n transition: all 0.25s ", ";\n "])), token.borderRadius, token.motionEaseInOut),
9
+ bar: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n\n max-width: 100%;\n height: 100%;\n border-radius: ", "px;\n\n opacity: 0.25;\n\n transition: all 0.25s ", ";\n "])), token.borderRadius, token.motionEaseInOut),
10
10
  barContainer: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n "]))),
11
11
  barHover: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n &:hover {\n .", "-chart-bar-item {\n opacity: 0.4;\n }\n }\n "])), prefixCls),
12
12
  emphasis: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n "]))),
@@ -109,7 +109,7 @@ var FunnelChart = /*#__PURE__*/forwardRef(function (props, ref) {
109
109
  _props$width = props.width,
110
110
  width = _props$width === void 0 ? '100%' : _props$width,
111
111
  _props$height = props.height,
112
- height = _props$height === void 0 ? '20rem' : _props$height,
112
+ height = _props$height === void 0 ? 280 : _props$height,
113
113
  className = props.className,
114
114
  style = props.style,
115
115
  yAxisWidth = props.yAxisWidth,
@@ -12,7 +12,7 @@ var useStyles = createStyles(function (_ref) {
12
12
  var css = _ref.css,
13
13
  token = _ref.token;
14
14
  return {
15
- container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n\n color: ", ";\n white-space: nowrap;\n\n border-radius: ", "px;\n "])), token.colorTextDescription, token.borderRadius),
15
+ container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n\n border-radius: ", "px;\n\n color: ", ";\n white-space: nowrap;\n "])), token.borderRadius, token.colorTextDescription),
16
16
  hasOnValueChange: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n transition: all 0.25s ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n "])), token.motionEaseInOut, token.colorTextSecondary, token.colorFillTertiary),
17
17
  itemContent: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: 12px;\n color: inherit;\n "])))
18
18
  };
@@ -95,7 +95,7 @@ var LineChart = /*#__PURE__*/forwardRef(function (props, ref) {
95
95
  _props$width = props.width,
96
96
  width = _props$width === void 0 ? '100%' : _props$width,
97
97
  _props$height = props.height,
98
- height = _props$height === void 0 ? '20rem' : _props$height,
98
+ height = _props$height === void 0 ? 280 : _props$height,
99
99
  style = props.style,
100
100
  customCategories = props.customCategories,
101
101
  loading = props.loading,
@@ -201,7 +201,6 @@ var LineChart = /*#__PURE__*/forwardRef(function (props, ref) {
201
201
  dataKey: index,
202
202
  dy: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.verticalShift,
203
203
  fill: "",
204
- height: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.xAxisHeight,
205
204
  hide: !showXAxis,
206
205
  interval: startEndOnly ? 'preserveStartEnd' : intervalType,
207
206
  minTickGap: tickGap,
@@ -15,7 +15,7 @@ var useStyles = createStyles(function (_ref) {
15
15
  var css = _ref.css,
16
16
  token = _ref.token;
17
17
  return {
18
- header: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-weight: 500;\n border-bottom: 1px solid ", ";\n "])), token.colorBorderSecondary)
18
+ header: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-bottom: 1px solid ", ";\n font-weight: 500;\n "])), token.colorBorderSecondary)
19
19
  };
20
20
  });
21
21
  var ScatterChartTooltip = /*#__PURE__*/memo(function (_ref2) {
@@ -104,7 +104,7 @@ var ScatterChart = /*#__PURE__*/forwardRef(function (props, ref) {
104
104
  _props$width = props.width,
105
105
  width = _props$width === void 0 ? '100%' : _props$width,
106
106
  _props$height = props.height,
107
- height = _props$height === void 0 ? '20rem' : _props$height,
107
+ height = _props$height === void 0 ? 280 : _props$height,
108
108
  style = props.style,
109
109
  customCategories = props.customCategories,
110
110
  rest = _objectWithoutProperties(props, _excluded);
@@ -211,7 +211,6 @@ var ScatterChart = /*#__PURE__*/forwardRef(function (props, ref) {
211
211
  domain: xAxisDomain,
212
212
  dy: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.verticalShift,
213
213
  fill: "",
214
- height: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.xAxisHeight,
215
214
  hide: !showXAxis,
216
215
  interval: startEndOnly ? 'preserveStartEnd' : intervalType,
217
216
  minTickGap: tickGap,
@@ -17,7 +17,7 @@ export var useStyles = createStyles(function (_ref) {
17
17
  var css = _ref.css,
18
18
  token = _ref.token;
19
19
  return {
20
- container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n "])), token.colorBgElevated, token.colorBorderSecondary, token.borderRadiusLG, token.boxShadow)
20
+ container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n\n background: ", ";\n box-shadow: ", ";\n "])), token.colorBorderSecondary, token.borderRadiusLG, token.colorBgElevated, token.boxShadow)
21
21
  };
22
22
  });
23
23
  export var ChartTooltipFrame = /*#__PURE__*/memo(function (_ref2) {
@@ -11,7 +11,7 @@ var useStyles = createStyles(function (_ref) {
11
11
  var css = _ref.css,
12
12
  token = _ref.token;
13
13
  return {
14
- header: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-weight: 500;\n border-bottom: 1px solid ", ";\n "])), token.colorBorderSecondary)
14
+ header: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-bottom: 1px solid ", ";\n font-weight: 500;\n "])), token.colorBorderSecondary)
15
15
  };
16
16
  });
17
17
  var ChartTooltip = function ChartTooltip(_ref2) {
@@ -1,2 +1 @@
1
1
  export declare function createTheme(input?: string[], size?: number): string[];
2
- export declare const convertAlphaToSolid: (foreground: string, background: string) => string;
package/es/utils/theme.js CHANGED
@@ -37,13 +37,4 @@ export function createTheme(input) {
37
37
  return isstringScale(theme, size) ? theme : createstringScale(theme, size);
38
38
  }
39
39
  return defaultTheme;
40
- }
41
- export var convertAlphaToSolid = function convertAlphaToSolid(foreground, background) {
42
- var fgColor = chroma(foreground);
43
- var bgColor = chroma(background);
44
- var alpha = fgColor.alpha();
45
- var alphaComplement = 1 - alpha;
46
- var mixedColor = [fgColor.get('rgb.r') * alpha + bgColor.get('rgb.r') * alphaComplement, fgColor.get('rgb.g') * alpha + bgColor.get('rgb.g') * alphaComplement, fgColor.get('rgb.b') * alpha + bgColor.get('rgb.b') * alphaComplement];
47
- var resultColor = chroma(mixedColor);
48
- return resultColor.hex();
49
- };
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/charts",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "React modern charts components built on recharts",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -24,7 +24,7 @@
24
24
  "es"
25
25
  ],
26
26
  "dependencies": {
27
- "@lobehub/ui": "^1.161.0",
27
+ "@lobehub/ui": "^1.162.0",
28
28
  "ahooks": "^3.8.4",
29
29
  "antd-style": "^3.7.1",
30
30
  "chroma-js": "^3.1.2",