@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.
Files changed (155) hide show
  1. package/CHANGELOG.md +16 -6
  2. package/lib/axis/arrow.js +19 -55
  3. package/lib/axis/arrow.js.map +1 -1
  4. package/lib/axis/axes.js +104 -186
  5. package/lib/axis/axes.js.map +1 -1
  6. package/lib/axis/index.js +1 -6
  7. package/lib/axis/index.js.map +1 -1
  8. package/lib/bg.js +21 -49
  9. package/lib/bg.js.map +1 -1
  10. package/lib/container/actions.js +2 -8
  11. package/lib/container/actions.js.map +1 -1
  12. package/lib/container/index.js +14 -59
  13. package/lib/container/index.js.map +1 -1
  14. package/lib/container/marks.js +1 -6
  15. package/lib/container/marks.js.map +1 -1
  16. package/lib/container/middleware.js +2 -8
  17. package/lib/container/middleware.js.map +1 -1
  18. package/lib/container/reducer.js +1 -8
  19. package/lib/container/reducer.js.map +1 -1
  20. package/lib/coordinates-label.js +23 -55
  21. package/lib/coordinates-label.js.map +1 -1
  22. package/lib/graph-with-controls.js +120 -184
  23. package/lib/graph-with-controls.js.map +1 -1
  24. package/lib/graph.js +59 -116
  25. package/lib/graph.js.map +1 -1
  26. package/lib/grid-setup.js +174 -224
  27. package/lib/grid-setup.js.map +1 -1
  28. package/lib/grid.js +28 -73
  29. package/lib/grid.js.map +1 -1
  30. package/lib/index.js +1 -13
  31. package/lib/index.js.map +1 -1
  32. package/lib/key-legend.js +41 -85
  33. package/lib/key-legend.js.map +1 -1
  34. package/lib/label-svg-icon.js +1 -7
  35. package/lib/label-svg-icon.js.map +1 -1
  36. package/lib/labels.js +61 -119
  37. package/lib/labels.js.map +1 -1
  38. package/lib/mark-label.js +113 -163
  39. package/lib/mark-label.js.map +1 -1
  40. package/lib/toggle-bar.js +158 -242
  41. package/lib/toggle-bar.js.map +1 -1
  42. package/lib/tool-menu.js +16 -48
  43. package/lib/tool-menu.js.map +1 -1
  44. package/lib/tools/absolute/component.js +4 -10
  45. package/lib/tools/absolute/component.js.map +1 -1
  46. package/lib/tools/absolute/index.js +3 -16
  47. package/lib/tools/absolute/index.js.map +1 -1
  48. package/lib/tools/circle/bg-circle.js +42 -92
  49. package/lib/tools/circle/bg-circle.js.map +1 -1
  50. package/lib/tools/circle/component.js +79 -165
  51. package/lib/tools/circle/component.js.map +1 -1
  52. package/lib/tools/circle/index.js +3 -13
  53. package/lib/tools/circle/index.js.map +1 -1
  54. package/lib/tools/exponential/component.js +4 -10
  55. package/lib/tools/exponential/component.js.map +1 -1
  56. package/lib/tools/exponential/index.js +3 -18
  57. package/lib/tools/exponential/index.js.map +1 -1
  58. package/lib/tools/index.js +3 -16
  59. package/lib/tools/index.js.map +1 -1
  60. package/lib/tools/line/component.js +27 -48
  61. package/lib/tools/line/component.js.map +1 -1
  62. package/lib/tools/line/index.js +1 -6
  63. package/lib/tools/line/index.js.map +1 -1
  64. package/lib/tools/parabola/component.js +4 -10
  65. package/lib/tools/parabola/component.js.map +1 -1
  66. package/lib/tools/parabola/index.js +3 -16
  67. package/lib/tools/parabola/index.js.map +1 -1
  68. package/lib/tools/point/component.js +24 -71
  69. package/lib/tools/point/component.js.map +1 -1
  70. package/lib/tools/point/index.js +3 -11
  71. package/lib/tools/point/index.js.map +1 -1
  72. package/lib/tools/polygon/component.js +82 -183
  73. package/lib/tools/polygon/component.js.map +1 -1
  74. package/lib/tools/polygon/index.js +6 -23
  75. package/lib/tools/polygon/index.js.map +1 -1
  76. package/lib/tools/polygon/line.js +48 -91
  77. package/lib/tools/polygon/line.js.map +1 -1
  78. package/lib/tools/polygon/polygon.js +65 -98
  79. package/lib/tools/polygon/polygon.js.map +1 -1
  80. package/lib/tools/ray/component.js +41 -60
  81. package/lib/tools/ray/component.js.map +1 -1
  82. package/lib/tools/ray/index.js +1 -6
  83. package/lib/tools/ray/index.js.map +1 -1
  84. package/lib/tools/segment/component.js +25 -43
  85. package/lib/tools/segment/component.js.map +1 -1
  86. package/lib/tools/segment/index.js +1 -6
  87. package/lib/tools/segment/index.js.map +1 -1
  88. package/lib/tools/shared/arrow-head.js +69 -28
  89. package/lib/tools/shared/arrow-head.js.map +1 -1
  90. package/lib/tools/shared/icons/CorrectSVG.js +3 -8
  91. package/lib/tools/shared/icons/CorrectSVG.js.map +1 -1
  92. package/lib/tools/shared/icons/IncorrectSVG.js +3 -8
  93. package/lib/tools/shared/icons/IncorrectSVG.js.map +1 -1
  94. package/lib/tools/shared/icons/MissingSVG.js +3 -8
  95. package/lib/tools/shared/icons/MissingSVG.js.map +1 -1
  96. package/lib/tools/shared/line/index.js +126 -187
  97. package/lib/tools/shared/line/index.js.map +1 -1
  98. package/lib/tools/shared/line/line-path.js +70 -100
  99. package/lib/tools/shared/line/line-path.js.map +1 -1
  100. package/lib/tools/shared/line/with-root-edge.js +21 -55
  101. package/lib/tools/shared/line/with-root-edge.js.map +1 -1
  102. package/lib/tools/shared/point/arrow-point.js +23 -62
  103. package/lib/tools/shared/point/arrow-point.js.map +1 -1
  104. package/lib/tools/shared/point/arrow.js +24 -52
  105. package/lib/tools/shared/point/arrow.js.map +1 -1
  106. package/lib/tools/shared/point/base-point.js +54 -72
  107. package/lib/tools/shared/point/base-point.js.map +1 -1
  108. package/lib/tools/shared/point/index.js +22 -57
  109. package/lib/tools/shared/point/index.js.map +1 -1
  110. package/lib/tools/shared/styles.js +10 -38
  111. package/lib/tools/shared/styles.js.map +1 -1
  112. package/lib/tools/shared/types.js +2 -9
  113. package/lib/tools/shared/types.js.map +1 -1
  114. package/lib/tools/sine/component.js +8 -19
  115. package/lib/tools/sine/component.js.map +1 -1
  116. package/lib/tools/sine/index.js +3 -16
  117. package/lib/tools/sine/index.js.map +1 -1
  118. package/lib/tools/vector/component.js +24 -44
  119. package/lib/tools/vector/component.js.map +1 -1
  120. package/lib/tools/vector/index.js +1 -6
  121. package/lib/tools/vector/index.js.map +1 -1
  122. package/lib/undo-redo.js +29 -69
  123. package/lib/undo-redo.js.map +1 -1
  124. package/lib/use-debounce.js +4 -11
  125. package/lib/use-debounce.js.map +1 -1
  126. package/lib/utils.js +51 -128
  127. package/lib/utils.js.map +1 -1
  128. package/package.json +16 -13
  129. package/src/axis/arrow.jsx +7 -12
  130. package/src/axis/axes.jsx +40 -45
  131. package/src/coordinates-label.jsx +13 -18
  132. package/src/graph-with-controls.jsx +52 -59
  133. package/src/grid-setup.jsx +210 -206
  134. package/src/grid.jsx +1 -3
  135. package/src/key-legend.jsx +52 -56
  136. package/src/labels.jsx +21 -30
  137. package/src/mark-label.jsx +83 -81
  138. package/src/toggle-bar.jsx +155 -166
  139. package/src/tools/circle/bg-circle.jsx +20 -28
  140. package/src/tools/circle/component.jsx +28 -63
  141. package/src/tools/line/component.jsx +22 -15
  142. package/src/tools/polygon/component.jsx +1 -2
  143. package/src/tools/polygon/line.jsx +28 -32
  144. package/src/tools/polygon/polygon.jsx +52 -45
  145. package/src/tools/ray/component.jsx +38 -25
  146. package/src/tools/segment/component.jsx +19 -18
  147. package/src/tools/shared/arrow-head.jsx +60 -7
  148. package/src/tools/shared/line/index.jsx +39 -2
  149. package/src/tools/shared/line/line-path.jsx +54 -58
  150. package/src/tools/shared/point/arrow-point.jsx +10 -24
  151. package/src/tools/shared/point/arrow.jsx +5 -11
  152. package/src/tools/shared/point/base-point.jsx +42 -19
  153. package/src/tools/shared/point/index.jsx +27 -44
  154. package/src/tools/vector/component.jsx +11 -16
  155. package/src/undo-redo.jsx +19 -21
@@ -1,27 +1,18 @@
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.tool = void 0;
9
-
10
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
9
  var _component = _interopRequireDefault(require("./component"));
13
-
14
10
  var _debug = _interopRequireDefault(require("debug"));
15
-
16
11
  var _utils = require("../../utils");
17
-
18
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
-
20
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
-
12
+ 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; }
13
+ 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; }
22
14
  var log = (0, _debug["default"])('pie-lib:graphing:exponential');
23
-
24
- var tool = function tool() {
15
+ var tool = exports.tool = function tool() {
25
16
  return {
26
17
  type: 'exponential',
27
18
  Component: _component["default"],
@@ -33,19 +24,15 @@ var tool = function tool() {
33
24
  },
34
25
  addPoint: function addPoint(point, mark) {
35
26
  log('add point to exponential model: ', point, 'mark: ', mark);
36
-
37
27
  if (mark && ((0, _utils.equalPoints)(mark.root, point) || (0, _utils.sameAxes)(mark.root, point))) {
38
28
  return mark;
39
29
  }
40
-
41
30
  if (mark && mark.root.y * point.y < 0) {
42
31
  return mark;
43
32
  }
44
-
45
33
  if (point.y === 0) {
46
34
  return mark;
47
35
  }
48
-
49
36
  if (!mark) {
50
37
  return {
51
38
  type: 'exponential',
@@ -66,6 +53,4 @@ var tool = function tool() {
66
53
  }
67
54
  };
68
55
  };
69
-
70
- exports.tool = tool;
71
56
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/tools/exponential/index.js"],"names":["log","tool","type","Component","Exponential","complete","data","mark","building","closed","addPoint","point","root","y","edge","undefined","Error"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,8BAAN,CAAZ;;AAEO,IAAMC,IAAI,GAAG,SAAPA,IAAO;AAAA,SAAO;AACzBC,IAAAA,IAAI,EAAE,aADmB;AAEzBC,IAAAA,SAAS,EAAEC,qBAFc;AAGzBC,IAAAA,QAAQ,EAAE,kBAACC,IAAD,EAAOC,IAAP;AAAA,6CAAsBA,IAAtB;AAA4BC,QAAAA,QAAQ,EAAE,KAAtC;AAA6CC,QAAAA,MAAM,EAAE;AAArD;AAAA,KAHe;AAIzBC,IAAAA,QAAQ,EAAE,kBAACC,KAAD,EAAQJ,IAAR,EAAiB;AACzBP,MAAAA,GAAG,CAAC,kCAAD,EAAqCW,KAArC,EAA4C,QAA5C,EAAsDJ,IAAtD,CAAH;;AACA,UAAIA,IAAI,KAAK,wBAAYA,IAAI,CAACK,IAAjB,EAAuBD,KAAvB,KAAiC,qBAASJ,IAAI,CAACK,IAAd,EAAoBD,KAApB,CAAtC,CAAR,EAA2E;AACzE,eAAOJ,IAAP;AACD;;AAED,UAAIA,IAAI,IAAIA,IAAI,CAACK,IAAL,CAAUC,CAAV,GAAcF,KAAK,CAACE,CAApB,GAAwB,CAApC,EAAuC;AACrC,eAAON,IAAP;AACD;;AAED,UAAII,KAAK,CAACE,CAAN,KAAY,CAAhB,EAAmB;AACjB,eAAON,IAAP;AACD;;AAED,UAAI,CAACA,IAAL,EAAW;AACT,eAAO;AACLL,UAAAA,IAAI,EAAE,aADD;AAELU,UAAAA,IAAI,EAAED,KAFD;AAGLG,UAAAA,IAAI,EAAEC,SAHD;AAILN,UAAAA,MAAM,EAAE,KAJH;AAKLD,UAAAA,QAAQ,EAAE;AALL,SAAP;AAOD,OARD,MAQO,IAAID,IAAI,IAAI,CAACA,IAAI,CAACK,IAAlB,EAAwB;AAC7B,cAAM,IAAII,KAAJ,CAAU,+BAAV,CAAN;AACD,OAFM,MAEA;AACL,+CAAYT,IAAZ;AAAkBO,UAAAA,IAAI,EAAEH,KAAxB;AAA+BF,UAAAA,MAAM,EAAE,IAAvC;AAA6CD,UAAAA,QAAQ,EAAE;AAAvD;AACD;AACF;AA/BwB,GAAP;AAAA,CAAb","sourcesContent":["import Exponential from './component';\nimport debug from 'debug';\nimport { equalPoints, sameAxes } from '../../utils';\n\nconst log = debug('pie-lib:graphing:exponential');\n\nexport const tool = () => ({\n type: 'exponential',\n Component: Exponential,\n complete: (data, mark) => ({ ...mark, building: false, closed: true }),\n addPoint: (point, mark) => {\n log('add point to exponential model: ', point, 'mark: ', mark);\n if (mark && (equalPoints(mark.root, point) || sameAxes(mark.root, point))) {\n return mark;\n }\n\n if (mark && mark.root.y * point.y < 0) {\n return mark;\n }\n\n if (point.y === 0) {\n return mark;\n }\n\n if (!mark) {\n return {\n type: 'exponential',\n root: point,\n edge: undefined,\n closed: false,\n building: true,\n };\n } else if (mark && !mark.root) {\n throw new Error('no root - should never happen');\n } else {\n return { ...mark, edge: point, closed: true, building: false };\n }\n },\n});\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":["_component","_interopRequireDefault","require","_debug","_utils","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","log","debug","tool","exports","type","Component","Exponential","complete","data","mark","building","closed","addPoint","point","equalPoints","root","sameAxes","y","edge","undefined","Error"],"sources":["../../../src/tools/exponential/index.js"],"sourcesContent":["import Exponential from './component';\nimport debug from 'debug';\nimport { equalPoints, sameAxes } from '../../utils';\n\nconst log = debug('pie-lib:graphing:exponential');\n\nexport const tool = () => ({\n type: 'exponential',\n Component: Exponential,\n complete: (data, mark) => ({ ...mark, building: false, closed: true }),\n addPoint: (point, mark) => {\n log('add point to exponential model: ', point, 'mark: ', mark);\n if (mark && (equalPoints(mark.root, point) || sameAxes(mark.root, point))) {\n return mark;\n }\n\n if (mark && mark.root.y * point.y < 0) {\n return mark;\n }\n\n if (point.y === 0) {\n return mark;\n }\n\n if (!mark) {\n return {\n type: 'exponential',\n root: point,\n edge: undefined,\n closed: false,\n building: true,\n };\n } else if (mark && !mark.root) {\n throw new Error('no root - should never happen');\n } else {\n return { ...mark, edge: point, closed: true, building: false };\n }\n },\n});\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAoD,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,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,IAAI,CAACM,IAAI,CAACE,CAAC,GAAGJ,KAAK,CAACI,CAAC,GAAG,CAAC,EAAE;QACrC,OAAOR,IAAI;MACb;MAEA,IAAII,KAAK,CAACI,CAAC,KAAK,CAAC,EAAE;QACjB,OAAOR,IAAI;MACb;MAEA,IAAI,CAACA,IAAI,EAAE;QACT,OAAO;UACLL,IAAI,EAAE,aAAa;UACnBW,IAAI,EAAEF,KAAK;UACXK,IAAI,EAAEC,SAAS;UACfR,MAAM,EAAE,KAAK;UACbD,QAAQ,EAAE;QACZ,CAAC;MACH,CAAC,MAAM,IAAID,IAAI,IAAI,CAACA,IAAI,CAACM,IAAI,EAAE;QAC7B,MAAM,IAAIK,KAAK,CAAC,+BAA+B,CAAC;MAClD,CAAC,MAAM;QACL,OAAA5B,aAAA,CAAAA,aAAA,KAAYiB,IAAI;UAAES,IAAI,EAAEL,KAAK;UAAEF,MAAM,EAAE,IAAI;UAAED,QAAQ,EAAE;QAAK;MAC9D;IACF;EACF,CAAC;AAAA,CAAC","ignoreList":[]}
@@ -65,35 +65,22 @@ Object.defineProperty(exports, "vector", {
65
65
  return _vector.tool;
66
66
  }
67
67
  });
68
-
69
68
  var _point = require("./point");
70
-
71
69
  var _circle = require("./circle");
72
-
73
70
  var _polygon = require("./polygon");
74
-
75
71
  var _sine = require("./sine");
76
-
77
72
  var _parabola = require("./parabola");
78
-
79
73
  var _line = require("./line");
80
-
81
74
  var _segment = require("./segment");
82
-
83
75
  var _ray = require("./ray");
84
-
85
76
  var _vector = require("./vector");
86
-
87
77
  var _absolute = require("./absolute");
88
-
89
78
  var _exponential = require("./exponential");
79
+ var allTools = exports.allTools = ['circle', 'line', 'label', 'parabola', 'point', 'polygon', 'ray', 'segment', 'sine', 'vector', 'absolute', 'exponential'];
90
80
 
91
- var allTools = ['circle', 'line', 'label', 'parabola', 'point', 'polygon', 'ray', 'segment', 'sine', 'vector', 'absolute', 'exponential']; // need this because now we should treat label as other tools PD-3736
92
-
93
- exports.allTools = allTools;
81
+ // need this because now we should treat label as other tools PD-3736
94
82
  var labelTool = {
95
83
  type: 'label'
96
84
  };
97
- var toolsArr = [(0, _circle.tool)(), (0, _line.tool)(), (0, _parabola.tool)(), (0, _point.tool)(), (0, _polygon.tool)(), (0, _ray.tool)(), (0, _segment.tool)(), (0, _sine.tool)(), (0, _vector.tool)(), (0, _absolute.tool)(), (0, _exponential.tool)(), labelTool];
98
- exports.toolsArr = toolsArr;
85
+ var toolsArr = exports.toolsArr = [(0, _circle.tool)(), (0, _line.tool)(), (0, _parabola.tool)(), (0, _point.tool)(), (0, _polygon.tool)(), (0, _ray.tool)(), (0, _segment.tool)(), (0, _sine.tool)(), (0, _vector.tool)(), (0, _absolute.tool)(), (0, _exponential.tool)(), labelTool];
99
86
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tools/index.js"],"names":["allTools","labelTool","type","toolsArr"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,QAAQ,GAAG,CACf,QADe,EAEf,MAFe,EAGf,OAHe,EAIf,UAJe,EAKf,OALe,EAMf,SANe,EAOf,KAPe,EAQf,SARe,EASf,MATe,EAUf,QAVe,EAWf,UAXe,EAYf,aAZe,CAAjB,C,CAeA;;;AACA,IAAMC,SAAS,GAAG;AAChBC,EAAAA,IAAI,EAAE;AADU,CAAlB;AAIA,IAAMC,QAAQ,GAAG,CACf,mBADe,EAEf,iBAFe,EAGf,qBAHe,EAIf,kBAJe,EAKf,oBALe,EAMf,gBANe,EAOf,oBAPe,EAQf,iBARe,EASf,mBATe,EAUf,qBAVe,EAWf,wBAXe,EAYfF,SAZe,CAAjB","sourcesContent":["import { tool as point } from './point';\nimport { tool as circle } from './circle';\nimport { tool as polygon } from './polygon';\nimport { tool as sine } from './sine';\nimport { tool as parabola } from './parabola';\nimport { tool as line } from './line';\nimport { tool as segment } from './segment';\nimport { tool as ray } from './ray';\nimport { tool as vector } from './vector';\nimport { tool as absolute } from './absolute';\nimport { tool as exponential } from './exponential';\n\nconst allTools = [\n 'circle',\n 'line',\n 'label',\n 'parabola',\n 'point',\n 'polygon',\n 'ray',\n 'segment',\n 'sine',\n 'vector',\n 'absolute',\n 'exponential',\n];\n\n// need this because now we should treat label as other tools PD-3736\nconst labelTool = {\n type: 'label',\n};\n\nconst toolsArr = [\n circle(),\n line(),\n parabola(),\n point(),\n polygon(),\n ray(),\n segment(),\n sine(),\n vector(),\n absolute(),\n exponential(),\n labelTool,\n];\n\nexport { allTools, toolsArr, circle, line, point, parabola, polygon, ray, sine, vector, absolute, exponential };\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":["_point","require","_circle","_polygon","_sine","_parabola","_line","_segment","_ray","_vector","_absolute","_exponential","allTools","exports","labelTool","type","toolsArr","circle","line","parabola","point","polygon","ray","segment","sine","vector","absolute","exponential"],"sources":["../../src/tools/index.js"],"sourcesContent":["import { tool as point } from './point';\nimport { tool as circle } from './circle';\nimport { tool as polygon } from './polygon';\nimport { tool as sine } from './sine';\nimport { tool as parabola } from './parabola';\nimport { tool as line } from './line';\nimport { tool as segment } from './segment';\nimport { tool as ray } from './ray';\nimport { tool as vector } from './vector';\nimport { tool as absolute } from './absolute';\nimport { tool as exponential } from './exponential';\n\nconst allTools = [\n 'circle',\n 'line',\n 'label',\n 'parabola',\n 'point',\n 'polygon',\n 'ray',\n 'segment',\n 'sine',\n 'vector',\n 'absolute',\n 'exponential',\n];\n\n// need this because now we should treat label as other tools PD-3736\nconst labelTool = {\n type: 'label',\n};\n\nconst toolsArr = [\n circle(),\n line(),\n parabola(),\n point(),\n polygon(),\n ray(),\n segment(),\n sine(),\n vector(),\n absolute(),\n exponential(),\n labelTool,\n];\n\nexport { allTools, toolsArr, circle, line, point, parabola, polygon, ray, sine, vector, absolute, exponential };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AAEA,IAAMW,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,CACf,QAAQ,EACR,MAAM,EACN,OAAO,EACP,UAAU,EACV,OAAO,EACP,SAAS,EACT,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,UAAU,EACV,aAAa,CACd;;AAED;AACA,IAAME,SAAS,GAAG;EAChBC,IAAI,EAAE;AACR,CAAC;AAED,IAAMC,QAAQ,GAAAH,OAAA,CAAAG,QAAA,GAAG,CACf,IAAAC,YAAM,EAAC,CAAC,EACR,IAAAC,UAAI,EAAC,CAAC,EACN,IAAAC,cAAQ,EAAC,CAAC,EACV,IAAAC,WAAK,EAAC,CAAC,EACP,IAAAC,aAAO,EAAC,CAAC,EACT,IAAAC,SAAG,EAAC,CAAC,EACL,IAAAC,aAAO,EAAC,CAAC,EACT,IAAAC,UAAI,EAAC,CAAC,EACN,IAAAC,YAAM,EAAC,CAAC,EACR,IAAAC,cAAQ,EAAC,CAAC,EACV,IAAAC,iBAAW,EAAC,CAAC,EACbb,SAAS,CACV","ignoreList":[]}
@@ -1,37 +1,24 @@
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["default"] = exports.ArrowedLine = void 0;
9
-
10
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
-
12
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
-
14
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
-
16
11
  var _line = require("../shared/line");
17
-
18
12
  var _react = _interopRequireDefault(require("react"));
19
-
20
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
21
-
22
14
  var _plot = require("@pie-lib/plot");
23
-
24
15
  var _classnames = _interopRequireDefault(require("classnames"));
25
-
26
- var _styles = require("@material-ui/core/styles");
27
-
28
16
  var _arrowHead = require("../shared/arrow-head");
29
-
30
17
  var _utils = require("../../utils");
31
-
32
- var _excluded = ["className", "classes", "correctness", "disabled", "graphProps", "from", "to"];
33
-
34
- var lineStyles = function lineStyles(theme) {
18
+ var _styles = require("@mui/material/styles");
19
+ var _excluded = ["className", "correctness", "disabled", "graphProps", "from", "to", "markerId"];
20
+ var StyledArrowedLineRoot = (0, _styles.styled)('g')(function (_ref) {
21
+ var theme = _ref.theme;
35
22
  return {
36
23
  line: _line.styles.line(theme),
37
24
  enabledArrow: _line.styles.arrow(theme),
@@ -45,49 +32,43 @@ var lineStyles = function lineStyles(theme) {
45
32
  missing: _line.styles.missing(theme, 'stroke'),
46
33
  missingArrow: _line.styles.missing(theme)
47
34
  };
48
- };
49
-
50
- var ArrowedLine = function ArrowedLine(props) {
35
+ });
36
+ var ArrowedLine = exports.ArrowedLine = function ArrowedLine(props) {
51
37
  var markerId = (0, _arrowHead.genUid)();
52
38
  var className = props.className,
53
- classes = props.classes,
54
- correctness = props.correctness,
55
- disabled = props.disabled,
56
- graphProps = props.graphProps,
57
- from = props.from,
58
- to = props.to,
59
- rest = (0, _objectWithoutProperties2["default"])(props, _excluded);
39
+ correctness = props.correctness,
40
+ disabled = props.disabled,
41
+ graphProps = props.graphProps,
42
+ from = props.from,
43
+ to = props.to,
44
+ propMarkerId = props.markerId,
45
+ rest = (0, _objectWithoutProperties2["default"])(props, _excluded);
60
46
  var scale = graphProps.scale;
61
-
62
47
  var _getAdjustedGraphLimi = (0, _utils.getAdjustedGraphLimits)(graphProps),
63
- domain = _getAdjustedGraphLimi.domain,
64
- range = _getAdjustedGraphLimi.range;
65
-
48
+ domain = _getAdjustedGraphLimi.domain,
49
+ range = _getAdjustedGraphLimi.range;
66
50
  var _trig$edges = _plot.trig.edges(domain, range)(from, to),
67
- _trig$edges2 = (0, _slicedToArray2["default"])(_trig$edges, 2),
68
- eFrom = _trig$edges2[0],
69
- eTo = _trig$edges2[1];
70
-
51
+ _trig$edges2 = (0, _slicedToArray2["default"])(_trig$edges, 2),
52
+ eFrom = _trig$edges2[0],
53
+ eTo = _trig$edges2[1];
71
54
  var suffix = correctness || disabled && 'disabled' || 'enabled';
72
- return /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("defs", null, /*#__PURE__*/_react["default"].createElement(_arrowHead.ArrowMarker, {
55
+ var finalMarkerId = propMarkerId || markerId;
56
+ return /*#__PURE__*/_react["default"].createElement(StyledArrowedLineRoot, null, /*#__PURE__*/_react["default"].createElement("defs", null, /*#__PURE__*/_react["default"].createElement(_arrowHead.ArrowMarker, {
73
57
  size: (0, _utils.thinnerShapesNeeded)(graphProps) ? 4 : 5,
74
- id: "".concat(props.markerId || markerId, "-").concat(suffix),
75
- className: (0, _classnames["default"])(classes["".concat(suffix, "Arrow")])
58
+ id: "".concat(finalMarkerId, "-").concat(suffix),
59
+ className: (0, _classnames["default"])(suffix === 'enabled' ? 'enabledArrow' : suffix === 'disabled' ? 'disabledArrow' : "".concat(suffix, "Arrow"))
76
60
  })), /*#__PURE__*/_react["default"].createElement("line", (0, _extends2["default"])({
77
61
  x1: scale.x(eFrom.x),
78
62
  y1: scale.y(eFrom.y),
79
63
  x2: scale.x(eTo.x),
80
64
  y2: scale.y(eTo.y),
81
- className: (0, _classnames["default"])(classes.line, disabled && classes.disabledSecondary, classes[correctness], className),
82
- markerEnd: "url(#".concat(props.markerId || markerId, "-").concat(suffix, ")"),
83
- markerStart: "url(#".concat(props.markerId || markerId, "-").concat(suffix, ")")
65
+ className: (0, _classnames["default"])('line', disabled && 'disabledSecondary', correctness, className),
66
+ markerEnd: "url(#".concat(finalMarkerId, "-").concat(suffix, ")"),
67
+ markerStart: "url(#".concat(finalMarkerId, "-").concat(suffix, ")")
84
68
  }, rest)));
85
69
  };
86
-
87
- exports.ArrowedLine = ArrowedLine;
88
70
  ArrowedLine.propTypes = {
89
71
  className: _propTypes["default"].string,
90
- classes: _propTypes["default"].object,
91
72
  correctness: _propTypes["default"].string,
92
73
  disabled: _propTypes["default"].bool,
93
74
  graphProps: _plot.types.GraphPropsType,
@@ -95,9 +76,7 @@ ArrowedLine.propTypes = {
95
76
  to: _plot.types.PointType,
96
77
  markerId: _propTypes["default"].string
97
78
  };
98
- var StyledArrowedLine = (0, _styles.withStyles)(lineStyles)(ArrowedLine);
99
- var Line = (0, _line.lineBase)(StyledArrowedLine);
79
+ var Line = (0, _line.lineBase)(ArrowedLine);
100
80
  var Component = (0, _line.lineToolComponent)(Line);
101
- var _default = Component;
102
- exports["default"] = _default;
81
+ var _default = exports["default"] = Component;
103
82
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/tools/line/component.jsx"],"names":["lineStyles","theme","line","styles","enabledArrow","arrow","disabledArrow","disabled","disabledSecondary","correct","correctArrow","incorrect","incorrectArrow","missing","missingArrow","ArrowedLine","props","markerId","className","classes","correctness","graphProps","from","to","rest","scale","domain","range","trig","edges","eFrom","eTo","suffix","x","y","propTypes","PropTypes","string","object","bool","types","GraphPropsType","PointType","StyledArrowedLine","Line","Component"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,UAAU,GAAG,SAA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A,WAAW,iBAAUhB,KAAK,CAACC,QAAN,IAAkBA,QAA5B,cAAwCe,MAAxC;AAPb,KAQMR,IARN,EARF,CADF;AAqBD,CA7BM;;;AA+BPT,WAAW,CAACoB,SAAZ,GAAwB;AACtBjB,EAAAA,SAAS,EAAEkB,sBAAUC,MADC;AAEtBlB,EAAAA,OAAO,EAAEiB,sBAAUE,MAFG;AAGtBlB,EAAAA,WAAW,EAAEgB,sBAAUC,MAHD;AAItB9B,EAAAA,QAAQ,EAAE6B,sBAAUG,IAJE;AAKtBlB,EAAAA,UAAU,EAAEmB,YAAMC,cALI;AAMtBnB,EAAAA,IAAI,EAAEkB,YAAME,SANU;AAOtBnB,EAAAA,EAAE,EAAEiB,YAAME,SAPY;AAQtBzB,EAAAA,QAAQ,EAAEmB,sBAAUC;AARE,CAAxB;AAWA,IAAMM,iBAAiB,GAAG,wBAAW3C,UAAX,EAAuBe,WAAvB,CAA1B;AAEA,IAAM6B,IAAI,GAAG,oBAASD,iBAAT,CAAb;AACA,IAAME,SAAS,GAAG,6BAAkBD,IAAlB,CAAlB;eAEeC,S","sourcesContent":["import { lineToolComponent, lineBase, styles } from '../shared/line';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { trig, types } from '@pie-lib/plot';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { ArrowMarker, genUid } from '../shared/arrow-head';\nimport { thinnerShapesNeeded, getAdjustedGraphLimits } from '../../utils';\n\nconst lineStyles = (theme) => ({\n line: styles.line(theme),\n enabledArrow: styles.arrow(theme),\n disabledArrow: styles.disabledArrow(theme),\n disabled: styles.disabled(theme),\n disabledSecondary: styles.disabledSecondary(theme),\n correct: styles.correct(theme, 'stroke'),\n correctArrow: styles.correct(theme),\n incorrect: styles.incorrect(theme, 'stroke'),\n incorrectArrow: styles.incorrect(theme),\n missing: styles.missing(theme, 'stroke'),\n missingArrow: styles.missing(theme),\n});\n\nexport const ArrowedLine = (props) => {\n const markerId = genUid();\n const { className, classes, correctness, disabled, graphProps, from, to, ...rest } = props;\n const { scale } = graphProps;\n const { domain, range } = getAdjustedGraphLimits(graphProps);\n const [eFrom, eTo] = trig.edges(domain, range)(from, to);\n const suffix = correctness || (disabled && 'disabled') || 'enabled';\n\n return (\n <g>\n <defs>\n <ArrowMarker\n size={thinnerShapesNeeded(graphProps) ? 4 : 5}\n id={`${props.markerId || markerId}-${suffix}`}\n className={classNames(classes[`${suffix}Arrow`])}\n />\n </defs>\n <line\n x1={scale.x(eFrom.x)}\n y1={scale.y(eFrom.y)}\n x2={scale.x(eTo.x)}\n y2={scale.y(eTo.y)}\n className={classNames(classes.line, disabled && classes.disabledSecondary, classes[correctness], className)}\n markerEnd={`url(#${props.markerId || markerId}-${suffix})`}\n markerStart={`url(#${props.markerId || markerId}-${suffix})`}\n {...rest}\n />\n </g>\n );\n};\n\nArrowedLine.propTypes = {\n className: PropTypes.string,\n classes: PropTypes.object,\n correctness: PropTypes.string,\n disabled: PropTypes.bool,\n graphProps: types.GraphPropsType,\n from: types.PointType,\n to: types.PointType,\n markerId: PropTypes.string,\n};\n\nconst StyledArrowedLine = withStyles(lineStyles)(ArrowedLine);\n\nconst Line = lineBase(StyledArrowedLine);\nconst Component = lineToolComponent(Line);\n\nexport default Component;\n"],"file":"component.js"}
1
+ {"version":3,"file":"component.js","names":["_line","require","_react","_interopRequireDefault","_propTypes","_plot","_classnames","_arrowHead","_utils","_styles","_excluded","StyledArrowedLineRoot","styled","_ref","theme","line","styles","enabledArrow","arrow","disabledArrow","disabled","disabledSecondary","correct","correctArrow","incorrect","incorrectArrow","missing","missingArrow","ArrowedLine","exports","props","markerId","genUid","className","correctness","graphProps","from","to","propMarkerId","rest","_objectWithoutProperties2","scale","_getAdjustedGraphLimi","getAdjustedGraphLimits","domain","range","_trig$edges","trig","edges","_trig$edges2","_slicedToArray2","eFrom","eTo","suffix","finalMarkerId","createElement","ArrowMarker","size","thinnerShapesNeeded","id","concat","classNames","_extends2","x1","x","y1","y","x2","y2","markerEnd","markerStart","propTypes","PropTypes","string","bool","types","GraphPropsType","PointType","Line","lineBase","Component","lineToolComponent","_default"],"sources":["../../../src/tools/line/component.jsx"],"sourcesContent":["import { lineToolComponent, lineBase, styles } from '../shared/line';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { trig, types } from '@pie-lib/plot';\nimport classNames from 'classnames';\nimport { ArrowMarker, genUid } from '../shared/arrow-head';\nimport { thinnerShapesNeeded, getAdjustedGraphLimits } from '../../utils';\nimport { styled } from '@mui/material/styles';\n\nconst StyledArrowedLineRoot = styled('g')(({ theme }) => ({\n line: styles.line(theme),\n enabledArrow: styles.arrow(theme),\n disabledArrow: styles.disabledArrow(theme),\n disabled: styles.disabled(theme),\n disabledSecondary: styles.disabledSecondary(theme),\n correct: styles.correct(theme, 'stroke'),\n correctArrow: styles.correct(theme),\n incorrect: styles.incorrect(theme, 'stroke'),\n incorrectArrow: styles.incorrect(theme),\n missing: styles.missing(theme, 'stroke'),\n missingArrow: styles.missing(theme),\n}));\n\nexport const ArrowedLine = (props) => {\n const markerId = genUid();\n const { className, correctness, disabled, graphProps, from, to, markerId: propMarkerId, ...rest } = props;\n const { scale } = graphProps;\n const { domain, range } = getAdjustedGraphLimits(graphProps);\n const [eFrom, eTo] = trig.edges(domain, range)(from, to);\n const suffix = correctness || (disabled && 'disabled') || 'enabled';\n const finalMarkerId = propMarkerId || markerId;\n\n return (\n <StyledArrowedLineRoot>\n <defs>\n <ArrowMarker\n size={thinnerShapesNeeded(graphProps) ? 4 : 5}\n id={`${finalMarkerId}-${suffix}`}\n className={classNames(\n suffix === 'enabled' ? 'enabledArrow' :\n suffix === 'disabled' ? 'disabledArrow' :\n `${suffix}Arrow`\n )}\n />\n </defs>\n <line\n x1={scale.x(eFrom.x)}\n y1={scale.y(eFrom.y)}\n x2={scale.x(eTo.x)}\n y2={scale.y(eTo.y)}\n className={classNames(\n 'line',\n disabled && 'disabledSecondary',\n correctness,\n className\n )}\n markerEnd={`url(#${finalMarkerId}-${suffix})`}\n markerStart={`url(#${finalMarkerId}-${suffix})`}\n {...rest}\n />\n </StyledArrowedLineRoot>\n );\n};\n\nArrowedLine.propTypes = {\n className: PropTypes.string,\n correctness: PropTypes.string,\n disabled: PropTypes.bool,\n graphProps: types.GraphPropsType,\n from: types.PointType,\n to: types.PointType,\n markerId: PropTypes.string,\n};\n\nconst Line = lineBase(ArrowedLine);\nconst Component = lineToolComponent(Line);\n\nexport default Component;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAA8C,IAAAS,SAAA;AAE9C,IAAMC,qBAAqB,GAAG,IAAAC,cAAM,EAAC,GAAG,CAAC,CAAC,UAAAC,IAAA;EAAA,IAAGC,KAAK,GAAAD,IAAA,CAALC,KAAK;EAAA,OAAQ;IACxDC,IAAI,EAAEC,YAAM,CAACD,IAAI,CAACD,KAAK,CAAC;IACxBG,YAAY,EAAED,YAAM,CAACE,KAAK,CAACJ,KAAK,CAAC;IACjCK,aAAa,EAAEH,YAAM,CAACG,aAAa,CAACL,KAAK,CAAC;IAC1CM,QAAQ,EAAEJ,YAAM,CAACI,QAAQ,CAACN,KAAK,CAAC;IAChCO,iBAAiB,EAAEL,YAAM,CAACK,iBAAiB,CAACP,KAAK,CAAC;IAClDQ,OAAO,EAAEN,YAAM,CAACM,OAAO,CAACR,KAAK,EAAE,QAAQ,CAAC;IACxCS,YAAY,EAAEP,YAAM,CAACM,OAAO,CAACR,KAAK,CAAC;IACnCU,SAAS,EAAER,YAAM,CAACQ,SAAS,CAACV,KAAK,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,qBAAS,CAACE,IAAI;EACxBvC,UAAU,EAAEwC,WAAK,CAACC,cAAc;EAChCxC,IAAI,EAAEuC,WAAK,CAACE,SAAS;EACrBxC,EAAE,EAAEsC,WAAK,CAACE,SAAS;EACnB9C,QAAQ,EAAEyC,qBAAS,CAACC;AACtB,CAAC;AAED,IAAMK,IAAI,GAAG,IAAAC,cAAQ,EAACnD,WAAW,CAAC;AAClC,IAAMoD,SAAS,GAAG,IAAAC,uBAAiB,EAACH,IAAI,CAAC;AAAC,IAAAI,QAAA,GAAArD,OAAA,cAE3BmD,SAAS","ignoreList":[]}
@@ -1,16 +1,11 @@
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.tool = void 0;
9
-
10
8
  var _component = _interopRequireDefault(require("./component"));
11
-
12
9
  var _line = require("../shared/line");
13
-
14
- var tool = (0, _line.lineTool)('line', _component["default"]);
15
- exports.tool = tool;
10
+ var tool = exports.tool = (0, _line.lineTool)('line', _component["default"]);
16
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/tools/line/index.js"],"names":["tool","Line"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEO,IAAMA,IAAI,GAAG,oBAAS,MAAT,EAAiBC,qBAAjB,CAAb","sourcesContent":["import Line from './component';\nimport { lineTool } from '../shared/line';\n\nexport const tool = lineTool('line', Line);\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":["_component","_interopRequireDefault","require","_line","tool","exports","lineTool","Line"],"sources":["../../../src/tools/line/index.js"],"sourcesContent":["import Line from './component';\nimport { lineTool } from '../shared/line';\n\nexport const tool = lineTool('line', Line);\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,IAAME,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG,IAAAE,cAAQ,EAAC,MAAM,EAAEC,qBAAI,CAAC","ignoreList":[]}
@@ -1,25 +1,20 @@
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["default"] = void 0;
9
-
10
8
  var _debug = _interopRequireDefault(require("debug"));
11
-
12
9
  var _graphingUtils = require("@pie-lib/graphing-utils");
13
-
14
10
  var _withRootEdge = require("../shared/line/with-root-edge");
15
-
16
11
  var log = (0, _debug["default"])('pie-lib:graphing:parabola');
17
12
  var Parabola = (0, _withRootEdge.withRootEdge)(function (props) {
18
13
  var root = props.root,
19
- edge = props.edge,
20
- graphProps = props.graphProps;
14
+ edge = props.edge,
15
+ graphProps = props.graphProps;
21
16
  var domain = graphProps.domain,
22
- range = graphProps.range;
17
+ range = graphProps.range;
23
18
  var dataPoints = edge && edge.x === root.x ? [] : (0, _graphingUtils.buildDataPoints)(domain, range, root, edge, (0, _graphingUtils.parabolaFromTwoPoints)(root, edge), true);
24
19
  log('dataPoints:', dataPoints);
25
20
  return {
@@ -29,6 +24,5 @@ var Parabola = (0, _withRootEdge.withRootEdge)(function (props) {
29
24
  };
30
25
  });
31
26
  var Component = (0, _withRootEdge.rootEdgeComponent)(Parabola);
32
- var _default = Component;
33
- exports["default"] = _default;
27
+ var _default = exports["default"] = Component;
34
28
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/tools/parabola/component.jsx"],"names":["log","Parabola","props","root","edge","graphProps","domain","range","dataPoints","x","Component"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,GAAG,GAAG,uBAAM,2BAAN,CAAZ;AAEA,IAAMC,QAAQ,GAAG,gCAAa,UAACC,KAAD,EAAW;AACvC,MAAQC,IAAR,GAAmCD,KAAnC,CAAQC,IAAR;AAAA,MAAcC,IAAd,GAAmCF,KAAnC,CAAcE,IAAd;AAAA,MAAoBC,UAApB,GAAmCH,KAAnC,CAAoBG,UAApB;AACA,MAAQC,MAAR,GAA0BD,UAA1B,CAAQC,MAAR;AAAA,MAAgBC,KAAhB,GAA0BF,UAA1B,CAAgBE,KAAhB;AAEA,MAAMC,UAAU,GACdJ,IAAI,IAAIA,IAAI,CAACK,CAAL,KAAWN,IAAI,CAACM,CAAxB,GACI,EADJ,GAEI,oCAAgBH,MAAhB,EAAwBC,KAAxB,EAA+BJ,IAA/B,EAAqCC,IAArC,EAA2C,0CAAsBD,IAAtB,EAA4BC,IAA5B,CAA3C,EAA8E,IAA9E,CAHN;AAKAJ,EAAAA,GAAG,CAAC,aAAD,EAAgBQ,UAAhB,CAAH;AAEA,SAAO;AAAEL,IAAAA,IAAI,EAAED,KAAK,CAACC,IAAd;AAAoBC,IAAAA,IAAI,EAAEF,KAAK,CAACE,IAAhC;AAAsCI,IAAAA,UAAU,EAAVA;AAAtC,GAAP;AACD,CAZgB,CAAjB;AAcA,IAAME,SAAS,GAAG,qCAAkBT,QAAlB,CAAlB;eAEeS,S","sourcesContent":["import debug from 'debug';\nimport { buildDataPoints, parabolaFromTwoPoints } from '@pie-lib/graphing-utils';\nimport { withRootEdge, rootEdgeComponent } from '../shared/line/with-root-edge';\n\nconst log = debug('pie-lib:graphing:parabola');\n\nconst Parabola = withRootEdge((props) => {\n const { root, edge, graphProps } = props;\n const { domain, range } = graphProps;\n\n const dataPoints =\n edge && edge.x === root.x\n ? []\n : buildDataPoints(domain, range, root, edge, parabolaFromTwoPoints(root, edge), true);\n\n log('dataPoints:', dataPoints);\n\n return { root: props.root, edge: props.edge, dataPoints };\n});\n\nconst Component = rootEdgeComponent(Parabola);\n\nexport default Component;\n"],"file":"component.js"}
1
+ {"version":3,"file":"component.js","names":["_debug","_interopRequireDefault","require","_graphingUtils","_withRootEdge","log","debug","Parabola","withRootEdge","props","root","edge","graphProps","domain","range","dataPoints","x","buildDataPoints","parabolaFromTwoPoints","Component","rootEdgeComponent","_default","exports"],"sources":["../../../src/tools/parabola/component.jsx"],"sourcesContent":["import debug from 'debug';\nimport { buildDataPoints, parabolaFromTwoPoints } from '@pie-lib/graphing-utils';\nimport { withRootEdge, rootEdgeComponent } from '../shared/line/with-root-edge';\n\nconst log = debug('pie-lib:graphing:parabola');\n\nconst Parabola = withRootEdge((props) => {\n const { root, edge, graphProps } = props;\n const { domain, range } = graphProps;\n\n const dataPoints =\n edge && edge.x === root.x\n ? []\n : buildDataPoints(domain, range, root, edge, parabolaFromTwoPoints(root, edge), true);\n\n log('dataPoints:', dataPoints);\n\n return { root: props.root, edge: props.edge, dataPoints };\n});\n\nconst Component = rootEdgeComponent(Parabola);\n\nexport default Component;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAMG,GAAG,GAAG,IAAAC,iBAAK,EAAC,2BAA2B,CAAC;AAE9C,IAAMC,QAAQ,GAAG,IAAAC,0BAAY,EAAC,UAACC,KAAK,EAAK;EACvC,IAAQC,IAAI,GAAuBD,KAAK,CAAhCC,IAAI;IAAEC,IAAI,GAAiBF,KAAK,CAA1BE,IAAI;IAAEC,UAAU,GAAKH,KAAK,CAApBG,UAAU;EAC9B,IAAQC,MAAM,GAAYD,UAAU,CAA5BC,MAAM;IAAEC,KAAK,GAAKF,UAAU,CAApBE,KAAK;EAErB,IAAMC,UAAU,GACdJ,IAAI,IAAIA,IAAI,CAACK,CAAC,KAAKN,IAAI,CAACM,CAAC,GACrB,EAAE,GACF,IAAAC,8BAAe,EAACJ,MAAM,EAAEC,KAAK,EAAEJ,IAAI,EAAEC,IAAI,EAAE,IAAAO,oCAAqB,EAACR,IAAI,EAAEC,IAAI,CAAC,EAAE,IAAI,CAAC;EAEzFN,GAAG,CAAC,aAAa,EAAEU,UAAU,CAAC;EAE9B,OAAO;IAAEL,IAAI,EAAED,KAAK,CAACC,IAAI;IAAEC,IAAI,EAAEF,KAAK,CAACE,IAAI;IAAEI,UAAU,EAAVA;EAAW,CAAC;AAC3D,CAAC,CAAC;AAEF,IAAMI,SAAS,GAAG,IAAAC,+BAAiB,EAACb,QAAQ,CAAC;AAAC,IAAAc,QAAA,GAAAC,OAAA,cAE/BH,SAAS","ignoreList":[]}
@@ -1,27 +1,18 @@
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.tool = void 0;
9
-
10
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
9
  var _component = _interopRequireDefault(require("./component"));
13
-
14
10
  var _debug = _interopRequireDefault(require("debug"));
15
-
16
11
  var _utils = require("../../utils");
17
-
18
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
-
20
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
-
12
+ 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; }
13
+ 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; }
22
14
  var log = (0, _debug["default"])('pie-lib:graphing:parabola');
23
-
24
- var tool = function tool() {
15
+ var tool = exports.tool = function tool() {
25
16
  return {
26
17
  type: 'parabola',
27
18
  Component: _component["default"],
@@ -33,11 +24,9 @@ var tool = function tool() {
33
24
  },
34
25
  addPoint: function addPoint(point, mark) {
35
26
  log('add point to parabola model: ', point, 'mark: ', mark);
36
-
37
27
  if (mark && ((0, _utils.equalPoints)(mark.root, point) || (0, _utils.sameAxes)(mark.root, point))) {
38
28
  return mark;
39
29
  }
40
-
41
30
  if (!mark) {
42
31
  return {
43
32
  type: 'parabola',
@@ -58,6 +47,4 @@ var tool = function tool() {
58
47
  }
59
48
  };
60
49
  };
61
-
62
- exports.tool = tool;
63
50
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/tools/parabola/index.js"],"names":["log","tool","type","Component","Parabola","complete","data","mark","building","closed","addPoint","point","root","edge","undefined","Error"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,2BAAN,CAAZ;;AAEO,IAAMC,IAAI,GAAG,SAAPA,IAAO;AAAA,SAAO;AACzBC,IAAAA,IAAI,EAAE,UADmB;AAEzBC,IAAAA,SAAS,EAAEC,qBAFc;AAGzBC,IAAAA,QAAQ,EAAE,kBAACC,IAAD,EAAOC,IAAP;AAAA,6CAAsBA,IAAtB;AAA4BC,QAAAA,QAAQ,EAAE,KAAtC;AAA6CC,QAAAA,MAAM,EAAE;AAArD;AAAA,KAHe;AAIzBC,IAAAA,QAAQ,EAAE,kBAACC,KAAD,EAAQJ,IAAR,EAAiB;AACzBP,MAAAA,GAAG,CAAC,+BAAD,EAAkCW,KAAlC,EAAyC,QAAzC,EAAmDJ,IAAnD,CAAH;;AACA,UAAIA,IAAI,KAAK,wBAAYA,IAAI,CAACK,IAAjB,EAAuBD,KAAvB,KAAiC,qBAASJ,IAAI,CAACK,IAAd,EAAoBD,KAApB,CAAtC,CAAR,EAA2E;AACzE,eAAOJ,IAAP;AACD;;AAED,UAAI,CAACA,IAAL,EAAW;AACT,eAAO;AACLL,UAAAA,IAAI,EAAE,UADD;AAELU,UAAAA,IAAI,EAAED,KAFD;AAGLE,UAAAA,IAAI,EAAEC,SAHD;AAILL,UAAAA,MAAM,EAAE,KAJH;AAKLD,UAAAA,QAAQ,EAAE;AALL,SAAP;AAOD,OARD,MAQO,IAAID,IAAI,IAAI,CAACA,IAAI,CAACK,IAAlB,EAAwB;AAC7B,cAAM,IAAIG,KAAJ,CAAU,+BAAV,CAAN;AACD,OAFM,MAEA;AACL,+CAAYR,IAAZ;AAAkBM,UAAAA,IAAI,EAAEF,KAAxB;AAA+BF,UAAAA,MAAM,EAAE,IAAvC;AAA6CD,UAAAA,QAAQ,EAAE;AAAvD;AACD;AACF;AAvBwB,GAAP;AAAA,CAAb","sourcesContent":["import Parabola from './component';\nimport debug from 'debug';\nimport { equalPoints, sameAxes } from '../../utils';\n\nconst log = debug('pie-lib:graphing:parabola');\n\nexport const tool = () => ({\n type: 'parabola',\n Component: Parabola,\n complete: (data, mark) => ({ ...mark, building: false, closed: true }),\n addPoint: (point, mark) => {\n log('add point to parabola model: ', point, 'mark: ', mark);\n if (mark && (equalPoints(mark.root, point) || sameAxes(mark.root, point))) {\n return mark;\n }\n\n if (!mark) {\n return {\n type: 'parabola',\n root: point,\n edge: undefined,\n closed: false,\n building: true,\n };\n } else if (mark && !mark.root) {\n throw new Error('no root - should never happen');\n } else {\n return { ...mark, edge: point, closed: true, building: false };\n }\n },\n});\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":["_component","_interopRequireDefault","require","_debug","_utils","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","log","debug","tool","exports","type","Component","Parabola","complete","data","mark","building","closed","addPoint","point","equalPoints","root","sameAxes","edge","undefined","Error"],"sources":["../../../src/tools/parabola/index.js"],"sourcesContent":["import Parabola from './component';\nimport debug from 'debug';\nimport { equalPoints, sameAxes } from '../../utils';\n\nconst log = debug('pie-lib:graphing:parabola');\n\nexport const tool = () => ({\n type: 'parabola',\n Component: Parabola,\n complete: (data, mark) => ({ ...mark, building: false, closed: true }),\n addPoint: (point, mark) => {\n log('add point to parabola model: ', point, 'mark: ', mark);\n if (mark && (equalPoints(mark.root, point) || sameAxes(mark.root, point))) {\n return mark;\n }\n\n if (!mark) {\n return {\n type: 'parabola',\n root: point,\n edge: undefined,\n closed: false,\n building: true,\n };\n } else if (mark && !mark.root) {\n throw new Error('no root - should never happen');\n } else {\n return { ...mark, edge: point, closed: true, building: false };\n }\n },\n});\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAoD,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CA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