@pie-lib/graphing 2.4.9 → 2.4.10
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/CHANGELOG.md +14 -0
- package/lib/axis/arrow.js +17 -13
- package/lib/axis/arrow.js.map +1 -1
- package/lib/axis/axes.js +57 -51
- package/lib/axis/axes.js.map +1 -1
- package/lib/axis/index.js +5 -1
- package/lib/axis/index.js.map +1 -1
- package/lib/bg.js +16 -14
- package/lib/bg.js.map +1 -1
- package/lib/container/index.js +21 -15
- package/lib/container/index.js.map +1 -1
- package/lib/coordinates-label.js +4 -4
- package/lib/coordinates-label.js.map +1 -1
- package/lib/graph-with-controls.js +29 -25
- package/lib/graph-with-controls.js.map +1 -1
- package/lib/graph.js +54 -41
- package/lib/graph.js.map +1 -1
- package/lib/grid.js +20 -14
- package/lib/grid.js.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/labels.js +28 -24
- package/lib/labels.js.map +1 -1
- package/lib/mark-label.js +16 -8
- package/lib/mark-label.js.map +1 -1
- package/lib/toggle-bar.js +18 -16
- package/lib/toggle-bar.js.map +1 -1
- package/lib/tool-menu.js +22 -16
- package/lib/tool-menu.js.map +1 -1
- package/lib/tools/circle/bg-circle.js +26 -18
- package/lib/tools/circle/bg-circle.js.map +1 -1
- package/lib/tools/circle/component.js +30 -28
- package/lib/tools/circle/component.js.map +1 -1
- package/lib/tools/circle/index.js +4 -4
- package/lib/tools/circle/index.js.map +1 -1
- package/lib/tools/index.js +16 -15
- package/lib/tools/index.js.map +1 -1
- package/lib/tools/line/component.js +12 -6
- package/lib/tools/line/component.js.map +1 -1
- package/lib/tools/parabola/component.js.map +1 -1
- package/lib/tools/parabola/index.js +4 -4
- package/lib/tools/parabola/index.js.map +1 -1
- package/lib/tools/point/component.js +21 -17
- package/lib/tools/point/component.js.map +1 -1
- package/lib/tools/point/index.js +2 -2
- package/lib/tools/polygon/component.js +55 -47
- package/lib/tools/polygon/component.js.map +1 -1
- package/lib/tools/polygon/index.js +12 -8
- package/lib/tools/polygon/index.js.map +1 -1
- package/lib/tools/polygon/line.js +26 -18
- package/lib/tools/polygon/line.js.map +1 -1
- package/lib/tools/polygon/polygon.js +26 -18
- package/lib/tools/polygon/polygon.js.map +1 -1
- package/lib/tools/ray/component.js +12 -6
- package/lib/tools/ray/component.js.map +1 -1
- package/lib/tools/segment/component.js +4 -2
- package/lib/tools/segment/component.js.map +1 -1
- package/lib/tools/shared/arrow-head.js +4 -4
- package/lib/tools/shared/arrow-head.js.map +1 -1
- package/lib/tools/shared/line/index.js +46 -44
- package/lib/tools/shared/line/index.js.map +1 -1
- package/lib/tools/shared/line/line-path.js +28 -20
- package/lib/tools/shared/line/line-path.js.map +1 -1
- package/lib/tools/shared/line/with-root-edge.js +8 -6
- package/lib/tools/shared/line/with-root-edge.js.map +1 -1
- package/lib/tools/shared/point/arrow-point.js +21 -15
- package/lib/tools/shared/point/arrow-point.js.map +1 -1
- package/lib/tools/shared/point/arrow.js +21 -15
- package/lib/tools/shared/point/arrow.js.map +1 -1
- package/lib/tools/shared/point/base-point.js +22 -16
- package/lib/tools/shared/point/base-point.js.map +1 -1
- package/lib/tools/shared/point/index.js +8 -4
- package/lib/tools/shared/point/index.js.map +1 -1
- package/lib/tools/shared/styles.js +1 -1
- package/lib/tools/shared/types.js +1 -1
- package/lib/tools/sine/component.js.map +1 -1
- package/lib/tools/sine/index.js +4 -4
- package/lib/tools/sine/index.js.map +1 -1
- package/lib/tools/vector/component.js +4 -2
- package/lib/tools/vector/component.js.map +1 -1
- package/lib/undo-redo.js +20 -16
- package/lib/undo-redo.js.map +1 -1
- package/lib/use-debounce.js +7 -3
- package/lib/use-debounce.js.map +1 -1
- package/lib/utils.js +68 -5
- package/lib/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/axis/axes.jsx +1 -1
- package/src/graph.jsx +12 -6
- package/src/utils.js +62 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.withRootEdge = exports.
|
|
6
|
+
exports.withRootEdge = exports.rootEdgeToFromToWrapper = exports.rootEdgeComponent = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -17,6 +17,8 @@ var _curve = require("@vx/curve");
|
|
|
17
17
|
|
|
18
18
|
var _index = require("./index");
|
|
19
19
|
|
|
20
|
+
var _excluded = ["graphProps", "from", "to", "onClick", "onDragStart", "onDragStop", "onChange", "disabled", "correctness"];
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
23
|
|
|
22
24
|
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; }
|
|
@@ -25,9 +27,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
25
27
|
|
|
26
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); }
|
|
27
29
|
|
|
28
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
30
|
+
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; }
|
|
29
31
|
|
|
30
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
32
|
+
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) { _defineProperty(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; }
|
|
31
33
|
|
|
32
34
|
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; }
|
|
33
35
|
|
|
@@ -59,7 +61,7 @@ var rootEdgeToFromToWrapper = function rootEdgeToFromToWrapper(BaseComp) {
|
|
|
59
61
|
props.onChange(toRootEdge(current), toRootEdge(next));
|
|
60
62
|
};
|
|
61
63
|
|
|
62
|
-
return _react["default"].createElement(BaseComp, _extends({}, props, {
|
|
64
|
+
return /*#__PURE__*/_react["default"].createElement(BaseComp, _extends({}, props, {
|
|
63
65
|
mark: m,
|
|
64
66
|
onChange: onChange
|
|
65
67
|
}));
|
|
@@ -92,7 +94,7 @@ var withPointsGenerationLinePath = function withPointsGenerationLinePath(getPoin
|
|
|
92
94
|
onChange = props.onChange,
|
|
93
95
|
disabled = props.disabled,
|
|
94
96
|
correctness = props.correctness,
|
|
95
|
-
rest = _objectWithoutProperties(props,
|
|
97
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
96
98
|
|
|
97
99
|
var _getPoints = getPoints({
|
|
98
100
|
graphProps: props.graphProps,
|
|
@@ -113,7 +115,7 @@ var withPointsGenerationLinePath = function withPointsGenerationLinePath(getPoin
|
|
|
113
115
|
disabled: disabled,
|
|
114
116
|
correctness: correctness
|
|
115
117
|
};
|
|
116
|
-
return _react["default"].createElement(_linePath.LinePath, _extends({
|
|
118
|
+
return /*#__PURE__*/_react["default"].createElement(_linePath.LinePath, _extends({
|
|
117
119
|
data: raw,
|
|
118
120
|
from: from,
|
|
119
121
|
to: to,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/tools/shared/line/with-root-edge.jsx"],"names":["toRootEdge","m","out","root","from","edge","to","undefined","toFromTo","rootEdgeToFromToWrapper","BaseComp","Wrapper","props","mark","onChange","current","next","propTypes","PropTypes","func","object","rootEdgeComponent","RootEdgeComp","BaseComponent","withPointsGenerationLinePath","getPoints","LinePathComponent","graphProps","onClick","onDragStart","onDragStop","disabled","correctness","rest","dataPoints","raw","map","d","scale","x","y","common","curveMonotoneX","types","GraphPropsType","isRequired","PointType","bool","string","withRootEdge","LinePathComp"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA
|
|
1
|
+
{"version":3,"sources":["../../../../src/tools/shared/line/with-root-edge.jsx"],"names":["toRootEdge","m","out","root","from","edge","to","undefined","toFromTo","rootEdgeToFromToWrapper","BaseComp","Wrapper","props","mark","onChange","current","next","propTypes","PropTypes","func","object","rootEdgeComponent","RootEdgeComp","BaseComponent","withPointsGenerationLinePath","getPoints","LinePathComponent","graphProps","onClick","onDragStart","onDragStop","disabled","correctness","rest","dataPoints","raw","map","d","scale","x","y","common","curveMonotoneX","types","GraphPropsType","isRequired","PointType","bool","string","withRootEdge","LinePathComp"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAAAC,CAAC,EAAI;AACtB,MAAMC,GAAG,qBAAQD,CAAR,CAAT;;AACAC,EAAAA,GAAG,CAACC,IAAJ,qBAAgBF,CAAC,CAACG,IAAlB;AACAF,EAAAA,GAAG,CAACG,IAAJ,GAAWJ,CAAC,CAACK,EAAF,qBAAYL,CAAC,CAACK,E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A,UAAU,EAAVA,UAJa;AAKbhB,MAAAA,QAAQ,EAARA,QALa;AAMbiB,MAAAA,QAAQ,EAARA,QANa;AAObC,MAAAA,WAAW,EAAXA;AAPa,KAAf;AAUA,wBAAO,gCAAC,kBAAD;AAAU,MAAA,IAAI,EAAEG,GAAhB;AAAqB,MAAA,IAAI,EAAE/B,IAA3B;AAAiC,MAAA,EAAE,EAAEE,EAArC;AAAyC,MAAA,KAAK,EAAEoC;AAAhD,OAAoED,MAApE,EAAgFR,IAAhF,EAAP;AACD,GAhCD;;AAiCAP,EAAAA,iBAAiB,CAACT,SAAlB,GAA8B;AAC5BU,IAAAA,UAAU,EAAEgB,YAAMC,cAAN,CAAqBC,UADL;AAE5BzC,IAAAA,IAAI,EAAEuC,YAAMG,SAAN,CAAgBD,UAFM;AAG5BvC,IAAAA,EAAE,EAAEqC,YAAMG,SAHkB;AAI5BlB,IAAAA,OAAO,EAAEV,sBAAUC,IAJS;AAK5BU,IAAAA,WAAW,EAAEX,sBAAUC,IALK;AAM5BW,IAAAA,UAAU,EAAEZ,sBAAUC,IANM;AAO5BL,IAAAA,QAAQ,EAAEI,sBAAUC,IAPQ;AAQ5BY,IAAAA,QAAQ,EAAEb,sBAAU6B,IARQ;AAS5Bf,IAAAA,WAAW,EAAEd,sBAAU8B;AATK,GAA9B;AAWA,SAAOtB,iBAAP;AACD,CA9CD;;AAgDO,IAAMuB,YAAY,GAAG,SAAfA,YAAe,CAAAxB,SAAS,EAAI;AACvC,MAAMyB,YAAY,GAAG1B,4BAA4B,CAACC,SAAD,CAAjD;AACA,SAAO,qBAASyB,YAAT,CAAP;AACD,CAHM","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { types } from '@pie-lib/plot';\nimport { LinePath } from '../line/line-path';\nimport { curveMonotoneX } from '@vx/curve';\nimport { lineBase, lineToolComponent } from './index';\n\nconst toRootEdge = m => {\n const out = { ...m };\n out.root = { ...m.from };\n out.edge = m.to ? { ...m.to } : undefined;\n delete out.from;\n delete out.to;\n return out;\n};\n\nconst toFromTo = m => {\n const out = { ...m };\n out.from = { ...m.root };\n out.to = m.edge ? { ...m.edge } : undefined;\n delete out.root;\n delete out.edge;\n return out;\n};\n\nexport const rootEdgeToFromToWrapper = BaseComp => {\n const Wrapper = props => {\n const m = toFromTo(props.mark);\n\n const onChange = (current, next) => {\n props.onChange(toRootEdge(current), toRootEdge(next));\n };\n\n return <BaseComp {...props} mark={m} onChange={onChange} />;\n };\n\n Wrapper.propTypes = {\n onChange: PropTypes.func,\n mark: PropTypes.object\n };\n\n return Wrapper;\n};\n\nexport const rootEdgeComponent = RootEdgeComp => {\n const BaseComponent = lineToolComponent(RootEdgeComp);\n return rootEdgeToFromToWrapper(BaseComponent);\n};\n\nconst withPointsGenerationLinePath = getPoints => {\n const LinePathComponent = props => {\n const {\n graphProps,\n from,\n to,\n onClick,\n onDragStart,\n onDragStop,\n onChange,\n disabled,\n correctness,\n ...rest\n } = props;\n\n const { dataPoints } = getPoints({\n graphProps: props.graphProps,\n root: from,\n edge: to\n });\n const raw = dataPoints.map(d => [graphProps.scale.x(d.x), graphProps.scale.y(d.y)]);\n\n const common = {\n onClick,\n graphProps,\n onDragStart,\n onDragStop,\n onChange,\n disabled,\n correctness\n };\n\n return <LinePath data={raw} from={from} to={to} curve={curveMonotoneX} {...common} {...rest} />;\n };\n LinePathComponent.propTypes = {\n graphProps: types.GraphPropsType.isRequired,\n from: types.PointType.isRequired,\n to: types.PointType,\n onClick: PropTypes.func,\n onDragStart: PropTypes.func,\n onDragStop: PropTypes.func,\n onChange: PropTypes.func,\n disabled: PropTypes.bool,\n correctness: PropTypes.string\n };\n return LinePathComponent;\n};\n\nexport const withRootEdge = getPoints => {\n const LinePathComp = withPointsGenerationLinePath(getPoints);\n return lineBase(LinePathComp);\n};\n"],"file":"with-root-edge.js"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -17,9 +19,9 @@ var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
|
17
19
|
|
|
18
20
|
var _utils = require("../../../utils");
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
var _excluded = ["classes", "className", "x", "y", "disabled", "correctness", "graphProps", "from", "to"];
|
|
21
23
|
|
|
22
|
-
function
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
25
|
|
|
24
26
|
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); }
|
|
25
27
|
|
|
@@ -31,29 +33,33 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
31
33
|
|
|
32
34
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
33
35
|
|
|
34
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
36
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
37
|
|
|
36
|
-
function
|
|
38
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
37
39
|
|
|
38
|
-
function
|
|
40
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
39
41
|
|
|
40
|
-
function
|
|
42
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
41
43
|
|
|
42
|
-
function
|
|
44
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
43
45
|
|
|
44
|
-
function
|
|
46
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
|
+
|
|
48
|
+
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
|
+
|
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
51
|
|
|
46
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; }
|
|
47
53
|
|
|
48
|
-
var RawArrow =
|
|
49
|
-
/*#__PURE__*/
|
|
50
|
-
function (_React$Component) {
|
|
54
|
+
var RawArrow = /*#__PURE__*/function (_React$Component) {
|
|
51
55
|
_inherits(RawArrow, _React$Component);
|
|
52
56
|
|
|
57
|
+
var _super = _createSuper(RawArrow);
|
|
58
|
+
|
|
53
59
|
function RawArrow() {
|
|
54
60
|
_classCallCheck(this, RawArrow);
|
|
55
61
|
|
|
56
|
-
return
|
|
62
|
+
return _super.apply(this, arguments);
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
_createClass(RawArrow, [{
|
|
@@ -69,7 +75,7 @@ function (_React$Component) {
|
|
|
69
75
|
graphProps = _this$props.graphProps,
|
|
70
76
|
from = _this$props.from,
|
|
71
77
|
to = _this$props.to,
|
|
72
|
-
rest = _objectWithoutProperties(_this$props,
|
|
78
|
+
rest = _objectWithoutProperties(_this$props, _excluded); // x & y are the initial coordinates for the arrow
|
|
73
79
|
// from & to are used only to calculate the angle that the arrow should be rotated with
|
|
74
80
|
|
|
75
81
|
|
|
@@ -83,9 +89,9 @@ function (_React$Component) {
|
|
|
83
89
|
points = "0,0 ".concat(_utils.arrowDimensions.vector, ",").concat(_utils.arrowDimensions.vector * 2, " \n -").concat(_utils.arrowDimensions.vector, ",").concat(_utils.arrowDimensions.vector * 2);
|
|
84
90
|
}
|
|
85
91
|
|
|
86
|
-
return _react["default"].createElement("g", _extends({
|
|
92
|
+
return /*#__PURE__*/_react["default"].createElement("g", _extends({
|
|
87
93
|
className: (0, _classnames["default"])(classes.point, disabled && classes.disabled, classes[correctness], className)
|
|
88
|
-
}, rest), _react["default"].createElement("polygon", {
|
|
94
|
+
}, rest), /*#__PURE__*/_react["default"].createElement("polygon", {
|
|
89
95
|
points: points,
|
|
90
96
|
transform: "\n translate(".concat(scale.x(x), ", ").concat(scale.y(y), ")\n rotate(").concat(angle, " 0 0)")
|
|
91
97
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/tools/shared/point/arrow-point.jsx"],"names":["RawArrow","props","classes","className","x","y","disabled","correctness","graphProps","from","to","rest","scale","angle","points","arrowDimensions","vector","point","React","Component","PropTypes","object","string","bool","number","shape","isRequired","types","GraphPropsType"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/tools/shared/point/arrow-point.jsx"],"names":["RawArrow","props","classes","className","x","y","disabled","correctness","graphProps","from","to","rest","scale","angle","points","arrowDimensions","vector","point","React","Component","PropTypes","object","string","bool","number","shape","isRequired","types","GraphPropsType"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEaA,Q;;;;;;;;;;;;;WAwBX,kBAAS;AACP,wBAWI,KAAKC,KAXT;AAAA,UACEC,OADF,eACEA,OADF;AAAA,UAEEC,SAFF,eAEEA,SAFF;AAAA,UAGEC,CAHF,eAGEA,CAHF;AAAA,UAIEC,CAJF,eAIEA,CAJF;AAAA,UAKEC,QALF,eAKEA,QALF;AAAA,UAMEC,WANF,eAMEA,WANF;AAAA,UAOEC,UAPF,eAOEA,UAPF;AAAA,UAQEC,IARF,eAQEA,IARF;AAAA,UASEC,EATF,eASEA,EATF;AAAA,UAUKC,IAVL,oDADO,CAaP;AACA;;;AAEA,UAAQC,KAAR,GAAkBJ,UAAlB,CAAQI,KAAR;AACA,UAAMC,KAAK,GAAG,wBAAYJ,IAAI,CAACL,CAAjB,EAAoBK,IAAI,CAACJ,CAAzB,EAA4BK,EAAE,CAACN,CAA/B,EAAkCM,EAAE,CAACL,CAArC,CAAd;AAEA,UAAIS,MAAM,GAAG,EAAb;;AAEA,UAAI,yBAAQL,IAAR,EAAcC,EAAd,CAAJ,EAAuB;AACrBI,QAAAA,MAAM,GAAG,aAAT;AACD,OAFD,MAEO;AACLA,QAAA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C,EAAAA,EAAE,EAAE;AAFgB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { types } from '@pie-lib/plot';\nimport isEqual from 'lodash/isEqual';\nimport { getAngleDeg, arrowDimensions } from '../../../utils';\n\nexport class RawArrow 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,\n y: PropTypes.number,\n from: PropTypes.shape({\n x: PropTypes.number,\n y: PropTypes.number\n }).isRequired,\n to: PropTypes.shape({\n x: PropTypes.number,\n y: PropTypes.number\n }),\n graphProps: types.GraphPropsType.isRequired\n };\n\n static defaultProps = {\n from: {},\n to: {}\n };\n\n render() {\n const {\n classes,\n className,\n x,\n y,\n disabled,\n correctness,\n graphProps,\n from,\n to,\n ...rest\n } = this.props;\n // x & y are the initial coordinates for the arrow\n // from & to are used only to calculate the angle that the arrow should be rotated with\n\n const { scale } = graphProps;\n const angle = getAngleDeg(from.x, from.y, to.x, to.y);\n\n let points = '';\n\n if (isEqual(from, to)) {\n points = '0,0 0,0 0,0';\n } else {\n points = `0,0 ${arrowDimensions.vector},${arrowDimensions.vector * 2} \n -${arrowDimensions.vector},${arrowDimensions.vector * 2}`;\n }\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 <polygon\n points={points}\n transform={`\n translate(${scale.x(x)}, ${scale.y(y)})\n rotate(${angle} 0 0)`}\n />\n </g>\n );\n }\n}\n"],"file":"arrow-point.js"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -17,9 +19,9 @@ var _arrowHead = require("../arrow-head");
|
|
|
17
19
|
|
|
18
20
|
var _utils = require("../../../utils");
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
var _excluded = ["classes", "angle", "className", "x", "y", "disabled", "correctness", "graphProps"];
|
|
21
23
|
|
|
22
|
-
function
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
25
|
|
|
24
26
|
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); }
|
|
25
27
|
|
|
@@ -31,29 +33,33 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
31
33
|
|
|
32
34
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
33
35
|
|
|
34
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
36
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
37
|
|
|
36
|
-
function
|
|
38
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
37
39
|
|
|
38
|
-
function
|
|
40
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
39
41
|
|
|
40
|
-
function
|
|
42
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
41
43
|
|
|
42
|
-
function
|
|
44
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
43
45
|
|
|
44
|
-
function
|
|
46
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
|
+
|
|
48
|
+
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
|
+
|
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
51
|
|
|
46
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; }
|
|
47
53
|
|
|
48
|
-
var Arrow =
|
|
49
|
-
/*#__PURE__*/
|
|
50
|
-
function (_React$Component) {
|
|
54
|
+
var Arrow = /*#__PURE__*/function (_React$Component) {
|
|
51
55
|
_inherits(Arrow, _React$Component);
|
|
52
56
|
|
|
57
|
+
var _super = _createSuper(Arrow);
|
|
58
|
+
|
|
53
59
|
function Arrow() {
|
|
54
60
|
_classCallCheck(this, Arrow);
|
|
55
61
|
|
|
56
|
-
return
|
|
62
|
+
return _super.apply(this, arguments);
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
_createClass(Arrow, [{
|
|
@@ -91,7 +97,7 @@ function (_React$Component) {
|
|
|
91
97
|
disabled = _this$props.disabled,
|
|
92
98
|
correctness = _this$props.correctness,
|
|
93
99
|
graphProps = _this$props.graphProps,
|
|
94
|
-
rest = _objectWithoutProperties(_this$props,
|
|
100
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
95
101
|
|
|
96
102
|
var size = (0, _utils.thinnerShapesNeeded)(graphProps) ? 12 : 14;
|
|
97
103
|
var scale = graphProps.scale;
|
|
@@ -110,9 +116,9 @@ function (_React$Component) {
|
|
|
110
116
|
transform = this.getRotationWithBreakpoint(angle, 280, scaledX, scaledY);
|
|
111
117
|
}
|
|
112
118
|
|
|
113
|
-
return _react["default"].createElement("g", _extends({
|
|
119
|
+
return /*#__PURE__*/_react["default"].createElement("g", _extends({
|
|
114
120
|
className: (0, _classnames["default"])(classes.point, disabled && classes.disabled, classes[correctness], className)
|
|
115
|
-
}, rest), _react["default"].createElement(_arrowHead.ArrowHead, {
|
|
121
|
+
}, rest), /*#__PURE__*/_react["default"].createElement(_arrowHead.ArrowHead, {
|
|
116
122
|
size: size,
|
|
117
123
|
transform: transform,
|
|
118
124
|
points: points
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/tools/shared/point/arrow.jsx"],"names":["Arrow","currentAngle","referenceAngle","x","y","breakpoint","firstBreakpoint","secondBreakpoint","t","props","classes","angle","className","disabled","correctness","graphProps","rest","size","scale","scaledX","scaledY","transform","points","getRotation","getRotationWithBreakpoint","point","React","Component","PropTypes","object","string","bool","number","isRequired","types","GraphPropsType"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/tools/shared/point/arrow.jsx"],"names":["Arrow","currentAngle","referenceAngle","x","y","breakpoint","firstBreakpoint","secondBreakpoint","t","props","classes","angle","className","disabled","correctness","graphProps","rest","size","scale","scaledX","scaledY","transform","points","getRotation","getRotationWithBreakpoint","point","React","Component","PropTypes","object","string","bool","number","isRequired","types","GraphPropsType"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEqBA,K;;;;;;;;;;;;;WAYnB,qBAAYC,YAAZ,EAA0BC,cAA1B,EAA0CC,CAA1C,EAA6CC,CAA7C,EAAgD;AAC9C,UAAMC,UAAU,GAAGH,cAAc,GAAG,EAApC;AACA,8BAAiB,CAACD,YAAD,IAAiBA,YAAY,GAAGI,UAAf,GAA4B,EAA5B,GAAiC,CAAlD,CAAjB,eAA0EF,CAA1E,cAA+EC,CAA/E;AACD;;;WAED,mCAA0BH,YAA1B,EAAwCC,cAAxC,EAAwDC,CAAxD,EAA2DC,CAA3D,EAA8D;AAC5D,UAAME,eAAe,GAAGJ,cAAc,GAAG,EAAzC;AACA,UAAMK,gBAAgB,GAAGL,cAAc,GAAG,EAA1C;AACA,UAAIM,CAAJ;;AACA,UAAIP,YAAY,IAAIK,eAAhB,IAAmCL,YAAY,GAAGM,gBAAtD,EAAwE;AACtEC,QAAAA,CAAC,GAAG,EAAJ;AACD,OAFD,MAEO,IAAIP,YAAY,GAAGM,gBAAnB,EAAqC;AAC1CC,QAAAA,CAAC,GAAG,CAAJ;AACD,OAFM,MAEA;AACLA,QAAAA,CAAC,GAAG,CAAJ;AACD;;AACD,8BAAiB,CAACP,YAAD,GAAgBO,CAAjC,eAAuCL,CAAvC,cAA4CC,CAA5C;AACD;;;WAED,kBAAS;AACP,wBAUI,KAAKK,KAVT;AAAA,UACEC,OADF,eACEA,OADF;AAAA,U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;AACD,OAFM,MAEA;AACLC,QAAAA,SAAS,GAAG,KAAKG,yBAAL,CAA+Bb,KAA/B,EAAsC,GAAtC,EAA2CQ,OAA3C,EAAoDC,OAApD,CAAZ;AACD;;AAED,0BACE;AACE,QAAA,SAAS,EAAE,4BACTV,OAAO,CAACe,KADC,EAETZ,QAAQ,IAAIH,OAAO,CAACG,QAFX,EAGTH,OAAO,CAACI,WAAD,CAHE,EAITF,SAJS;AADb,SAOMI,IAPN,gBASE,gCAAC,oBAAD;AAAW,QAAA,IAAI,EAAEC,IAAjB;AAAuB,QAAA,SAAS,EAAEI,SAAlC;AAA6C,QAAA,MAAM,EAAEC;AAArD,QATF,CADF;AAaD;;;;EA9EgCI,kBAAMC,S;;;;gBAApB3B,K,eACA;AACjBU,EAAAA,OAAO,EAAEkB,sBAAUC,MADF;AAEjBjB,EAAAA,SAAS,EAAEgB,sBAAUE,MAFJ;AAGjBhB,EAAAA,WAAW,EAAEc,sBAAUE,MAHN;AAIjBjB,EAAAA,QAAQ,EAAEe,sBAAUG,IAJH;AAKjB5B,EAAAA,CAAC,EAAEyB,sBAAUI,MAAV,CAAiBC,UALH;AAMjB7B,EAAAA,CAAC,EAAEwB,sBAAUI,MAAV,CAAiBC,UANH;AAOjBtB,EAAAA,KAAK,EAAEiB,sBAAUI,MAAV,CAAiBC,UAPP;AAQjBlB,EAAAA,UAAU,EAAEmB,YAAMC,cAAN,CAAqBF;AARhB,C","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 getRotation(currentAngle, referenceAngle, x, y) {\n const breakpoint = referenceAngle + 10;\n return `rotate(${-currentAngle - (currentAngle > breakpoint ? 15 : 0)}, ${x},${y})`;\n }\n\n getRotationWithBreakpoint(currentAngle, referenceAngle, x, y) {\n const firstBreakpoint = referenceAngle + 10;\n const secondBreakpoint = referenceAngle + 65;\n let t;\n if (currentAngle >= firstBreakpoint && currentAngle < secondBreakpoint) {\n t = 15;\n } else if (currentAngle > secondBreakpoint) {\n t = 7;\n } else {\n t = 0;\n }\n return `rotate(${-currentAngle + t}, ${x},${y})`;\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 let transform;\n const points = `${scaledX},${scaledY}\n ${scaledX - size},${scaledY - size / 2}\n ${scaledX - size}, ${scaledY + size / 2}`;\n\n if (angle >= 0 && angle < 90) {\n transform = this.getRotation(angle, 0, scaledX, scaledY);\n } else if (angle >= 90 && angle < 180) {\n transform = this.getRotationWithBreakpoint(angle, 90, scaledX, scaledY);\n } else if (angle >= 180 && angle < 270) {\n transform = this.getRotation(angle, 180, scaledX, scaledY);\n } else {\n transform = this.getRotationWithBreakpoint(angle, 280, scaledX, scaledY);\n }\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"],"file":"arrow.js"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -19,9 +21,9 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
19
21
|
|
|
20
22
|
var _utils = require("../../../utils");
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
var _excluded = ["classes", "className", "coordinatesOnHover", "x", "y", "disabled", "correctness", "graphProps", "labelNode"];
|
|
23
25
|
|
|
24
|
-
function
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
27
|
|
|
26
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); }
|
|
27
29
|
|
|
@@ -33,31 +35,35 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
33
35
|
|
|
34
36
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
35
37
|
|
|
36
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
38
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
37
39
|
|
|
38
|
-
function
|
|
40
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
39
41
|
|
|
40
|
-
function
|
|
42
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
43
|
|
|
42
|
-
function
|
|
44
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
43
45
|
|
|
44
|
-
function
|
|
46
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
45
47
|
|
|
46
|
-
function
|
|
48
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
49
|
+
|
|
50
|
+
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
|
+
|
|
52
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
53
|
|
|
48
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; }
|
|
49
55
|
|
|
50
|
-
var RawBp =
|
|
51
|
-
/*#__PURE__*/
|
|
52
|
-
function (_React$Component) {
|
|
56
|
+
var RawBp = /*#__PURE__*/function (_React$Component) {
|
|
53
57
|
_inherits(RawBp, _React$Component);
|
|
54
58
|
|
|
59
|
+
var _super = _createSuper(RawBp);
|
|
60
|
+
|
|
55
61
|
function RawBp(props) {
|
|
56
62
|
var _this;
|
|
57
63
|
|
|
58
64
|
_classCallCheck(this, RawBp);
|
|
59
65
|
|
|
60
|
-
_this =
|
|
66
|
+
_this = _super.call(this, props);
|
|
61
67
|
_this.state = {
|
|
62
68
|
showCoordinates: false
|
|
63
69
|
};
|
|
@@ -79,12 +85,12 @@ function (_React$Component) {
|
|
|
79
85
|
correctness = _this$props.correctness,
|
|
80
86
|
graphProps = _this$props.graphProps,
|
|
81
87
|
labelNode = _this$props.labelNode,
|
|
82
|
-
rest = _objectWithoutProperties(_this$props,
|
|
88
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
83
89
|
|
|
84
90
|
var showCoordinates = this.state.showCoordinates;
|
|
85
91
|
var scale = graphProps.scale;
|
|
86
92
|
var r = (0, _utils.thinnerShapesNeeded)(graphProps) ? 5 : 7;
|
|
87
|
-
return _react["default"].createElement("g", _extends({
|
|
93
|
+
return /*#__PURE__*/_react["default"].createElement("g", _extends({
|
|
88
94
|
className: (0, _classnames["default"])(classes.point, disabled && classes.disabled, classes[correctness], className),
|
|
89
95
|
onMouseEnter: function onMouseEnter() {
|
|
90
96
|
return _this2.setState({
|
|
@@ -96,11 +102,11 @@ function (_React$Component) {
|
|
|
96
102
|
showCoordinates: false
|
|
97
103
|
});
|
|
98
104
|
}
|
|
99
|
-
}, rest), _react["default"].createElement("circle", {
|
|
105
|
+
}, rest), /*#__PURE__*/_react["default"].createElement("circle", {
|
|
100
106
|
r: r,
|
|
101
107
|
cx: scale.x(x),
|
|
102
108
|
cy: scale.y(y)
|
|
103
|
-
}), labelNode && coordinatesOnHover && showCoordinates && _reactDom["default"].createPortal(_react["default"].createElement(_coordinatesLabel["default"], {
|
|
109
|
+
}), labelNode && coordinatesOnHover && showCoordinates && /*#__PURE__*/_reactDom["default"].createPortal( /*#__PURE__*/_react["default"].createElement(_coordinatesLabel["default"], {
|
|
104
110
|
graphProps: graphProps,
|
|
105
111
|
x: x,
|
|
106
112
|
y: y
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/tools/shared/point/base-point.jsx"],"names":["RawBp","props","state","showCoordinates","classes","className","coordinatesOnHover","x","y","disabled","correctness","graphProps","labelNode","rest","scale","r","point","setState","ReactDOM","createPortal","React","Component","PropTypes","object","string","bool","number","types","GraphPropsType","isRequired"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/tools/shared/point/base-point.jsx"],"names":["RawBp","props","state","showCoordinates","classes","className","coordinatesOnHover","x","y","disabled","correctness","graphProps","labelNode","rest","scale","r","point","setState","ReactDOM","createPortal","React","Component","PropTypes","object","string","bool","number","types","GraphPropsType","isRequired"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEaA,K;;;;;AAaX,iBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACjB,8BAAMA,KAAN;AACA,UAAKC,KAAL,GAAa;AAAEC,MAAAA,eAAe,EAAE;AAAnB,KAAb;AAFiB;AAGlB;;;;WAED,kBAAS;AAAA;;AACP,wBAWI,KAAKF,KAXT;AAAA,UACEG,OADF,eACEA,OADF;AAAA,UAEEC,SAFF,eAEEA,SAFF;AAAA,UAGEC,kBAHF,eAGEA,kBAHF;AAAA,UAIEC,CAJF,eAIEA,CAJF;AAAA,UAKEC,CALF,eAKEA,CALF;AAAA,UAMEC,QANF,eAMEA,QANF;AAAA,UAOEC,WAPF,eAOEA,WAPF;AAAA,UAQEC,UARF,eAQEA,UARF;AAAA,UASEC,SATF,eASEA,SATF;AAAA,UAUKC,IAVL;;AAYA,UAAQV,eAAR,GAA4B,KAAKD,KAAjC,CAAQC,eAAR;AACA,UAAQW,K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,sBAAUI,MAPI;AAQjBlB,EAAAA,CAAC,EAAEc,sBAAUI,MARI;AASjBf,EAAAA,UAAU,EAAEgB,YAAMC,cAAN,CAAqBC;AAThB,C","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"],"file":"base-point.js"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
|
-
exports.
|
|
8
|
+
exports.BasePoint = exports.ArrowPoint = exports.Arrow = void 0;
|
|
7
9
|
|
|
8
10
|
var _index = require("@material-ui/core/styles/index");
|
|
9
11
|
|
|
@@ -23,11 +25,13 @@ var _arrow = _interopRequireDefault(require("./arrow"));
|
|
|
23
25
|
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
27
|
|
|
26
|
-
function
|
|
28
|
+
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
|
+
|
|
30
|
+
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; }
|
|
27
31
|
|
|
28
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
32
|
+
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; }
|
|
29
33
|
|
|
30
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
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) { _defineProperty(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; }
|
|
31
35
|
|
|
32
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; }
|
|
33
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/tools/shared/point/index.jsx"],"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","RawBp","ArrowPoint","RawArrow","Arrow","BaseArrow"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/tools/shared/point/index.jsx"],"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","RawBp","ArrowPoint","RawArrow","Arrow","BaseArrow"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,IAAI,GAAG;AACXC,EAAAA,MAAM,EAAE,gBAACC,KAAD,QAA8B;AAAA,QAApBC,MAAoB,QAApBA,MAAoB;AAAA,QAAZC,KAAY,QA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AAclB,IAAd,EAAoB2B,gBAApB,CAAnB,CAAlB;;AACA,IAAMC,UAAU,GAAG,uBAAWV,MAAX,EAAmB,yBAAclB,IAAd,EAAoB6B,oBAApB,CAAnB,CAAnB;;AACA,IAAMC,KAAK,GAAG,uBAAWZ,MAAX,EAAmB,yBAAclB,IAAd,EAAoB+B,iBAApB,CAAnB,CAAd","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"],"file":"index.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/tools/sine/component.jsx"],"names":["log","Sine","props","domain","graphProps","root","edge","amplitude","freq","interval","FREQ_DIVIDER","dataPoints","x","min","max","phase","vertical","y","Component"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,uBAAN,CAAZ;AAEAA,GAAG,CAAC,SAAD,CAAH;AAEA,IAAMC,IAAI,GAAG,gCAAa,UAAAC,KAAK,EAAI;
|
|
1
|
+
{"version":3,"sources":["../../../src/tools/sine/component.jsx"],"names":["log","Sine","props","domain","graphProps","root","edge","amplitude","freq","interval","FREQ_DIVIDER","dataPoints","x","min","max","phase","vertical","y","Component"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,uBAAN,CAAZ;AAEAA,GAAG,CAAC,SAAD,CAAH;AAEA,IAAMC,IAAI,GAAG,gCAAa,UAAAC,KAAK,EAAI;AACjC,MAAQC,MAAR,GAAmBD,KAAK,CAACE,UAAzB,CAAQD,MAAR;AAEA,MAAQE,IAAR,GAAuBH,KAAvB,CAAQG,IAAR;AAAA,MAAcC,IAAd,GAAuBJ,KAAvB,CAAcI,IAAd;;AACA,6BAA4B,wCAAoBD,IAApB,EAA0BC,IAA1B,CAA5B;AAAA,MAAQC,SAAR,wBAAQA,SAAR;AAAA,MAAmBC,IAAnB,wBAAmBA,IAAnB;;AACA,MAAMC,QAAQ,GAAGD,IAAI,GAAGE,2BAAxB;AACAV,EAAAA,GAAG,CAAC,wBAAD,EAA2BO,SAA3B,EAAsC,OAAtC,EAA+CC,IAA/C,CAAH;AAEA,MAAMG,UAAU,GACdL,IAAI,IAAIA,IAAI,CAACM,CAAL,KAAWP,IAAI,CAACO,CAAxB,GACI,EADJ,GAEI,oCACET,MAAM,CAACU,GADT,EAEEV,MAAM,CAACW,GAFT,EAGET,IAHF,EAIEC,IAJF,EAKEG,QALF,EAME,yBAAKF,SAAL,EAAgBC,IAAhB,EAAsB;AAAEO,IAAAA,KAAK,EAAEV,IAAI,CAACO,CAAd;AAAiBI,IAAAA,QAAQ,EAAEX,IAAI,CAACY;AAAhC,GAAtB,CANF,CAHN;AAWA,SAAO;AAAEZ,IAAAA,IAAI,EAAEH,KAAK,CAACG,IAAd;AAAoBC,IAAAA,IAAI,EAAEJ,KAAK,CAACI,IAAhC;AAAsCK,IAAAA,UAAU,EAAVA;AAAtC,GAAP;AACD,CApBY,CAAb;AAsBA,IAAMO,SAAS,GAAG,qCAAkBjB,IAAlB,CAAlB;eACeiB,S","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"],"file":"component.js"}
|