diff --git a/packages/adjacency/CHANGELOG.md b/packages/adjacency/CHANGELOG.md index f1e29e48c3..cb25a1f70e 100644 --- a/packages/adjacency/CHANGELOG.md +++ b/packages/adjacency/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.14...@thi.ng/adjacency@0.1.15) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/adjacency + + + + + ## [0.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.13...@thi.ng/adjacency@0.1.14) (2019-04-26) **Note:** Version bump only for package @thi.ng/adjacency diff --git a/packages/adjacency/package.json b/packages/adjacency/package.json index 48f37ee409..b2ace67abd 100644 --- a/packages/adjacency/package.json +++ b/packages/adjacency/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/adjacency", - "version": "0.1.14", + "version": "0.1.15", "description": "Sparse & bitwise adjacency matrices for directed / undirected graphs", "module": "./index.js", "main": "./lib/index.js", @@ -24,7 +24,7 @@ "pub": "yarn build && yarn publish --access public" }, "devDependencies": { - "@thi.ng/vectors": "^2.5.5", + "@thi.ng/vectors": "^2.5.6", "@types/mocha": "^5.2.6", "@types/node": "^11.13.7", "mocha": "^6.1.4", @@ -33,12 +33,12 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/binary": "^1.0.6", - "@thi.ng/bitfield": "^0.1.7", + "@thi.ng/bitfield": "^0.1.8", "@thi.ng/checks": "^2.1.6", - "@thi.ng/dcons": "^2.0.18", - "@thi.ng/sparse": "^0.1.14" + "@thi.ng/dcons": "^2.0.19", + "@thi.ng/sparse": "^0.1.15" }, "keywords": [ "adjacency", diff --git a/packages/api/CHANGELOG.md b/packages/api/CHANGELOG.md index 410ed2316b..3c92bc2329 100644 --- a/packages/api/CHANGELOG.md +++ b/packages/api/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [6.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.1.1...@thi.ng/api@6.2.0) (2019-05-22) + + +### Features + +* **api:** add Type enum, IntArray, UIntArray, FloatArray, SIZEOF ([b0c44fe](https://github.com/thi-ng/umbrella/commit/b0c44fe)) + + + + + ## [6.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.1.0...@thi.ng/api@6.1.1) (2019-04-26) diff --git a/packages/api/package.json b/packages/api/package.json index 9529e78fff..10db06c17c 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/api", - "version": "6.1.1", + "version": "6.2.0", "description": "Common, generic types & interfaces for thi.ng projects", "module": "./index.js", "main": "./lib/index.js", diff --git a/packages/api/src/api.ts b/packages/api/src/api.ts index 19c05f3774..00ac09614a 100644 --- a/packages/api/src/api.ts +++ b/packages/api/src/api.ts @@ -322,6 +322,34 @@ export type TypedArray = | Uint16Array | Uint32Array; +export type IntArray = Int8Array | Int16Array | Int32Array; +export type UIntArray = Uint8Array | Uint16Array | Uint32Array; +export type FloatArray = Float32Array | Float64Array; + +export const enum Type { + U8, + U8C, + I8, + U16, + I16, + U32, + I32, + F32, + F64 +} + +export const SIZEOF = { + [Type.U8]: 1, + [Type.U8C]: 1, + [Type.I8]: 1, + [Type.U16]: 2, + [Type.I16]: 2, + [Type.U32]: 4, + [Type.I32]: 4, + [Type.F32]: 4, + [Type.F64]: 8 +}; + /** * Observer function for `IWatch` implementations. */ diff --git a/packages/arrays/CHANGELOG.md b/packages/arrays/CHANGELOG.md index 4762cef5d6..1968695069 100644 --- a/packages/arrays/CHANGELOG.md +++ b/packages/arrays/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.1.8...@thi.ng/arrays@0.1.9) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/arrays + + + + + ## [0.1.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.1.7...@thi.ng/arrays@0.1.8) (2019-04-26) **Note:** Version bump only for package @thi.ng/arrays diff --git a/packages/arrays/package.json b/packages/arrays/package.json index 71ac66829a..a74af22139 100644 --- a/packages/arrays/package.json +++ b/packages/arrays/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/arrays", - "version": "0.1.8", + "version": "0.1.9", "description": "Array / Arraylike utilities", "module": "./index.js", "main": "./lib/index.js", @@ -32,12 +32,12 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", "@thi.ng/compare": "^1.0.6", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/random": "^1.1.6" + "@thi.ng/random": "^1.1.7" }, "keywords": [ "arrays", diff --git a/packages/associative/CHANGELOG.md b/packages/associative/CHANGELOG.md index 533b218df5..5d65aab39d 100644 --- a/packages/associative/CHANGELOG.md +++ b/packages/associative/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@2.2.3...@thi.ng/associative@2.3.0) (2019-05-22) + + +### Features + +* **associative:** add sparseSet factory fn ([867eaa3](https://github.com/thi-ng/umbrella/commit/867eaa3)) +* **associative:** add SparseSet8/16/32 ([b5994d9](https://github.com/thi-ng/umbrella/commit/b5994d9)) + + + + + ## [2.2.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@2.2.2...@thi.ng/associative@2.2.3) (2019-04-26) **Note:** Version bump only for package @thi.ng/associative diff --git a/packages/associative/package.json b/packages/associative/package.json index aceb235804..ebbf03d305 100644 --- a/packages/associative/package.json +++ b/packages/associative/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/associative", - "version": "2.2.3", + "version": "2.3.0", "description": "Alternative Set & Map data type implementations with customizable equality semantics & supporting operations", "module": "./index.js", "main": "./lib/index.js", @@ -32,14 +32,14 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/binary": "^1.0.6", "@thi.ng/checks": "^2.1.6", "@thi.ng/compare": "^1.0.6", - "@thi.ng/dcons": "^2.0.18", + "@thi.ng/dcons": "^2.0.19", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "data structures", diff --git a/packages/associative/src/array-set.ts b/packages/associative/src/array-set.ts index a2189e8623..1929d45143 100644 --- a/packages/associative/src/array-set.ts +++ b/packages/associative/src/array-set.ts @@ -7,12 +7,12 @@ import { import { equiv } from "@thi.ng/equiv"; import { EquivSetOpts, IEquivSet } from "./api"; -interface SetProps { +interface ArraySetProps { vals: T[]; equiv: Predicate2; } -const __private = new WeakMap, SetProps>(); +const __private = new WeakMap, ArraySetProps>(); /** * An alternative set implementation to the native ES6 Set type. Uses @@ -133,7 +133,7 @@ export class ArraySet extends Set implements IEquivSet { return false; } const vals = __private.get(this).vals; - for (let i = vals.length - 1; i >= 0; i--) { + for (let i = vals.length; --i >= 0; ) { if (!o.has(vals[i])) { return false; } @@ -143,7 +143,7 @@ export class ArraySet extends Set implements IEquivSet { forEach(fn: Fn3, Readonly, Set, void>, thisArg?: any) { const vals = __private.get(this).vals; - for (let i = vals.length - 1; i >= 0; i--) { + for (let i = vals.length; --i >= 0; ) { const v = vals[i]; fn.call(thisArg, v, v, this); } diff --git a/packages/associative/src/index.ts b/packages/associative/src/index.ts index 7f8e7baf71..85c818f47c 100644 --- a/packages/associative/src/index.ts +++ b/packages/associative/src/index.ts @@ -17,5 +17,6 @@ export * from "./rename-keys"; export * from "./select-keys"; export * from "./sorted-map"; export * from "./sorted-set"; +export * from "./sparse-set"; export * from "./union"; export * from "./without-keys"; diff --git a/packages/associative/src/sparse-set.ts b/packages/associative/src/sparse-set.ts new file mode 100644 index 0000000000..5e66bd0501 --- /dev/null +++ b/packages/associative/src/sparse-set.ts @@ -0,0 +1,276 @@ +import { + Fn3, + IEquiv, + Pair, + UIntArray +} from "@thi.ng/api"; +import { isNumber } from "@thi.ng/checks"; +import { illegalArgs } from "@thi.ng/errors"; +import { IEquivSet } from "./api"; + +interface SparseSetProps { + dense: UIntArray; + sparse: UIntArray; + n: number; +} + +const __private = new WeakMap, SparseSetProps>(); + +const fail = () => illegalArgs(`dense & sparse arrays must be of same size`); + +/** + * After "An Efficient Representation for Sparse Sets" + * Preston Briggs and Linda Torczon (1993) + * + * https://research.swtch.com/sparse + * https://programmingpraxis.com/2012/03/09/sparse-sets/ + * https://blog.molecular-matters.com/2013/07/24/adventures-in-data-oriented-design-part-3c-external-references/ + */ +export abstract class ASparseSet extends Set + implements IEquiv { + protected constructor(dense: T, sparse: T) { + super(); + __private.set(this, { dense, sparse, n: 0 }); + } + + [Symbol.iterator]() { + return this.keys(); + } + + get size() { + return __private.get(this).n; + } + + get capacity() { + return __private.get(this).dense.length; + } + + clear() { + __private.get(this).n = 0; + } + + equiv(o: any) { + if (this === o) { + return true; + } + if (!(o instanceof Set)) { + return false; + } + if (this.size !== o.size) { + return false; + } + const $this = __private.get(this); + const d = $this.dense; + for (let i = $this.n; --i >= 0; ) { + if (!o.has(d[i])) { + return false; + } + } + return true; + } + + add(k: number) { + const $this = __private.get(this); + const dense = $this.dense; + const sparse = $this.sparse; + const max = dense.length; + const i = sparse[k]; + const n = $this.n; + if (k < max && n < max && !(i < n && dense[i] === k)) { + dense[n] = k; + sparse[k] = n; + $this.n++; + } + return this; + } + + delete(k: number) { + const $this = __private.get(this); + const dense = $this.dense; + const sparse = $this.sparse; + const i = sparse[k]; + if (i < $this.n && dense[i] === k) { + const j = dense[--$this.n]; + dense[i] = j; + sparse[j] = i; + return true; + } + return false; + } + + has(k: number) { + const $this = __private.get(this); + const i = $this.sparse[k]; + return i < $this.n && $this.dense[i] === k; + } + + get(k: number, notFound = -1) { + return this.has(k) ? k : notFound; + } + + first() { + const $this = __private.get(this); + return $this.n ? $this.dense[0] : undefined; + } + + into(ks: Iterable) { + for (let k of ks) { + this.add(k); + } + return this; + } + + disj(ks: Iterable) { + for (let k of ks) { + this.delete(k); + } + return this; + } + + forEach(fn: Fn3, void>, thisArg?: any) { + const $this = __private.get(this); + const d = $this.dense; + const n = $this.n; + for (let i = 0; i < n; i++) { + const v = d[i]; + fn.call(thisArg, v, v, this); + } + } + + *entries(): IterableIterator> { + const $this = __private.get(this); + const d = $this.dense; + const n = $this.n; + for (let i = 0; i < n; i++) { + yield [d[i], d[i]]; + } + } + + *keys() { + const $this = __private.get(this); + const d = $this.dense; + const n = $this.n; + for (let i = 0; i < n; i++) { + yield d[i]; + } + } + + values() { + return this.keys(); + } + + protected __copy(c: ASparseSet) { + const $this = __private.get(this); + const $c = __private.get(c); + $c.dense = $this.dense.slice(); + $c.sparse = $this.sparse.slice(); + $c.n = $this.n; + } +} + +export class SparseSet8 extends ASparseSet + implements IEquivSet { + constructor(dense: Uint8Array, sparse: Uint8Array); + constructor(n: number); + constructor(n: number | Uint8Array, sparse?: Uint8Array) { + isNumber(n) + ? super(new Uint8Array(n), new Uint8Array(n)) + : n.length === sparse.length + ? super(n, sparse) + : fail(); + } + + get [Symbol.species]() { + return SparseSet8; + } + + get [Symbol.toStringTag]() { + return "SparseSet8"; + } + + copy() { + const c = new SparseSet8(0); + this.__copy(c); + return c; + } + + empty() { + return new SparseSet8(this.capacity); + } +} + +export class SparseSet16 extends ASparseSet + implements IEquivSet { + constructor(dense: Uint16Array, sparse: Uint16Array); + constructor(n: number); + constructor(n: number | Uint16Array, sparse?: Uint16Array) { + isNumber(n) + ? super(new Uint16Array(n), new Uint16Array(n)) + : n.length === sparse.length + ? super(n, sparse) + : fail(); + } + + get [Symbol.species]() { + return SparseSet16; + } + + get [Symbol.toStringTag]() { + return "SparseSet16"; + } + + copy() { + const c = new SparseSet16(0); + this.__copy(c); + return c; + } + + empty() { + return new SparseSet16(this.capacity); + } +} + +export class SparseSet32 extends ASparseSet + implements IEquivSet { + constructor(dense: Uint32Array, sparse: Uint32Array); + constructor(n: number); + constructor(n: number | Uint32Array, sparse?: Uint32Array) { + isNumber(n) + ? super(new Uint32Array(n), new Uint32Array(n)) + : n.length === sparse.length + ? super(n, sparse) + : fail(); + } + + get [Symbol.species]() { + return SparseSet32; + } + + get [Symbol.toStringTag]() { + return "SparseSet32"; + } + + copy() { + const c = new SparseSet8(0); + this.__copy(c); + return c; + } + + empty() { + return new SparseSet32(this.capacity); + } +} + +/** + * Creates a new sparse set with given max. capacity (max ID + 1) and + * chooses most memory efficient implementation, e.g. if `n` <= 256 + * returns a `SparseSet8` instance. + * + * @param n + */ +export const sparseSet = (n: number) => + n < 0x100 + ? new SparseSet8(n) + : n < 0x10000 + ? new SparseSet16(n) + : new SparseSet32(n); diff --git a/packages/associative/test/sparse-set.ts b/packages/associative/test/sparse-set.ts new file mode 100644 index 0000000000..2862a5e4ee --- /dev/null +++ b/packages/associative/test/sparse-set.ts @@ -0,0 +1,57 @@ +import { isSet } from "@thi.ng/checks"; +import * as assert from "assert"; +import { SparseSet8 } from "../src"; + +describe("SparseSet", () => { + let set: SparseSet8; + + beforeEach(() => { + set = new SparseSet8(8); + }); + + it("ctor(n)", () => { + assert(isSet(set)); + assert.equal(set.size, 0); + assert.equal(set.capacity, 8); + }); + + it("ctor(arrays)", () => { + const d = new Uint8Array(8); + const s = new Uint8Array(8); + set = new SparseSet8(d, s); + assert.equal(set.size, 0); + assert.equal(set.capacity, 8); + assert.throws(() => new SparseSet8(new Uint8Array(4), s)); + }); + + it("add", () => { + assert.deepEqual( + set.into([1, 4, 3, 7, 9, 2, 0, 1, 2]), + new Set([0, 1, 2, 3, 4, 7]) + ); + }); + + it("delete", () => { + set.into([1, 4, 3, 7, 9, 2, 0, 1, 2]); + assert(set.delete(4)); + assert.deepEqual(set, new Set([0, 1, 2, 3, 7])); + assert(set.delete(0)); + assert.deepEqual(set, new Set([1, 2, 3, 7])); + assert(set.delete(7)); + assert.deepEqual(set, new Set([1, 2, 3])); + assert(!set.delete(7)); + assert(!set.delete(4)); + set.add(4); + assert.deepEqual(set, new Set([1, 2, 3, 4])); + }); + + it("has", () => { + assert(!set.has(0)); + set.add(0); + set.add(0); + assert(set.has(0)); + set.delete(0); + assert(!set.has(0)); + set.into([3, 1, 2]); + }); +}); diff --git a/packages/atom/CHANGELOG.md b/packages/atom/CHANGELOG.md index 801d262c24..863bde6595 100644 --- a/packages/atom/CHANGELOG.md +++ b/packages/atom/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@2.0.11...@thi.ng/atom@2.0.12) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/atom + + + + + ## [2.0.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@2.0.10...@thi.ng/atom@2.0.11) (2019-04-26) **Note:** Version bump only for package @thi.ng/atom diff --git a/packages/atom/package.json b/packages/atom/package.json index ce834941a6..4e4e803309 100644 --- a/packages/atom/package.json +++ b/packages/atom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/atom", - "version": "2.0.11", + "version": "2.0.12", "description": "Mutable wrappers for nested immutable values w/ optional undo/redo history", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6", diff --git a/packages/bencode/CHANGELOG.md b/packages/bencode/CHANGELOG.md index 0def1615cd..d5a55b78bc 100644 --- a/packages/bencode/CHANGELOG.md +++ b/packages/bencode/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.2.16...@thi.ng/bencode@0.2.17) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/bencode + + + + + ## [0.2.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.2.15...@thi.ng/bencode@0.2.16) (2019-04-26) **Note:** Version bump only for package @thi.ng/bencode diff --git a/packages/bencode/package.json b/packages/bencode/package.json index 14be9b2ba1..89052a30c7 100644 --- a/packages/bencode/package.json +++ b/packages/bencode/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/bencode", - "version": "0.2.16", + "version": "0.2.17", "description": "Bencode binary encoder / decoder with optional UTF8 encoding", "module": "./index.js", "main": "./lib/index.js", @@ -32,13 +32,13 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/arrays": "^0.1.8", + "@thi.ng/api": "^6.2.0", + "@thi.ng/arrays": "^0.1.9", "@thi.ng/checks": "^2.1.6", - "@thi.ng/defmulti": "^1.0.8", + "@thi.ng/defmulti": "^1.0.9", "@thi.ng/errors": "^1.0.6", - "@thi.ng/transducers": "^5.3.6", - "@thi.ng/transducers-binary": "^0.3.11" + "@thi.ng/transducers": "^5.3.7", + "@thi.ng/transducers-binary": "^0.3.12" }, "keywords": [ "bencode", diff --git a/packages/bitfield/CHANGELOG.md b/packages/bitfield/CHANGELOG.md index 136334807f..1021a50ed2 100644 --- a/packages/bitfield/CHANGELOG.md +++ b/packages/bitfield/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.1.7...@thi.ng/bitfield@0.1.8) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/bitfield + + + + + ## [0.1.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.1.6...@thi.ng/bitfield@0.1.7) (2019-04-26) **Note:** Version bump only for package @thi.ng/bitfield diff --git a/packages/bitfield/package.json b/packages/bitfield/package.json index bf8a04b7f9..1e1ec62b55 100644 --- a/packages/bitfield/package.json +++ b/packages/bitfield/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/bitfield", - "version": "0.1.7", + "version": "0.1.8", "description": "1D / 2D bit field implementations", "module": "./index.js", "main": "./lib/index.js", @@ -32,9 +32,9 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/binary": "^1.0.6", - "@thi.ng/strings": "^1.1.2" + "@thi.ng/strings": "^1.1.3" }, "keywords": [ "1D", diff --git a/packages/cache/CHANGELOG.md b/packages/cache/CHANGELOG.md index c18b9497e9..624929b793 100644 --- a/packages/cache/CHANGELOG.md +++ b/packages/cache/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.18...@thi.ng/cache@1.0.19) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/cache + + + + + ## [1.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.17...@thi.ng/cache@1.0.18) (2019-04-26) **Note:** Version bump only for package @thi.ng/cache diff --git a/packages/cache/package.json b/packages/cache/package.json index 2d87e5fe7c..6102f75c5e 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/cache", - "version": "1.0.18", + "version": "1.0.19", "description": "In-memory cache implementations with ES6 Map-like API and different eviction strategies", "module": "./index.js", "main": "./lib/index.js", @@ -32,9 +32,9 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/dcons": "^2.0.18", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/api": "^6.2.0", + "@thi.ng/dcons": "^2.0.19", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "cache", diff --git a/packages/color/CHANGELOG.md b/packages/color/CHANGELOG.md index 257ec687f0..e313f70087 100644 --- a/packages/color/CHANGELOG.md +++ b/packages/color/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@0.1.20...@thi.ng/color@0.1.21) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/color + + + + + ## [0.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@0.1.19...@thi.ng/color@0.1.20) (2019-04-26) **Note:** Version bump only for package @thi.ng/color diff --git a/packages/color/package.json b/packages/color/package.json index 143e37970b..fd82884d1c 100644 --- a/packages/color/package.json +++ b/packages/color/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/color", - "version": "0.1.20", + "version": "0.1.21", "description": "Raw, array-based, color ops, conversions, opt. type wrappers, multi-color gradients", "module": "./index.js", "main": "./lib/index.js", @@ -32,14 +32,14 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/compose": "^1.2.4", - "@thi.ng/defmulti": "^1.0.8", + "@thi.ng/api": "^6.2.0", + "@thi.ng/compose": "^1.2.5", + "@thi.ng/defmulti": "^1.0.9", "@thi.ng/errors": "^1.0.6", - "@thi.ng/math": "^1.2.3", - "@thi.ng/strings": "^1.1.2", - "@thi.ng/transducers": "^5.3.6", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/math": "^1.3.0", + "@thi.ng/strings": "^1.1.3", + "@thi.ng/transducers": "^5.3.7", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "alpha", diff --git a/packages/compose/CHANGELOG.md b/packages/compose/CHANGELOG.md index 5875a396cd..5f9be43a93 100644 --- a/packages/compose/CHANGELOG.md +++ b/packages/compose/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.2.4...@thi.ng/compose@1.2.5) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/compose + + + + + ## [1.2.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.2.3...@thi.ng/compose@1.2.4) (2019-04-26) **Note:** Version bump only for package @thi.ng/compose diff --git a/packages/compose/package.json b/packages/compose/package.json index 88293dd9ea..1f18af3c17 100644 --- a/packages/compose/package.json +++ b/packages/compose/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/compose", - "version": "1.2.4", + "version": "1.2.5", "description": "Arity-optimized functional composition helpers", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/errors": "^1.0.6" }, "keywords": [ diff --git a/packages/csp/CHANGELOG.md b/packages/csp/CHANGELOG.md index 8213ba9c63..efe283c7f9 100644 --- a/packages/csp/CHANGELOG.md +++ b/packages/csp/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.0.18...@thi.ng/csp@1.0.19) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/csp + + + + + ## [1.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.0.17...@thi.ng/csp@1.0.18) (2019-04-26) **Note:** Version bump only for package @thi.ng/csp diff --git a/packages/csp/package.json b/packages/csp/package.json index 8c4d4cd971..81dc0796ac 100644 --- a/packages/csp/package.json +++ b/packages/csp/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/csp", - "version": "1.0.18", + "version": "1.0.19", "description": "ES6 promise based CSP implementation", "module": "./index.js", "main": "./lib/index.js", @@ -36,12 +36,12 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/arrays": "^0.1.8", + "@thi.ng/api": "^6.2.0", + "@thi.ng/arrays": "^0.1.9", "@thi.ng/checks": "^2.1.6", - "@thi.ng/dcons": "^2.0.18", + "@thi.ng/dcons": "^2.0.19", "@thi.ng/errors": "^1.0.6", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "async", diff --git a/packages/dcons/CHANGELOG.md b/packages/dcons/CHANGELOG.md index 897c27e0aa..622285a013 100644 --- a/packages/dcons/CHANGELOG.md +++ b/packages/dcons/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.0.18...@thi.ng/dcons@2.0.19) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/dcons + + + + + ## [2.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.0.17...@thi.ng/dcons@2.0.18) (2019-04-26) **Note:** Version bump only for package @thi.ng/dcons diff --git a/packages/dcons/package.json b/packages/dcons/package.json index 8d7a6b1d4a..51bb451e12 100644 --- a/packages/dcons/package.json +++ b/packages/dcons/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/dcons", - "version": "2.0.18", + "version": "2.0.19", "description": "Comprehensive doubly linked list structure w/ iterator support", "module": "./index.js", "main": "./lib/index.js", @@ -32,12 +32,12 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", "@thi.ng/compare": "^1.0.6", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "datastructure", diff --git a/packages/defmulti/CHANGELOG.md b/packages/defmulti/CHANGELOG.md index 2f97e11f17..cba3300fb4 100644 --- a/packages/defmulti/CHANGELOG.md +++ b/packages/defmulti/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@1.0.8...@thi.ng/defmulti@1.0.9) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/defmulti + + + + + ## [1.0.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@1.0.7...@thi.ng/defmulti@1.0.8) (2019-04-26) **Note:** Version bump only for package @thi.ng/defmulti diff --git a/packages/defmulti/package.json b/packages/defmulti/package.json index ee535b1b24..9309c62cac 100644 --- a/packages/defmulti/package.json +++ b/packages/defmulti/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/defmulti", - "version": "1.0.8", + "version": "1.0.9", "description": "Dynamically extensible multiple dispatch via user supplied dispatch function.", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/errors": "^1.0.6" }, "keywords": [ diff --git a/packages/dgraph/CHANGELOG.md b/packages/dgraph/CHANGELOG.md index 1721dc9832..8c8065a5d1 100644 --- a/packages/dgraph/CHANGELOG.md +++ b/packages/dgraph/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.1.8...@thi.ng/dgraph@1.1.9) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/dgraph + + + + + ## [1.1.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.1.7...@thi.ng/dgraph@1.1.8) (2019-04-26) **Note:** Version bump only for package @thi.ng/dgraph diff --git a/packages/dgraph/package.json b/packages/dgraph/package.json index cd58ef9679..5c8f633162 100644 --- a/packages/dgraph/package.json +++ b/packages/dgraph/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/dgraph", - "version": "1.1.8", + "version": "1.1.9", "description": "Type-agnostic directed acyclic graph (DAG) & graph operations", "module": "./index.js", "main": "./lib/index.js", @@ -32,11 +32,11 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/associative": "^2.2.3", + "@thi.ng/api": "^6.2.0", + "@thi.ng/associative": "^2.3.0", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "data structure", diff --git a/packages/diff/CHANGELOG.md b/packages/diff/CHANGELOG.md index a0b10604c6..8aa116042d 100644 --- a/packages/diff/CHANGELOG.md +++ b/packages/diff/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.1.2...@thi.ng/diff@3.1.3) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/diff + + + + + ## [3.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.1.1...@thi.ng/diff@3.1.2) (2019-04-26) **Note:** Version bump only for package @thi.ng/diff diff --git a/packages/diff/package.json b/packages/diff/package.json index bcd51d8e9b..05c49cf135 100644 --- a/packages/diff/package.json +++ b/packages/diff/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/diff", - "version": "3.1.2", + "version": "3.1.3", "description": "Array & object Diff", "module": "./index.js", "main": "./lib/index.js", @@ -31,7 +31,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/equiv": "^1.0.6" }, "keywords": [ diff --git a/packages/dot/CHANGELOG.md b/packages/dot/CHANGELOG.md index 67f6990d47..1aea6fe436 100644 --- a/packages/dot/CHANGELOG.md +++ b/packages/dot/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@1.0.11...@thi.ng/dot@1.0.12) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/dot + + + + + ## [1.0.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@1.0.10...@thi.ng/dot@1.0.11) (2019-04-26) **Note:** Version bump only for package @thi.ng/dot diff --git a/packages/dot/package.json b/packages/dot/package.json index e71cd394bb..3efe7da0c6 100644 --- a/packages/dot/package.json +++ b/packages/dot/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/dot", - "version": "1.0.11", + "version": "1.0.12", "description": "Graphviz DOM abstraction as vanilla JS objects & serialization to DOT format", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6" }, "keywords": [ diff --git a/packages/dsp/CHANGELOG.md b/packages/dsp/CHANGELOG.md index bd7613ce88..916ec8b601 100644 --- a/packages/dsp/CHANGELOG.md +++ b/packages/dsp/CHANGELOG.md @@ -3,6 +3,25 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@1.0.10...@thi.ng/dsp@1.0.11) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/dsp + + + + + +## [1.0.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@1.0.9...@thi.ng/dsp@1.0.10) (2019-04-26) + + +### Bug Fixes + +* **dsp:** fix tri() oscillator for negative phases ([c67c733](https://github.com/thi-ng/umbrella/commit/c67c733)) + + + + + ## [1.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@1.0.8...@thi.ng/dsp@1.0.9) (2019-04-26) **Note:** Version bump only for package @thi.ng/dsp diff --git a/packages/dsp/package.json b/packages/dsp/package.json index d7dc881a74..c834c4556d 100644 --- a/packages/dsp/package.json +++ b/packages/dsp/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/dsp", - "version": "1.0.9", + "version": "1.0.11", "description": "Assorted DSP utils, oscillators etc.", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/math": "^1.2.3" + "@thi.ng/api": "^6.2.0", + "@thi.ng/math": "^1.3.0" }, "keywords": [ "additive", diff --git a/packages/dsp/src/osc.ts b/packages/dsp/src/osc.ts index 0a81d8bffd..318ff53e55 100644 --- a/packages/dsp/src/osc.ts +++ b/packages/dsp/src/osc.ts @@ -82,7 +82,7 @@ export const sin = (phase: number, freq: number, amp = 1, dc = 0) => dc + amp * Math.sin(phase * freq * TAU); export const tri = (phase: number, freq: number, amp = 1, dc = 0) => - dc + amp * (Math.abs(((phase * freq * 4) % 4) - 2) - 1); + dc + amp * (Math.abs(((fract(phase * freq) * 4) % 4) - 2) - 1); export const triConcave = (phase: number, freq: number, amp = 1, dc = 0) => dc + amp * (8 * Math.pow(fract(phase * freq) - 0.5, 2) - 1); diff --git a/packages/ecs/CHANGELOG.md b/packages/ecs/CHANGELOG.md new file mode 100644 index 0000000000..e1f51d52a0 --- /dev/null +++ b/packages/ecs/CHANGELOG.md @@ -0,0 +1,8 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## 0.0.2 (2019-05-22) + +**Note:** Version bump only for package @thi.ng/ecs diff --git a/packages/ecs/package.json b/packages/ecs/package.json new file mode 100644 index 0000000000..ffa2f070fa --- /dev/null +++ b/packages/ecs/package.json @@ -0,0 +1,50 @@ +{ + "name": "@thi.ng/ecs", + "version": "0.0.2", + "description": "TODO", + "module": "./index.js", + "main": "./lib/index.js", + "umd:main": "./lib/index.umd.js", + "typings": "./index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/thi-ng/umbrella.git" + }, + "homepage": "https://github.com/thi-ng/umbrella/tree/master/packages/ecs", + "author": "Karsten Schmidt ", + "license": "Apache-2.0", + "scripts": { + "build": "yarn clean && yarn build:es6 && yarn build:bundle", + "build:es6": "tsc --declaration", + "build:bundle": "../../scripts/bundle-module", + "test": "rimraf build && tsc -p test/tsconfig.json && nyc mocha build/test/*.js", + "clean": "rimraf *.js *.d.ts .nyc_output build coverage doc lib", + "cover": "yarn test && nyc report --reporter=lcov", + "doc": "node_modules/.bin/typedoc --mode modules --out doc src", + "pub": "yarn build && yarn publish --access public" + }, + "devDependencies": { + "@types/mocha": "^5.2.6", + "@types/node": "^11.13.7", + "mocha": "^6.1.4", + "nyc": "^14.0.0", + "typedoc": "^0.14.2", + "typescript": "^3.4.5" + }, + "dependencies": { + "@thi.ng/api": "^6.2.0", + "@thi.ng/checks": "^2.1.6", + "@thi.ng/errors": "^1.0.6", + "@thi.ng/transducers": "^5.3.7", + "@thi.ng/vectors": "^2.5.6" + }, + "keywords": [ + "ECS", + "ES6", + "typescript" + ], + "publishConfig": { + "access": "public" + }, + "sideEffects": false +} diff --git a/packages/fsm/CHANGELOG.md b/packages/fsm/CHANGELOG.md index 39216ba36e..e7c3dcdf1d 100644 --- a/packages/fsm/CHANGELOG.md +++ b/packages/fsm/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.1.14...@thi.ng/fsm@2.1.15) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/fsm + + + + + ## [2.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.1.13...@thi.ng/fsm@2.1.14) (2019-04-26) **Note:** Version bump only for package @thi.ng/fsm diff --git a/packages/fsm/package.json b/packages/fsm/package.json index d258f3fefd..0b32cd8bf1 100644 --- a/packages/fsm/package.json +++ b/packages/fsm/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/fsm", - "version": "2.1.14", + "version": "2.1.15", "description": "Composable primitives for building declarative, transducer based Finite-State machines & parsers for arbitrary data streams", "module": "./index.js", "main": "./lib/index.js", @@ -32,11 +32,11 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/arrays": "^0.1.8", + "@thi.ng/api": "^6.2.0", + "@thi.ng/arrays": "^0.1.9", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "ES6", diff --git a/packages/geom-accel/CHANGELOG.md b/packages/geom-accel/CHANGELOG.md index a79003ac56..015d8e495c 100644 --- a/packages/geom-accel/CHANGELOG.md +++ b/packages/geom-accel/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@1.1.16...@thi.ng/geom-accel@1.1.17) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-accel + + + + + ## [1.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@1.1.15...@thi.ng/geom-accel@1.1.16) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-accel diff --git a/packages/geom-accel/package.json b/packages/geom-accel/package.json index 2a39ae1ec6..8448ee12e1 100644 --- a/packages/geom-accel/package.json +++ b/packages/geom-accel/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-accel", - "version": "1.1.16", + "version": "1.1.17", "description": "nD spatial indexing data structures", "module": "./index.js", "main": "./lib/index.js", @@ -32,13 +32,13 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/arrays": "^0.1.8", - "@thi.ng/geom-api": "^0.2.2", - "@thi.ng/heaps": "^1.0.9", - "@thi.ng/math": "^1.2.3", - "@thi.ng/transducers": "^5.3.6", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/api": "^6.2.0", + "@thi.ng/arrays": "^0.1.9", + "@thi.ng/geom-api": "^0.2.3", + "@thi.ng/heaps": "^1.0.10", + "@thi.ng/math": "^1.3.0", + "@thi.ng/transducers": "^5.3.7", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-api/CHANGELOG.md b/packages/geom-api/CHANGELOG.md index 753e674fae..fc1ba1ae09 100644 --- a/packages/geom-api/CHANGELOG.md +++ b/packages/geom-api/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@0.2.2...@thi.ng/geom-api@0.2.3) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-api + + + + + ## [0.2.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@0.2.1...@thi.ng/geom-api@0.2.2) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-api diff --git a/packages/geom-api/package.json b/packages/geom-api/package.json index 70434e4d11..7c751fc623 100644 --- a/packages/geom-api/package.json +++ b/packages/geom-api/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-api", - "version": "0.2.2", + "version": "0.2.3", "description": "Shared type & interface declarations for @thi.ng/geom packages", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/api": "^6.2.0", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "ES6", diff --git a/packages/geom-arc/CHANGELOG.md b/packages/geom-arc/CHANGELOG.md index fe17c29fac..efb5599a15 100644 --- a/packages/geom-arc/CHANGELOG.md +++ b/packages/geom-arc/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.1.16...@thi.ng/geom-arc@0.1.17) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-arc + + + + + ## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.1.15...@thi.ng/geom-arc@0.1.16) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-arc diff --git a/packages/geom-arc/package.json b/packages/geom-arc/package.json index a76cbc53ed..34d3343d1e 100644 --- a/packages/geom-arc/package.json +++ b/packages/geom-arc/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-arc", - "version": "0.1.16", + "version": "0.1.17", "description": "2D circular / elliptic arc operations", "module": "./index.js", "main": "./lib/index.js", @@ -33,10 +33,10 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.6", - "@thi.ng/geom-api": "^0.2.2", - "@thi.ng/geom-resample": "^0.1.16", - "@thi.ng/math": "^1.2.3", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/geom-api": "^0.2.3", + "@thi.ng/geom-resample": "^0.1.17", + "@thi.ng/math": "^1.3.0", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-clip/CHANGELOG.md b/packages/geom-clip/CHANGELOG.md index f751099b14..ee85c25e57 100644 --- a/packages/geom-clip/CHANGELOG.md +++ b/packages/geom-clip/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip@0.0.18...@thi.ng/geom-clip@0.0.19) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-clip + + + + + ## [0.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip@0.0.17...@thi.ng/geom-clip@0.0.18) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-clip diff --git a/packages/geom-clip/package.json b/packages/geom-clip/package.json index 180dd46f3b..576b2a2312 100644 --- a/packages/geom-clip/package.json +++ b/packages/geom-clip/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-clip", - "version": "0.0.18", + "version": "0.0.19", "description": "2D line & convex polygon clipping (Liang-Barsky / Sutherland-Hodgeman)", "module": "./index.js", "main": "./lib/index.js", @@ -32,10 +32,10 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/geom-isec": "^0.1.16", - "@thi.ng/geom-poly-utils": "^0.1.16", - "@thi.ng/math": "^1.2.3", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/geom-isec": "^0.2.0", + "@thi.ng/geom-poly-utils": "^0.1.17", + "@thi.ng/math": "^1.3.0", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-closest-point/CHANGELOG.md b/packages/geom-closest-point/CHANGELOG.md index 738b16c1ff..47f4f76e9e 100644 --- a/packages/geom-closest-point/CHANGELOG.md +++ b/packages/geom-closest-point/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.2.2...@thi.ng/geom-closest-point@0.2.3) (2019-05-22) + + +### Bug Fixes + +* **geom-closest-point:** flip sign of plane W component, extract distToPlane() ([74dbcb0](https://github.com/thi-ng/umbrella/commit/74dbcb0)) + + + + + ## [0.2.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.2.1...@thi.ng/geom-closest-point@0.2.2) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-closest-point diff --git a/packages/geom-closest-point/package.json b/packages/geom-closest-point/package.json index cb9244a29d..a7a88988a8 100644 --- a/packages/geom-closest-point/package.json +++ b/packages/geom-closest-point/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-closest-point", - "version": "0.2.2", + "version": "0.2.3", "description": "Closest point / proximity helpers", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/math": "^1.2.3", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/math": "^1.3.0", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "ES6", diff --git a/packages/geom-closest-point/src/index.ts b/packages/geom-closest-point/src/index.ts index fd1be6eb2e..8c92e1ecd6 100644 --- a/packages/geom-closest-point/src/index.ts +++ b/packages/geom-closest-point/src/index.ts @@ -198,15 +198,15 @@ export const closestPointArray = (p: ReadonlyVec, pts: Vec[]) => { return closest; }; +export const distToPlane = (p: ReadonlyVec, n: ReadonlyVec, w: number) => + dot(n, p) - w; + export const closestPointPlane = ( p: ReadonlyVec, normal: ReadonlyVec, w: number, out: Vec = [] -) => { - out = normalize(out, normal, dot(p, normal) + w); - return sub(out, p, out); -}; +) => sub(out, p, normalize(out, normal, distToPlane(p, normal, w))); export const closestPointCircle = ( p: ReadonlyVec, diff --git a/packages/geom-hull/CHANGELOG.md b/packages/geom-hull/CHANGELOG.md index 0267137f49..fc6f858cd9 100644 --- a/packages/geom-hull/CHANGELOG.md +++ b/packages/geom-hull/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.18...@thi.ng/geom-hull@0.0.19) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-hull + + + + + ## [0.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.17...@thi.ng/geom-hull@0.0.18) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-hull diff --git a/packages/geom-hull/package.json b/packages/geom-hull/package.json index b109de9d91..4d4b50327d 100644 --- a/packages/geom-hull/package.json +++ b/packages/geom-hull/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-hull", - "version": "0.0.18", + "version": "0.0.19", "description": "Fast 2D convex hull (Graham Scan)", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/math": "^1.2.3", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/math": "^1.3.0", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-isec/CHANGELOG.md b/packages/geom-isec/CHANGELOG.md index 7d60092942..7148413a92 100644 --- a/packages/geom-isec/CHANGELOG.md +++ b/packages/geom-isec/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.1.16...@thi.ng/geom-isec@0.2.0) (2019-05-22) + + +### Bug Fixes + +* **geom-isec:** fix [#84](https://github.com/thi-ng/umbrella/issues/84), update pointInSegment, add tests ([2bef312](https://github.com/thi-ng/umbrella/commit/2bef312)) + + +### Features + +* **geom-isec:** add ray-plane, plane-plane fns, update readme ([40a8bff](https://github.com/thi-ng/umbrella/commit/40a8bff)) + + + + + ## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.1.15...@thi.ng/geom-isec@0.1.16) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-isec diff --git a/packages/geom-isec/README.md b/packages/geom-isec/README.md index 7d872d1513..46d929ff02 100644 --- a/packages/geom-isec/README.md +++ b/packages/geom-isec/README.md @@ -26,22 +26,23 @@ This project is part of the ### 2D tests -| Type | Circle | Line | Poly | Rect | Tri | -|--------|:------:|:----:|:----:|:----:|:---:| -| Circle | ✓ | | | | | -| Line | | ✓ | | | | -| Point | ✓ | ✓ | ✓ | ✓ | ✓ | -| Ray | ✓ | ✓ | ✓ | ✓ | | -| Rect | ✓ | | | ✓ | | +| Type | Circle | Line | Poly | Ray | Rect | Tri | +|--------|:------:|:----:|:----:|:---:|:----:|:---:| +| Circle | ✓ | | | | | | +| Line | | ✓ | | | | | +| Point | ✓ | ✓ | ✓ | | ✓ | ✓ | +| Ray | ✓ | ✓ | ✓ | | ✓ | | +| Rect | ✓ | | | | ✓ | | ### 3D tests -| Type | AABB | Sphere | -|--------|:----:|:------:| -| AABB | ✓ | ✓ | -| Point | ✓ | ✓ | -| Ray | ✓ | ✓ | -| Sphere | | ✓ | +| Type | AABB | Plane | Point | Ray | Sphere | +|--------|:----:|:-----:|:-----:|:---:|:------:| +| AABB | ✓ | | | | ✓ | +| Plane | | ✓ | | | | +| Point | ✓ | | | | ✓ | +| Ray | ✓ | ✓ | | | ✓ | +| Sphere | | | | | ✓ | ## Installation diff --git a/packages/geom-isec/package.json b/packages/geom-isec/package.json index c01b8f471d..f5eaa4d98b 100644 --- a/packages/geom-isec/package.json +++ b/packages/geom-isec/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-isec", - "version": "0.1.16", + "version": "0.2.0", "description": "2D/3D shape intersection checks", "module": "./index.js", "main": "./lib/index.js", @@ -32,11 +32,11 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/geom-api": "^0.2.2", - "@thi.ng/geom-closest-point": "^0.2.2", - "@thi.ng/math": "^1.2.3", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/api": "^6.2.0", + "@thi.ng/geom-api": "^0.2.3", + "@thi.ng/geom-closest-point": "^0.2.3", + "@thi.ng/math": "^1.3.0", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-isec/src/index.ts b/packages/geom-isec/src/index.ts index c3a2985a78..9e5bea0cdb 100644 --- a/packages/geom-isec/src/index.ts +++ b/packages/geom-isec/src/index.ts @@ -2,8 +2,10 @@ export * from "./point"; export * from "./circle-circle"; export * from "./line-line"; +export * from "./plane-plane"; export * from "./ray-circle"; export * from "./ray-line"; +export * from "./ray-plane"; export * from "./ray-poly"; export * from "./ray-rect"; export * from "./rect-circle"; diff --git a/packages/geom-isec/src/plane-plane.ts b/packages/geom-isec/src/plane-plane.ts new file mode 100644 index 0000000000..bcaa9c8af7 --- /dev/null +++ b/packages/geom-isec/src/plane-plane.ts @@ -0,0 +1,32 @@ +import { IntersectionType } from "@thi.ng/geom-api"; +import { eqDelta, eqDeltaFixed } from "@thi.ng/math"; +import { + add3, + cross3, + dot3, + mulN3, + ReadonlyVec +} from "@thi.ng/vectors"; +import { NONE } from "./api"; + +export const intersectPlanePlane = ( + na: ReadonlyVec, + wa: number, + nb: ReadonlyVec, + wb: number +) => { + const dn = dot3(na, nb); + if (eqDeltaFixed(dn, 1)) { + return eqDelta(wa, wb) ? { type: IntersectionType.COINCIDENT } : NONE; + } + const det = 1 / (1 - dn * dn); + const da = (wa - wb * dn) * det; + const db = (wb - wa * dn) * det; + return { + type: IntersectionType.INTERSECT, + isec: [ + add3(null, mulN3([], na, da), mulN3([], nb, db)), + cross3([], na, nb) + ] + }; +}; diff --git a/packages/geom-isec/src/point.ts b/packages/geom-isec/src/point.ts index 41eee8bb32..27c81de073 100644 --- a/packages/geom-isec/src/point.ts +++ b/packages/geom-isec/src/point.ts @@ -1,23 +1,24 @@ -import { EPS, sign } from "@thi.ng/math"; +import { closestT } from "@thi.ng/geom-closest-point"; +import { clamp01, EPS, sign } from "@thi.ng/math"; import { clockwise2, distSq, magSq, + mixN, ReadonlyVec, signedArea2 } from "@thi.ng/vectors"; -export const pointInSegment2 = ( +export const pointInSegment = ( p: ReadonlyVec, a: ReadonlyVec, b: ReadonlyVec, eps = EPS ) => { - const ax = a[0]; - const ay = a[1]; - const tx = (p[0] - ax) / (b[0] - ax); - const ty = (p[1] - ay) / (b[1] - ay); - return Math.abs(tx - ty) <= eps && !(tx < 0 || tx > 1 || ty < 0 || ty > 1); + const t = closestT(p, a, b); + return t !== undefined + ? distSq(p, mixN([], a, b, clamp01(t))) < eps * eps + : false; }; export const pointInCircle = (p: ReadonlyVec, pos: ReadonlyVec, r: number) => diff --git a/packages/geom-isec/src/ray-line.ts b/packages/geom-isec/src/ray-line.ts index 0ed7578486..641d6a3446 100644 --- a/packages/geom-isec/src/ray-line.ts +++ b/packages/geom-isec/src/ray-line.ts @@ -13,7 +13,7 @@ export const intersectRayLine = ( const bay = b[1] - a[1]; const d = dir[0] * bay - dir[1] * bax; if (eqDeltaFixed(d, 0)) { - return { type: IntersectionType.NONE }; + return NONE; } const arx = a[0] - rpos[0]; const ary = a[1] - rpos[1]; diff --git a/packages/geom-isec/src/ray-plane.ts b/packages/geom-isec/src/ray-plane.ts new file mode 100644 index 0000000000..6a1dfda2c7 --- /dev/null +++ b/packages/geom-isec/src/ray-plane.ts @@ -0,0 +1,37 @@ +import { IntersectionType } from "@thi.ng/geom-api"; +import { EPS, sign } from "@thi.ng/math"; +import { + copy, + dot, + maddN, + mulN, + ReadonlyVec, + sub +} from "@thi.ng/vectors"; +import { NONE } from "./api"; + +export const intersectRayPlane = ( + rpos: ReadonlyVec, + dir: ReadonlyVec, + normal: ReadonlyVec, + w: number, + eps = EPS +) => { + const d = dot(normal, dir); + const cp = sign(dot(normal, rpos) - w, eps); + if ((d > eps && cp < 0) || (d < -eps && cp > 0)) { + const isec = sub(null, mulN([], normal, w), rpos); + const alpha = dot(normal, isec) / d; + return { + type: IntersectionType.INTERSECT, + isec: maddN(isec, rpos, dir, alpha), + alpha + }; + } + return cp === 0 + ? { + type: IntersectionType.COINCIDENT, + isec: copy(rpos) + } + : NONE; +}; diff --git a/packages/geom-isec/test/index.ts b/packages/geom-isec/test/index.ts deleted file mode 100644 index 4b38f19781..0000000000 --- a/packages/geom-isec/test/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// import * as assert from "assert"; -// import * as gi from "../src/index"; - -describe("geom-isec", () => { - it("tests pending"); -}); diff --git a/packages/geom-isec/test/point-segment.ts b/packages/geom-isec/test/point-segment.ts new file mode 100644 index 0000000000..fd89a9a906 --- /dev/null +++ b/packages/geom-isec/test/point-segment.ts @@ -0,0 +1,30 @@ +import * as assert from "assert"; +import { pointInSegment } from "../src"; + +describe("pointInSegment", () => { + it("2d", () => { + assert(pointInSegment([0, 0], [-10, -10], [10, 10]), "1"); + assert(pointInSegment([-5, -5], [-10, -10], [10, 10]), "2"); + assert(pointInSegment([5, 5], [-10, -10], [10, 10]), "3"); + assert(!pointInSegment([5, 5.01], [-10, -10], [10, 10]), "4"); + assert(pointInSegment([5, 5.01], [-10, -10], [10, 10], 0.01), "4.1"); + assert(pointInSegment([5, 4.99], [-10, -10], [10, 10], 0.01), "4.2"); + assert(!pointInSegment([5, 5.02], [-10, -10], [10, 10], 0.01), "4.3"); + assert(!pointInSegment([5, 4.98], [-10, -10], [10, 10], 0.01), "4.4"); + }); + + it("2d axis aligned", () => { + assert(pointInSegment([9, 10], [5, 10], [10, 10]), "1"); + assert(pointInSegment([9, 10], [10, 10], [5, 10]), "1.1"); + assert(pointInSegment([10, 9], [10, 5], [10, 10]), "2"); + assert(pointInSegment([10, 9], [10, 10], [10, 5]), "2.1"); + assert(pointInSegment([4.9, 10], [5, 10], [10, 10], 0.1), "3"); + assert(!pointInSegment([4.89, 10], [5, 10], [10, 10], 0.1), "3.1"); + assert(pointInSegment([10.1, 10], [5, 10], [10, 10], 0.1), "3.2"); + assert(!pointInSegment([10.11, 10], [5, 10], [10, 10], 0.1), "3.3"); + assert(pointInSegment([9, 10.1], [5, 10], [10, 10], 0.1), "4"); + assert(!pointInSegment([9, 10.11], [5, 10], [10, 10], 0.1), "4.1"); + assert(pointInSegment([9, 9.9], [5, 10], [10, 10], 0.1), "4.2"); + assert(!pointInSegment([9, 9.89], [5, 10], [10, 10], 0.1), "4.3"); + }); +}); diff --git a/packages/geom-isoline/CHANGELOG.md b/packages/geom-isoline/CHANGELOG.md index 27f2f27971..e6ea904626 100644 --- a/packages/geom-isoline/CHANGELOG.md +++ b/packages/geom-isoline/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.16...@thi.ng/geom-isoline@0.1.17) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-isoline + + + + + ## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.15...@thi.ng/geom-isoline@0.1.16) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-isoline diff --git a/packages/geom-isoline/package.json b/packages/geom-isoline/package.json index 0882317ad3..339827fba9 100644 --- a/packages/geom-isoline/package.json +++ b/packages/geom-isoline/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-isoline", - "version": "0.1.16", + "version": "0.1.17", "description": "Fast 2D contour line extraction / generation", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/transducers": "^5.3.6", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/transducers": "^5.3.7", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-poly-utils/CHANGELOG.md b/packages/geom-poly-utils/CHANGELOG.md index 5ec3e94b61..7a9a8d19b9 100644 --- a/packages/geom-poly-utils/CHANGELOG.md +++ b/packages/geom-poly-utils/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.16...@thi.ng/geom-poly-utils@0.1.17) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-poly-utils + + + + + ## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.15...@thi.ng/geom-poly-utils@0.1.16) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-poly-utils diff --git a/packages/geom-poly-utils/package.json b/packages/geom-poly-utils/package.json index cacfa9a90a..40dd0fe88d 100644 --- a/packages/geom-poly-utils/package.json +++ b/packages/geom-poly-utils/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-poly-utils", - "version": "0.1.16", + "version": "0.1.17", "description": "Polygon / triangle analysis & processing utilities", "module": "./index.js", "main": "./lib/index.js", @@ -33,9 +33,9 @@ }, "dependencies": { "@thi.ng/errors": "^1.0.6", - "@thi.ng/geom-api": "^0.2.2", - "@thi.ng/math": "^1.2.3", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/geom-api": "^0.2.3", + "@thi.ng/math": "^1.3.0", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-resample/CHANGELOG.md b/packages/geom-resample/CHANGELOG.md index 1da6c462e6..757b4b4d0f 100644 --- a/packages/geom-resample/CHANGELOG.md +++ b/packages/geom-resample/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.1.16...@thi.ng/geom-resample@0.1.17) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-resample + + + + + ## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.1.15...@thi.ng/geom-resample@0.1.16) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-resample diff --git a/packages/geom-resample/package.json b/packages/geom-resample/package.json index abf0e2292a..b2ed43052a 100644 --- a/packages/geom-resample/package.json +++ b/packages/geom-resample/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-resample", - "version": "0.1.16", + "version": "0.1.17", "description": "Customizable nD polyline interpolation, re-sampling, splitting & nearest point computation", "module": "./index.js", "main": "./lib/index.js", @@ -33,10 +33,10 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.6", - "@thi.ng/geom-api": "^0.2.2", - "@thi.ng/geom-closest-point": "^0.2.2", - "@thi.ng/math": "^1.2.3", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/geom-api": "^0.2.3", + "@thi.ng/geom-closest-point": "^0.2.3", + "@thi.ng/math": "^1.3.0", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-splines/CHANGELOG.md b/packages/geom-splines/CHANGELOG.md index 952a98837f..3eeb1d1c5d 100644 --- a/packages/geom-splines/CHANGELOG.md +++ b/packages/geom-splines/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.1.16...@thi.ng/geom-splines@0.1.17) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-splines + + + + + ## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.1.15...@thi.ng/geom-splines@0.1.16) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-splines diff --git a/packages/geom-splines/package.json b/packages/geom-splines/package.json index b0fad8fb81..cac40d7667 100644 --- a/packages/geom-splines/package.json +++ b/packages/geom-splines/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-splines", - "version": "0.1.16", + "version": "0.1.17", "description": "nD cubic & quadratic curve analysis, conversion, interpolation, splitting", "module": "./index.js", "main": "./lib/index.js", @@ -33,11 +33,11 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.6", - "@thi.ng/geom-api": "^0.2.2", - "@thi.ng/geom-arc": "^0.1.16", - "@thi.ng/geom-resample": "^0.1.16", - "@thi.ng/math": "^1.2.3", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/geom-api": "^0.2.3", + "@thi.ng/geom-arc": "^0.1.17", + "@thi.ng/geom-resample": "^0.1.17", + "@thi.ng/math": "^1.3.0", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-subdiv-curve/CHANGELOG.md b/packages/geom-subdiv-curve/CHANGELOG.md index 20d079c388..bb4c638b5a 100644 --- a/packages/geom-subdiv-curve/CHANGELOG.md +++ b/packages/geom-subdiv-curve/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.15...@thi.ng/geom-subdiv-curve@0.1.16) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-subdiv-curve + + + + + ## [0.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.14...@thi.ng/geom-subdiv-curve@0.1.15) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-subdiv-curve diff --git a/packages/geom-subdiv-curve/package.json b/packages/geom-subdiv-curve/package.json index 7395a83e6a..3192a3a902 100644 --- a/packages/geom-subdiv-curve/package.json +++ b/packages/geom-subdiv-curve/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-subdiv-curve", - "version": "0.1.15", + "version": "0.1.16", "description": "Freely customizable, iterative subdivision curves for open / closed input geometries", "module": "./index.js", "main": "./lib/index.js", @@ -32,9 +32,9 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/geom-api": "^0.2.2", - "@thi.ng/transducers": "^5.3.6", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/geom-api": "^0.2.3", + "@thi.ng/transducers": "^5.3.7", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-tessellate/CHANGELOG.md b/packages/geom-tessellate/CHANGELOG.md index a085abe901..2541f8c51c 100644 --- a/packages/geom-tessellate/CHANGELOG.md +++ b/packages/geom-tessellate/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.1.16...@thi.ng/geom-tessellate@0.1.17) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-tessellate + + + + + ## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.1.15...@thi.ng/geom-tessellate@0.1.16) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-tessellate diff --git a/packages/geom-tessellate/package.json b/packages/geom-tessellate/package.json index 81559ad16d..d36e0c1441 100644 --- a/packages/geom-tessellate/package.json +++ b/packages/geom-tessellate/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-tessellate", - "version": "0.1.16", + "version": "0.1.17", "description": "2D/3D polygon tessellators", "module": "./index.js", "main": "./lib/index.js", @@ -33,11 +33,11 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.6", - "@thi.ng/geom-api": "^0.2.2", - "@thi.ng/geom-isec": "^0.1.16", - "@thi.ng/geom-poly-utils": "^0.1.16", - "@thi.ng/transducers": "^5.3.6", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/geom-api": "^0.2.3", + "@thi.ng/geom-isec": "^0.2.0", + "@thi.ng/geom-poly-utils": "^0.1.17", + "@thi.ng/transducers": "^5.3.7", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-voronoi/CHANGELOG.md b/packages/geom-voronoi/CHANGELOG.md index a3f33eafd7..d0dd50c8a4 100644 --- a/packages/geom-voronoi/CHANGELOG.md +++ b/packages/geom-voronoi/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.1.16...@thi.ng/geom-voronoi@0.1.17) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/geom-voronoi + + + + + ## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.1.15...@thi.ng/geom-voronoi@0.1.16) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom-voronoi diff --git a/packages/geom-voronoi/package.json b/packages/geom-voronoi/package.json index 92be9ffcb4..4e90339f3e 100644 --- a/packages/geom-voronoi/package.json +++ b/packages/geom-voronoi/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-voronoi", - "version": "0.1.16", + "version": "0.1.17", "description": "Fast, incremental 2D Delaunay & Voronoi mesh implementation", "module": "./index.js", "main": "./lib/index.js", @@ -32,14 +32,14 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", - "@thi.ng/geom-clip": "^0.0.18", - "@thi.ng/geom-isec": "^0.1.16", - "@thi.ng/geom-poly-utils": "^0.1.16", - "@thi.ng/math": "^1.2.3", + "@thi.ng/geom-clip": "^0.0.19", + "@thi.ng/geom-isec": "^0.2.0", + "@thi.ng/geom-poly-utils": "^0.1.17", + "@thi.ng/math": "^1.3.0", "@thi.ng/quad-edge": "^0.1.4", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom-voronoi/src/index.ts b/packages/geom-voronoi/src/index.ts index 5010ff2202..c40b5f7722 100644 --- a/packages/geom-voronoi/src/index.ts +++ b/packages/geom-voronoi/src/index.ts @@ -1,11 +1,7 @@ import { IObjectOf, Pair } from "@thi.ng/api"; import { isNumber } from "@thi.ng/checks"; import { liangBarsky2, sutherlandHodgeman } from "@thi.ng/geom-clip"; -import { - pointInCircumCircle, - pointInPolygon2, - pointInSegment2 -} from "@thi.ng/geom-isec"; +import { pointInCircumCircle, pointInPolygon2, pointInSegment } from "@thi.ng/geom-isec"; import { centroid, circumCenter2 } from "@thi.ng/geom-poly-utils"; import { EPS } from "@thi.ng/math"; import { Edge } from "@thi.ng/quad-edge"; @@ -61,7 +57,7 @@ export class DVMesh { add(p: ReadonlyVec, val?: T, eps = EPS) { let [e, exists] = this.locate(p, eps); if (exists) return false; - if (pointInSegment2(p, e.origin.pos, e.dest.pos)) { + if (pointInSegment(p, e.origin.pos, e.dest.pos)) { e = e.oprev; e.onext.remove(); } diff --git a/packages/geom/CHANGELOG.md b/packages/geom/CHANGELOG.md index 92685eac29..cb85fcb24c 100644 --- a/packages/geom/CHANGELOG.md +++ b/packages/geom/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.4.2...@thi.ng/geom@1.5.0) (2019-05-22) + + +### Features + +* **geom:** add Plane, Quad3 factories & ops ([2079bfe](https://github.com/thi-ng/umbrella/commit/2079bfe)) + + + + + ## [1.4.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.4.1...@thi.ng/geom@1.4.2) (2019-04-26) **Note:** Version bump only for package @thi.ng/geom diff --git a/packages/geom/package.json b/packages/geom/package.json index baa7ffe657..5ae93dd02c 100644 --- a/packages/geom/package.json +++ b/packages/geom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom", - "version": "1.4.2", + "version": "1.5.0", "description": "2D geometry types, polymorphic operations, SVG generation", "module": "./index.js", "main": "./lib/index.js", @@ -32,31 +32,31 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/arrays": "^0.1.8", + "@thi.ng/api": "^6.2.0", + "@thi.ng/arrays": "^0.1.9", "@thi.ng/checks": "^2.1.6", - "@thi.ng/compose": "^1.2.4", - "@thi.ng/defmulti": "^1.0.8", + "@thi.ng/compose": "^1.2.5", + "@thi.ng/defmulti": "^1.0.9", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/geom-api": "^0.2.2", - "@thi.ng/geom-arc": "^0.1.16", - "@thi.ng/geom-clip": "^0.0.18", - "@thi.ng/geom-closest-point": "^0.2.2", - "@thi.ng/geom-hull": "^0.0.18", - "@thi.ng/geom-isec": "^0.1.16", - "@thi.ng/geom-poly-utils": "^0.1.16", - "@thi.ng/geom-resample": "^0.1.16", - "@thi.ng/geom-splines": "^0.1.16", - "@thi.ng/geom-subdiv-curve": "^0.1.15", - "@thi.ng/geom-tessellate": "^0.1.16", - "@thi.ng/hiccup": "^3.1.8", - "@thi.ng/hiccup-svg": "^3.1.21", - "@thi.ng/math": "^1.2.3", - "@thi.ng/matrices": "^0.3.4", - "@thi.ng/random": "^1.1.6", - "@thi.ng/transducers": "^5.3.6", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/geom-api": "^0.2.3", + "@thi.ng/geom-arc": "^0.1.17", + "@thi.ng/geom-clip": "^0.0.19", + "@thi.ng/geom-closest-point": "^0.2.3", + "@thi.ng/geom-hull": "^0.0.19", + "@thi.ng/geom-isec": "^0.2.0", + "@thi.ng/geom-poly-utils": "^0.1.17", + "@thi.ng/geom-resample": "^0.1.17", + "@thi.ng/geom-splines": "^0.1.17", + "@thi.ng/geom-subdiv-curve": "^0.1.16", + "@thi.ng/geom-tessellate": "^0.1.17", + "@thi.ng/hiccup": "^3.1.9", + "@thi.ng/hiccup-svg": "^3.1.22", + "@thi.ng/math": "^1.3.0", + "@thi.ng/matrices": "^0.4.0", + "@thi.ng/random": "^1.1.7", + "@thi.ng/transducers": "^5.3.7", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/geom/src/api.ts b/packages/geom/src/api.ts index 126261f947..2e56d85506 100644 --- a/packages/geom/src/api.ts +++ b/packages/geom/src/api.ts @@ -437,6 +437,19 @@ export class Quad extends APC implements IHiccupShape { return ["polygon", this.attribs, this.points]; } } +export class Quad3 extends APC implements IHiccupShape { + get type() { + return Type.QUAD3; + } + + copy() { + return new Quad3(copyVectors(this.points), { ...this.attribs }); + } + + toHiccup() { + return ["polygon", this.attribs, this.points]; + } +} export class Quadratic extends APC implements IHiccupShape, IHiccupPathSegment { get type() { diff --git a/packages/geom/src/ctors/plane.ts b/packages/geom/src/ctors/plane.ts index 7b1f19a2ec..3c9797afae 100644 --- a/packages/geom/src/ctors/plane.ts +++ b/packages/geom/src/ctors/plane.ts @@ -2,6 +2,7 @@ import { Attribs } from "@thi.ng/geom-api"; import { dot3, normalize, + orthoNormal3, ReadonlyVec, Vec } from "@thi.ng/vectors"; @@ -16,5 +17,12 @@ export const planeWithPoint = ( attribs?: Attribs ) => { normal = normalize(null, normal); - return new Plane(normal, -dot3(normal, p), attribs); + return new Plane(normal, dot3(normal, p), attribs); }; + +export const planeFrom3Points = ( + a: ReadonlyVec, + b: ReadonlyVec, + c: ReadonlyVec, + attribs?: Attribs +) => planeWithPoint(orthoNormal3([], a, b, c), a, attribs); diff --git a/packages/geom/src/ctors/quad.ts b/packages/geom/src/ctors/quad.ts index fe964887d9..b1da3db85b 100644 --- a/packages/geom/src/ctors/quad.ts +++ b/packages/geom/src/ctors/quad.ts @@ -1,6 +1,14 @@ +import { isNumber } from "@thi.ng/checks"; import { Attribs } from "@thi.ng/geom-api"; -import { Vec } from "@thi.ng/vectors"; -import { Quad } from "../api"; +import { closestPointPlane } from "@thi.ng/geom-closest-point"; +import { alignmentQuat, mulVQ } from "@thi.ng/matrices"; +import { + add3, + ReadonlyVec, + Vec, + Z3 +} from "@thi.ng/vectors"; +import { Plane, Quad, Quad3 } from "../api"; import { argAttribs } from "../internal/args"; export function quad(a: Vec, b: Vec, c: Vec, d: Vec, attribs?: Attribs): Quad; @@ -9,3 +17,27 @@ export function quad(...args: any[]) { const attr = argAttribs(args); return new Quad(args.length === 1 ? args[0] : args, attr); } + +export function quad3(a: Vec, b: Vec, c: Vec, d: Vec, attribs?: Attribs): Quad; +export function quad3(pts: Vec[], attribs?: Attribs): Quad; +export function quad3(...args: any[]) { + const attr = argAttribs(args); + return new Quad3(args.length === 1 ? args[0] : args, attr); +} + +export const quadOnPlane = ( + plane: Plane, + pos: ReadonlyVec, + size: number | ReadonlyVec, + attribs?: Attribs +) => { + pos = closestPointPlane(pos, plane.normal, plane.w); + const [w, h] = isNumber(size) ? [size, size] : size; + const q = alignmentQuat(Z3, plane.normal); + return new Quad3( + [[-w, -h, 0], [w, -h, 0], [w, h, 0], [-w, h, 0]].map((p) => + add3(null, mulVQ(null, q, p), pos) + ), + attribs + ); +}; diff --git a/packages/geom/src/ops/area.ts b/packages/geom/src/ops/area.ts index f39465c66e..c7d2dac2f9 100644 --- a/packages/geom/src/ops/area.ts +++ b/packages/geom/src/ops/area.ts @@ -11,6 +11,7 @@ import { Group, Polygon, Rect, + Sphere, Triangle } from "../api"; import { dispatch } from "../internal/dispatch"; @@ -34,6 +35,7 @@ import { dispatch } from "../internal/dispatch"; * - Ellipse * - Group * - Line + * - Plane * - Points * - Polygon * - Polyline @@ -41,6 +43,7 @@ import { dispatch } from "../internal/dispatch"; * - Quadratic * - Ray * - Rect + * - Sphere * - Triangle * * @param shape @@ -55,7 +58,7 @@ area.addAll({ // http://cut-the-knot.org/Generalization/Cavalieri2.shtml ($: Arc) => 0.5 * Math.abs($.start - $.end) * $.r[0] * $.r[1], - [Type.CIRCLE]: ($: Circle) => PI * $.r * $.r, + [Type.CIRCLE]: ($: Circle) => PI * $.r ** 2, [Type.ELLIPSE]: ($: Ellipse) => PI * $.r[0] * $.r[1], @@ -64,6 +67,8 @@ area.addAll({ [Type.POINTS]: () => 0, + [Type.PLANE]: () => Infinity, + [Type.POLYGON]: ($: Polygon, signed?) => { const area = polyArea2($.points); return signed ? area : Math.abs(area); @@ -71,6 +76,8 @@ area.addAll({ [Type.RECT]: ($: Rect) => $.size[0] * $.size[1], + [Type.SPHERE]: ($: Sphere) => 4 * PI * $.r ** 2, + [Type.TRIANGLE]: ($: Triangle, signed?) => { const area = 0.5 * signedArea2(...(<[Vec, Vec, Vec]>$.points)); return signed ? area : Math.abs(area); diff --git a/packages/geom/src/ops/centroid.ts b/packages/geom/src/ops/centroid.ts index a7d1b26ca8..652f413166 100644 --- a/packages/geom/src/ops/centroid.ts +++ b/packages/geom/src/ops/centroid.ts @@ -1,13 +1,30 @@ import { defmulti, MultiFn1O } from "@thi.ng/defmulti"; -import { AABBLike, IShape, PCLike, Type } from "@thi.ng/geom-api"; import { - centerOfWeight2, - centroid as _centroid -} from "@thi.ng/geom-poly-utils"; -import { add, divN, maddN, mixN, set, Vec } from "@thi.ng/vectors"; + AABBLike, + IShape, + PCLike, + Type +} from "@thi.ng/geom-api"; +import { centerOfWeight2, centroid as _centroid } from "@thi.ng/geom-poly-utils"; +import { + add, + divN, + maddN, + mixN, + mulN, + set, + Vec +} from "@thi.ng/vectors"; +import { + Circle, + Group, + Line, + Plane, + Polygon, + Triangle +} from "../api"; import { dispatch } from "../internal/dispatch"; import { bounds } from "./bounds"; -import { Circle, Group, Line, Polygon, Triangle } from "../api"; export const centroid: MultiFn1O = defmulti(dispatch); @@ -21,6 +38,8 @@ centroid.addAll({ [Type.POINTS]: ($: PCLike, out?) => _centroid($.points, out), + [Type.PLANE]: ($: Plane, out?) => mulN(out || [], $.normal, $.w), + [Type.POLYGON]: ($: Polygon, out?) => centerOfWeight2($.points, out), [Type.RECT]: ($: AABBLike, out?) => maddN(out || [], $.pos, $.size, 0.5), diff --git a/packages/geom/src/ops/classify-point.ts b/packages/geom/src/ops/classify-point.ts index 1602260cf9..16b087ed3d 100644 --- a/packages/geom/src/ops/classify-point.ts +++ b/packages/geom/src/ops/classify-point.ts @@ -1,12 +1,9 @@ import { defmulti, MultiFn2O } from "@thi.ng/defmulti"; import { IShape, Type } from "@thi.ng/geom-api"; -import { - classifyPointInCircle, - classifyPointInTriangle2 -} from "@thi.ng/geom-isec"; -import { EPS } from "@thi.ng/math"; -import { ReadonlyVec } from "@thi.ng/vectors"; -import { Circle, Triangle } from "../api"; +import { classifyPointInCircle, classifyPointInTriangle2 } from "@thi.ng/geom-isec"; +import { EPS, sign } from "@thi.ng/math"; +import { dot, ReadonlyVec } from "@thi.ng/vectors"; +import { Circle, Plane, Triangle } from "../api"; import { dispatch } from "../internal/dispatch"; export const classifyPoint: MultiFn2O< @@ -17,9 +14,11 @@ export const classifyPoint: MultiFn2O< > = defmulti(dispatch); classifyPoint.addAll({ - [Type.CIRCLE]: ($: Circle, p: ReadonlyVec, eps = EPS) => + [Type.CIRCLE]: ($: Circle, p, eps = EPS) => classifyPointInCircle(p, $.pos, $.r, eps), + [Type.PLANE]: ($: Plane, p, eps) => sign(dot($.normal, p) - $.w, eps), + [Type.TRIANGLE]: ({ points }: Triangle, p: ReadonlyVec, eps = EPS) => classifyPointInTriangle2(p, points[0], points[1], points[2], eps) }); diff --git a/packages/geom/src/ops/closest-point.ts b/packages/geom/src/ops/closest-point.ts index d9740e8000..5b25605b4b 100644 --- a/packages/geom/src/ops/closest-point.ts +++ b/packages/geom/src/ops/closest-point.ts @@ -5,6 +5,7 @@ import { closestPointAABB, closestPointArray, closestPointCircle, + closestPointPlane, closestPointPolyline, closestPointRect, closestPointSegment @@ -23,6 +24,7 @@ import { Circle, Cubic, Line, + Plane, Quadratic, Rect } from "../api"; @@ -48,6 +50,9 @@ closestPoint.addAll({ [Type.LINE]: ({ points }: Line, p, out = []) => closestPointSegment(p, points[0], points[1], out), + [Type.PLANE]: ($: Plane, p, out = []) => + closestPointPlane(p, $.normal, $.w, out), + [Type.POINTS]: ($: PCLike, p, out) => set(out, closestPointArray(p, $.points)), diff --git a/packages/geom/src/ops/intersects.ts b/packages/geom/src/ops/intersects.ts index e0c8350134..be36eb5688 100644 --- a/packages/geom/src/ops/intersects.ts +++ b/packages/geom/src/ops/intersects.ts @@ -9,14 +9,24 @@ import { import { intersectCircleCircle, intersectLineLine, + intersectPlanePlane, intersectRayAABB, intersectRayCircle, + intersectRayPlane, intersectRayPolyline, intersectRayRect, testRectCircle, testRectRect } from "@thi.ng/geom-isec"; -import { AABB, Circle, Line, Ray, Rect, Sphere } from "../api"; +import { + AABB, + Circle, + Line, + Plane, + Ray, + Rect, + Sphere +} from "../api"; import { dispatch2 } from "../internal/dispatch"; export const intersects: MultiFn2O< @@ -33,12 +43,18 @@ intersects.addAll({ [`${Type.LINE}-${Type.LINE}`]: ({ points: a }: Line, { points: b }: Line) => intersectLineLine(a[0], a[1], b[0], b[1]), + [`${Type.PLANE}-${Type.PLANE}`]: (a: Plane, b: Plane) => + intersectPlanePlane(a.normal, a.w, b.normal, b.w), + [`${Type.RAY}-${Type.AABB}`]: (ray: Ray, box: AABB) => intersectRayAABB(ray.pos, ray.dir, box.pos, box.max()), [`${Type.RAY}-${Type.CIRCLE}`]: (ray: Ray, sphere: Sphere) => intersectRayCircle(ray.pos, ray.dir, sphere.pos, sphere.r), + [`${Type.RAY}-${Type.PLANE}`]: (ray: Ray, plane: Plane) => + intersectRayPlane(ray.pos, ray.dir, plane.normal, plane.w), + [`${Type.RAY}-${Type.POLYGON}`]: (ray: Ray, poly: PCLike) => intersectRayPolyline(ray.pos, ray.dir, poly.points, true), @@ -48,20 +64,14 @@ intersects.addAll({ [`${Type.RAY}-${Type.RECT}`]: (ray: Ray, rect: Rect) => intersectRayRect(ray.pos, ray.dir, rect.pos, rect.max()), - [`${Type.RECT}-${Type.CIRCLE}`]: ( - { pos: rp, size }: Rect, - { pos: cp, r }: Circle - ) => ({ - type: testRectCircle(rp, size, cp, r) + [`${Type.RECT}-${Type.CIRCLE}`]: (rect: Rect, circle: Circle) => ({ + type: testRectCircle(rect.pos, rect.size, circle.pos, circle.r) ? IntersectionType.INTERSECT : IntersectionType.NONE }), - [`${Type.RECT}-${Type.RECT}`]: ( - { pos: ap, size: as }: Rect, - { pos: bp, size: bs }: Rect - ) => ({ - type: testRectRect(ap, as, bp, bs) + [`${Type.RECT}-${Type.RECT}`]: (a: Rect, b: Rect) => ({ + type: testRectRect(a.pos, a.size, b.pos, b.size) ? IntersectionType.INTERSECT : IntersectionType.NONE }) diff --git a/packages/geom/src/ops/point-inside.ts b/packages/geom/src/ops/point-inside.ts index 1aa6b8b715..b74aba32bb 100644 --- a/packages/geom/src/ops/point-inside.ts +++ b/packages/geom/src/ops/point-inside.ts @@ -5,11 +5,19 @@ import { pointInCircle, pointInPolygon2, pointInRect, - pointInTriangle2, - pointInSegment2 + pointInSegment, + pointInTriangle2 } from "@thi.ng/geom-isec"; import { isInArray, ReadonlyVec, Vec } from "@thi.ng/vectors"; -import { AABB, Circle, Points, Polygon, Rect, Triangle, Line } from "../api"; +import { + AABB, + Circle, + Line, + Points, + Polygon, + Rect, + Triangle +} from "../api"; import { dispatch } from "../internal/dispatch"; export const pointInside = defmulti(dispatch); @@ -19,7 +27,7 @@ pointInside.addAll({ [Type.CIRCLE]: ($: Circle, p) => pointInCircle(p, $.pos, $.r), - [Type.LINE]: ($: Line, p) => pointInSegment2(p, $.points[0], $.points[1]), + [Type.LINE]: ($: Line, p) => pointInSegment(p, $.points[0], $.points[1]), [Type.POINTS]: ({ points }: Points, p) => isInArray(p, points), diff --git a/packages/geom/src/ops/volume.ts b/packages/geom/src/ops/volume.ts index 7024137fe3..a76c872c50 100644 --- a/packages/geom/src/ops/volume.ts +++ b/packages/geom/src/ops/volume.ts @@ -18,5 +18,5 @@ volume.add(DEFAULT, () => 0); volume.addAll({ [Type.AABB]: ({ size }: AABB) => size[0] * size[1] * size[2], - [Type.SPHERE]: ($: Sphere) => (4 / 3) * PI * Math.pow($.r, 3) + [Type.SPHERE]: ($: Sphere) => (4 / 3) * PI * $.r ** 3 }); diff --git a/packages/hdom-canvas/CHANGELOG.md b/packages/hdom-canvas/CHANGELOG.md index e33a2daa0a..87a4f41934 100644 --- a/packages/hdom-canvas/CHANGELOG.md +++ b/packages/hdom-canvas/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@2.0.17...@thi.ng/hdom-canvas@2.0.18) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/hdom-canvas + + + + + ## [2.0.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@2.0.16...@thi.ng/hdom-canvas@2.0.17) (2019-04-26) **Note:** Version bump only for package @thi.ng/hdom-canvas diff --git a/packages/hdom-canvas/package.json b/packages/hdom-canvas/package.json index 33028fbb6a..15468485bb 100644 --- a/packages/hdom-canvas/package.json +++ b/packages/hdom-canvas/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom-canvas", - "version": "2.0.17", + "version": "2.0.18", "description": "Declarative canvas scenegraph & visualization for @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -32,11 +32,11 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", - "@thi.ng/color": "^0.1.20", - "@thi.ng/diff": "^3.1.2", - "@thi.ng/hdom": "^7.2.7" + "@thi.ng/color": "^0.1.21", + "@thi.ng/diff": "^3.1.3", + "@thi.ng/hdom": "^7.2.8" }, "keywords": [ "ES6", diff --git a/packages/hdom-components/CHANGELOG.md b/packages/hdom-components/CHANGELOG.md index 986654afa5..e4eff1d24a 100644 --- a/packages/hdom-components/CHANGELOG.md +++ b/packages/hdom-components/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-components@3.0.19...@thi.ng/hdom-components@3.0.20) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/hdom-components + + + + + ## [3.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-components@3.0.18...@thi.ng/hdom-components@3.0.19) (2019-04-26) **Note:** Version bump only for package @thi.ng/hdom-components diff --git a/packages/hdom-components/package.json b/packages/hdom-components/package.json index 29a777e9b5..0c9bfbaac4 100644 --- a/packages/hdom-components/package.json +++ b/packages/hdom-components/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom-components", - "version": "3.0.19", + "version": "3.0.20", "description": "Raw, skinnable UI & SVG components for @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -32,11 +32,11 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", - "@thi.ng/math": "^1.2.3", - "@thi.ng/transducers": "^5.3.6", - "@thi.ng/transducers-stats": "^1.0.18", + "@thi.ng/math": "^1.3.0", + "@thi.ng/transducers": "^5.3.7", + "@thi.ng/transducers-stats": "^1.0.19", "@types/webgl2": "^0.0.4" }, "keywords": [ diff --git a/packages/hdom-mock/CHANGELOG.md b/packages/hdom-mock/CHANGELOG.md index 68c4719951..594ca1ce21 100644 --- a/packages/hdom-mock/CHANGELOG.md +++ b/packages/hdom-mock/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-mock@1.0.15...@thi.ng/hdom-mock@1.0.16) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/hdom-mock + + + + + ## [1.0.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-mock@1.0.14...@thi.ng/hdom-mock@1.0.15) (2019-04-26) **Note:** Version bump only for package @thi.ng/hdom-mock diff --git a/packages/hdom-mock/package.json b/packages/hdom-mock/package.json index 13c74345e9..621e750fdb 100644 --- a/packages/hdom-mock/package.json +++ b/packages/hdom-mock/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom-mock", - "version": "1.0.15", + "version": "1.0.16", "description": "Mock base implementation for @thi.ng/hdom API", "module": "./index.js", "main": "./lib/index.js", @@ -32,9 +32,9 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", - "@thi.ng/hdom": "^7.2.7" + "@thi.ng/hdom": "^7.2.8" }, "keywords": [ "ES6", diff --git a/packages/hdom/CHANGELOG.md b/packages/hdom/CHANGELOG.md index 095773cfd6..784d04b1b0 100644 --- a/packages/hdom/CHANGELOG.md +++ b/packages/hdom/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [7.2.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom@7.2.7...@thi.ng/hdom@7.2.8) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/hdom + + + + + ## [7.2.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom@7.2.6...@thi.ng/hdom@7.2.7) (2019-04-26) **Note:** Version bump only for package @thi.ng/hdom diff --git a/packages/hdom/package.json b/packages/hdom/package.json index 4510b94250..74a1095124 100644 --- a/packages/hdom/package.json +++ b/packages/hdom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom", - "version": "7.2.7", + "version": "7.2.8", "description": "Lightweight vanilla ES6 UI component trees with customizable branch-local behaviors", "module": "./index.js", "main": "./lib/index.js", @@ -24,7 +24,7 @@ "pub": "yarn build && yarn publish --access public" }, "devDependencies": { - "@thi.ng/atom": "^2.0.11", + "@thi.ng/atom": "^2.0.12", "@types/mocha": "^5.2.6", "@types/node": "^11.13.7", "mocha": "^6.1.4", @@ -33,12 +33,12 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", - "@thi.ng/diff": "^3.1.2", + "@thi.ng/diff": "^3.1.3", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/hiccup": "^3.1.8" + "@thi.ng/hiccup": "^3.1.9" }, "keywords": [ "browser", diff --git a/packages/heaps/CHANGELOG.md b/packages/heaps/CHANGELOG.md index 1e7a6cc86a..f558f70f2b 100644 --- a/packages/heaps/CHANGELOG.md +++ b/packages/heaps/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/heaps@1.0.9...@thi.ng/heaps@1.0.10) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/heaps + + + + + ## [1.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/heaps@1.0.8...@thi.ng/heaps@1.0.9) (2019-04-26) **Note:** Version bump only for package @thi.ng/heaps diff --git a/packages/heaps/package.json b/packages/heaps/package.json index f580160bfb..096c35cc1f 100644 --- a/packages/heaps/package.json +++ b/packages/heaps/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/heaps", - "version": "1.0.9", + "version": "1.0.10", "description": "Generic binary heap & d-ary heap implementations with customizable ordering", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/compare": "^1.0.6" }, "keywords": [ diff --git a/packages/hiccup-carbon-icons/CHANGELOG.md b/packages/hiccup-carbon-icons/CHANGELOG.md index ab5827221d..de62e2f84e 100644 --- a/packages/hiccup-carbon-icons/CHANGELOG.md +++ b/packages/hiccup-carbon-icons/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-carbon-icons@1.0.13...@thi.ng/hiccup-carbon-icons@1.0.14) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/hiccup-carbon-icons + + + + + ## [1.0.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-carbon-icons@1.0.12...@thi.ng/hiccup-carbon-icons@1.0.13) (2019-04-26) **Note:** Version bump only for package @thi.ng/hiccup-carbon-icons diff --git a/packages/hiccup-carbon-icons/package.json b/packages/hiccup-carbon-icons/package.json index 93d40dd525..c8c84a72e2 100644 --- a/packages/hiccup-carbon-icons/package.json +++ b/packages/hiccup-carbon-icons/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-carbon-icons", - "version": "1.0.13", + "version": "1.0.14", "description": "Full set of IBM's Carbon icons in hiccup format", "module": "./index.js", "main": "./lib/index.js", @@ -24,7 +24,7 @@ "pub": "yarn build && yarn publish --access public" }, "devDependencies": { - "@thi.ng/hiccup": "^3.1.8", + "@thi.ng/hiccup": "^3.1.9", "@types/mocha": "^5.2.6", "@types/node": "^11.13.7", "mocha": "^6.1.4", diff --git a/packages/hiccup-css/CHANGELOG.md b/packages/hiccup-css/CHANGELOG.md index 0095960404..0cf81cc1e0 100644 --- a/packages/hiccup-css/CHANGELOG.md +++ b/packages/hiccup-css/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@1.0.18...@thi.ng/hiccup-css@1.0.19) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/hiccup-css + + + + + ## [1.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@1.0.17...@thi.ng/hiccup-css@1.0.18) (2019-04-26) **Note:** Version bump only for package @thi.ng/hiccup-css diff --git a/packages/hiccup-css/package.json b/packages/hiccup-css/package.json index 3ff7352a62..09434db3bc 100644 --- a/packages/hiccup-css/package.json +++ b/packages/hiccup-css/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-css", - "version": "1.0.18", + "version": "1.0.19", "description": "CSS from nested JS data structures", "module": "./index.js", "main": "./lib/index.js", @@ -32,10 +32,10 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "clojure", diff --git a/packages/hiccup-markdown/CHANGELOG.md b/packages/hiccup-markdown/CHANGELOG.md index 09cd8f0237..d2501eb66e 100644 --- a/packages/hiccup-markdown/CHANGELOG.md +++ b/packages/hiccup-markdown/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-markdown@1.0.21...@thi.ng/hiccup-markdown@1.0.22) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/hiccup-markdown + + + + + ## [1.0.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-markdown@1.0.20...@thi.ng/hiccup-markdown@1.0.21) (2019-04-26) **Note:** Version bump only for package @thi.ng/hiccup-markdown diff --git a/packages/hiccup-markdown/package.json b/packages/hiccup-markdown/package.json index 60756864cc..09a0d3f9ec 100644 --- a/packages/hiccup-markdown/package.json +++ b/packages/hiccup-markdown/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-markdown", - "version": "1.0.21", + "version": "1.0.22", "description": "Markdown serialization of hiccup DOM trees", "module": "./index.js", "main": "./lib/index.js", @@ -32,14 +32,14 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/arrays": "^0.1.8", + "@thi.ng/arrays": "^0.1.9", "@thi.ng/checks": "^2.1.6", - "@thi.ng/defmulti": "^1.0.8", + "@thi.ng/defmulti": "^1.0.9", "@thi.ng/errors": "^1.0.6", - "@thi.ng/fsm": "^2.1.14", - "@thi.ng/hiccup": "^3.1.8", - "@thi.ng/strings": "^1.1.2", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/fsm": "^2.1.15", + "@thi.ng/hiccup": "^3.1.9", + "@thi.ng/strings": "^1.1.3", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "ES6", diff --git a/packages/hiccup-svg/CHANGELOG.md b/packages/hiccup-svg/CHANGELOG.md index ec03fd8f0b..e6fb484118 100644 --- a/packages/hiccup-svg/CHANGELOG.md +++ b/packages/hiccup-svg/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.1.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@3.1.21...@thi.ng/hiccup-svg@3.1.22) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/hiccup-svg + + + + + ## [3.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@3.1.20...@thi.ng/hiccup-svg@3.1.21) (2019-04-26) **Note:** Version bump only for package @thi.ng/hiccup-svg diff --git a/packages/hiccup-svg/package.json b/packages/hiccup-svg/package.json index aef257fcbf..65fbdddcd9 100644 --- a/packages/hiccup-svg/package.json +++ b/packages/hiccup-svg/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-svg", - "version": "3.1.21", + "version": "3.1.22", "description": "SVG element functions for @thi.ng/hiccup & @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -33,8 +33,8 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.6", - "@thi.ng/color": "^0.1.20", - "@thi.ng/hiccup": "^3.1.8" + "@thi.ng/color": "^0.1.21", + "@thi.ng/hiccup": "^3.1.9" }, "keywords": [ "components", diff --git a/packages/hiccup/CHANGELOG.md b/packages/hiccup/CHANGELOG.md index 205b556318..38dffcf1f5 100644 --- a/packages/hiccup/CHANGELOG.md +++ b/packages/hiccup/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.1.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup@3.1.8...@thi.ng/hiccup@3.1.9) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/hiccup + + + + + ## [3.1.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup@3.1.7...@thi.ng/hiccup@3.1.8) (2019-04-26) **Note:** Version bump only for package @thi.ng/hiccup diff --git a/packages/hiccup/package.json b/packages/hiccup/package.json index 22e96e226c..e7bfc84b75 100644 --- a/packages/hiccup/package.json +++ b/packages/hiccup/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup", - "version": "3.1.8", + "version": "3.1.9", "description": "HTML/SVG/XML serialization of nested data structures, iterables & closures", "module": "./index.js", "main": "./lib/index.js", @@ -24,7 +24,7 @@ "pub": "yarn build && yarn publish --access public" }, "devDependencies": { - "@thi.ng/atom": "^2.0.11", + "@thi.ng/atom": "^2.0.12", "@types/mocha": "^5.2.6", "@types/node": "^11.13.7", "mocha": "^6.1.4", diff --git a/packages/iges/CHANGELOG.md b/packages/iges/CHANGELOG.md index c3ff8e1ac2..8a88fdeeac 100644 --- a/packages/iges/CHANGELOG.md +++ b/packages/iges/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/iges@1.1.3...@thi.ng/iges@1.1.4) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/iges + + + + + ## [1.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/iges@1.1.2...@thi.ng/iges@1.1.3) (2019-04-26) **Note:** Version bump only for package @thi.ng/iges diff --git a/packages/iges/package.json b/packages/iges/package.json index bfe4144344..8c032ba713 100644 --- a/packages/iges/package.json +++ b/packages/iges/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/iges", - "version": "1.1.3", + "version": "1.1.4", "description": "IGES 5.3 serializer for (currently only) polygonal geometry, both open & closed", "module": "./index.js", "main": "./lib/index.js", @@ -32,11 +32,11 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", - "@thi.ng/defmulti": "^1.0.8", - "@thi.ng/strings": "^1.1.2", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/defmulti": "^1.0.9", + "@thi.ng/strings": "^1.1.3", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "CAD", diff --git a/packages/interceptors/CHANGELOG.md b/packages/interceptors/CHANGELOG.md index 19b84606e0..affc8ed65d 100644 --- a/packages/interceptors/CHANGELOG.md +++ b/packages/interceptors/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/interceptors@2.0.11...@thi.ng/interceptors@2.0.12) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/interceptors + + + + + ## [2.0.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/interceptors@2.0.10...@thi.ng/interceptors@2.0.11) (2019-04-26) **Note:** Version bump only for package @thi.ng/interceptors diff --git a/packages/interceptors/package.json b/packages/interceptors/package.json index b976302887..7750f06f7a 100644 --- a/packages/interceptors/package.json +++ b/packages/interceptors/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/interceptors", - "version": "2.0.11", + "version": "2.0.12", "description": "Interceptor based event bus, side effect & immutable state handling", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/atom": "^2.0.11", + "@thi.ng/api": "^6.2.0", + "@thi.ng/atom": "^2.0.12", "@thi.ng/checks": "^2.1.6", "@thi.ng/errors": "^1.0.6", "@thi.ng/paths": "^2.0.9" diff --git a/packages/intervals/CHANGELOG.md b/packages/intervals/CHANGELOG.md index 8685ce82fa..5a9a2338da 100644 --- a/packages/intervals/CHANGELOG.md +++ b/packages/intervals/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/intervals@1.0.8...@thi.ng/intervals@1.0.9) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/intervals + + + + + ## [1.0.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/intervals@1.0.7...@thi.ng/intervals@1.0.8) (2019-04-26) **Note:** Version bump only for package @thi.ng/intervals diff --git a/packages/intervals/package.json b/packages/intervals/package.json index dfd3e4325f..f35decd56e 100644 --- a/packages/intervals/package.json +++ b/packages/intervals/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/intervals", - "version": "1.0.8", + "version": "1.0.9", "description": "Closed/open/semi-open interval data type, queries & operations", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/errors": "^1.0.6" }, "keywords": [ diff --git a/packages/iterators/CHANGELOG.md b/packages/iterators/CHANGELOG.md index 2db122e8c2..ebc83f5669 100644 --- a/packages/iterators/CHANGELOG.md +++ b/packages/iterators/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/iterators@5.0.18...@thi.ng/iterators@5.0.19) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/iterators + + + + + ## [5.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/iterators@5.0.17...@thi.ng/iterators@5.0.18) (2019-04-26) **Note:** Version bump only for package @thi.ng/iterators diff --git a/packages/iterators/package.json b/packages/iterators/package.json index 4720132698..94833229b9 100644 --- a/packages/iterators/package.json +++ b/packages/iterators/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/iterators", - "version": "5.0.18", + "version": "5.0.19", "description": "clojure.core inspired, composable ES6 iterators & generators", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/dcons": "^2.0.18", + "@thi.ng/api": "^6.2.0", + "@thi.ng/dcons": "^2.0.19", "@thi.ng/errors": "^1.0.6" }, "keywords": [ diff --git a/packages/lsys/CHANGELOG.md b/packages/lsys/CHANGELOG.md index d2aa791d79..852da2fe09 100644 --- a/packages/lsys/CHANGELOG.md +++ b/packages/lsys/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/lsys@0.2.13...@thi.ng/lsys@0.2.14) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/lsys + + + + + ## [0.2.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/lsys@0.2.12...@thi.ng/lsys@0.2.13) (2019-04-26) **Note:** Version bump only for package @thi.ng/lsys diff --git a/packages/lsys/package.json b/packages/lsys/package.json index ceefbf729b..340258035f 100644 --- a/packages/lsys/package.json +++ b/packages/lsys/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/lsys", - "version": "0.2.13", + "version": "0.2.14", "description": "Functional, extensible L-System architecture w/ support for probabilistic rules", "module": "./index.js", "main": "./lib/index.js", @@ -32,13 +32,13 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/compose": "^1.2.4", + "@thi.ng/api": "^6.2.0", + "@thi.ng/compose": "^1.2.5", "@thi.ng/errors": "^1.0.6", - "@thi.ng/math": "^1.2.3", - "@thi.ng/random": "^1.1.6", - "@thi.ng/transducers": "^5.3.6", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/math": "^1.3.0", + "@thi.ng/random": "^1.1.7", + "@thi.ng/transducers": "^5.3.7", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "axiom", diff --git a/packages/malloc/CHANGELOG.md b/packages/malloc/CHANGELOG.md index 4963c61689..c8a5d06c57 100644 --- a/packages/malloc/CHANGELOG.md +++ b/packages/malloc/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [3.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/malloc@2.0.10...@thi.ng/malloc@3.0.0) (2019-05-22) + + +### Code Refactoring + +* **malloc:** remove Type enum, SIZEOF ([b26df6d](https://github.com/thi-ng/umbrella/commit/b26df6d)) + + +### BREAKING CHANGES + +* **malloc:** remove Type enum, SIZEOF, migrated to @thi.ng/api + + + + + ## [2.0.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/malloc@2.0.9...@thi.ng/malloc@2.0.10) (2019-04-26) **Note:** Version bump only for package @thi.ng/malloc diff --git a/packages/malloc/README.md b/packages/malloc/README.md index 111d8aca47..9b3f7e3c9d 100644 --- a/packages/malloc/README.md +++ b/packages/malloc/README.md @@ -63,7 +63,8 @@ yarn add @thi.ng/malloc ## Usage examples ```ts -import { MemPool, Type } from "@thi.ng/malloc"; +import { Type } from "@thi.ng/api"; +import { MemPool } from "@thi.ng/malloc"; // create memory w/ optional start allocation address // (start address can't be zero, reserved for malloc/calloc failure) @@ -161,7 +162,9 @@ Similar to `malloc()`, but returns a typed array view of desired `type` and instead of byte size, expects number of elements. Returns `null`, if allocation failed. -Types are referred to via the `Type` enum, e.g. `Type.F64`: +Types are referred to via the `Type` enum in the base +[@thi.ng/api](https://github.com/thi-ng/umbrella/tree/master/packages/api/src/api.ts) +package, e.g. `Type.F64`: `U8`, `U8C`, `I8`, `U16`, `I16`, `U32`, `I32`, `F32`, `F64` diff --git a/packages/malloc/package.json b/packages/malloc/package.json index bd09ee7334..f5b36ac87c 100644 --- a/packages/malloc/package.json +++ b/packages/malloc/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/malloc", - "version": "2.0.10", + "version": "3.0.0", "description": "ArrayBuffer based malloc() impl for hybrid JS/WASM use cases, based on thi.ng/tinyalloc", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/binary": "^1.0.6", "@thi.ng/checks": "^2.1.6", "@thi.ng/errors": "^1.0.6" diff --git a/packages/malloc/src/api.ts b/packages/malloc/src/api.ts index b7934fd423..96a3fb3ab5 100644 --- a/packages/malloc/src/api.ts +++ b/packages/malloc/src/api.ts @@ -1,28 +1,4 @@ -import { IRelease, TypedArray } from "@thi.ng/api"; - -export const enum Type { - U8, - U8C, - I8, - U16, - I16, - U32, - I32, - F32, - F64 -} - -export const SIZEOF = { - [Type.U8]: 1, - [Type.U8C]: 1, - [Type.I8]: 1, - [Type.U16]: 2, - [Type.I16]: 2, - [Type.U32]: 4, - [Type.I32]: 4, - [Type.F32]: 4, - [Type.F64]: 8 -}; +import { IRelease, Type, TypedArray } from "@thi.ng/api"; export interface MemBlock { addr: number; diff --git a/packages/malloc/src/pool.ts b/packages/malloc/src/pool.ts index e6e22d46cf..9df1be4e2e 100644 --- a/packages/malloc/src/pool.ts +++ b/packages/malloc/src/pool.ts @@ -1,4 +1,4 @@ -import { TypedArray } from "@thi.ng/api"; +import { SIZEOF, Type, TypedArray } from "@thi.ng/api"; import { align } from "@thi.ng/binary"; import { isNumber } from "@thi.ng/checks"; import { illegalArgs } from "@thi.ng/errors"; @@ -6,9 +6,7 @@ import { IMemPool, MemBlock, MemPoolOpts, - MemPoolStats, - SIZEOF, - Type + MemPoolStats } from "./api"; import { wrap } from "./wrap"; diff --git a/packages/malloc/src/wrap.ts b/packages/malloc/src/wrap.ts index f645406172..1070ef5043 100644 --- a/packages/malloc/src/wrap.ts +++ b/packages/malloc/src/wrap.ts @@ -1,5 +1,5 @@ -import { IObjectOf } from "@thi.ng/api"; -import { BlockCtor, Type } from "./api"; +import { IObjectOf, Type } from "@thi.ng/api"; +import { BlockCtor } from "./api"; const CTORS: IObjectOf = { [Type.U8]: (buf, addr, num) => new Uint8Array(buf, addr, num), diff --git a/packages/malloc/test/index.ts b/packages/malloc/test/index.ts index aa1a0f55c8..e26dd6681c 100644 --- a/packages/malloc/test/index.ts +++ b/packages/malloc/test/index.ts @@ -1,8 +1,8 @@ +import { Type } from "@thi.ng/api"; import * as assert from "assert"; -import { MemPool, Type } from "../src/index"; +import { MemPool } from "../src/index"; describe("malloc", () => { - let pool: MemPool; beforeEach(() => { @@ -22,8 +22,12 @@ describe("malloc", () => { assert.equal(p.top, 0x10); assert.equal(p.end, 0x80); assert.throws(() => new MemPool({ size: 0x100, start: 0x0, end: 0x0 })); - assert.throws(() => new MemPool({ size: 0x100, start: 0x100, end: 0x200 })); - assert.throws(() => new MemPool({ size: 0x100, start: 0x80, end: 0x0 })); + assert.throws( + () => new MemPool({ size: 0x100, start: 0x100, end: 0x200 }) + ); + assert.throws( + () => new MemPool({ size: 0x100, start: 0x80, end: 0x0 }) + ); }); it("malloc / free", () => { @@ -115,16 +119,13 @@ describe("malloc", () => { assert.equal(stats.top, 8, "top9"); pool.freeAll(); - assert.deepEqual( - pool.stats(), - { - free: { count: 0, size: 0 }, - used: { count: 0, size: 0 }, - available: pool.buf.byteLength - 8, - total: pool.buf.byteLength, - top: 8, - } - ); + assert.deepEqual(pool.stats(), { + free: { count: 0, size: 0 }, + used: { count: 0, size: 0 }, + available: pool.buf.byteLength - 8, + total: pool.buf.byteLength, + top: 8 + }); pool.release(); }); @@ -147,23 +148,20 @@ describe("malloc", () => { assert.equal(b.byteLength, 24, "b bytes"); a.set([1, 2, 3]); b.set([10, 20, 30]); - assert.deepEqual( - new Uint32Array(pool.buf, 8, 10), - [ - // a - 0x3f800000, - 0x40000000, - 0x40400000, - 0, - // b - 0, - 0x40240000, - 0, - 0x40340000, - 0, - 0x403e0000 - ] - ); + assert.deepEqual(new Uint32Array(pool.buf, 8, 10), [ + // a + 0x3f800000, + 0x40000000, + 0x40400000, + 0, + // b + 0, + 0x40240000, + 0, + 0x40340000, + 0, + 0x403e0000 + ]); assert(pool.free(a), "free a"); assert(pool.free(b), "free b"); assert(!pool.free(a), "free a (repeat)"); @@ -175,10 +173,7 @@ describe("malloc", () => { const u8 = (pool).u8; u8.fill(0xff); let a = pool.calloc(6); - assert.deepEqual( - u8.subarray(a, a + 9), - [0, 0, 0, 0, 0, 0, 0, 0, 0xff] - ); + assert.deepEqual(u8.subarray(a, a + 9), [0, 0, 0, 0, 0, 0, 0, 0, 0xff]); }); it("callocAs", () => { @@ -206,7 +201,11 @@ describe("malloc", () => { pool.free(b); pool.free(d); assert.equal(pool.malloc(pool.buf.byteLength - d + 1), 0, "malloc top"); - assert.equal(pool.mallocAs(Type.U8, pool.buf.byteLength - d + 1), null, "mallocAs top"); + assert.equal( + pool.mallocAs(Type.U8, pool.buf.byteLength - d + 1), + null, + "mallocAs top" + ); pool.free(c); }); diff --git a/packages/math/CHANGELOG.md b/packages/math/CHANGELOG.md index a68f146d28..b1c2310060 100644 --- a/packages/math/CHANGELOG.md +++ b/packages/math/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/math@1.2.3...@thi.ng/math@1.3.0) (2019-05-22) + + +### Features + +* **math:** add extrema & crossing fns and Crossing enum ([e102f39](https://github.com/thi-ng/umbrella/commit/e102f39)) +* **math:** add sigmoid / sigmoid11 fns ([3f085a3](https://github.com/thi-ng/umbrella/commit/3f085a3)) + + + + + ## [1.2.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/math@1.2.2...@thi.ng/math@1.2.3) (2019-04-24) **Note:** Version bump only for package @thi.ng/math diff --git a/packages/math/package.json b/packages/math/package.json index e47b6ab641..cac18cf389 100644 --- a/packages/math/package.json +++ b/packages/math/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/math", - "version": "1.2.3", + "version": "1.3.0", "description": "Assorted common math functions & utilities", "module": "./index.js", "main": "./lib/index.js", diff --git a/packages/math/src/api.ts b/packages/math/src/api.ts index f073b73a55..dfbd29efab 100644 --- a/packages/math/src/api.ts +++ b/packages/math/src/api.ts @@ -24,3 +24,23 @@ export const TWO_THIRD = 2 / 3; export const SIXTH = 1 / 6; export let EPS = 1e-6; + +export const enum Crossing { + /** + * lines A & B are equal + */ + EQUAL = 0, + /** + * lines A & B are flat (all same values) + */ + FLAT, + /** + * line A crossed under B + */ + UNDER, + /** + * line A crossed over B + */ + OVER, + OTHER +} diff --git a/packages/math/src/crossing.ts b/packages/math/src/crossing.ts new file mode 100644 index 0000000000..c223ecb645 --- /dev/null +++ b/packages/math/src/crossing.ts @@ -0,0 +1,72 @@ +import { Crossing, EPS } from "./api"; +import { eqDelta } from "./eqdelta"; + +/** + * Returns true if line A rises up over B. + * + * ``` + * b1 a2 + * \/ + * /\ + * a1 b2 + * ``` + * + * @param a1 + * @param a2 + * @param b1 + * @param b2 + */ +export const isCrossOver = (a1: number, a2: number, b1: number, b2: number) => + a1 < b1 && a2 > b2; + +/** + * Returns true if line A rises up over B. + * + * ``` + * a1 b2 + * \/ + * /\ + * b1 a2 + * ``` + * + * @param a1 + * @param a2 + * @param b1 + * @param b2 + */ +export const isCrossUnder = (a1: number, a2: number, b1: number, b2: number) => + a1 > b1 && a2 < b2; + +/** + * Returns `Crossing` classifier indicating the relationship of line A + * to line B. The optional epsilon value is used to determine if both + * lines are considered equal or flat. + * + * @see isCrossUp + * @see isCrossDown + * @see Crossing + * + * @param a1 + * @param a2 + * @param b1 + * @param b2 + * @param eps + */ +export const classifyCrossing = ( + a1: number, + a2: number, + b1: number, + b2: number, + eps = EPS +) => { + if (isCrossOver(a1, a2, b1, b2)) { + return Crossing.OVER; + } else if (isCrossUnder(a1, a2, b1, b2)) { + return Crossing.UNDER; + } + return eqDelta(a1, b1, eps) && eqDelta(a2, b2, eps) + ? eqDelta(a1, b2, eps) + ? Crossing.FLAT + : Crossing.EQUAL + : Crossing.OTHER; +}; diff --git a/packages/math/src/extrema.ts b/packages/math/src/extrema.ts new file mode 100644 index 0000000000..41b11baffa --- /dev/null +++ b/packages/math/src/extrema.ts @@ -0,0 +1,94 @@ +/** + * Returns true if `b` is a local minima, i.e. iff a > b and b < c. + * + * @param a + * @param b + * @param c + */ +export const isMinima = (a: number, b: number, c: number) => a > b && b < c; + +/** + * Returns true if `b` is a local maxima, i.e. iff a < b and b > c. + * + * @param a + * @param b + * @param c + */ +export const isMaxima = (a: number, b: number, c: number) => a < b && b > c; + +const index = ( + pred: (a: number, b: number, c: number) => boolean, + values: number[], + from = 0, + to = values.length +) => { + to--; + for (let i = from + 1; i < to; i++) { + if (pred(values[i - 1], values[i], values[i + 1])) { + return i; + } + } + return -1; +}; + +/** + * Returns index of the first local & internal minima found in given + * `values` array, or -1 if no such minima exists. The search range can + * be optionally defined via semi-open [from, to) index interval. + * + * @param values + * @param from + * @param to + */ +export const minimaIndex = (values: number[], from = 0, to = values.length) => + index(isMinima, values, from, to); + +/** + * Returns index of the first local & internal maxima found in given + * `values` array, or -1 if no such maxima exists. The search range can + * be optionally defined via semi-open [from, to) index interval. + * + * @param values + * @param from + * @param to + */ +export const maximaIndex = (values: number[], from = 0, to = values.length) => + index(isMaxima, values, from, to); + +function* indices( + fn: (a: number[], from: number, to: number) => number, + vals: number[], + from = 0, + to = vals.length +) { + while (from < to) { + const i = fn(vals, from, to); + if (i < 0) return; + yield i; + from = i + 1; + } +} + +/** + * Returns an iterator yielding all minima indices in given `values` + * array. The search range can be optionally defined via semi-open + * [from, to) index interval. + * + * @param values + * @param from + * @param to + */ +export const minimaIndices = (values: number[], from = 0, to = values.length) => + indices(minimaIndex, values, from, to); + +/** + * Returns an iterator yielding all maxima indices in given `values` + * array. The search range can be optionally defined via semi-open + * [from, to) index interval. + * + * @param values + * @param from + * @param to + */ +export const maximaIndices = (values: number[], from = 0, to = values.length) => + indices(minimaIndex, values, from, to); diff --git a/packages/math/src/index.ts b/packages/math/src/index.ts index ce155f0b8c..1dc77b0c1e 100644 --- a/packages/math/src/index.ts +++ b/packages/math/src/index.ts @@ -1,7 +1,9 @@ export * from "./api"; export * from "./abs"; export * from "./angle"; +export * from "./crossing"; export * from "./eqdelta"; +export * from "./extrema"; export * from "./fit"; export * from "./interval"; export * from "./min-error"; diff --git a/packages/math/src/mix.ts b/packages/math/src/mix.ts index 161d13bffa..14d8d7520f 100644 --- a/packages/math/src/mix.ts +++ b/packages/math/src/mix.ts @@ -1,4 +1,4 @@ -import { PI, HALF_PI } from "./api"; +import { HALF_PI, PI } from "./api"; export const mix = (a: number, b: number, t: number) => a + (b - a) * t; @@ -59,7 +59,7 @@ export const circular = (t: number) => { return Math.sqrt(1 - t * t); }; -export const cosine = (t: number): number => 1 - (Math.cos(t * PI) * 0.5 + 0.5); +export const cosine = (t: number) => 1 - (Math.cos(t * PI) * 0.5 + 0.5); export const decimated = (n: number, t: number) => Math.floor(t * n) / n; @@ -105,3 +105,20 @@ export const sinc = (k: number, t: number) => { t = PI * (k * t - 1.0); return Math.sin(t) / t; }; + +/** + * Sigmoid function for inputs in [0..1] interval. + * + * @param k + * @param t + */ +export const sigmoid = (k: number, t: number) => + 1 / (1 + Math.exp(-k * (2 * t - 1))); + +/** + * Sigmoid function for inputs in [-1..+1] interval. + * + * @param k + * @param t + */ +export const sigmoid11 = (k: number, t: number) => 1 / (1 + Math.exp(-k * t)); diff --git a/packages/matrices/CHANGELOG.md b/packages/matrices/CHANGELOG.md index b366fb27b1..40b295ff9a 100644 --- a/packages/matrices/CHANGELOG.md +++ b/packages/matrices/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/matrices@0.3.4...@thi.ng/matrices@0.4.0) (2019-05-22) + + +### Features + +* **matrices:** add outerProduct for vec 2/3/4 ([2a9d076](https://github.com/thi-ng/umbrella/commit/2a9d076)) + + + + + ## [0.3.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/matrices@0.3.3...@thi.ng/matrices@0.3.4) (2019-04-26) **Note:** Version bump only for package @thi.ng/matrices diff --git a/packages/matrices/package.json b/packages/matrices/package.json index 13e0973116..7a3b553aba 100644 --- a/packages/matrices/package.json +++ b/packages/matrices/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/matrices", - "version": "0.3.4", + "version": "0.4.0", "description": "Matrix & quaternion operations for 2D/3D geometry processing", "module": "./index.js", "main": "./lib/index.js", @@ -32,10 +32,10 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", - "@thi.ng/math": "^1.2.3", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/math": "^1.3.0", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2D", diff --git a/packages/matrices/src/index.ts b/packages/matrices/src/index.ts index 7094100dc8..bd8dedb168 100644 --- a/packages/matrices/src/index.ts +++ b/packages/matrices/src/index.ts @@ -28,6 +28,7 @@ export * from "./mulq"; export * from "./mulv"; export * from "./normal-mat"; export * from "./ortho"; +export * from "./outer-product"; export * from "./perspective"; export * from "./project"; export * from "./quat-axis-angle"; diff --git a/packages/matrices/src/outer-product.ts b/packages/matrices/src/outer-product.ts new file mode 100644 index 0000000000..507585da05 --- /dev/null +++ b/packages/matrices/src/outer-product.ts @@ -0,0 +1,63 @@ +import { + MultiVecOpVV, + ReadonlyVec, + setC, + setC4, + vop +} from "@thi.ng/vectors"; +import { Mat } from "./api"; + +/** + * Computes outer/tensor product of vectors `u` and `v`. Returns square + * matrix of same dimensions as vectors, e.g. 3x3 matrix for 3D vectors. + * + * https://en.wikipedia.org/wiki/Outer_product + */ +export const outerProduct: MultiVecOpVV = vop(1); + +export const outerProduct2 = outerProduct.add( + 2, + (out: Mat, [ux, uy]: ReadonlyVec, [vx, vy]: ReadonlyVec) => + setC4(out || [], ux * vx, uy * vx, ux * vy, uy * vy) +); + +export const outerProduct3 = outerProduct.add( + 3, + (out: Mat, [ux, uy, uz]: ReadonlyVec, [vx, vy, vz]: ReadonlyVec) => + setC( + out || [], + ux * vx, + uy * vx, + uz * vx, + ux * vy, + uy * vy, + uz * vy, + ux * vz, + uy * vz, + uz * vz + ) +); + +export const outerProduct4 = outerProduct.add( + 4, + (out: Mat, [ux, uy, uz, uw]: ReadonlyVec, [vx, vy, vz, vw]: ReadonlyVec) => + setC( + out || [], + ux * vx, + uy * vx, + uz * vx, + uw * vx, + ux * vy, + uy * vy, + uz * vy, + uw * vy, + ux * vz, + uy * vz, + uz * vz, + uw * vz, + ux * vw, + uy * vw, + uz * vw, + uw * vw + ) +); diff --git a/packages/memoize/CHANGELOG.md b/packages/memoize/CHANGELOG.md index 3f9e445ca9..38cd7719fb 100644 --- a/packages/memoize/CHANGELOG.md +++ b/packages/memoize/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/memoize@1.0.8...@thi.ng/memoize@1.0.9) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/memoize + + + + + ## [1.0.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/memoize@1.0.7...@thi.ng/memoize@1.0.8) (2019-04-26) **Note:** Version bump only for package @thi.ng/memoize diff --git a/packages/memoize/package.json b/packages/memoize/package.json index 8201127f56..7d7a5a78a4 100644 --- a/packages/memoize/package.json +++ b/packages/memoize/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/memoize", - "version": "1.0.8", + "version": "1.0.9", "description": "Function memoization with configurable caches", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1" + "@thi.ng/api": "^6.2.0" }, "keywords": [ "cache", diff --git a/packages/morton/CHANGELOG.md b/packages/morton/CHANGELOG.md index 8929eae8ad..2326f10489 100644 --- a/packages/morton/CHANGELOG.md +++ b/packages/morton/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/morton@1.0.8...@thi.ng/morton@1.0.9) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/morton + + + + + ## [1.0.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/morton@1.0.7...@thi.ng/morton@1.0.8) (2019-04-24) **Note:** Version bump only for package @thi.ng/morton diff --git a/packages/morton/package.json b/packages/morton/package.json index 9178d1b52d..8da72601a7 100644 --- a/packages/morton/package.json +++ b/packages/morton/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/morton", - "version": "1.0.8", + "version": "1.0.9", "description": "Z-order-curve / Morton encoding & decoding for 1D, 2D, 3D", "module": "./index.js", "main": "./lib/index.js", @@ -34,7 +34,7 @@ "dependencies": { "@thi.ng/binary": "^1.0.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/math": "^1.2.3" + "@thi.ng/math": "^1.3.0" }, "keywords": [ "binary", diff --git a/packages/pointfree-lang/CHANGELOG.md b/packages/pointfree-lang/CHANGELOG.md index 195b9a7dfd..bee369698d 100644 --- a/packages/pointfree-lang/CHANGELOG.md +++ b/packages/pointfree-lang/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree-lang@1.0.13...@thi.ng/pointfree-lang@1.0.14) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/pointfree-lang + + + + + ## [1.0.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree-lang@1.0.12...@thi.ng/pointfree-lang@1.0.13) (2019-04-26) **Note:** Version bump only for package @thi.ng/pointfree-lang diff --git a/packages/pointfree-lang/package.json b/packages/pointfree-lang/package.json index 78c20d960e..07c8e80cf3 100644 --- a/packages/pointfree-lang/package.json +++ b/packages/pointfree-lang/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/pointfree-lang", - "version": "1.0.13", + "version": "1.0.14", "description": "Forth style syntax layer/compiler for the @thi.ng/pointfree DSL", "module": "./index.js", "main": "./lib/index.js", @@ -34,9 +34,9 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/errors": "^1.0.6", - "@thi.ng/pointfree": "^1.0.13" + "@thi.ng/pointfree": "^1.0.14" }, "keywords": [ "concatenative", diff --git a/packages/pointfree/CHANGELOG.md b/packages/pointfree/CHANGELOG.md index d85f338734..b4140ef3dd 100644 --- a/packages/pointfree/CHANGELOG.md +++ b/packages/pointfree/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree@1.0.13...@thi.ng/pointfree@1.0.14) (2019-05-22) + + +### Bug Fixes + +* **pointfree:** update safeMode handling ([d27bcba](https://github.com/thi-ng/umbrella/commit/d27bcba)) + + + + + ## [1.0.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree@1.0.12...@thi.ng/pointfree@1.0.13) (2019-04-26) **Note:** Version bump only for package @thi.ng/pointfree diff --git a/packages/pointfree/package.json b/packages/pointfree/package.json index 865cf6e078..23c3c7bd9f 100644 --- a/packages/pointfree/package.json +++ b/packages/pointfree/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/pointfree", - "version": "1.0.13", + "version": "1.0.14", "description": "Pointfree functional composition / Forth style stack execution engine", "module": "./index.js", "main": "./lib/index.js", @@ -32,9 +32,9 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", - "@thi.ng/compose": "^1.2.4", + "@thi.ng/compose": "^1.2.5", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6" }, diff --git a/packages/pointfree/src/index.ts b/packages/pointfree/src/index.ts index b0871b7b8f..db18588d25 100644 --- a/packages/pointfree/src/index.ts +++ b/packages/pointfree/src/index.ts @@ -17,9 +17,18 @@ import { StackProgram } from "./api"; -let SAFE = true; +let $: (stack: Stack, n: number) => void; +let $n: (m: number, n: number) => void; -export const safeMode = (state: boolean) => (SAFE = state); +export const safeMode = (state: boolean) => { + if (state) { + $n = (m: number, n: number) => m < n && illegalState(`stack underflow`); + $ = (stack: Stack, n: number) => $n(stack.length, n); + } else { + $ = $n = NO_OP; + } +}; +safeMode(true); /** * Executes program / quotation with given stack context (initial D/R @@ -86,14 +95,6 @@ export const ctx = (stack: Stack = [], env: StackEnv = {}): StackContext => [ env ]; -const $n = SAFE - ? (m: number, n: number) => m < n && illegalState(`stack underflow`) - : NO_OP; - -const $ = SAFE ? (stack: Stack, n: number) => $n(stack.length, n) : NO_OP; - -export { $ as ensureStack, $n as ensureStackN }; - const $stackFn = (f: StackProc) => (isArray(f) ? word(f) : f); const tos = (stack: Stack) => stack[stack.length - 1]; @@ -1061,7 +1062,7 @@ export const keep = word([over, [exec], dip]); export const keep2 = word([[dup2], dip, dip2]); /** - * Call a quotation with two values on the stack, restoring the values + * Call a quotation with three values on the stack, restoring the values * after quotation finished. * * ( x y z q -- .. x y z ) @@ -1809,3 +1810,5 @@ export const printds = (ctx: StackContext) => (console.log(ctx[0]), ctx); export const printrs = (ctx: StackContext) => (console.log(ctx[1]), ctx); export * from "./api"; + +export { $ as ensureStack, $n as ensureStackN }; diff --git a/packages/poisson/CHANGELOG.md b/packages/poisson/CHANGELOG.md index 0a7776b745..d0232dc831 100644 --- a/packages/poisson/CHANGELOG.md +++ b/packages/poisson/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/poisson@0.2.15...@thi.ng/poisson@0.2.16) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/poisson + + + + + ## [0.2.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/poisson@0.2.14...@thi.ng/poisson@0.2.15) (2019-04-26) **Note:** Version bump only for package @thi.ng/poisson diff --git a/packages/poisson/package.json b/packages/poisson/package.json index 37852cb340..44d3120361 100644 --- a/packages/poisson/package.json +++ b/packages/poisson/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/poisson", - "version": "0.2.15", + "version": "0.2.16", "description": "nD Poisson-disc sampling w/ support for spatial density functions and custom PRNGs", "module": "./index.js", "main": "./lib/index.js", @@ -33,9 +33,9 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.6", - "@thi.ng/geom-api": "^0.2.2", - "@thi.ng/random": "^1.1.6", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/geom-api": "^0.2.3", + "@thi.ng/random": "^1.1.7", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "2d", diff --git a/packages/random/CHANGELOG.md b/packages/random/CHANGELOG.md index 2d91d2feec..b9a50a47cf 100644 --- a/packages/random/CHANGELOG.md +++ b/packages/random/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.1.6...@thi.ng/random@1.1.7) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/random + + + + + ## [1.1.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.1.5...@thi.ng/random@1.1.6) (2019-04-26) **Note:** Version bump only for package @thi.ng/random diff --git a/packages/random/package.json b/packages/random/package.json index 5e7eeedd00..9f518eedeb 100644 --- a/packages/random/package.json +++ b/packages/random/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/random", - "version": "1.1.6", + "version": "1.1.7", "description": "Pseudo-random number generators w/ unified API", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1" + "@thi.ng/api": "^6.2.0" }, "keywords": [ "ES6", diff --git a/packages/range-coder/CHANGELOG.md b/packages/range-coder/CHANGELOG.md index 5c230327ab..7cc48fd6e1 100644 --- a/packages/range-coder/CHANGELOG.md +++ b/packages/range-coder/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/range-coder@1.0.18...@thi.ng/range-coder@1.0.19) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/range-coder + + + + + ## [1.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/range-coder@1.0.17...@thi.ng/range-coder@1.0.18) (2019-04-26) **Note:** Version bump only for package @thi.ng/range-coder diff --git a/packages/range-coder/package.json b/packages/range-coder/package.json index 689c94c6b6..f2ecbeac74 100644 --- a/packages/range-coder/package.json +++ b/packages/range-coder/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/range-coder", - "version": "1.0.18", + "version": "1.0.19", "description": "Binary data range encoder / decoder", "module": "./index.js", "main": "./lib/index.js", @@ -24,7 +24,7 @@ "pub": "yarn build && yarn publish --access public" }, "devDependencies": { - "@thi.ng/transducers": "^5.3.6", + "@thi.ng/transducers": "^5.3.7", "@types/mocha": "^5.2.6", "@types/node": "^11.13.7", "mocha": "^6.1.4", diff --git a/packages/resolve-map/CHANGELOG.md b/packages/resolve-map/CHANGELOG.md index 77c498bf8b..3e5f87e10e 100644 --- a/packages/resolve-map/CHANGELOG.md +++ b/packages/resolve-map/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/resolve-map@4.0.11...@thi.ng/resolve-map@4.0.12) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/resolve-map + + + + + ## [4.0.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/resolve-map@4.0.10...@thi.ng/resolve-map@4.0.11) (2019-04-26) **Note:** Version bump only for package @thi.ng/resolve-map diff --git a/packages/resolve-map/package.json b/packages/resolve-map/package.json index e07572da6a..950ec982f6 100644 --- a/packages/resolve-map/package.json +++ b/packages/resolve-map/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/resolve-map", - "version": "4.0.11", + "version": "4.0.12", "description": "DAG resolution of vanilla objects & arrays with internally linked values", "module": "./index.js", "main": "./lib/index.js", @@ -31,7 +31,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", "@thi.ng/errors": "^1.0.6", "@thi.ng/paths": "^2.0.9" diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index 13179404f8..aba5696eac 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/router@1.0.11...@thi.ng/router@1.0.12) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/router + + + + + ## [1.0.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/router@1.0.10...@thi.ng/router@1.0.11) (2019-04-26) **Note:** Version bump only for package @thi.ng/router diff --git a/packages/router/package.json b/packages/router/package.json index 077749a2d9..ddecd24d93 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/router", - "version": "1.0.11", + "version": "1.0.12", "description": "Generic router for browser & non-browser based applications", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6" diff --git a/packages/rstream-csp/CHANGELOG.md b/packages/rstream-csp/CHANGELOG.md index 3110817c57..c051fe2679 100644 --- a/packages/rstream-csp/CHANGELOG.md +++ b/packages/rstream-csp/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-csp@1.0.25...@thi.ng/rstream-csp@1.0.26) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/rstream-csp + + + + + ## [1.0.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-csp@1.0.24...@thi.ng/rstream-csp@1.0.25) (2019-04-26) **Note:** Version bump only for package @thi.ng/rstream-csp diff --git a/packages/rstream-csp/package.json b/packages/rstream-csp/package.json index 7dc800ec51..3cb86c3429 100644 --- a/packages/rstream-csp/package.json +++ b/packages/rstream-csp/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-csp", - "version": "1.0.25", + "version": "1.0.26", "description": "@thi.ng/csp bridge module for @thi.ng/rstream", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/csp": "^1.0.18", - "@thi.ng/rstream": "^2.4.3" + "@thi.ng/csp": "^1.0.19", + "@thi.ng/rstream": "^2.4.4" }, "keywords": [ "bridge", diff --git a/packages/rstream-dot/CHANGELOG.md b/packages/rstream-dot/CHANGELOG.md index 8e2e22acc7..f1afcbc263 100644 --- a/packages/rstream-dot/CHANGELOG.md +++ b/packages/rstream-dot/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-dot@1.0.25...@thi.ng/rstream-dot@1.0.26) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/rstream-dot + + + + + ## [1.0.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-dot@1.0.24...@thi.ng/rstream-dot@1.0.25) (2019-04-26) **Note:** Version bump only for package @thi.ng/rstream-dot diff --git a/packages/rstream-dot/package.json b/packages/rstream-dot/package.json index d63bba515a..adbe72c68d 100644 --- a/packages/rstream-dot/package.json +++ b/packages/rstream-dot/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-dot", - "version": "1.0.25", + "version": "1.0.26", "description": "Graphviz DOT conversion of @thi.ng/rstream dataflow graph topologies", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/rstream": "^2.4.3" + "@thi.ng/rstream": "^2.4.4" }, "keywords": [ "conversion", diff --git a/packages/rstream-gestures/CHANGELOG.md b/packages/rstream-gestures/CHANGELOG.md index 70bd0c38e0..148125fc2b 100644 --- a/packages/rstream-gestures/CHANGELOG.md +++ b/packages/rstream-gestures/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-gestures@1.1.3...@thi.ng/rstream-gestures@1.1.4) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/rstream-gestures + + + + + ## [1.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-gestures@1.1.2...@thi.ng/rstream-gestures@1.1.3) (2019-04-26) **Note:** Version bump only for package @thi.ng/rstream-gestures diff --git a/packages/rstream-gestures/package.json b/packages/rstream-gestures/package.json index 0b4908d220..b0c375278a 100644 --- a/packages/rstream-gestures/package.json +++ b/packages/rstream-gestures/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-gestures", - "version": "1.1.3", + "version": "1.1.4", "description": "Unified mouse, mouse wheel & single-touch event stream abstraction", "module": "./index.js", "main": "./lib/index.js", @@ -32,9 +32,9 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/rstream": "^2.4.3", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/api": "^6.2.0", + "@thi.ng/rstream": "^2.4.4", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "dataflow", diff --git a/packages/rstream-graph/CHANGELOG.md b/packages/rstream-graph/CHANGELOG.md index 2c7cdda8b4..a25da4bb6e 100644 --- a/packages/rstream-graph/CHANGELOG.md +++ b/packages/rstream-graph/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-graph@3.0.25...@thi.ng/rstream-graph@3.0.26) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/rstream-graph + + + + + ## [3.0.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-graph@3.0.24...@thi.ng/rstream-graph@3.0.25) (2019-04-26) **Note:** Version bump only for package @thi.ng/rstream-graph diff --git a/packages/rstream-graph/package.json b/packages/rstream-graph/package.json index 18923b070f..82227da34a 100644 --- a/packages/rstream-graph/package.json +++ b/packages/rstream-graph/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-graph", - "version": "3.0.25", + "version": "3.0.26", "description": "Declarative dataflow graph construction for @thi.ng/rstream", "module": "./index.js", "main": "./lib/index.js", @@ -32,13 +32,13 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", "@thi.ng/errors": "^1.0.6", "@thi.ng/paths": "^2.0.9", - "@thi.ng/resolve-map": "^4.0.11", - "@thi.ng/rstream": "^2.4.3", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/resolve-map": "^4.0.12", + "@thi.ng/rstream": "^2.4.4", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "compute", diff --git a/packages/rstream-log-file/CHANGELOG.md b/packages/rstream-log-file/CHANGELOG.md index c2b7ed20aa..f5203faabe 100644 --- a/packages/rstream-log-file/CHANGELOG.md +++ b/packages/rstream-log-file/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log-file@0.1.13...@thi.ng/rstream-log-file@0.1.14) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/rstream-log-file + + + + + ## [0.1.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log-file@0.1.12...@thi.ng/rstream-log-file@0.1.13) (2019-04-26) **Note:** Version bump only for package @thi.ng/rstream-log-file diff --git a/packages/rstream-log-file/package.json b/packages/rstream-log-file/package.json index 3383e40224..72f088b546 100644 --- a/packages/rstream-log-file/package.json +++ b/packages/rstream-log-file/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-log-file", - "version": "0.1.13", + "version": "0.1.14", "description": "File output handler for structured, multilevel & hierarchical loggers based on @thi.ng/rstream", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/rstream": "^2.4.3" + "@thi.ng/rstream": "^2.4.4" }, "keywords": [ "append", diff --git a/packages/rstream-log/CHANGELOG.md b/packages/rstream-log/CHANGELOG.md index ab2af128fb..98c8b990e7 100644 --- a/packages/rstream-log/CHANGELOG.md +++ b/packages/rstream-log/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log@3.0.13...@thi.ng/rstream-log@3.0.14) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/rstream-log + + + + + ## [3.0.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log@3.0.12...@thi.ng/rstream-log@3.0.13) (2019-04-26) **Note:** Version bump only for package @thi.ng/rstream-log diff --git a/packages/rstream-log/package.json b/packages/rstream-log/package.json index 1b71fa217d..454f786aa0 100644 --- a/packages/rstream-log/package.json +++ b/packages/rstream-log/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-log", - "version": "3.0.13", + "version": "3.0.14", "description": "Structured, multilevel & hierarchical loggers based on @thi.ng/rstream", "module": "./index.js", "main": "./lib/index.js", @@ -32,11 +32,11 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/checks": "^2.1.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/rstream": "^2.4.3", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/rstream": "^2.4.4", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "ES6", diff --git a/packages/rstream-query/CHANGELOG.md b/packages/rstream-query/CHANGELOG.md index ccb96af471..0979976cb4 100644 --- a/packages/rstream-query/CHANGELOG.md +++ b/packages/rstream-query/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-query@1.0.25...@thi.ng/rstream-query@1.0.26) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/rstream-query + + + + + ## [1.0.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-query@1.0.24...@thi.ng/rstream-query@1.0.25) (2019-04-26) **Note:** Version bump only for package @thi.ng/rstream-query diff --git a/packages/rstream-query/package.json b/packages/rstream-query/package.json index 620afb0408..8c1aa601f9 100644 --- a/packages/rstream-query/package.json +++ b/packages/rstream-query/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-query", - "version": "1.0.25", + "version": "1.0.26", "description": "@thi.ng/rstream based triple store & reactive query engine", "module": "./index.js", "main": "./lib/index.js", @@ -32,14 +32,14 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/associative": "^2.2.3", + "@thi.ng/api": "^6.2.0", + "@thi.ng/associative": "^2.3.0", "@thi.ng/checks": "^2.1.6", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/rstream": "^2.4.3", - "@thi.ng/rstream-dot": "^1.0.25", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/rstream": "^2.4.4", + "@thi.ng/rstream-dot": "^1.0.26", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "dataflow", diff --git a/packages/rstream/CHANGELOG.md b/packages/rstream/CHANGELOG.md index a7e2abb9c8..13eef121d6 100644 --- a/packages/rstream/CHANGELOG.md +++ b/packages/rstream/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.4.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream@2.4.3...@thi.ng/rstream@2.4.4) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/rstream + + + + + ## [2.4.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream@2.4.2...@thi.ng/rstream@2.4.3) (2019-04-26) **Note:** Version bump only for package @thi.ng/rstream diff --git a/packages/rstream/package.json b/packages/rstream/package.json index 9ce46bc549..f55aca1340 100644 --- a/packages/rstream/package.json +++ b/packages/rstream/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream", - "version": "2.4.3", + "version": "2.4.4", "description": "Reactive multi-tap streams, dataflow & transformation pipeline constructs", "module": "./index.js", "main": "./lib/index.js", @@ -32,13 +32,13 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/associative": "^2.2.3", - "@thi.ng/atom": "^2.0.11", + "@thi.ng/api": "^6.2.0", + "@thi.ng/associative": "^2.3.0", + "@thi.ng/atom": "^2.0.12", "@thi.ng/checks": "^2.1.6", "@thi.ng/errors": "^1.0.6", "@thi.ng/paths": "^2.0.9", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "datastructure", diff --git a/packages/sax/CHANGELOG.md b/packages/sax/CHANGELOG.md index e715eb49dc..adb085453d 100644 --- a/packages/sax/CHANGELOG.md +++ b/packages/sax/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/sax@1.0.18...@thi.ng/sax@1.0.19) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/sax + + + + + ## [1.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/sax@1.0.17...@thi.ng/sax@1.0.18) (2019-04-26) **Note:** Version bump only for package @thi.ng/sax diff --git a/packages/sax/package.json b/packages/sax/package.json index 8abeec0018..bd1f39414e 100644 --- a/packages/sax/package.json +++ b/packages/sax/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/sax", - "version": "1.0.18", + "version": "1.0.19", "description": "Transducer-based, SAX-like, non-validating, speedy & tiny XML parser", "module": "./index.js", "main": "./lib/index.js", @@ -32,9 +32,9 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/transducers": "^5.3.6", - "@thi.ng/transducers-fsm": "^1.0.18" + "@thi.ng/api": "^6.2.0", + "@thi.ng/transducers": "^5.3.7", + "@thi.ng/transducers-fsm": "^1.0.19" }, "keywords": [ "ES6", diff --git a/packages/sparse/CHANGELOG.md b/packages/sparse/CHANGELOG.md index 6b7a17505a..5b5040150a 100644 --- a/packages/sparse/CHANGELOG.md +++ b/packages/sparse/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/sparse@0.1.14...@thi.ng/sparse@0.1.15) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/sparse + + + + + ## [0.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/sparse@0.1.13...@thi.ng/sparse@0.1.14) (2019-04-26) **Note:** Version bump only for package @thi.ng/sparse diff --git a/packages/sparse/package.json b/packages/sparse/package.json index 2596285175..4739312009 100644 --- a/packages/sparse/package.json +++ b/packages/sparse/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/sparse", - "version": "0.1.14", + "version": "0.1.15", "description": "Sparse vector & matrix implementations", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/api": "^6.2.0", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "adjacency", diff --git a/packages/strings/CHANGELOG.md b/packages/strings/CHANGELOG.md index f75a02aa21..6e72303b1c 100644 --- a/packages/strings/CHANGELOG.md +++ b/packages/strings/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.1.2...@thi.ng/strings@1.1.3) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/strings + + + + + ## [1.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.1.1...@thi.ng/strings@1.1.2) (2019-04-26) **Note:** Version bump only for package @thi.ng/strings diff --git a/packages/strings/package.json b/packages/strings/package.json index 7459281703..5d8f2b959a 100644 --- a/packages/strings/package.json +++ b/packages/strings/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/strings", - "version": "1.1.2", + "version": "1.1.3", "description": "Various string formatting & utility functions", "module": "./index.js", "main": "./lib/index.js", @@ -33,7 +33,7 @@ }, "dependencies": { "@thi.ng/errors": "^1.0.6", - "@thi.ng/memoize": "^1.0.8" + "@thi.ng/memoize": "^1.0.9" }, "keywords": [ "composition", diff --git a/packages/transducers-binary/CHANGELOG.md b/packages/transducers-binary/CHANGELOG.md index be704d1b28..c6d819675e 100644 --- a/packages/transducers-binary/CHANGELOG.md +++ b/packages/transducers-binary/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.3.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-binary@0.3.11...@thi.ng/transducers-binary@0.3.12) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/transducers-binary + + + + + ## [0.3.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-binary@0.3.10...@thi.ng/transducers-binary@0.3.11) (2019-04-26) **Note:** Version bump only for package @thi.ng/transducers-binary diff --git a/packages/transducers-binary/package.json b/packages/transducers-binary/package.json index 2297dbf384..bb73c348a3 100644 --- a/packages/transducers-binary/package.json +++ b/packages/transducers-binary/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-binary", - "version": "0.3.11", + "version": "0.3.12", "description": "Binary data related transducers & reducers", "module": "./index.js", "main": "./lib/index.js", @@ -32,10 +32,10 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/compose": "^1.2.4", - "@thi.ng/random": "^1.1.6", - "@thi.ng/strings": "^1.1.2", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/compose": "^1.2.5", + "@thi.ng/random": "^1.1.7", + "@thi.ng/strings": "^1.1.3", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "base64", diff --git a/packages/transducers-fsm/CHANGELOG.md b/packages/transducers-fsm/CHANGELOG.md index 111d4a0f3e..75f4c8bc1c 100644 --- a/packages/transducers-fsm/CHANGELOG.md +++ b/packages/transducers-fsm/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-fsm@1.0.18...@thi.ng/transducers-fsm@1.0.19) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/transducers-fsm + + + + + ## [1.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-fsm@1.0.17...@thi.ng/transducers-fsm@1.0.18) (2019-04-26) **Note:** Version bump only for package @thi.ng/transducers-fsm diff --git a/packages/transducers-fsm/package.json b/packages/transducers-fsm/package.json index 9d30424a81..4cceba8ae2 100644 --- a/packages/transducers-fsm/package.json +++ b/packages/transducers-fsm/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-fsm", - "version": "1.0.18", + "version": "1.0.19", "description": "Transducer-based Finite State Machine transformer", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/api": "^6.2.0", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "ES6", diff --git a/packages/transducers-hdom/CHANGELOG.md b/packages/transducers-hdom/CHANGELOG.md index 285f25ffae..31b95f1902 100644 --- a/packages/transducers-hdom/CHANGELOG.md +++ b/packages/transducers-hdom/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-hdom@2.0.22...@thi.ng/transducers-hdom@2.0.23) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/transducers-hdom + + + + + ## [2.0.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-hdom@2.0.21...@thi.ng/transducers-hdom@2.0.22) (2019-04-26) **Note:** Version bump only for package @thi.ng/transducers-hdom diff --git a/packages/transducers-hdom/package.json b/packages/transducers-hdom/package.json index 2e3adf21c8..967e6bfc4b 100644 --- a/packages/transducers-hdom/package.json +++ b/packages/transducers-hdom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-hdom", - "version": "2.0.22", + "version": "2.0.23", "description": "Transducer based UI updater for @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -32,9 +32,9 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/hdom": "^7.2.7", - "@thi.ng/hiccup": "^3.1.8", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/hdom": "^7.2.8", + "@thi.ng/hiccup": "^3.1.9", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "diff", diff --git a/packages/transducers-stats/CHANGELOG.md b/packages/transducers-stats/CHANGELOG.md index c69b2b057a..afc7bd488f 100644 --- a/packages/transducers-stats/CHANGELOG.md +++ b/packages/transducers-stats/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-stats@1.0.18...@thi.ng/transducers-stats@1.0.19) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/transducers-stats + + + + + ## [1.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-stats@1.0.17...@thi.ng/transducers-stats@1.0.18) (2019-04-26) **Note:** Version bump only for package @thi.ng/transducers-stats diff --git a/packages/transducers-stats/package.json b/packages/transducers-stats/package.json index 1ef4aa951b..b46512507f 100644 --- a/packages/transducers-stats/package.json +++ b/packages/transducers-stats/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-stats", - "version": "1.0.18", + "version": "1.0.19", "description": "Transducers for statistical / technical analysis", "module": "./index.js", "main": "./lib/index.js", @@ -33,9 +33,9 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.6", - "@thi.ng/dcons": "^2.0.18", + "@thi.ng/dcons": "^2.0.19", "@thi.ng/errors": "^1.0.6", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "ES6", diff --git a/packages/transducers/CHANGELOG.md b/packages/transducers/CHANGELOG.md index 1a1ffb6998..b61e62a5b3 100644 --- a/packages/transducers/CHANGELOG.md +++ b/packages/transducers/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.3.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@5.3.6...@thi.ng/transducers@5.3.7) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/transducers + + + + + ## [5.3.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@5.3.5...@thi.ng/transducers@5.3.6) (2019-04-26) **Note:** Version bump only for package @thi.ng/transducers diff --git a/packages/transducers/package.json b/packages/transducers/package.json index ab2841b5fe..48ce8342f1 100644 --- a/packages/transducers/package.json +++ b/packages/transducers/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers", - "version": "5.3.6", + "version": "5.3.7", "description": "Lightweight transducer implementations for ES6 / TypeScript", "module": "./index.js", "main": "./lib/index.js", @@ -32,15 +32,15 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/arrays": "^0.1.8", + "@thi.ng/api": "^6.2.0", + "@thi.ng/arrays": "^0.1.9", "@thi.ng/checks": "^2.1.6", "@thi.ng/compare": "^1.0.6", - "@thi.ng/compose": "^1.2.4", + "@thi.ng/compose": "^1.2.5", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/random": "^1.1.6", - "@thi.ng/strings": "^1.1.2" + "@thi.ng/random": "^1.1.7", + "@thi.ng/strings": "^1.1.3" }, "keywords": [ "array", diff --git a/packages/vector-pools/CHANGELOG.md b/packages/vector-pools/CHANGELOG.md index 44801c4a51..65cf416ed0 100644 --- a/packages/vector-pools/CHANGELOG.md +++ b/packages/vector-pools/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/vector-pools@0.2.15...@thi.ng/vector-pools@0.2.16) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/vector-pools + + + + + ## [0.2.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/vector-pools@0.2.14...@thi.ng/vector-pools@0.2.15) (2019-04-26) **Note:** Version bump only for package @thi.ng/vector-pools diff --git a/packages/vector-pools/README.md b/packages/vector-pools/README.md index 5fd76ddb71..fe0b6d7bee 100644 --- a/packages/vector-pools/README.md +++ b/packages/vector-pools/README.md @@ -177,6 +177,8 @@ EMSCRIPTEN_KEEPALIVE int getNumVertices() { ``` ```ts +import { Type } from "@thi.ng/api"; + // ... WASM / Emscripten boilerplate omitted const Module = ... @@ -190,10 +192,10 @@ const geo = new vp.AttribPool( // don't specify attrib defaults to avoid overriding // values already initialized by WASM code { - pos: { type: vp.GLType.F32, size: 3, byteOffset: 0 }, - uv: { type: vp.GLType.F32, size: 2, byteOffset: 12 }, - col: { type: vp.GLType.F32, size: 3, byteOffset: 20 }, - id: { type: vp.GLType.U16, size: 1, byteOffset: 32 } + pos: { type: Type.F32, size: 3, byteOffset: 0 }, + uv: { type: Type.F32, size: 2, byteOffset: 12 }, + col: { type: Type.F32, size: 3, byteOffset: 20 }, + id: { type: Type.U16, size: 1, byteOffset: 32 } }, // pool options { diff --git a/packages/vector-pools/package.json b/packages/vector-pools/package.json index f34bfd6039..f79804506c 100644 --- a/packages/vector-pools/package.json +++ b/packages/vector-pools/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/vector-pools", - "version": "0.2.15", + "version": "0.2.16", "description": "Data structures for managing & working with strided, memory mapped vectors", "module": "./index.js", "main": "./lib/index.js", @@ -32,9 +32,9 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", - "@thi.ng/malloc": "^2.0.10", - "@thi.ng/vectors": "^2.5.5" + "@thi.ng/api": "^6.2.0", + "@thi.ng/malloc": "^3.0.0", + "@thi.ng/vectors": "^2.5.6" }, "keywords": [ "ES6", diff --git a/packages/vector-pools/src/api.ts b/packages/vector-pools/src/api.ts index 5216a5dd13..42db350b9e 100644 --- a/packages/vector-pools/src/api.ts +++ b/packages/vector-pools/src/api.ts @@ -1,5 +1,10 @@ -import { IObjectOf, IRelease, TypedArray } from "@thi.ng/api"; -import { MemPool, MemPoolOpts, Type } from "@thi.ng/malloc"; +import { + IObjectOf, + IRelease, + Type, + TypedArray +} from "@thi.ng/api"; +import { MemPool, MemPoolOpts } from "@thi.ng/malloc"; import { ReadonlyVec, StridedVec, Vec } from "@thi.ng/vectors"; export interface AttribSpec { diff --git a/packages/vector-pools/src/attrib-pool.ts b/packages/vector-pools/src/attrib-pool.ts index 36c82eefeb..8e97e8254b 100644 --- a/packages/vector-pools/src/attrib-pool.ts +++ b/packages/vector-pools/src/attrib-pool.ts @@ -1,10 +1,16 @@ -import { assert, IObjectOf, IRelease, TypedArray } from "@thi.ng/api"; +import { + assert, + IObjectOf, + IRelease, + SIZEOF, + TypedArray +} from "@thi.ng/api"; import { align, Pow2 } from "@thi.ng/binary"; -import { MemPool, SIZEOF, wrap } from "@thi.ng/malloc"; +import { MemPool, wrap } from "@thi.ng/malloc"; import { range } from "@thi.ng/transducers"; import { ReadonlyVec, Vec, zeroes } from "@thi.ng/vectors"; -import { asNativeType } from "./convert"; import { AttribPoolOpts, AttribSpec } from "./api"; +import { asNativeType } from "./convert"; /* * WASM mem : 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... diff --git a/packages/vector-pools/src/convert.ts b/packages/vector-pools/src/convert.ts index 65e497132c..fa136c76d6 100644 --- a/packages/vector-pools/src/convert.ts +++ b/packages/vector-pools/src/convert.ts @@ -1,4 +1,4 @@ -import { Type } from "@thi.ng/malloc"; +import { Type } from "@thi.ng/api"; import { GL2TYPE, GLType, TYPE2GL } from "./api"; /** diff --git a/packages/vector-pools/src/vec-pool.ts b/packages/vector-pools/src/vec-pool.ts index e319122785..47c221aa5e 100644 --- a/packages/vector-pools/src/vec-pool.ts +++ b/packages/vector-pools/src/vec-pool.ts @@ -1,6 +1,6 @@ -import { TypedArray } from "@thi.ng/api"; +import { Type, TypedArray } from "@thi.ng/api"; import { isTypedArray } from "@thi.ng/checks"; -import { MemPool, MemPoolOpts, MemPoolStats, Type } from "@thi.ng/malloc"; +import { MemPool, MemPoolOpts, MemPoolStats } from "@thi.ng/malloc"; import { IVector } from "@thi.ng/vectors"; import { GLType, IVecPool } from "./api"; import { asNativeType } from "./convert"; diff --git a/packages/vector-pools/test/attribs.ts b/packages/vector-pools/test/attribs.ts index 8fe1a65413..de7275e318 100644 --- a/packages/vector-pools/test/attribs.ts +++ b/packages/vector-pools/test/attribs.ts @@ -1,5 +1,5 @@ +import { Type } from "@thi.ng/api"; import { AttribPool } from "../src/attrib-pool"; -import { Type } from "@thi.ng/malloc"; // import * as assert from "assert"; describe("vector-pools", () => { @@ -8,10 +8,20 @@ describe("vector-pools", () => { mem: { size: 0x100 }, num: 8, attribs: { - pos: { type: Type.F32, default: [0, 0], size: 2, byteOffset: 0 }, + pos: { + type: Type.F32, + default: [0, 0], + size: 2, + byteOffset: 0 + }, id: { type: Type.U32, default: 0, size: 1, byteOffset: 8 }, index: { type: Type.U16, default: 0, size: 1, byteOffset: 12 }, - col: { type: Type.I8, default: [0, 0, 0, 0], size: 4, byteOffset: 14 }, + col: { + type: Type.I8, + default: [0, 0, 0, 0], + size: 4, + byteOffset: 14 + } } }); pool.setAttribValue("pos", 0, [1, 2]); diff --git a/packages/vectors/CHANGELOG.md b/packages/vectors/CHANGELOG.md index 8754f6002d..9ead7b81cd 100644 --- a/packages/vectors/CHANGELOG.md +++ b/packages/vectors/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.5.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/vectors@2.5.5...@thi.ng/vectors@2.5.6) (2019-05-22) + +**Note:** Version bump only for package @thi.ng/vectors + + + + + ## [2.5.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/vectors@2.5.4...@thi.ng/vectors@2.5.5) (2019-04-26) **Note:** Version bump only for package @thi.ng/vectors diff --git a/packages/vectors/package.json b/packages/vectors/package.json index 3ccc8e96fb..cd1fc1dc8c 100644 --- a/packages/vectors/package.json +++ b/packages/vectors/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/vectors", - "version": "2.5.5", + "version": "2.5.6", "description": "Optimized 2d/3d/4d and arbitrary length vector operations", "module": "./index.js", "main": "./lib/index.js", @@ -32,15 +32,15 @@ "typescript": "^3.4.5" }, "dependencies": { - "@thi.ng/api": "^6.1.1", + "@thi.ng/api": "^6.2.0", "@thi.ng/binary": "^1.0.6", "@thi.ng/checks": "^2.1.6", "@thi.ng/equiv": "^1.0.6", "@thi.ng/errors": "^1.0.6", - "@thi.ng/math": "^1.2.3", - "@thi.ng/memoize": "^1.0.8", - "@thi.ng/random": "^1.1.6", - "@thi.ng/transducers": "^5.3.6" + "@thi.ng/math": "^1.3.0", + "@thi.ng/memoize": "^1.0.9", + "@thi.ng/random": "^1.1.7", + "@thi.ng/transducers": "^5.3.7" }, "keywords": [ "2D",