@thi.ng/ramp 3.3.78 → 3.3.79
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/group.js +7 -4
- package/nested.js +18 -12
- package/package.json +9 -9
package/group.js
CHANGED
|
@@ -11,10 +11,13 @@ class Group {
|
|
|
11
11
|
childEntries;
|
|
12
12
|
at(t) {
|
|
13
13
|
t = this.domain(t, ...this.timeBounds());
|
|
14
|
-
return this.childEntries.reduce(
|
|
15
|
-
acc[id]
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
return this.childEntries.reduce(
|
|
15
|
+
(acc, [id, ramp]) => {
|
|
16
|
+
acc[id] = ramp.at(t);
|
|
17
|
+
return acc;
|
|
18
|
+
},
|
|
19
|
+
{}
|
|
20
|
+
);
|
|
18
21
|
}
|
|
19
22
|
samples(n = 100, start, end) {
|
|
20
23
|
return __samples(this, n, start, end);
|
package/nested.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
const nested = (children) => {
|
|
2
2
|
const pairs = Object.entries(children);
|
|
3
|
-
const $minmax = (op) => (acc, x) => pairs.reduce(
|
|
4
|
-
acc2
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const $minmax = (op) => (acc, x) => pairs.reduce(
|
|
4
|
+
(acc2, [id, impl]) => {
|
|
5
|
+
acc2[id] = impl[op](acc2[id], x[id]);
|
|
6
|
+
return acc2;
|
|
7
|
+
},
|
|
8
|
+
acc || {}
|
|
9
|
+
);
|
|
7
10
|
return {
|
|
8
11
|
min: $minmax("min"),
|
|
9
12
|
max: $minmax("max"),
|
|
10
|
-
at: (stops, index, t) => pairs.reduce(
|
|
11
|
-
acc[id]
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
at: (stops, index, t) => pairs.reduce(
|
|
14
|
+
(acc, [id, impl]) => {
|
|
15
|
+
acc[id] = impl.at(
|
|
16
|
+
stops.map((x) => [x[0], x[1][id]]),
|
|
17
|
+
index,
|
|
18
|
+
t
|
|
19
|
+
);
|
|
20
|
+
return acc;
|
|
21
|
+
},
|
|
22
|
+
{}
|
|
23
|
+
)
|
|
18
24
|
};
|
|
19
25
|
};
|
|
20
26
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/ramp",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.79",
|
|
4
4
|
"description": "Extensible keyframe interpolation/tweening of arbitrary, nested types",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.12.
|
|
44
|
-
"@thi.ng/arrays": "^2.14.
|
|
45
|
-
"@thi.ng/compare": "^2.5.
|
|
46
|
-
"@thi.ng/errors": "^2.6.
|
|
47
|
-
"@thi.ng/math": "^5.15.
|
|
48
|
-
"@thi.ng/transducers": "^9.6.
|
|
49
|
-
"@thi.ng/vectors": "^8.6.
|
|
43
|
+
"@thi.ng/api": "^8.12.17",
|
|
44
|
+
"@thi.ng/arrays": "^2.14.13",
|
|
45
|
+
"@thi.ng/compare": "^2.5.5",
|
|
46
|
+
"@thi.ng/errors": "^2.6.6",
|
|
47
|
+
"@thi.ng/math": "^5.15.6",
|
|
48
|
+
"@thi.ng/transducers": "^9.6.30",
|
|
49
|
+
"@thi.ng/vectors": "^8.6.24"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"esbuild": "^0.27.2",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"thi.ng": {
|
|
124
124
|
"year": 2019
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "1107498d31504dc63d1a457b5def387d7a134f69\n"
|
|
127
127
|
}
|