@alfalab/core-components-chart 3.1.4 → 3.1.5
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/Component.js +39 -41
- package/components/CustomizedLabel.js +5 -7
- package/components/Dot/index.css +8 -8
- package/components/Dot/index.js +9 -11
- package/components/Legends/index.css +8 -8
- package/components/Legends/index.js +13 -15
- package/components/LinearGradient.js +3 -5
- package/components/RectBar.js +5 -7
- package/components/Tick/index.css +4 -4
- package/components/Tick/index.js +7 -9
- package/components/TooltipContent/index.css +7 -7
- package/components/TooltipContent/index.js +12 -14
- package/cssm/Component.js +41 -43
- package/cssm/components/CustomizedLabel.js +5 -7
- package/cssm/components/Dot/index.js +10 -12
- package/cssm/components/Legends/index.js +13 -15
- package/cssm/components/LinearGradient.js +3 -5
- package/cssm/components/RectBar.js +5 -7
- package/cssm/components/Tick/index.js +7 -9
- package/cssm/components/TooltipContent/index.js +12 -14
- package/cssm/hooks/usePathBar/index.js +0 -2
- package/cssm/hooks/usePathBar/utils/getRadius.js +0 -2
- package/cssm/hooks/useSettings/index.js +1 -3
- package/cssm/hooks/useSettings/utils/setComposedChartsMargin.js +0 -2
- package/cssm/hooks/useSettings/utils/setDatas.js +4 -6
- package/cssm/hooks/useSettings/utils/setGradientCharts.js +2 -4
- package/cssm/hooks/useSettings/utils/setLegendMargin.js +0 -2
- package/cssm/hooks/useSettings/utils/sortByIndex.js +0 -2
- package/cssm/icons/Circle.js +4 -6
- package/cssm/icons/CircleLine.js +5 -7
- package/cssm/icons/FilledCircle.js +8 -10
- package/cssm/icons/Point.js +5 -7
- package/cssm/icons/StrokeCircle.js +4 -6
- package/cssm/index.js +9 -11
- package/cssm/{tslib.es6-0de342ae.d.ts → tslib.es6-19b064c1.d.ts} +0 -0
- package/cssm/{tslib.es6-0de342ae.js → tslib.es6-19b064c1.js} +0 -0
- package/cssm/types/utils/index.d.ts +1 -0
- package/esm/Component.js +23 -23
- package/esm/components/CustomizedLabel.js +1 -1
- package/esm/components/Dot/index.css +8 -8
- package/esm/components/Dot/index.js +3 -3
- package/esm/components/Legends/index.css +8 -8
- package/esm/components/Legends/index.js +4 -4
- package/esm/components/LinearGradient.js +1 -1
- package/esm/components/RectBar.js +2 -2
- package/esm/components/Tick/index.css +4 -4
- package/esm/components/Tick/index.js +2 -2
- package/esm/components/TooltipContent/index.css +7 -7
- package/esm/components/TooltipContent/index.js +2 -2
- package/esm/hooks/useSettings/index.js +1 -1
- package/esm/hooks/useSettings/utils/setDatas.js +4 -4
- package/esm/hooks/useSettings/utils/setGradientCharts.js +2 -2
- package/esm/index.css +5 -5
- package/esm/index.js +7 -7
- package/esm/{tslib.es6-98750278.d.ts → tslib.es6-c1e06c73.d.ts} +0 -0
- package/esm/{tslib.es6-98750278.js → tslib.es6-c1e06c73.js} +0 -0
- package/esm/types/utils/index.d.ts +1 -0
- package/hooks/usePathBar/index.js +0 -2
- package/hooks/usePathBar/utils/getRadius.js +0 -2
- package/hooks/useSettings/index.js +1 -3
- package/hooks/useSettings/utils/setComposedChartsMargin.js +0 -2
- package/hooks/useSettings/utils/setDatas.js +4 -6
- package/hooks/useSettings/utils/setGradientCharts.js +2 -4
- package/hooks/useSettings/utils/setLegendMargin.js +0 -2
- package/hooks/useSettings/utils/sortByIndex.js +0 -2
- package/icons/Circle.js +4 -6
- package/icons/CircleLine.js +5 -7
- package/icons/FilledCircle.js +8 -10
- package/icons/Point.js +5 -7
- package/icons/StrokeCircle.js +4 -6
- package/index.css +5 -5
- package/index.js +7 -9
- package/modern/Component.js +10 -10
- package/modern/components/CustomizedLabel.js +1 -1
- package/modern/components/Dot/index.css +8 -8
- package/modern/components/Dot/index.js +1 -1
- package/modern/components/Legends/index.css +8 -8
- package/modern/components/Legends/index.js +1 -1
- package/modern/components/RectBar.js +1 -1
- package/modern/components/Tick/index.css +4 -4
- package/modern/components/Tick/index.js +1 -1
- package/modern/components/TooltipContent/index.css +7 -7
- package/modern/components/TooltipContent/index.js +1 -1
- package/modern/index.css +5 -5
- package/modern/index.js +6 -6
- package/modern/types/utils/index.d.ts +1 -0
- package/package.json +2 -2
- package/{tslib.es6-27fe16ea.d.ts → tslib.es6-2bc3955e.d.ts} +0 -0
- package/{tslib.es6-27fe16ea.js → tslib.es6-2bc3955e.js} +0 -0
- package/types/utils/index.d.ts +1 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var tslib_es6 = require('../../../tslib.es6-0de342ae.js');
|
|
3
|
+
var tslib_es6 = require('../../../tslib.es6-19b064c1.js');
|
|
6
4
|
|
|
7
5
|
var setGradientCharts = function (series) {
|
|
8
6
|
var filterSeries = series.filter(function (item) { return item.chart !== 'gradient'; });
|
|
@@ -19,7 +17,7 @@ var setGradientCharts = function (series) {
|
|
|
19
17
|
};
|
|
20
18
|
});
|
|
21
19
|
}
|
|
22
|
-
accum.push(tslib_es6.__assign(tslib_es6.__assign({}, item), { zIndex: -100, chart: 'gradient', hideLegend: true, hideTooltip: true, properties: tslib_es6.__assign(tslib_es6.__assign({}, item.properties), { dataKey: item.properties.dataKey
|
|
20
|
+
accum.push(tslib_es6.__assign(tslib_es6.__assign({}, item), { zIndex: -100, chart: 'gradient', hideLegend: true, hideTooltip: true, properties: tslib_es6.__assign(tslib_es6.__assign({}, item.properties), { dataKey: "".concat(item.properties.dataKey, "-gradient"), fill: fill }), data: newData || item.data }));
|
|
23
21
|
}
|
|
24
22
|
accum.push(item);
|
|
25
23
|
return accum;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var setLegendMargin = function (brush, legend) {
|
|
6
4
|
var top = 0;
|
|
7
5
|
if (typeof (brush === null || brush === void 0 ? void 0 : brush.brushMargin) !== 'number' || !(legend === null || legend === void 0 ? void 0 : legend.verticalAlign))
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var sortByIndex = function (series) {
|
|
6
4
|
return series.sort(function (a, b) {
|
|
7
5
|
if ((a === null || a === void 0 ? void 0 : a.zIndex) && (b === null || b === void 0 ? void 0 : b.zIndex) && (a === null || a === void 0 ? void 0 : a.zIndex) > (b === null || b === void 0 ? void 0 : b.zIndex)) {
|
package/cssm/icons/Circle.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var React = require('react');
|
|
6
4
|
|
|
7
|
-
function
|
|
5
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
6
|
|
|
9
|
-
var React__default = /*#__PURE__*/
|
|
7
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
8
|
|
|
11
9
|
var CircleIcon = function (_a) {
|
|
12
10
|
var _b = _a.fill, fill = _b === void 0 ? '#FF5C5C' : _b, _c = _a.height, height = _c === void 0 ? 16 : _c;
|
|
13
|
-
return (React__default
|
|
14
|
-
React__default
|
|
11
|
+
return (React__default.default.createElement("svg", { xmlns: 'http://www.w3.org/2000/svg', height: height, viewBox: '0 0 16 16', fill: 'none' },
|
|
12
|
+
React__default.default.createElement("circle", { cx: '8', cy: '8', r: '8', fill: fill })));
|
|
15
13
|
};
|
|
16
14
|
|
|
17
15
|
exports.CircleIcon = CircleIcon;
|
package/cssm/icons/CircleLine.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var React = require('react');
|
|
6
4
|
|
|
7
|
-
function
|
|
5
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
6
|
|
|
9
|
-
var React__default = /*#__PURE__*/
|
|
7
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
8
|
|
|
11
9
|
var CircleLineIcon = function (_a) {
|
|
12
10
|
var _b = _a.fill, fill = _b === void 0 ? '#FF5C5C' : _b, _c = _a.height, height = _c === void 0 ? 16 : _c;
|
|
13
|
-
return (React__default
|
|
14
|
-
React__default
|
|
15
|
-
React__default
|
|
11
|
+
return (React__default.default.createElement("svg", { xmlns: 'http://www.w3.org/2000/svg', height: height, viewBox: '0 0 22 12', fill: 'none' },
|
|
12
|
+
React__default.default.createElement("circle", { cx: '11', cy: '6', r: '6', fill: fill }),
|
|
13
|
+
React__default.default.createElement("rect", { y: '5', width: '22', height: '2', fill: fill })));
|
|
16
14
|
};
|
|
17
15
|
|
|
18
16
|
exports.CircleLineIcon = CircleLineIcon;
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var React = require('react');
|
|
6
4
|
|
|
7
|
-
function
|
|
5
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
6
|
|
|
9
|
-
var React__default = /*#__PURE__*/
|
|
7
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
8
|
|
|
11
9
|
var FilledCircleIcon = function (_a) {
|
|
12
10
|
var _b = _a.fill, fill = _b === void 0 ? '#5A8ECF' : _b, _c = _a.height, height = _c === void 0 ? 16 : _c;
|
|
13
|
-
return (React__default
|
|
14
|
-
React__default
|
|
15
|
-
React__default
|
|
16
|
-
React__default
|
|
17
|
-
React__default
|
|
18
|
-
React__default
|
|
11
|
+
return (React__default.default.createElement("svg", { xmlns: 'http://www.w3.org/2000/svg', height: height, viewBox: '0 0 22 22', fill: 'none' },
|
|
12
|
+
React__default.default.createElement("circle", { cx: '11', cy: '11', r: '10', fill: 'url(#paint0_linear)', stroke: fill, strokeWidth: '2' }),
|
|
13
|
+
React__default.default.createElement("defs", null,
|
|
14
|
+
React__default.default.createElement("linearGradient", { id: 'paint0_linear', x1: '11', y1: '1', x2: '11', y2: '21', gradientUnits: 'userSpaceOnUse' },
|
|
15
|
+
React__default.default.createElement("stop", { stopColor: fill, stopOpacity: '0.2' }),
|
|
16
|
+
React__default.default.createElement("stop", { offset: '1', stopColor: fill, stopOpacity: '0' })))));
|
|
19
17
|
};
|
|
20
18
|
|
|
21
19
|
exports.FilledCircleIcon = FilledCircleIcon;
|
package/cssm/icons/Point.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var React = require('react');
|
|
6
4
|
|
|
7
|
-
function
|
|
5
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
6
|
|
|
9
|
-
var React__default = /*#__PURE__*/
|
|
7
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
8
|
|
|
11
9
|
var PointIcon = function (_a) {
|
|
12
10
|
var _b = _a.fill, fill = _b === void 0 ? '#5A8ECF' : _b, _c = _a.height, height = _c === void 0 ? 16 : _c;
|
|
13
|
-
return (React__default
|
|
14
|
-
React__default
|
|
15
|
-
React__default
|
|
11
|
+
return (React__default.default.createElement("svg", { height: height, viewBox: '0 0 18 18' },
|
|
12
|
+
React__default.default.createElement("circle", { cx: '9', cy: '9', r: '9', strokeWidth: '1', fill: fill, fillOpacity: '0.4' }),
|
|
13
|
+
React__default.default.createElement("circle", { cx: '9', cy: '9', r: '3', strokeWidth: '2', stroke: '#fff', fill: fill })));
|
|
16
14
|
};
|
|
17
15
|
|
|
18
16
|
exports.PointIcon = PointIcon;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var React = require('react');
|
|
6
4
|
|
|
7
|
-
function
|
|
5
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
6
|
|
|
9
|
-
var React__default = /*#__PURE__*/
|
|
7
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
8
|
|
|
11
9
|
var StrokeCircleIcon = function (_a) {
|
|
12
10
|
var _b = _a.fill, fill = _b === void 0 ? '#5A8ECF' : _b, _c = _a.height, height = _c === void 0 ? 16 : _c;
|
|
13
|
-
return (React__default
|
|
14
|
-
React__default
|
|
11
|
+
return (React__default.default.createElement("svg", { xmlns: 'http://www.w3.org/2000/svg', height: height, viewBox: '0 0 22 22', fill: 'none' },
|
|
12
|
+
React__default.default.createElement("circle", { cx: '11', cy: '11', r: '10', stroke: fill, strokeWidth: '2', strokeDasharray: '8 8' })));
|
|
15
13
|
};
|
|
16
14
|
|
|
17
15
|
exports.StrokeCircleIcon = StrokeCircleIcon;
|
package/cssm/index.js
CHANGED
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require('./tslib.es6-0de342ae.js');
|
|
3
|
+
var Component = require('./Component.js');
|
|
4
|
+
require('./tslib.es6-19b064c1.js');
|
|
6
5
|
require('react');
|
|
7
6
|
require('classnames');
|
|
8
7
|
require('recharts');
|
|
9
|
-
require('./hooks/usePathBar/utils/getRadius.js');
|
|
10
|
-
require('./hooks/usePathBar/index.js');
|
|
11
8
|
require('./components/CustomizedLabel.js');
|
|
9
|
+
require('./hooks/usePathBar/index.js');
|
|
10
|
+
require('./hooks/usePathBar/utils/getRadius.js');
|
|
11
|
+
require('./components/Dot/index.js');
|
|
12
12
|
require('./icons/Point.js');
|
|
13
13
|
require('./components/Dot/index.module.css');
|
|
14
|
-
require('./components/
|
|
14
|
+
require('./components/Legends/index.js');
|
|
15
15
|
require('@alfalab/core-components-typography/cssm');
|
|
16
16
|
require('./icons/Circle.js');
|
|
17
17
|
require('./icons/CircleLine.js');
|
|
18
18
|
require('./icons/FilledCircle.js');
|
|
19
19
|
require('./icons/StrokeCircle.js');
|
|
20
20
|
require('./components/Legends/index.module.css');
|
|
21
|
-
require('./components/Legends/index.js');
|
|
22
21
|
require('./components/LinearGradient.js');
|
|
23
22
|
require('./components/RectBar.js');
|
|
24
|
-
require('./components/Tick/index.module.css');
|
|
25
23
|
require('./components/Tick/index.js');
|
|
26
|
-
require('./components/
|
|
24
|
+
require('./components/Tick/index.module.css');
|
|
27
25
|
require('./components/TooltipContent/index.js');
|
|
28
|
-
|
|
26
|
+
require('./components/TooltipContent/index.module.css');
|
|
27
|
+
require('./hooks/useSettings/index.js');
|
|
29
28
|
require('./hooks/useSettings/utils/setComposedChartsMargin.js');
|
|
30
29
|
require('./hooks/useSettings/utils/setDatas.js');
|
|
31
30
|
require('./hooks/useSettings/utils/setGradientCharts.js');
|
|
32
31
|
require('./hooks/useSettings/utils/setLegendMargin.js');
|
|
33
32
|
require('./hooks/useSettings/utils/sortByIndex.js');
|
|
34
|
-
require('./hooks/useSettings/index.js');
|
|
35
33
|
require('./index.module.css');
|
|
36
34
|
|
|
37
35
|
|
|
File without changes
|
|
File without changes
|
package/esm/Component.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { _ as __assign } from './tslib.es6-
|
|
1
|
+
import { _ as __assign } from './tslib.es6-c1e06c73.js';
|
|
2
2
|
import React, { useState, useRef, useMemo, useCallback, useEffect } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import { Legend, CartesianGrid, XAxis, YAxis, Brush, Tooltip, Area, Line, Bar, LabelList, Cell, ResponsiveContainer, ComposedChart } from 'recharts';
|
|
5
|
-
import './hooks/usePathBar/utils/getRadius.js';
|
|
6
|
-
import './hooks/usePathBar/index.js';
|
|
7
5
|
import { CustomizedLabel } from './components/CustomizedLabel.js';
|
|
8
|
-
import './icons/Point.js';
|
|
9
6
|
import { Dot } from './components/Dot/index.js';
|
|
10
|
-
import '@alfalab/core-components-typography/esm';
|
|
11
|
-
import './icons/Circle.js';
|
|
12
|
-
import './icons/CircleLine.js';
|
|
13
|
-
import './icons/FilledCircle.js';
|
|
14
|
-
import './icons/StrokeCircle.js';
|
|
15
7
|
import { Legends } from './components/Legends/index.js';
|
|
16
8
|
import { LinearGradient } from './components/LinearGradient.js';
|
|
17
9
|
import { RectBar } from './components/RectBar.js';
|
|
18
10
|
import { Tick } from './components/Tick/index.js';
|
|
19
11
|
import { TooltipContent } from './components/TooltipContent/index.js';
|
|
12
|
+
import { useSettings } from './hooks/useSettings/index.js';
|
|
13
|
+
import './hooks/usePathBar/index.js';
|
|
14
|
+
import './hooks/usePathBar/utils/getRadius.js';
|
|
15
|
+
import './icons/Point.js';
|
|
16
|
+
import '@alfalab/core-components-typography/esm';
|
|
17
|
+
import './icons/Circle.js';
|
|
18
|
+
import './icons/CircleLine.js';
|
|
19
|
+
import './icons/FilledCircle.js';
|
|
20
|
+
import './icons/StrokeCircle.js';
|
|
20
21
|
import './hooks/useSettings/utils/setComposedChartsMargin.js';
|
|
21
22
|
import './hooks/useSettings/utils/setDatas.js';
|
|
22
23
|
import './hooks/useSettings/utils/setGradientCharts.js';
|
|
23
24
|
import './hooks/useSettings/utils/setLegendMargin.js';
|
|
24
25
|
import './hooks/useSettings/utils/sortByIndex.js';
|
|
25
|
-
import { useSettings } from './hooks/useSettings/index.js';
|
|
26
26
|
|
|
27
27
|
var CustomizedHOC = function (Component, options) {
|
|
28
28
|
var NewComponent = function (props) { return React.createElement(Component, __assign({}, props, options)); };
|
|
29
29
|
return NewComponent;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
var styles = {"coreChart":"
|
|
32
|
+
var styles = {"coreChart":"chart__coreChart_14ne4","bar":"chart__bar_14ne4","unfocused":"chart__unfocused_14ne4"};
|
|
33
33
|
require('./index.css')
|
|
34
34
|
|
|
35
35
|
var Chart = function (props) {
|
|
@@ -52,18 +52,18 @@ var Chart = function (props) {
|
|
|
52
52
|
if (chart !== 'gradient' || !gradient)
|
|
53
53
|
return null;
|
|
54
54
|
var gid = gradient.gid, points = gradient.points;
|
|
55
|
-
return (React.createElement(LinearGradient, { key: state.id
|
|
55
|
+
return (React.createElement(LinearGradient, { key: "".concat(state.id, "-").concat(gid), id: state.id, gid: gid, points: points }));
|
|
56
56
|
});
|
|
57
57
|
}, [state]);
|
|
58
58
|
var toggleChart = useCallback(function (item) {
|
|
59
59
|
var chart = item.chart, dataKey = item.properties.dataKey;
|
|
60
60
|
var withGrad = chart === 'area';
|
|
61
61
|
var changed = false;
|
|
62
|
-
if (charts[""
|
|
62
|
+
if (charts["".concat(dataKey)] && filterCount > 1) {
|
|
63
63
|
changed = true;
|
|
64
64
|
setFilterCount(function (prev) { return prev - 1; });
|
|
65
65
|
}
|
|
66
|
-
if (!charts[""
|
|
66
|
+
if (!charts["".concat(dataKey)]) {
|
|
67
67
|
changed = true;
|
|
68
68
|
setFilterCount(function (prev) { return prev + 1; });
|
|
69
69
|
}
|
|
@@ -71,9 +71,9 @@ var Chart = function (props) {
|
|
|
71
71
|
return;
|
|
72
72
|
setCharts(function (prev) {
|
|
73
73
|
var newState = __assign({}, prev);
|
|
74
|
-
newState[""
|
|
74
|
+
newState["".concat(dataKey)] = !newState["".concat(dataKey)];
|
|
75
75
|
if (withGrad)
|
|
76
|
-
newState[dataKey
|
|
76
|
+
newState["".concat(dataKey, "-gradient")] = !newState["".concat(dataKey, "-gradient")];
|
|
77
77
|
return newState;
|
|
78
78
|
});
|
|
79
79
|
}, [charts, filterCount, setCharts, setFilterCount]);
|
|
@@ -93,7 +93,7 @@ var Chart = function (props) {
|
|
|
93
93
|
? state.xAxis.tickMargin + (((_c = state === null || state === void 0 ? void 0 : state.brush) === null || _c === void 0 ? void 0 : _c.brushMargin) || 0)
|
|
94
94
|
: 0;
|
|
95
95
|
return (React.createElement(Legend, __assign({}, (state.legend || null), { content: React.createElement(Legends, { legend: state.legend, series: state.series, id: state.id, toggleChart: toggleChart, ref: legendRef, charts: charts }), wrapperStyle: {
|
|
96
|
-
transform: "translateY("
|
|
96
|
+
transform: "translateY(".concat(translate, "px)"),
|
|
97
97
|
} })));
|
|
98
98
|
}, [state, charts, toggleChart, legendRef]);
|
|
99
99
|
var renderCartesianGrid = useMemo(function () {
|
|
@@ -148,13 +148,13 @@ var Chart = function (props) {
|
|
|
148
148
|
return null;
|
|
149
149
|
return state.series.map(function (item) {
|
|
150
150
|
var chart = item.chart, properties = item.properties, radius = item.radius, labelList = item.labelList;
|
|
151
|
-
var show = charts[""
|
|
151
|
+
var show = charts["".concat(properties.dataKey)];
|
|
152
152
|
switch (chart) {
|
|
153
153
|
case 'bar':
|
|
154
|
-
return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React.createElement(Bar, __assign({ key: state.id
|
|
154
|
+
return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React.createElement(Bar, __assign({ key: "".concat(state.id, "-").concat(properties.dataKey) }, properties, { shape: React.createElement(RectBar, { radius: radius }) }),
|
|
155
155
|
labelList && (React.createElement(LabelList, __assign({ dataKey: properties.dataKey.toString() }, labelList, { content: React.createElement(CustomizedLabel, { radius: radius }) }))),
|
|
156
156
|
data.map(function (_, index) {
|
|
157
|
-
var key = state.id
|
|
157
|
+
var key = "".concat(state.id, "-").concat(properties.dataKey, "-").concat(index);
|
|
158
158
|
return (React.createElement(Cell, { key: key, className: cn(styles.bar, typeof activeDotsState.active === 'number' &&
|
|
159
159
|
activeDotsState.active !== index
|
|
160
160
|
? styles.unfocused
|
|
@@ -162,7 +162,7 @@ var Chart = function (props) {
|
|
|
162
162
|
}))) : null;
|
|
163
163
|
case 'area':
|
|
164
164
|
case 'line':
|
|
165
|
-
return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React.createElement(Line, __assign({ key: state.id
|
|
165
|
+
return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React.createElement(Line, __assign({ key: "".concat(state.id, "-").concat(properties.dataKey) }, properties, { dot: properties.dot && properties.dotSettings
|
|
166
166
|
? CustomizedHOC(Dot, {
|
|
167
167
|
activeDot: activeDotsState.active,
|
|
168
168
|
dotSettings: properties.dotSettings,
|
|
@@ -172,8 +172,8 @@ var Chart = function (props) {
|
|
|
172
172
|
})
|
|
173
173
|
: false, activeDot: false }))) : null;
|
|
174
174
|
case 'gradient':
|
|
175
|
-
return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React.createElement(Area, __assign({}, item.properties, { key: state.id
|
|
176
|
-
? "url(#"
|
|
175
|
+
return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React.createElement(Area, __assign({}, item.properties, { key: "".concat(state.id, "-").concat(item.properties.dataKey), dataKey: "".concat(item.properties.dataKey), stroke: 'transparent', fill: item.gradient.gid
|
|
176
|
+
? "url(#".concat(state.id, "-").concat(item.gradient.gid, ")")
|
|
177
177
|
: item.properties.fill, dot: false, activeDot: false }))) : null;
|
|
178
178
|
default:
|
|
179
179
|
return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import '../hooks/usePathBar/utils/getRadius.js';
|
|
3
2
|
import { usePathBar } from '../hooks/usePathBar/index.js';
|
|
3
|
+
import '../hooks/usePathBar/utils/getRadius.js';
|
|
4
4
|
|
|
5
5
|
var CustomizedLabel = function (_a) {
|
|
6
6
|
var x = _a.x, y = _a.y, value = _a.value, offset = _a.offset, radius = _a.radius, height = _a.height, width = _a.width, formatter = _a.formatter;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
.
|
|
1
|
+
/* hash: 1vmhq */
|
|
2
|
+
.chart__dotUnfocused_1u9no {
|
|
3
3
|
opacity: 0.3;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
7
|
-
.
|
|
8
|
-
.
|
|
6
|
+
.chart__dot_1u9no,
|
|
7
|
+
.chart__dotItem_1u9no,
|
|
8
|
+
.chart__dotWrap_1u9no {
|
|
9
9
|
transition: all 0.2s ease;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
.
|
|
13
|
-
animation:
|
|
12
|
+
.chart__dot_1u9no {
|
|
13
|
+
animation: chart__showDot_1u9no 0.5s ease;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
@keyframes
|
|
16
|
+
@keyframes chart__showDot_1u9no {
|
|
17
17
|
from {
|
|
18
18
|
opacity: 0;
|
|
19
19
|
}
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { PointIcon } from '../../icons/Point.js';
|
|
4
4
|
|
|
5
|
-
var styles = {"dotUnfocused":"
|
|
5
|
+
var styles = {"dotUnfocused":"chart__dotUnfocused_1u9no","dot":"chart__dot_1u9no","dotItem":"chart__dotItem_1u9no","dotWrap":"chart__dotWrap_1u9no","showDot":"chart__showDot_1u9no"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var Dot = React.forwardRef(function (_a, ref) {
|
|
@@ -35,8 +35,8 @@ var Dot = React.forwardRef(function (_a, ref) {
|
|
|
35
35
|
}, [activeDot, index, option]);
|
|
36
36
|
if (!value)
|
|
37
37
|
return null;
|
|
38
|
-
return (React.createElement("g", { ref: ref, className: cn(styles.dot), transform: "translate("
|
|
39
|
-
React.createElement("g", { className: cn(styles.dotWrap), transform: "scale("
|
|
38
|
+
return (React.createElement("g", { ref: ref, className: cn(styles.dot), transform: "translate(".concat(cx - width / 2, ", ").concat(cy - height / 2, ")") },
|
|
39
|
+
React.createElement("g", { className: cn(styles.dotWrap), transform: "scale(".concat(activeDot === index ? (option === null || option === void 0 ? void 0 : option.scale) || 0 : (option === null || option === void 0 ? void 0 : option.initScale) || 0, ")") },
|
|
40
40
|
React.createElement("svg", { className: cn(styles.dotItem, activeDot === index ? styles.dotActive : '', typeof activeDot === 'number' && activeDot !== index
|
|
41
41
|
? styles.dotUnfocused
|
|
42
42
|
: ''), "data-id": index, "data-name": dataKey, width: (option === null || option === void 0 ? void 0 : option.width) || 0, height: (option === null || option === void 0 ? void 0 : option.height) || 0 },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1gmkt */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -10,31 +10,31 @@
|
|
|
10
10
|
:root {
|
|
11
11
|
--gap-2xl: 32px;
|
|
12
12
|
}
|
|
13
|
-
.
|
|
13
|
+
.chart__legendContent_nx6sz {
|
|
14
14
|
display: flex;
|
|
15
15
|
align-items: center;
|
|
16
16
|
flex-wrap: wrap;
|
|
17
17
|
}
|
|
18
|
-
.
|
|
18
|
+
.chart__legendWrap_nx6sz {
|
|
19
19
|
width: 100%;
|
|
20
20
|
margin: 0;
|
|
21
21
|
padding: 0;
|
|
22
22
|
}
|
|
23
|
-
.
|
|
23
|
+
.chart__legendItem_nx6sz {
|
|
24
24
|
margin-right: var(--gap-2xl);
|
|
25
25
|
cursor: pointer;
|
|
26
26
|
display: inline-block;
|
|
27
27
|
}
|
|
28
|
-
.
|
|
28
|
+
.chart__legendItem_nx6sz:last-child {
|
|
29
29
|
margin-right: 0;
|
|
30
30
|
}
|
|
31
|
-
.
|
|
31
|
+
.chart__legendUnactive_nx6sz {
|
|
32
32
|
opacity: 0.3;
|
|
33
33
|
}
|
|
34
|
-
.
|
|
34
|
+
.chart__legendIcon_nx6sz {
|
|
35
35
|
margin-right: 13px;
|
|
36
36
|
display: flex;
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.chart__legendValue_nx6sz {
|
|
39
39
|
text-transform: capitalize;
|
|
40
40
|
}
|
|
@@ -6,7 +6,7 @@ import { CircleLineIcon } from '../../icons/CircleLine.js';
|
|
|
6
6
|
import { FilledCircleIcon } from '../../icons/FilledCircle.js';
|
|
7
7
|
import { StrokeCircleIcon } from '../../icons/StrokeCircle.js';
|
|
8
8
|
|
|
9
|
-
var styles = {"legendContent":"
|
|
9
|
+
var styles = {"legendContent":"chart__legendContent_nx6sz","legendWrap":"chart__legendWrap_nx6sz","legendItem":"chart__legendItem_nx6sz","legendUnactive":"chart__legendUnactive_nx6sz","legendIcon":"chart__legendIcon_nx6sz","legendValue":"chart__legendValue_nx6sz"};
|
|
10
10
|
require('./index.css')
|
|
11
11
|
|
|
12
12
|
var icons = {
|
|
@@ -19,15 +19,15 @@ var Legends = React.forwardRef(function (_a, ref) {
|
|
|
19
19
|
var legend = _a.legend, series = _a.series, id = _a.id, charts = _a.charts, toggleChart = _a.toggleChart;
|
|
20
20
|
var style = {
|
|
21
21
|
textAlign: legend.align || 'center',
|
|
22
|
-
transform: "translateY("
|
|
23
|
-
(legend.verticalAlign === 'top' ? -1 : 1)
|
|
22
|
+
transform: "translateY(".concat(((legend === null || legend === void 0 ? void 0 : legend.marginTop) ? legend.marginTop : 0) *
|
|
23
|
+
(legend.verticalAlign === 'top' ? -1 : 1), "px)"),
|
|
24
24
|
};
|
|
25
25
|
return (React.createElement("ul", { ref: ref, className: cn(styles.legendWrap), style: style }, series.map(function (item) {
|
|
26
26
|
var _a, _b;
|
|
27
27
|
if (item.hideLegend || item.hide)
|
|
28
28
|
return null;
|
|
29
29
|
var Icon = icons[item.icon] || CircleIcon;
|
|
30
|
-
return (React.createElement("li", { role: 'presentation', key: id
|
|
30
|
+
return (React.createElement("li", { role: 'presentation', key: "".concat(id, "-").concat(item.properties.dataKey), className: cn(styles.legendItem, charts["".concat(item.properties.dataKey)] ? '' : styles.legendUnactive), onClick: function () { return toggleChart(item); } },
|
|
31
31
|
React.createElement("div", { className: cn(styles.legendContent) },
|
|
32
32
|
Icon ? (React.createElement("i", { className: cn(styles.legendIcon) },
|
|
33
33
|
React.createElement(Icon, { fill: ((_a = item.properties) === null || _a === void 0 ? void 0 : _a.fill) ||
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
var LinearGradient = function (_a) {
|
|
4
4
|
var id = _a.id, gid = _a.gid, points = _a.points;
|
|
5
|
-
return (React.createElement("linearGradient", { key: id
|
|
5
|
+
return (React.createElement("linearGradient", { key: "".concat(id, "-").concat(gid), id: "".concat(id, "-").concat(gid), x1: '0', y1: '0', x2: '0', y2: '1' }, points.map(function (point, index) { return (React.createElement("stop", { key: "".concat(id).concat(gid, "-").concat(index.toString()), offset: "".concat(point.offset, "%"), stopColor: point.stopColor, stopOpacity: point.stopOpacity })); })));
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export { LinearGradient };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import '../hooks/usePathBar/utils/getRadius.js';
|
|
3
2
|
import { usePathBar } from '../hooks/usePathBar/index.js';
|
|
3
|
+
import '../hooks/usePathBar/utils/getRadius.js';
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line complexity
|
|
6
6
|
var getPath = function (x, width, height, initHeight, topRadius, bottomRadius, initY) {
|
|
7
|
-
return "\n M"
|
|
7
|
+
return "\n M".concat(x + ((height !== 0 && bottomRadius) || 0), " ").concat(initY + initHeight || 0, "\n Q").concat(x, " ").concat(initY + initHeight, " ").concat(x, " ").concat(initY + initHeight - ((height !== 0 && bottomRadius) || 0), "\n L").concat(x, " ").concat(initY + ((height !== 0 && topRadius) || 0), "\n Q").concat(x, " ").concat(initY, " ").concat(x + ((height !== 0 && topRadius) || 0), " ").concat(initY, "\n L").concat(x + width - ((height !== 0 && topRadius) || 0), " ").concat(initY, "\n Q").concat(x + width, " ").concat(initY, " ").concat(x + width, " ").concat(initY + (topRadius || 0), "\n L").concat(x + width, " ").concat(initY + initHeight - ((height !== 0 && bottomRadius) || 0), "\n Q").concat(x + width, " ").concat(initY + initHeight, " ").concat(x + width - ((height !== 0 && bottomRadius) || 0), " ").concat(initY + initHeight, "\n Z\n ");
|
|
8
8
|
};
|
|
9
9
|
var RectBar = function (_a) {
|
|
10
10
|
var fill = _a.fill, x = _a.x, y = _a.y, width = _a.width, height = _a.height, radius = _a.radius, background = _a.background;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 2ftiy */
|
|
2
2
|
:root {
|
|
3
3
|
--color-dark-bg-primary: #0b1f35;
|
|
4
4
|
--color-light-text-primary: #0b1f35;
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
|
|
12
12
|
/* Hard up */
|
|
13
13
|
}
|
|
14
|
-
.
|
|
14
|
+
.chart__tickText_13q5p {
|
|
15
15
|
fill: var(--color-light-text-primary);
|
|
16
16
|
font-size: 16px;
|
|
17
17
|
line-height: 24px;
|
|
18
18
|
font-weight: 400;
|
|
19
19
|
}
|
|
20
|
-
.
|
|
20
|
+
.chart__circle_13q5p {
|
|
21
21
|
opacity: 0.3;
|
|
22
22
|
fill: var(--color-dark-bg-primary);
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.chart__circle_13q5p {
|
|
25
25
|
opacity: 0.3;
|
|
26
26
|
fill: var(--color-dark-bg-primary);
|
|
27
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
-
var styles = {"tickText":"
|
|
4
|
+
var styles = {"tickText":"chart__tickText_13q5p","circle":"chart__circle_13q5p"};
|
|
5
5
|
require('./index.css')
|
|
6
6
|
|
|
7
7
|
var Tick = function (_a) {
|
|
@@ -11,7 +11,7 @@ var Tick = function (_a) {
|
|
|
11
11
|
(xAxis.tickMargin > 0 ? xAxis.tickMargin - radius / 2 : xAxis.tickMargin === 0)
|
|
12
12
|
? (radius / 2) * -1
|
|
13
13
|
: null;
|
|
14
|
-
return (React.createElement("g", { className: cn(styles.tick), opacity: '1', textAnchor: 'middle', transform: "translate("
|
|
14
|
+
return (React.createElement("g", { className: cn(styles.tick), opacity: '1', textAnchor: 'middle', transform: "translate(".concat(payload.coordinate, ", ").concat(y - (typeof marginTick === 'number' ? marginTick : 0) - radius * 2, ")") },
|
|
15
15
|
React.createElement("text", { className: cn(styles.tickText), y: '30' }, tickFormatter ? tickFormatter(payload.value) : payload.value),
|
|
16
16
|
React.createElement("circle", { r: radius, className: cn(styles.circle) })));
|
|
17
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: yxflg */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-border-primary: #dbdee1;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
:root {
|
|
20
20
|
--border-radius-m: 8px;
|
|
21
21
|
}
|
|
22
|
-
.
|
|
22
|
+
.chart__tooltip_4pmy3 {
|
|
23
23
|
background-color: var(--color-light-bg-primary);
|
|
24
24
|
border: 1px solid var(--color-light-border-primary);
|
|
25
25
|
box-shadow: var(--shadow-l);
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
pointer-events: none;
|
|
29
29
|
position: relative;
|
|
30
30
|
}
|
|
31
|
-
.
|
|
31
|
+
.chart__tooltipList_4pmy3 {
|
|
32
32
|
position: relative;
|
|
33
33
|
z-index: 5;
|
|
34
34
|
list-style-type: none;
|
|
35
35
|
padding: 0;
|
|
36
36
|
margin: 0;
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.chart__tooltipItem_4pmy3 {
|
|
39
39
|
margin-bottom: 10px;
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.chart__tooltipArrow_4pmy3 {
|
|
42
42
|
position: absolute;
|
|
43
43
|
left: 0;
|
|
44
44
|
top: 50%;
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
border: 1px solid var(--color-light-border-primary);
|
|
49
49
|
background-color: var(--color-light-bg-primary);
|
|
50
50
|
}
|
|
51
|
-
.
|
|
51
|
+
.chart__tooltipArrow_4pmy3:before {
|
|
52
52
|
content: '';
|
|
53
53
|
position: absolute;
|
|
54
54
|
left: -2px;
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
border-width: 0 24px 24px 0;
|
|
60
60
|
border-color: transparent var(--color-light-bg-primary) transparent transparent;
|
|
61
61
|
}
|
|
62
|
-
.
|
|
62
|
+
.chart__tooltipArrowRight_4pmy3 {
|
|
63
63
|
left: 100%;
|
|
64
64
|
transform: translate(-50%, -50%) scale(-1, 1) rotate(45deg);
|
|
65
65
|
}
|