@pie-lib/graphing-utils 1.21.2-next.0 → 1.22.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 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
- ## [1.21.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing-utils@1.17.0...@pie-lib/graphing-utils@1.21.1) (2025-10-22)
6
+ # [1.22.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing-utils@1.21.0-mui-update.0...@pie-lib/graphing-utils@1.22.0-mui-update.0) (2025-11-05)
7
7
 
8
8
  **Note:** Version bump only for package @pie-lib/graphing-utils
9
9
 
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- # [1.21.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing-utils@1.17.0...@pie-lib/graphing-utils@1.21.0) (2025-10-16)
14
+ # [1.21.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing-utils@1.20.0-mui-update.0...@pie-lib/graphing-utils@1.21.0-mui-update.0) (2025-11-03)
15
15
 
16
16
  **Note:** Version bump only for package @pie-lib/graphing-utils
17
17
 
@@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
19
 
20
20
 
21
21
 
22
- # [1.20.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing-utils@1.17.0...@pie-lib/graphing-utils@1.20.0) (2025-10-16)
22
+ # [1.20.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing-utils@1.18.0-mui-update.0...@pie-lib/graphing-utils@1.20.0-mui-update.0) (2025-11-03)
23
23
 
24
24
  **Note:** Version bump only for package @pie-lib/graphing-utils
25
25
 
@@ -27,15 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
27
27
 
28
28
 
29
29
 
30
- # [1.19.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing-utils@1.17.0...@pie-lib/graphing-utils@1.19.0) (2025-10-16)
31
-
32
- **Note:** Version bump only for package @pie-lib/graphing-utils
33
-
34
-
35
-
36
-
37
-
38
- # [1.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing-utils@1.17.0...@pie-lib/graphing-utils@1.18.0) (2025-10-16)
30
+ # [1.18.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing-utils@1.17.0...@pie-lib/graphing-utils@1.18.0-mui-update.0) (2025-10-31)
39
31
 
40
32
  **Note:** Version bump only for package @pie-lib/graphing-utils
41
33
 
package/lib/index.js CHANGED
@@ -1,80 +1,58 @@
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.xPoints = exports.sinY = exports.pointsToAForAbsolute = exports.pointsToABForExponential = exports.pointsToABC = exports.parabolaFromTwoPoints = exports.parabolaFromThreePoints = exports.parabola = exports.getAmplitudeAndFreq = exports.exponentialFromTwoPoints = exports.exponential = exports["default"] = exports.buildDataPoints = exports.absoluteFromTwoPoints = exports.absolute = exports.FREQ_DIVIDER = void 0;
9
-
10
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
-
12
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
-
14
10
  var _debug = _interopRequireDefault(require("debug"));
15
-
16
11
  var _pointGeometry = _interopRequireDefault(require("@mapbox/point-geometry"));
17
-
18
12
  var _lodash = _interopRequireDefault(require("lodash"));
19
-
20
- 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; }
21
-
22
- 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; }
23
-
13
+ 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; }
14
+ 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; }
24
15
  var log = (0, _debug["default"])('pie-lib:graphing:tools:utils');
25
- var FREQ_DIVIDER = 16;
26
- exports.FREQ_DIVIDER = FREQ_DIVIDER;
27
-
28
- var getAmplitudeAndFreq = function getAmplitudeAndFreq(root, edge) {
16
+ var FREQ_DIVIDER = exports.FREQ_DIVIDER = 16;
17
+ var getAmplitudeAndFreq = exports.getAmplitudeAndFreq = function getAmplitudeAndFreq(root, edge) {
29
18
  if (!edge) {
30
19
  return {
31
20
  freq: 0,
32
21
  amplitude: 0
33
22
  };
34
23
  }
35
-
36
24
  if (root.x == edge.x) {
37
25
  return {
38
26
  freq: 0,
39
27
  amplitude: 0
40
28
  };
41
29
  }
42
-
43
30
  var r = new _pointGeometry["default"](root.x, root.y);
44
31
  var e = new _pointGeometry["default"](edge.x, edge.y);
45
- var d = e.sub(r); // edge point describes 1/4 of the freq
46
-
32
+ var d = e.sub(r);
33
+ // edge point describes 1/4 of the freq
47
34
  return {
48
35
  freq: d.x * 4,
49
36
  amplitude: d.y
50
37
  };
51
38
  };
39
+
52
40
  /**
53
41
  * build the x points with root as the anchor.
54
42
  */
55
-
56
-
57
- exports.getAmplitudeAndFreq = getAmplitudeAndFreq;
58
-
59
- var xPoints = function xPoints(root, freq, min, max) {
43
+ var xPoints = exports.xPoints = function xPoints(root, freq, min, max) {
60
44
  freq = Math.abs(freq);
61
45
  log('[xPoints] root:', root, 'freq:', freq, ' min:', min, ' max:', max);
62
-
63
46
  var leftpoints = _lodash["default"].rangeRight(root, min - freq, freq * -1);
64
-
65
47
  var rightpoints = _lodash["default"].range(root + freq, max + freq, freq);
66
-
67
48
  return _lodash["default"].concat(leftpoints, rightpoints);
68
49
  };
50
+
69
51
  /**
70
52
  * Calculate y for x value using amp, freq and shift
71
53
  * https://www.desmos.com/calculator/f1psfoiiv6
72
54
  */
73
-
74
-
75
- exports.xPoints = xPoints;
76
-
77
- var sinY = function sinY(amplitude, freq, shift) {
55
+ var sinY = exports.sinY = function sinY(amplitude, freq, shift) {
78
56
  return function (x) {
79
57
  shift = _objectSpread({
80
58
  phase: 0,
@@ -88,15 +66,12 @@ var sinY = function sinY(amplitude, freq, shift) {
88
66
  return amplitude * sinFloat + shift.vertical;
89
67
  };
90
68
  };
69
+
91
70
  /**
92
71
  * You need three points for the quadratic eq, so we mirror the edge point
93
72
  * https://www.desmos.com/calculator/xhz1xqgpca
94
73
  */
95
-
96
-
97
- exports.sinY = sinY;
98
-
99
- var parabolaFromTwoPoints = function parabolaFromTwoPoints(root, edge) {
74
+ var parabolaFromTwoPoints = exports.parabolaFromTwoPoints = function parabolaFromTwoPoints(root, edge) {
100
75
  edge = edge || _objectSpread({}, root);
101
76
  var mirrorEdge = {
102
77
  x: root.x - (edge.x - root.x),
@@ -104,26 +79,17 @@ var parabolaFromTwoPoints = function parabolaFromTwoPoints(root, edge) {
104
79
  };
105
80
  return parabolaFromThreePoints(root, edge, mirrorEdge);
106
81
  };
107
-
108
- exports.parabolaFromTwoPoints = parabolaFromTwoPoints;
109
-
110
- var parabolaFromThreePoints = function parabolaFromThreePoints(one, two, three) {
82
+ var parabolaFromThreePoints = exports.parabolaFromThreePoints = function parabolaFromThreePoints(one, two, three) {
111
83
  log(one, two, three);
112
-
113
84
  var _pointsToABC = pointsToABC(one, two, three),
114
- a = _pointsToABC.a,
115
- b = _pointsToABC.b,
116
- c = _pointsToABC.c;
117
-
85
+ a = _pointsToABC.a,
86
+ b = _pointsToABC.b,
87
+ c = _pointsToABC.c;
118
88
  log(a, b, c);
119
89
  return parabola(a, b, c);
120
90
  };
121
91
  /** derive a,b,c from the 3 points */
122
-
123
-
124
- exports.parabolaFromThreePoints = parabolaFromThreePoints;
125
-
126
- var pointsToABC = function pointsToABC(one, two, three) {
92
+ var pointsToABC = exports.pointsToABC = function pointsToABC(one, two, three) {
127
93
  var a1 = Math.pow(one.x, 2) * -1 + Math.pow(two.x, 2);
128
94
  var b1 = one.x * -1 + two.x;
129
95
  var d1 = one.y * -1 + two.y;
@@ -142,94 +108,72 @@ var pointsToABC = function pointsToABC(one, two, three) {
142
108
  c: c
143
109
  };
144
110
  };
111
+
145
112
  /**
146
113
  * y=ax^2+bx+c
147
114
  */
148
-
149
-
150
- exports.pointsToABC = pointsToABC;
151
-
152
- var parabola = function parabola(a, b, c) {
115
+ var parabola = exports.parabola = function parabola(a, b, c) {
153
116
  return function (x) {
154
117
  return a * Math.pow(x, 2) + b * x + c;
155
118
  };
156
119
  };
120
+
157
121
  /**
158
122
  * Absolute value from two points Root (Vertex) the point where the two rays intersect and edge One point on a ray.
159
123
  * @param root 1st point selected on graph
160
124
  * @param edge 2nd point selected on graph
161
125
  * https://www.desmos.com/calculator/rarxiatpip
162
126
  */
163
-
164
-
165
- exports.parabola = parabola;
166
-
167
- var absoluteFromTwoPoints = function absoluteFromTwoPoints(root, edge) {
127
+ var absoluteFromTwoPoints = exports.absoluteFromTwoPoints = function absoluteFromTwoPoints(root, edge) {
168
128
  edge = edge || _objectSpread({}, root);
169
129
  var a = pointsToAForAbsolute(root, edge);
170
130
  return absolute(a, root.x, root.y);
171
131
  };
132
+
172
133
  /*
173
134
  * Finds value of a in y=a*abs(x-h)+k function
174
135
  * @param one 1st point
175
136
  * @param two 2nd point
176
137
  * */
177
-
178
-
179
- exports.absoluteFromTwoPoints = absoluteFromTwoPoints;
180
-
181
- var pointsToAForAbsolute = function pointsToAForAbsolute(one, two) {
138
+ var pointsToAForAbsolute = exports.pointsToAForAbsolute = function pointsToAForAbsolute(one, two) {
182
139
  var y1 = two.y - one.y;
183
140
  var x1 = two.x - one.x;
184
141
  var a = y1 / x1;
185
-
186
142
  if (two.x < one.x) {
187
143
  a = a * -1;
188
144
  }
189
-
190
145
  return a;
191
146
  };
147
+
192
148
  /**
193
149
  * y=a*abs(x-h)+k
194
150
  */
195
-
196
-
197
- exports.pointsToAForAbsolute = pointsToAForAbsolute;
198
-
199
- var absolute = function absolute(a, h, k) {
151
+ var absolute = exports.absolute = function absolute(a, h, k) {
200
152
  return function (x) {
201
153
  return a * Math.abs(x - h) + k;
202
154
  };
203
155
  };
156
+
204
157
  /**
205
158
  * Exponential from two points on exponential graph.
206
159
  * @param root 1st point selected on graph
207
160
  * @param edge 2nd point selected on graph
208
161
  * https://www.desmos.com/calculator/3fisjexbvp
209
162
  */
210
-
211
-
212
- exports.absolute = absolute;
213
-
214
- var exponentialFromTwoPoints = function exponentialFromTwoPoints(root, edge) {
163
+ var exponentialFromTwoPoints = exports.exponentialFromTwoPoints = function exponentialFromTwoPoints(root, edge) {
215
164
  edge = edge || _objectSpread({}, root);
216
-
217
165
  var _pointsToABForExponen = pointsToABForExponential(root, edge),
218
- a = _pointsToABForExponen.a,
219
- b = _pointsToABForExponen.b;
220
-
166
+ a = _pointsToABForExponen.a,
167
+ b = _pointsToABForExponen.b;
221
168
  return exponential(a, b);
222
169
  };
170
+
223
171
  /*
224
172
  * Finds value of a and b in y=a*(b)^x function
225
173
  * @param one 1st point
226
174
  * @param two 2nd point
227
175
  * */
228
-
229
-
230
- exports.exponentialFromTwoPoints = exponentialFromTwoPoints;
231
-
232
- var pointsToABForExponential = function pointsToABForExponential(one, two) {
176
+ var pointsToABForExponential = exports.pointsToABForExponential = function pointsToABForExponential(one, two) {
233
177
  var p = one.y / two.y;
234
178
  var r = 1 / (one.x - two.x);
235
179
  var b = Math.pow(p, r);
@@ -239,18 +183,16 @@ var pointsToABForExponential = function pointsToABForExponential(one, two) {
239
183
  b: b
240
184
  };
241
185
  };
186
+
242
187
  /**
243
188
  * y=a*(b)^x
244
189
  */
245
-
246
-
247
- exports.pointsToABForExponential = pointsToABForExponential;
248
-
249
- var exponential = function exponential(a, b) {
190
+ var exponential = exports.exponential = function exponential(a, b) {
250
191
  return function (x) {
251
192
  return a * Math.pow(b, x);
252
193
  };
253
194
  };
195
+
254
196
  /**
255
197
  * Generate a set of data points, add spacing before min and after max if there is space between minx + min and maxX and max
256
198
  * @param {*} domain
@@ -260,11 +202,7 @@ var exponential = function exponential(a, b) {
260
202
  * @param {*} yFn
261
203
  * @param {*} excludeOutsidePoints
262
204
  */
263
-
264
-
265
- exports.exponential = exponential;
266
-
267
- var buildDataPoints = function buildDataPoints(domain, range, root, edge, yFn) {
205
+ var buildDataPoints = exports.buildDataPoints = function buildDataPoints(domain, range, root, edge, yFn) {
268
206
  var excludeOutsidePoints = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
269
207
  log('[buildDataPoints] domain:', domain, 'range:', range, 'root:', root, 'edge:', edge);
270
208
  domain = _objectSpread({
@@ -282,47 +220,42 @@ var buildDataPoints = function buildDataPoints(domain, range, root, edge, yFn) {
282
220
  var xPts = xPoints(minX, domain.step, domain.min - domain.step, domain.max + domain.step);
283
221
  log('[buildDataPoints]:xPts:', xPts);
284
222
  var startIndex = -1;
285
- var endIndex = -1; // generate points based on the yFn
223
+ var endIndex = -1;
286
224
 
225
+ // generate points based on the yFn
287
226
  var points = xPts.map(function (v) {
288
227
  return new _pointGeometry["default"](v, yFn(v));
289
228
  });
290
-
291
229
  if (!excludeOutsidePoints) {
292
230
  return points;
293
- } // exclude the points with y outside range min and max
294
-
231
+ }
295
232
 
233
+ // exclude the points with y outside range min and max
296
234
  var filteredPoints = points.reduce(function (acc, val, index) {
297
235
  if (val.y >= range.min - range.step && val.y <= range.max + range.step) {
298
236
  if (startIndex === -1) {
299
237
  startIndex = index;
300
238
  }
301
-
302
239
  if (endIndex < index) {
303
240
  endIndex = index;
304
241
  }
305
-
306
242
  return [].concat((0, _toConsumableArray2["default"])(acc), [val]);
307
243
  }
308
-
309
244
  return acc;
310
- }, []); // add the first value outside range min and max smaller than range.min if exists
245
+ }, []);
311
246
 
247
+ // add the first value outside range min and max smaller than range.min if exists
312
248
  if (startIndex - 1 >= 0) {
313
249
  filteredPoints.unshift(points[startIndex - 1]);
314
- } // add the first value outside range min and max greater than range.min if exists
315
-
250
+ }
316
251
 
252
+ // add the first value outside range min and max greater than range.min if exists
317
253
  if (endIndex + 1 <= points.length - 1) {
318
254
  filteredPoints.push(points[endIndex + 1]);
319
255
  }
320
-
321
256
  return points;
322
257
  };
323
-
324
- exports.buildDataPoints = buildDataPoints;
325
- var _default = {
258
+ var _default = exports["default"] = {
326
259
  FREQ_DIVIDER: FREQ_DIVIDER,
327
260
  getAmplitudeAndFreq: getAmplitudeAndFreq,
328
261
  xPoints: xPoints,
@@ -339,5 +272,4 @@ var _default = {
339
272
  exponential: exponential,
340
273
  buildDataPoints: buildDataPoints
341
274
  };
342
- exports["default"] = _default;
343
275
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["log","FREQ_DIVIDER","getAmplitudeAndFreq","root","edge","freq","amplitude","x","r","Point","y","e","d","sub","xPoints","min","max","Math","abs","leftpoints","_","rangeRight","rightpoints","range","concat","sinY","shift","phase","vertical","TWO_PI","PI","num","frac","sin","sinFloat","parseFloat","toFixed","parabolaFromTwoPoints","mirrorEdge","parabolaFromThreePoints","one","two","three","pointsToABC","a","b","c","parabola","a1","pow","b1","d1","a2","b2","d2","bMult","a3","d3","absoluteFromTwoPoints","pointsToAForAbsolute","absolute","y1","x1","h","k","exponentialFromTwoPoints","pointsToABForExponential","exponential","p","buildDataPoints","domain","yFn","excludeOutsidePoints","step","minX","xPts","startIndex","endIndex","points","map","v","filteredPoints","reduce","acc","val","index","unshift","length","push"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AACA,IAAMA,GAAG,GAAG,uBAAM,8BAAN,CAAZ;AAEO,IAAMC,YAAY,GAAG,EAArB;;;AAEA,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,IAAD,EAAOC,IAAP,EAAgB;AACjD,MAAI,CAACA,IAAL,EAAW;AACT,WAAO;AAAEC,MAAAA,IAAI,EAAE,CAAR;AAAWC,MAAAA,SAAS,EAAE;AAAtB,KAAP;AACD;;AAED,MAAIH,IAAI,CAACI,CAAL,IAAUH,IAAI,CAACG,CAAnB,EAAsB;AACpB,WAAO;AAAEF,MAAAA,IAAI,EAAE,CAAR;AAAWC,MAAAA,SAAS,EAAE;AAAtB,KAAP;AACD;;AAED,MAAME,CAAC,GAAG,IAAIC,yBAAJ,CAAUN,IAAI,CAACI,CAAf,EAAkBJ,IAAI,CAACO,CAAvB,CAAV;AACA,MAAMC,CAAC,GAAG,IAAIF,yBAAJ,CAAUL,IAAI,CAACG,CAAf,EAAkBH,IAAI,CAACM,CAAvB,CAAV;AACA,MAAME,CAAC,GAAGD,CAAC,CAACE,GAAF,CAAML,CAAN,CAAV,CAXiD,CAYjD;;AACA,SAAO;AAAEH,IAAAA,IAAI,EAAEO,CAAC,CAACL,CAAF,GAAM,CAAd;AAAiBD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a;AAIbW,EAAAA,IAAI,EAAJA,IAJa;AAKbY,EAAAA,qBAAqB,EAArBA,qBALa;AAMbE,EAAAA,uBAAuB,EAAvBA,uBANa;AAObI,EAAAA,WAAW,EAAXA,WAPa;AAQbI,EAAAA,QAAQ,EAARA,QARa;AASbW,EAAAA,qBAAqB,EAArBA,qBATa;AAUbC,EAAAA,oBAAoB,EAApBA,oBAVa;AAWbC,EAAAA,QAAQ,EAARA,QAXa;AAYbK,EAAAA,wBAAwB,EAAxBA,wBAZa;AAabC,EAAAA,wBAAwB,EAAxBA,wBAba;AAcbC,EAAAA,WAAW,EAAXA,WAda;AAebE,EAAAA,eAAe,EAAfA;AAfa,C","sourcesContent":["import debug from 'debug';\nimport Point from '@mapbox/point-geometry';\nimport _ from 'lodash';\nconst log = debug('pie-lib:graphing:tools:utils');\n\nexport const FREQ_DIVIDER = 16;\n\nexport const getAmplitudeAndFreq = (root, edge) => {\n if (!edge) {\n return { freq: 0, amplitude: 0 };\n }\n\n if (root.x == edge.x) {\n return { freq: 0, amplitude: 0 };\n }\n\n const r = new Point(root.x, root.y);\n const e = new Point(edge.x, edge.y);\n const d = e.sub(r);\n // edge point describes 1/4 of the freq\n return { freq: d.x * 4, amplitude: d.y };\n};\n\n/**\n * build the x points with root as the anchor.\n */\nexport const xPoints = (root, freq, min, max) => {\n freq = Math.abs(freq);\n log('[xPoints] root:', root, 'freq:', freq, ' min:', min, ' max:', max);\n const leftpoints = _.rangeRight(root, min - freq, freq * -1);\n const rightpoints = _.range(root + freq, max + freq, freq);\n\n return _.concat(leftpoints, rightpoints);\n};\n\n/**\n * Calculate y for x value using amp, freq and shift\n * https://www.desmos.com/calculator/f1psfoiiv6\n */\nexport const sinY = (amplitude, freq, shift) => (x) => {\n shift = { phase: 0, vertical: 0, ...shift };\n const TWO_PI = Math.PI * 2;\n const num = TWO_PI * (x - shift.phase);\n const frac = num / freq;\n const sin = Math.sin(frac);\n const sinFloat = parseFloat(sin).toFixed(10);\n return amplitude * sinFloat + shift.vertical;\n};\n\n/**\n * You need three points for the quadratic eq, so we mirror the edge point\n * https://www.desmos.com/calculator/xhz1xqgpca\n */\nexport const parabolaFromTwoPoints = (root, edge) => {\n edge = edge || { ...root };\n const mirrorEdge = { x: root.x - (edge.x - root.x), y: edge.y };\n return parabolaFromThreePoints(root, edge, mirrorEdge);\n};\n\nexport const parabolaFromThreePoints = (one, two, three) => {\n log(one, two, three);\n const { a, b, c } = pointsToABC(one, two, three);\n log(a, b, c);\n return parabola(a, b, c);\n};\n/** derive a,b,c from the 3 points */\nexport const pointsToABC = (one, two, three) => {\n const a1 = Math.pow(one.x, 2) * -1 + Math.pow(two.x, 2);\n const b1 = one.x * -1 + two.x;\n const d1 = one.y * -1 + two.y;\n const a2 = Math.pow(two.x, 2) * -1 + Math.pow(three.x, 2);\n const b2 = two.x * -1 + three.x;\n const d2 = two.y * -1 + three.y;\n const bMult = (b2 / b1) * -1;\n const a3 = bMult * a1 + a2;\n const d3 = bMult * d1 + d2;\n const a = d3 / a3;\n const b = (d1 - a1 * a) / b1;\n const c = one.y - a * Math.pow(one.x, 2) - b * one.x;\n return { a, b, c };\n};\n\n/**\n * y=ax^2+bx+c\n */\nexport const parabola = (a, b, c) => (x) => a * Math.pow(x, 2) + b * x + c;\n\n/**\n * Absolute value from two points Root (Vertex) the point where the two rays intersect and edge One point on a ray.\n * @param root 1st point selected on graph\n * @param edge 2nd point selected on graph\n * https://www.desmos.com/calculator/rarxiatpip\n */\nexport const absoluteFromTwoPoints = (root, edge) => {\n edge = edge || { ...root };\n const a = pointsToAForAbsolute(root, edge);\n return absolute(a, root.x, root.y);\n};\n\n/*\n * Finds value of a in y=a*abs(x-h)+k function\n * @param one 1st point\n * @param two 2nd point\n * */\nexport const pointsToAForAbsolute = (one, two) => {\n const y1 = two.y - one.y;\n const x1 = two.x - one.x;\n let a = y1 / x1;\n if (two.x < one.x) {\n a = a * -1;\n }\n return a;\n};\n\n/**\n * y=a*abs(x-h)+k\n */\nexport const absolute = (a, h, k) => (x) => a * Math.abs(x - h) + k;\n\n/**\n * Exponential from two points on exponential graph.\n * @param root 1st point selected on graph\n * @param edge 2nd point selected on graph\n * https://www.desmos.com/calculator/3fisjexbvp\n */\nexport const exponentialFromTwoPoints = (root, edge) => {\n edge = edge || { ...root };\n const { a, b } = pointsToABForExponential(root, edge);\n return exponential(a, b);\n};\n\n/*\n * Finds value of a and b in y=a*(b)^x function\n * @param one 1st point\n * @param two 2nd point\n * */\nexport const pointsToABForExponential = (one, two) => {\n const p = one.y / two.y;\n const r = 1 / (one.x - two.x);\n const b = Math.pow(p, r);\n const a = one.y / Math.pow(b, one.x);\n return { a, b };\n};\n\n/**\n * y=a*(b)^x\n */\nexport const exponential = (a, b) => (x) => a * Math.pow(b, x);\n\n/**\n * Generate a set of data points, add spacing before min and after max if there is space between minx + min and maxX and max\n * @param {*} domain\n * @param {*} range\n * @param {*} root\n * @param {*} edge\n * @param {*} yFn\n * @param {*} excludeOutsidePoints\n */\nexport const buildDataPoints = (domain, range, root, edge, yFn, excludeOutsidePoints = false) => {\n log('[buildDataPoints] domain:', domain, 'range:', range, 'root:', root, 'edge:', edge);\n\n domain = { min: 0, max: 0, step: 1, ...domain };\n range = { min: 0, max: 0, step: 1, ...range };\n edge = edge ? edge : { ...root };\n\n const minX = Math.min(root.x, edge.x);\n const xPts = xPoints(minX, domain.step, domain.min - domain.step, domain.max + domain.step);\n\n log('[buildDataPoints]:xPts:', xPts);\n\n let startIndex = -1;\n let endIndex = -1;\n\n // generate points based on the yFn\n const points = xPts.map((v) => new Point(v, yFn(v)));\n\n if (!excludeOutsidePoints) {\n return points;\n }\n\n // exclude the points with y outside range min and max\n const filteredPoints = points.reduce((acc, val, index) => {\n if (val.y >= range.min - range.step && val.y <= range.max + range.step) {\n if (startIndex === -1) {\n startIndex = index;\n }\n\n if (endIndex < index) {\n endIndex = index;\n }\n\n return [...acc, val];\n }\n\n return acc;\n }, []);\n\n // add the first value outside range min and max smaller than range.min if exists\n if (startIndex - 1 >= 0) {\n filteredPoints.unshift(points[startIndex - 1]);\n }\n\n // add the first value outside range min and max greater than range.min if exists\n if (endIndex + 1 <= points.length - 1) {\n filteredPoints.push(points[endIndex + 1]);\n }\n\n return points;\n};\n\nexport default {\n FREQ_DIVIDER,\n getAmplitudeAndFreq,\n xPoints,\n sinY,\n parabolaFromTwoPoints,\n parabolaFromThreePoints,\n pointsToABC,\n parabola,\n absoluteFromTwoPoints,\n pointsToAForAbsolute,\n absolute,\n exponentialFromTwoPoints,\n pointsToABForExponential,\n exponential,\n buildDataPoints,\n};\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":["_debug","_interopRequireDefault","require","_pointGeometry","_lodash","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","log","debug","FREQ_DIVIDER","exports","getAmplitudeAndFreq","root","edge","freq","amplitude","x","Point","y","d","sub","xPoints","min","max","Math","abs","leftpoints","_","rangeRight","rightpoints","range","concat","sinY","shift","phase","vertical","TWO_PI","PI","num","frac","sin","sinFloat","parseFloat","toFixed","parabolaFromTwoPoints","mirrorEdge","parabolaFromThreePoints","one","two","three","_pointsToABC","pointsToABC","a","b","c","parabola","a1","pow","b1","d1","a2","b2","d2","bMult","a3","d3","absoluteFromTwoPoints","pointsToAForAbsolute","absolute","y1","x1","h","k","exponentialFromTwoPoints","_pointsToABForExponen","pointsToABForExponential","exponential","p","buildDataPoints","domain","yFn","excludeOutsidePoints","undefined","step","minX","xPts","startIndex","endIndex","points","map","v","filteredPoints","reduce","acc","val","index","_toConsumableArray2","unshift","_default"],"sources":["../src/index.js"],"sourcesContent":["import debug from 'debug';\nimport Point from '@mapbox/point-geometry';\nimport _ from 'lodash';\nconst log = debug('pie-lib:graphing:tools:utils');\n\nexport const FREQ_DIVIDER = 16;\n\nexport const getAmplitudeAndFreq = (root, edge) => {\n if (!edge) {\n return { freq: 0, amplitude: 0 };\n }\n\n if (root.x == edge.x) {\n return { freq: 0, amplitude: 0 };\n }\n\n const r = new Point(root.x, root.y);\n const e = new Point(edge.x, edge.y);\n const d = e.sub(r);\n // edge point describes 1/4 of the freq\n return { freq: d.x * 4, amplitude: d.y };\n};\n\n/**\n * build the x points with root as the anchor.\n */\nexport const xPoints = (root, freq, min, max) => {\n freq = Math.abs(freq);\n log('[xPoints] root:', root, 'freq:', freq, ' min:', min, ' max:', max);\n const leftpoints = _.rangeRight(root, min - freq, freq * -1);\n const rightpoints = _.range(root + freq, max + freq, freq);\n\n return _.concat(leftpoints, rightpoints);\n};\n\n/**\n * Calculate y for x value using amp, freq and shift\n * https://www.desmos.com/calculator/f1psfoiiv6\n */\nexport const sinY = (amplitude, freq, shift) => (x) => {\n shift = { phase: 0, vertical: 0, ...shift };\n const TWO_PI = Math.PI * 2;\n const num = TWO_PI * (x - shift.phase);\n const frac = num / freq;\n const sin = Math.sin(frac);\n const sinFloat = parseFloat(sin).toFixed(10);\n return amplitude * sinFloat + shift.vertical;\n};\n\n/**\n * You need three points for the quadratic eq, so we mirror the edge point\n * https://www.desmos.com/calculator/xhz1xqgpca\n */\nexport const parabolaFromTwoPoints = (root, edge) => {\n edge = edge || { ...root };\n const mirrorEdge = { x: root.x - (edge.x - root.x), y: edge.y };\n return parabolaFromThreePoints(root, edge, mirrorEdge);\n};\n\nexport const parabolaFromThreePoints = (one, two, three) => {\n log(one, two, three);\n const { a, b, c } = pointsToABC(one, two, three);\n log(a, b, c);\n return parabola(a, b, c);\n};\n/** derive a,b,c from the 3 points */\nexport const pointsToABC = (one, two, three) => {\n const a1 = Math.pow(one.x, 2) * -1 + Math.pow(two.x, 2);\n const b1 = one.x * -1 + two.x;\n const d1 = one.y * -1 + two.y;\n const a2 = Math.pow(two.x, 2) * -1 + Math.pow(three.x, 2);\n const b2 = two.x * -1 + three.x;\n const d2 = two.y * -1 + three.y;\n const bMult = (b2 / b1) * -1;\n const a3 = bMult * a1 + a2;\n const d3 = bMult * d1 + d2;\n const a = d3 / a3;\n const b = (d1 - a1 * a) / b1;\n const c = one.y - a * Math.pow(one.x, 2) - b * one.x;\n return { a, b, c };\n};\n\n/**\n * y=ax^2+bx+c\n */\nexport const parabola = (a, b, c) => (x) => a * Math.pow(x, 2) + b * x + c;\n\n/**\n * Absolute value from two points Root (Vertex) the point where the two rays intersect and edge One point on a ray.\n * @param root 1st point selected on graph\n * @param edge 2nd point selected on graph\n * https://www.desmos.com/calculator/rarxiatpip\n */\nexport const absoluteFromTwoPoints = (root, edge) => {\n edge = edge || { ...root };\n const a = pointsToAForAbsolute(root, edge);\n return absolute(a, root.x, root.y);\n};\n\n/*\n * Finds value of a in y=a*abs(x-h)+k function\n * @param one 1st point\n * @param two 2nd point\n * */\nexport const pointsToAForAbsolute = (one, two) => {\n const y1 = two.y - one.y;\n const x1 = two.x - one.x;\n let a = y1 / x1;\n if (two.x < one.x) {\n a = a * -1;\n }\n return a;\n};\n\n/**\n * y=a*abs(x-h)+k\n */\nexport const absolute = (a, h, k) => (x) => a * Math.abs(x - h) + k;\n\n/**\n * Exponential from two points on exponential graph.\n * @param root 1st point selected on graph\n * @param edge 2nd point selected on graph\n * https://www.desmos.com/calculator/3fisjexbvp\n */\nexport const exponentialFromTwoPoints = (root, edge) => {\n edge = edge || { ...root };\n const { a, b } = pointsToABForExponential(root, edge);\n return exponential(a, b);\n};\n\n/*\n * Finds value of a and b in y=a*(b)^x function\n * @param one 1st point\n * @param two 2nd point\n * */\nexport const pointsToABForExponential = (one, two) => {\n const p = one.y / two.y;\n const r = 1 / (one.x - two.x);\n const b = Math.pow(p, r);\n const a = one.y / Math.pow(b, one.x);\n return { a, b };\n};\n\n/**\n * y=a*(b)^x\n */\nexport const exponential = (a, b) => (x) => a * Math.pow(b, x);\n\n/**\n * Generate a set of data points, add spacing before min and after max if there is space between minx + min and maxX and max\n * @param {*} domain\n * @param {*} range\n * @param {*} root\n * @param {*} edge\n * @param {*} yFn\n * @param {*} excludeOutsidePoints\n */\nexport const buildDataPoints = (domain, range, root, edge, yFn, excludeOutsidePoints = false) => {\n log('[buildDataPoints] domain:', domain, 'range:', range, 'root:', root, 'edge:', edge);\n\n domain = { min: 0, max: 0, step: 1, ...domain };\n range = { min: 0, max: 0, step: 1, ...range };\n edge = edge ? edge : { ...root };\n\n const minX = Math.min(root.x, edge.x);\n const xPts = xPoints(minX, domain.step, domain.min - domain.step, domain.max + domain.step);\n\n log('[buildDataPoints]:xPts:', xPts);\n\n let startIndex = -1;\n let endIndex = -1;\n\n // generate points based on the yFn\n const points = xPts.map((v) => new Point(v, yFn(v)));\n\n if (!excludeOutsidePoints) {\n return points;\n }\n\n // exclude the points with y outside range min and max\n const filteredPoints = points.reduce((acc, val, index) => {\n if (val.y >= range.min - range.step && val.y <= range.max + range.step) {\n if (startIndex === -1) {\n startIndex = index;\n }\n\n if (endIndex < index) {\n endIndex = index;\n }\n\n return [...acc, val];\n }\n\n return acc;\n }, []);\n\n // add the first value outside range min and max smaller than range.min if exists\n if (startIndex - 1 >= 0) {\n filteredPoints.unshift(points[startIndex - 1]);\n }\n\n // add the first value outside range min and max greater than range.min if exists\n if (endIndex + 1 <= points.length - 1) {\n filteredPoints.push(points[endIndex + 1]);\n }\n\n return points;\n};\n\nexport default {\n FREQ_DIVIDER,\n getAmplitudeAndFreq,\n xPoints,\n sinY,\n parabolaFromTwoPoints,\n parabolaFromThreePoints,\n pointsToABC,\n parabola,\n absoluteFromTwoPoints,\n pointsToAForAbsolute,\n absolute,\n exponentialFromTwoPoints,\n pointsToABForExponential,\n exponential,\n buildDataPoints,\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAuB,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC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,IAAIG,UAAU,KAAK,CAAC,CAAC,EAAE;QACrBA,UAAU,GAAGS,KAAK;MACpB;MAEA,IAAIR,QAAQ,GAAGQ,KAAK,EAAE;QACpBR,QAAQ,GAAGQ,KAAK;MAClB;MAEA,UAAAhE,MAAA,KAAAiE,mBAAA,aAAWH,GAAG,IAAEC,GAAG;IACrB;IAEA,OAAOD,GAAG;EACZ,CAAC,EAAE,EAAE,CAAC;;EAEN;EACA,IAAIP,UAAU,GAAG,CAAC,IAAI,CAAC,EAAE;IACvBK,cAAc,CAACM,OAAO,CAACT,MAAM,CAACF,UAAU,GAAG,CAAC,CAAC,CAAC;EAChD;;EAEA;EACA,IAAIC,QAAQ,GAAG,CAAC,IAAIC,MAAM,CAACvF,MAAM,GAAG,CAAC,EAAE;IACrC0F,cAAc,CAAC9F,IAAI,CAAC2F,MAAM,CAACD,QAAQ,GAAG,CAAC,CAAC,CAAC;EAC3C;EAEA,OAAOC,MAAM;AACf,CAAC;AAAC,IAAAU,QAAA,GAAAxF,OAAA,cAEa;EACbD,YAAY,EAAZA,YAAY;EACZE,mBAAmB,EAAnBA,mBAAmB;EACnBU,OAAO,EAAPA,OAAO;EACPW,IAAI,EAAJA,IAAI;EACJY,qBAAqB,EAArBA,qBAAqB;EACrBE,uBAAuB,EAAvBA,uBAAuB;EACvBK,WAAW,EAAXA,WAAW;EACXI,QAAQ,EAARA,QAAQ;EACRW,qBAAqB,EAArBA,qBAAqB;EACrBC,oBAAoB,EAApBA,oBAAoB;EACpBC,QAAQ,EAARA,QAAQ;EACRK,wBAAwB,EAAxBA,wBAAwB;EACxBE,wBAAwB,EAAxBA,wBAAwB;EACxBC,WAAW,EAAXA,WAAW;EACXE,eAAe,EAAfA;AACF,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/graphing-utils",
3
- "version": "1.21.2-next.0+19a7ac5d",
3
+ "version": "1.22.0-mui-update.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
@@ -14,6 +14,6 @@
14
14
  "debug": "^4.1.1",
15
15
  "lodash": "^4.17.11"
16
16
  },
17
- "gitHead": "19a7ac5d429f1c5fe9138faff9981720f8c9e294",
17
+ "gitHead": "2e0222bda045f46b504640a972d43787e68288c4",
18
18
  "scripts": {}
19
19
  }