@pie-lib/graphing-utils 1.17.1-next.0 → 1.18.2
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/esm/index.js +281 -0
- package/esm/index.js.map +1 -0
- package/package.json +10 -3
- package/LICENSE.md +0 -5
package/esm/index.js
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import debug from 'debug';
|
|
2
|
+
import Point from '@mapbox/point-geometry';
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
|
|
5
|
+
function _extends() {
|
|
6
|
+
_extends = Object.assign || function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
|
|
10
|
+
for (var key in source) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12
|
+
target[key] = source[key];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return _extends.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const log = debug('pie-lib:graphing:tools:utils');
|
|
24
|
+
const FREQ_DIVIDER = 16;
|
|
25
|
+
const getAmplitudeAndFreq = (root, edge) => {
|
|
26
|
+
if (!edge) {
|
|
27
|
+
return {
|
|
28
|
+
freq: 0,
|
|
29
|
+
amplitude: 0
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (root.x == edge.x) {
|
|
34
|
+
return {
|
|
35
|
+
freq: 0,
|
|
36
|
+
amplitude: 0
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const r = new Point(root.x, root.y);
|
|
41
|
+
const e = new Point(edge.x, edge.y);
|
|
42
|
+
const d = e.sub(r); // edge point describes 1/4 of the freq
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
freq: d.x * 4,
|
|
46
|
+
amplitude: d.y
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* build the x points with root as the anchor.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
const xPoints = (root, freq, min, max) => {
|
|
54
|
+
freq = Math.abs(freq);
|
|
55
|
+
log('[xPoints] root:', root, 'freq:', freq, ' min:', min, ' max:', max);
|
|
56
|
+
|
|
57
|
+
const leftpoints = _.rangeRight(root, min - freq, freq * -1);
|
|
58
|
+
|
|
59
|
+
const rightpoints = _.range(root + freq, max + freq, freq);
|
|
60
|
+
|
|
61
|
+
return _.concat(leftpoints, rightpoints);
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Calculate y for x value using amp, freq and shift
|
|
65
|
+
* https://www.desmos.com/calculator/f1psfoiiv6
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
const sinY = (amplitude, freq, shift) => x => {
|
|
69
|
+
shift = _extends({
|
|
70
|
+
phase: 0,
|
|
71
|
+
vertical: 0
|
|
72
|
+
}, shift);
|
|
73
|
+
const TWO_PI = Math.PI * 2;
|
|
74
|
+
const num = TWO_PI * (x - shift.phase);
|
|
75
|
+
const frac = num / freq;
|
|
76
|
+
const sin = Math.sin(frac);
|
|
77
|
+
const sinFloat = parseFloat(sin).toFixed(10);
|
|
78
|
+
return amplitude * sinFloat + shift.vertical;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* You need three points for the quadratic eq, so we mirror the edge point
|
|
82
|
+
* https://www.desmos.com/calculator/xhz1xqgpca
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
const parabolaFromTwoPoints = (root, edge) => {
|
|
86
|
+
edge = edge || _extends({}, root);
|
|
87
|
+
const mirrorEdge = {
|
|
88
|
+
x: root.x - (edge.x - root.x),
|
|
89
|
+
y: edge.y
|
|
90
|
+
};
|
|
91
|
+
return parabolaFromThreePoints(root, edge, mirrorEdge);
|
|
92
|
+
};
|
|
93
|
+
const parabolaFromThreePoints = (one, two, three) => {
|
|
94
|
+
log(one, two, three);
|
|
95
|
+
const {
|
|
96
|
+
a,
|
|
97
|
+
b,
|
|
98
|
+
c
|
|
99
|
+
} = pointsToABC(one, two, three);
|
|
100
|
+
log(a, b, c);
|
|
101
|
+
return parabola(a, b, c);
|
|
102
|
+
};
|
|
103
|
+
/** derive a,b,c from the 3 points */
|
|
104
|
+
|
|
105
|
+
const pointsToABC = (one, two, three) => {
|
|
106
|
+
const a1 = Math.pow(one.x, 2) * -1 + Math.pow(two.x, 2);
|
|
107
|
+
const b1 = one.x * -1 + two.x;
|
|
108
|
+
const d1 = one.y * -1 + two.y;
|
|
109
|
+
const a2 = Math.pow(two.x, 2) * -1 + Math.pow(three.x, 2);
|
|
110
|
+
const b2 = two.x * -1 + three.x;
|
|
111
|
+
const d2 = two.y * -1 + three.y;
|
|
112
|
+
const bMult = b2 / b1 * -1;
|
|
113
|
+
const a3 = bMult * a1 + a2;
|
|
114
|
+
const d3 = bMult * d1 + d2;
|
|
115
|
+
const a = d3 / a3;
|
|
116
|
+
const b = (d1 - a1 * a) / b1;
|
|
117
|
+
const c = one.y - a * Math.pow(one.x, 2) - b * one.x;
|
|
118
|
+
return {
|
|
119
|
+
a,
|
|
120
|
+
b,
|
|
121
|
+
c
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* y=ax^2+bx+c
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
const parabola = (a, b, c) => x => a * Math.pow(x, 2) + b * x + c;
|
|
129
|
+
/**
|
|
130
|
+
* Absolute value from two points Root (Vertex) the point where the two rays intersect and edge One point on a ray.
|
|
131
|
+
* @param root 1st point selected on graph
|
|
132
|
+
* @param edge 2nd point selected on graph
|
|
133
|
+
* https://www.desmos.com/calculator/rarxiatpip
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
const absoluteFromTwoPoints = (root, edge) => {
|
|
137
|
+
edge = edge || _extends({}, root);
|
|
138
|
+
const a = pointsToAForAbsolute(root, edge);
|
|
139
|
+
return absolute(a, root.x, root.y);
|
|
140
|
+
};
|
|
141
|
+
/*
|
|
142
|
+
* Finds value of a in y=a*abs(x-h)+k function
|
|
143
|
+
* @param one 1st point
|
|
144
|
+
* @param two 2nd point
|
|
145
|
+
* */
|
|
146
|
+
|
|
147
|
+
const pointsToAForAbsolute = (one, two) => {
|
|
148
|
+
const y1 = two.y - one.y;
|
|
149
|
+
const x1 = two.x - one.x;
|
|
150
|
+
let a = y1 / x1;
|
|
151
|
+
|
|
152
|
+
if (two.x < one.x) {
|
|
153
|
+
a = a * -1;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return a;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* y=a*abs(x-h)+k
|
|
160
|
+
*/
|
|
161
|
+
|
|
162
|
+
const absolute = (a, h, k) => x => a * Math.abs(x - h) + k;
|
|
163
|
+
/**
|
|
164
|
+
* Exponential from two points on exponential graph.
|
|
165
|
+
* @param root 1st point selected on graph
|
|
166
|
+
* @param edge 2nd point selected on graph
|
|
167
|
+
* https://www.desmos.com/calculator/3fisjexbvp
|
|
168
|
+
*/
|
|
169
|
+
|
|
170
|
+
const exponentialFromTwoPoints = (root, edge) => {
|
|
171
|
+
edge = edge || _extends({}, root);
|
|
172
|
+
const {
|
|
173
|
+
a,
|
|
174
|
+
b
|
|
175
|
+
} = pointsToABForExponential(root, edge);
|
|
176
|
+
return exponential(a, b);
|
|
177
|
+
};
|
|
178
|
+
/*
|
|
179
|
+
* Finds value of a and b in y=a*(b)^x function
|
|
180
|
+
* @param one 1st point
|
|
181
|
+
* @param two 2nd point
|
|
182
|
+
* */
|
|
183
|
+
|
|
184
|
+
const pointsToABForExponential = (one, two) => {
|
|
185
|
+
const p = one.y / two.y;
|
|
186
|
+
const r = 1 / (one.x - two.x);
|
|
187
|
+
const b = Math.pow(p, r);
|
|
188
|
+
const a = one.y / Math.pow(b, one.x);
|
|
189
|
+
return {
|
|
190
|
+
a,
|
|
191
|
+
b
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* y=a*(b)^x
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
const exponential = (a, b) => x => a * Math.pow(b, x);
|
|
199
|
+
/**
|
|
200
|
+
* Generate a set of data points, add spacing before min and after max if there is space between minx + min and maxX and max
|
|
201
|
+
* @param {*} domain
|
|
202
|
+
* @param {*} range
|
|
203
|
+
* @param {*} root
|
|
204
|
+
* @param {*} edge
|
|
205
|
+
* @param {*} yFn
|
|
206
|
+
* @param {*} excludeOutsidePoints
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
const buildDataPoints = (domain, range, root, edge, yFn, excludeOutsidePoints = false) => {
|
|
210
|
+
log('[buildDataPoints] domain:', domain, 'range:', range, 'root:', root, 'edge:', edge);
|
|
211
|
+
domain = _extends({
|
|
212
|
+
min: 0,
|
|
213
|
+
max: 0,
|
|
214
|
+
step: 1
|
|
215
|
+
}, domain);
|
|
216
|
+
range = _extends({
|
|
217
|
+
min: 0,
|
|
218
|
+
max: 0,
|
|
219
|
+
step: 1
|
|
220
|
+
}, range);
|
|
221
|
+
edge = edge ? edge : _extends({}, root);
|
|
222
|
+
const minX = Math.min(root.x, edge.x);
|
|
223
|
+
const xPts = xPoints(minX, domain.step, domain.min - domain.step, domain.max + domain.step);
|
|
224
|
+
log('[buildDataPoints]:xPts:', xPts);
|
|
225
|
+
let startIndex = -1;
|
|
226
|
+
let endIndex = -1; // generate points based on the yFn
|
|
227
|
+
|
|
228
|
+
const points = xPts.map(v => new Point(v, yFn(v)));
|
|
229
|
+
|
|
230
|
+
if (!excludeOutsidePoints) {
|
|
231
|
+
return points;
|
|
232
|
+
} // exclude the points with y outside range min and max
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
const filteredPoints = points.reduce((acc, val, index) => {
|
|
236
|
+
if (val.y >= range.min - range.step && val.y <= range.max + range.step) {
|
|
237
|
+
if (startIndex === -1) {
|
|
238
|
+
startIndex = index;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (endIndex < index) {
|
|
242
|
+
endIndex = index;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return [...acc, val];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return acc;
|
|
249
|
+
}, []); // add the first value outside range min and max smaller than range.min if exists
|
|
250
|
+
|
|
251
|
+
if (startIndex - 1 >= 0) {
|
|
252
|
+
filteredPoints.unshift(points[startIndex - 1]);
|
|
253
|
+
} // add the first value outside range min and max greater than range.min if exists
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
if (endIndex + 1 <= points.length - 1) {
|
|
257
|
+
filteredPoints.push(points[endIndex + 1]);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return points;
|
|
261
|
+
};
|
|
262
|
+
var index = {
|
|
263
|
+
FREQ_DIVIDER,
|
|
264
|
+
getAmplitudeAndFreq,
|
|
265
|
+
xPoints,
|
|
266
|
+
sinY,
|
|
267
|
+
parabolaFromTwoPoints,
|
|
268
|
+
parabolaFromThreePoints,
|
|
269
|
+
pointsToABC,
|
|
270
|
+
parabola,
|
|
271
|
+
absoluteFromTwoPoints,
|
|
272
|
+
pointsToAForAbsolute,
|
|
273
|
+
absolute,
|
|
274
|
+
exponentialFromTwoPoints,
|
|
275
|
+
pointsToABForExponential,
|
|
276
|
+
exponential,
|
|
277
|
+
buildDataPoints
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export { FREQ_DIVIDER, absolute, absoluteFromTwoPoints, buildDataPoints, index as default, exponential, exponentialFromTwoPoints, getAmplitudeAndFreq, parabola, parabolaFromThreePoints, parabolaFromTwoPoints, pointsToABC, pointsToABForExponential, pointsToAForAbsolute, sinY, xPoints };
|
|
281
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","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"],"names":["log","debug","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","a","b","c","pointsToABC","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":";;;;;;;;;;;;;;;;;;;;;;AAGA,MAAMA,GAAG,GAAGC,KAAK,CAAC,8BAAD,CAAjB;AAEO,MAAMC,YAAY,GAAG;MAEfC,mBAAmB,GAAG,CAACC,IAAD,EAAOC,IAAP,KAAgB;AACjD,EAAA,IAAI,CAACA,IAAL,EAAW;AACT,IAAA,OAAO;AAAEC,MAAAA,IAAI,EAAE,CAAR;AAAWC,MAAAA,SAAS,EAAE;AAAtB,KAAP;AACD,EAAA;;AAED,EAAA,IAAIH,IAAI,CAACI,CAAL,IAAUH,IAAI,CAACG,CAAnB,EAAsB;AACpB,IAAA,OAAO;AAAEF,MAAAA,IAAI,EAAE,CAAR;AAAWC,MAAAA,SAAS,EAAE;AAAtB,KAAP;AACD,EAAA;;AAED,EAAA,MAAME,CAAC,GAAG,IAAIC,KAAJ,CAAUN,IAAI,CAACI,CAAf,EAAkBJ,IAAI,CAACO,CAAvB,CAAV;AACA,EAAA,MAAMC,CAAC,GAAG,IAAIF,KAAJ,CAAUL,IAAI,CAACG,CAAf,EAAkBH,IAAI,CAACM,CAAvB,CAAV;AACA,EAAA,MAAME,CAAC,GAAGD,CAAC,CAACE,GAAF,CAAML,CAAN,CAAV,CAXiD;;AAajD,EAAA,OAAO;AAAEH,IAAAA,IAAI,EAAEO,CAAC,CAACL,CAAF,GAAM,CAAd;AAAiBD,IAAAA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EAAAA,WAda;AAebE,EAAAA;AAfa,CAAf;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/graphing-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
"debug": "^4.1.1",
|
|
15
15
|
"lodash": "^4.17.11"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
18
|
-
"scripts": {}
|
|
17
|
+
"gitHead": "8a327571bd64249e4c88c0c8e750d16d6213f535",
|
|
18
|
+
"scripts": {},
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./esm/index.js",
|
|
22
|
+
"require": "./lib/index.js",
|
|
23
|
+
"default": "./esm/index.js"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
19
26
|
}
|
package/LICENSE.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Copyright 2019 CoreSpring Inc
|
|
2
|
-
|
|
3
|
-
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
4
|
-
|
|
5
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|