@pie-lib/plot 2.27.3-next.2 → 2.27.3-next.205
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 +21 -76
- package/lib/draggable.js +12 -33
- package/lib/draggable.js.map +1 -1
- package/lib/graph-props.js +4 -11
- package/lib/graph-props.js.map +1 -1
- package/lib/grid-draggable.js +67 -141
- package/lib/grid-draggable.js.map +1 -1
- package/lib/index.js +1 -16
- package/lib/index.js.map +1 -1
- package/lib/label.js +83 -109
- package/lib/label.js.map +1 -1
- package/lib/root.js +191 -216
- package/lib/root.js.map +1 -1
- package/lib/trig.js +14 -61
- package/lib/trig.js.map +1 -1
- package/lib/types.js +9 -37
- package/lib/types.js.map +1 -1
- package/lib/utils.js +22 -86
- package/lib/utils.js.map +1 -1
- package/package.json +11 -22
- package/src/__tests__/draggable.test.jsx +33 -15
- package/src/__tests__/grid-draggable.test.jsx +377 -224
- package/src/__tests__/root.test.jsx +213 -57
- package/src/grid-draggable.jsx +13 -4
- package/src/label.jsx +78 -73
- package/src/root.jsx +178 -130
- package/esm/index.css +0 -847
- package/esm/index.js +0 -199267
- package/esm/index.js.map +0 -1
- package/esm/package.json +0 -3
- package/src/__tests__/__snapshots__/grid-draggable.test.jsx.snap +0 -185
- package/src/__tests__/__snapshots__/root.test.jsx.snap +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# [3.0.0-next.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.27.3-next.0...@pie-lib/plot@3.0.0-next.0) (2026-01-19)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @pie-lib/plot
|
|
9
9
|
|
|
@@ -11,161 +11,106 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
## [2.27.
|
|
14
|
+
## [2.27.3-next.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.41.0-mui-update.0...@pie-lib/plot@2.27.3-next.0) (2026-01-19)
|
|
15
15
|
|
|
16
|
-
**Note:** Version bump only for package @pie-lib/plot
|
|
17
16
|
|
|
17
|
+
### Bug Fixes
|
|
18
18
|
|
|
19
|
+
* **plot:** fix focus PD-5452 ([882207c](https://github.com/pie-framework/pie-lib/commit/882207c6a1155a8e5818f5c7966239f8f341a0a6))
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [2.27.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.27.1...@pie-lib/plot@2.27.2) (2025-11-27)
|
|
23
26
|
|
|
24
27
|
**Note:** Version bump only for package @pie-lib/plot
|
|
25
28
|
|
|
29
|
+
## [2.27.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.23.2...@pie-lib/plot@2.27.1) (2025-10-22)
|
|
26
30
|
|
|
31
|
+
**Note:** Version bump only for package @pie-lib/plot
|
|
27
32
|
|
|
33
|
+
# [2.27.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.26.0...@pie-lib/plot@2.27.0) (2025-10-16)
|
|
28
34
|
|
|
35
|
+
**Note:** Version bump only for package @pie-lib/plot
|
|
29
36
|
|
|
30
37
|
# [2.26.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.23.0...@pie-lib/plot@2.26.0) (2025-10-16)
|
|
31
38
|
|
|
32
|
-
|
|
33
39
|
### Bug Fixes
|
|
34
40
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
- **plot/graphing:** add title height calculations through observer PD-5208 ([f993541](https://github.com/pie-framework/pie-lib/commit/f99354174b23dcd6a1f3524a15f9b64c4041d7e2))
|
|
40
42
|
|
|
41
43
|
# [2.25.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.23.0...@pie-lib/plot@2.25.0) (2025-10-16)
|
|
42
44
|
|
|
43
|
-
|
|
44
45
|
### Bug Fixes
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
- **plot/graphing:** add title height calculations through observer PD-5208 ([f993541](https://github.com/pie-framework/pie-lib/commit/f99354174b23dcd6a1f3524a15f9b64c4041d7e2))
|
|
51
48
|
|
|
52
49
|
# [2.24.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.23.0...@pie-lib/plot@2.24.0) (2025-10-16)
|
|
53
50
|
|
|
54
|
-
|
|
55
51
|
### Bug Fixes
|
|
56
52
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
- **plot/graphing:** add title height calculations through observer PD-5208 ([f993541](https://github.com/pie-framework/pie-lib/commit/f99354174b23dcd6a1f3524a15f9b64c4041d7e2))
|
|
62
54
|
|
|
63
55
|
## [2.23.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.23.1...@pie-lib/plot@2.23.2) (2025-10-14)
|
|
64
56
|
|
|
65
57
|
**Note:** Version bump only for package @pie-lib/plot
|
|
66
58
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
59
|
## [2.23.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.23.0...@pie-lib/plot@2.23.1) (2025-10-09)
|
|
72
60
|
|
|
73
|
-
|
|
74
61
|
### Bug Fixes
|
|
75
62
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
63
|
+
- **plot/graphing:** add title height calculations through observer PD-5208 ([f993541](https://github.com/pie-framework/pie-lib/commit/f99354174b23dcd6a1f3524a15f9b64c4041d7e2))
|
|
81
64
|
|
|
82
65
|
# [2.23.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.7.3...@pie-lib/plot@2.23.0) (2025-09-25)
|
|
83
66
|
|
|
84
|
-
|
|
85
67
|
### Bug Fixes
|
|
86
68
|
|
|
87
|
-
|
|
88
|
-
|
|
69
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
89
70
|
|
|
90
71
|
### Features
|
|
91
72
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
73
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
97
74
|
|
|
98
75
|
# [2.22.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.21.0...@pie-lib/plot@2.22.0) (2025-09-18)
|
|
99
76
|
|
|
100
77
|
**Note:** Version bump only for package @pie-lib/plot
|
|
101
78
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
79
|
# [2.21.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.20.0...@pie-lib/plot@2.21.0) (2025-09-18)
|
|
107
80
|
|
|
108
81
|
**Note:** Version bump only for package @pie-lib/plot
|
|
109
82
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
83
|
# [2.20.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.7.3...@pie-lib/plot@2.20.0) (2025-09-18)
|
|
115
84
|
|
|
116
|
-
|
|
117
85
|
### Bug Fixes
|
|
118
86
|
|
|
119
|
-
|
|
120
|
-
|
|
87
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
121
88
|
|
|
122
89
|
### Features
|
|
123
90
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
91
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
129
92
|
|
|
130
93
|
# [2.19.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.18.0...@pie-lib/plot@2.19.0) (2025-09-17)
|
|
131
94
|
|
|
132
95
|
**Note:** Version bump only for package @pie-lib/plot
|
|
133
96
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
97
|
# [2.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.17.0...@pie-lib/plot@2.18.0) (2025-09-17)
|
|
139
98
|
|
|
140
99
|
**Note:** Version bump only for package @pie-lib/plot
|
|
141
100
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
101
|
# [2.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.16.1...@pie-lib/plot@2.17.0) (2025-09-17)
|
|
147
102
|
|
|
148
103
|
**Note:** Version bump only for package @pie-lib/plot
|
|
149
104
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
105
|
## [2.16.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.7.3...@pie-lib/plot@2.16.1) (2025-08-11)
|
|
155
106
|
|
|
156
|
-
|
|
157
107
|
### Bug Fixes
|
|
158
108
|
|
|
159
|
-
|
|
160
|
-
|
|
109
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
161
110
|
|
|
162
111
|
### Features
|
|
163
112
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
113
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
169
114
|
|
|
170
115
|
# [2.16.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/plot@2.7.3...@pie-lib/plot@2.16.0) (2025-08-07)
|
|
171
116
|
|
package/lib/draggable.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
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
|
});
|
|
@@ -14,52 +12,33 @@ Object.defineProperty(exports, "DraggableCore", {
|
|
|
14
12
|
}
|
|
15
13
|
});
|
|
16
14
|
exports["default"] = void 0;
|
|
17
|
-
|
|
18
15
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
19
|
-
|
|
20
16
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
21
|
-
|
|
22
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
23
|
-
|
|
24
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
25
|
-
|
|
26
17
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
27
|
-
|
|
28
18
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
29
|
-
|
|
19
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
20
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
30
21
|
var _reactDraggable = _interopRequireWildcard(require("react-draggable"));
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
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); }; }
|
|
37
|
-
|
|
38
|
-
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; } }
|
|
39
|
-
|
|
40
|
-
var LocalDraggable = /*#__PURE__*/function (_Draggable) {
|
|
41
|
-
(0, _inherits2["default"])(LocalDraggable, _Draggable);
|
|
42
|
-
|
|
43
|
-
var _super = _createSuper(LocalDraggable);
|
|
44
|
-
|
|
22
|
+
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); }
|
|
23
|
+
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)); }
|
|
24
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
|
+
function _superPropGet(t, o, e, r) { var p = (0, _get2["default"])((0, _getPrototypeOf2["default"])(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
26
|
+
var LocalDraggable = exports["default"] = /*#__PURE__*/function (_Draggable) {
|
|
45
27
|
function LocalDraggable() {
|
|
46
28
|
(0, _classCallCheck2["default"])(this, LocalDraggable);
|
|
47
|
-
return
|
|
29
|
+
return _callSuper(this, LocalDraggable, arguments);
|
|
48
30
|
}
|
|
49
|
-
|
|
50
|
-
(0, _createClass2["default"])(LocalDraggable, [{
|
|
31
|
+
(0, _inherits2["default"])(LocalDraggable, _Draggable);
|
|
32
|
+
return (0, _createClass2["default"])(LocalDraggable, [{
|
|
51
33
|
key: "componentWillReceiveProps",
|
|
52
34
|
value: function componentWillReceiveProps(next) {
|
|
53
|
-
(
|
|
54
|
-
|
|
35
|
+
_superPropGet(LocalDraggable, "componentWillReceiveProps", this, 3)([next]);
|
|
36
|
+
//Remove the x/y state as these values have now been updated and will come through as props.
|
|
55
37
|
this.setState({
|
|
56
38
|
x: 0,
|
|
57
39
|
y: 0
|
|
58
40
|
});
|
|
59
41
|
}
|
|
60
42
|
}]);
|
|
61
|
-
return LocalDraggable;
|
|
62
43
|
}(_reactDraggable["default"]);
|
|
63
|
-
|
|
64
|
-
exports["default"] = LocalDraggable;
|
|
65
44
|
//# sourceMappingURL=draggable.js.map
|
package/lib/draggable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"draggable.js","names":["_reactDraggable","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_callSuper","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","_superPropGet","p","_get2","LocalDraggable","exports","_Draggable","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","componentWillReceiveProps","next","setState","x","y","Draggable"],"sources":["../src/draggable.jsx"],"sourcesContent":["import Draggable, { DraggableCore } from 'react-draggable';\n\nexport default class LocalDraggable extends Draggable {\n componentWillReceiveProps(next) {\n super.componentWillReceiveProps(next);\n //Remove the x/y state as these values have now been updated and will come through as props.\n this.setState({ x: 0, y: 0 });\n }\n}\n\nexport { DraggableCore };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA2D,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,wBAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,C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KAAA,EACjC,SAAAC,yBAAyBA,CAACC,IAAI,EAAE;MAC9Bb,aAAA,CAAAG,cAAA,yCAAgCU,IAAI;MACpC;MACA,IAAI,CAACC,QAAQ,CAAC;QAAEC,CAAC,EAAE,CAAC;QAAEC,CAAC,EAAE;MAAE,CAAC,CAAC;IAC/B;EAAC;AAAA,EALyCC,0BAAS","ignoreList":[]}
|
package/lib/graph-props.js
CHANGED
|
@@ -1,32 +1,27 @@
|
|
|
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.create = void 0;
|
|
9
|
-
|
|
10
8
|
var _invariant = _interopRequireDefault(require("invariant"));
|
|
11
|
-
|
|
12
9
|
var _utils = require("./utils");
|
|
13
|
-
|
|
14
10
|
var _d3Scale = require("d3-scale");
|
|
15
|
-
|
|
16
11
|
var createSnapMinAndMax = function createSnapMinAndMax(_ref) {
|
|
17
12
|
var min = _ref.min,
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
max = _ref.max,
|
|
14
|
+
step = _ref.step;
|
|
20
15
|
// for graphing, if step is a value with decimals, we have to calculate the min & max for the grid taking in consideration that 0 has to be exactly in the middle
|
|
21
16
|
// for example, if min: -5 & max: 5 & step: 0.75, in order to keep 0 in the middle we have to set min: -4.5 & max: 4.5
|
|
17
|
+
|
|
22
18
|
return {
|
|
23
19
|
step: step,
|
|
24
20
|
min: parseInt(min / step) * step,
|
|
25
21
|
max: parseInt(max / step) * step
|
|
26
22
|
};
|
|
27
23
|
};
|
|
28
|
-
|
|
29
|
-
var create = function create(domain, range, size, getRootNode) {
|
|
24
|
+
var create = exports.create = function create(domain, range, size, getRootNode) {
|
|
30
25
|
(0, _invariant["default"])(domain.min < domain.max, 'domain: min must be less than max');
|
|
31
26
|
(0, _invariant["default"])(range.min < range.max, 'range: min must be less than max');
|
|
32
27
|
var domainMinMax = createSnapMinAndMax(domain);
|
|
@@ -48,6 +43,4 @@ var create = function create(domain, range, size, getRootNode) {
|
|
|
48
43
|
getRootNode: getRootNode
|
|
49
44
|
};
|
|
50
45
|
};
|
|
51
|
-
|
|
52
|
-
exports.create = create;
|
|
53
46
|
//# sourceMappingURL=graph-props.js.map
|
package/lib/graph-props.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"graph-props.js","names":["_invariant","_interopRequireDefault","require","_utils","_d3Scale","createSnapMinAndMax","_ref","min","max","step","parseInt","create","exports","domain","range","size","getRootNode","invariant","domainMinMax","rangeMinMax","scale","x","scaleLinear","width","y","height","snap","snapTo","bind"],"sources":["../src/graph-props.js"],"sourcesContent":["import invariant from 'invariant';\nimport { snapTo } from './utils';\nimport { scaleLinear } from 'd3-scale';\n\nconst createSnapMinAndMax = ({ min, max, step }) => {\n // for graphing, if step is a value with decimals, we have to calculate the min & max for the grid taking in consideration that 0 has to be exactly in the middle\n // for example, if min: -5 & max: 5 & step: 0.75, in order to keep 0 in the middle we have to set min: -4.5 & max: 4.5\n\n return {\n step,\n min: parseInt(min / step) * step,\n max: parseInt(max / step) * step,\n };\n};\n\nexport const create = (domain, range, size, getRootNode) => {\n invariant(domain.min < domain.max, 'domain: min must be less than max');\n invariant(range.min < range.max, 'range: min must be less than max');\n\n const domainMinMax = createSnapMinAndMax(domain);\n const rangeMinMax = createSnapMinAndMax(range);\n\n const scale = {\n x: scaleLinear()\n .domain([domain.min, domain.max])\n .range([0, size.width]),\n y: scaleLinear()\n .domain([range.max, range.min])\n .range([0, size.height]),\n };\n\n const snap = {\n x: snapTo.bind(null, domainMinMax.min, domainMinMax.max, domainMinMax.step),\n y: snapTo.bind(null, rangeMinMax.min, rangeMinMax.max, rangeMinMax.step),\n };\n\n return { scale, snap, domain, range, size, getRootNode };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,U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