@pie-lib/graphing 2.34.2-next.0 → 2.36.0-mui-update.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -6
- package/lib/axis/arrow.js +19 -55
- package/lib/axis/arrow.js.map +1 -1
- package/lib/axis/axes.js +104 -186
- package/lib/axis/axes.js.map +1 -1
- package/lib/axis/index.js +1 -6
- package/lib/axis/index.js.map +1 -1
- package/lib/bg.js +21 -49
- package/lib/bg.js.map +1 -1
- package/lib/container/actions.js +2 -8
- package/lib/container/actions.js.map +1 -1
- package/lib/container/index.js +14 -59
- package/lib/container/index.js.map +1 -1
- package/lib/container/marks.js +1 -6
- package/lib/container/marks.js.map +1 -1
- package/lib/container/middleware.js +2 -8
- package/lib/container/middleware.js.map +1 -1
- package/lib/container/reducer.js +1 -8
- package/lib/container/reducer.js.map +1 -1
- package/lib/coordinates-label.js +23 -55
- package/lib/coordinates-label.js.map +1 -1
- package/lib/graph-with-controls.js +120 -184
- package/lib/graph-with-controls.js.map +1 -1
- package/lib/graph.js +59 -116
- package/lib/graph.js.map +1 -1
- package/lib/grid-setup.js +174 -224
- package/lib/grid-setup.js.map +1 -1
- package/lib/grid.js +28 -73
- package/lib/grid.js.map +1 -1
- package/lib/index.js +1 -13
- package/lib/index.js.map +1 -1
- package/lib/key-legend.js +41 -85
- package/lib/key-legend.js.map +1 -1
- package/lib/label-svg-icon.js +1 -7
- package/lib/label-svg-icon.js.map +1 -1
- package/lib/labels.js +61 -119
- package/lib/labels.js.map +1 -1
- package/lib/mark-label.js +113 -163
- package/lib/mark-label.js.map +1 -1
- package/lib/toggle-bar.js +158 -242
- package/lib/toggle-bar.js.map +1 -1
- package/lib/tool-menu.js +16 -48
- package/lib/tool-menu.js.map +1 -1
- package/lib/tools/absolute/component.js +4 -10
- package/lib/tools/absolute/component.js.map +1 -1
- package/lib/tools/absolute/index.js +3 -16
- package/lib/tools/absolute/index.js.map +1 -1
- package/lib/tools/circle/bg-circle.js +42 -92
- package/lib/tools/circle/bg-circle.js.map +1 -1
- package/lib/tools/circle/component.js +79 -165
- package/lib/tools/circle/component.js.map +1 -1
- package/lib/tools/circle/index.js +3 -13
- package/lib/tools/circle/index.js.map +1 -1
- package/lib/tools/exponential/component.js +4 -10
- package/lib/tools/exponential/component.js.map +1 -1
- package/lib/tools/exponential/index.js +3 -18
- package/lib/tools/exponential/index.js.map +1 -1
- package/lib/tools/index.js +3 -16
- package/lib/tools/index.js.map +1 -1
- package/lib/tools/line/component.js +27 -48
- package/lib/tools/line/component.js.map +1 -1
- package/lib/tools/line/index.js +1 -6
- package/lib/tools/line/index.js.map +1 -1
- package/lib/tools/parabola/component.js +4 -10
- package/lib/tools/parabola/component.js.map +1 -1
- package/lib/tools/parabola/index.js +3 -16
- package/lib/tools/parabola/index.js.map +1 -1
- package/lib/tools/point/component.js +24 -71
- package/lib/tools/point/component.js.map +1 -1
- package/lib/tools/point/index.js +3 -11
- package/lib/tools/point/index.js.map +1 -1
- package/lib/tools/polygon/component.js +82 -183
- package/lib/tools/polygon/component.js.map +1 -1
- package/lib/tools/polygon/index.js +6 -23
- package/lib/tools/polygon/index.js.map +1 -1
- package/lib/tools/polygon/line.js +48 -91
- package/lib/tools/polygon/line.js.map +1 -1
- package/lib/tools/polygon/polygon.js +65 -98
- package/lib/tools/polygon/polygon.js.map +1 -1
- package/lib/tools/ray/component.js +41 -60
- package/lib/tools/ray/component.js.map +1 -1
- package/lib/tools/ray/index.js +1 -6
- package/lib/tools/ray/index.js.map +1 -1
- package/lib/tools/segment/component.js +25 -43
- package/lib/tools/segment/component.js.map +1 -1
- package/lib/tools/segment/index.js +1 -6
- package/lib/tools/segment/index.js.map +1 -1
- package/lib/tools/shared/arrow-head.js +69 -28
- package/lib/tools/shared/arrow-head.js.map +1 -1
- package/lib/tools/shared/icons/CorrectSVG.js +3 -8
- package/lib/tools/shared/icons/CorrectSVG.js.map +1 -1
- package/lib/tools/shared/icons/IncorrectSVG.js +3 -8
- package/lib/tools/shared/icons/IncorrectSVG.js.map +1 -1
- package/lib/tools/shared/icons/MissingSVG.js +3 -8
- package/lib/tools/shared/icons/MissingSVG.js.map +1 -1
- package/lib/tools/shared/line/index.js +126 -187
- package/lib/tools/shared/line/index.js.map +1 -1
- package/lib/tools/shared/line/line-path.js +70 -100
- package/lib/tools/shared/line/line-path.js.map +1 -1
- package/lib/tools/shared/line/with-root-edge.js +21 -55
- package/lib/tools/shared/line/with-root-edge.js.map +1 -1
- package/lib/tools/shared/point/arrow-point.js +23 -62
- package/lib/tools/shared/point/arrow-point.js.map +1 -1
- package/lib/tools/shared/point/arrow.js +24 -52
- package/lib/tools/shared/point/arrow.js.map +1 -1
- package/lib/tools/shared/point/base-point.js +54 -72
- package/lib/tools/shared/point/base-point.js.map +1 -1
- package/lib/tools/shared/point/index.js +22 -57
- package/lib/tools/shared/point/index.js.map +1 -1
- package/lib/tools/shared/styles.js +10 -38
- package/lib/tools/shared/styles.js.map +1 -1
- package/lib/tools/shared/types.js +2 -9
- package/lib/tools/shared/types.js.map +1 -1
- package/lib/tools/sine/component.js +8 -19
- package/lib/tools/sine/component.js.map +1 -1
- package/lib/tools/sine/index.js +3 -16
- package/lib/tools/sine/index.js.map +1 -1
- package/lib/tools/vector/component.js +24 -44
- package/lib/tools/vector/component.js.map +1 -1
- package/lib/tools/vector/index.js +1 -6
- package/lib/tools/vector/index.js.map +1 -1
- package/lib/undo-redo.js +29 -69
- package/lib/undo-redo.js.map +1 -1
- package/lib/use-debounce.js +4 -11
- package/lib/use-debounce.js.map +1 -1
- package/lib/utils.js +51 -128
- package/lib/utils.js.map +1 -1
- package/package.json +16 -13
- package/src/axis/arrow.jsx +7 -12
- package/src/axis/axes.jsx +40 -45
- package/src/coordinates-label.jsx +13 -18
- package/src/graph-with-controls.jsx +52 -59
- package/src/grid-setup.jsx +210 -206
- package/src/grid.jsx +1 -3
- package/src/key-legend.jsx +52 -56
- package/src/labels.jsx +21 -30
- package/src/mark-label.jsx +83 -81
- package/src/toggle-bar.jsx +155 -166
- package/src/tools/circle/bg-circle.jsx +20 -28
- package/src/tools/circle/component.jsx +28 -63
- package/src/tools/line/component.jsx +22 -15
- package/src/tools/polygon/component.jsx +1 -2
- package/src/tools/polygon/line.jsx +28 -32
- package/src/tools/polygon/polygon.jsx +52 -45
- package/src/tools/ray/component.jsx +38 -25
- package/src/tools/segment/component.jsx +19 -18
- package/src/tools/shared/arrow-head.jsx +60 -7
- package/src/tools/shared/line/index.jsx +39 -2
- package/src/tools/shared/line/line-path.jsx +54 -58
- package/src/tools/shared/point/arrow-point.jsx +10 -24
- package/src/tools/shared/point/arrow.jsx +5 -11
- package/src/tools/shared/point/base-point.jsx +42 -19
- package/src/tools/shared/point/index.jsx +27 -44
- package/src/tools/vector/component.jsx +11 -16
- package/src/undo-redo.jsx +19 -21
package/lib/coordinates-label.js
CHANGED
|
@@ -1,109 +1,77 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.getLabelPosition = exports["default"] = exports.CoordinatesLabel = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
11
|
var _plot = require("@pie-lib/plot");
|
|
17
|
-
|
|
18
12
|
var _renderUi = require("@pie-lib/render-ui");
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
var _InputBase = _interopRequireDefault(require("@material-ui/core/InputBase"));
|
|
23
|
-
|
|
13
|
+
var _styles = require("@mui/material/styles");
|
|
14
|
+
var _InputBase = _interopRequireDefault(require("@mui/material/InputBase"));
|
|
24
15
|
var _utils = require("./utils");
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var styles = function styles(theme) {
|
|
16
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
+
var StyledInputBase = (0, _styles.styled)(_InputBase["default"])(function (_ref) {
|
|
19
|
+
var theme = _ref.theme;
|
|
31
20
|
return {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
inputLabel: {
|
|
21
|
+
fontFamily: theme.typography.fontFamily,
|
|
22
|
+
fontSize: theme.typography.fontSize,
|
|
23
|
+
borderRadius: '8px',
|
|
24
|
+
background: theme.palette.common.white,
|
|
25
|
+
color: _renderUi.color.defaults.PRIMARY_DARK,
|
|
26
|
+
'& .MuiInputBase-input': {
|
|
40
27
|
padding: 0
|
|
41
28
|
}
|
|
42
29
|
};
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var getLabelPosition = function getLabelPosition(graphProps, x, y, labelLength) {
|
|
30
|
+
});
|
|
31
|
+
var getLabelPosition = exports.getLabelPosition = function getLabelPosition(graphProps, x, y, labelLength) {
|
|
46
32
|
var scale = graphProps.scale,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
domain = graphProps.domain,
|
|
34
|
+
range = graphProps.range;
|
|
35
|
+
// treat corner cases for maximum and minimum
|
|
50
36
|
var topShift = y === range.min ? 16 : y === range.max ? 0 : 8;
|
|
51
37
|
var leftShift = 10;
|
|
52
38
|
var rightEdge = scale.x(x) + labelLength + leftShift;
|
|
53
|
-
|
|
54
39
|
if (rightEdge >= scale.x(domain.max)) {
|
|
55
40
|
return {
|
|
56
41
|
left: scale.x(x) - leftShift - labelLength,
|
|
57
42
|
top: scale.y(y) - topShift
|
|
58
43
|
};
|
|
59
44
|
}
|
|
60
|
-
|
|
61
45
|
return {
|
|
62
46
|
left: scale.x(x) + leftShift,
|
|
63
47
|
top: scale.y(y) - topShift
|
|
64
48
|
};
|
|
65
49
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var x = _ref.x,
|
|
71
|
-
y = _ref.y,
|
|
72
|
-
graphProps = _ref.graphProps,
|
|
73
|
-
classes = _ref.classes;
|
|
50
|
+
var CoordinatesLabel = exports.CoordinatesLabel = function CoordinatesLabel(_ref2) {
|
|
51
|
+
var x = _ref2.x,
|
|
52
|
+
y = _ref2.y,
|
|
53
|
+
graphProps = _ref2.graphProps;
|
|
74
54
|
var label = "(".concat((0, _utils.roundNumber)(x), ", ").concat((0, _utils.roundNumber)(y), ")");
|
|
75
55
|
var labelLength = (label.length || 0) * 6;
|
|
76
56
|
var labelPosition = getLabelPosition(graphProps, x, y, labelLength);
|
|
77
|
-
|
|
78
57
|
var style = _objectSpread({
|
|
79
58
|
position: 'absolute',
|
|
80
59
|
pointerEvents: 'auto',
|
|
81
60
|
width: labelLength,
|
|
82
61
|
padding: 0
|
|
83
62
|
}, labelPosition);
|
|
84
|
-
|
|
85
|
-
return /*#__PURE__*/_react["default"].createElement(_InputBase["default"], {
|
|
63
|
+
return /*#__PURE__*/_react["default"].createElement(StyledInputBase, {
|
|
86
64
|
style: style,
|
|
87
|
-
classes: {
|
|
88
|
-
input: classes.inputLabel
|
|
89
|
-
},
|
|
90
|
-
className: classes.input,
|
|
91
65
|
value: label,
|
|
92
66
|
inputProps: {
|
|
93
67
|
ariaLabel: 'naked'
|
|
94
68
|
}
|
|
95
69
|
});
|
|
96
70
|
};
|
|
97
|
-
|
|
98
|
-
exports.CoordinatesLabel = CoordinatesLabel;
|
|
99
71
|
CoordinatesLabel.propTypes = {
|
|
100
72
|
graphProps: _plot.types.GraphPropsType,
|
|
101
|
-
classes: _propTypes["default"].object,
|
|
102
73
|
x: _propTypes["default"].number,
|
|
103
74
|
y: _propTypes["default"].number
|
|
104
75
|
};
|
|
105
|
-
|
|
106
|
-
var _default = (0, _styles.withStyles)(styles)(CoordinatesLabel);
|
|
107
|
-
|
|
108
|
-
exports["default"] = _default;
|
|
76
|
+
var _default = exports["default"] = CoordinatesLabel;
|
|
109
77
|
//# sourceMappingURL=coordinates-label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"coordinates-label.js","names":["_react","_interopRequireDefault","require","_propTypes","_plot","_renderUi","_styles","_InputBase","_utils","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","StyledInputBase","styled","InputBase","_ref","theme","fontFamily","typography","fontSize","borderRadius","background","palette","common","white","color","defaults","PRIMARY_DARK","padding","getLabelPosition","exports","graphProps","x","y","labelLength","scale","domain","range","topShift","min","max","leftShift","rightEdge","left","top","CoordinatesLabel","_ref2","label","concat","roundNumber","labelPosition","style","position","pointerEvents","width","createElement","value","inputProps","ariaLabel","propTypes","types","GraphPropsType","PropTypes","number","_default"],"sources":["../src/coordinates-label.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { types } from '@pie-lib/plot';\nimport { color } from '@pie-lib/render-ui';\nimport { styled } from '@mui/material/styles';\nimport InputBase from '@mui/material/InputBase';\nimport { roundNumber } from './utils';\n\nconst StyledInputBase = styled(InputBase)(({ theme }) => ({\n fontFamily: theme.typography.fontFamily,\n fontSize: theme.typography.fontSize,\n borderRadius: '8px',\n background: theme.palette.common.white,\n color: color.defaults.PRIMARY_DARK,\n '& .MuiInputBase-input': {\n padding: 0,\n },\n}));\n\nexport const getLabelPosition = (graphProps, x, y, labelLength) => {\n const { scale, domain, range } = graphProps;\n // treat corner cases for maximum and minimum\n const topShift = y === range.min ? 16 : y === range.max ? 0 : 8;\n const leftShift = 10;\n const rightEdge = scale.x(x) + labelLength + leftShift;\n\n if (rightEdge >= scale.x(domain.max)) {\n return {\n left: scale.x(x) - leftShift - labelLength,\n top: scale.y(y) - topShift,\n };\n }\n\n return {\n left: scale.x(x) + leftShift,\n top: scale.y(y) - topShift,\n };\n};\n\nexport const CoordinatesLabel = ({ x, y, graphProps }) => {\n const label = `(${roundNumber(x)}, ${roundNumber(y)})`;\n const labelLength = (label.length || 0) * 6;\n const labelPosition = getLabelPosition(graphProps, x, y, labelLength);\n\n const style = {\n position: 'absolute',\n pointerEvents: 'auto',\n width: labelLength,\n padding: 0,\n ...labelPosition,\n };\n\n return (\n <StyledInputBase\n style={style}\n value={label}\n inputProps={{ ariaLabel: 'naked' }}\n />\n );\n};\n\nCoordinatesLabel.propTypes = {\n graphProps: types.GraphPropsType,\n x: PropTypes.number,\n y: PropTypes.number,\n};\n\nexport default CoordinatesLabel;\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,67 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.toolIsAvailable = exports.setToolbarAvailability = exports.getAvailableTool = exports.filterByVisibleToolTypes = exports.filterByValidToolTypes = exports["default"] = exports.GraphWithControls = void 0;
|
|
11
|
-
|
|
12
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
24
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
15
|
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
|
|
28
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
|
-
|
|
30
|
-
var _styles = require("@material-ui/core/styles");
|
|
31
|
-
|
|
32
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
33
|
-
|
|
17
|
+
var _styles = require("@mui/material/styles");
|
|
34
18
|
var _uniq = _interopRequireDefault(require("lodash/uniq"));
|
|
35
|
-
|
|
36
19
|
var _isString = _interopRequireDefault(require("lodash/isString"));
|
|
37
|
-
|
|
38
20
|
var _renderUi = require("@pie-lib/render-ui");
|
|
39
|
-
|
|
40
21
|
var _toolMenu = _interopRequireDefault(require("./tool-menu"));
|
|
41
|
-
|
|
42
22
|
var _graph = _interopRequireWildcard(require("./graph"));
|
|
43
|
-
|
|
44
23
|
var _undoRedo = _interopRequireDefault(require("./undo-redo"));
|
|
45
|
-
|
|
46
24
|
var _tools = require("./tools");
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
25
|
+
var _material = require("@mui/material");
|
|
26
|
+
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
27
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
28
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
29
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
30
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32
|
+
var StyledGraphContainer = (0, _styles.styled)('div')({
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
width: 'min-content'
|
|
36
|
+
});
|
|
37
|
+
var StyledControls = (0, _styles.styled)('div')(function (_ref) {
|
|
38
|
+
var theme = _ref.theme;
|
|
39
|
+
return {
|
|
40
|
+
display: 'flex',
|
|
41
|
+
justifyContent: 'space-between',
|
|
42
|
+
padding: theme.spacing(1),
|
|
43
|
+
color: _renderUi.color.text(),
|
|
44
|
+
backgroundColor: _renderUi.color.primaryLight(),
|
|
45
|
+
'& button': {
|
|
46
|
+
fontSize: theme.typography.fontSize
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
var StyledAccordion = (0, _styles.styled)(_material.Accordion)({
|
|
51
|
+
backgroundColor: _renderUi.color.primaryLight(),
|
|
52
|
+
width: '100%'
|
|
53
|
+
});
|
|
54
|
+
var StyledAccordionSummary = (0, _styles.styled)(_material.AccordionSummary)(function (_ref2) {
|
|
55
|
+
var theme = _ref2.theme;
|
|
56
|
+
return {
|
|
57
|
+
padding: "0 ".concat(theme.spacing(1), "px"),
|
|
58
|
+
minHeight: '32px !important',
|
|
59
|
+
'& .MuiAccordionSummary-content': {
|
|
60
|
+
margin: '4px 0 !important'
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
var StyledAccordionDetails = (0, _styles.styled)(_material.AccordionDetails)(function (_ref3) {
|
|
65
|
+
var theme = _ref3.theme;
|
|
66
|
+
return {
|
|
67
|
+
padding: 0,
|
|
68
|
+
marginTop: theme.spacing(1),
|
|
69
|
+
display: 'flex',
|
|
70
|
+
justifyContent: 'space-between'
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
var setToolbarAvailability = exports.setToolbarAvailability = function setToolbarAvailability(toolbarTools) {
|
|
65
74
|
return _tools.toolsArr.map(function (tA) {
|
|
66
75
|
return _objectSpread(_objectSpread({}, tA), {}, {
|
|
67
76
|
toolbar: !!toolbarTools.find(function (t) {
|
|
@@ -70,90 +79,64 @@ var setToolbarAvailability = function setToolbarAvailability(toolbarTools) {
|
|
|
70
79
|
});
|
|
71
80
|
}) || [];
|
|
72
81
|
};
|
|
73
|
-
|
|
74
|
-
exports.setToolbarAvailability = setToolbarAvailability;
|
|
75
|
-
|
|
76
|
-
var toolIsAvailable = function toolIsAvailable(tools, currentTool) {
|
|
82
|
+
var toolIsAvailable = exports.toolIsAvailable = function toolIsAvailable(tools, currentTool) {
|
|
77
83
|
return currentTool && tools && (tools.find(function (tool) {
|
|
78
84
|
return tool.type === currentTool.type;
|
|
79
85
|
}) || {}).toolbar;
|
|
80
86
|
};
|
|
81
|
-
|
|
82
|
-
exports.toolIsAvailable = toolIsAvailable;
|
|
83
|
-
|
|
84
|
-
var getAvailableTool = function getAvailableTool(tools) {
|
|
87
|
+
var getAvailableTool = exports.getAvailableTool = function getAvailableTool(tools) {
|
|
85
88
|
return tools.find(function (tool) {
|
|
86
89
|
return tool.toolbar;
|
|
87
90
|
});
|
|
88
91
|
};
|
|
89
|
-
|
|
90
|
-
exports.getAvailableTool = getAvailableTool;
|
|
91
|
-
|
|
92
|
-
var filterByValidToolTypes = function filterByValidToolTypes(backgroundMarks) {
|
|
92
|
+
var filterByValidToolTypes = exports.filterByValidToolTypes = function filterByValidToolTypes(backgroundMarks) {
|
|
93
93
|
return backgroundMarks.filter(function (bM) {
|
|
94
94
|
return !!_tools.allTools.find(function (tool) {
|
|
95
95
|
return tool === bM.type;
|
|
96
96
|
});
|
|
97
97
|
});
|
|
98
98
|
};
|
|
99
|
-
|
|
100
|
-
exports.filterByValidToolTypes = filterByValidToolTypes;
|
|
101
|
-
|
|
102
|
-
var filterByVisibleToolTypes = function filterByVisibleToolTypes(toolbarTools, marks) {
|
|
99
|
+
var filterByVisibleToolTypes = exports.filterByVisibleToolTypes = function filterByVisibleToolTypes(toolbarTools, marks) {
|
|
103
100
|
return marks.filter(function (bM) {
|
|
104
101
|
return !!toolbarTools.find(function (tool) {
|
|
105
102
|
return tool === bM.type;
|
|
106
103
|
});
|
|
107
104
|
});
|
|
108
105
|
};
|
|
109
|
-
|
|
110
|
-
exports.filterByVisibleToolTypes = filterByVisibleToolTypes;
|
|
111
|
-
|
|
112
106
|
var getDefaultCurrentTool = function getDefaultCurrentTool(toolType) {
|
|
113
107
|
return _tools.toolsArr.find(function (tool) {
|
|
114
108
|
return tool.type === toolType;
|
|
115
109
|
}) || null;
|
|
116
110
|
};
|
|
117
|
-
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
title = _ref.title;
|
|
122
|
-
return /*#__PURE__*/_react["default"].createElement(_core.ExpansionPanel, {
|
|
111
|
+
var Collapsible = function Collapsible(_ref4) {
|
|
112
|
+
var children = _ref4.children,
|
|
113
|
+
title = _ref4.title;
|
|
114
|
+
return /*#__PURE__*/_react["default"].createElement(StyledAccordion, {
|
|
123
115
|
elevation: 0,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
116
|
+
disableGutters: true,
|
|
117
|
+
square: true,
|
|
118
|
+
TransitionProps: {
|
|
119
|
+
timeout: {
|
|
120
|
+
enter: 225,
|
|
121
|
+
exit: 195
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledAccordionSummary, {
|
|
132
125
|
expandIcon: /*#__PURE__*/_react["default"].createElement(_ExpandMore["default"], null)
|
|
133
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
126
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Typography, {
|
|
134
127
|
variant: "subheading"
|
|
135
|
-
}, title)), /*#__PURE__*/_react["default"].createElement(
|
|
136
|
-
className: classes.details
|
|
137
|
-
}, children));
|
|
128
|
+
}, title)), /*#__PURE__*/_react["default"].createElement(StyledAccordionDetails, null, children));
|
|
138
129
|
};
|
|
139
|
-
|
|
140
130
|
Collapsible.propTypes = {
|
|
141
|
-
classes: _propTypes["default"].object,
|
|
142
131
|
children: _propTypes["default"].array,
|
|
143
132
|
title: _propTypes["default"].string
|
|
144
133
|
};
|
|
145
|
-
|
|
146
|
-
var GraphWithControls = /*#__PURE__*/function (_React$Component) {
|
|
147
|
-
(0, _inherits2["default"])(GraphWithControls, _React$Component);
|
|
148
|
-
|
|
149
|
-
var _super = _createSuper(GraphWithControls);
|
|
150
|
-
|
|
134
|
+
var GraphWithControls = exports.GraphWithControls = /*#__PURE__*/function (_React$Component) {
|
|
151
135
|
function GraphWithControls(props) {
|
|
152
136
|
var _this;
|
|
153
|
-
|
|
154
137
|
(0, _classCallCheck2["default"])(this, GraphWithControls);
|
|
155
|
-
_this =
|
|
156
|
-
(0, _defineProperty2["default"])(
|
|
138
|
+
_this = _callSuper(this, GraphWithControls, [props]);
|
|
139
|
+
(0, _defineProperty2["default"])(_this, "changeCurrentTool", function (tool, tools) {
|
|
157
140
|
return _this.setState({
|
|
158
141
|
currentTool: tools.find(function (t) {
|
|
159
142
|
return t.type === tool;
|
|
@@ -167,12 +150,11 @@ var GraphWithControls = /*#__PURE__*/function (_React$Component) {
|
|
|
167
150
|
};
|
|
168
151
|
return _this;
|
|
169
152
|
}
|
|
170
|
-
|
|
171
|
-
(0, _createClass2["default"])(GraphWithControls, [{
|
|
153
|
+
(0, _inherits2["default"])(GraphWithControls, _React$Component);
|
|
154
|
+
return (0, _createClass2["default"])(GraphWithControls, [{
|
|
172
155
|
key: "componentDidUpdate",
|
|
173
156
|
value: function componentDidUpdate(prevProps) {
|
|
174
157
|
var defaultTool = this.props.defaultTool;
|
|
175
|
-
|
|
176
158
|
if (prevProps.defaultTool !== defaultTool) {
|
|
177
159
|
var currentTool = getDefaultCurrentTool(defaultTool);
|
|
178
160
|
this.setState({
|
|
@@ -184,59 +166,60 @@ var GraphWithControls = /*#__PURE__*/function (_React$Component) {
|
|
|
184
166
|
key: "render",
|
|
185
167
|
value: function render() {
|
|
186
168
|
var _this2 = this;
|
|
187
|
-
|
|
188
169
|
var _this$state = this.state,
|
|
189
|
-
|
|
190
|
-
|
|
170
|
+
currentTool = _this$state.currentTool,
|
|
171
|
+
labelModeEnabled = _this$state.labelModeEnabled;
|
|
191
172
|
var _this$props = this.props,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
limitLabeling = _this$props.limitLabeling;
|
|
173
|
+
axesSettings = _this$props.axesSettings,
|
|
174
|
+
className = _this$props.className,
|
|
175
|
+
coordinatesOnHover = _this$props.coordinatesOnHover,
|
|
176
|
+
collapsibleToolbar = _this$props.collapsibleToolbar,
|
|
177
|
+
collapsibleToolbarTitle = _this$props.collapsibleToolbarTitle,
|
|
178
|
+
disabled = _this$props.disabled,
|
|
179
|
+
disabledLabels = _this$props.disabledLabels,
|
|
180
|
+
disabledTitle = _this$props.disabledTitle,
|
|
181
|
+
domain = _this$props.domain,
|
|
182
|
+
draggableTools = _this$props.draggableTools,
|
|
183
|
+
labels = _this$props.labels,
|
|
184
|
+
labelsPlaceholders = _this$props.labelsPlaceholders,
|
|
185
|
+
onChangeLabels = _this$props.onChangeLabels,
|
|
186
|
+
onChangeMarks = _this$props.onChangeMarks,
|
|
187
|
+
onChangeTitle = _this$props.onChangeTitle,
|
|
188
|
+
onChangeTools = _this$props.onChangeTools,
|
|
189
|
+
onUndo = _this$props.onUndo,
|
|
190
|
+
onRedo = _this$props.onRedo,
|
|
191
|
+
onReset = _this$props.onReset,
|
|
192
|
+
range = _this$props.range,
|
|
193
|
+
size = _this$props.size,
|
|
194
|
+
showLabels = _this$props.showLabels,
|
|
195
|
+
showPixelGuides = _this$props.showPixelGuides,
|
|
196
|
+
showTitle = _this$props.showTitle,
|
|
197
|
+
title = _this$props.title,
|
|
198
|
+
titlePlaceholder = _this$props.titlePlaceholder,
|
|
199
|
+
language = _this$props.language,
|
|
200
|
+
removeIncompleteTool = _this$props.removeIncompleteTool,
|
|
201
|
+
limitLabeling = _this$props.limitLabeling;
|
|
222
202
|
var _this$props2 = this.props,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
203
|
+
backgroundMarks = _this$props2.backgroundMarks,
|
|
204
|
+
marks = _this$props2.marks,
|
|
205
|
+
toolbarTools = _this$props2.toolbarTools;
|
|
226
206
|
|
|
207
|
+
// make sure only valid tool types are kept (string) and without duplicates
|
|
227
208
|
toolbarTools = (0, _uniq["default"])(toolbarTools || []).filter(function (tT) {
|
|
228
209
|
return !!(0, _isString["default"])(tT);
|
|
229
|
-
}) || [];
|
|
210
|
+
}) || [];
|
|
230
211
|
|
|
231
|
-
|
|
212
|
+
// keep only the backgroundMarks that have valid types
|
|
213
|
+
backgroundMarks = filterByValidToolTypes(backgroundMarks || []);
|
|
232
214
|
|
|
215
|
+
// keep only the marks that have types which appear in toolbar
|
|
233
216
|
marks = filterByVisibleToolTypes(toolbarTools, marks || []);
|
|
234
|
-
var tools = setToolbarAvailability(toolbarTools);
|
|
217
|
+
var tools = setToolbarAvailability(toolbarTools);
|
|
235
218
|
|
|
219
|
+
// set current tool if there's no current tool or if the existing one is no longer available
|
|
236
220
|
if (!currentTool || !toolIsAvailable(tools, currentTool)) {
|
|
237
221
|
currentTool = getAvailableTool(tools);
|
|
238
222
|
}
|
|
239
|
-
|
|
240
223
|
var graphActions = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_toolMenu["default"], {
|
|
241
224
|
currentToolType: currentTool && currentTool.type,
|
|
242
225
|
disabled: !!disabled,
|
|
@@ -254,13 +237,9 @@ var GraphWithControls = /*#__PURE__*/function (_React$Component) {
|
|
|
254
237
|
onReset: onReset,
|
|
255
238
|
language: language
|
|
256
239
|
}));
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
261
|
-
className: classes.controls
|
|
262
|
-
}, collapsibleToolbar ? /*#__PURE__*/_react["default"].createElement(Collapsible, {
|
|
263
|
-
classes: classes,
|
|
240
|
+
return /*#__PURE__*/_react["default"].createElement(StyledGraphContainer, {
|
|
241
|
+
className: className
|
|
242
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledControls, null, collapsibleToolbar ? /*#__PURE__*/_react["default"].createElement(Collapsible, {
|
|
264
243
|
title: collapsibleToolbarTitle
|
|
265
244
|
}, graphActions) : graphActions), /*#__PURE__*/_react["default"].createElement("div", {
|
|
266
245
|
ref: function ref(r) {
|
|
@@ -294,10 +273,7 @@ var GraphWithControls = /*#__PURE__*/function (_React$Component) {
|
|
|
294
273
|
}));
|
|
295
274
|
}
|
|
296
275
|
}]);
|
|
297
|
-
return GraphWithControls;
|
|
298
276
|
}(_react["default"].Component);
|
|
299
|
-
|
|
300
|
-
exports.GraphWithControls = GraphWithControls;
|
|
301
277
|
(0, _defineProperty2["default"])(GraphWithControls, "propTypes", _objectSpread(_objectSpread({}, _graph.graphPropTypes), {}, {
|
|
302
278
|
onUndo: _propTypes["default"].func,
|
|
303
279
|
onRedo: _propTypes["default"].func,
|
|
@@ -315,45 +291,5 @@ exports.GraphWithControls = GraphWithControls;
|
|
|
315
291
|
showTitle: true,
|
|
316
292
|
toolbarTools: []
|
|
317
293
|
});
|
|
318
|
-
|
|
319
|
-
var styles = function styles(theme) {
|
|
320
|
-
return {
|
|
321
|
-
graphWithControls: {
|
|
322
|
-
display: 'flex',
|
|
323
|
-
flexDirection: 'column',
|
|
324
|
-
width: 'min-content'
|
|
325
|
-
},
|
|
326
|
-
controls: {
|
|
327
|
-
display: 'flex',
|
|
328
|
-
justifyContent: 'space-between',
|
|
329
|
-
padding: theme.spacing.unit,
|
|
330
|
-
color: _renderUi.color.text(),
|
|
331
|
-
backgroundColor: _renderUi.color.primaryLight(),
|
|
332
|
-
'& button': {
|
|
333
|
-
fontSize: theme.typography.fontSize
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
expansionPanel: {
|
|
337
|
-
backgroundColor: _renderUi.color.primaryLight(),
|
|
338
|
-
width: '100%'
|
|
339
|
-
},
|
|
340
|
-
summaryRoot: {
|
|
341
|
-
padding: "0 ".concat(theme.spacing.unit, "px"),
|
|
342
|
-
minHeight: '32px !important'
|
|
343
|
-
},
|
|
344
|
-
summaryContent: {
|
|
345
|
-
margin: '4px 0 !important'
|
|
346
|
-
},
|
|
347
|
-
details: {
|
|
348
|
-
padding: 0,
|
|
349
|
-
marginTop: theme.spacing.unit,
|
|
350
|
-
display: 'flex',
|
|
351
|
-
justifyContent: 'space-between'
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
var _default = (0, _styles.withStyles)(styles)(GraphWithControls);
|
|
357
|
-
|
|
358
|
-
exports["default"] = _default;
|
|
294
|
+
var _default = exports["default"] = GraphWithControls;
|
|
359
295
|
//# sourceMappingURL=graph-with-controls.js.map
|