@pie-lib/graphing 2.4.3-next.362 → 2.4.3-next.406
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/lib/axis/arrow.js +15 -25
- package/lib/axis/arrow.js.map +1 -1
- package/lib/axis/axes.js +41 -73
- package/lib/axis/axes.js.map +1 -1
- package/lib/axis/index.js +1 -1
- package/lib/bg.js +20 -31
- package/lib/bg.js.map +1 -1
- package/lib/container/index.js +27 -41
- package/lib/container/index.js.map +1 -1
- package/lib/container/reducer.js +2 -2
- package/lib/container/reducer.js.map +1 -1
- package/lib/coordinates-label.js +5 -5
- package/lib/coordinates-label.js.map +1 -1
- package/lib/graph-with-controls.js +26 -37
- package/lib/graph-with-controls.js.map +1 -1
- package/lib/graph.js +43 -69
- package/lib/graph.js.map +1 -1
- package/lib/grid-setup.js +6 -6
- package/lib/grid-setup.js.map +1 -1
- package/lib/grid.js +28 -46
- package/lib/grid.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/labels.js +22 -38
- package/lib/labels.js.map +1 -1
- package/lib/mark-label.js +10 -20
- package/lib/mark-label.js.map +1 -1
- package/lib/toggle-bar.js +22 -33
- package/lib/toggle-bar.js.map +1 -1
- package/lib/tool-menu.js +21 -32
- package/lib/tool-menu.js.map +1 -1
- package/lib/tools/circle/bg-circle.js +27 -38
- package/lib/tools/circle/bg-circle.js.map +1 -1
- package/lib/tools/circle/component.js +36 -54
- package/lib/tools/circle/component.js.map +1 -1
- package/lib/tools/circle/index.js +5 -5
- package/lib/tools/circle/index.js.map +1 -1
- package/lib/tools/line/component.js +11 -25
- package/lib/tools/line/component.js.map +1 -1
- package/lib/tools/line/index.js +2 -2
- package/lib/tools/line/index.js.map +1 -1
- package/lib/tools/parabola/component.js +2 -2
- package/lib/tools/parabola/component.js.map +1 -1
- package/lib/tools/parabola/index.js +5 -5
- package/lib/tools/parabola/index.js.map +1 -1
- package/lib/tools/point/component.js +30 -47
- package/lib/tools/point/component.js.map +1 -1
- package/lib/tools/point/index.js +5 -5
- package/lib/tools/point/index.js.map +1 -1
- package/lib/tools/polygon/component.js +59 -107
- package/lib/tools/polygon/component.js.map +1 -1
- package/lib/tools/polygon/index.js +9 -19
- package/lib/tools/polygon/index.js.map +1 -1
- package/lib/tools/polygon/line.js +28 -41
- package/lib/tools/polygon/line.js.map +1 -1
- package/lib/tools/polygon/polygon.js +28 -42
- package/lib/tools/polygon/polygon.js.map +1 -1
- package/lib/tools/ray/component.js +11 -25
- package/lib/tools/ray/component.js.map +1 -1
- package/lib/tools/ray/index.js +2 -2
- package/lib/tools/ray/index.js.map +1 -1
- package/lib/tools/segment/component.js +8 -11
- package/lib/tools/segment/component.js.map +1 -1
- package/lib/tools/segment/index.js +2 -2
- package/lib/tools/segment/index.js.map +1 -1
- package/lib/tools/shared/arrow-head.js +2 -2
- package/lib/tools/shared/arrow-head.js.map +1 -1
- package/lib/tools/shared/line/index.js +43 -66
- package/lib/tools/shared/line/index.js.map +1 -1
- package/lib/tools/shared/line/line-path.js +29 -42
- package/lib/tools/shared/line/line-path.js.map +1 -1
- package/lib/tools/shared/line/with-root-edge.js +12 -14
- package/lib/tools/shared/line/with-root-edge.js.map +1 -1
- package/lib/tools/shared/point/arrow-point.js +24 -39
- package/lib/tools/shared/point/arrow-point.js.map +1 -1
- package/lib/tools/shared/point/arrow.js +23 -37
- package/lib/tools/shared/point/arrow.js.map +1 -1
- package/lib/tools/shared/point/base-point.js +24 -38
- package/lib/tools/shared/point/base-point.js.map +1 -1
- package/lib/tools/shared/point/index.js +6 -6
- package/lib/tools/shared/point/index.js.map +1 -1
- package/lib/tools/shared/styles.js +7 -5
- package/lib/tools/shared/styles.js.map +1 -1
- package/lib/tools/shared/types.js +2 -2
- package/lib/tools/shared/types.js.map +1 -1
- package/lib/tools/sine/component.js +2 -2
- package/lib/tools/sine/component.js.map +1 -1
- package/lib/tools/sine/index.js +5 -5
- package/lib/tools/sine/index.js.map +1 -1
- package/lib/tools/vector/component.js +8 -11
- package/lib/tools/vector/component.js.map +1 -1
- package/lib/tools/vector/index.js +2 -2
- package/lib/tools/vector/index.js.map +1 -1
- package/lib/undo-redo.js +19 -31
- package/lib/undo-redo.js.map +1 -1
- package/lib/use-debounce.js +5 -13
- package/lib/use-debounce.js.map +1 -1
- package/lib/utils.js +2 -2
- package/lib/utils.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,68 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
|
-
var _plot = require("@pie-lib/plot");
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
11
|
|
|
18
|
-
var
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
19
13
|
|
|
20
|
-
var
|
|
14
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
15
|
|
|
22
|
-
var
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
27
21
|
|
|
28
|
-
|
|
22
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
var _react = _interopRequireDefault(require("react"));
|
|
33
27
|
|
|
34
|
-
|
|
28
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
37
31
|
|
|
38
|
-
|
|
32
|
+
var _plot = require("@pie-lib/plot");
|
|
39
33
|
|
|
40
|
-
|
|
34
|
+
var _arrowHead = require("../arrow-head");
|
|
41
35
|
|
|
42
|
-
|
|
36
|
+
var _utils = require("../../../utils");
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
var _excluded = ["classes", "angle", "className", "x", "y", "disabled", "correctness", "graphProps"];
|
|
45
39
|
|
|
46
|
-
function
|
|
40
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
47
41
|
|
|
48
42
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
49
43
|
|
|
50
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
|
-
|
|
52
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
53
|
-
|
|
54
44
|
var Arrow = /*#__PURE__*/function (_React$Component) {
|
|
55
|
-
|
|
45
|
+
(0, _inherits2["default"])(Arrow, _React$Component);
|
|
56
46
|
|
|
57
47
|
var _super = _createSuper(Arrow);
|
|
58
48
|
|
|
59
49
|
function Arrow() {
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
(0, _classCallCheck2["default"])(this, Arrow);
|
|
62
51
|
return _super.apply(this, arguments);
|
|
63
52
|
}
|
|
64
53
|
|
|
65
|
-
|
|
54
|
+
(0, _createClass2["default"])(Arrow, [{
|
|
66
55
|
key: "render",
|
|
67
56
|
value: function render() {
|
|
68
57
|
var _this$props = this.props,
|
|
@@ -74,15 +63,14 @@ var Arrow = /*#__PURE__*/function (_React$Component) {
|
|
|
74
63
|
disabled = _this$props.disabled,
|
|
75
64
|
correctness = _this$props.correctness,
|
|
76
65
|
graphProps = _this$props.graphProps,
|
|
77
|
-
rest =
|
|
78
|
-
|
|
66
|
+
rest = (0, _objectWithoutProperties2["default"])(_this$props, _excluded);
|
|
79
67
|
var size = (0, _utils.thinnerShapesNeeded)(graphProps) ? 12 : 14;
|
|
80
68
|
var scale = graphProps.scale;
|
|
81
69
|
var scaledX = scale.x(x);
|
|
82
70
|
var scaledY = scale.y(y);
|
|
83
71
|
var transform = "rotate(".concat(-angle, ", ").concat(scaledX, ",").concat(scaledY, ")");
|
|
84
72
|
var points = "".concat(scaledX, ",").concat(scaledY, "\n ").concat(scaledX - size, ",").concat(scaledY - size / 2, "\n ").concat(scaledX - size, ", ").concat(scaledY + size / 2);
|
|
85
|
-
return /*#__PURE__*/_react["default"].createElement("g",
|
|
73
|
+
return /*#__PURE__*/_react["default"].createElement("g", (0, _extends2["default"])({
|
|
86
74
|
className: (0, _classnames["default"])(classes.point, disabled && classes.disabled, classes[correctness], className)
|
|
87
75
|
}, rest), /*#__PURE__*/_react["default"].createElement(_arrowHead.ArrowHead, {
|
|
88
76
|
size: size,
|
|
@@ -91,13 +79,11 @@ var Arrow = /*#__PURE__*/function (_React$Component) {
|
|
|
91
79
|
}));
|
|
92
80
|
}
|
|
93
81
|
}]);
|
|
94
|
-
|
|
95
82
|
return Arrow;
|
|
96
83
|
}(_react["default"].Component);
|
|
97
84
|
|
|
98
85
|
exports["default"] = Arrow;
|
|
99
|
-
|
|
100
|
-
_defineProperty(Arrow, "propTypes", {
|
|
86
|
+
(0, _defineProperty2["default"])(Arrow, "propTypes", {
|
|
101
87
|
classes: _propTypes["default"].object,
|
|
102
88
|
className: _propTypes["default"].string,
|
|
103
89
|
correctness: _propTypes["default"].string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow.js","names":["Arrow","props","classes","angle","className","x","y","disabled","correctness","graphProps","rest","size","thinnerShapesNeeded","scale","scaledX","scaledY","transform","points","classNames","point","React","Component","PropTypes","object","string","bool","number","isRequired","types","GraphPropsType"],"sources":["../../../../src/tools/shared/point/arrow.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { types } from '@pie-lib/plot';\nimport { ArrowHead } from '../arrow-head';\nimport { thinnerShapesNeeded } from '../../../utils';\n\nexport default class Arrow extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n className: PropTypes.string,\n correctness: PropTypes.string,\n disabled: PropTypes.bool,\n x: PropTypes.number.isRequired,\n y: PropTypes.number.isRequired,\n angle: PropTypes.number.isRequired,\n graphProps: types.GraphPropsType.isRequired\n };\n\n render() {\n const {\n classes,\n angle,\n className,\n x,\n y,\n disabled,\n correctness,\n graphProps,\n ...rest\n } = this.props;\n\n const size = thinnerShapesNeeded(graphProps) ? 12 : 14;\n const { scale } = graphProps;\n\n const scaledX = scale.x(x);\n const scaledY = scale.y(y);\n\n const transform = `rotate(${-angle}, ${scaledX},${scaledY})`;\n const points = `${scaledX},${scaledY}\n ${scaledX - size},${scaledY - size / 2}\n ${scaledX - size}, ${scaledY + size / 2}`;\n\n return (\n <g\n className={classNames(\n classes.point,\n disabled && classes.disabled,\n classes[correctness],\n className\n )}\n {...rest}\n >\n <ArrowHead size={size} transform={transform} points={points} />\n </g>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrow.js","names":["Arrow","props","classes","angle","className","x","y","disabled","correctness","graphProps","rest","size","thinnerShapesNeeded","scale","scaledX","scaledY","transform","points","classNames","point","React","Component","PropTypes","object","string","bool","number","isRequired","types","GraphPropsType"],"sources":["../../../../src/tools/shared/point/arrow.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { types } from '@pie-lib/plot';\nimport { ArrowHead } from '../arrow-head';\nimport { thinnerShapesNeeded } from '../../../utils';\n\nexport default class Arrow extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n className: PropTypes.string,\n correctness: PropTypes.string,\n disabled: PropTypes.bool,\n x: PropTypes.number.isRequired,\n y: PropTypes.number.isRequired,\n angle: PropTypes.number.isRequired,\n graphProps: types.GraphPropsType.isRequired\n };\n\n render() {\n const {\n classes,\n angle,\n className,\n x,\n y,\n disabled,\n correctness,\n graphProps,\n ...rest\n } = this.props;\n\n const size = thinnerShapesNeeded(graphProps) ? 12 : 14;\n const { scale } = graphProps;\n\n const scaledX = scale.x(x);\n const scaledY = scale.y(y);\n\n const transform = `rotate(${-angle}, ${scaledX},${scaledY})`;\n const points = `${scaledX},${scaledY}\n ${scaledX - size},${scaledY - size / 2}\n ${scaledX - size}, ${scaledY + size / 2}`;\n\n return (\n <g\n className={classNames(\n classes.point,\n disabled && classes.disabled,\n classes[correctness],\n className\n )}\n {...rest}\n >\n <ArrowHead size={size} transform={transform} points={points} />\n </g>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,K;;;;;;;;;;;;WAYn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E,MAFJ;EAGjBhB,WAAW,EAAEc,qBAAA,CAAUE,MAHN;EAIjBjB,QAAQ,EAAEe,qBAAA,CAAUG,IAJH;EAKjBpB,CAAC,EAAEiB,qBAAA,CAAUI,MAAV,CAAiBC,UALH;EAMjBrB,CAAC,EAAEgB,qBAAA,CAAUI,MAAV,CAAiBC,UANH;EAOjBxB,KAAK,EAAEmB,qBAAA,CAAUI,MAAV,CAAiBC,UAPP;EAQjBlB,UAAU,EAAEmB,WAAA,CAAMC,cAAN,CAAqBF;AARhB,C"}
|
|
@@ -1,68 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.RawBp = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
23
|
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
-
|
|
28
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
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; }
|
|
26
|
+
var _react = _interopRequireDefault(require("react"));
|
|
33
27
|
|
|
34
|
-
|
|
28
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
37
31
|
|
|
38
|
-
|
|
32
|
+
var _plot = require("@pie-lib/plot");
|
|
39
33
|
|
|
40
|
-
|
|
34
|
+
var _coordinatesLabel = _interopRequireDefault(require("../../../coordinates-label"));
|
|
41
35
|
|
|
42
|
-
|
|
36
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
var _utils = require("../../../utils");
|
|
45
39
|
|
|
46
|
-
|
|
40
|
+
var _excluded = ["classes", "className", "coordinatesOnHover", "x", "y", "disabled", "correctness", "graphProps", "labelNode"];
|
|
47
41
|
|
|
48
|
-
function
|
|
42
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
49
43
|
|
|
50
44
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
51
45
|
|
|
52
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
53
|
-
|
|
54
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
55
|
-
|
|
56
46
|
var RawBp = /*#__PURE__*/function (_React$Component) {
|
|
57
|
-
|
|
47
|
+
(0, _inherits2["default"])(RawBp, _React$Component);
|
|
58
48
|
|
|
59
49
|
var _super = _createSuper(RawBp);
|
|
60
50
|
|
|
61
51
|
function RawBp(props) {
|
|
62
52
|
var _this;
|
|
63
53
|
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
(0, _classCallCheck2["default"])(this, RawBp);
|
|
66
55
|
_this = _super.call(this, props);
|
|
67
56
|
_this.state = {
|
|
68
57
|
showCoordinates: false
|
|
@@ -70,7 +59,7 @@ var RawBp = /*#__PURE__*/function (_React$Component) {
|
|
|
70
59
|
return _this;
|
|
71
60
|
}
|
|
72
61
|
|
|
73
|
-
|
|
62
|
+
(0, _createClass2["default"])(RawBp, [{
|
|
74
63
|
key: "render",
|
|
75
64
|
value: function render() {
|
|
76
65
|
var _this2 = this;
|
|
@@ -85,12 +74,11 @@ var RawBp = /*#__PURE__*/function (_React$Component) {
|
|
|
85
74
|
correctness = _this$props.correctness,
|
|
86
75
|
graphProps = _this$props.graphProps,
|
|
87
76
|
labelNode = _this$props.labelNode,
|
|
88
|
-
rest =
|
|
89
|
-
|
|
77
|
+
rest = (0, _objectWithoutProperties2["default"])(_this$props, _excluded);
|
|
90
78
|
var showCoordinates = this.state.showCoordinates;
|
|
91
79
|
var scale = graphProps.scale;
|
|
92
80
|
var r = (0, _utils.thinnerShapesNeeded)(graphProps) ? 5 : 7;
|
|
93
|
-
return /*#__PURE__*/_react["default"].createElement("g",
|
|
81
|
+
return /*#__PURE__*/_react["default"].createElement("g", (0, _extends2["default"])({
|
|
94
82
|
className: (0, _classnames["default"])(classes.point, disabled && classes.disabled, classes[correctness], className),
|
|
95
83
|
onMouseEnter: function onMouseEnter() {
|
|
96
84
|
return _this2.setState({
|
|
@@ -113,13 +101,11 @@ var RawBp = /*#__PURE__*/function (_React$Component) {
|
|
|
113
101
|
}), labelNode));
|
|
114
102
|
}
|
|
115
103
|
}]);
|
|
116
|
-
|
|
117
104
|
return RawBp;
|
|
118
105
|
}(_react["default"].Component);
|
|
119
106
|
|
|
120
107
|
exports.RawBp = RawBp;
|
|
121
|
-
|
|
122
|
-
_defineProperty(RawBp, "propTypes", {
|
|
108
|
+
(0, _defineProperty2["default"])(RawBp, "propTypes", {
|
|
123
109
|
classes: _propTypes["default"].object,
|
|
124
110
|
className: _propTypes["default"].string,
|
|
125
111
|
coordinatesOnHover: _propTypes["default"].bool,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-point.js","names":["RawBp","props","state","showCoordinates","classes","className","coordinatesOnHover","x","y","disabled","correctness","graphProps","labelNode","rest","scale","r","thinnerShapesNeeded","classNames","point","setState","ReactDOM","createPortal","React","Component","PropTypes","object","string","bool","number","types","GraphPropsType","isRequired"],"sources":["../../../../src/tools/shared/point/base-point.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { types } from '@pie-lib/plot';\nimport CoordinatesLabel from '../../../coordinates-label';\nimport ReactDOM from 'react-dom';\nimport { thinnerShapesNeeded } from '../../../utils';\n\nexport class RawBp extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n className: PropTypes.string,\n coordinatesOnHover: PropTypes.bool,\n correctness: PropTypes.string,\n disabled: PropTypes.bool,\n labelNode: PropTypes.object,\n x: PropTypes.number,\n y: PropTypes.number,\n graphProps: types.GraphPropsType.isRequired\n };\n\n constructor(props) {\n super(props);\n this.state = { showCoordinates: false };\n }\n\n render() {\n const {\n classes,\n className,\n coordinatesOnHover,\n x,\n y,\n disabled,\n correctness,\n graphProps,\n labelNode,\n ...rest\n } = this.props;\n const { showCoordinates } = this.state;\n const { scale } = graphProps;\n const r = thinnerShapesNeeded(graphProps) ? 5 : 7;\n\n return (\n <g\n className={classNames(\n classes.point,\n disabled && classes.disabled,\n classes[correctness],\n className\n )}\n onMouseEnter={() => this.setState({ showCoordinates: true })}\n onMouseLeave={() => this.setState({ showCoordinates: false })}\n {...rest}\n >\n <circle r={r} cx={scale.x(x)} cy={scale.y(y)} />\n {labelNode &&\n coordinatesOnHover &&\n showCoordinates &&\n ReactDOM.createPortal(\n <CoordinatesLabel graphProps={graphProps} x={x} y={y} />,\n labelNode\n )}\n </g>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-point.js","names":["RawBp","props","state","showCoordinates","classes","className","coordinatesOnHover","x","y","disabled","correctness","graphProps","labelNode","rest","scale","r","thinnerShapesNeeded","classNames","point","setState","ReactDOM","createPortal","React","Component","PropTypes","object","string","bool","number","types","GraphPropsType","isRequired"],"sources":["../../../../src/tools/shared/point/base-point.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { types } from '@pie-lib/plot';\nimport CoordinatesLabel from '../../../coordinates-label';\nimport ReactDOM from 'react-dom';\nimport { thinnerShapesNeeded } from '../../../utils';\n\nexport class RawBp extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n className: PropTypes.string,\n coordinatesOnHover: PropTypes.bool,\n correctness: PropTypes.string,\n disabled: PropTypes.bool,\n labelNode: PropTypes.object,\n x: PropTypes.number,\n y: PropTypes.number,\n graphProps: types.GraphPropsType.isRequired\n };\n\n constructor(props) {\n super(props);\n this.state = { showCoordinates: false };\n }\n\n render() {\n const {\n classes,\n className,\n coordinatesOnHover,\n x,\n y,\n disabled,\n correctness,\n graphProps,\n labelNode,\n ...rest\n } = this.props;\n const { showCoordinates } = this.state;\n const { scale } = graphProps;\n const r = thinnerShapesNeeded(graphProps) ? 5 : 7;\n\n return (\n <g\n className={classNames(\n classes.point,\n disabled && classes.disabled,\n classes[correctness],\n className\n )}\n onMouseEnter={() => this.setState({ showCoordinates: true })}\n onMouseLeave={() => this.setState({ showCoordinates: false })}\n {...rest}\n >\n <circle r={r} cx={scale.x(x)} cy={scale.y(y)} />\n {labelNode &&\n coordinatesOnHover &&\n showCoordinates &&\n ReactDOM.createPortal(\n <CoordinatesLabel graphProps={graphProps} x={x} y={y} />,\n labelNode\n )}\n </g>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;IAEaA,K;;;;;EAaX,eAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACjB,0BAAMA,KAAN;IACA,MAAKC,KAAL,GAAa;MAAEC,eAAe,EAAE;IAAnB,CAAb;IAFiB;EAGlB;;;;WAED,kBAAS;MAAA;;MACP,kBAWI,KAAKF,KAXT;MAAA,IACEG,OADF,eACEA,OADF;MAAA,IAEEC,SAFF,eAEEA,SAFF;MAAA,IAGEC,kBAHF,eAGEA,kBAHF;MAAA,IAIEC,CAJF,eAIEA,CAJF;MAAA,IAKEC,CALF,eAKEA,CALF;MAAA,IAMEC,QANF,eAMEA,QANF;MAAA,IAOEC,WAPF,eAOEA,WAPF;MAAA,IAQEC,UARF,eAQEA,UARF;MAAA,IASEC,SATF,eASEA,SATF;MAAA,IAUKC,IAVL;MAYA,IAAQV,eAAR,GAA4B,KAAKD,KAAjC,C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API;EAQjBpB,CAAC,EAAEgB,qBAAA,CAAUI,MARI;EASjBjB,UAAU,EAAEkB,WAAA,CAAMC,cAAN,CAAqBC;AAThB,C"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports.BasePoint = exports.ArrowPoint = exports.Arrow = void 0;
|
|
9
11
|
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
10
14
|
var _index = require("@material-ui/core/styles/index");
|
|
11
15
|
|
|
12
16
|
var _plot = require("@pie-lib/plot");
|
|
@@ -23,17 +27,13 @@ var _renderUi = require("@pie-lib/render-ui");
|
|
|
23
27
|
|
|
24
28
|
var _arrow = _interopRequireDefault(require("./arrow"));
|
|
25
29
|
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
-
|
|
28
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
31
|
|
|
30
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
33
|
|
|
32
34
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
35
|
|
|
34
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
35
|
-
|
|
36
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
36
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
37
37
|
|
|
38
38
|
var opts = {
|
|
39
39
|
bounds: function bounds(props, _ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["opts","bounds","props","domain","range","x","y","area","left","top","bottom","right","utils","anchorPoint","fromDelta","delta","point","add","styles","cursor","fill","color","secondary","disabled","correct","incorrect","BasePoint","withStyles","gridDraggable","RawBp","ArrowPoint","RawArrow","Arrow","BaseArrow"],"sources":["../../../../src/tools/shared/point/index.jsx"],"sourcesContent":["import { withStyles } from '@material-ui/core/styles/index';\nimport { gridDraggable } from '@pie-lib/plot';\nimport * as utils from '../../../utils';\nimport { disabled, correct, incorrect } from '../styles';\nimport { RawBp } from './base-point';\nimport { RawArrow } from './arrow-point';\nimport { color } from '@pie-lib/render-ui';\nimport BaseArrow from './arrow';\n\nconst opts = {\n bounds: (props, { domain, range }) => {\n const { x, y } = props;\n const area = { left: x, top: y, bottom: y, right: x };\n\n return utils.bounds(area, domain, range);\n },\n anchorPoint: props => {\n const { x, y } = props;\n\n return { x, y };\n },\n fromDelta: (props, delta) => {\n return utils.point(props).add(utils.point(delta));\n }\n};\n\nconst styles = () => {\n return {\n point: {\n '& circle, & polygon': {\n cursor: 'pointer',\n fill: color.secondary()\n }\n },\n disabled: {\n '& circle, & polygon': {\n ...disabled()\n }\n },\n correct: {\n '& circle, & polygon': {\n ...correct()\n }\n },\n incorrect: {\n '& circle, & polygon': {\n ...incorrect()\n }\n }\n };\n};\n\nexport const BasePoint = withStyles(styles)(gridDraggable(opts)(RawBp));\nexport const ArrowPoint = withStyles(styles)(gridDraggable(opts)(RawArrow));\nexport const Arrow = withStyles(styles)(gridDraggable(opts)(BaseArrow));\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["opts","bounds","props","domain","range","x","y","area","left","top","bottom","right","utils","anchorPoint","fromDelta","delta","point","add","styles","cursor","fill","color","secondary","disabled","correct","incorrect","BasePoint","withStyles","gridDraggable","RawBp","ArrowPoint","RawArrow","Arrow","BaseArrow"],"sources":["../../../../src/tools/shared/point/index.jsx"],"sourcesContent":["import { withStyles } from '@material-ui/core/styles/index';\nimport { gridDraggable } from '@pie-lib/plot';\nimport * as utils from '../../../utils';\nimport { disabled, correct, incorrect } from '../styles';\nimport { RawBp } from './base-point';\nimport { RawArrow } from './arrow-point';\nimport { color } from '@pie-lib/render-ui';\nimport BaseArrow from './arrow';\n\nconst opts = {\n bounds: (props, { domain, range }) => {\n const { x, y } = props;\n const area = { left: x, top: y, bottom: y, right: x };\n\n return utils.bounds(area, domain, range);\n },\n anchorPoint: props => {\n const { x, y } = props;\n\n return { x, y };\n },\n fromDelta: (props, delta) => {\n return utils.point(props).add(utils.point(delta));\n }\n};\n\nconst styles = () => {\n return {\n point: {\n '& circle, & polygon': {\n cursor: 'pointer',\n fill: color.secondary()\n }\n },\n disabled: {\n '& circle, & polygon': {\n ...disabled()\n }\n },\n correct: {\n '& circle, & polygon': {\n ...correct()\n }\n },\n incorrect: {\n '& circle, & polygon': {\n ...incorrect()\n }\n }\n };\n};\n\nexport const BasePoint = withStyles(styles)(gridDraggable(opts)(RawBp));\nexport const ArrowPoint = withStyles(styles)(gridDraggable(opts)(RawArrow));\nexport const Arrow = withStyles(styles)(gridDraggable(opts)(BaseArrow));\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,IAAI,GAAG;EACXC,MAAM,EAAE,gBAACC,KAAD,QAA8B;IAAA,IAApBC,MAAoB,QAApBA,MAAoB;IAAA,IAAZC,KAAY,QAAZA,KAAY;IACpC,IAAQC,CAAR,GAAiBH,KAAjB,CAAQG,CAAR;IAAA,IAAWC,CAAX,GAAiBJ,KAAjB,CAAWI,CAAX;IACA,IAAMC,IAAI,GAAG;MAAEC,IAAI,EAAEH,CAAR;MAAWI,GAAG,EAAEH,CAAhB;MAAmBI,MAAM,EAAEJ,CAA3B;MAA8BK,KAAK,EAAEN;IAArC,CAAb;IAEA,OAAOO,KAAK,CAACX,MAAN,CAAaM,IAAb,EAAmBJ,MAAnB,EAA2BC,KAA3B,CAAP;EACD,CANU;EAOXS,WAAW,EAAE,qBAAAX,KAAK,EAAI;IACpB,IAAQG,CAAR,GAAiBH,KAAjB,CAAQG,CAAR;IAAA,IAAWC,CAAX,GAAiBJ,KAAjB,CAAWI,CAAX;IAEA,OAAO;MAAED,CAAC,EAADA,CAAF;MAAKC,CAAC,EAADA;IAAL,CAAP;EACD,CAXU;EAYXQ,SAAS,EAAE,mBAACZ,KAAD,EAAQa,KAAR,EAAkB;IAC3B,OAAOH,KAAK,CAACI,KAAN,CAAYd,KAAZ,EAAmBe,GAAnB,CAAuBL,KAAK,CAACI,KAAN,CAAYD,KAAZ,CAAvB,CAAP;EACD;AAdU,CAAb;;AAiBA,IAAMG,MAAM,GAAG,SAATA,MAAS,GAAM;EACnB,OAAO;IACLF,KAAK,EAAE;MACL,uBAAuB;QACrBG,MAAM,EAAE,SADa;QAErBC,IAAI,EAAEC,eAAA,CAAMC,SAAN;MAFe;IADlB,CADF;IAOLC,QAAQ,EAAE;MACR,yCACK,IAAAA,gBAAA,GADL;IADQ,CAPL;IAYLC,OAAO,EAAE;MACP,yCACK,IAAAA,eAAA,GADL;IADO,CAZJ;IAiBLC,SAAS,EAAE;MACT,yCACK,IAAAA,iBAAA,GADL;IADS;EAjBN,CAAP;AAuBD,CAxBD;;AA0BO,IAAMC,SAAS,GAAG,IAAAC,iBAAA,EAAWT,MAAX,EAAmB,IAAAU,mBAAA,EAAc5B,IAAd,EAAoB6B,gBAApB,CAAnB,CAAlB;;AACA,IAAMC,UAAU,GAAG,IAAAH,iBAAA,EAAWT,MAAX,EAAmB,IAAAU,mBAAA,EAAc5B,IAAd,EAAoB+B,oBAApB,CAAnB,CAAnB;;AACA,IAAMC,KAAK,GAAG,IAAAL,iBAAA,EAAWT,MAAX,EAAmB,IAAAU,mBAAA,EAAc5B,IAAd,EAAoBiC,iBAApB,CAAnB,CAAd"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.incorrect = exports.disabled = exports.correct = void 0;
|
|
7
9
|
|
|
8
|
-
var
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
11
13
|
|
|
12
14
|
var disabled = function disabled() {
|
|
13
15
|
var _ref;
|
|
14
16
|
|
|
15
17
|
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fill';
|
|
16
|
-
return _ref = {},
|
|
18
|
+
return _ref = {}, (0, _defineProperty2["default"])(_ref, key, _renderUi.color.disabled()), (0, _defineProperty2["default"])(_ref, "pointerEvents", 'none'), _ref;
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
exports.disabled = disabled;
|
|
@@ -22,7 +24,7 @@ var correct = function correct() {
|
|
|
22
24
|
var _ref2;
|
|
23
25
|
|
|
24
26
|
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fill';
|
|
25
|
-
return _ref2 = {},
|
|
27
|
+
return _ref2 = {}, (0, _defineProperty2["default"])(_ref2, key, _renderUi.color.correct()), (0, _defineProperty2["default"])(_ref2, "pointerEvents", 'none'), _ref2;
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
exports.correct = correct;
|
|
@@ -31,7 +33,7 @@ var incorrect = function incorrect() {
|
|
|
31
33
|
var _ref3;
|
|
32
34
|
|
|
33
35
|
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fill';
|
|
34
|
-
return _ref3 = {},
|
|
36
|
+
return _ref3 = {}, (0, _defineProperty2["default"])(_ref3, key, _renderUi.color.incorrect()), (0, _defineProperty2["default"])(_ref3, "pointerEvents", 'none'), _ref3;
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
exports.incorrect = incorrect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["disabled","key","color","correct","incorrect"],"sources":["../../../src/tools/shared/styles.js"],"sourcesContent":["import { color } from '@pie-lib/render-ui';\n\nexport const disabled = (key = 'fill') => ({\n [key]: color.disabled(),\n pointerEvents: 'none'\n});\n\nexport const correct = (key = 'fill') => ({\n [key]: color.correct(),\n pointerEvents: 'none'\n});\nexport const incorrect = (key = 'fill') => ({\n [key]: color.incorrect(),\n pointerEvents: 'none'\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.js","names":["disabled","key","color","correct","incorrect"],"sources":["../../../src/tools/shared/styles.js"],"sourcesContent":["import { color } from '@pie-lib/render-ui';\n\nexport const disabled = (key = 'fill') => ({\n [key]: color.disabled(),\n pointerEvents: 'none'\n});\n\nexport const correct = (key = 'fill') => ({\n [key]: color.correct(),\n pointerEvents: 'none'\n});\nexport const incorrect = (key = 'fill') => ({\n [key]: color.incorrect(),\n pointerEvents: 'none'\n});\n"],"mappings":";;;;;;;;;;;AAAA;;AAEO,IAAMA,QAAQ,GAAG,SAAXA,QAAW;EAAA;;EAAA,IAACC,GAAD,uEAAO,MAAP;EAAA,yDACrBA,GADqB,EACfC,eAAA,CAAMF,QAAN,EADe,2DAEP,MAFO;AAAA,CAAjB;;;;AAKA,IAAMG,OAAO,GAAG,SAAVA,OAAU;EAAA;;EAAA,IAACF,GAAD,uEAAO,MAAP;EAAA,2DACpBA,GADoB,EACdC,eAAA,CAAMC,OAAN,EADc,4DAEN,MAFM;AAAA,CAAhB;;;;AAIA,IAAMC,SAAS,GAAG,SAAZA,SAAY;EAAA;;EAAA,IAACH,GAAD,uEAAO,MAAP;EAAA,2DACtBA,GADsB,EAChBC,eAAA,CAAME,SAAN,EADgB,4DAER,MAFQ;AAAA,CAAlB"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -7,8 +9,6 @@ exports.ToolPropTypeFields = exports.ToolPropType = void 0;
|
|
|
7
9
|
|
|
8
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
11
|
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
12
|
var ToolPropTypeFields = {
|
|
13
13
|
mark: _propTypes["default"].any,
|
|
14
14
|
onChange: _propTypes["default"].func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["ToolPropTypeFields","mark","PropTypes","any","onChange","func","onDragStart","onDragStop","ToolPropType","shape"],"sources":["../../../src/tools/shared/types.js"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport const ToolPropTypeFields = {\n mark: PropTypes.any,\n onChange: PropTypes.func,\n onDragStart: PropTypes.func,\n onDragStop: PropTypes.func\n};\n\nexport const ToolPropType = PropTypes.shape(ToolPropTypeFields);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","names":["ToolPropTypeFields","mark","PropTypes","any","onChange","func","onDragStart","onDragStop","ToolPropType","shape"],"sources":["../../../src/tools/shared/types.js"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport const ToolPropTypeFields = {\n mark: PropTypes.any,\n onChange: PropTypes.func,\n onDragStart: PropTypes.func,\n onDragStop: PropTypes.func\n};\n\nexport const ToolPropType = PropTypes.shape(ToolPropTypeFields);\n"],"mappings":";;;;;;;;;AAAA;;AAEO,IAAMA,kBAAkB,GAAG;EAChCC,IAAI,EAAEC,qBAAA,CAAUC,GADgB;EAEhCC,QAAQ,EAAEF,qBAAA,CAAUG,IAFY;EAGhCC,WAAW,EAAEJ,qBAAA,CAAUG,IAHS;EAIhCE,UAAU,EAAEL,qBAAA,CAAUG;AAJU,CAA3B;;;AAOA,IAAMG,YAAY,GAAGN,qBAAA,CAAUO,KAAV,CAAgBT,kBAAhB,CAArB"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -11,8 +13,6 @@ var _graphingUtils = require("@pie-lib/graphing-utils");
|
|
|
11
13
|
|
|
12
14
|
var _withRootEdge = require("../shared/line/with-root-edge");
|
|
13
15
|
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
16
|
var log = (0, _debug["default"])('pie-lib:graphing:sine');
|
|
17
17
|
log('sine...');
|
|
18
18
|
var Sine = (0, _withRootEdge.withRootEdge)(function (props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","names":["log","debug","Sine","withRootEdge","props","domain","graphProps","root","edge","getAmplitudeAndFreq","amplitude","freq","interval","FREQ_DIVIDER","dataPoints","x","buildDataPoints","min","max","sinY","phase","vertical","y","Component","rootEdgeComponent"],"sources":["../../../src/tools/sine/component.jsx"],"sourcesContent":["import debug from 'debug';\nimport { sinY, buildDataPoints, getAmplitudeAndFreq, FREQ_DIVIDER } from '@pie-lib/graphing-utils';\nimport { withRootEdge, rootEdgeComponent } from '../shared/line/with-root-edge';\n\nconst log = debug('pie-lib:graphing:sine');\n\nlog('sine...');\n\nconst Sine = withRootEdge(props => {\n const { domain } = props.graphProps;\n\n const { root, edge } = props;\n const { amplitude, freq } = getAmplitudeAndFreq(root, edge);\n const interval = freq / FREQ_DIVIDER;\n log('[getPoints] amplitude:', amplitude, 'freq:', freq);\n\n const dataPoints =\n edge && edge.x === root.x\n ? []\n : buildDataPoints(\n domain.min,\n domain.max,\n root,\n edge,\n interval,\n sinY(amplitude, freq, { phase: root.x, vertical: root.y })\n );\n return { root: props.root, edge: props.edge, dataPoints };\n});\n\nconst Component = rootEdgeComponent(Sine);\nexport default Component;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.js","names":["log","debug","Sine","withRootEdge","props","domain","graphProps","root","edge","getAmplitudeAndFreq","amplitude","freq","interval","FREQ_DIVIDER","dataPoints","x","buildDataPoints","min","max","sinY","phase","vertical","y","Component","rootEdgeComponent"],"sources":["../../../src/tools/sine/component.jsx"],"sourcesContent":["import debug from 'debug';\nimport { sinY, buildDataPoints, getAmplitudeAndFreq, FREQ_DIVIDER } from '@pie-lib/graphing-utils';\nimport { withRootEdge, rootEdgeComponent } from '../shared/line/with-root-edge';\n\nconst log = debug('pie-lib:graphing:sine');\n\nlog('sine...');\n\nconst Sine = withRootEdge(props => {\n const { domain } = props.graphProps;\n\n const { root, edge } = props;\n const { amplitude, freq } = getAmplitudeAndFreq(root, edge);\n const interval = freq / FREQ_DIVIDER;\n log('[getPoints] amplitude:', amplitude, 'freq:', freq);\n\n const dataPoints =\n edge && edge.x === root.x\n ? []\n : buildDataPoints(\n domain.min,\n domain.max,\n root,\n edge,\n interval,\n sinY(amplitude, freq, { phase: root.x, vertical: root.y })\n );\n return { root: props.root, edge: props.edge, dataPoints };\n});\n\nconst Component = rootEdgeComponent(Sine);\nexport default Component;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,GAAG,GAAG,IAAAC,iBAAA,EAAM,uBAAN,CAAZ;AAEAD,GAAG,CAAC,SAAD,CAAH;AAEA,IAAME,IAAI,GAAG,IAAAC,0BAAA,EAAa,UAAAC,KAAK,EAAI;EACjC,IAAQC,MAAR,GAAmBD,KAAK,CAACE,UAAzB,CAAQD,MAAR;EAEA,IAAQE,IAAR,GAAuBH,KAAvB,CAAQG,IAAR;EAAA,IAAcC,IAAd,GAAuBJ,KAAvB,CAAcI,IAAd;;EACA,2BAA4B,IAAAC,kCAAA,EAAoBF,IAApB,EAA0BC,IAA1B,CAA5B;EAAA,IAAQE,SAAR,wBAAQA,SAAR;EAAA,IAAmBC,IAAnB,wBAAmBA,IAAnB;;EACA,IAAMC,QAAQ,GAAGD,IAAI,GAAGE,2BAAxB;EACAb,GAAG,CAAC,wBAAD,EAA2BU,SAA3B,EAAsC,OAAtC,EAA+CC,IAA/C,CAAH;EAEA,IAAMG,UAAU,GACdN,IAAI,IAAIA,IAAI,CAACO,CAAL,KAAWR,IAAI,CAACQ,CAAxB,GACI,EADJ,GAEI,IAAAC,8BAAA,EACEX,MAAM,CAACY,GADT,EAEEZ,MAAM,CAACa,GAFT,EAGEX,IAHF,EAIEC,IAJF,EAKEI,QALF,EAME,IAAAO,mBAAA,EAAKT,SAAL,EAAgBC,IAAhB,EAAsB;IAAES,KAAK,EAAEb,IAAI,CAACQ,CAAd;IAAiBM,QAAQ,EAAEd,IAAI,CAACe;EAAhC,CAAtB,CANF,CAHN;EAWA,OAAO;IAAEf,IAAI,EAAEH,KAAK,CAACG,IAAd;IAAoBC,IAAI,EAAEJ,KAAK,CAACI,IAAhC;IAAsCM,UAAU,EAAVA;EAAtC,CAAP;AACD,CApBY,CAAb;AAsBA,IAAMS,SAAS,GAAG,IAAAC,+BAAA,EAAkBtB,IAAlB,CAAlB;eACeqB,S"}
|
package/lib/tools/sine/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.tool = void 0;
|
|
7
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
8
12
|
var _component = _interopRequireDefault(require("./component"));
|
|
9
13
|
|
|
10
14
|
var _debug = _interopRequireDefault(require("debug"));
|
|
11
15
|
|
|
12
16
|
var _utils = require("../../utils");
|
|
13
17
|
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
19
|
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
19
|
-
|
|
20
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
21
|
|
|
22
22
|
var log = (0, _debug["default"])('pie-lib:graphing:sine');
|
|
23
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["log","debug","tool","type","Component","Sine","complete","data","mark","building","closed","addPoint","point","equalPoints","root","sameAxes","edge","undefined","Error"],"sources":["../../../src/tools/sine/index.js"],"sourcesContent":["import Sine from './component';\nimport debug from 'debug';\nimport { equalPoints, sameAxes } from '../../utils';\n\nconst log = debug('pie-lib:graphing:sine');\n\nexport const tool = () => ({\n type: 'sine',\n Component: Sine,\n complete: (data, mark) => {\n return { ...mark, building: false, closed: true };\n },\n addPoint: (point, mark) => {\n log('add point to sine model: ', point, 'mark: ', mark);\n if (mark && (equalPoints(mark.root, point) || sameAxes(mark.root, point))) {\n return mark;\n }\n\n if (!mark) {\n return {\n type: 'sine',\n root: point,\n edge: undefined,\n closed: false,\n building: true\n };\n } else if (mark && !mark.root) {\n throw new Error('no root - should never happen');\n } else {\n return { ...mark, edge: point, closed: true, building: false };\n }\n }\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["log","debug","tool","type","Component","Sine","complete","data","mark","building","closed","addPoint","point","equalPoints","root","sameAxes","edge","undefined","Error"],"sources":["../../../src/tools/sine/index.js"],"sourcesContent":["import Sine from './component';\nimport debug from 'debug';\nimport { equalPoints, sameAxes } from '../../utils';\n\nconst log = debug('pie-lib:graphing:sine');\n\nexport const tool = () => ({\n type: 'sine',\n Component: Sine,\n complete: (data, mark) => {\n return { ...mark, building: false, closed: true };\n },\n addPoint: (point, mark) => {\n log('add point to sine model: ', point, 'mark: ', mark);\n if (mark && (equalPoints(mark.root, point) || sameAxes(mark.root, point))) {\n return mark;\n }\n\n if (!mark) {\n return {\n type: 'sine',\n root: point,\n edge: undefined,\n closed: false,\n building: true\n };\n } else if (mark && !mark.root) {\n throw new Error('no root - should never happen');\n } else {\n return { ...mark, edge: point, closed: true, building: false };\n }\n }\n});\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,IAAAC,iBAAA,EAAM,uBAAN,CAAZ;;AAEO,IAAMC,IAAI,GAAG,SAAPA,IAAO;EAAA,OAAO;IACzBC,IAAI,EAAE,MADmB;IAEzBC,SAAS,EAAEC,qBAFc;IAGzBC,QAAQ,EAAE,kBAACC,IAAD,EAAOC,IAAP,EAAgB;MACxB,uCAAYA,IAAZ;QAAkBC,QAAQ,EAAE,KAA5B;QAAmCC,MAAM,EAAE;MAA3C;IACD,CALwB;IAMzBC,QAAQ,EAAE,kBAACC,KAAD,EAAQJ,IAAR,EAAiB;MACzBR,GAAG,CAAC,2BAAD,EAA8BY,KAA9B,EAAqC,QAArC,EAA+CJ,IAA/C,CAAH;;MACA,IAAIA,IAAI,KAAK,IAAAK,kBAAA,EAAYL,IAAI,CAACM,IAAjB,EAAuBF,KAAvB,KAAiC,IAAAG,eAAA,EAASP,IAAI,CAACM,IAAd,EAAoBF,KAApB,CAAtC,CAAR,EAA2E;QACzE,OAAOJ,IAAP;MACD;;MAED,IAAI,CAACA,IAAL,EAAW;QACT,OAAO;UACLL,IAAI,EAAE,MADD;UAELW,IAAI,EAAEF,KAFD;UAGLI,IAAI,EAAEC,SAHD;UAILP,MAAM,EAAE,KAJH;UAKLD,QAAQ,EAAE;QALL,CAAP;MAOD,CARD,MAQO,IAAID,IAAI,IAAI,CAACA,IAAI,CAACM,IAAlB,EAAwB;QAC7B,MAAM,IAAII,KAAJ,CAAU,+BAAV,CAAN;MACD,CAFM,MAEA;QACL,uCAAYV,IAAZ;UAAkBQ,IAAI,EAAEJ,KAAxB;UAA+BF,MAAM,EAAE,IAAvC;UAA6CD,QAAQ,EAAE;QAAvD;MACD;IACF;EAzBwB,CAAP;AAAA,CAAb"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports["default"] = exports.Line = void 0;
|
|
7
9
|
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
8
14
|
var _line = require("../shared/line");
|
|
9
15
|
|
|
10
16
|
var _point = require("../shared/point");
|
|
@@ -23,14 +29,6 @@ var _utils = require("../../utils");
|
|
|
23
29
|
|
|
24
30
|
var _excluded = ["className", "classes", "disabled", "correctness", "graphProps", "from", "to"];
|
|
25
31
|
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
-
|
|
28
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
32
|
-
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; }
|
|
33
|
-
|
|
34
32
|
var lineStyles = function lineStyles(theme) {
|
|
35
33
|
return {
|
|
36
34
|
line: _line.styles.line(theme),
|
|
@@ -48,8 +46,7 @@ var Line = function Line(props) {
|
|
|
48
46
|
scale = props.graphProps.scale,
|
|
49
47
|
from = props.from,
|
|
50
48
|
to = props.to,
|
|
51
|
-
rest =
|
|
52
|
-
|
|
49
|
+
rest = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
53
50
|
var startPoint = {
|
|
54
51
|
x: scale.x(from.x),
|
|
55
52
|
y: scale.y(from.y)
|
|
@@ -59,7 +56,7 @@ var Line = function Line(props) {
|
|
|
59
56
|
y: scale.y(to.y)
|
|
60
57
|
};
|
|
61
58
|
var length = (0, _utils.getDistanceBetweenTwoPoints)(startPoint, endPoint);
|
|
62
|
-
return /*#__PURE__*/_react["default"].createElement("line",
|
|
59
|
+
return /*#__PURE__*/_react["default"].createElement("line", (0, _extends2["default"])({
|
|
63
60
|
className: (0, _classnames["default"])(classes.line, disabled && classes.disabled, classes[correctness], className),
|
|
64
61
|
x1: startPoint.x,
|
|
65
62
|
y1: startPoint.y,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","names":["lineStyles","theme","line","styles","disabled","correct","incorrect","Line","props","className","classes","correctness","scale","graphProps","from","to","rest","startPoint","x","y","endPoint","length","getDistanceBetweenTwoPoints","classNames","propTypes","PropTypes","string","object","bool","any","types","PointType","StyledLine","withStyles","Vector","lineBase","Arrow","Component","lineToolComponent"],"sources":["../../../src/tools/vector/component.jsx"],"sourcesContent":["import { lineToolComponent, lineBase, styles } from '../shared/line';\nimport { Arrow } from '../shared/point';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { types } from '@pie-lib/plot';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { getDistanceBetweenTwoPoints } from '../../utils';\n\nconst lineStyles = theme => ({\n line: styles.line(theme),\n disabled: styles.disabled(theme),\n correct: styles.correct(theme, 'stroke'),\n incorrect: styles.incorrect(theme, 'stroke')\n});\n\nexport const Line = props => {\n const {\n className,\n classes,\n disabled,\n correctness,\n graphProps: { scale },\n from,\n to,\n ...rest\n } = props;\n const startPoint = { x: scale.x(from.x), y: scale.y(from.y) };\n const endPoint = { x: scale.x(to.x), y: scale.y(to.y) };\n const length = getDistanceBetweenTwoPoints(startPoint, endPoint);\n\n return (\n <line\n className={classNames(\n classes.line,\n disabled && classes.disabled,\n classes[correctness],\n className\n )}\n x1={startPoint.x}\n y1={startPoint.y}\n x2={endPoint.x}\n y2={endPoint.y}\n strokeDasharray={length - 7}\n {...rest}\n />\n );\n};\n\nLine.propTypes = {\n className: PropTypes.string,\n classes: PropTypes.object,\n disabled: PropTypes.bool,\n correctness: PropTypes.string,\n graphProps: PropTypes.any,\n from: types.PointType,\n to: types.PointType\n};\n\nconst StyledLine = withStyles(lineStyles)(Line);\nconst Vector = lineBase(StyledLine, { to: Arrow });\nconst Component = lineToolComponent(Vector);\n\nexport default Component;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.js","names":["lineStyles","theme","line","styles","disabled","correct","incorrect","Line","props","className","classes","correctness","scale","graphProps","from","to","rest","startPoint","x","y","endPoint","length","getDistanceBetweenTwoPoints","classNames","propTypes","PropTypes","string","object","bool","any","types","PointType","StyledLine","withStyles","Vector","lineBase","Arrow","Component","lineToolComponent"],"sources":["../../../src/tools/vector/component.jsx"],"sourcesContent":["import { lineToolComponent, lineBase, styles } from '../shared/line';\nimport { Arrow } from '../shared/point';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { types } from '@pie-lib/plot';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { getDistanceBetweenTwoPoints } from '../../utils';\n\nconst lineStyles = theme => ({\n line: styles.line(theme),\n disabled: styles.disabled(theme),\n correct: styles.correct(theme, 'stroke'),\n incorrect: styles.incorrect(theme, 'stroke')\n});\n\nexport const Line = props => {\n const {\n className,\n classes,\n disabled,\n correctness,\n graphProps: { scale },\n from,\n to,\n ...rest\n } = props;\n const startPoint = { x: scale.x(from.x), y: scale.y(from.y) };\n const endPoint = { x: scale.x(to.x), y: scale.y(to.y) };\n const length = getDistanceBetweenTwoPoints(startPoint, endPoint);\n\n return (\n <line\n className={classNames(\n classes.line,\n disabled && classes.disabled,\n classes[correctness],\n className\n )}\n x1={startPoint.x}\n y1={startPoint.y}\n x2={endPoint.x}\n y2={endPoint.y}\n strokeDasharray={length - 7}\n {...rest}\n />\n );\n};\n\nLine.propTypes = {\n className: PropTypes.string,\n classes: PropTypes.object,\n disabled: PropTypes.bool,\n correctness: PropTypes.string,\n graphProps: PropTypes.any,\n from: types.PointType,\n to: types.PointType\n};\n\nconst StyledLine = withStyles(lineStyles)(Line);\nconst Vector = lineBase(StyledLine, { to: Arrow });\nconst Component = lineToolComponent(Vector);\n\nexport default Component;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAAAC,K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