@thi.ng/grid-iterators 2.3.25 → 2.3.26
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 +1 -1
- package/clipping.d.ts +3 -2
- package/clipping.js +3 -2
- package/diagonal.d.ts +4 -4
- package/diagonal.js +4 -4
- package/hilbert.d.ts +3 -3
- package/hilbert.js +3 -3
- package/package.json +9 -9
- package/random.d.ts +4 -2
- package/random.js +4 -2
- package/rows.d.ts +1 -1
- package/rows.js +1 -1
- package/spiral.d.ts +3 -3
- package/spiral.js +3 -3
- package/zigzag-columns.d.ts +3 -3
- package/zigzag-columns.js +3 -3
- package/zigzag-rows.d.ts +3 -3
- package/zigzag-rows.js +3 -3
package/CHANGELOG.md
CHANGED
package/clipping.d.ts
CHANGED
|
@@ -11,7 +11,8 @@ import type { FnU7, FnU8, Tuple } from "@thi.ng/api";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function clipped(src: Iterable<number[]>, left: number, top: number, right: number, bottom: number): Generator<number[], void, unknown>;
|
|
13
13
|
/**
|
|
14
|
-
* Based on
|
|
14
|
+
* Based on [thi.ng/geom-isec](https://thi.ng/geom-isec), but inlined to avoid
|
|
15
|
+
* dependency.
|
|
15
16
|
*
|
|
16
17
|
* @param x -
|
|
17
18
|
* @param y -
|
|
@@ -25,7 +26,7 @@ export declare function clipped(src: Iterable<number[]>, left: number, top: numb
|
|
|
25
26
|
*/
|
|
26
27
|
export declare const intersectRectCircle: FnU7<number, boolean>;
|
|
27
28
|
/**
|
|
28
|
-
* Based on
|
|
29
|
+
* Based on [`liangBarsky2Raw()`](https://docs.thi.ng/umbrella/geom-clip-line/functions/liangBarsky2Raw.html), but with diff return type.
|
|
29
30
|
*
|
|
30
31
|
* @param ax -
|
|
31
32
|
* @param ay -
|
package/clipping.js
CHANGED
|
@@ -17,7 +17,8 @@ export function* clipped(src, left, top, right, bottom) {
|
|
|
17
17
|
/** @internal */
|
|
18
18
|
const axis = (a, b, c) => (a < b ? a - b : a > b + c ? a - b - c : 0) ** 2;
|
|
19
19
|
/**
|
|
20
|
-
* Based on
|
|
20
|
+
* Based on [thi.ng/geom-isec](https://thi.ng/geom-isec), but inlined to avoid
|
|
21
|
+
* dependency.
|
|
21
22
|
*
|
|
22
23
|
* @param x -
|
|
23
24
|
* @param y -
|
|
@@ -31,7 +32,7 @@ const axis = (a, b, c) => (a < b ? a - b : a > b + c ? a - b - c : 0) ** 2;
|
|
|
31
32
|
*/
|
|
32
33
|
export const intersectRectCircle = (x, y, w, h, cx, cy, r) => axis(cx, x, w) + axis(cy, y, h) <= r * r;
|
|
33
34
|
/**
|
|
34
|
-
* Based on
|
|
35
|
+
* Based on [`liangBarsky2Raw()`](https://docs.thi.ng/umbrella/geom-clip-line/functions/liangBarsky2Raw.html), but with diff return type.
|
|
35
36
|
*
|
|
36
37
|
* @param ax -
|
|
37
38
|
* @param ay -
|
package/diagonal.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Yields sequence of 2D grid coordinates in diagonal order starting at
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Yields sequence of 2D grid coordinates in diagonal order starting at [0,0]
|
|
3
|
+
* and using given `cols` and `rows`. Each diagonal starts at y=0 and progresses
|
|
4
|
+
* in -x,+y direction.
|
|
5
5
|
*
|
|
6
6
|
* Ported & modified from original Java code by Christopher Kulla.
|
|
7
|
-
*
|
|
7
|
+
* https://sourceforge.net/p/sunflow/code/HEAD/tree/trunk/src/org/sunflow/core/bucket/DiagonalBucketOrder.java
|
|
8
8
|
*
|
|
9
9
|
* @param cols -
|
|
10
10
|
* @param rows -
|
package/diagonal.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { asInt } from "@thi.ng/api/typedarray";
|
|
2
2
|
/**
|
|
3
|
-
* Yields sequence of 2D grid coordinates in diagonal order starting at
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Yields sequence of 2D grid coordinates in diagonal order starting at [0,0]
|
|
4
|
+
* and using given `cols` and `rows`. Each diagonal starts at y=0 and progresses
|
|
5
|
+
* in -x,+y direction.
|
|
6
6
|
*
|
|
7
7
|
* Ported & modified from original Java code by Christopher Kulla.
|
|
8
|
-
*
|
|
8
|
+
* https://sourceforge.net/p/sunflow/code/HEAD/tree/trunk/src/org/sunflow/core/bucket/DiagonalBucketOrder.java
|
|
9
9
|
*
|
|
10
10
|
* @param cols -
|
|
11
11
|
* @param rows -
|
package/hilbert.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Yields sequence of 2D grid coordinates along 2D Hilbert curve using
|
|
3
|
-
*
|
|
2
|
+
* Yields sequence of 2D grid coordinates along 2D Hilbert curve using given
|
|
3
|
+
* `cols` and `rows` (each max. 32768 (2^15)).
|
|
4
4
|
*
|
|
5
5
|
* Ported & modified from original Java code by Christopher Kulla.
|
|
6
|
-
*
|
|
6
|
+
* https://sourceforge.net/p/sunflow/code/HEAD/tree/trunk/src/org/sunflow/core/bucket/HilbertBucketOrder.java
|
|
7
7
|
*
|
|
8
8
|
* @param cols -
|
|
9
9
|
* @param rows -
|
package/hilbert.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { asInt } from "@thi.ng/api/typedarray";
|
|
2
2
|
/**
|
|
3
|
-
* Yields sequence of 2D grid coordinates along 2D Hilbert curve using
|
|
4
|
-
*
|
|
3
|
+
* Yields sequence of 2D grid coordinates along 2D Hilbert curve using given
|
|
4
|
+
* `cols` and `rows` (each max. 32768 (2^15)).
|
|
5
5
|
*
|
|
6
6
|
* Ported & modified from original Java code by Christopher Kulla.
|
|
7
|
-
*
|
|
7
|
+
* https://sourceforge.net/p/sunflow/code/HEAD/tree/trunk/src/org/sunflow/core/bucket/HilbertBucketOrder.java
|
|
8
8
|
*
|
|
9
9
|
* @param cols -
|
|
10
10
|
* @param rows -
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/grid-iterators",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.26",
|
|
4
4
|
"description": "2D grid and shape iterators w/ multiple orderings",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"test": "testament test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.6.
|
|
39
|
-
"@thi.ng/arrays": "^2.4.
|
|
40
|
-
"@thi.ng/binary": "^3.3.
|
|
41
|
-
"@thi.ng/bitfield": "^2.2.
|
|
42
|
-
"@thi.ng/morton": "^3.1.
|
|
43
|
-
"@thi.ng/random": "^3.3.
|
|
44
|
-
"@thi.ng/transducers": "^8.3.
|
|
38
|
+
"@thi.ng/api": "^8.6.1",
|
|
39
|
+
"@thi.ng/arrays": "^2.4.6",
|
|
40
|
+
"@thi.ng/binary": "^3.3.14",
|
|
41
|
+
"@thi.ng/bitfield": "^2.2.16",
|
|
42
|
+
"@thi.ng/morton": "^3.1.25",
|
|
43
|
+
"@thi.ng/random": "^3.3.19",
|
|
44
|
+
"@thi.ng/transducers": "^8.3.27"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@microsoft/api-extractor": "^7.33.7",
|
|
@@ -152,5 +152,5 @@
|
|
|
152
152
|
],
|
|
153
153
|
"year": 2019
|
|
154
154
|
},
|
|
155
|
-
"gitHead": "
|
|
155
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
156
156
|
}
|
package/random.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { IRandom } from "@thi.ng/random";
|
|
2
2
|
/**
|
|
3
3
|
* Yields 2D grid coordinates in random order w/ support for optional
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html)
|
|
5
|
+
* implementation (default:
|
|
6
|
+
* [`SYSTEM`](https://docs.thi.ng/umbrella/random/variables/SYSTEM.html) aka
|
|
7
|
+
* `Math.random`).
|
|
6
8
|
*
|
|
7
9
|
* @param cols -
|
|
8
10
|
* @param rows -
|
package/random.js
CHANGED
|
@@ -4,8 +4,10 @@ import { SYSTEM } from "@thi.ng/random/system";
|
|
|
4
4
|
import { range } from "@thi.ng/transducers/range";
|
|
5
5
|
/**
|
|
6
6
|
* Yields 2D grid coordinates in random order w/ support for optional
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html)
|
|
8
|
+
* implementation (default:
|
|
9
|
+
* [`SYSTEM`](https://docs.thi.ng/umbrella/random/variables/SYSTEM.html) aka
|
|
10
|
+
* `Math.random`).
|
|
9
11
|
*
|
|
10
12
|
* @param cols -
|
|
11
13
|
* @param rows -
|
package/rows.d.ts
CHANGED
package/rows.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { range2d } from "@thi.ng/transducers/range2d";
|
|
2
2
|
/**
|
|
3
3
|
* Yields sequence of 2D grid coordinates in row-major order. Same as
|
|
4
|
-
*
|
|
4
|
+
* [`range2d()`](https://docs.thi.ng/umbrella/transducers/functions/range2d.html).
|
|
5
5
|
*
|
|
6
6
|
* @param cols -
|
|
7
7
|
* @param rows -
|
package/spiral.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Yields sequence of 2D grid coordinates in outward spiral order
|
|
3
|
-
*
|
|
2
|
+
* Yields sequence of 2D grid coordinates in outward spiral order starting from
|
|
3
|
+
* the center, given `cols` and `rows`.
|
|
4
4
|
*
|
|
5
5
|
* Ported & modified from original Java code by Christopher Kulla.
|
|
6
|
-
*
|
|
6
|
+
* https://sourceforge.net/p/sunflow/code/HEAD/tree/trunk/src/org/sunflow/core/bucket/SpiralBucketOrder.java
|
|
7
7
|
*
|
|
8
8
|
* @param cols -
|
|
9
9
|
* @param rows -
|
package/spiral.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { asInt } from "@thi.ng/api/typedarray";
|
|
2
2
|
/**
|
|
3
|
-
* Yields sequence of 2D grid coordinates in outward spiral order
|
|
4
|
-
*
|
|
3
|
+
* Yields sequence of 2D grid coordinates in outward spiral order starting from
|
|
4
|
+
* the center, given `cols` and `rows`.
|
|
5
5
|
*
|
|
6
6
|
* Ported & modified from original Java code by Christopher Kulla.
|
|
7
|
-
*
|
|
7
|
+
* https://sourceforge.net/p/sunflow/code/HEAD/tree/trunk/src/org/sunflow/core/bucket/SpiralBucketOrder.java
|
|
8
8
|
*
|
|
9
9
|
* @param cols -
|
|
10
10
|
* @param rows -
|
package/zigzag-columns.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Yields sequence of 2D grid coordinates in zigzag column order
|
|
3
|
-
*
|
|
2
|
+
* Yields sequence of 2D grid coordinates in zigzag column order starting from
|
|
3
|
+
* [0,0], given `cols` and `rows`.
|
|
4
4
|
*
|
|
5
5
|
* Ported & modified from original Java code by Christopher Kulla.
|
|
6
|
-
*
|
|
6
|
+
* https://sourceforge.net/p/sunflow/code/HEAD/tree/trunk/src/org/sunflow/core/bucket/SpiralBucketOrder.java
|
|
7
7
|
*
|
|
8
8
|
* @param cols -
|
|
9
9
|
* @param rows -
|
package/zigzag-columns.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { asInt } from "@thi.ng/api/typedarray";
|
|
2
2
|
/**
|
|
3
|
-
* Yields sequence of 2D grid coordinates in zigzag column order
|
|
4
|
-
*
|
|
3
|
+
* Yields sequence of 2D grid coordinates in zigzag column order starting from
|
|
4
|
+
* [0,0], given `cols` and `rows`.
|
|
5
5
|
*
|
|
6
6
|
* Ported & modified from original Java code by Christopher Kulla.
|
|
7
|
-
*
|
|
7
|
+
* https://sourceforge.net/p/sunflow/code/HEAD/tree/trunk/src/org/sunflow/core/bucket/SpiralBucketOrder.java
|
|
8
8
|
*
|
|
9
9
|
* @param cols -
|
|
10
10
|
* @param rows -
|
package/zigzag-rows.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Yields sequence of 2D grid coordinates in zigzag row order starting
|
|
3
|
-
*
|
|
2
|
+
* Yields sequence of 2D grid coordinates in zigzag row order starting from
|
|
3
|
+
* [0,0], given `cols` and `rows`.
|
|
4
4
|
*
|
|
5
5
|
* Ported & modified from original Java code by Christopher Kulla.
|
|
6
|
-
*
|
|
6
|
+
* https://sourceforge.net/p/sunflow/code/HEAD/tree/trunk/src/org/sunflow/core/bucket/SpiralBucketOrder.java
|
|
7
7
|
*
|
|
8
8
|
* @param cols -
|
|
9
9
|
* @param rows -
|
package/zigzag-rows.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { asInt } from "@thi.ng/api/typedarray";
|
|
2
2
|
/**
|
|
3
|
-
* Yields sequence of 2D grid coordinates in zigzag row order starting
|
|
4
|
-
*
|
|
3
|
+
* Yields sequence of 2D grid coordinates in zigzag row order starting from
|
|
4
|
+
* [0,0], given `cols` and `rows`.
|
|
5
5
|
*
|
|
6
6
|
* Ported & modified from original Java code by Christopher Kulla.
|
|
7
|
-
*
|
|
7
|
+
* https://sourceforge.net/p/sunflow/code/HEAD/tree/trunk/src/org/sunflow/core/bucket/SpiralBucketOrder.java
|
|
8
8
|
*
|
|
9
9
|
* @param cols -
|
|
10
10
|
* @param rows -
|