Skip to content

Commit 811f4d8

Browse files
docs
1 parent 848f3ce commit 811f4d8

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ import * as MatrixLog from 'matrix-log';
2020
// create a matrix log that will have dependencies called
2121
const matrixLog = new MatrixLog(parentMatrixName, width, height, depth); //depth is optional
2222

23+
// in your algorithm, perhaps many times
2324
matrixLog.at({
2425
x: parentX,
2526
y: parentY,
2627
z: parentZ // optional
27-
});
28-
29-
// in your algorithm, perhaps many times
30-
matrixLog.add({
28+
})
29+
.add({
3130
name: childMatrixName,
3231
x: childX,
3332
y: childY,
@@ -125,7 +124,14 @@ for (let y = 0; y < 4; y++) {
125124
let filterX = x < filter.length ? 0 : 1;
126125
filters[filterY][filterX] += weights[y][x];
127126
matrixLog
128-
.add('weights', filterX, filterY, x, y, weights[0].length, weights.length);
127+
.at({ x, y })
128+
.add({
129+
name: 'weights',
130+
x: filterX,
131+
y: filterY,
132+
width: weights[0].length,
133+
height: weights.length
134+
});
129135
}
130136
}
131137

0 commit comments

Comments
 (0)