diff --git a/.all-contributorsrc b/.all-contributorsrc
index 63467c7311..b66aa0f055 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -231,6 +231,34 @@
"bug",
"ideas"
]
+ },
+ {
+ "login": "pedroteixeira",
+ "name": "Pedro Henriques dos Santos Teixeira",
+ "avatar_url": "https://avatars3.githubusercontent.com/u/14740?v=4",
+ "profile": "http://twitter.com/pedroteixeira",
+ "contributions": [
+ "financial"
+ ]
+ },
+ {
+ "login": "jamieowen",
+ "name": "Jamie Owen",
+ "avatar_url": "https://avatars3.githubusercontent.com/u/248957?v=4",
+ "profile": "http://jamieowen.com",
+ "contributions": [
+ "bug"
+ ]
+ },
+ {
+ "login": "rkesters",
+ "name": "Robert Kesteson",
+ "avatar_url": "https://avatars3.githubusercontent.com/u/5572145?v=4",
+ "profile": "https://github.com/rkesters",
+ "contributions": [
+ "bug",
+ "code"
+ ]
}
],
"contributorsPerLine": 7,
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 7f9419ab04..7e282c6fc2 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -3,7 +3,7 @@ on:
push:
branches:
- develop
- - master
+ - main
paths:
- "packages/**"
- ".github/workflows/**"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 141588e232..25aa77066e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -314,7 +314,7 @@ If in doubt, please ask first...
It has been [brought to my
attention](https://github.com/thi-ng/umbrella/issues/154) (thanks to
-@Bnaya) that exported `const enums` negatively interfere with some
+[@Bnaya](https://github.com/Bnaya)) that exported `const enums` negatively interfere with some
downstream workflows related to Babel transpilation and TypeScript's
`isolatedModules` compilation feature. For that reason, that latter
option is now enabled for all packages and exported `const enum`s are
diff --git a/README.md b/README.md
index 84866901cc..bb1ef6e5fd 100644
--- a/README.md
+++ b/README.md
@@ -13,10 +13,13 @@
> the composer of. Geared towards versatility, not any specific type of music."
> — [@loganpowell](https://twitter.com/logantpowell/status/1186334119812304901) via Twitter
-Mono-repository for 142+ thi.ng TypeScript/ES6 projects, a wide
+Mono-repository for 144+ thi.ng TypeScript/ES6 projects, a wide
collection of largely data transformation oriented packages and building
blocks for (non-exhaustive list of topics):
+**Please visit [thi.ng](https://thi.ng) for additional information & topic based
+search of packages relevant to your use cases...**
+
- Functional programming (composition, memoization, transducers, multi-methods)
- Data structures & data transformations for wide range of use cases (list,
sets, maps, joins, spatial indexing, clocks)
@@ -111,6 +114,12 @@ fixes, feature requests, financial contributions etc.). You can find a
fairly detailed overview for contributors here:
[CONTRIBUTING.md](https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md).
+**Note:** The default branch for this repo is `develop`. As of 2020-12-08,
+we've also renamed `master` to the more suitable `main` branch. If you have
+local clones, please follow the [advice & short instructions in this
+article](https://www.hanselman.com/blog/easily-rename-your-git-default-branch-from-master-to-main)
+to update your local version.
+
## Projects
+### Latest additions (2020-12-22)
+
+| Project | Version | Changelog | Description |
+|---------------------------------------------|-------------------------------------------------------------------------------------------------------------------|------------------------------------------------|--------------------------------------------------|
+| [`@thi.ng/fuzzy`](./packages/fuzzy) | [![version](https://img.shields.io/npm/v/@thi.ng/fuzzy.svg)](https://www.npmjs.com/package/@thi.ng/fuzzy) | [changelog](./packages/fuzzy/CHANGELOG.md) | Fuzzy logic primitives & rule inference engine |
+| [`@thi.ng/fuzzy-viz`](./packages/fuzzy-viz) | [![version](https://img.shields.io/npm/v/@thi.ng/fuzzy-viz.svg)](https://www.npmjs.com/package/@thi.ng/fuzzy-viz) | [changelog](./packages/fuzzy-viz/CHANGELOG.md) | Visualization, instrumentation for @thi.ng/fuzzy |
+| [`@thi.ng/vclock`](./packages/vclock) | [![version](https://img.shields.io/npm/v/@thi.ng/vclock.svg)](https://www.npmjs.com/package/@thi.ng/vclock) | [changelog](./packages/vclock/CHANGELOG.md) | Vector clock functions / comparators |
+
### Fundamentals
| Project | Version | Changelog | Description |
@@ -135,6 +152,7 @@ feature or `develop` branches) -->
| [`@thi.ng/ecs`](./packages/ecs) | [![version](https://img.shields.io/npm/v/@thi.ng/ecs.svg)](https://www.npmjs.com/package/@thi.ng/ecs) | [changelog](./packages/ecs/CHANGELOG.md) | Entity-Component System |
| [`@thi.ng/equiv`](./packages/equiv) | [![version](https://img.shields.io/npm/v/@thi.ng/equiv.svg)](https://www.npmjs.com/package/@thi.ng/equiv) | [changelog](./packages/equiv/CHANGELOG.md) | Deep value equivalence checking |
| [`@thi.ng/errors`](./packages/errors) | [![version](https://img.shields.io/npm/v/@thi.ng/errors.svg)](https://www.npmjs.com/package/@thi.ng/errors) | [changelog](./packages/errors/CHANGELOG.md) | Custom error types |
+| [`@thi.ng/fuzzy`](./packages/fuzzy) | [![version](https://img.shields.io/npm/v/@thi.ng/fuzzy.svg)](https://www.npmjs.com/package/@thi.ng/fuzzy) | [changelog](./packages/fuzzy/CHANGELOG.md) | Fuzzy logic primitives & rule inference engine |
| [`@thi.ng/hex`](./packages/hex) | [![version](https://img.shields.io/npm/v/@thi.ng/hex.svg)](https://www.npmjs.com/package/@thi.ng/hex) | [changelog](./packages/hex/CHANGELOG.md) | Hex value formatters for U4-64 words |
| [`@thi.ng/math`](./packages/math) | [![version](https://img.shields.io/npm/v/@thi.ng/math.svg)](https://www.npmjs.com/package/@thi.ng/math) | [changelog](./packages/math/CHANGELOG.md) | Assorted common math functions & utilities |
| [`@thi.ng/memoize`](./packages/memoize) | [![version](https://img.shields.io/npm/v/@thi.ng/memoize.svg)](https://www.npmjs.com/package/@thi.ng/memoize) | [changelog](./packages/memoize/CHANGELOG.md) | Function memoization w/ customizable caching |
@@ -146,7 +164,6 @@ feature or `develop` branches) -->
| [`@thi.ng/random`](./packages/random) | [![version](https://img.shields.io/npm/v/@thi.ng/random.svg)](https://www.npmjs.com/package/@thi.ng/random) | [changelog](./packages/random/CHANGELOG.md) | Seedable PRNG implementations w/ unified API |
| [`@thi.ng/strings`](./packages/strings) | [![version](https://img.shields.io/npm/v/@thi.ng/strings.svg)](https://www.npmjs.com/package/@thi.ng/strings) | [changelog](./packages/strings/CHANGELOG.md) | Higher-order string formatting utils |
| [`@thi.ng/system`](./packages/system) | [![version](https://img.shields.io/npm/v/@thi.ng/system.svg)](https://www.npmjs.com/package/@thi.ng/system) | [changelog](./packages/system/CHANGELOG.md) | Minimal life cycle container for stateful app components |
-
### Iterator, stream & sequence processing
| Project | Version | Changelog | Description |
@@ -236,6 +253,7 @@ feature or `develop` branches) -->
| [`@thi.ng/color`](./packages/color) | [![version](https://img.shields.io/npm/v/@thi.ng/color.svg)](https://www.npmjs.com/package/@thi.ng/color) | [changelog](./packages/color/CHANGELOG.md) | Color conversions, gradients |
| [`@thi.ng/dgraph-dot`](./packages/dgraph-dot) | [![version](https://img.shields.io/npm/v/@thi.ng/dgraph-dot.svg)](https://www.npmjs.com/package/@thi.ng/dgraph-dot) | [changelog](./packages/dgraph-dot/CHANGELOG.md) | Dependency graph -> Graphviz |
| [`@thi.ng/dot`](./packages/dot) | [![version](https://img.shields.io/npm/v/@thi.ng/dot.svg)](https://www.npmjs.com/package/@thi.ng/dot) | [changelog](./packages/dot/CHANGELOG.md) | Graphviz DOM & export |
+| [`@thi.ng/fuzzy-viz`](./packages/fuzzy-viz) | [![version](https://img.shields.io/npm/v/@thi.ng/fuzzy-viz.svg)](https://www.npmjs.com/package/@thi.ng/fuzzy-viz) | [changelog](./packages/fuzzy-viz/CHANGELOG.md) | Visualization, instrumentation for @thi.ng/fuzzy |
| [`@thi.ng/geom`](./packages/geom) | [![version](https://img.shields.io/npm/v/@thi.ng/geom.svg)](https://www.npmjs.com/package/@thi.ng/geom) | [changelog](./packages/geom/CHANGELOG.md) | 2D only geometry types & ops |
| [`@thi.ng/geom-accel`](./packages/geom-accel) | [![version](https://img.shields.io/npm/v/@thi.ng/geom-accel.svg)](https://www.npmjs.com/package/@thi.ng/geom-accel) | [changelog](./packages/geom-accel/CHANGELOG.md) | Spatial indexing data structures |
| [`@thi.ng/geom-api`](./packages/geom-api) | [![version](https://img.shields.io/npm/v/@thi.ng/geom-api.svg)](https://www.npmjs.com/package/@thi.ng/geom-api) | [changelog](./packages/geom-api/CHANGELOG.md) | Shared types & interfaces |
@@ -402,6 +420,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
TBD 🐛 🤔 |
+ Pedro Henriques dos Santos Teixeira 💵 |
+ Jamie Owen 🐛 |
+ Robert Kesteson 🐛 💻 |
diff --git a/assets/fuzzy/fuzzy-matrix-dernoncourt.png b/assets/fuzzy/fuzzy-matrix-dernoncourt.png
new file mode 100644
index 0000000000..c47e7fc85b
Binary files /dev/null and b/assets/fuzzy/fuzzy-matrix-dernoncourt.png differ
diff --git a/assets/fuzzy/strategy-viz.svg b/assets/fuzzy/strategy-viz.svg
new file mode 100644
index 0000000000..6577f83712
--- /dev/null
+++ b/assets/fuzzy/strategy-viz.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/fuzzy/temperature-lvar-2.svg b/assets/fuzzy/temperature-lvar-2.svg
new file mode 100644
index 0000000000..0497163553
--- /dev/null
+++ b/assets/fuzzy/temperature-lvar-2.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/adaptive-threshold/package.json b/examples/adaptive-threshold/package.json
index 3131f9e821..1890186542 100644
--- a/examples/adaptive-threshold/package.json
+++ b/examples/adaptive-threshold/package.json
@@ -35,6 +35,6 @@
"screenshot": "examples/adaptive-threshold.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/adaptive-threshold/snowpack.config.js b/examples/adaptive-threshold/snowpack.config.js
index b453cdcb2a..cb372dc5b2 100644
--- a/examples/adaptive-threshold/snowpack.config.js
+++ b/examples/adaptive-threshold/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/adaptive-threshold",
+ baseUrl: "/umbrella/adaptive-threshold",
},
};
diff --git a/examples/async-effect/package.json b/examples/async-effect/package.json
index 02cc4e607a..463a8ebd8b 100644
--- a/examples/async-effect/package.json
+++ b/examples/async-effect/package.json
@@ -27,6 +27,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/async-effect/snowpack.config.js b/examples/async-effect/snowpack.config.js
index 947542ffe9..92adba683f 100644
--- a/examples/async-effect/snowpack.config.js
+++ b/examples/async-effect/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/async-effect",
+ baseUrl: "/umbrella/async-effect",
},
};
diff --git a/examples/bitmap-font/package.json b/examples/bitmap-font/package.json
index 985362ff7a..f880b6cef2 100644
--- a/examples/bitmap-font/package.json
+++ b/examples/bitmap-font/package.json
@@ -35,6 +35,6 @@
"screenshot": "examples/bitmap-font.gif"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/bitmap-font/snowpack.config.js b/examples/bitmap-font/snowpack.config.js
index 44f64dc948..c988e2dd6e 100644
--- a/examples/bitmap-font/snowpack.config.js
+++ b/examples/bitmap-font/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/bitmap-font",
+ baseUrl: "/umbrella/bitmap-font",
},
};
diff --git a/examples/canvas-dial/package.json b/examples/canvas-dial/package.json
index d457e003ec..9611625641 100644
--- a/examples/canvas-dial/package.json
+++ b/examples/canvas-dial/package.json
@@ -38,6 +38,6 @@
"screenshot": "examples/canvas-dial.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/canvas-dial/snowpack.config.js b/examples/canvas-dial/snowpack.config.js
index c11ebe5b7f..1d6144b2fa 100644
--- a/examples/canvas-dial/snowpack.config.js
+++ b/examples/canvas-dial/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/canvas-dial",
+ baseUrl: "/umbrella/canvas-dial",
},
};
diff --git a/examples/canvas-dial/src/dial.ts b/examples/canvas-dial/src/dial.ts
index 552a189560..808c0af915 100644
--- a/examples/canvas-dial/src/dial.ts
+++ b/examples/canvas-dial/src/dial.ts
@@ -4,11 +4,7 @@ import { isString } from "@thi.ng/checks";
import { canvas2D } from "@thi.ng/hdom-components";
import { fitClamped } from "@thi.ng/math";
import type { Subscription } from "@thi.ng/rstream";
-import {
- GestureEvent,
- gestureStream,
- GestureType,
-} from "@thi.ng/rstream-gestures";
+import { GestureEvent, gestureStream } from "@thi.ng/rstream-gestures";
import { heading, sub2 } from "@thi.ng/vectors";
/**
@@ -190,10 +186,7 @@ export const dial = (_opts: Partial) => {
// configure stream to return scaled coords (devicePixelRatio)
events = gestureStream(el, { scale: true }).subscribe({
next: (e) => {
- if (
- e.type === GestureType.START ||
- e.type === GestureType.DRAG
- ) {
+ if (e.type === "start" || e.type === "drag") {
let theta =
heading(sub2([], e.pos, [cx, cy])) - startTheta;
if (theta < 0) theta += TAU;
diff --git a/examples/cellular-automata/package.json b/examples/cellular-automata/package.json
index 75a1d684db..bdf71b4b2c 100644
--- a/examples/cellular-automata/package.json
+++ b/examples/cellular-automata/package.json
@@ -30,6 +30,6 @@
"screenshot": "examples/cellular-automata.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/cellular-automata/snowpack.config.js b/examples/cellular-automata/snowpack.config.js
index 01547e6d6a..b65c0841d0 100644
--- a/examples/cellular-automata/snowpack.config.js
+++ b/examples/cellular-automata/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/cellular-automata",
+ baseUrl: "/umbrella/cellular-automata",
},
};
diff --git a/examples/commit-table-ssr/package.json b/examples/commit-table-ssr/package.json
index 9a08353cf6..60cc1a0051 100644
--- a/examples/commit-table-ssr/package.json
+++ b/examples/commit-table-ssr/package.json
@@ -13,7 +13,7 @@
},
"devDependencies": {
"ts-node": "^9.1.0",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
"@thi.ng/api": "latest",
diff --git a/examples/commit-table-ssr/webpack.config.js b/examples/commit-table-ssr/webpack.config.js
index a026490e1d..fdd6630a8c 100644
--- a/examples/commit-table-ssr/webpack.config.js
+++ b/examples/commit-table-ssr/webpack.config.js
@@ -17,7 +17,5 @@ module.exports = {
{ test: /\.ts$/, use: "ts-loader" },
],
},
- node: {
- process: false,
- },
+ node: false,
};
diff --git a/examples/crypto-chart/package.json b/examples/crypto-chart/package.json
index fd9b3c280f..12326718ee 100644
--- a/examples/crypto-chart/package.json
+++ b/examples/crypto-chart/package.json
@@ -43,6 +43,6 @@
"screenshot": "examples/crypto-chart.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/crypto-chart/snowpack.config.js b/examples/crypto-chart/snowpack.config.js
index e19f406e35..72ff772ac9 100644
--- a/examples/crypto-chart/snowpack.config.js
+++ b/examples/crypto-chart/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/crypto-chart",
+ baseUrl: "/umbrella/crypto-chart",
},
};
diff --git a/examples/devcards/package.json b/examples/devcards/package.json
index 1e8716ede5..e24a4bfc4d 100644
--- a/examples/devcards/package.json
+++ b/examples/devcards/package.json
@@ -28,6 +28,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/devcards/snowpack.config.js b/examples/devcards/snowpack.config.js
index 7b31b1e56a..fb38b1237a 100644
--- a/examples/devcards/snowpack.config.js
+++ b/examples/devcards/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/devcards",
+ baseUrl: "/umbrella/devcards",
},
};
diff --git a/examples/ellipse-proximity/package.json b/examples/ellipse-proximity/package.json
index ae376da13c..07373607df 100644
--- a/examples/ellipse-proximity/package.json
+++ b/examples/ellipse-proximity/package.json
@@ -35,6 +35,6 @@
"screenshot": "examples/ellipse-proximity.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/ellipse-proximity/snowpack.config.js b/examples/ellipse-proximity/snowpack.config.js
index 6114e0d69b..2c9edf289e 100644
--- a/examples/ellipse-proximity/snowpack.config.js
+++ b/examples/ellipse-proximity/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/ellipse-proximity",
+ baseUrl: "/umbrella/ellipse-proximity",
},
};
diff --git a/examples/fft-synth/package.json b/examples/fft-synth/package.json
index 7d3a2ae2b7..948fb00a6a 100644
--- a/examples/fft-synth/package.json
+++ b/examples/fft-synth/package.json
@@ -41,6 +41,6 @@
"screenshot": "examples/fft-synth.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/fft-synth/snowpack.config.js b/examples/fft-synth/snowpack.config.js
index 04e376bfc3..ffafd16725 100644
--- a/examples/fft-synth/snowpack.config.js
+++ b/examples/fft-synth/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/fft-synth",
+ baseUrl: "/umbrella/fft-synth",
},
};
diff --git a/examples/geom-convex-hull/package.json b/examples/geom-convex-hull/package.json
index 9ee9d5ea24..6a1e66cd69 100644
--- a/examples/geom-convex-hull/package.json
+++ b/examples/geom-convex-hull/package.json
@@ -30,6 +30,6 @@
"screenshot": "examples/geom-convex-hull.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/geom-convex-hull/snowpack.config.js b/examples/geom-convex-hull/snowpack.config.js
index 8d4fd4cb47..aec95f94bc 100644
--- a/examples/geom-convex-hull/snowpack.config.js
+++ b/examples/geom-convex-hull/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/geom-convex-hull",
+ baseUrl: "/umbrella/geom-convex-hull",
},
};
diff --git a/examples/geom-fuzz-basics/package.json b/examples/geom-fuzz-basics/package.json
index 27617696c9..4347e95286 100644
--- a/examples/geom-fuzz-basics/package.json
+++ b/examples/geom-fuzz-basics/package.json
@@ -32,6 +32,6 @@
"screenshot": "geom/geom-fuzz.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/geom-fuzz-basics/snowpack.config.js b/examples/geom-fuzz-basics/snowpack.config.js
index 6822cb8b32..9bc8ecfc0c 100644
--- a/examples/geom-fuzz-basics/snowpack.config.js
+++ b/examples/geom-fuzz-basics/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/geom-fuzz-basics",
+ baseUrl: "/umbrella/geom-fuzz-basics",
},
};
diff --git a/examples/geom-knn/package.json b/examples/geom-knn/package.json
index 3880705856..eb8cd40f82 100644
--- a/examples/geom-knn/package.json
+++ b/examples/geom-knn/package.json
@@ -36,6 +36,6 @@
"screenshot": "examples/geom-knn.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/geom-knn/snowpack.config.js b/examples/geom-knn/snowpack.config.js
index 38ba861bf9..7da134d6f4 100644
--- a/examples/geom-knn/snowpack.config.js
+++ b/examples/geom-knn/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/geom-knn",
+ baseUrl: "/umbrella/geom-knn",
},
};
diff --git a/examples/geom-tessel/package.json b/examples/geom-tessel/package.json
index 567995f000..4bea359252 100644
--- a/examples/geom-tessel/package.json
+++ b/examples/geom-tessel/package.json
@@ -36,6 +36,6 @@
"screenshot": "geom/tessel.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/geom-tessel/snowpack.config.js b/examples/geom-tessel/snowpack.config.js
index 4529dc0772..b54403ecd0 100644
--- a/examples/geom-tessel/snowpack.config.js
+++ b/examples/geom-tessel/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/geom-tessel",
+ baseUrl: "/umbrella/geom-tessel",
},
};
diff --git a/examples/geom-voronoi-mst/package.json b/examples/geom-voronoi-mst/package.json
index 9f4cb740db..11f841154c 100644
--- a/examples/geom-voronoi-mst/package.json
+++ b/examples/geom-voronoi-mst/package.json
@@ -41,6 +41,6 @@
"screenshot": "examples/geom-voronoi-mst.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/geom-voronoi-mst/snowpack.config.js b/examples/geom-voronoi-mst/snowpack.config.js
index 8050f0f583..99c065d5ff 100644
--- a/examples/geom-voronoi-mst/snowpack.config.js
+++ b/examples/geom-voronoi-mst/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/geom-voronoi-mst",
+ baseUrl: "/umbrella/geom-voronoi-mst",
},
};
diff --git a/examples/gesture-analysis/package.json b/examples/gesture-analysis/package.json
index 67572d0a57..8d60e1f79c 100644
--- a/examples/gesture-analysis/package.json
+++ b/examples/gesture-analysis/package.json
@@ -37,6 +37,6 @@
"screenshot": "examples/gesture-analysis.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/gesture-analysis/snowpack.config.js b/examples/gesture-analysis/snowpack.config.js
index 31b9ba8238..390c23664d 100644
--- a/examples/gesture-analysis/snowpack.config.js
+++ b/examples/gesture-analysis/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/gesture-analysis",
+ baseUrl: "/umbrella/gesture-analysis",
},
};
diff --git a/examples/gesture-analysis/src/index.ts b/examples/gesture-analysis/src/index.ts
index 8927544f42..dabb0dd130 100644
--- a/examples/gesture-analysis/src/index.ts
+++ b/examples/gesture-analysis/src/index.ts
@@ -3,11 +3,7 @@ import { identity } from "@thi.ng/compose";
import { polyline as gPolyline, resample, vertices } from "@thi.ng/geom";
import { circle, group, polyline, svg } from "@thi.ng/hiccup-svg";
import { fromIterable, merge, sync } from "@thi.ng/rstream";
-import {
- GestureEvent,
- gestureStream,
- GestureType,
-} from "@thi.ng/rstream-gestures";
+import { GestureEvent, gestureStream } from "@thi.ng/rstream-gestures";
import {
comp,
filter,
@@ -116,10 +112,10 @@ const collectPath = () => {
return (g: GestureEvent) => {
console.log(g);
switch (g.type) {
- case GestureType.START:
+ case "start":
pts = [g.pos];
break;
- case GestureType.DRAG:
+ case "drag":
pts.push(g.pos);
break;
}
@@ -138,9 +134,7 @@ const gesture = merge({
// mouse & touch event stream attached to document.body
// we're filtering out move & zoom events to avoid extraneous work
gestureStream(document.body).transform(
- filter(
- (g) => g.type != GestureType.MOVE && g.type != GestureType.ZOOM
- ),
+ filter((g) => !(g.type === "move" || g.type === "zoom")),
map(collectPath())
),
],
diff --git a/examples/grid-iterators/package.json b/examples/grid-iterators/package.json
index 61fa310a82..ebadb9e1a3 100644
--- a/examples/grid-iterators/package.json
+++ b/examples/grid-iterators/package.json
@@ -30,6 +30,6 @@
"screenshot": "examples/grid-iterators.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/grid-iterators/snowpack.config.js b/examples/grid-iterators/snowpack.config.js
index 422503b7aa..562875b443 100644
--- a/examples/grid-iterators/snowpack.config.js
+++ b/examples/grid-iterators/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/grid-iterators",
+ baseUrl: "/umbrella/grid-iterators",
},
};
diff --git a/examples/hdom-basics/package.json b/examples/hdom-basics/package.json
index 4836746491..0c42a00a13 100644
--- a/examples/hdom-basics/package.json
+++ b/examples/hdom-basics/package.json
@@ -20,6 +20,6 @@
"process": false
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-basics/snowpack.config.js b/examples/hdom-basics/snowpack.config.js
index d1238ae89b..a9d86c3692 100644
--- a/examples/hdom-basics/snowpack.config.js
+++ b/examples/hdom-basics/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-basics",
+ baseUrl: "/umbrella/hdom-basics",
},
};
diff --git a/examples/hdom-benchmark/package.json b/examples/hdom-benchmark/package.json
index 98c784cc06..b21ab72de3 100644
--- a/examples/hdom-benchmark/package.json
+++ b/examples/hdom-benchmark/package.json
@@ -27,6 +27,6 @@
"screenshot": "examples/hdom-benchmark.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-benchmark/snowpack.config.js b/examples/hdom-benchmark/snowpack.config.js
index c35ddf8a41..26738a9298 100644
--- a/examples/hdom-benchmark/snowpack.config.js
+++ b/examples/hdom-benchmark/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-benchmark",
+ baseUrl: "/umbrella/hdom-benchmark",
},
};
diff --git a/examples/hdom-benchmark2/package.json b/examples/hdom-benchmark2/package.json
index 49f6d5a569..551e7dfd30 100644
--- a/examples/hdom-benchmark2/package.json
+++ b/examples/hdom-benchmark2/package.json
@@ -35,6 +35,6 @@
"screenshot": "examples/hdom-benchmark2.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-benchmark2/snowpack.config.js b/examples/hdom-benchmark2/snowpack.config.js
index 1d09027467..6876dbd776 100644
--- a/examples/hdom-benchmark2/snowpack.config.js
+++ b/examples/hdom-benchmark2/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-benchmark2",
+ baseUrl: "/umbrella/hdom-benchmark2",
},
};
diff --git a/examples/hdom-canvas-clock/package.json b/examples/hdom-canvas-clock/package.json
index 73adbceef3..72bd0e3616 100644
--- a/examples/hdom-canvas-clock/package.json
+++ b/examples/hdom-canvas-clock/package.json
@@ -33,6 +33,6 @@
"screenshot": "examples/hdom-canvas-clock.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-canvas-clock/snowpack.config.js b/examples/hdom-canvas-clock/snowpack.config.js
index 4fb1c0d83b..ef63005fca 100644
--- a/examples/hdom-canvas-clock/snowpack.config.js
+++ b/examples/hdom-canvas-clock/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-canvas-clock",
+ baseUrl: "/umbrella/hdom-canvas-clock",
},
};
diff --git a/examples/hdom-canvas-draw/package.json b/examples/hdom-canvas-draw/package.json
index efd924d9af..5b004c6dc3 100644
--- a/examples/hdom-canvas-draw/package.json
+++ b/examples/hdom-canvas-draw/package.json
@@ -38,6 +38,6 @@
"screenshot": "examples/hdom-canvas-draw.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-canvas-draw/snowpack.config.js b/examples/hdom-canvas-draw/snowpack.config.js
index cbff5a5f79..33f8f537f5 100644
--- a/examples/hdom-canvas-draw/snowpack.config.js
+++ b/examples/hdom-canvas-draw/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-canvas-draw",
+ baseUrl: "/umbrella/hdom-canvas-draw",
},
};
diff --git a/examples/hdom-canvas-draw/src/index.ts b/examples/hdom-canvas-draw/src/index.ts
index adc86b2452..e916177905 100644
--- a/examples/hdom-canvas-draw/src/index.ts
+++ b/examples/hdom-canvas-draw/src/index.ts
@@ -1,11 +1,7 @@
import { canvas } from "@thi.ng/hdom-canvas";
import { HALF_PI, PI } from "@thi.ng/math";
import { CloseMode, StreamSync, sync, trigger } from "@thi.ng/rstream";
-import {
- GestureEvent,
- gestureStream,
- GestureType,
-} from "@thi.ng/rstream-gestures";
+import { GestureEvent, gestureStream } from "@thi.ng/rstream-gestures";
import {
filter,
map,
@@ -49,8 +45,7 @@ const app = (main: StreamSync) => {
// only interested in some gesture types
filter(
(e: GestureEvent) =>
- e.type === GestureType.START ||
- e.type === GestureType.DRAG
+ e.type === "start" || e.type === "drag"
),
// get current mouse / touch position
map((e) => e.pos),
diff --git a/examples/hdom-canvas-particles/package.json b/examples/hdom-canvas-particles/package.json
index a41a9f61b3..41c558d81e 100644
--- a/examples/hdom-canvas-particles/package.json
+++ b/examples/hdom-canvas-particles/package.json
@@ -38,6 +38,6 @@
"screenshot": "examples/hdom-canvas-particles.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-canvas-particles/snowpack.config.js b/examples/hdom-canvas-particles/snowpack.config.js
index 69f8037d8c..b4e625b9a4 100644
--- a/examples/hdom-canvas-particles/snowpack.config.js
+++ b/examples/hdom-canvas-particles/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-canvas-particles",
+ baseUrl: "/umbrella/hdom-canvas-particles",
},
};
diff --git a/examples/hdom-canvas-shapes/package.json b/examples/hdom-canvas-shapes/package.json
index a1ec771af9..577d04c531 100644
--- a/examples/hdom-canvas-shapes/package.json
+++ b/examples/hdom-canvas-shapes/package.json
@@ -48,6 +48,6 @@
"screenshot": "hdom-canvas/hdom-canvas-shapes-results.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-canvas-shapes/snowpack.config.js b/examples/hdom-canvas-shapes/snowpack.config.js
index bdae2101cd..a9ba20b640 100644
--- a/examples/hdom-canvas-shapes/snowpack.config.js
+++ b/examples/hdom-canvas-shapes/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-canvas-shapes",
+ baseUrl: "/umbrella/hdom-canvas-shapes",
},
};
diff --git a/examples/hdom-dropdown-fuzzy/package.json b/examples/hdom-dropdown-fuzzy/package.json
index 1b6347eaea..3145d57223 100644
--- a/examples/hdom-dropdown-fuzzy/package.json
+++ b/examples/hdom-dropdown-fuzzy/package.json
@@ -36,6 +36,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-dropdown-fuzzy/snowpack.config.js b/examples/hdom-dropdown-fuzzy/snowpack.config.js
index 2a8c198265..0a0ad2f11a 100644
--- a/examples/hdom-dropdown-fuzzy/snowpack.config.js
+++ b/examples/hdom-dropdown-fuzzy/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-dropdown-fuzzy",
+ baseUrl: "/umbrella/hdom-dropdown-fuzzy",
},
};
diff --git a/examples/hdom-dropdown/package.json b/examples/hdom-dropdown/package.json
index 88affe20e0..1f6e99faf2 100644
--- a/examples/hdom-dropdown/package.json
+++ b/examples/hdom-dropdown/package.json
@@ -25,6 +25,6 @@
"process": false
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-dropdown/snowpack.config.js b/examples/hdom-dropdown/snowpack.config.js
index b1d2570e1a..50ffb687fb 100644
--- a/examples/hdom-dropdown/snowpack.config.js
+++ b/examples/hdom-dropdown/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-dropdown",
+ baseUrl: "/umbrella/hdom-dropdown",
},
};
diff --git a/examples/hdom-dyn-context/package.json b/examples/hdom-dyn-context/package.json
index 4b25109106..d859436a1d 100644
--- a/examples/hdom-dyn-context/package.json
+++ b/examples/hdom-dyn-context/package.json
@@ -21,6 +21,6 @@
"process": false
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-dyn-context/snowpack.config.js b/examples/hdom-dyn-context/snowpack.config.js
index 3ee559d3ea..579262bdd8 100644
--- a/examples/hdom-dyn-context/snowpack.config.js
+++ b/examples/hdom-dyn-context/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-dyn-context",
+ baseUrl: "/umbrella/hdom-dyn-context",
},
};
diff --git a/examples/hdom-elm/package.json b/examples/hdom-elm/package.json
index 9da6294d81..f23f03559b 100644
--- a/examples/hdom-elm/package.json
+++ b/examples/hdom-elm/package.json
@@ -30,6 +30,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-elm/snowpack.config.js b/examples/hdom-elm/snowpack.config.js
index eb3f15ed7f..4c7d85e28b 100644
--- a/examples/hdom-elm/snowpack.config.js
+++ b/examples/hdom-elm/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-elm",
+ baseUrl: "/umbrella/hdom-elm",
},
};
diff --git a/examples/hdom-inner-html/package.json b/examples/hdom-inner-html/package.json
index 7ee106a877..e02daaddbf 100644
--- a/examples/hdom-inner-html/package.json
+++ b/examples/hdom-inner-html/package.json
@@ -20,6 +20,6 @@
"process": false
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-inner-html/snowpack.config.js b/examples/hdom-inner-html/snowpack.config.js
index a05c78b688..72abbe9d86 100644
--- a/examples/hdom-inner-html/snowpack.config.js
+++ b/examples/hdom-inner-html/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-inner-html",
+ baseUrl: "/umbrella/hdom-inner-html",
},
};
diff --git a/examples/hdom-local-render/package.json b/examples/hdom-local-render/package.json
index a4a5583045..0a17c02186 100644
--- a/examples/hdom-local-render/package.json
+++ b/examples/hdom-local-render/package.json
@@ -22,6 +22,6 @@
"process": false
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-local-render/snowpack.config.js b/examples/hdom-local-render/snowpack.config.js
index 828fdbaee5..8c01e797f7 100644
--- a/examples/hdom-local-render/snowpack.config.js
+++ b/examples/hdom-local-render/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-local-render",
+ baseUrl: "/umbrella/hdom-local-render",
},
};
diff --git a/examples/hdom-localstate/package.json b/examples/hdom-localstate/package.json
index 76628f6f58..8ea816382f 100644
--- a/examples/hdom-localstate/package.json
+++ b/examples/hdom-localstate/package.json
@@ -21,6 +21,6 @@
"process": false
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-localstate/snowpack.config.js b/examples/hdom-localstate/snowpack.config.js
index c2f3e124e9..8ec4c1b67b 100644
--- a/examples/hdom-localstate/snowpack.config.js
+++ b/examples/hdom-localstate/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-localstate",
+ baseUrl: "/umbrella/hdom-localstate",
},
};
diff --git a/examples/hdom-skip-nested/package.json b/examples/hdom-skip-nested/package.json
index 2c47a17602..8a29598859 100644
--- a/examples/hdom-skip-nested/package.json
+++ b/examples/hdom-skip-nested/package.json
@@ -20,6 +20,6 @@
"process": false
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-skip-nested/snowpack.config.js b/examples/hdom-skip-nested/snowpack.config.js
index d6ede912e1..ab5e0f1700 100644
--- a/examples/hdom-skip-nested/snowpack.config.js
+++ b/examples/hdom-skip-nested/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-skip-nested",
+ baseUrl: "/umbrella/hdom-skip-nested",
},
};
diff --git a/examples/hdom-skip/package.json b/examples/hdom-skip/package.json
index 8b931e11b0..3ab471b0e0 100644
--- a/examples/hdom-skip/package.json
+++ b/examples/hdom-skip/package.json
@@ -20,6 +20,6 @@
"process": false
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-skip/snowpack.config.js b/examples/hdom-skip/snowpack.config.js
index 320ed35cc1..85c85307f1 100644
--- a/examples/hdom-skip/snowpack.config.js
+++ b/examples/hdom-skip/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-skip",
+ baseUrl: "/umbrella/hdom-skip",
},
};
diff --git a/examples/hdom-theme-adr-0003/package.json b/examples/hdom-theme-adr-0003/package.json
index 974ce7691a..2142959a36 100644
--- a/examples/hdom-theme-adr-0003/package.json
+++ b/examples/hdom-theme-adr-0003/package.json
@@ -22,6 +22,6 @@
"process": false
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-theme-adr-0003/snowpack.config.js b/examples/hdom-theme-adr-0003/snowpack.config.js
index 6b16ac994d..2425fb388f 100644
--- a/examples/hdom-theme-adr-0003/snowpack.config.js
+++ b/examples/hdom-theme-adr-0003/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-theme-adr-0003",
+ baseUrl: "/umbrella/hdom-theme-adr-0003",
},
};
diff --git a/examples/hdom-toggle/package.json b/examples/hdom-toggle/package.json
index eeac50417c..bd90e93969 100644
--- a/examples/hdom-toggle/package.json
+++ b/examples/hdom-toggle/package.json
@@ -25,6 +25,6 @@
"screenshot": "examples/hdom-toggle.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-toggle/snowpack.config.js b/examples/hdom-toggle/snowpack.config.js
index 9e16165900..8e8cec3ab6 100644
--- a/examples/hdom-toggle/snowpack.config.js
+++ b/examples/hdom-toggle/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-toggle",
+ baseUrl: "/umbrella/hdom-toggle",
},
};
diff --git a/examples/hdom-vscroller/package.json b/examples/hdom-vscroller/package.json
index ef2cd7b870..85b9a556ac 100644
--- a/examples/hdom-vscroller/package.json
+++ b/examples/hdom-vscroller/package.json
@@ -22,6 +22,6 @@
"process": false
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hdom-vscroller/snowpack.config.js b/examples/hdom-vscroller/snowpack.config.js
index 8b219cfdce..5f606aee30 100644
--- a/examples/hdom-vscroller/snowpack.config.js
+++ b/examples/hdom-vscroller/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hdom-vscroller",
+ baseUrl: "/umbrella/hdom-vscroller",
},
};
diff --git a/examples/hiccup-canvas-arcs/package.json b/examples/hiccup-canvas-arcs/package.json
index 81806d8242..143f5cae1f 100644
--- a/examples/hiccup-canvas-arcs/package.json
+++ b/examples/hiccup-canvas-arcs/package.json
@@ -31,6 +31,6 @@
"screenshot": "examples/hiccup-canvas-arcs.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hiccup-canvas-arcs/snowpack.config.js b/examples/hiccup-canvas-arcs/snowpack.config.js
index 2ba43400e2..bfae7649e3 100644
--- a/examples/hiccup-canvas-arcs/snowpack.config.js
+++ b/examples/hiccup-canvas-arcs/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hiccup-canvas-arcs",
+ baseUrl: "/umbrella/hiccup-canvas-arcs",
},
};
diff --git a/examples/hydrate-basics/package.json b/examples/hydrate-basics/package.json
index e86c7b32f1..29ddd8622b 100644
--- a/examples/hydrate-basics/package.json
+++ b/examples/hydrate-basics/package.json
@@ -30,6 +30,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/hydrate-basics/snowpack.config.js b/examples/hydrate-basics/snowpack.config.js
index 29a3893873..86724556c4 100644
--- a/examples/hydrate-basics/snowpack.config.js
+++ b/examples/hydrate-basics/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/hydrate-basics",
+ baseUrl: "/umbrella/hydrate-basics",
},
};
diff --git a/examples/imgui-basics/package.json b/examples/imgui-basics/package.json
index 2828d70a68..49418b451e 100644
--- a/examples/imgui-basics/package.json
+++ b/examples/imgui-basics/package.json
@@ -33,6 +33,6 @@
"screenshot": "examples/imgui-basics.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/imgui-basics/snowpack.config.js b/examples/imgui-basics/snowpack.config.js
index 789074bbe8..d96ea5c4bf 100644
--- a/examples/imgui-basics/snowpack.config.js
+++ b/examples/imgui-basics/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/imgui-basics",
+ baseUrl: "/umbrella/imgui-basics",
},
};
diff --git a/examples/imgui/package.json b/examples/imgui/package.json
index e3bec5feb4..823932b0be 100644
--- a/examples/imgui/package.json
+++ b/examples/imgui/package.json
@@ -49,6 +49,6 @@
"screenshot": "imgui/imgui-all.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/imgui/snowpack.config.js b/examples/imgui/snowpack.config.js
index 552281de88..6b6fa34d83 100644
--- a/examples/imgui/snowpack.config.js
+++ b/examples/imgui/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/imgui",
+ baseUrl: "/umbrella/imgui",
},
};
diff --git a/examples/interceptor-basics/package.json b/examples/interceptor-basics/package.json
index 06edf0b8c5..a26bf5a205 100644
--- a/examples/interceptor-basics/package.json
+++ b/examples/interceptor-basics/package.json
@@ -28,6 +28,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/interceptor-basics/snowpack.config.js b/examples/interceptor-basics/snowpack.config.js
index 6398dfcc79..fda9d54dae 100644
--- a/examples/interceptor-basics/snowpack.config.js
+++ b/examples/interceptor-basics/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/interceptor-basics",
+ baseUrl: "/umbrella/interceptor-basics",
},
};
diff --git a/examples/interceptor-basics2/package.json b/examples/interceptor-basics2/package.json
index c6bfb23184..43bfa63cbd 100644
--- a/examples/interceptor-basics2/package.json
+++ b/examples/interceptor-basics2/package.json
@@ -30,6 +30,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/interceptor-basics2/snowpack.config.js b/examples/interceptor-basics2/snowpack.config.js
index 422a154b67..2c0d36d702 100644
--- a/examples/interceptor-basics2/snowpack.config.js
+++ b/examples/interceptor-basics2/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/interceptor-basics2",
+ baseUrl: "/umbrella/interceptor-basics2",
},
};
diff --git a/examples/iso-plasma/package.json b/examples/iso-plasma/package.json
index d36945a687..3222b450d8 100644
--- a/examples/iso-plasma/package.json
+++ b/examples/iso-plasma/package.json
@@ -39,6 +39,6 @@
"screenshot": "geom/geom-isoline.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/iso-plasma/snowpack.config.js b/examples/iso-plasma/snowpack.config.js
index 570bac1f9d..853d2e0f95 100644
--- a/examples/iso-plasma/snowpack.config.js
+++ b/examples/iso-plasma/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/iso-plasma",
+ baseUrl: "/umbrella/iso-plasma",
},
};
diff --git a/examples/json-components/package.json b/examples/json-components/package.json
index 8577150eb4..bb7e2b6996 100644
--- a/examples/json-components/package.json
+++ b/examples/json-components/package.json
@@ -25,6 +25,6 @@
"screenshot": "examples/json-components.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/json-components/snowpack.config.js b/examples/json-components/snowpack.config.js
index 72e53f993e..cd2194e485 100644
--- a/examples/json-components/snowpack.config.js
+++ b/examples/json-components/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/json-components",
+ baseUrl: "/umbrella/json-components",
},
};
diff --git a/examples/login-form/package.json b/examples/login-form/package.json
index c89545a251..6570057ebe 100644
--- a/examples/login-form/package.json
+++ b/examples/login-form/package.json
@@ -26,6 +26,6 @@
"readme": true
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/login-form/snowpack.config.js b/examples/login-form/snowpack.config.js
index 376e76cddb..a67b965820 100644
--- a/examples/login-form/snowpack.config.js
+++ b/examples/login-form/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/login-form",
+ baseUrl: "/umbrella/login-form",
},
};
diff --git a/examples/mandelbrot/.gitignore b/examples/mandelbrot/.gitignore
index 0c5abcab62..e228563433 100644
--- a/examples/mandelbrot/.gitignore
+++ b/examples/mandelbrot/.gitignore
@@ -1,5 +1,6 @@
-.cache
-out
+build
+dev
node_modules
yarn.lock
-*.js
+!snowpack.config.js
+!*.d.ts
\ No newline at end of file
diff --git a/examples/mandelbrot/snowpack.config.js b/examples/mandelbrot/snowpack.config.js
new file mode 100644
index 0000000000..2157b52521
--- /dev/null
+++ b/examples/mandelbrot/snowpack.config.js
@@ -0,0 +1,29 @@
+/** @type {import("snowpack").SnowpackUserConfig } */
+module.exports = {
+ mount: {
+ public: "/",
+ src: "/_dist_",
+ },
+ plugins: [
+ "@snowpack/plugin-typescript",
+ [
+ "@snowpack/plugin-webpack",
+ {
+ extendConfig: (config) => {
+ config.node = {
+ process: false,
+ setImmediate: false,
+ util: "empty",
+ };
+ return config;
+ },
+ },
+ ],
+ ],
+ installOptions: {
+ installTypes: true,
+ },
+ buildOptions: {
+ baseUrl: "/umbrella/mandelbrot",
+ },
+};
diff --git a/examples/mandelbrot/src/index.ts b/examples/mandelbrot/src/index.ts
index ac1a7d94c8..3cd6f75562 100644
--- a/examples/mandelbrot/src/index.ts
+++ b/examples/mandelbrot/src/index.ts
@@ -3,7 +3,7 @@ import { equiv } from "@thi.ng/equiv";
import { canvas2D } from "@thi.ng/hdom-components";
import { fit, mix } from "@thi.ng/math";
import { stream, Stream, sync, tunnel } from "@thi.ng/rstream";
-import { gestureStream, GestureType } from "@thi.ng/rstream-gestures";
+import { gestureStream } from "@thi.ng/rstream-gestures";
import { padLeft } from "@thi.ng/strings";
import { map } from "@thi.ng/transducers";
import { updateDOM } from "@thi.ng/transducers-hdom";
@@ -132,13 +132,13 @@ const app = () => {
const _x2 = x2.deref()!;
const _y2 = y2.deref()!;
switch (e.type) {
- case GestureType.START:
+ case "start":
sel1.next(e.pos);
break;
- case GestureType.DRAG:
+ case "drag":
sel2.next(e.pos);
break;
- case GestureType.END: {
+ case "end": {
const p = sel1.deref();
if (!p || equiv(p, e.pos)) return;
// compute target coord based on current zoom region
@@ -166,7 +166,7 @@ const app = () => {
newRender(ax, ay, bx, by);
break;
}
- case GestureType.ZOOM:
+ case "zoom":
updateZoom(e.zoom);
break;
default:
diff --git a/examples/mandelbrot/webpack.worker.js b/examples/mandelbrot/webpack.worker.js
index 9ec791aec9..a695663e3c 100644
--- a/examples/mandelbrot/webpack.worker.js
+++ b/examples/mandelbrot/webpack.worker.js
@@ -27,7 +27,5 @@ module.exports = {
},
],
},
- node: {
- process: false,
- },
+ node: false,
};
diff --git a/examples/markdown/package.json b/examples/markdown/package.json
index 5dbfaca078..4f0e17fb97 100644
--- a/examples/markdown/package.json
+++ b/examples/markdown/package.json
@@ -33,6 +33,6 @@
"screenshot": "examples/markdown-parser.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/markdown/snowpack.config.js b/examples/markdown/snowpack.config.js
index f0bfed1a52..149fb125aa 100644
--- a/examples/markdown/snowpack.config.js
+++ b/examples/markdown/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/markdown",
+ baseUrl: "/umbrella/markdown",
},
};
diff --git a/examples/multitouch/package.json b/examples/multitouch/package.json
index 2ba3cfdfbe..853dc6b679 100644
--- a/examples/multitouch/package.json
+++ b/examples/multitouch/package.json
@@ -33,6 +33,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/multitouch/snowpack.config.js b/examples/multitouch/snowpack.config.js
index d2ccee4419..7240b138d6 100644
--- a/examples/multitouch/snowpack.config.js
+++ b/examples/multitouch/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/multitouch",
+ baseUrl: "/umbrella/multitouch",
},
};
diff --git a/examples/multitouch/src/index.ts b/examples/multitouch/src/index.ts
index 03ac3fee54..91bb2ada52 100644
--- a/examples/multitouch/src/index.ts
+++ b/examples/multitouch/src/index.ts
@@ -19,7 +19,7 @@ const MTCanvas = memoize1((id: string) => {
main.add(gestureStream(el), el.id);
},
};
- return (attribs: any, gesture?: GestureEvent) => [
+ return (attribs: any, gesture: GestureEvent = {}) => [
_canvas,
{ id, class: "bg-washed-yellow", ...attribs },
[
@@ -29,12 +29,12 @@ const MTCanvas = memoize1((id: string) => {
...mapcat(
(i: GestureInfo) => [
["circle", { stroke: "#333", fill: "none" }, i.start, 20],
- ["circle", {}, i.pos, 20 * (gesture?.zoom || 1)],
+ ["circle", {}, i.pos, 20 * (gesture.zoom || 1)],
i.start
? ["line", { stroke: "#333" }, i.start, i.pos]
: null,
],
- gesture?.active || []
+ gesture.active || []
),
],
];
diff --git a/examples/package-stats/package.json b/examples/package-stats/package.json
index ac41156fc1..6b03edc49a 100644
--- a/examples/package-stats/package.json
+++ b/examples/package-stats/package.json
@@ -11,7 +11,7 @@
},
"devDependencies": {
"ts-node": "^9.1.0",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
"@thi.ng/checks": "latest",
diff --git a/examples/parse-playground/package.json b/examples/parse-playground/package.json
index f856b32fc2..1176b2b3a3 100644
--- a/examples/parse-playground/package.json
+++ b/examples/parse-playground/package.json
@@ -45,6 +45,6 @@
"screenshot": "examples/parse-playground.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/parse-playground/snowpack.config.js b/examples/parse-playground/snowpack.config.js
index e9b0e20090..2e897e86c3 100644
--- a/examples/parse-playground/snowpack.config.js
+++ b/examples/parse-playground/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/parse-playground",
+ baseUrl: "/umbrella/parse-playground",
},
};
diff --git a/examples/pixel-basics/package.json b/examples/pixel-basics/package.json
index 40ceb65914..54815faa45 100644
--- a/examples/pixel-basics/package.json
+++ b/examples/pixel-basics/package.json
@@ -25,6 +25,6 @@
"screenshot": "pixel/pixel-basics.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/pixel-basics/snowpack.config.js b/examples/pixel-basics/snowpack.config.js
index af66f4ffb7..ba8ca1532a 100644
--- a/examples/pixel-basics/snowpack.config.js
+++ b/examples/pixel-basics/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/pixel-basics",
+ baseUrl: "/umbrella/pixel-basics",
},
};
diff --git a/examples/pointfree-svg/package.json b/examples/pointfree-svg/package.json
index c90e563a45..8720e91c5e 100644
--- a/examples/pointfree-svg/package.json
+++ b/examples/pointfree-svg/package.json
@@ -17,7 +17,7 @@
},
"devDependencies": {
"ts-node": "^9.1.0",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"thi.ng": {
"online": false,
diff --git a/examples/poisson-circles/package.json b/examples/poisson-circles/package.json
index dbca07105f..223bdbd1e1 100644
--- a/examples/poisson-circles/package.json
+++ b/examples/poisson-circles/package.json
@@ -31,6 +31,6 @@
"screenshot": "poisson/poisson.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/poisson-circles/snowpack.config.js b/examples/poisson-circles/snowpack.config.js
index e10517418f..3b4d2bda19 100644
--- a/examples/poisson-circles/snowpack.config.js
+++ b/examples/poisson-circles/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/poisson-circles",
+ baseUrl: "/umbrella/poisson-circles",
},
};
diff --git a/examples/poly-spline/package.json b/examples/poly-spline/package.json
index 3d057db840..4cbb3de5ac 100644
--- a/examples/poly-spline/package.json
+++ b/examples/poly-spline/package.json
@@ -35,6 +35,6 @@
"screenshot": "examples/poly-spline.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/poly-spline/snowpack.config.js b/examples/poly-spline/snowpack.config.js
index 6b77db262b..a7ed3f0d4d 100644
--- a/examples/poly-spline/snowpack.config.js
+++ b/examples/poly-spline/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/poly-spline",
+ baseUrl: "/umbrella/poly-spline",
},
};
diff --git a/examples/porter-duff/package.json b/examples/porter-duff/package.json
index 032a092efe..902228c663 100644
--- a/examples/porter-duff/package.json
+++ b/examples/porter-duff/package.json
@@ -25,6 +25,6 @@
"screenshot": "porter-duff/porter-duff2.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/porter-duff/snowpack.config.js b/examples/porter-duff/snowpack.config.js
index d1de7753b8..aa72f433cf 100644
--- a/examples/porter-duff/snowpack.config.js
+++ b/examples/porter-duff/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/porter-duff",
+ baseUrl: "/umbrella/porter-duff",
},
};
diff --git a/examples/ramp-synth/package.json b/examples/ramp-synth/package.json
index 688d0db6fc..aa28e70ab1 100644
--- a/examples/ramp-synth/package.json
+++ b/examples/ramp-synth/package.json
@@ -36,6 +36,6 @@
"screenshot": "examples/ramp-synth.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/ramp-synth/snowpack.config.js b/examples/ramp-synth/snowpack.config.js
index f8635a7cc6..796d5a8043 100644
--- a/examples/ramp-synth/snowpack.config.js
+++ b/examples/ramp-synth/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/ramp-synth",
+ baseUrl: "/umbrella/ramp-synth",
},
};
diff --git a/examples/rdom-basics/package.json b/examples/rdom-basics/package.json
index c75f2fd11c..8f56b9a059 100644
--- a/examples/rdom-basics/package.json
+++ b/examples/rdom-basics/package.json
@@ -32,6 +32,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/rdom-basics/snowpack.config.js b/examples/rdom-basics/snowpack.config.js
index 17aea3096c..41fba46900 100644
--- a/examples/rdom-basics/snowpack.config.js
+++ b/examples/rdom-basics/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/rdom-basics",
+ baseUrl: "/umbrella/rdom-basics",
},
};
diff --git a/examples/rdom-dnd/package.json b/examples/rdom-dnd/package.json
index c5f8c5f9e2..433b69b43e 100644
--- a/examples/rdom-dnd/package.json
+++ b/examples/rdom-dnd/package.json
@@ -31,6 +31,6 @@
"screenshot": "examples/rdom-dnd.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/rdom-dnd/snowpack.config.js b/examples/rdom-dnd/snowpack.config.js
index 0deb860804..795733b09c 100644
--- a/examples/rdom-dnd/snowpack.config.js
+++ b/examples/rdom-dnd/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/rdom-dnd",
+ baseUrl: "/umbrella/rdom-dnd",
},
};
diff --git a/examples/rdom-lissajous/package.json b/examples/rdom-lissajous/package.json
index 24e826c470..f9946c991e 100644
--- a/examples/rdom-lissajous/package.json
+++ b/examples/rdom-lissajous/package.json
@@ -35,6 +35,6 @@
"screenshot": "examples/rdom-lissajous.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/rdom-lissajous/snowpack.config.js b/examples/rdom-lissajous/snowpack.config.js
index f5ac4e1750..81d114db1a 100644
--- a/examples/rdom-lissajous/snowpack.config.js
+++ b/examples/rdom-lissajous/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/rdom-lissajous",
+ baseUrl: "/umbrella/rdom-lissajous",
},
};
diff --git a/examples/rdom-search-docs/package.json b/examples/rdom-search-docs/package.json
index 1ea1c5cd7c..80ed67afb7 100644
--- a/examples/rdom-search-docs/package.json
+++ b/examples/rdom-search-docs/package.json
@@ -37,6 +37,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/rdom-search-docs/snowpack.config.js b/examples/rdom-search-docs/snowpack.config.js
index d7e30c3e03..08c62b1602 100644
--- a/examples/rdom-search-docs/snowpack.config.js
+++ b/examples/rdom-search-docs/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/rdom-search-docs",
+ baseUrl: "/umbrella/rdom-search-docs",
},
};
diff --git a/examples/rdom-svg-nodes/package.json b/examples/rdom-svg-nodes/package.json
index d38f534bec..a41a167422 100644
--- a/examples/rdom-svg-nodes/package.json
+++ b/examples/rdom-svg-nodes/package.json
@@ -34,6 +34,6 @@
"screenshot": "examples/rdom-svg-nodes.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/rdom-svg-nodes/snowpack.config.js b/examples/rdom-svg-nodes/snowpack.config.js
index 0b79d25904..321cee70d6 100644
--- a/examples/rdom-svg-nodes/snowpack.config.js
+++ b/examples/rdom-svg-nodes/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/rdom-svg-nodes",
+ baseUrl: "/umbrella/rdom-svg-nodes",
},
};
diff --git a/examples/rotating-voronoi/package.json b/examples/rotating-voronoi/package.json
index f38e222e45..1df325edbe 100644
--- a/examples/rotating-voronoi/package.json
+++ b/examples/rotating-voronoi/package.json
@@ -54,6 +54,6 @@
"screenshot": "examples/rotating-voronoi.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/rotating-voronoi/snowpack.config.js b/examples/rotating-voronoi/snowpack.config.js
index b7007c300f..5af8be8bde 100644
--- a/examples/rotating-voronoi/snowpack.config.js
+++ b/examples/rotating-voronoi/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/rotating-voronoi",
+ baseUrl: "/umbrella/rotating-voronoi",
},
};
diff --git a/examples/router-basics/package.json b/examples/router-basics/package.json
index 719441ecc9..c7a20baf4a 100644
--- a/examples/router-basics/package.json
+++ b/examples/router-basics/package.json
@@ -34,6 +34,6 @@
"screenshot": "examples/router-basics.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/router-basics/snowpack.config.js b/examples/router-basics/snowpack.config.js
index 5e2818643d..7c53328ecc 100644
--- a/examples/router-basics/snowpack.config.js
+++ b/examples/router-basics/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/router-basics",
+ baseUrl: "/umbrella/router-basics",
},
};
diff --git a/examples/rstream-dataflow/package.json b/examples/rstream-dataflow/package.json
index 7664aa59b3..46fc724fbd 100644
--- a/examples/rstream-dataflow/package.json
+++ b/examples/rstream-dataflow/package.json
@@ -35,6 +35,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/rstream-dataflow/snowpack.config.js b/examples/rstream-dataflow/snowpack.config.js
index ff49999aad..92b7daa1e9 100644
--- a/examples/rstream-dataflow/snowpack.config.js
+++ b/examples/rstream-dataflow/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/rstream-dataflow",
+ baseUrl: "/umbrella/rstream-dataflow",
},
};
diff --git a/examples/rstream-event-loop/package.json b/examples/rstream-event-loop/package.json
index 6ed0bfc216..4fa01fcab8 100644
--- a/examples/rstream-event-loop/package.json
+++ b/examples/rstream-event-loop/package.json
@@ -35,6 +35,6 @@
"screenshot": "examples/rstream-event-loop.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/rstream-event-loop/snowpack.config.js b/examples/rstream-event-loop/snowpack.config.js
index 8bb6b25589..09df02742d 100644
--- a/examples/rstream-event-loop/snowpack.config.js
+++ b/examples/rstream-event-loop/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/rstream-event-loop",
+ baseUrl: "/umbrella/rstream-event-loop",
},
};
diff --git a/examples/rstream-grid/package.json b/examples/rstream-grid/package.json
index fd954bf98b..8f9a508d08 100644
--- a/examples/rstream-grid/package.json
+++ b/examples/rstream-grid/package.json
@@ -45,6 +45,6 @@
"screenshot": "examples/rstream-grid.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/rstream-grid/snowpack.config.js b/examples/rstream-grid/snowpack.config.js
index 2e2f280f99..9e68ab9212 100644
--- a/examples/rstream-grid/snowpack.config.js
+++ b/examples/rstream-grid/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/rstream-grid",
+ baseUrl: "/umbrella/rstream-grid",
},
};
diff --git a/examples/rstream-hdom/package.json b/examples/rstream-hdom/package.json
index 80a24e5e86..af8531b9af 100644
--- a/examples/rstream-hdom/package.json
+++ b/examples/rstream-hdom/package.json
@@ -23,6 +23,6 @@
"process": false
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/rstream-hdom/snowpack.config.js b/examples/rstream-hdom/snowpack.config.js
index e85d7fa7be..c4be8d2fd7 100644
--- a/examples/rstream-hdom/snowpack.config.js
+++ b/examples/rstream-hdom/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/rstream-hdom",
+ baseUrl: "/umbrella/rstream-hdom",
},
};
diff --git a/examples/rstream-spreadsheet/package.json b/examples/rstream-spreadsheet/package.json
index da8f566c64..758cc505cc 100644
--- a/examples/rstream-spreadsheet/package.json
+++ b/examples/rstream-spreadsheet/package.json
@@ -48,6 +48,6 @@
"screenshot": "examples/rstream-spreadsheet.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/rstream-spreadsheet/snowpack.config.js b/examples/rstream-spreadsheet/snowpack.config.js
index bfdbe21727..6393e31051 100644
--- a/examples/rstream-spreadsheet/snowpack.config.js
+++ b/examples/rstream-spreadsheet/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/rstream-spreadsheet",
+ baseUrl: "/umbrella/rstream-spreadsheet",
},
};
diff --git a/examples/scenegraph-image/package.json b/examples/scenegraph-image/package.json
index 4f2e5ef122..aca4a3e2fe 100644
--- a/examples/scenegraph-image/package.json
+++ b/examples/scenegraph-image/package.json
@@ -41,6 +41,6 @@
"screenshot": "examples/scenegraph-image.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/scenegraph-image/snowpack.config.js b/examples/scenegraph-image/snowpack.config.js
index 8be49694bd..4b95460d45 100644
--- a/examples/scenegraph-image/snowpack.config.js
+++ b/examples/scenegraph-image/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/scenegraph-image",
+ baseUrl: "/umbrella/scenegraph-image",
},
};
diff --git a/examples/scenegraph/package.json b/examples/scenegraph/package.json
index 53c4ab3174..8aba0805a2 100644
--- a/examples/scenegraph/package.json
+++ b/examples/scenegraph/package.json
@@ -39,6 +39,6 @@
"screenshot": "examples/scenegraph.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/scenegraph/snowpack.config.js b/examples/scenegraph/snowpack.config.js
index 3974526e07..bb70356cf6 100644
--- a/examples/scenegraph/snowpack.config.js
+++ b/examples/scenegraph/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/scenegraph",
+ baseUrl: "/umbrella/scenegraph",
},
};
diff --git a/examples/shader-ast-canvas2d/package.json b/examples/shader-ast-canvas2d/package.json
index 2493cad8e8..eb220f828e 100644
--- a/examples/shader-ast-canvas2d/package.json
+++ b/examples/shader-ast-canvas2d/package.json
@@ -27,6 +27,6 @@
"screenshot": "shader-ast/shader-ast-01.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/shader-ast-canvas2d/snowpack.config.js b/examples/shader-ast-canvas2d/snowpack.config.js
index 71cbf59590..2b38993ba0 100644
--- a/examples/shader-ast-canvas2d/snowpack.config.js
+++ b/examples/shader-ast-canvas2d/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/shader-ast-canvas2d",
+ baseUrl: "/umbrella/shader-ast-canvas2d",
},
};
diff --git a/examples/shader-ast-evo/package.json b/examples/shader-ast-evo/package.json
index fd4b41d46f..660a44fdcb 100644
--- a/examples/shader-ast-evo/package.json
+++ b/examples/shader-ast-evo/package.json
@@ -37,6 +37,6 @@
"screenshot": "examples/shader-ast-evo.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/shader-ast-evo/snowpack.config.js b/examples/shader-ast-evo/snowpack.config.js
index 55c83af024..e28135b434 100644
--- a/examples/shader-ast-evo/snowpack.config.js
+++ b/examples/shader-ast-evo/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/shader-ast-evo",
+ baseUrl: "/umbrella/shader-ast-evo",
},
};
diff --git a/examples/shader-ast-evo/src/index.ts b/examples/shader-ast-evo/src/index.ts
index 1c93364085..39ab6406a0 100644
--- a/examples/shader-ast-evo/src/index.ts
+++ b/examples/shader-ast-evo/src/index.ts
@@ -1,4 +1,4 @@
-import { AST, ASTNode, ASTOpts, GeneType } from "@thi.ng/gp";
+import { AST, ASTNode, ASTOpts } from "@thi.ng/gp";
import { roundTo } from "@thi.ng/math";
import { IRandom, SYSTEM } from "@thi.ng/random";
import {
@@ -115,7 +115,7 @@ const AST_OPTS: ASTOpts = {
};
const transpile = (node: ASTNode): Term =>
- node.type === GeneType.OP
+ node.type === "op"
? node.op.apply(null, node.args.map(transpile))
: node.value;
diff --git a/examples/shader-ast-noise/package.json b/examples/shader-ast-noise/package.json
index 3c12fe13de..f6312754b4 100644
--- a/examples/shader-ast-noise/package.json
+++ b/examples/shader-ast-noise/package.json
@@ -28,6 +28,6 @@
"screenshot": "examples/shader-ast-noise.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/shader-ast-noise/snowpack.config.js b/examples/shader-ast-noise/snowpack.config.js
index 2e478138a3..c35c625d02 100644
--- a/examples/shader-ast-noise/snowpack.config.js
+++ b/examples/shader-ast-noise/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/shader-ast-noise",
+ baseUrl: "/umbrella/shader-ast-noise",
},
};
diff --git a/examples/shader-ast-raymarch/package.json b/examples/shader-ast-raymarch/package.json
index f57517b8dc..37a0bdc4ea 100644
--- a/examples/shader-ast-raymarch/package.json
+++ b/examples/shader-ast-raymarch/package.json
@@ -28,6 +28,6 @@
"screenshot": "shader-ast/shader-ast-raymarch.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/shader-ast-raymarch/snowpack.config.js b/examples/shader-ast-raymarch/snowpack.config.js
index b7f728c807..50ebc44be4 100644
--- a/examples/shader-ast-raymarch/snowpack.config.js
+++ b/examples/shader-ast-raymarch/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/shader-ast-raymarch",
+ baseUrl: "/umbrella/shader-ast-raymarch",
},
};
diff --git a/examples/shader-ast-sdf2d/package.json b/examples/shader-ast-sdf2d/package.json
index d4a0098763..2d5aa69d78 100644
--- a/examples/shader-ast-sdf2d/package.json
+++ b/examples/shader-ast-sdf2d/package.json
@@ -28,6 +28,6 @@
"screenshot": "examples/shader-ast-sdf2d.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/shader-ast-sdf2d/snowpack.config.js b/examples/shader-ast-sdf2d/snowpack.config.js
index d14c02ffa9..8b302362cd 100644
--- a/examples/shader-ast-sdf2d/snowpack.config.js
+++ b/examples/shader-ast-sdf2d/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/shader-ast-sdf2d",
+ baseUrl: "/umbrella/shader-ast-sdf2d",
},
};
diff --git a/examples/shader-ast-tunnel/package.json b/examples/shader-ast-tunnel/package.json
index 479077dc25..854cc06e6a 100644
--- a/examples/shader-ast-tunnel/package.json
+++ b/examples/shader-ast-tunnel/package.json
@@ -35,6 +35,6 @@
"screenshot": "examples/shader-ast-tunnel.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/shader-ast-tunnel/snowpack.config.js b/examples/shader-ast-tunnel/snowpack.config.js
index fe00fecc47..e3bc7c9fd4 100644
--- a/examples/shader-ast-tunnel/snowpack.config.js
+++ b/examples/shader-ast-tunnel/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/shader-ast-tunnel",
+ baseUrl: "/umbrella/shader-ast-tunnel",
},
};
diff --git a/examples/shader-ast-workers/.gitignore b/examples/shader-ast-workers/.gitignore
index 0c5abcab62..e228563433 100644
--- a/examples/shader-ast-workers/.gitignore
+++ b/examples/shader-ast-workers/.gitignore
@@ -1,5 +1,6 @@
-.cache
-out
+build
+dev
node_modules
yarn.lock
-*.js
+!snowpack.config.js
+!*.d.ts
\ No newline at end of file
diff --git a/examples/shader-ast-workers/snowpack.config.js b/examples/shader-ast-workers/snowpack.config.js
new file mode 100644
index 0000000000..2352c0fbb2
--- /dev/null
+++ b/examples/shader-ast-workers/snowpack.config.js
@@ -0,0 +1,29 @@
+/** @type {import("snowpack").SnowpackUserConfig } */
+module.exports = {
+ mount: {
+ public: "/",
+ src: "/_dist_",
+ },
+ plugins: [
+ "@snowpack/plugin-typescript",
+ [
+ "@snowpack/plugin-webpack",
+ {
+ extendConfig: (config) => {
+ config.node = {
+ process: false,
+ setImmediate: false,
+ util: "empty",
+ };
+ return config;
+ },
+ },
+ ],
+ ],
+ installOptions: {
+ installTypes: true,
+ },
+ buildOptions: {
+ baseUrl: "/umbrella/shader-ast-workers",
+ },
+};
diff --git a/examples/shader-ast-workers/webpack.worker.js b/examples/shader-ast-workers/webpack.worker.js
new file mode 100644
index 0000000000..a695663e3c
--- /dev/null
+++ b/examples/shader-ast-workers/webpack.worker.js
@@ -0,0 +1,31 @@
+module.exports = {
+ entry: "./src/worker.ts",
+ output: {
+ filename: "worker.js",
+ path: __dirname + "/public",
+ },
+ resolve: {
+ extensions: [".ts", ".js"],
+ },
+ module: {
+ rules: [
+ {
+ test: /\.(png|jpg|gif)$/,
+ loader: "file-loader",
+ options: { name: "[path][hash].[ext]" },
+ },
+ {
+ test: /\.ts$/,
+ use: [
+ {
+ loader: "ts-loader",
+ options: {
+ configFile: "tsconfig.worker.json",
+ },
+ },
+ ],
+ },
+ ],
+ },
+ node: false,
+};
diff --git a/examples/shader-graph/package.json b/examples/shader-graph/package.json
index eaf36b6330..88fbc21d2b 100644
--- a/examples/shader-graph/package.json
+++ b/examples/shader-graph/package.json
@@ -39,6 +39,6 @@
"screenshot": "examples/shader-graph.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/shader-graph/snowpack.config.js b/examples/shader-graph/snowpack.config.js
index 88f67b623b..b4c3deb958 100644
--- a/examples/shader-graph/snowpack.config.js
+++ b/examples/shader-graph/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/shader-graph",
+ baseUrl: "/umbrella/shader-graph",
},
};
diff --git a/examples/shader-graph/src/index.ts b/examples/shader-graph/src/index.ts
index adce8c9d11..f035eeb538 100644
--- a/examples/shader-graph/src/index.ts
+++ b/examples/shader-graph/src/index.ts
@@ -1,7 +1,7 @@
import { exposeGlobal, Nullable } from "@thi.ng/api";
import { ortho } from "@thi.ng/matrices";
import { fromRAF } from "@thi.ng/rstream";
-import { gestureStream, GestureType } from "@thi.ng/rstream-gestures";
+import { gestureStream } from "@thi.ng/rstream-gestures";
import { Node2D } from "@thi.ng/scenegraph";
import {
$x,
@@ -273,7 +273,7 @@ gestureStream(CTX.canvas, { minZoom: 0.1, maxZoom: 4, smooth: 0.05 }).subscribe(
{
next(e) {
switch (e.type) {
- case GestureType.START:
+ case "start":
const info = ROOT.childForPoint(e.pos);
this.sel = info ? info.node : CONTENT;
this.startTheta = this.sel.rotate;
@@ -282,7 +282,7 @@ gestureStream(CTX.canvas, { minZoom: 0.1, maxZoom: 4, smooth: 0.05 }).subscribe(
copy(this.sel.translate)
);
break;
- case GestureType.DRAG:
+ case "drag":
if (e.buttons == 2) {
this.sel.rotate =
this.startTheta + e.active[0].delta![0] * 0.01;
@@ -294,7 +294,7 @@ gestureStream(CTX.canvas, { minZoom: 0.1, maxZoom: 4, smooth: 0.05 }).subscribe(
}
CONTENT.update();
break;
- case GestureType.ZOOM:
+ case "zoom":
CONTENT.scale = e.zoom;
CONTENT.update();
}
diff --git a/examples/soa-ecs/package.json b/examples/soa-ecs/package.json
index 124c699ff2..6ad2163da9 100644
--- a/examples/soa-ecs/package.json
+++ b/examples/soa-ecs/package.json
@@ -44,6 +44,6 @@
"screenshot": "examples/soa-ecs-100k.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/soa-ecs/snowpack.config.js b/examples/soa-ecs/snowpack.config.js
index 765eced3f5..371ac4bf9e 100644
--- a/examples/soa-ecs/snowpack.config.js
+++ b/examples/soa-ecs/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/soa-ecs",
+ baseUrl: "/umbrella/soa-ecs",
},
};
diff --git a/examples/stratified-grid/package.json b/examples/stratified-grid/package.json
index ee1e299474..b4ec27ed50 100644
--- a/examples/stratified-grid/package.json
+++ b/examples/stratified-grid/package.json
@@ -31,6 +31,6 @@
"screenshot": "poisson/stratified-grid.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/stratified-grid/snowpack.config.js b/examples/stratified-grid/snowpack.config.js
index 318ed0a9ee..6685ec646f 100644
--- a/examples/stratified-grid/snowpack.config.js
+++ b/examples/stratified-grid/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/stratified-grid",
+ baseUrl: "/umbrella/stratified-grid",
},
};
diff --git a/examples/svg-barchart/package.json b/examples/svg-barchart/package.json
index d2c5fd4a6b..0238b81ec1 100644
--- a/examples/svg-barchart/package.json
+++ b/examples/svg-barchart/package.json
@@ -26,6 +26,6 @@
"screenshot": "examples/svg-barchart.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/svg-barchart/snowpack.config.js b/examples/svg-barchart/snowpack.config.js
index 5466adb6ad..21ebdc0de4 100644
--- a/examples/svg-barchart/snowpack.config.js
+++ b/examples/svg-barchart/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/svg-barchart",
+ baseUrl: "/umbrella/svg-barchart",
},
};
diff --git a/examples/svg-particles/package.json b/examples/svg-particles/package.json
index c907f23b20..41bba9030e 100644
--- a/examples/svg-particles/package.json
+++ b/examples/svg-particles/package.json
@@ -23,6 +23,6 @@
},
"thi.ng": {},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/svg-particles/snowpack.config.js b/examples/svg-particles/snowpack.config.js
index e46b4d2b07..3fb37abd6a 100644
--- a/examples/svg-particles/snowpack.config.js
+++ b/examples/svg-particles/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/svg-particles",
+ baseUrl: "/umbrella/svg-particles",
},
};
diff --git a/examples/svg-waveform/package.json b/examples/svg-waveform/package.json
index 1f2af98afb..2de146f4e2 100644
--- a/examples/svg-waveform/package.json
+++ b/examples/svg-waveform/package.json
@@ -36,6 +36,6 @@
"screenshot": "examples/svg-waveform.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/svg-waveform/snowpack.config.js b/examples/svg-waveform/snowpack.config.js
index 9a9f18026f..a1c408829d 100644
--- a/examples/svg-waveform/snowpack.config.js
+++ b/examples/svg-waveform/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/svg-waveform",
+ baseUrl: "/umbrella/svg-waveform",
},
};
diff --git a/examples/talk-slides/package.json b/examples/talk-slides/package.json
index 5b55cf367b..1a850372f6 100644
--- a/examples/talk-slides/package.json
+++ b/examples/talk-slides/package.json
@@ -33,6 +33,6 @@
"screenshot": "examples/talk-slides.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/talk-slides/snowpack.config.js b/examples/talk-slides/snowpack.config.js
index ed8dbf5a41..c0e7793712 100644
--- a/examples/talk-slides/snowpack.config.js
+++ b/examples/talk-slides/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/talk-slides",
+ baseUrl: "/umbrella/talk-slides",
},
};
diff --git a/examples/text-canvas/package.json b/examples/text-canvas/package.json
index 6a1524fc96..3e0c96f55c 100644
--- a/examples/text-canvas/package.json
+++ b/examples/text-canvas/package.json
@@ -28,6 +28,6 @@
"screenshot": "examples/text-canvas.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/text-canvas/snowpack.config.js b/examples/text-canvas/snowpack.config.js
index dea95ded68..07f95815cd 100644
--- a/examples/text-canvas/snowpack.config.js
+++ b/examples/text-canvas/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/text-canvas",
+ baseUrl: "/umbrella/text-canvas",
},
};
diff --git a/examples/todo-list/package.json b/examples/todo-list/package.json
index 839206a090..578d230264 100644
--- a/examples/todo-list/package.json
+++ b/examples/todo-list/package.json
@@ -32,6 +32,6 @@
"screenshot": "examples/todo-list.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/todo-list/snowpack.config.js b/examples/todo-list/snowpack.config.js
index f4fbd8ee77..d167a69a4c 100644
--- a/examples/todo-list/snowpack.config.js
+++ b/examples/todo-list/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/todo-list",
+ baseUrl: "/umbrella/todo-list",
},
};
diff --git a/examples/transducers-hdom/package.json b/examples/transducers-hdom/package.json
index ae025221cc..f5792711d3 100644
--- a/examples/transducers-hdom/package.json
+++ b/examples/transducers-hdom/package.json
@@ -28,6 +28,6 @@
]
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/transducers-hdom/snowpack.config.js b/examples/transducers-hdom/snowpack.config.js
index cf15009c8a..aa04f2d479 100644
--- a/examples/transducers-hdom/snowpack.config.js
+++ b/examples/transducers-hdom/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/transducers-hdom",
+ baseUrl: "/umbrella/transducers-hdom",
},
};
diff --git a/examples/triple-query/package.json b/examples/triple-query/package.json
index a8b0069be1..5b026dbb8e 100644
--- a/examples/triple-query/package.json
+++ b/examples/triple-query/package.json
@@ -41,6 +41,6 @@
"screenshot": "examples/triple-query.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/triple-query/snowpack.config.js b/examples/triple-query/snowpack.config.js
index 800d272938..800284a6aa 100644
--- a/examples/triple-query/snowpack.config.js
+++ b/examples/triple-query/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/triple-query",
+ baseUrl: "/umbrella/triple-query",
},
};
diff --git a/examples/webgl-cube/package.json b/examples/webgl-cube/package.json
index 5f09b4dff6..cb62e0c0e0 100644
--- a/examples/webgl-cube/package.json
+++ b/examples/webgl-cube/package.json
@@ -36,6 +36,6 @@
"screenshot": "examples/webgl-cube.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/webgl-cube/snowpack.config.js b/examples/webgl-cube/snowpack.config.js
index 80a069a0a7..e150a34bc4 100644
--- a/examples/webgl-cube/snowpack.config.js
+++ b/examples/webgl-cube/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/webgl-cube",
+ baseUrl: "/umbrella/webgl-cube",
},
};
diff --git a/examples/webgl-cubemap/package.json b/examples/webgl-cubemap/package.json
index 7b72b4c5f1..5123c55322 100644
--- a/examples/webgl-cubemap/package.json
+++ b/examples/webgl-cubemap/package.json
@@ -37,6 +37,6 @@
"screenshot": "examples/webgl-cubemap.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/webgl-cubemap/snowpack.config.js b/examples/webgl-cubemap/snowpack.config.js
index 272173c640..d71d1caded 100644
--- a/examples/webgl-cubemap/snowpack.config.js
+++ b/examples/webgl-cubemap/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/webgl-cubemap",
+ baseUrl: "/umbrella/webgl-cubemap",
},
};
diff --git a/examples/webgl-grid/package.json b/examples/webgl-grid/package.json
index 85c5a3d052..3da93715b6 100644
--- a/examples/webgl-grid/package.json
+++ b/examples/webgl-grid/package.json
@@ -39,6 +39,6 @@
"screenshot": "examples/webgl-grid.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/webgl-grid/snowpack.config.js b/examples/webgl-grid/snowpack.config.js
index 6bdf2f25a1..337a3975f4 100644
--- a/examples/webgl-grid/snowpack.config.js
+++ b/examples/webgl-grid/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/webgl-grid",
+ baseUrl: "/umbrella/webgl-grid",
},
};
diff --git a/examples/webgl-msdf/package.json b/examples/webgl-msdf/package.json
index 5daed837d1..0bf6634945 100644
--- a/examples/webgl-msdf/package.json
+++ b/examples/webgl-msdf/package.json
@@ -46,6 +46,6 @@
"screenshot": "examples/webgl-msdf.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/webgl-msdf/snowpack.config.js b/examples/webgl-msdf/snowpack.config.js
index c1f0980412..42ee10cba9 100644
--- a/examples/webgl-msdf/snowpack.config.js
+++ b/examples/webgl-msdf/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/webgl-msdf",
+ baseUrl: "/umbrella/webgl-msdf",
},
};
diff --git a/examples/webgl-multipass/package.json b/examples/webgl-multipass/package.json
index 118b9a94df..274091bf4c 100644
--- a/examples/webgl-multipass/package.json
+++ b/examples/webgl-multipass/package.json
@@ -26,6 +26,6 @@
"readme": true
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/webgl-multipass/snowpack.config.js b/examples/webgl-multipass/snowpack.config.js
index 6abf0d57a3..1fb51aeb72 100644
--- a/examples/webgl-multipass/snowpack.config.js
+++ b/examples/webgl-multipass/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/webgl-multipass",
+ baseUrl: "/umbrella/webgl-multipass",
},
};
diff --git a/examples/webgl-shadertoy/package.json b/examples/webgl-shadertoy/package.json
index 78a539290a..c1affe9806 100644
--- a/examples/webgl-shadertoy/package.json
+++ b/examples/webgl-shadertoy/package.json
@@ -27,6 +27,6 @@
"screenshot": "examples/webgl-shadertoy.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/webgl-shadertoy/snowpack.config.js b/examples/webgl-shadertoy/snowpack.config.js
index 4b22fb5c72..c7aa7830ad 100644
--- a/examples/webgl-shadertoy/snowpack.config.js
+++ b/examples/webgl-shadertoy/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/webgl-shadertoy",
+ baseUrl: "/umbrella/webgl-shadertoy",
},
};
diff --git a/examples/webgl-ssao/package.json b/examples/webgl-ssao/package.json
index 8550a7b208..5c04277ef7 100644
--- a/examples/webgl-ssao/package.json
+++ b/examples/webgl-ssao/package.json
@@ -40,6 +40,6 @@
"screenshot": "examples/webgl-ssao.jpg"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/webgl-ssao/snowpack.config.js b/examples/webgl-ssao/snowpack.config.js
index 062270df56..f87d5f5124 100644
--- a/examples/webgl-ssao/snowpack.config.js
+++ b/examples/webgl-ssao/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/webgl-ssao",
+ baseUrl: "/umbrella/webgl-ssao",
},
};
diff --git a/examples/webgl-ssao/src/index.ts b/examples/webgl-ssao/src/index.ts
index 1e6b1154ba..4875ae4e7c 100644
--- a/examples/webgl-ssao/src/index.ts
+++ b/examples/webgl-ssao/src/index.ts
@@ -202,10 +202,4 @@ const app = () => {
];
};
-const cancel = start(app());
-
-if (import.meta.hot) {
- import.meta.hot.accept(() => {
- cancel();
- });
-}
+start(app());
diff --git a/examples/wolfram/package.json b/examples/wolfram/package.json
index 2c6001679b..19609effea 100644
--- a/examples/wolfram/package.json
+++ b/examples/wolfram/package.json
@@ -34,6 +34,6 @@
"screenshot": "examples/wolfram.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/wolfram/snowpack.config.js b/examples/wolfram/snowpack.config.js
index 5d4f31dca7..4f6d5ee772 100644
--- a/examples/wolfram/snowpack.config.js
+++ b/examples/wolfram/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/wolfram",
+ baseUrl: "/umbrella/wolfram",
},
};
diff --git a/examples/xml-converter/package.json b/examples/xml-converter/package.json
index 3010cc8163..790644fde7 100644
--- a/examples/xml-converter/package.json
+++ b/examples/xml-converter/package.json
@@ -38,6 +38,6 @@
"screenshot": "examples/xml-converter.png"
},
"devDependencies": {
- "@types/snowpack-env": "^2.3.2"
+ "@types/snowpack-env": "^2.3.3"
}
}
diff --git a/examples/xml-converter/snowpack.config.js b/examples/xml-converter/snowpack.config.js
index 0a75b08722..f2b713b742 100644
--- a/examples/xml-converter/snowpack.config.js
+++ b/examples/xml-converter/snowpack.config.js
@@ -24,6 +24,6 @@ module.exports = {
installTypes: true,
},
buildOptions: {
- baseUrl: "/xml-converter",
+ baseUrl: "/umbrella/xml-converter",
},
};
diff --git a/package.json b/package.json
index 6ecc114fd0..f9a4dd155f 100644
--- a/package.json
+++ b/package.json
@@ -4,10 +4,11 @@
"packages/*"
],
"devDependencies": {
- "@microsoft/api-documenter": "^7.11.3",
- "@microsoft/api-extractor": "^7.12.0",
+ "@microsoft/api-documenter": "^7.12.1",
+ "@microsoft/api-extractor": "^7.12.1",
"@snowpack/plugin-typescript": "^1.1.1",
- "@snowpack/plugin-webpack": "^2.1.2",
+ "@snowpack/plugin-webpack": "^2.2.0",
+ "@types/snowpack-env": "^2.3.3",
"benchmark": "^2.1.4",
"file-loader": "^6.2.0",
"gzip-size": "^6.0.0",
@@ -16,24 +17,25 @@
"mocha": "^8.2.1",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
- "rollup": "^2.34.1",
+ "rollup": "^2.35.1",
"rollup-plugin-cleanup": "^3.2.1",
- "snowpack": "^2.18.0",
+ "snowpack": "^2.18.5",
"terser": "^5.5.1",
- "ts-loader": "^8.0.11",
- "typescript": "^4.1.2",
- "webpack": "^4.44.1",
- "webpack-cli": "^3.3.12"
+ "ts-loader": "^8.0.12",
+ "typescript": "^4.1.3",
+ "webpack": "^5.11.0",
+ "webpack-cli": "^4.2.0"
},
"dependencies": {
"@ygoe/msgpack": "^1.0.2"
},
"scripts": {
- "bootstrap": "lerna bootstrap",
- "build": "yarn install && lerna -v && lerna bootstrap && lerna run build --sort",
- "build:release": "yarn install && lerna -v && lerna bootstrap && lerna run build:release --sort",
+ "bootstrap": "yarn install && lerna -v && lerna bootstrap",
+ "build": "yarn bootstrap && lerna run build --sort",
+ "build:release": "yarn bootstrap && lerna run build:release --sort",
"build:es6only": "lerna run clean && lerna run build:es6 --sort",
"build:check": "lerna run build:check",
+ "clean": "lerna run clean",
"cover": "lerna run cover",
"doc": "lerna run doc",
"doc:readme": "lerna run doc:readme",
@@ -47,6 +49,6 @@
"tool:searchindex": "ts-node -P tools/tsconfig.json tools/src/build-search-index.ts"
},
"resolutions": {
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
}
}
diff --git a/packages/adapt-dpi/CHANGELOG.md b/packages/adapt-dpi/CHANGELOG.md
index 15aba9c24f..be95a5bb35 100644
--- a/packages/adapt-dpi/CHANGELOG.md
+++ b/packages/adapt-dpi/CHANGELOG.md
@@ -3,55 +3,7 @@
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/adapt-dpi@1.0.10...@thi.ng/adapt-dpi@1.0.11) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/adapt-dpi
-
-
-
-
-
-## [1.0.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/adapt-dpi@1.0.9...@thi.ng/adapt-dpi@1.0.10) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/adapt-dpi
-
-
-
-
-
-## [1.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/adapt-dpi@1.0.8...@thi.ng/adapt-dpi@1.0.9) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/adapt-dpi
-
-
-
-
-
-## [1.0.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/adapt-dpi@1.0.7...@thi.ng/adapt-dpi@1.0.8) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/adapt-dpi
-
-
-
-
-
-## [1.0.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/adapt-dpi@1.0.6...@thi.ng/adapt-dpi@1.0.7) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/adapt-dpi
-
-
-
-
-
-## [1.0.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/adapt-dpi@1.0.5...@thi.ng/adapt-dpi@1.0.6) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/adapt-dpi
-
-
-
-
-
-## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/adapt-dpi@1.0.4...@thi.ng/adapt-dpi@1.0.5) (2020-08-16)
+## [1.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/adapt-dpi@1.0.11...@thi.ng/adapt-dpi@1.0.12) (2020-12-22)
**Note:** Version bump only for package @thi.ng/adapt-dpi
diff --git a/packages/adapt-dpi/package.json b/packages/adapt-dpi/package.json
index 9880c0a85e..e108d48cda 100644
--- a/packages/adapt-dpi/package.json
+++ b/packages/adapt-dpi/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/adapt-dpi",
- "version": "1.0.11",
+ "version": "1.0.12",
"description": "HDPI canvas adapter / styling utility",
"module": "./index.js",
"main": "./lib/index.js",
@@ -38,14 +38,14 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"files": [
"*.js",
diff --git a/packages/adjacency/CHANGELOG.md b/packages/adjacency/CHANGELOG.md
index 62f905139e..b7c2e25397 100644
--- a/packages/adjacency/CHANGELOG.md
+++ b/packages/adjacency/CHANGELOG.md
@@ -3,89 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.1.67](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.66...@thi.ng/adjacency@0.1.67) (2020-12-07)
+# [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.67...@thi.ng/adjacency@0.2.0) (2020-12-22)
-**Note:** Version bump only for package @thi.ng/adjacency
+### Code Refactoring
+* **adjacency:** fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace enum w/ type alias ([88edbe1](https://github.com/thi-ng/umbrella/commit/88edbe10ffe9ceb9f5e8494c9a60b8067a7d57d1))
+### BREAKING CHANGES
-## [0.1.66](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.65...@thi.ng/adjacency@0.1.66) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/adjacency
-
-
-
-
-
-## [0.1.65](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.64...@thi.ng/adjacency@0.1.65) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/adjacency
-
-
-
-
-
-## [0.1.64](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.63...@thi.ng/adjacency@0.1.64) (2020-10-19)
-
-**Note:** Version bump only for package @thi.ng/adjacency
-
-
-
-
-
-## [0.1.63](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.62...@thi.ng/adjacency@0.1.63) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/adjacency
-
-
-
-
-
-## [0.1.62](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.61...@thi.ng/adjacency@0.1.62) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/adjacency
-
-
-
-
-
-## [0.1.61](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.60...@thi.ng/adjacency@0.1.61) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/adjacency
-
-
-
-
-
-## [0.1.60](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.59...@thi.ng/adjacency@0.1.60) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/adjacency
-
-
-
-
-
-## [0.1.59](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.58...@thi.ng/adjacency@0.1.59) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/adjacency
-
-
-
-
-
-## [0.1.58](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.57...@thi.ng/adjacency@0.1.58) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/adjacency
-
-
-
-
-
-## [0.1.57](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.56...@thi.ng/adjacency@0.1.57) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/adjacency
+* **adjacency:** replace DegreeType w/ type alias
diff --git a/packages/adjacency/README.md b/packages/adjacency/README.md
index 9845e5e261..7e0fc91ec6 100644
--- a/packages/adjacency/README.md
+++ b/packages/adjacency/README.md
@@ -42,7 +42,7 @@ yarn add @thi.ng/adjacency
```
-Package sizes (gzipped, pre-treeshake): ESM: 1.81 KB / CJS: 1.88 KB / UMD: 1.98 KB
+Package sizes (gzipped, pre-treeshake): ESM: 1.74 KB / CJS: 1.82 KB / UMD: 1.92 KB
## Dependencies
diff --git a/packages/adjacency/package.json b/packages/adjacency/package.json
index 61049d4f30..40ab2dbd25 100644
--- a/packages/adjacency/package.json
+++ b/packages/adjacency/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/adjacency",
- "version": "0.1.67",
+ "version": "0.2.0",
"description": "Sparse & bitwise adjacency matrices and related functions for directed & undirected graphs",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,23 +39,23 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@thi.ng/vectors": "^4.8.2",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@thi.ng/vectors": "^4.8.3",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/binary": "^2.0.19",
- "@thi.ng/bitfield": "^0.3.25",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/dcons": "^2.3.3",
- "@thi.ng/sparse": "^0.1.58"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/binary": "^2.0.20",
+ "@thi.ng/bitfield": "^0.3.26",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/dcons": "^2.3.4",
+ "@thi.ng/sparse": "^0.1.59"
},
"files": [
"*.js",
diff --git a/packages/adjacency/src/api.ts b/packages/adjacency/src/api.ts
index f171b55f38..6fc236ef1c 100644
--- a/packages/adjacency/src/api.ts
+++ b/packages/adjacency/src/api.ts
@@ -1,10 +1,6 @@
import type { Fn2, Pair } from "@thi.ng/api";
-export enum DegreeType {
- IN,
- OUT,
- BOTH,
-}
+export type DegreeType = "in" | "out" | "both";
export interface IGraph {
numEdges(): number;
diff --git a/packages/adjacency/src/sparse.ts b/packages/adjacency/src/sparse.ts
index 209109a3b7..e1dfc09cc9 100644
--- a/packages/adjacency/src/sparse.ts
+++ b/packages/adjacency/src/sparse.ts
@@ -1,6 +1,6 @@
import type { Pair } from "@thi.ng/api";
import { CSR } from "@thi.ng/sparse";
-import { DegreeType, IGraph } from "./api";
+import type { DegreeType, IGraph } from "./api";
export class AdjacencyMatrix extends CSR implements IGraph {
static newEmpty(n: number, undirected = false) {
@@ -96,21 +96,21 @@ export class AdjacencyMatrix extends CSR implements IGraph {
*
* @param deg - degree type
*/
- degreeMat(deg: DegreeType = DegreeType.OUT) {
+ degreeMat(deg: DegreeType = "out") {
const res = CSR.empty(this.m);
switch (deg) {
- case DegreeType.OUT:
+ case "out":
default:
for (let i = this.m; --i >= 0; ) {
res.setAt(i, i, this.nnzRow(i));
}
break;
- case DegreeType.IN:
+ case "in":
for (let i = this.m; --i >= 0; ) {
res.setAt(i, i, this.nnzCol(i));
}
break;
- case DegreeType.BOTH:
+ case "both":
for (let i = this.m; --i >= 0; ) {
res.setAt(i, i, this.nnzRow(i) + this.nnzCol(i));
}
diff --git a/packages/api/CHANGELOG.md b/packages/api/CHANGELOG.md
index 109604e376..4314914208 100644
--- a/packages/api/CHANGELOG.md
+++ b/packages/api/CHANGELOG.md
@@ -3,31 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [6.13.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.13.3...@thi.ng/api@6.13.4) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/api
-
-
-
-
-
-## [6.13.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.13.2...@thi.ng/api@6.13.3) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/api
-
-
-
-
-
-## [6.13.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.13.1...@thi.ng/api@6.13.2) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/api
-
-
-
-
-
-## [6.13.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.13.0...@thi.ng/api@6.13.1) (2020-09-22)
+## [6.13.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.13.4...@thi.ng/api@6.13.5) (2020-12-22)
**Note:** Version bump only for package @thi.ng/api
@@ -52,30 +28,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [6.12.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.12.2...@thi.ng/api@6.12.3) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/api
-
-
-
-
-
-## [6.12.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.12.1...@thi.ng/api@6.12.2) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/api
-
-
-
-
-
-## [6.12.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.12.0...@thi.ng/api@6.12.1) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/api
-
-
-
-
-
# [6.12.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.11.3...@thi.ng/api@6.12.0) (2020-07-28)
diff --git a/packages/api/package.json b/packages/api/package.json
index 0f74b95a04..7aa8221f97 100644
--- a/packages/api/package.json
+++ b/packages/api/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/api",
- "version": "6.13.4",
+ "version": "6.13.5",
"description": "Common, generic types, interfaces & mixins",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,14 +39,14 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"files": [
"*.js",
diff --git a/packages/arrays/CHANGELOG.md b/packages/arrays/CHANGELOG.md
index 66a3be8452..0654915056 100644
--- a/packages/arrays/CHANGELOG.md
+++ b/packages/arrays/CHANGELOG.md
@@ -3,31 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.8.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.8.3...@thi.ng/arrays@0.8.4) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/arrays
-
-
-
-
-
-## [0.8.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.8.2...@thi.ng/arrays@0.8.3) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/arrays
-
-
-
-
-
-## [0.8.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.8.1...@thi.ng/arrays@0.8.2) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/arrays
-
-
-
-
-
-## [0.8.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.8.0...@thi.ng/arrays@0.8.1) (2020-09-22)
+## [0.8.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.8.4...@thi.ng/arrays@0.8.5) (2020-12-22)
**Note:** Version bump only for package @thi.ng/arrays
@@ -57,22 +33,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.6.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.6.14...@thi.ng/arrays@0.6.15) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/arrays
-
-
-
-
-
-## [0.6.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.6.13...@thi.ng/arrays@0.6.14) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/arrays
-
-
-
-
-
# [0.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.5.6...@thi.ng/arrays@0.6.0) (2020-03-28)
diff --git a/packages/arrays/package.json b/packages/arrays/package.json
index baaf6d69b0..6adee97f7a 100644
--- a/packages/arrays/package.json
+++ b/packages/arrays/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/arrays",
- "version": "0.8.4",
+ "version": "0.8.5",
"description": "Array / Arraylike utilities",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,22 +39,22 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/compare": "^1.3.20",
- "@thi.ng/equiv": "^1.0.33",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/random": "^2.1.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/compare": "^1.3.21",
+ "@thi.ng/equiv": "^1.0.34",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/random": "^2.1.3"
},
"files": [
"*.js",
diff --git a/packages/associative/CHANGELOG.md b/packages/associative/CHANGELOG.md
index 235a9c9e9a..8ce196d0c8 100644
--- a/packages/associative/CHANGELOG.md
+++ b/packages/associative/CHANGELOG.md
@@ -3,71 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [5.0.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@5.0.10...@thi.ng/associative@5.0.11) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/associative
-
-
-
-
-
-## [5.0.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@5.0.9...@thi.ng/associative@5.0.10) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/associative
-
-
-
-
-
-## [5.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@5.0.8...@thi.ng/associative@5.0.9) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/associative
-
-
-
-
-
-## [5.0.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@5.0.7...@thi.ng/associative@5.0.8) (2020-10-19)
-
-**Note:** Version bump only for package @thi.ng/associative
-
-
-
-
-
-## [5.0.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@5.0.6...@thi.ng/associative@5.0.7) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/associative
-
-
-
-
-
-## [5.0.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@5.0.5...@thi.ng/associative@5.0.6) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/associative
-
-
-
-
-
-## [5.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@5.0.4...@thi.ng/associative@5.0.5) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/associative
-
-
-
-
-
-## [5.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@5.0.3...@thi.ng/associative@5.0.4) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/associative
-
-
-
-
-
-## [5.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@5.0.2...@thi.ng/associative@5.0.3) (2020-08-16)
+## [5.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@5.0.11...@thi.ng/associative@5.0.12) (2020-12-22)
**Note:** Version bump only for package @thi.ng/associative
diff --git a/packages/associative/package.json b/packages/associative/package.json
index a72eb0801b..5a59fda408 100644
--- a/packages/associative/package.json
+++ b/packages/associative/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/associative",
- "version": "5.0.11",
+ "version": "5.0.12",
"description": "Alternative Map and Set implementations with customizable equality semantics & supporting operations",
"module": "./index.js",
"main": "./lib/index.js",
@@ -31,7 +31,7 @@
"build:check": "tsc --isolatedModules --noEmit",
"test": "mocha test",
"cover": "nyc mocha test && nyc report --reporter=lcov",
- "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib",
+ "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib internal",
"doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
"doc": "node_modules/.bin/typedoc --mode modules --out doc --theme ../../tools/doc/typedoc-theme src",
"doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
@@ -39,24 +39,24 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/binary": "^2.0.19",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/compare": "^1.3.20",
- "@thi.ng/dcons": "^2.3.3",
- "@thi.ng/equiv": "^1.0.33",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/transducers": "^7.5.2",
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/binary": "^2.0.20",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/compare": "^1.3.21",
+ "@thi.ng/dcons": "^2.3.4",
+ "@thi.ng/equiv": "^1.0.34",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/transducers": "^7.5.3",
"tslib": "2.0.1"
},
"files": [
diff --git a/packages/atom/CHANGELOG.md b/packages/atom/CHANGELOG.md
index 7333bf0008..657a1a1dd6 100644
--- a/packages/atom/CHANGELOG.md
+++ b/packages/atom/CHANGELOG.md
@@ -3,63 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [4.1.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@4.1.23...@thi.ng/atom@4.1.24) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/atom
-
-
-
-
-
-## [4.1.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@4.1.22...@thi.ng/atom@4.1.23) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/atom
-
-
-
-
-
-## [4.1.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@4.1.21...@thi.ng/atom@4.1.22) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/atom
-
-
-
-
-
-## [4.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@4.1.20...@thi.ng/atom@4.1.21) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/atom
-
-
-
-
-
-## [4.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@4.1.19...@thi.ng/atom@4.1.20) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/atom
-
-
-
-
-
-## [4.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@4.1.18...@thi.ng/atom@4.1.19) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/atom
-
-
-
-
-
-## [4.1.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@4.1.17...@thi.ng/atom@4.1.18) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/atom
-
-
-
-
-
-## [4.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@4.1.16...@thi.ng/atom@4.1.17) (2020-08-16)
+## [4.1.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/atom@4.1.24...@thi.ng/atom@4.1.25) (2020-12-22)
**Note:** Version bump only for package @thi.ng/atom
diff --git a/packages/atom/package.json b/packages/atom/package.json
index 29f5dd0b84..1f812f1aa5 100644
--- a/packages/atom/package.json
+++ b/packages/atom/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/atom",
- "version": "4.1.24",
+ "version": "4.1.25",
"description": "Mutable wrappers for nested immutable values with optional undo/redo history and transaction support",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,20 +39,20 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/equiv": "^1.0.33",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/paths": "^4.1.10",
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/equiv": "^1.0.34",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/paths": "^4.1.11",
"tslib": "2.0.1"
},
"files": [
diff --git a/packages/bench/CHANGELOG.md b/packages/bench/CHANGELOG.md
index 515f838231..6b29997c57 100644
--- a/packages/bench/CHANGELOG.md
+++ b/packages/bench/CHANGELOG.md
@@ -3,63 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [2.0.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.0.23...@thi.ng/bench@2.0.24) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/bench
-
-
-
-
-
-## [2.0.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.0.22...@thi.ng/bench@2.0.23) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/bench
-
-
-
-
-
-## [2.0.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.0.21...@thi.ng/bench@2.0.22) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/bench
-
-
-
-
-
-## [2.0.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.0.20...@thi.ng/bench@2.0.21) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/bench
-
-
-
-
-
-## [2.0.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.0.19...@thi.ng/bench@2.0.20) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/bench
-
-
-
-
-
-## [2.0.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.0.18...@thi.ng/bench@2.0.19) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/bench
-
-
-
-
-
-## [2.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.0.17...@thi.ng/bench@2.0.18) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/bench
-
-
-
-
-
-## [2.0.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.0.16...@thi.ng/bench@2.0.17) (2020-08-16)
+## [2.0.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/bench@2.0.24...@thi.ng/bench@2.0.25) (2020-12-22)
**Note:** Version bump only for package @thi.ng/bench
diff --git a/packages/bench/package.json b/packages/bench/package.json
index bfbfc56b8d..ff9f85fa82 100644
--- a/packages/bench/package.json
+++ b/packages/bench/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/bench",
- "version": "2.0.24",
+ "version": "2.0.25",
"description": "Benchmarking utilities w/ optional statistics",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,14 +39,14 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"files": [
"*.js",
diff --git a/packages/bencode/CHANGELOG.md b/packages/bencode/CHANGELOG.md
index e955cb00c0..cb528fffe6 100644
--- a/packages/bencode/CHANGELOG.md
+++ b/packages/bencode/CHANGELOG.md
@@ -3,71 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.3.43](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.3.42...@thi.ng/bencode@0.3.43) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/bencode
-
-
-
-
-
-## [0.3.42](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.3.41...@thi.ng/bencode@0.3.42) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/bencode
-
-
-
-
-
-## [0.3.41](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.3.40...@thi.ng/bencode@0.3.41) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/bencode
-
-
-
-
-
-## [0.3.40](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.3.39...@thi.ng/bencode@0.3.40) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/bencode
-
-
-
-
-
-## [0.3.39](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.3.38...@thi.ng/bencode@0.3.39) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/bencode
-
-
-
-
-
-## [0.3.38](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.3.37...@thi.ng/bencode@0.3.38) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/bencode
-
-
-
-
-
-## [0.3.37](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.3.36...@thi.ng/bencode@0.3.37) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/bencode
-
-
-
-
-
-## [0.3.36](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.3.35...@thi.ng/bencode@0.3.36) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/bencode
-
-
-
-
-
-## [0.3.35](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.3.34...@thi.ng/bencode@0.3.35) (2020-08-16)
+## [0.3.44](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.3.43...@thi.ng/bencode@0.3.44) (2020-12-22)
**Note:** Version bump only for package @thi.ng/bencode
diff --git a/packages/bencode/package.json b/packages/bencode/package.json
index 64323cd652..967d0df374 100644
--- a/packages/bencode/package.json
+++ b/packages/bencode/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/bencode",
- "version": "0.3.43",
+ "version": "0.3.44",
"description": "Bencode binary encoder / decoder with optional UTF8 encoding & floating point support",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,23 +39,23 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/arrays": "^0.8.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/defmulti": "^1.3.2",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/transducers": "^7.5.2",
- "@thi.ng/transducers-binary": "^0.5.33"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/arrays": "^0.8.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/defmulti": "^1.3.3",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/transducers": "^7.5.3",
+ "@thi.ng/transducers-binary": "^0.6.0"
},
"files": [
"*.js",
diff --git a/packages/binary/CHANGELOG.md b/packages/binary/CHANGELOG.md
index d969332d17..7f1b7aa559 100644
--- a/packages/binary/CHANGELOG.md
+++ b/packages/binary/CHANGELOG.md
@@ -3,63 +3,7 @@
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/binary@2.0.18...@thi.ng/binary@2.0.19) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/binary
-
-
-
-
-
-## [2.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/binary@2.0.17...@thi.ng/binary@2.0.18) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/binary
-
-
-
-
-
-## [2.0.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/binary@2.0.16...@thi.ng/binary@2.0.17) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/binary
-
-
-
-
-
-## [2.0.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/binary@2.0.15...@thi.ng/binary@2.0.16) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/binary
-
-
-
-
-
-## [2.0.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/binary@2.0.14...@thi.ng/binary@2.0.15) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/binary
-
-
-
-
-
-## [2.0.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/binary@2.0.13...@thi.ng/binary@2.0.14) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/binary
-
-
-
-
-
-## [2.0.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/binary@2.0.12...@thi.ng/binary@2.0.13) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/binary
-
-
-
-
-
-## [2.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/binary@2.0.11...@thi.ng/binary@2.0.12) (2020-08-16)
+## [2.0.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/binary@2.0.19...@thi.ng/binary@2.0.20) (2020-12-22)
**Note:** Version bump only for package @thi.ng/binary
diff --git a/packages/binary/package.json b/packages/binary/package.json
index 8dc76bc618..37ac3d1c0d 100644
--- a/packages/binary/package.json
+++ b/packages/binary/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/binary",
- "version": "2.0.19",
+ "version": "2.0.20",
"description": "95+ assorted binary / bitwise operations, conversions, utilities",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,17 +39,17 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4"
+ "@thi.ng/api": "^6.13.5"
},
"files": [
"*.js",
diff --git a/packages/bitfield/CHANGELOG.md b/packages/bitfield/CHANGELOG.md
index 8ff891f58e..f114c6857f 100644
--- a/packages/bitfield/CHANGELOG.md
+++ b/packages/bitfield/CHANGELOG.md
@@ -3,71 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.3.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.3.24...@thi.ng/bitfield@0.3.25) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/bitfield
-
-
-
-
-
-## [0.3.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.3.23...@thi.ng/bitfield@0.3.24) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/bitfield
-
-
-
-
-
-## [0.3.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.3.22...@thi.ng/bitfield@0.3.23) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/bitfield
-
-
-
-
-
-## [0.3.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.3.21...@thi.ng/bitfield@0.3.22) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/bitfield
-
-
-
-
-
-## [0.3.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.3.20...@thi.ng/bitfield@0.3.21) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/bitfield
-
-
-
-
-
-## [0.3.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.3.19...@thi.ng/bitfield@0.3.20) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/bitfield
-
-
-
-
-
-## [0.3.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.3.18...@thi.ng/bitfield@0.3.19) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/bitfield
-
-
-
-
-
-## [0.3.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.3.17...@thi.ng/bitfield@0.3.18) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/bitfield
-
-
-
-
-
-## [0.3.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.3.16...@thi.ng/bitfield@0.3.17) (2020-08-16)
+## [0.3.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitfield@0.3.25...@thi.ng/bitfield@0.3.26) (2020-12-22)
**Note:** Version bump only for package @thi.ng/bitfield
diff --git a/packages/bitfield/package.json b/packages/bitfield/package.json
index 3b383ece35..91729f2e02 100644
--- a/packages/bitfield/package.json
+++ b/packages/bitfield/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/bitfield",
- "version": "0.3.25",
+ "version": "0.3.26",
"description": "1D / 2D bit field implementations",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,19 +39,19 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/binary": "^2.0.19",
- "@thi.ng/strings": "^1.11.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/binary": "^2.0.20",
+ "@thi.ng/strings": "^1.11.3"
},
"files": [
"*.js",
diff --git a/packages/bitstream/CHANGELOG.md b/packages/bitstream/CHANGELOG.md
index 0f46f2e8bb..0e9d154f3a 100644
--- a/packages/bitstream/CHANGELOG.md
+++ b/packages/bitstream/CHANGELOG.md
@@ -3,55 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.1.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitstream@1.1.28...@thi.ng/bitstream@1.1.29) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/bitstream
-
-
-
-
-
-## [1.1.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitstream@1.1.27...@thi.ng/bitstream@1.1.28) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/bitstream
-
-
-
-
-
-## [1.1.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitstream@1.1.26...@thi.ng/bitstream@1.1.27) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/bitstream
-
-
-
-
-
-## [1.1.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitstream@1.1.25...@thi.ng/bitstream@1.1.26) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/bitstream
-
-
-
-
-
-## [1.1.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitstream@1.1.24...@thi.ng/bitstream@1.1.25) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/bitstream
-
-
-
-
-
-## [1.1.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitstream@1.1.23...@thi.ng/bitstream@1.1.24) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/bitstream
-
-
-
-
-
-## [1.1.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitstream@1.1.22...@thi.ng/bitstream@1.1.23) (2020-08-16)
+## [1.1.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/bitstream@1.1.29...@thi.ng/bitstream@1.1.30) (2020-12-22)
**Note:** Version bump only for package @thi.ng/bitstream
diff --git a/packages/bitstream/package.json b/packages/bitstream/package.json
index 109f7e63a6..d7c15c092a 100644
--- a/packages/bitstream/package.json
+++ b/packages/bitstream/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/bitstream",
- "version": "1.1.29",
+ "version": "1.1.30",
"description": "ES6 iterator based read/write bit streams with support for variable word widths",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,17 +39,17 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/errors": "^1.2.24"
+ "@thi.ng/errors": "^1.2.25"
},
"files": [
"*.js",
diff --git a/packages/cache/CHANGELOG.md b/packages/cache/CHANGELOG.md
index 6f1c5f2bff..0ec3f151cd 100644
--- a/packages/cache/CHANGELOG.md
+++ b/packages/cache/CHANGELOG.md
@@ -3,71 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.0.63](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.62...@thi.ng/cache@1.0.63) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/cache
-
-
-
-
-
-## [1.0.62](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.61...@thi.ng/cache@1.0.62) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/cache
-
-
-
-
-
-## [1.0.61](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.60...@thi.ng/cache@1.0.61) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/cache
-
-
-
-
-
-## [1.0.60](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.59...@thi.ng/cache@1.0.60) (2020-10-19)
-
-**Note:** Version bump only for package @thi.ng/cache
-
-
-
-
-
-## [1.0.59](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.58...@thi.ng/cache@1.0.59) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/cache
-
-
-
-
-
-## [1.0.58](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.57...@thi.ng/cache@1.0.58) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/cache
-
-
-
-
-
-## [1.0.57](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.56...@thi.ng/cache@1.0.57) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/cache
-
-
-
-
-
-## [1.0.56](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.55...@thi.ng/cache@1.0.56) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/cache
-
-
-
-
-
-## [1.0.55](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.54...@thi.ng/cache@1.0.55) (2020-08-16)
+## [1.0.64](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.63...@thi.ng/cache@1.0.64) (2020-12-22)
**Note:** Version bump only for package @thi.ng/cache
diff --git a/packages/cache/package.json b/packages/cache/package.json
index ba3470eb54..807e33a8d2 100644
--- a/packages/cache/package.json
+++ b/packages/cache/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/cache",
- "version": "1.0.63",
+ "version": "1.0.64",
"description": "In-memory cache implementations with ES6 Map-like API and different eviction strategies",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,19 +39,19 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/dcons": "^2.3.3",
- "@thi.ng/transducers": "^7.5.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/dcons": "^2.3.4",
+ "@thi.ng/transducers": "^7.5.3"
},
"files": [
"*.js",
diff --git a/packages/checks/CHANGELOG.md b/packages/checks/CHANGELOG.md
index 4832c7b477..9c12b2d2a8 100644
--- a/packages/checks/CHANGELOG.md
+++ b/packages/checks/CHANGELOG.md
@@ -3,55 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [2.7.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@2.7.10...@thi.ng/checks@2.7.11) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/checks
-
-
-
-
-
-## [2.7.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@2.7.9...@thi.ng/checks@2.7.10) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/checks
-
-
-
-
-
-## [2.7.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@2.7.8...@thi.ng/checks@2.7.9) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/checks
-
-
-
-
-
-## [2.7.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@2.7.7...@thi.ng/checks@2.7.8) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/checks
-
-
-
-
-
-## [2.7.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@2.7.6...@thi.ng/checks@2.7.7) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/checks
-
-
-
-
-
-## [2.7.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@2.7.5...@thi.ng/checks@2.7.6) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/checks
-
-
-
-
-
-## [2.7.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@2.7.4...@thi.ng/checks@2.7.5) (2020-08-16)
+## [2.7.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@2.7.11...@thi.ng/checks@2.7.12) (2020-12-22)
**Note:** Version bump only for package @thi.ng/checks
diff --git a/packages/checks/package.json b/packages/checks/package.json
index 6574d464bf..f86c3e27c5 100644
--- a/packages/checks/package.json
+++ b/packages/checks/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/checks",
- "version": "2.7.11",
+ "version": "2.7.12",
"description": "Collection of 50+ type, feature & value checks",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,14 +39,14 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
"tslib": "2.0.1"
diff --git a/packages/color/CHANGELOG.md b/packages/color/CHANGELOG.md
index 8c5b849d02..a25e5fa81e 100644
--- a/packages/color/CHANGELOG.md
+++ b/packages/color/CHANGELOG.md
@@ -3,17 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.3.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@1.3.1...@thi.ng/color@1.3.2) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/color
+# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@1.3.2...@thi.ng/color@2.0.0) (2020-12-22)
+### Code Refactoring
+* **color:** fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace enum w/ type alias ([17e2449](https://github.com/thi-ng/umbrella/commit/17e244969d2d39e17cdea739308928adc17d5392))
-## [1.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@1.3.0...@thi.ng/color@1.3.1) (2020-11-26)
+### BREAKING CHANGES
-**Note:** Version bump only for package @thi.ng/color
+* **color:** replace ColorMode w/ type alias
@@ -30,62 +30,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [1.2.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@1.2.17...@thi.ng/color@1.2.18) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/color
-
-
-
-
-
-## [1.2.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@1.2.16...@thi.ng/color@1.2.17) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/color
-
-
-
-
-
-## [1.2.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@1.2.15...@thi.ng/color@1.2.16) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/color
-
-
-
-
-
-## [1.2.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@1.2.14...@thi.ng/color@1.2.15) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/color
-
-
-
-
-
-## [1.2.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@1.2.13...@thi.ng/color@1.2.14) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/color
-
-
-
-
-
-## [1.2.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@1.2.12...@thi.ng/color@1.2.13) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/color
-
-
-
-
-
-## [1.2.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@1.2.11...@thi.ng/color@1.2.12) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/color
-
-
-
-
-
# [1.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@1.1.21...@thi.ng/color@1.2.0) (2020-05-29)
diff --git a/packages/color/README.md b/packages/color/README.md
index 3cdc53cb2f..a8811f80dc 100644
--- a/packages/color/README.md
+++ b/packages/color/README.md
@@ -194,7 +194,7 @@ yarn add @thi.ng/color
```
-Package sizes (gzipped, pre-treeshake): ESM: 7.21 KB / CJS: 7.58 KB / UMD: 7.16 KB
+Package sizes (gzipped, pre-treeshake): ESM: 7.08 KB / CJS: 7.44 KB / UMD: 7.00 KB
## Dependencies
@@ -239,7 +239,7 @@ const b = col.parseCss("hsla(30,100%,50%,0.75)");
// route #3: convert() multi-method: CSS -> RGBA -> HSVA
// (see convert.ts)
-const c = col.convert("rgb(0,255,255)", col.ColorMode.HSVA, col.ColorMode.CSS);
+const c = col.convert("rgb(0,255,255)", "hsv", "css");
// [ 0.4999999722222268, 0.9999990000010001, 1, 1 ]
// route #4: direct conversion RGBA -> HSLA -> CSS
@@ -249,7 +249,7 @@ col.hslaCss(col.rgbaHsla([], [1, 0.5, 0.5, 1]))
// "hsl(0.00,100.00%,75.00%)"
col.luminance(col.css("white"))
-col.luminance(0xffffff, col.ColorMode.INT32)
+col.luminance(0xffffff, "int")
// 1
// apply color matrix (RGBA only)
diff --git a/packages/color/package.json b/packages/color/package.json
index 010e98d400..2c8beac3c0 100644
--- a/packages/color/package.json
+++ b/packages/color/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/color",
- "version": "1.3.2",
+ "version": "2.0.0",
"description": "Array-based color ops, conversions, multi-color gradients, presets",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,25 +39,25 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/compose": "^1.4.21",
- "@thi.ng/defmulti": "^1.3.2",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/strings": "^1.11.2",
- "@thi.ng/transducers": "^7.5.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/compose": "^1.4.22",
+ "@thi.ng/defmulti": "^1.3.3",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/strings": "^1.11.3",
+ "@thi.ng/transducers": "^7.5.3",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/color/src/api.ts b/packages/color/src/api.ts
index 3e16ba0b00..8e8cc42673 100644
--- a/packages/color/src/api.ts
+++ b/packages/color/src/api.ts
@@ -1,6 +1,16 @@
import type { Tuple } from "@thi.ng/api";
import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
-import type { ColorMode } from "./constants";
+
+export type ColorMode =
+ | "rgb"
+ | "hcy"
+ | "hsv"
+ | "hsl"
+ | "hsi"
+ | "int"
+ | "css"
+ | "xyz"
+ | "ycbcr";
export type Color = Vec;
export type ReadonlyColor = ReadonlyVec;
diff --git a/packages/color/src/constants.ts b/packages/color/src/constants.ts
index 1c9721d682..bf114b6e08 100644
--- a/packages/color/src/constants.ts
+++ b/packages/color/src/constants.ts
@@ -1,17 +1,5 @@
import { float, percent } from "@thi.ng/strings";
-export enum ColorMode {
- RGBA,
- HCYA,
- HSVA,
- HSLA,
- HSIA,
- INT32,
- CSS,
- XYZA,
- YCBCRA,
-}
-
// RGBA constants
export const BLACK = Object.freeze([0, 0, 0, 1]);
diff --git a/packages/color/src/convert.ts b/packages/color/src/convert.ts
index a3cac44143..9abd2648d7 100644
--- a/packages/color/src/convert.ts
+++ b/packages/color/src/convert.ts
@@ -1,8 +1,13 @@
import type { Implementation2O, MultiFn2O } from "@thi.ng/defmulti";
import { DEFAULT, defmulti } from "@thi.ng/defmulti";
import { illegalArgs } from "@thi.ng/errors";
-import type { Color, ColorConversion, IColor, ReadonlyColor } from "./api";
-import { ColorMode } from "./constants";
+import type {
+ Color,
+ ColorConversion,
+ ColorMode,
+ IColor,
+ ReadonlyColor,
+} from "./api";
import { hcyaRgba } from "./hcya-rgba";
import { hsiaRgba } from "./hsia-rgba";
import { hslaCss } from "./hsla-css";
@@ -49,7 +54,7 @@ export function asCSS(
mode: ColorMode
): string;
export function asCSS(col: any, mode?: ColorMode) {
- return convert(col, ColorMode.CSS, mode);
+ return convert(col, "css", mode);
}
export function asRGBA(col: IColor): Color;
@@ -58,7 +63,7 @@ export function asRGBA(
mode: ColorMode
): Color;
export function asRGBA(col: any, mode?: ColorMode) {
- return convert(col, ColorMode.RGBA, mode);
+ return convert(col, "rgb", mode);
}
export function asHCYA(col: IColor): Color;
@@ -67,7 +72,7 @@ export function asHCYA(
mode: ColorMode
): Color;
export function asHCYA(col: any, mode?: ColorMode) {
- return convert(col, ColorMode.HCYA, mode);
+ return convert(col, "hcy", mode);
}
export function asHSIA(col: IColor): Color;
@@ -76,7 +81,7 @@ export function asHSIA(
mode: ColorMode
): Color;
export function asHSIA(col: any, mode?: ColorMode) {
- return convert(col, ColorMode.HSIA, mode);
+ return convert(col, "hsi", mode);
}
export function asHSLA(col: IColor): Color;
@@ -85,7 +90,7 @@ export function asHSLA(
mode: ColorMode
): Color;
export function asHSLA(col: any, mode?: ColorMode) {
- return convert(col, ColorMode.HSLA, mode);
+ return convert(col, "hsl", mode);
}
export function asHSVA(col: IColor): Color;
@@ -94,7 +99,7 @@ export function asHSVA(
mode: ColorMode
): Color;
export function asHSVA(col: any, mode?: ColorMode) {
- return convert(col, ColorMode.HSVA, mode);
+ return convert(col, "hsv", mode);
}
export function asXYZA(col: IColor): Color;
@@ -103,7 +108,7 @@ export function asXYZA(
mode: ColorMode
): Color;
export function asXYZA(col: any, mode?: ColorMode) {
- return convert(col, ColorMode.XYZA, mode);
+ return convert(col, "xyz", mode);
}
export function asYCbCrA(col: IColor): Color;
@@ -112,7 +117,7 @@ export function asYCbCrA(
mode: ColorMode
): Color;
export function asYCbCrA(col: any, mode?: ColorMode) {
- return convert(col, ColorMode.YCBCRA, mode);
+ return convert(col, "ycbcr", mode);
}
const defConversion = (
@@ -131,147 +136,107 @@ const defConversions = (
toRGBA: ColorConversion,
...dest: ColorMode[]
) => {
- defConversion(ColorMode.RGBA, src, (x: any) => toRGBA([], x));
+ defConversion("rgb", src, (x: any) => toRGBA([], x));
dest.forEach((id) =>
- defConversion(id, src, (x: any) =>
- convert(toRGBA([], x), id, ColorMode.RGBA)
- )
+ defConversion(id, src, (x: any) => convert(toRGBA([], x), id, "rgb"))
);
};
// CSS
-defConversion(ColorMode.RGBA, ColorMode.CSS, (x: any) => parseCss(x));
-
-[
- ColorMode.HCYA,
- ColorMode.HSIA,
- ColorMode.HSLA,
- ColorMode.HSVA,
- ColorMode.INT32,
- ColorMode.XYZA,
- ColorMode.YCBCRA,
-].forEach((id) =>
- defConversion(id, ColorMode.CSS, (x: any) =>
- convert(parseCss(x), id, ColorMode.RGBA)
- )
+defConversion("rgb", "css", (x: any) => parseCss(x));
+
+([
+ "hcy",
+ "hsi",
+ "hsl",
+ "hsv",
+ "int",
+ "xyz",
+ "ycbcr",
+]).forEach((id) =>
+ defConversion(id, "css", (x: any) => convert(parseCss(x), id, "rgb"))
);
// Int
-defConversions(
- ColorMode.INT32,
- int32Rgba,
- ColorMode.HCYA,
- ColorMode.HSIA,
- ColorMode.HSLA,
- ColorMode.HSVA,
- ColorMode.XYZA,
- ColorMode.YCBCRA
-);
+defConversions("int", int32Rgba, "hcy", "hsi", "hsl", "hsv", "xyz", "ycbcr");
-defConversion(ColorMode.CSS, ColorMode.INT32, (x: any) => int32Css(x));
+defConversion("css", "int", (x: any) => int32Css(x));
// HCYA
-defConversions(
- ColorMode.HCYA,
- hcyaRgba,
- ColorMode.CSS,
- ColorMode.INT32,
- ColorMode.HSLA,
- ColorMode.HSVA,
- ColorMode.XYZA,
- ColorMode.YCBCRA
-);
+defConversions("hcy", hcyaRgba, "css", "int", "hsl", "hsv", "xyz", "ycbcr");
// HSIA
defConversions(
- ColorMode.HSIA,
+ "hsi",
hsiaRgba,
- ColorMode.CSS,
- ColorMode.INT32,
- ColorMode.HCYA,
- ColorMode.HSLA,
- ColorMode.HSVA,
- ColorMode.XYZA,
- ColorMode.YCBCRA
+ "css",
+ "int",
+ "hcy",
+ "hsl",
+ "hsv",
+ "xyz",
+ "ycbcr"
);
// HSLA
-defConversions(
- ColorMode.HSLA,
- hslaRgba,
- ColorMode.HCYA,
- ColorMode.HSIA,
- ColorMode.INT32,
- ColorMode.XYZA,
- ColorMode.YCBCRA
-);
+defConversions("hsl", hslaRgba, "hcy", "hsi", "int", "xyz", "ycbcr");
-defConversion(ColorMode.CSS, ColorMode.HSLA, (x: any) => hslaCss(x));
+defConversion("css", "hsl", (x: any) => hslaCss(x));
-defConversion(ColorMode.HSVA, ColorMode.HSLA, (x: any) => hslaHsva([], x));
+defConversion("hsv", "hsl", (x: any) => hslaHsva([], x));
// HSVA
-defConversions(
- ColorMode.HSVA,
- hsvaRgba,
- ColorMode.HCYA,
- ColorMode.HSIA,
- ColorMode.INT32,
- ColorMode.XYZA,
- ColorMode.YCBCRA
-);
+defConversions("hsv", hsvaRgba, "hcy", "hsi", "int", "xyz", "ycbcr");
-defConversion(ColorMode.CSS, ColorMode.HSVA, (x: any) => hsvaCss(x));
+defConversion("css", "hsv", (x: any) => hsvaCss(x));
-defConversion(ColorMode.HSLA, ColorMode.HSVA, (x: any) => hsvaHsla([], x));
+defConversion("hsl", "hsv", (x: any) => hsvaHsla([], x));
// RGBA
(<[ColorMode, ColorConversion][]>[
- [ColorMode.HCYA, rgbaHcya],
- [ColorMode.HSIA, rgbaHsia],
- [ColorMode.HSLA, rgbaHsla],
- [ColorMode.HSVA, rgbaHsva],
- [ColorMode.XYZA, rgbaXyza],
- [ColorMode.YCBCRA, rgbaYcbcra],
-]).forEach(([id, fn]) =>
- defConversion(id, ColorMode.RGBA, (x: any) => fn([], x))
-);
+ ["hcy", rgbaHcya],
+ ["hsi", rgbaHsia],
+ ["hsl", rgbaHsla],
+ ["hsv", rgbaHsva],
+ ["xyz", rgbaXyza],
+ ["ycbcr", rgbaYcbcra],
+]).forEach(([id, fn]) => defConversion(id, "rgb", (x: any) => fn([], x)));
-defConversion(ColorMode.CSS, ColorMode.RGBA, (x: any) => rgbaCss(x));
+defConversion("css", "rgb", (x: any) => rgbaCss(x));
-defConversion(ColorMode.INT32, ColorMode.RGBA, (x: any) => rgbaInt(x));
+defConversion("int", "rgb", (x: any) => rgbaInt(x));
// XYZA
defConversions(
- ColorMode.XYZA,
+ "xyz",
xyzaRgba,
- ColorMode.CSS,
- ColorMode.HCYA,
- ColorMode.HSIA,
- ColorMode.HSLA,
- ColorMode.HSVA,
- ColorMode.INT32,
- ColorMode.YCBCRA
+ "css",
+ "hcy",
+ "hsi",
+ "hsl",
+ "hsv",
+ "int",
+ "ycbcr"
);
// YCbCr
defConversions(
- ColorMode.YCBCRA,
+ "ycbcr",
ycbcraRgba,
- ColorMode.CSS,
- ColorMode.HCYA,
- ColorMode.HSIA,
- ColorMode.HSLA,
- ColorMode.HSVA,
- ColorMode.INT32,
- ColorMode.XYZA
+ "css",
+ "hcy",
+ "hsi",
+ "hsl",
+ "hsv",
+ "int",
+ "xyz"
);
diff --git a/packages/color/src/css.ts b/packages/color/src/css.ts
index bdd1ad57e3..6ff35db131 100644
--- a/packages/color/src/css.ts
+++ b/packages/color/src/css.ts
@@ -1,6 +1,5 @@
import type { ICopy, IDeref } from "@thi.ng/api";
-import type { IColor } from "./api";
-import { ColorMode } from "./constants";
+import type { ColorMode, IColor } from "./api";
export const css = (col: string) => new CSS(col);
@@ -12,7 +11,7 @@ export class CSS implements IColor, ICopy, IDeref {
}
get mode() {
- return ColorMode.CSS;
+ return "css";
}
copy() {
diff --git a/packages/color/src/hcya.ts b/packages/color/src/hcya.ts
index 9786d31ee0..30c899503e 100644
--- a/packages/color/src/hcya.ts
+++ b/packages/color/src/hcya.ts
@@ -1,6 +1,5 @@
import { declareIndices, IVector } from "@thi.ng/vectors";
-import type { Color } from "./api";
-import { ColorMode } from "./constants";
+import type { Color, ColorMode } from "./api";
import { AColor } from "./internal/acolor";
import { ensureArgs } from "./internal/ensure-args";
@@ -17,7 +16,7 @@ export class HCYA extends AColor implements IVector {
a!: number;
get mode() {
- return ColorMode.HCYA;
+ return "hcy";
}
copy() {
diff --git a/packages/color/src/hsia.ts b/packages/color/src/hsia.ts
index 8a1da88660..abfed2879e 100644
--- a/packages/color/src/hsia.ts
+++ b/packages/color/src/hsia.ts
@@ -1,6 +1,5 @@
import { declareIndices, IVector } from "@thi.ng/vectors";
-import type { Color } from "./api";
-import { ColorMode } from "./constants";
+import type { Color, ColorMode } from "./api";
import { AColor } from "./internal/acolor";
import { ensureArgs } from "./internal/ensure-args";
@@ -17,7 +16,7 @@ export class HSIA extends AColor implements IVector {
a!: number;
get mode() {
- return ColorMode.HSIA;
+ return "hsi";
}
copy() {
diff --git a/packages/color/src/hsla.ts b/packages/color/src/hsla.ts
index 4bbaecbb58..e49ad0dc4e 100644
--- a/packages/color/src/hsla.ts
+++ b/packages/color/src/hsla.ts
@@ -1,6 +1,5 @@
import { declareIndices, IVector } from "@thi.ng/vectors";
-import type { Color } from "./api";
-import { ColorMode } from "./constants";
+import type { Color, ColorMode } from "./api";
import { AColor } from "./internal/acolor";
import { ensureArgs } from "./internal/ensure-args";
@@ -17,7 +16,7 @@ export class HSLA extends AColor implements IVector {
a!: number;
get mode() {
- return ColorMode.HSLA;
+ return "hsl";
}
copy() {
diff --git a/packages/color/src/hsva.ts b/packages/color/src/hsva.ts
index 5086cbb281..bb3807f542 100644
--- a/packages/color/src/hsva.ts
+++ b/packages/color/src/hsva.ts
@@ -1,6 +1,5 @@
import { declareIndices, IVector } from "@thi.ng/vectors";
-import type { Color } from "./api";
-import { ColorMode } from "./constants";
+import type { Color, ColorMode } from "./api";
import { AColor } from "./internal/acolor";
import { ensureArgs } from "./internal/ensure-args";
@@ -17,7 +16,7 @@ export class HSVA extends AColor implements IVector {
a!: number;
get mode() {
- return ColorMode.HSVA;
+ return "hsv";
}
copy() {
diff --git a/packages/color/src/int.ts b/packages/color/src/int.ts
index 6b3ca21740..a808d24ed3 100644
--- a/packages/color/src/int.ts
+++ b/packages/color/src/int.ts
@@ -1,6 +1,5 @@
import type { ICopy, IDeref } from "@thi.ng/api";
-import type { IColor } from "./api";
-import { ColorMode } from "./constants";
+import type { ColorMode, IColor } from "./api";
/**
* Returns new {@link Int32} wrapping given ARGB int.
@@ -25,7 +24,7 @@ export class Int32 implements IColor, ICopy, IDeref {
}
get mode() {
- return ColorMode.INT32;
+ return "int";
}
copy() {
diff --git a/packages/color/src/internal/acolor.ts b/packages/color/src/internal/acolor.ts
index b9a56718c2..8618c842b7 100644
--- a/packages/color/src/internal/acolor.ts
+++ b/packages/color/src/internal/acolor.ts
@@ -1,8 +1,7 @@
import type { IDeref } from "@thi.ng/api";
import { EPS } from "@thi.ng/math";
import { eqDelta4, stridedValues } from "@thi.ng/vectors";
-import type { Color, IColor } from "../api";
-import type { ColorMode } from "../constants";
+import type { Color, ColorMode, IColor } from "../api";
export abstract class AColor implements IColor, IDeref {
buf: Color;
diff --git a/packages/color/src/luminance.ts b/packages/color/src/luminance.ts
index 0647226262..df093ba5f6 100644
--- a/packages/color/src/luminance.ts
+++ b/packages/color/src/luminance.ts
@@ -1,7 +1,6 @@
import { DEFAULT, defmulti, MultiFn1O } from "@thi.ng/defmulti";
import { illegalArgs } from "@thi.ng/errors";
-import type { IColor, ReadonlyColor } from "./api";
-import { ColorMode } from "./constants";
+import type { ColorMode, IColor, ReadonlyColor } from "./api";
import { convert } from "./convert";
import { luminanceInt, luminanceRGB } from "./luminance-rgb";
@@ -22,12 +21,12 @@ export const luminance: MultiFn1O<
: illegalArgs(`missing color mode`)
);
-luminance.add(ColorMode.RGBA, (x: any) => luminanceRGB(x));
+luminance.add("rgb", (x: any) => luminanceRGB(x));
-luminance.add(ColorMode.INT32, (x: any) =>
+luminance.add("int", (x: any) =>
luminanceInt(typeof x === "number" ? x : x.deref())
);
luminance.add(DEFAULT, (x: any, mode) =>
- luminanceRGB(convert(x, ColorMode.RGBA, mode))
+ luminanceRGB(convert(x, "rgb", mode))
);
diff --git a/packages/color/src/resolve.ts b/packages/color/src/resolve.ts
index 2826109886..ffe2f36e63 100644
--- a/packages/color/src/resolve.ts
+++ b/packages/color/src/resolve.ts
@@ -1,6 +1,5 @@
import { isArrayLike, isNumber } from "@thi.ng/checks";
import type { ReadonlyColor } from "./api";
-import { ColorMode } from "./constants";
import { asCSS } from "./convert";
/**
@@ -18,7 +17,7 @@ export const resolveAsCSS = (col: any) =>
isArrayLike(col)
? isNumber((col).mode)
? asCSS(col)
- : asCSS(col, ColorMode.RGBA)
+ : asCSS(col, "rgb")
: isNumber(col)
- ? asCSS(col, ColorMode.INT32)
+ ? asCSS(col, "int")
: col;
diff --git a/packages/color/src/rgba.ts b/packages/color/src/rgba.ts
index aad98760ee..b6b6f7d899 100644
--- a/packages/color/src/rgba.ts
+++ b/packages/color/src/rgba.ts
@@ -1,6 +1,5 @@
import { declareIndices, IVector } from "@thi.ng/vectors";
-import type { Color } from "./api";
-import { ColorMode } from "./constants";
+import type { Color, ColorMode } from "./api";
import { AColor } from "./internal/acolor";
import { ensureArgs } from "./internal/ensure-args";
@@ -17,7 +16,7 @@ export class RGBA extends AColor implements IVector {
a!: number;
get mode() {
- return ColorMode.RGBA;
+ return "rgb";
}
copy() {
diff --git a/packages/color/src/xyza.ts b/packages/color/src/xyza.ts
index dd49d16550..497400db0b 100644
--- a/packages/color/src/xyza.ts
+++ b/packages/color/src/xyza.ts
@@ -1,6 +1,5 @@
import { declareIndices, IVector } from "@thi.ng/vectors";
-import type { Color } from "./api";
-import { ColorMode } from "./constants";
+import type { Color, ColorMode } from "./api";
import { AColor } from "./internal/acolor";
import { ensureArgs } from "./internal/ensure-args";
@@ -17,7 +16,7 @@ export class XYZA extends AColor implements IVector {
a!: number;
get mode() {
- return ColorMode.XYZA;
+ return "xyz";
}
copy() {
diff --git a/packages/color/src/ycbcr.ts b/packages/color/src/ycbcr.ts
index 8efe85a979..eb20286d35 100644
--- a/packages/color/src/ycbcr.ts
+++ b/packages/color/src/ycbcr.ts
@@ -1,6 +1,5 @@
import { declareIndices, IVector } from "@thi.ng/vectors";
-import type { Color } from "./api";
-import { ColorMode } from "./constants";
+import type { Color, ColorMode } from "./api";
import { AColor } from "./internal/acolor";
import { ensureArgs } from "./internal/ensure-args";
@@ -17,7 +16,7 @@ export class YCbCrA extends AColor implements IVector {
a!: number;
get mode() {
- return ColorMode.YCBCRA;
+ return "ycbcr";
}
copy() {
diff --git a/packages/color/tools/index.ts b/packages/color/tools/index.ts
index e3f286c273..981d54aa6d 100644
--- a/packages/color/tools/index.ts
+++ b/packages/color/tools/index.ts
@@ -10,9 +10,10 @@ Object.keys(GRADIENTS).forEach((id) => {
asSvg(
svgDoc(
{},
- ...cosineGradient(100, GRADIENTS[id]).map((col, i) =>
- rect([i * 5, 0], [5, 50], { fill: col })
- )
+ ...cosineGradient(
+ 100,
+ GRADIENTS[id]
+ ).map((col, i) => rect([i * 5, 0], [5, 50], { fill: col }))
)
)
);
diff --git a/packages/color/tpl.readme.md b/packages/color/tpl.readme.md
index 23f4f5aa04..fde9472eb1 100644
--- a/packages/color/tpl.readme.md
+++ b/packages/color/tpl.readme.md
@@ -195,7 +195,7 @@ const b = col.parseCss("hsla(30,100%,50%,0.75)");
// route #3: convert() multi-method: CSS -> RGBA -> HSVA
// (see convert.ts)
-const c = col.convert("rgb(0,255,255)", col.ColorMode.HSVA, col.ColorMode.CSS);
+const c = col.convert("rgb(0,255,255)", "hsv", "css");
// [ 0.4999999722222268, 0.9999990000010001, 1, 1 ]
// route #4: direct conversion RGBA -> HSLA -> CSS
@@ -205,7 +205,7 @@ col.hslaCss(col.rgbaHsla([], [1, 0.5, 0.5, 1]))
// "hsl(0.00,100.00%,75.00%)"
col.luminance(col.css("white"))
-col.luminance(0xffffff, col.ColorMode.INT32)
+col.luminance(0xffffff, "int")
// 1
// apply color matrix (RGBA only)
diff --git a/packages/colored-noise/CHANGELOG.md b/packages/colored-noise/CHANGELOG.md
index 6d011de0a9..58a065636c 100644
--- a/packages/colored-noise/CHANGELOG.md
+++ b/packages/colored-noise/CHANGELOG.md
@@ -3,47 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.1.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/colored-noise@0.1.5...@thi.ng/colored-noise@0.1.6) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/colored-noise
-
-
-
-
-
-## [0.1.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/colored-noise@0.1.4...@thi.ng/colored-noise@0.1.5) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/colored-noise
-
-
-
-
-
-## [0.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/colored-noise@0.1.3...@thi.ng/colored-noise@0.1.4) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/colored-noise
-
-
-
-
-
-## [0.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/colored-noise@0.1.2...@thi.ng/colored-noise@0.1.3) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/colored-noise
-
-
-
-
-
-## [0.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/colored-noise@0.1.1...@thi.ng/colored-noise@0.1.2) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/colored-noise
-
-
-
-
-
-## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/colored-noise@0.1.0...@thi.ng/colored-noise@0.1.1) (2020-09-13)
+## [0.1.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/colored-noise@0.1.6...@thi.ng/colored-noise@0.1.7) (2020-12-22)
**Note:** Version bump only for package @thi.ng/colored-noise
diff --git a/packages/colored-noise/package.json b/packages/colored-noise/package.json
index 4a165d5bcc..dc1a9cc660 100644
--- a/packages/colored-noise/package.json
+++ b/packages/colored-noise/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/colored-noise",
- "version": "0.1.6",
+ "version": "0.1.7",
"description": "Customizable O(1) ES6 generators for colored noise",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,24 +39,24 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/dsp": "^2.1.5",
- "@thi.ng/dsp-io-wav": "^0.1.33",
- "@thi.ng/text-canvas": "^0.2.35",
- "@thi.ng/transducers": "^7.5.2",
- "@thi.ng/vectors": "^4.8.2",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/dsp": "^3.0.0",
+ "@thi.ng/dsp-io-wav": "^0.1.34",
+ "@thi.ng/text-canvas": "^0.2.36",
+ "@thi.ng/transducers": "^7.5.3",
+ "@thi.ng/vectors": "^4.8.3",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/binary": "^2.0.19",
- "@thi.ng/random": "^2.1.2"
+ "@thi.ng/binary": "^2.0.20",
+ "@thi.ng/random": "^2.1.3"
},
"files": [
"*.js",
diff --git a/packages/compare/CHANGELOG.md b/packages/compare/CHANGELOG.md
index 66668c0739..2003d6361e 100644
--- a/packages/compare/CHANGELOG.md
+++ b/packages/compare/CHANGELOG.md
@@ -3,63 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.3.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/compare@1.3.19...@thi.ng/compare@1.3.20) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/compare
-
-
-
-
-
-## [1.3.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/compare@1.3.18...@thi.ng/compare@1.3.19) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/compare
-
-
-
-
-
-## [1.3.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/compare@1.3.17...@thi.ng/compare@1.3.18) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/compare
-
-
-
-
-
-## [1.3.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/compare@1.3.16...@thi.ng/compare@1.3.17) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/compare
-
-
-
-
-
-## [1.3.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/compare@1.3.15...@thi.ng/compare@1.3.16) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/compare
-
-
-
-
-
-## [1.3.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/compare@1.3.14...@thi.ng/compare@1.3.15) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/compare
-
-
-
-
-
-## [1.3.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/compare@1.3.13...@thi.ng/compare@1.3.14) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/compare
-
-
-
-
-
-## [1.3.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/compare@1.3.12...@thi.ng/compare@1.3.13) (2020-08-16)
+## [1.3.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/compare@1.3.20...@thi.ng/compare@1.3.21) (2020-12-22)
**Note:** Version bump only for package @thi.ng/compare
diff --git a/packages/compare/package.json b/packages/compare/package.json
index 72d8c21e06..f9798ba9dc 100644
--- a/packages/compare/package.json
+++ b/packages/compare/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/compare",
- "version": "1.3.20",
+ "version": "1.3.21",
"description": "Comparators with support for types implementing the @thi.ng/api/ICompare interface",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,17 +39,17 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4"
+ "@thi.ng/api": "^6.13.5"
},
"files": [
"*.js",
diff --git a/packages/compose/CHANGELOG.md b/packages/compose/CHANGELOG.md
index 00cf506b7d..de9afba900 100644
--- a/packages/compose/CHANGELOG.md
+++ b/packages/compose/CHANGELOG.md
@@ -3,63 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.4.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.4.20...@thi.ng/compose@1.4.21) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/compose
-
-
-
-
-
-## [1.4.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.4.19...@thi.ng/compose@1.4.20) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/compose
-
-
-
-
-
-## [1.4.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.4.18...@thi.ng/compose@1.4.19) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/compose
-
-
-
-
-
-## [1.4.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.4.17...@thi.ng/compose@1.4.18) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/compose
-
-
-
-
-
-## [1.4.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.4.16...@thi.ng/compose@1.4.17) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/compose
-
-
-
-
-
-## [1.4.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.4.15...@thi.ng/compose@1.4.16) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/compose
-
-
-
-
-
-## [1.4.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.4.14...@thi.ng/compose@1.4.15) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/compose
-
-
-
-
-
-## [1.4.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.4.13...@thi.ng/compose@1.4.14) (2020-08-16)
+## [1.4.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.4.21...@thi.ng/compose@1.4.22) (2020-12-22)
**Note:** Version bump only for package @thi.ng/compose
diff --git a/packages/compose/package.json b/packages/compose/package.json
index 6462989a6b..8ce1eb0b4d 100644
--- a/packages/compose/package.json
+++ b/packages/compose/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/compose",
- "version": "1.4.21",
+ "version": "1.4.22",
"description": "Optimized functional composition helpers",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,18 +39,18 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/errors": "^1.2.24"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/errors": "^1.2.25"
},
"files": [
"*.js",
diff --git a/packages/csp/CHANGELOG.md b/packages/csp/CHANGELOG.md
index 17bbe72c20..bc9aee9836 100644
--- a/packages/csp/CHANGELOG.md
+++ b/packages/csp/CHANGELOG.md
@@ -3,71 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.1.43](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.1.42...@thi.ng/csp@1.1.43) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/csp
-
-
-
-
-
-## [1.1.42](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.1.41...@thi.ng/csp@1.1.42) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/csp
-
-
-
-
-
-## [1.1.41](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.1.40...@thi.ng/csp@1.1.41) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/csp
-
-
-
-
-
-## [1.1.40](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.1.39...@thi.ng/csp@1.1.40) (2020-10-19)
-
-**Note:** Version bump only for package @thi.ng/csp
-
-
-
-
-
-## [1.1.39](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.1.38...@thi.ng/csp@1.1.39) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/csp
-
-
-
-
-
-## [1.1.38](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.1.37...@thi.ng/csp@1.1.38) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/csp
-
-
-
-
-
-## [1.1.37](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.1.36...@thi.ng/csp@1.1.37) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/csp
-
-
-
-
-
-## [1.1.36](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.1.35...@thi.ng/csp@1.1.36) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/csp
-
-
-
-
-
-## [1.1.35](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.1.34...@thi.ng/csp@1.1.35) (2020-08-16)
+## [1.1.44](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.1.43...@thi.ng/csp@1.1.44) (2020-12-22)
**Note:** Version bump only for package @thi.ng/csp
diff --git a/packages/csp/package.json b/packages/csp/package.json
index 680c108635..b3ae21b16b 100644
--- a/packages/csp/package.json
+++ b/packages/csp/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/csp",
- "version": "1.1.43",
+ "version": "1.1.44",
"description": "ES6 promise based CSP primitives & operations",
"module": "./index.js",
"main": "./lib/index.js",
@@ -43,22 +43,22 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/arrays": "^0.8.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/dcons": "^2.3.3",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/transducers": "^7.5.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/arrays": "^0.8.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/dcons": "^2.3.4",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/transducers": "^7.5.3"
},
"files": [
"*.js",
diff --git a/packages/csv/CHANGELOG.md b/packages/csv/CHANGELOG.md
index f80f6ee93e..87558bfb9b 100644
--- a/packages/csv/CHANGELOG.md
+++ b/packages/csv/CHANGELOG.md
@@ -3,15 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/csv@0.1.1...@thi.ng/csv@0.1.2) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/csv
-
-
-
-
-
-## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/csv@0.1.0...@thi.ng/csv@0.1.1) (2020-11-26)
+## [0.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/csv@0.1.2...@thi.ng/csv@0.1.3) (2020-12-22)
**Note:** Version bump only for package @thi.ng/csv
diff --git a/packages/csv/package.json b/packages/csv/package.json
index cd38b7d841..a1ccfd1f9f 100644
--- a/packages/csv/package.json
+++ b/packages/csv/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/csv",
- "version": "0.1.2",
+ "version": "0.1.3",
"description": "Customizable, transducer-based CSV parser/object mapper and transformer",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,20 +39,20 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/strings": "^1.11.2",
- "@thi.ng/transducers": "^7.5.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/strings": "^1.11.3",
+ "@thi.ng/transducers": "^7.5.3"
},
"files": [
"*.js",
diff --git a/packages/date/CHANGELOG.md b/packages/date/CHANGELOG.md
index f638182c0b..3c4e2b16b9 100644
--- a/packages/date/CHANGELOG.md
+++ b/packages/date/CHANGELOG.md
@@ -3,15 +3,7 @@
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/date@0.2.2...@thi.ng/date@0.2.3) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/date
-
-
-
-
-
-## [0.2.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/date@0.2.1...@thi.ng/date@0.2.2) (2020-11-26)
+## [0.2.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/date@0.2.3...@thi.ng/date@0.2.4) (2020-12-22)
**Note:** Version bump only for package @thi.ng/date
diff --git a/packages/date/package.json b/packages/date/package.json
index a8af241cd4..b6f7f02d87 100644
--- a/packages/date/package.json
+++ b/packages/date/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/date",
- "version": "0.2.3",
+ "version": "0.2.4",
"description": "Date/timestamp iterators, formatters, rounding",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,17 +39,17 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4"
+ "@thi.ng/api": "^6.13.5"
},
"files": [
"*.js",
diff --git a/packages/dcons/CHANGELOG.md b/packages/dcons/CHANGELOG.md
index babdd3d457..2f2d715775 100644
--- a/packages/dcons/CHANGELOG.md
+++ b/packages/dcons/CHANGELOG.md
@@ -3,23 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [2.3.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.3.2...@thi.ng/dcons@2.3.3) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/dcons
-
-
-
-
-
-## [2.3.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.3.1...@thi.ng/dcons@2.3.2) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/dcons
-
-
-
-
-
-## [2.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.3.0...@thi.ng/dcons@2.3.1) (2020-11-24)
+## [2.3.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.3.3...@thi.ng/dcons@2.3.4) (2020-12-22)
**Note:** Version bump only for package @thi.ng/dcons
@@ -38,46 +22,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [2.2.32](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.2.31...@thi.ng/dcons@2.2.32) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/dcons
-
-
-
-
-
-## [2.2.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.2.30...@thi.ng/dcons@2.2.31) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/dcons
-
-
-
-
-
-## [2.2.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.2.29...@thi.ng/dcons@2.2.30) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/dcons
-
-
-
-
-
-## [2.2.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.2.28...@thi.ng/dcons@2.2.29) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/dcons
-
-
-
-
-
-## [2.2.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.2.27...@thi.ng/dcons@2.2.28) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/dcons
-
-
-
-
-
# [2.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.1.6...@thi.ng/dcons@2.2.0) (2019-11-30)
### Features
diff --git a/packages/dcons/package.json b/packages/dcons/package.json
index bab6d239a8..0ca63a3934 100644
--- a/packages/dcons/package.json
+++ b/packages/dcons/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dcons",
- "version": "2.3.3",
+ "version": "2.3.4",
"description": "Double-linked lists with comprehensive set of operations (incl. optional self-organizing behaviors)",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,23 +39,23 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/compare": "^1.3.20",
- "@thi.ng/equiv": "^1.0.33",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/random": "^2.1.2",
- "@thi.ng/transducers": "^7.5.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/compare": "^1.3.21",
+ "@thi.ng/equiv": "^1.0.34",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/random": "^2.1.3",
+ "@thi.ng/transducers": "^7.5.3"
},
"files": [
"*.js",
diff --git a/packages/defmulti/CHANGELOG.md b/packages/defmulti/CHANGELOG.md
index 78e56e67cb..36cd6af62d 100644
--- a/packages/defmulti/CHANGELOG.md
+++ b/packages/defmulti/CHANGELOG.md
@@ -3,15 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.3.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@1.3.1...@thi.ng/defmulti@1.3.2) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/defmulti
-
-
-
-
-
-## [1.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@1.3.0...@thi.ng/defmulti@1.3.1) (2020-11-26)
+## [1.3.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@1.3.2...@thi.ng/defmulti@1.3.3) (2020-12-22)
**Note:** Version bump only for package @thi.ng/defmulti
@@ -30,46 +22,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [1.2.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@1.2.25...@thi.ng/defmulti@1.2.26) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/defmulti
-
-
-
-
-
-## [1.2.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@1.2.24...@thi.ng/defmulti@1.2.25) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/defmulti
-
-
-
-
-
-## [1.2.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@1.2.23...@thi.ng/defmulti@1.2.24) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/defmulti
-
-
-
-
-
-## [1.2.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@1.2.22...@thi.ng/defmulti@1.2.23) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/defmulti
-
-
-
-
-
-## [1.2.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@1.2.21...@thi.ng/defmulti@1.2.22) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/defmulti
-
-
-
-
-
# [1.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/defmulti@1.1.4...@thi.ng/defmulti@1.2.0) (2019-11-09)
### Features
diff --git a/packages/defmulti/package.json b/packages/defmulti/package.json
index 18a654e87d..d91550ee4d 100644
--- a/packages/defmulti/package.json
+++ b/packages/defmulti/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/defmulti",
- "version": "1.3.2",
+ "version": "1.3.3",
"description": "Dynamic, extensible multiple dispatch via user supplied dispatch function.",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,18 +39,18 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/errors": "^1.2.24"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/errors": "^1.2.25"
},
"files": [
"*.js",
diff --git a/packages/dgraph-dot/CHANGELOG.md b/packages/dgraph-dot/CHANGELOG.md
index 469c49ccf4..2c8b308d52 100644
--- a/packages/dgraph-dot/CHANGELOG.md
+++ b/packages/dgraph-dot/CHANGELOG.md
@@ -3,71 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.1.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.30...@thi.ng/dgraph-dot@0.1.31) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/dgraph-dot
-
-
-
-
-
-## [0.1.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.29...@thi.ng/dgraph-dot@0.1.30) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/dgraph-dot
-
-
-
-
-
-## [0.1.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.28...@thi.ng/dgraph-dot@0.1.29) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/dgraph-dot
-
-
-
-
-
-## [0.1.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.27...@thi.ng/dgraph-dot@0.1.28) (2020-10-19)
-
-**Note:** Version bump only for package @thi.ng/dgraph-dot
-
-
-
-
-
-## [0.1.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.26...@thi.ng/dgraph-dot@0.1.27) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/dgraph-dot
-
-
-
-
-
-## [0.1.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.25...@thi.ng/dgraph-dot@0.1.26) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/dgraph-dot
-
-
-
-
-
-## [0.1.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.24...@thi.ng/dgraph-dot@0.1.25) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/dgraph-dot
-
-
-
-
-
-## [0.1.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.23...@thi.ng/dgraph-dot@0.1.24) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/dgraph-dot
-
-
-
-
-
-## [0.1.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.22...@thi.ng/dgraph-dot@0.1.23) (2020-08-16)
+## [0.1.32](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.31...@thi.ng/dgraph-dot@0.1.32) (2020-12-22)
**Note:** Version bump only for package @thi.ng/dgraph-dot
diff --git a/packages/dgraph-dot/package.json b/packages/dgraph-dot/package.json
index 7ec0deb164..016b932e2e 100644
--- a/packages/dgraph-dot/package.json
+++ b/packages/dgraph-dot/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dgraph-dot",
- "version": "0.1.31",
+ "version": "0.1.32",
"description": "Customizable Graphviz DOT serialization for @thi.ng/dgraph",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,19 +39,19 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/dgraph": "^1.3.2",
- "@thi.ng/dot": "^1.2.21"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/dgraph": "^1.3.3",
+ "@thi.ng/dot": "^1.2.22"
},
"files": [
"*.js",
diff --git a/packages/dgraph/CHANGELOG.md b/packages/dgraph/CHANGELOG.md
index d2292c834b..e6f00625a5 100644
--- a/packages/dgraph/CHANGELOG.md
+++ b/packages/dgraph/CHANGELOG.md
@@ -3,15 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.3.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.3.1...@thi.ng/dgraph@1.3.2) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/dgraph
-
-
-
-
-
-## [1.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.3.0...@thi.ng/dgraph@1.3.1) (2020-11-26)
+## [1.3.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.3.2...@thi.ng/dgraph@1.3.3) (2020-12-22)
**Note:** Version bump only for package @thi.ng/dgraph
@@ -30,54 +22,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [1.2.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.2.27...@thi.ng/dgraph@1.2.28) (2020-10-19)
-
-**Note:** Version bump only for package @thi.ng/dgraph
-
-
-
-
-
-## [1.2.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.2.26...@thi.ng/dgraph@1.2.27) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/dgraph
-
-
-
-
-
-## [1.2.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.2.25...@thi.ng/dgraph@1.2.26) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/dgraph
-
-
-
-
-
-## [1.2.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.2.24...@thi.ng/dgraph@1.2.25) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/dgraph
-
-
-
-
-
-## [1.2.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.2.23...@thi.ng/dgraph@1.2.24) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/dgraph
-
-
-
-
-
-## [1.2.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.2.22...@thi.ng/dgraph@1.2.23) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/dgraph
-
-
-
-
-
# [1.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.1.25...@thi.ng/dgraph@1.2.0) (2020-04-03)
diff --git a/packages/dgraph/package.json b/packages/dgraph/package.json
index c4186a9bf5..f30801e5d3 100644
--- a/packages/dgraph/package.json
+++ b/packages/dgraph/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dgraph",
- "version": "1.3.2",
+ "version": "1.3.3",
"description": "Type-agnostic directed acyclic graph (DAG) & graph operations",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,21 +39,21 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/associative": "^5.0.11",
- "@thi.ng/equiv": "^1.0.33",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/transducers": "^7.5.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/associative": "^5.0.12",
+ "@thi.ng/equiv": "^1.0.34",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/transducers": "^7.5.3"
},
"files": [
"*.js",
diff --git a/packages/diff/CHANGELOG.md b/packages/diff/CHANGELOG.md
index d2e923db1c..b7dd793435 100644
--- a/packages/diff/CHANGELOG.md
+++ b/packages/diff/CHANGELOG.md
@@ -3,65 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [3.2.35](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.2.34...@thi.ng/diff@3.2.35) (2020-12-07)
+# [4.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.2.35...@thi.ng/diff@4.0.0) (2020-12-22)
-**Note:** Version bump only for package @thi.ng/diff
-
-
-
-
-
-## [3.2.34](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.2.33...@thi.ng/diff@3.2.34) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/diff
-
-
-
-
-
-## [3.2.33](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.2.32...@thi.ng/diff@3.2.33) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/diff
-
-
-
-
-
-## [3.2.32](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.2.31...@thi.ng/diff@3.2.32) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/diff
-
-
-
-
-
-## [3.2.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.2.30...@thi.ng/diff@3.2.31) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/diff
-
-
-
-
-
-## [3.2.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.2.29...@thi.ng/diff@3.2.30) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/diff
-
-
-
-
-
-## [3.2.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.2.28...@thi.ng/diff@3.2.29) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/diff
+### Code Refactoring
+* **diff:** fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace DiffMode enum ([cc77c71](https://github.com/thi-ng/umbrella/commit/cc77c711746eabebb4af58421282c50830613915))
+### BREAKING CHANGES
-## [3.2.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.2.27...@thi.ng/diff@3.2.28) (2020-08-16)
+* **diff:** replace DiffMode enum w/ type alias
-**Note:** Version bump only for package @thi.ng/diff
+- rename DiffMode.ONLY_DISTANCE_LINEAR_ONLY_CHANGES => "minimal"
+- update diffObject() mode arg to only allow: "full" or "only-distance"
diff --git a/packages/diff/README.md b/packages/diff/README.md
index 1fd9f411f6..74315bd5de 100644
--- a/packages/diff/README.md
+++ b/packages/diff/README.md
@@ -14,8 +14,6 @@ This project is part of the
- [Installation](#installation)
- [Dependencies](#dependencies)
- [API](#api)
-- [Breaking changes](#breaking-changes)
- - [2.0.0](#200)
- [Authors](#authors)
- [License](#license)
@@ -43,7 +41,7 @@ yarn add @thi.ng/diff
```
-Package sizes (gzipped, pre-treeshake): ESM: 1.25 KB / CJS: 1.30 KB / UMD: 1.33 KB
+Package sizes (gzipped, pre-treeshake): ESM: 1.15 KB / CJS: 1.21 KB / UMD: 1.24 KB
## Dependencies
@@ -55,9 +53,10 @@ Package sizes (gzipped, pre-treeshake): ESM: 1.25 KB / CJS: 1.30 KB / UMD: 1.33
[Generated API docs](https://docs.thi.ng/umbrella/diff/)
```ts
-import { diffArray, DiffMode } from "@thi.ng/diff";
+import { diffArray } from "@thi.ng/diff";
-diffArray([1, 2, 3], [1, 2, 4], DiffMode.FULL);
+// diff w/ default diff mode
+diffArray([1, 2, 3], [1, 2, 4], "full");
// {
// distance: 2,
// adds: { 2: 4 },
@@ -67,20 +66,6 @@ diffArray([1, 2, 3], [1, 2, 4], DiffMode.FULL);
// }
```
-## Breaking changes
-
-### 2.0.0
-
-The linear edit logs of both `diffArray` and `diffObject` are now
-returned as flat arrays, with each log entry consisting of 3 or 2
-successive array items. This is to avoid allocation of various small
-arrays.
-
-The order of optional args to both functions has been swapped to:
-
-- `diffArray(old, new, mode?, equiv?)`
-- `diffObject(old, new, mode?, equiv?)`
-
## Authors
Karsten Schmidt
diff --git a/packages/diff/package.json b/packages/diff/package.json
index 5f58e7db15..eb1395f235 100644
--- a/packages/diff/package.json
+++ b/packages/diff/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/diff",
- "version": "3.2.35",
+ "version": "4.0.0",
"description": "Customizable diff implementations for arrays (sequential) & objects (associative), with or without linear edit logs",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,17 +39,17 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/equiv": "^1.0.33"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/equiv": "^1.0.34"
},
"files": [
"*.js",
diff --git a/packages/diff/src/api.ts b/packages/diff/src/api.ts
index 136d0fc0e0..4bc2b9a5b5 100644
--- a/packages/diff/src/api.ts
+++ b/packages/diff/src/api.ts
@@ -1,5 +1,11 @@
import type { IObjectOf } from "@thi.ng/api";
+export type DiffMode =
+ | "only-distance"
+ | "only-distance-linear"
+ | "minimal"
+ | "full";
+
export type DiffKeyMap = IObjectOf;
export interface ArrayDiff {
diff --git a/packages/diff/src/array.ts b/packages/diff/src/array.ts
index 0741a8da8b..4789f09e0d 100644
--- a/packages/diff/src/array.ts
+++ b/packages/diff/src/array.ts
@@ -1,7 +1,6 @@
import type { FnU3, Nullable } from "@thi.ng/api";
import { equiv as _equiv } from "@thi.ng/equiv";
-import type { ArrayDiff, DiffKeyMap, EditLog } from "./api";
-import { DiffMode } from "./constants";
+import type { ArrayDiff, DiffKeyMap, DiffMode, EditLog } from "./api";
let _cachedFP: Nullable;
let _cachedPath: Nullable;
@@ -34,13 +33,13 @@ const simpleDiff = (
const n = src.length;
const linear = >state.linear;
state.distance = n;
- if (mode !== DiffMode.ONLY_DISTANCE) {
+ if (mode !== "only-distance") {
for (let i = 0, j = 0; i < n; i++, j += 3) {
linear[j] = logDir;
linear[j + 1] = i;
linear[j + 2] = src[i];
}
- if (mode === DiffMode.FULL) {
+ if (mode === "full") {
const _state = >state[key];
for (let i = 0; i < n; i++) {
_state[i] = src[i];
@@ -70,7 +69,7 @@ const simpleDiff = (
export const diffArray = (
a: ArrayLike | undefined | null,
b: ArrayLike | undefined | null,
- mode = DiffMode.FULL,
+ mode: DiffMode = "full",
equiv = _equiv
) => {
const state = >{
@@ -145,14 +144,14 @@ export const diffArray = (
state.distance = delta + 2 * p;
- if (mode !== DiffMode.ONLY_DISTANCE) {
+ if (mode !== "only-distance") {
p = path[doff] * 3;
while (p >= 0) {
epc.push(p);
p = pathPos[p + 2] * 3;
}
- if (mode === DiffMode.FULL) {
+ if (mode === "full") {
buildFullLog(epc, pathPos, state, _a, _b, reverse);
} else {
buildLinearLog(
@@ -162,7 +161,7 @@ export const diffArray = (
_a,
_b,
reverse,
- mode === DiffMode.ONLY_DISTANCE_LINEAR
+ mode === "only-distance-linear"
);
}
}
diff --git a/packages/diff/src/constants.ts b/packages/diff/src/constants.ts
deleted file mode 100644
index 8f7374c9eb..0000000000
--- a/packages/diff/src/constants.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export enum DiffMode {
- ONLY_DISTANCE,
- ONLY_DISTANCE_LINEAR,
- ONLY_DISTANCE_LINEAR_ONLY_CHANGES,
- FULL,
-}
diff --git a/packages/diff/src/index.ts b/packages/diff/src/index.ts
index 7c4e490404..ac723d9b1a 100644
--- a/packages/diff/src/index.ts
+++ b/packages/diff/src/index.ts
@@ -1,4 +1,3 @@
export * from "./api";
export * from "./array";
-export * from "./constants";
export * from "./object";
diff --git a/packages/diff/src/object.ts b/packages/diff/src/object.ts
index 64af87fadd..3701fc5b9c 100644
--- a/packages/diff/src/object.ts
+++ b/packages/diff/src/object.ts
@@ -1,17 +1,16 @@
import type { IObjectOf, Predicate2 } from "@thi.ng/api";
import { equiv } from "@thi.ng/equiv";
import type { ObjectDiff } from "./api";
-import { DiffMode } from "./constants";
export const diffObject = (
a: IObjectOf | undefined | null,
b: IObjectOf | undefined | null,
- mode = DiffMode.FULL,
+ mode: "full" | "only-distance" = "full",
_equiv: Predicate2 = equiv
): ObjectDiff =>
a === b
? { distance: 0 }
- : mode === DiffMode.ONLY_DISTANCE
+ : mode === "only-distance"
? diffObjectDist(a, b, _equiv)
: diffObjectFull(a, b, _equiv);
diff --git a/packages/diff/test/array.ts b/packages/diff/test/array.ts
index feb19661db..279777ca9e 100644
--- a/packages/diff/test/array.ts
+++ b/packages/diff/test/array.ts
@@ -1,5 +1,5 @@
import * as assert from "assert";
-import { ArrayDiff, diffArray, DiffMode } from "../src";
+import { ArrayDiff, diffArray } from "../src";
describe("array", function () {
const state = >{
@@ -70,11 +70,7 @@ describe("array", function () {
it("diff insert 2nd last (changes only)", () => {
assert.deepStrictEqual(
- diffArray(
- [1, 2, 3, 4],
- [1, 2, 3, 5, 4],
- DiffMode.ONLY_DISTANCE_LINEAR_ONLY_CHANGES
- ),
+ diffArray([1, 2, 3, 4], [1, 2, 3, 5, 4], "minimal"),
>{
distance: 1,
adds: {},
diff --git a/packages/diff/tpl.readme.md b/packages/diff/tpl.readme.md
index 56f9a0563b..4de521950b 100644
--- a/packages/diff/tpl.readme.md
+++ b/packages/diff/tpl.readme.md
@@ -38,9 +38,10 @@ ${examples}
${docLink}
```ts
-import { diffArray, DiffMode } from "@thi.ng/diff";
+import { diffArray } from "@thi.ng/diff";
-diffArray([1, 2, 3], [1, 2, 4], DiffMode.FULL);
+// diff w/ default diff mode
+diffArray([1, 2, 3], [1, 2, 4], "full");
// {
// distance: 2,
// adds: { 2: 4 },
@@ -50,20 +51,6 @@ diffArray([1, 2, 3], [1, 2, 4], DiffMode.FULL);
// }
```
-## Breaking changes
-
-### 2.0.0
-
-The linear edit logs of both `diffArray` and `diffObject` are now
-returned as flat arrays, with each log entry consisting of 3 or 2
-successive array items. This is to avoid allocation of various small
-arrays.
-
-The order of optional args to both functions has been swapped to:
-
-- `diffArray(old, new, mode?, equiv?)`
-- `diffObject(old, new, mode?, equiv?)`
-
## Authors
${authors}
diff --git a/packages/dl-asset/CHANGELOG.md b/packages/dl-asset/CHANGELOG.md
index 79a17f1ef7..d7e338fc98 100644
--- a/packages/dl-asset/CHANGELOG.md
+++ b/packages/dl-asset/CHANGELOG.md
@@ -3,63 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.4.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/dl-asset@0.4.8...@thi.ng/dl-asset@0.4.9) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/dl-asset
-
-
-
-
-
-## [0.4.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/dl-asset@0.4.7...@thi.ng/dl-asset@0.4.8) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/dl-asset
-
-
-
-
-
-## [0.4.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/dl-asset@0.4.6...@thi.ng/dl-asset@0.4.7) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/dl-asset
-
-
-
-
-
-## [0.4.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/dl-asset@0.4.5...@thi.ng/dl-asset@0.4.6) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/dl-asset
-
-
-
-
-
-## [0.4.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/dl-asset@0.4.4...@thi.ng/dl-asset@0.4.5) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/dl-asset
-
-
-
-
-
-## [0.4.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/dl-asset@0.4.3...@thi.ng/dl-asset@0.4.4) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/dl-asset
-
-
-
-
-
-## [0.4.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/dl-asset@0.4.2...@thi.ng/dl-asset@0.4.3) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/dl-asset
-
-
-
-
-
-## [0.4.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/dl-asset@0.4.1...@thi.ng/dl-asset@0.4.2) (2020-08-16)
+## [0.4.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/dl-asset@0.4.9...@thi.ng/dl-asset@0.4.10) (2020-12-22)
**Note:** Version bump only for package @thi.ng/dl-asset
diff --git a/packages/dl-asset/package.json b/packages/dl-asset/package.json
index 9da920abcf..7540630d83 100644
--- a/packages/dl-asset/package.json
+++ b/packages/dl-asset/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dl-asset",
- "version": "0.4.9",
+ "version": "0.4.10",
"description": "Local asset download for web apps, with automatic MIME type detection",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,19 +39,19 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/mime": "^0.1.25"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/mime": "^0.1.26"
},
"files": [
"*.js",
diff --git a/packages/dlogic/CHANGELOG.md b/packages/dlogic/CHANGELOG.md
index 6254ac3e2a..6a79aff401 100644
--- a/packages/dlogic/CHANGELOG.md
+++ b/packages/dlogic/CHANGELOG.md
@@ -3,63 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.0.35](https://github.com/thi-ng/umbrella/compare/@thi.ng/dlogic@1.0.34...@thi.ng/dlogic@1.0.35) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/dlogic
-
-
-
-
-
-## [1.0.34](https://github.com/thi-ng/umbrella/compare/@thi.ng/dlogic@1.0.33...@thi.ng/dlogic@1.0.34) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/dlogic
-
-
-
-
-
-## [1.0.33](https://github.com/thi-ng/umbrella/compare/@thi.ng/dlogic@1.0.32...@thi.ng/dlogic@1.0.33) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/dlogic
-
-
-
-
-
-## [1.0.32](https://github.com/thi-ng/umbrella/compare/@thi.ng/dlogic@1.0.31...@thi.ng/dlogic@1.0.32) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/dlogic
-
-
-
-
-
-## [1.0.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/dlogic@1.0.30...@thi.ng/dlogic@1.0.31) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/dlogic
-
-
-
-
-
-## [1.0.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/dlogic@1.0.29...@thi.ng/dlogic@1.0.30) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/dlogic
-
-
-
-
-
-## [1.0.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/dlogic@1.0.28...@thi.ng/dlogic@1.0.29) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/dlogic
-
-
-
-
-
-## [1.0.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/dlogic@1.0.27...@thi.ng/dlogic@1.0.28) (2020-08-16)
+## [1.0.36](https://github.com/thi-ng/umbrella/compare/@thi.ng/dlogic@1.0.35...@thi.ng/dlogic@1.0.36) (2020-12-22)
**Note:** Version bump only for package @thi.ng/dlogic
diff --git a/packages/dlogic/package.json b/packages/dlogic/package.json
index 0e0de7ffb8..d3f428ab7b 100644
--- a/packages/dlogic/package.json
+++ b/packages/dlogic/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dlogic",
- "version": "1.0.35",
+ "version": "1.0.36",
"description": "Assorted digital logic ops / constructs",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,17 +39,17 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4"
+ "@thi.ng/api": "^6.13.5"
},
"files": [
"*.js",
diff --git a/packages/dot/CHANGELOG.md b/packages/dot/CHANGELOG.md
index 55e5bad341..f5705d249a 100644
--- a/packages/dot/CHANGELOG.md
+++ b/packages/dot/CHANGELOG.md
@@ -3,63 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.2.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@1.2.20...@thi.ng/dot@1.2.21) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/dot
-
-
-
-
-
-## [1.2.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@1.2.19...@thi.ng/dot@1.2.20) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/dot
-
-
-
-
-
-## [1.2.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@1.2.18...@thi.ng/dot@1.2.19) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/dot
-
-
-
-
-
-## [1.2.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@1.2.17...@thi.ng/dot@1.2.18) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/dot
-
-
-
-
-
-## [1.2.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@1.2.16...@thi.ng/dot@1.2.17) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/dot
-
-
-
-
-
-## [1.2.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@1.2.15...@thi.ng/dot@1.2.16) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/dot
-
-
-
-
-
-## [1.2.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@1.2.14...@thi.ng/dot@1.2.15) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/dot
-
-
-
-
-
-## [1.2.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@1.2.13...@thi.ng/dot@1.2.14) (2020-08-16)
+## [1.2.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/dot@1.2.21...@thi.ng/dot@1.2.22) (2020-12-22)
**Note:** Version bump only for package @thi.ng/dot
diff --git a/packages/dot/package.json b/packages/dot/package.json
index f8a159361f..08edea126c 100644
--- a/packages/dot/package.json
+++ b/packages/dot/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dot",
- "version": "1.2.21",
+ "version": "1.2.22",
"description": "Graphviz document abstraction & serialization to DOT format",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,18 +39,18 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/checks": "^2.7.11"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/checks": "^2.7.12"
},
"files": [
"*.js",
diff --git a/packages/dsp-io-wav/CHANGELOG.md b/packages/dsp-io-wav/CHANGELOG.md
index 8c0d2f2218..a7c5b10248 100644
--- a/packages/dsp-io-wav/CHANGELOG.md
+++ b/packages/dsp-io-wav/CHANGELOG.md
@@ -3,71 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.1.33](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@0.1.32...@thi.ng/dsp-io-wav@0.1.33) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/dsp-io-wav
-
-
-
-
-
-## [0.1.32](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@0.1.31...@thi.ng/dsp-io-wav@0.1.32) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/dsp-io-wav
-
-
-
-
-
-## [0.1.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@0.1.30...@thi.ng/dsp-io-wav@0.1.31) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/dsp-io-wav
-
-
-
-
-
-## [0.1.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@0.1.29...@thi.ng/dsp-io-wav@0.1.30) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/dsp-io-wav
-
-
-
-
-
-## [0.1.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@0.1.28...@thi.ng/dsp-io-wav@0.1.29) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/dsp-io-wav
-
-
-
-
-
-## [0.1.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@0.1.27...@thi.ng/dsp-io-wav@0.1.28) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/dsp-io-wav
-
-
-
-
-
-## [0.1.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@0.1.26...@thi.ng/dsp-io-wav@0.1.27) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/dsp-io-wav
-
-
-
-
-
-## [0.1.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@0.1.25...@thi.ng/dsp-io-wav@0.1.26) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/dsp-io-wav
-
-
-
-
-
-## [0.1.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@0.1.24...@thi.ng/dsp-io-wav@0.1.25) (2020-08-16)
+## [0.1.34](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp-io-wav@0.1.33...@thi.ng/dsp-io-wav@0.1.34) (2020-12-22)
**Note:** Version bump only for package @thi.ng/dsp-io-wav
diff --git a/packages/dsp-io-wav/package.json b/packages/dsp-io-wav/package.json
index 529dc27e88..3591ea764f 100644
--- a/packages/dsp-io-wav/package.json
+++ b/packages/dsp-io-wav/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dsp-io-wav",
- "version": "0.1.33",
+ "version": "0.1.34",
"description": "WAV file format generation",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,20 +39,20 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/binary": "^2.0.19",
- "@thi.ng/transducers": "^7.5.2",
- "@thi.ng/transducers-binary": "^0.5.33"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/binary": "^2.0.20",
+ "@thi.ng/transducers": "^7.5.3",
+ "@thi.ng/transducers-binary": "^0.6.0"
},
"files": [
"*.js",
diff --git a/packages/dsp/CHANGELOG.md b/packages/dsp/CHANGELOG.md
index e317db3872..712a236256 100644
--- a/packages/dsp/CHANGELOG.md
+++ b/packages/dsp/CHANGELOG.md
@@ -3,41 +3,39 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [2.1.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@2.1.4...@thi.ng/dsp@2.1.5) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/dsp
-
-
-
-
-
-## [2.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@2.1.3...@thi.ng/dsp@2.1.4) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/dsp
-
-
-
-
-
-## [2.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@2.1.2...@thi.ng/dsp@2.1.3) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/dsp
-
+# [3.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@2.1.5...@thi.ng/dsp@3.0.0) (2020-12-22)
+### Code Refactoring
+* **adjacency:** fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace enums w/ type aliases ([b9cfacb](https://github.com/thi-ng/umbrella/commit/b9cfacbbb67fcb89d72090bdad512edaffa1adcf))
-## [2.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@2.1.1...@thi.ng/dsp@2.1.2) (2020-09-22)
-**Note:** Version bump only for package @thi.ng/dsp
+### Features
+* **dsp:** add applyWindow(), windowBartlett() ([d51a17c](https://github.com/thi-ng/umbrella/commit/d51a17c10dd6cbfbb69bb1cf09f46e59d2dd8ba2))
+* **dsp:** add cos() stateless oscillator ([276c6b7](https://github.com/thi-ng/umbrella/commit/276c6b76a6b69498f3b37c94fc34c4915b95b9b6))
+* **dsp:** add power & integral fns ([88edaac](https://github.com/thi-ng/umbrella/commit/88edaac0b93fb811738cbfd06d41063d8c4b9aff))
+* **dsp:** add windowWelch(), add docs ([84cd476](https://github.com/thi-ng/umbrella/commit/84cd4763a2a897d6b15b21b680fe2c8bd15c9d4a))
+* **dsp:** add/update power & integral fns ([f455fad](https://github.com/thi-ng/umbrella/commit/f455fad649394cd386839d983d8ae25895f9f1a2))
+* **dsp:** add/update various FFT & spectrum fns (fix [#258](https://github.com/thi-ng/umbrella/issues/258)) ([e351acb](https://github.com/thi-ng/umbrella/commit/e351acb98b1c776a6c8efe9ba910c2ec3b2df831))
+### BREAKING CHANGES
+* **adjacency:** replace filter type enums w/ type aliases
-## [2.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@2.1.0...@thi.ng/dsp@2.1.1) (2020-09-13)
+- FilterType
+- BiquadType
+- SVFType
+- OnepoleType
+* **dsp:** new args for normalizeFFT(),denormalizeFFT(), spectrumPow()
-**Note:** Version bump only for package @thi.ng/dsp
+- add support for windowing adjustments in above functions
+- add thresholdFFT()
+- add copyComplex()
+- update various real/complex checks using isComplex()
+- update docs, add references
@@ -54,22 +52,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [2.0.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@2.0.27...@thi.ng/dsp@2.0.28) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/dsp
-
-
-
-
-
-## [2.0.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@2.0.26...@thi.ng/dsp@2.0.27) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/dsp
-
-
-
-
-
# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@1.0.18...@thi.ng/dsp@2.0.0) (2020-01-24)
### Code Refactoring
diff --git a/packages/dsp/README.md b/packages/dsp/README.md
index d625ead9c9..0c94d17291 100644
--- a/packages/dsp/README.md
+++ b/packages/dsp/README.md
@@ -72,7 +72,7 @@ yarn add @thi.ng/dsp
```
-Package sizes (gzipped, pre-treeshake): ESM: 6.75 KB / CJS: 7.22 KB / UMD: 6.73 KB
+Package sizes (gzipped, pre-treeshake): ESM: 6.98 KB / CJS: 7.51 KB / UMD: 6.94 KB
## Dependencies
@@ -515,19 +515,27 @@ Desmos](https://www.desmos.com/calculator/lkyf2ag3ta) to experiment.
- `scaleFFT()`
- `complexArray()`
- `conjugate()`
+- `powerSumSquared()`
+- `powerMeanSquared()`
+- `powerTimeIntegral()`
- `spectrumMag()`
- `spectrumPow()` (optionally as dBFS)
- `spectrumPhase()`
- `binFreq()`
- `freqBin()`
- `fftFreq()`
+- `integralT()` / `integralTSquared()`
+- `integralF()` / `integralFSquared()`
#### Window functions
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/fft/window.ts)
- `window()`
+- `applyWindow()`
- `windowRect()`
+- `windowBartlett()`
+- `windowWelch()`
- `windowSin()`
- `windowSinPow()`
- `windowLanczos()`
diff --git a/packages/dsp/package.json b/packages/dsp/package.json
index 1334fa68d0..f9ba04e3d3 100644
--- a/packages/dsp/package.json
+++ b/packages/dsp/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dsp",
- "version": "2.1.5",
+ "version": "3.0.0",
"description": "Composable signal generators, oscillators, filters, FFT, spectrum, windowing & related DSP utils",
"module": "./index.js",
"main": "./lib/index.js",
@@ -31,7 +31,7 @@
"build:check": "tsc --isolatedModules --noEmit",
"test": "mocha test",
"cover": "nyc mocha test && nyc report --reporter=lcov",
- "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib comp gen osc proc util",
+ "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib comp fft gen osc proc util",
"doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
"doc": "node_modules/.bin/typedoc --mode modules --out doc --theme ../../tools/doc/typedoc-theme src",
"doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
@@ -39,22 +39,22 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/random": "^2.1.2",
- "@thi.ng/transducers": "^7.5.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/random": "^2.1.3",
+ "@thi.ng/transducers": "^7.5.3"
},
"files": [
"*.js",
diff --git a/packages/dsp/src/api.ts b/packages/dsp/src/api.ts
index d3beadb02f..8a4cefdddc 100644
--- a/packages/dsp/src/api.ts
+++ b/packages/dsp/src/api.ts
@@ -43,3 +43,26 @@ export interface IFilter {
*/
filterCoeffs(): FilterConfig;
}
+
+export type FilterType =
+ | "lp"
+ | "hp"
+ | "bp"
+ | "notch"
+ | "peak"
+ | "loshelf"
+ | "hishelf"
+ | "all";
+
+export type BiquadType =
+ | "lp"
+ | "hp"
+ | "bp"
+ | "notch"
+ | "peak"
+ | "loshelf"
+ | "hishelf";
+
+export type OnepoleType = "lp" | "hp";
+
+export type SVFType = "lp" | "hp" | "bp" | "notch" | "peak" | "all";
diff --git a/packages/dsp/src/constants.ts b/packages/dsp/src/constants.ts
deleted file mode 100644
index 0066c1b64d..0000000000
--- a/packages/dsp/src/constants.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-export enum FilterType {
- LP,
- HP,
- BP,
- NOTCH,
- PEAK,
- LOSHELF,
- HISHELF,
- ALL,
-}
diff --git a/packages/dsp/src/fft/fft.ts b/packages/dsp/src/fft/fft.ts
index e8fef487f1..0917e4cc24 100644
--- a/packages/dsp/src/fft/fft.ts
+++ b/packages/dsp/src/fft/fft.ts
@@ -1,9 +1,9 @@
import type { FnN3, NumericArray } from "@thi.ng/api";
-import { isNumber } from "@thi.ng/checks";
import type { ComplexArray } from "../api";
+import { isComplex } from "../util/complex";
import { magDb } from "../util/convert";
-
-const PI = Math.PI;
+import { invPowerScale, powerScale } from "./power";
+import { applyWindow } from "./window";
/**
* Returns a new tuple of real/img F64 buffers of given size.
@@ -15,6 +15,16 @@ export const complexArray = (n: number): ComplexArray => [
new Float64Array(n),
];
+/**
+ * Creates a deep copy of given {@link ComplexArray}.
+ *
+ * @param complex
+ */
+export const copyComplex = (complex: ComplexArray): ComplexArray => [
+ complex[0].slice(),
+ complex[1].slice(),
+];
+
/**
* If given a {@link ComplexArray}, computes the complex conjugate,
* concatenates it in mirrored order to input (excluding bin 0) and
@@ -62,15 +72,7 @@ export const complexArray = (n: number): ComplexArray => [
export function conjugate(src: NumericArray, isImg?: boolean): NumericArray;
export function conjugate(complex: ComplexArray): ComplexArray;
export function conjugate(src: NumericArray | ComplexArray, isImg = true): any {
- if (isNumber(src[0])) {
- const n = src.length;
- const dest = new Float64Array(n * 2);
- dest.set(src);
- for (let i = 1, j = n * 2 - 1; i < n; i++, j--) {
- dest[j] = isImg ? -(src)[i] : (src)[i];
- }
- return dest;
- } else {
+ if (isComplex(src)) {
const n = src[0].length;
const res = complexArray(n * 2);
const [sreal, simg] = src;
@@ -82,6 +84,14 @@ export function conjugate(src: NumericArray | ComplexArray, isImg = true): any {
dimg[j] = -simg[i];
}
return res;
+ } else {
+ const n = src.length;
+ const dest = new Float64Array(n * 2);
+ dest.set(src);
+ for (let i = 1, j = n * 2 - 1; i < n; i++, j--) {
+ dest[j] = isImg ? -(src)[i] : (src)[i];
+ }
+ return dest;
}
}
@@ -147,7 +157,7 @@ const transform = (real: NumericArray, img: NumericArray, n: number) => {
step <<= 1;
ur = 1;
ui = 0;
- t = PI / prevStep;
+ t = Math.PI / prevStep;
wr = Math.cos(t);
wi = -Math.sin(t);
for (j = 1; j <= prevStep; j++) {
@@ -192,19 +202,16 @@ export const fft = (
window?: NumericArray
): ComplexArray => {
let real: NumericArray, img: NumericArray | undefined;
- if (isNumber(complex[0])) {
- real = complex;
- } else {
+ if (isComplex(complex)) {
real = complex[0];
img = complex[1];
+ } else {
+ real = complex;
}
- const n = real.length;
if (window) {
- for (let i = 0; i < n; i++) {
- real[i] *= window[i];
- }
+ applyWindow(real, window);
}
-
+ const n = real.length;
if (img) {
swapRI(real, img, n);
} else {
@@ -218,8 +225,9 @@ export const fft = (
};
/**
- * Inverse FFT via computing forward transform with swapped
- * real/imaginary components. Expects denormalized inputs.
+ * Inverse FFT via computing forward transform with swapped real/imaginary
+ * components. Expects denormalized inputs (i.e. the same as the result of
+ * {@link fft}).
*
* @remarks
*
@@ -228,9 +236,9 @@ export const fft = (
* @param complex
*/
export const ifft = (src: NumericArray | ComplexArray): ComplexArray => {
- let complex: ComplexArray = isNumber(src[0])
- ? [new Float64Array(src.length), src]
- : src;
+ let complex: ComplexArray = isComplex(src)
+ ? src
+ : [new Float64Array(src.length), src];
fft([complex[1], complex[0]]);
return scaleFFT(complex, 1 / complex[0].length);
};
@@ -248,15 +256,74 @@ export const scaleFFT = (
return [real, img];
};
-export const normalizeFFT = (complex: ComplexArray): ComplexArray =>
- scaleFFT(complex, 1 / Math.sqrt(complex[0].length));
+/**
+ * Normalizes the complex FFT array by scaling each complex bin value with given
+ * scale factor (or, if given as array, the scale factor derived from these
+ * window function samples).
+ *
+ * @remarks
+ * By default assumes a rectangular window and the resulting scale factor of 2 /
+ * N.
+ *
+ * References:
+ * - https://holometer.fnal.gov/GH_FFT.pdf
+ *
+ * @param complex
+ * @param window
+ */
+export const normalizeFFT = (
+ complex: ComplexArray,
+ window: number | NumericArray = 2 / complex[0].length
+): ComplexArray => scaleFFT(complex, powerScale(window, 2));
-export const denormalizeFFT = (complex: ComplexArray): ComplexArray =>
- scaleFFT(complex, Math.sqrt(complex[0].length));
+/**
+ * Inverse operation of {@link normalizeFFT}. De-normalizes the complex FFT
+ * array by scaling each complex bin value with given scale factor (or, if given
+ * as array, the scale factor derived from these window function samples).
+ *
+ * @remarks
+ * By default assumes a rectangular window and the resulting scale factor of N /
+ * 2.
+ *
+ * References:
+ * - https://holometer.fnal.gov/GH_FFT.pdf
+ *
+ * @param complex
+ * @param window
+ */
+export const denormalizeFFT = (
+ complex: ComplexArray,
+ window: number | NumericArray = complex[0].length / 2
+): ComplexArray => scaleFFT(complex, invPowerScale(window, 2));
+
+/**
+ * Computes the magnitude of each FFT bin and if less than given `eps`
+ * threshold, sets that bin to zero. Returns input FFT array.
+ *
+ * @remarks
+ * It's recommended to apply this function prior computing
+ * {@link spectrumPhase}. The `eps` value might have to be adjusted and should
+ * be approx. `max(spectrumMag(fft))/10000`.
+ *
+ * References:
+ * - https://www.gaussianwaves.com/2015/11/interpreting-fft-results-obtaining-magnitude-and-phase-information/
+ *
+ * @param complex
+ * @param eps
+ */
+export const thresholdFFT = (complex: ComplexArray, eps = 1e-12) => {
+ const [real, img] = complex;
+ for (let i = 0, n = real.length; i < n; i++) {
+ if (Math.hypot(real[i], img[i]) < eps) {
+ real[i] = img[i] = 0;
+ }
+ }
+ return complex;
+};
/**
- * Computes magnitude spectrum for given FFT. By default only the first
- * N/2 values are returned.
+ * Computes magnitude spectrum for given FFT: y(i) = abs(c(i)). By default only
+ * the first N/2 values are returned.
*
* @param complex - FFT result
* @param n - bin count
@@ -269,35 +336,48 @@ export const spectrumMag = (
) => {
const [real, img] = complex;
for (let i = 0; i < n; i++) {
- out[i] = Math.sqrt(real[i] ** 2 + img[i] ** 2);
+ out[i] = Math.hypot(real[i], img[i]);
}
return out;
};
/**
- * Computes power spectrum (optionally as dBFS) for the given raw,
- * unnormalized FFT result arrays (length = N) and writes result to
- * `out`.
+ * Computes power spectrum (optionally as dBFS) for the given FFT result arrays
+ * (length = N) and optional `window`. Writes result to `out` or a new array.
*
* @remarks
- * By default only the first N/2 values are returned. If `db` is true,
- * the spectrum values are converted to dBFS.
+ * If `window` is given (scale factor or array), it will be used as (if number)
+ * or to compute the scaling factor (if array) for each FFT bin's value. The
+ * default (`window=1`) is the equivalent to a rectangular window (i.e. a
+ * no-op). If windowing was used to compute the FFT, the same should be provided
+ * to this function for correct results.
*
+ * **IMPORTANT:** If the FFT result has already been normalized using
+ * {@link normalizeFFT}, the scaling factor (`window` arg) MUST be set 1.0.
+ *
+ * By default only the first N/2 values are returned. If `db` is true, the
+ * spectrum values are converted to dBFS.
+ *
+ * - https://holometer.fnal.gov/GH_FFT.pdf
+ * - https://dsp.stackexchange.com/a/32080
+ * - https://dsp.stackexchange.com/a/14935
* - https://www.kvraudio.com/forum/viewtopic.php?t=276092
*
* @param complex
* @param db
+ * @param window
* @param n
* @param out
*/
export const spectrumPow = (
complex: ComplexArray,
db = false,
+ window: number | NumericArray = 2 / complex[0].length,
n = complex[0].length / 2,
out: NumericArray = []
) => {
const [real, img] = complex;
- const scale = 1 / real.length;
+ const scale = powerScale(window, 2);
for (let i = 0; i < n; i++) {
const p = real[i] ** 2 + img[i] ** 2;
out[i] = db ? magDb(Math.sqrt(p) * scale) : p * scale;
@@ -306,8 +386,12 @@ export const spectrumPow = (
};
/**
- * Computes phase spectrum for given FFT and writes results to `out`. By
- * default only the first N/2 values are returned.
+ * Computes phase spectrum for given FFT and writes results to `out`. By default
+ * only the first N/2 values are returned.
+ *
+ * @remarks
+ * Consider applying {@link thresholdFFT} prior to computing the phase spectrum
+ * to avoid exploding floating point error magnitudes.
*
* @param complex - FFT result
* @param n - bin count
@@ -346,16 +430,17 @@ export const freqBin: FnN3 = (f, fs, n) => ((f * n) / fs) | 0;
export const binFreq: FnN3 = (bin, fs, n) => (bin * fs) / n;
/**
- * Returns array of bin center frequencies for given FFT window size and
- * sample rate. By default only the first N/2 values are returned.
+ * Returns array of bin center frequencies for given FFT window size and sample
+ * rate. By default only the first N/2+1 values are returned (`m` and including
+ * 0Hz).
*
- * @param n
- * @param fs
- * @param m
+ * @param n - window size
+ * @param fs - sample rate
+ * @param m - number of result values
*/
export const fftFreq = (n: number, fs: number, m = n / 2) => {
const res = new Float64Array(m);
- for (let i = 0; i < m; i++) {
+ for (let i = 0; i <= m; i++) {
res[i] = binFreq(i, fs, n);
}
return res;
diff --git a/packages/dsp/src/fft/power.ts b/packages/dsp/src/fft/power.ts
new file mode 100644
index 0000000000..c7222762ea
--- /dev/null
+++ b/packages/dsp/src/fft/power.ts
@@ -0,0 +1,121 @@
+import type { NumericArray } from "@thi.ng/api";
+import { isNumber } from "@thi.ng/checks";
+import type { ComplexArray } from "../api";
+import { isComplex } from "../util/complex";
+
+/**
+ * Computes the sum of the given array.
+ *
+ * @param window
+ */
+export const integralT = (window: NumericArray) => {
+ let sum = 0;
+ for (let i = window.length; --i >= 0; ) {
+ sum += window[i];
+ }
+ return sum;
+};
+
+/**
+ * Computes the squared sum of given array.
+ *
+ * @param window
+ */
+export const integralTSquared = (window: NumericArray) => {
+ let sum = 0;
+ for (let i = window.length; --i >= 0; ) {
+ sum += window[i] ** 2;
+ }
+ return sum;
+};
+
+/**
+ * Computes the `sum(|c(i)|)` for given complex array.
+ *
+ * @param window
+ */
+export const integralF = ([real, img]: ComplexArray) => {
+ let sum = 0;
+ for (let i = real.length; --i >= 0; ) {
+ sum += Math.hypot(real[i], img[i]);
+ }
+ return sum;
+};
+
+/**
+ * Computes the `sum(|c(i)|^2)` for given complex array.
+ *
+ * @param window
+ */
+export const integralFSquared = ([real, img]: ComplexArray) => {
+ let sum = 0;
+ for (let i = real.length; --i >= 0; ) {
+ sum += real[i] ** 2 + img[i] ** 2;
+ }
+ return sum;
+};
+
+/**
+ * If `scale` is a number, returns it. Else returns `base / integralT(scale)`.
+ *
+ * @param scale
+ * @param base
+ */
+export const powerScale = (scale: number | NumericArray, base = 1) =>
+ isNumber(scale) ? scale : base / integralT(scale);
+
+/**
+ * If `scale` is a number, returns it. Else returns `integralT(scale) / base`.
+ *
+ * @param scale
+ * @param base
+ */
+export const invPowerScale = (scale: number | NumericArray, base = 1) =>
+ isNumber(scale) ? scale : integralT(scale) / base;
+
+/**
+ * Computes sum squared power of given time or frequency domain window.
+ *
+ * @remarks
+ * References:
+ * - http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c13-4.pdf
+ * - http://www.hep.ucl.ac.uk/~rjn/saltStuff/fftNormalisation.pdf
+ *
+ * @param window
+ */
+export const powerSumSquared = (window: NumericArray | ComplexArray) =>
+ isComplex(window)
+ ? integralFSquared(window) / window[0].length
+ : integralTSquared(window);
+
+/**
+ * Computes mean squared power of given time or frequency domain window.
+ *
+ * @remarks
+ * References:
+ * - http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c13-4.pdf
+ * - http://www.hep.ucl.ac.uk/~rjn/saltStuff/fftNormalisation.pdf
+ *
+ * @param window
+ */
+export const powerMeanSquared = (window: NumericArray | ComplexArray) =>
+ powerSumSquared(window) /
+ (isComplex(window) ? window[0].length : window.length);
+
+/**
+ * Computes time-integral squared power of given time or frequency domain
+ * window.
+ *
+ * @remarks
+ * References:
+ * - http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c13-4.pdf
+ * - http://www.hep.ucl.ac.uk/~rjn/saltStuff/fftNormalisation.pdf
+ *
+ * @param window
+ */
+export const powerTimeIntegral = (
+ window: NumericArray | ComplexArray,
+ fs: number
+) =>
+ (isComplex(window) ? integralFSquared(window) : integralTSquared(window)) /
+ fs;
diff --git a/packages/dsp/src/fft/window.ts b/packages/dsp/src/fft/window.ts
index e834afd2a6..f5e9a25217 100644
--- a/packages/dsp/src/fft/window.ts
+++ b/packages/dsp/src/fft/window.ts
@@ -1,4 +1,4 @@
-import type { FloatArray, Fn, FnU3, FnU4 } from "@thi.ng/api";
+import type { FloatArray, Fn, FnU3, FnU4, NumericArray } from "@thi.ng/api";
import { isNumber } from "@thi.ng/checks";
import { PI, TAU } from "@thi.ng/math";
import type { WindowFn } from "../api";
@@ -27,8 +27,32 @@ export const window = (fn: WindowFn, lenOfBuf: number | FloatArray) => {
return buf;
};
+/**
+ * Takes a `signal` and `window` buffer and multiplies both elementwise. Writes
+ * results into `out` (or back into `signal` by default).
+ *
+ * @param signal
+ * @param window
+ * @param out
+ */
+export const applyWindow = (
+ signal: NumericArray,
+ window: NumericArray,
+ out = signal
+) => {
+ for (let i = signal.length; --i >= 0; ) {
+ out[i] = signal[i] * window[i];
+ }
+ return out;
+};
+
export const windowRect: WindowFn = () => 1;
+export const windowBartlett: WindowFn = (i, n) =>
+ 1 - Math.abs((i - n / 2) / (n / 2));
+
+export const windowWelch: WindowFn = (i, n) => 1 - ((i - n / 2) / (n / 2)) ** 2;
+
export const windowSin: WindowFn = (i, n) => sin((PI * i) / n);
export const windowSinPow: Fn = (k) => (i, n) =>
diff --git a/packages/dsp/src/index.ts b/packages/dsp/src/index.ts
index 796363ed0a..c62b6636f5 100644
--- a/packages/dsp/src/index.ts
+++ b/packages/dsp/src/index.ts
@@ -1,5 +1,4 @@
export * from "./api";
-export * from "./constants";
export * from "./comp/addg";
export * from "./comp/compp";
@@ -43,6 +42,7 @@ export * from "./proc/svf";
export * from "./proc/waveshaper";
export * from "./osc/additive";
+export * from "./osc/cos";
export * from "./osc/dsf";
export * from "./osc/mix";
export * from "./osc/parabolic";
@@ -53,8 +53,10 @@ export * from "./osc/tri";
export * from "./osc/wavetable";
export * from "./fft/fft";
+export * from "./fft/power";
export * from "./fft/window";
export * from "./util/anti-alias";
+export * from "./util/complex";
export * from "./util/convert";
export * from "./util/filter-response";
diff --git a/packages/dsp/src/osc/cos.ts b/packages/dsp/src/osc/cos.ts
new file mode 100644
index 0000000000..3d8b17e81b
--- /dev/null
+++ b/packages/dsp/src/osc/cos.ts
@@ -0,0 +1,5 @@
+import { TAU } from "@thi.ng/math";
+import type { StatelessOscillator } from "../api";
+
+export const cos: StatelessOscillator = (phase, freq, amp = 1, dc = 0) =>
+ dc + amp * Math.cos(phase * freq * TAU);
diff --git a/packages/dsp/src/proc/biquad.ts b/packages/dsp/src/proc/biquad.ts
index fea1cdab76..82b884d778 100644
--- a/packages/dsp/src/proc/biquad.ts
+++ b/packages/dsp/src/proc/biquad.ts
@@ -1,20 +1,10 @@
import type { IReset } from "@thi.ng/api";
import { unsupported } from "@thi.ng/errors";
import { clamp05, PI, SQRT2, SQRT2_2 } from "@thi.ng/math";
-import type { FilterConfig, IFilter } from "../api";
-import { FilterType } from "../constants";
+import type { BiquadType, FilterConfig, IFilter } from "../api";
import { dbMag } from "../util/convert";
import { AProc } from "./aproc";
-type BiquadType =
- | FilterType.LP
- | FilterType.HP
- | FilterType.BP
- | FilterType.NOTCH
- | FilterType.PEAK
- | FilterType.LOSHELF
- | FilterType.HISHELF;
-
export const biquad = (
type: BiquadType,
fc: number,
@@ -22,26 +12,23 @@ export const biquad = (
gain?: number
) => new Biquad(type, fc, q, gain);
-export const biquadLP = (fc: number, q?: number) =>
- new Biquad(FilterType.LP, fc, q);
+export const biquadLP = (fc: number, q?: number) => new Biquad("lp", fc, q);
-export const biquadHP = (fc: number, q?: number) =>
- new Biquad(FilterType.HP, fc, q);
+export const biquadHP = (fc: number, q?: number) => new Biquad("hp", fc, q);
-export const biquadBP = (fc: number, q?: number) =>
- new Biquad(FilterType.BP, fc, q);
+export const biquadBP = (fc: number, q?: number) => new Biquad("bp", fc, q);
export const biquadNotch = (fc: number, q?: number) =>
- new Biquad(FilterType.NOTCH, fc, q);
+ new Biquad("notch", fc, q);
export const biquadPeak = (fc: number, q?: number, gain = 6) =>
- new Biquad(FilterType.PEAK, fc, q, gain);
+ new Biquad("peak", fc, q, gain);
export const biquadLoShelf = (fc: number, gain = -6) =>
- new Biquad(FilterType.LOSHELF, fc, undefined, gain);
+ new Biquad("loshelf", fc, undefined, gain);
export const biquadHiShelf = (fc: number, gain = -6) =>
- new Biquad(FilterType.HISHELF, fc, undefined, gain);
+ new Biquad("hishelf", fc, undefined, gain);
export class Biquad extends AProc implements IReset, IFilter {
protected _a0!: number;
@@ -129,7 +116,7 @@ export class Biquad extends AProc implements IReset, IFilter {
const ksqrt2v = k * Math.sqrt(2 * v);
let norm = 1 / k2kqp1;
switch (this._type) {
- case FilterType.LP:
+ case "lp":
this._a0 = k2 * norm;
this._a1 = 2 * this._a0;
this._a2 = this._a0;
@@ -137,7 +124,7 @@ export class Biquad extends AProc implements IReset, IFilter {
this._b2 = k2kqm1 * norm;
break;
- case FilterType.HP:
+ case "hp":
this._a0 = norm;
this._a1 = -2 * this._a0;
this._a2 = this._a0;
@@ -145,7 +132,7 @@ export class Biquad extends AProc implements IReset, IFilter {
this._b2 = k2kqm1 * norm;
break;
- case FilterType.BP:
+ case "bp":
this._a0 = kq * norm;
this._a1 = 0;
this._a2 = -this._a0;
@@ -153,7 +140,7 @@ export class Biquad extends AProc implements IReset, IFilter {
this._b2 = k2kqm1 * norm;
break;
- case FilterType.NOTCH:
+ case "notch":
this._a0 = (1 + k2) * norm;
this._a1 = k22 * norm;
this._a2 = this._a0;
@@ -161,7 +148,7 @@ export class Biquad extends AProc implements IReset, IFilter {
this._b2 = k2kqm1 * norm;
break;
- case FilterType.PEAK: {
+ case "peak": {
const z1 = 1 + kvq + k2;
const z2 = 1 - kvq + k2;
if (this._gain >= 0) {
@@ -181,7 +168,7 @@ export class Biquad extends AProc implements IReset, IFilter {
break;
}
- case FilterType.LOSHELF: {
+ case "loshelf": {
const z1 = 1 + ksqrt2 + k2;
const z2 = 1 - ksqrt2 + k2;
const vk2 = v * k2;
@@ -206,7 +193,7 @@ export class Biquad extends AProc implements IReset, IFilter {
break;
}
- case FilterType.HISHELF: {
+ case "hishelf": {
const z1 = 1 + ksqrt2 + k2;
const z2 = 1 - ksqrt2 + k2;
const y1 = v + ksqrt2v + k2;
diff --git a/packages/dsp/src/proc/dcblock.ts b/packages/dsp/src/proc/dcblock.ts
index 41f9516d3c..8dc3ad5c6a 100644
--- a/packages/dsp/src/proc/dcblock.ts
+++ b/packages/dsp/src/proc/dcblock.ts
@@ -1,4 +1,3 @@
-import { FilterType } from "../constants";
import { OnePole } from "./onepole";
/**
@@ -6,7 +5,7 @@ import { OnePole } from "./onepole";
*
* @param freq
*/
-export const dcBlock = (freq: number) => new DCBlock(FilterType.LP, freq);
+export const dcBlock = (freq: number) => new DCBlock("lp", freq);
export class DCBlock extends OnePole {
next(x: number) {
diff --git a/packages/dsp/src/proc/onepole.ts b/packages/dsp/src/proc/onepole.ts
index 4eb311a598..d2ac1d7c12 100644
--- a/packages/dsp/src/proc/onepole.ts
+++ b/packages/dsp/src/proc/onepole.ts
@@ -1,14 +1,11 @@
import type { IClear, IReset } from "@thi.ng/api";
import { clamp05, TAU } from "@thi.ng/math";
-import type { FilterConfig, IFilter } from "../api";
-import { FilterType } from "../constants";
+import type { FilterConfig, IFilter, OnepoleType } from "../api";
import { AProc } from "./aproc";
-type OnepoleType = FilterType.LP | FilterType.HP;
+export const onepoleLP = (fc: number) => new OnePole("lp", fc);
-export const onepoleLP = (fc: number) => new OnePole(FilterType.LP, fc);
-
-export const onepoleHP = (fc: number) => new OnePole(FilterType.HP, fc);
+export const onepoleHP = (fc: number) => new OnePole("hp", fc);
/**
* https://www.earlevel.com/main/2012/12/15/a-one-pole-filter/
@@ -39,7 +36,7 @@ export class OnePole
setFreq(fc: number) {
this._freq = fc = clamp05(fc);
- if (this._type === FilterType.LP) {
+ if (this._type === "lp") {
this._b1 = Math.exp(-TAU * fc);
this._a0 = 1 - this._b1;
} else {
@@ -51,7 +48,7 @@ export class OnePole
filterCoeffs(): FilterConfig {
return {
zeroes: [this._a0],
- poles: [1, this._type === FilterType.LP ? this._b1 : -this._b1],
+ poles: [1, this._type === "lp" ? this._b1 : -this._b1],
};
}
}
diff --git a/packages/dsp/src/proc/svf.ts b/packages/dsp/src/proc/svf.ts
index cd9a87155a..47cadad660 100644
--- a/packages/dsp/src/proc/svf.ts
+++ b/packages/dsp/src/proc/svf.ts
@@ -1,30 +1,19 @@
import type { IReset } from "@thi.ng/api";
import { clamp05, PI } from "@thi.ng/math";
-import { FilterType } from "../constants";
+import type { SVFType } from "../api";
import { AProc } from "./aproc";
-type SVFType =
- | FilterType.LP
- | FilterType.HP
- | FilterType.BP
- | FilterType.NOTCH
- | FilterType.PEAK
- | FilterType.ALL;
+export const svfLP = (fc: number, q?: number) => new SVF("lp", fc, q);
-export const svfLP = (fc: number, q?: number) => new SVF(FilterType.LP, fc, q);
+export const svfHP = (fc: number, q?: number) => new SVF("hp", fc, q);
-export const svfHP = (fc: number, q?: number) => new SVF(FilterType.HP, fc, q);
+export const svfBP = (fc: number, q?: number) => new SVF("bp", fc, q);
-export const svfBP = (fc: number, q?: number) => new SVF(FilterType.BP, fc, q);
+export const svfNotch = (fc: number, q?: number) => new SVF("notch", fc, q);
-export const svfNotch = (fc: number, q?: number) =>
- new SVF(FilterType.NOTCH, fc, q);
+export const svfPeak = (fc: number, q?: number) => new SVF("peak", fc, q);
-export const svfPeak = (fc: number, q?: number) =>
- new SVF(FilterType.PEAK, fc, q);
-
-export const svfAllpass = (fc: number, q?: number) =>
- new SVF(FilterType.ALL, fc, q);
+export const svfAllpass = (fc: number, q?: number) => new SVF("all", fc, q);
/**
* Multi-type state variable filter w/ trapezoidal integration, after
@@ -66,17 +55,17 @@ export class SVF extends AProc implements IReset {
this._c2 = 2 * x2 - _c2;
// TODO support type morphing / interpolation?
switch (this._type) {
- case FilterType.LP:
+ case "lp":
return (this._val = x2);
- case FilterType.HP:
+ case "hp":
return (this._val = x - this._k * x1 - x2);
- case FilterType.BP:
+ case "bp":
return (this._val = x1);
- case FilterType.NOTCH:
+ case "notch":
return (this._val = x - this._k * x1);
- case FilterType.PEAK:
+ case "peak":
return (this._val = 2 * x2 - x + this._k * x1);
- case FilterType.ALL:
+ case "all":
return (this._val = x - 2 * this._k * x1);
}
}
diff --git a/packages/dsp/src/util/complex.ts b/packages/dsp/src/util/complex.ts
new file mode 100644
index 0000000000..f6b94253d4
--- /dev/null
+++ b/packages/dsp/src/util/complex.ts
@@ -0,0 +1,7 @@
+import type { NumericArray } from "@thi.ng/api";
+import { isNumber } from "@thi.ng/checks";
+import type { ComplexArray } from "../api";
+
+export const isComplex = (
+ buf: NumericArray | ComplexArray
+): buf is ComplexArray => !isNumber(buf[0]);
diff --git a/packages/dsp/test/fft.ts b/packages/dsp/test/fft.ts
index d60404d4f4..ba83503407 100644
--- a/packages/dsp/test/fft.ts
+++ b/packages/dsp/test/fft.ts
@@ -1,22 +1,35 @@
import type { NumericArray } from "@thi.ng/api";
+import { eqDelta, TAU } from "@thi.ng/math";
import * as assert from "assert";
import {
+ add,
ComplexArray,
- denormalizeFFT,
+ copyComplex,
+ cos,
fft,
+ freqBin,
ifft,
+ magDb,
normalizeFFT,
+ osc,
+ powerMeanSquared,
+ powerSumSquared,
+ spectrumMag,
spectrumPhase,
spectrumPow,
+ window,
+ windowRect,
} from "../src";
-const pulse8 = [-1, -1, -1, -1, 1, 1, 1, 1];
-
const deltaEq = (a: NumericArray, b: NumericArray, eps = 1e-3) => {
if (a.length != b.length) return false;
eps **= 2;
for (let i = a.length; --i >= 0; ) {
- if ((a[i] - b[i]) ** 2 > eps) return false;
+ const diff = (a[i] - b[i]) ** 2;
+ if (diff > eps) {
+ console.log("deltaEq: ", i, diff);
+ return false;
+ }
}
return true;
};
@@ -25,50 +38,45 @@ const deltaEqComplex = (a: ComplexArray, b: ComplexArray, eps?: number) =>
deltaEq(a[0], b[0], eps) && deltaEq(a[1], b[1], eps);
describe("fft", () => {
- it("pulse(8)", () => {
- const res = fft([...pulse8]);
-
- assert.ok(
- deltaEqComplex(res, [
- [0, -2, 0, -2, 0, -2, 0, -2],
- [0, 4.828, 0, 0.828, 0, -0.828, 0, -4.828],
- ])
- );
-
- assert.ok(
- deltaEqComplex(ifft(fft([...pulse8])), [
- pulse8,
- [0, 0, 0, 0, 0, 0, 0, 0],
- ])
- );
+ it("roundtrip", () => {
+ const src = osc(cos, 64 / 512, 1).take(512);
+ const rev = ifft(fft([...src]));
+ assert(deltaEq(rev[0], src));
+ });
- assert.ok(
- deltaEqComplex(
- ifft(denormalizeFFT(normalizeFFT(fft([...pulse8])))),
- [pulse8, [0, 0, 0, 0, 0, 0, 0, 0]]
- )
- );
+ it("parseval", () => {
+ const FC = 64;
+ const FS = 512;
+ const A = 0.5;
+ const N = 2 * FS;
+ const I = freqBin(FC, FS, N);
- const norm = normalizeFFT(fft([...pulse8]));
+ const src = osc(cos, add(FC / FS, 1 / 12), A).take(N);
+ const win = window(windowRect, N);
+ const fwd = fft([...src], win);
+ // parseval's theorem: sum(src[i]^2) = sum(|fft[i]|^2) / N
+ const sumT = src.reduce((acc, x) => acc + x * x, 0);
+ const sumF =
+ (fwd[0]).reduce(
+ (acc, x, i) => acc + x ** 2 + fwd[1][i] ** 2,
+ 0
+ ) / N;
- assert.ok(
- deltaEqComplex(norm, [
- [0, -0.707, 0, -0.707, 0, -0.707, 0, -0.707],
- [0, 1.707, 0, 0.293, 0, -0.293, 0, -1.707],
- ])
- );
+ assert(eqDelta(powerSumSquared(src), sumT), "sumT1");
+ assert(eqDelta(powerSumSquared(fwd), sumF), "sumF1");
+ assert(eqDelta(powerMeanSquared(src), sumT / N), "sumT2");
+ assert(eqDelta(powerMeanSquared(fwd), sumF / N), "sumF2");
- assert.ok(deltaEq(spectrumPow(res, false), [0, 3.414, 0, 0.586]));
+ assert(eqDelta(spectrumMag(fwd)[I], 2 * sumF));
+ assert(eqDelta(spectrumPow(fwd)[I], sumF));
+ assert(eqDelta(spectrumPow(fwd, true)[I], magDb(A)));
+ assert(eqDelta(spectrumPhase(fwd)[I], (1 / 12) * TAU));
- assert.ok(
- deltaEq(spectrumPow(res, true), [
- -Infinity,
- -3.698,
- -Infinity,
- -11.354,
- ])
- );
+ const norm = normalizeFFT(copyComplex(fwd), win);
- assert.ok(deltaEq(spectrumPhase(res), [0, 1.963, 0, 2.749]));
+ assert(eqDelta(spectrumMag(norm)[I], A));
+ assert(eqDelta(spectrumPow(norm, false, 1)[I], A / 2));
+ assert(eqDelta(spectrumPow(norm, true, 1)[I], magDb(A)));
+ assert(eqDelta(spectrumPhase(norm)[I], (1 / 12) * TAU));
});
});
diff --git a/packages/dsp/test/index.ts b/packages/dsp/test/index.ts
deleted file mode 100644
index ede69a9bd0..0000000000
--- a/packages/dsp/test/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-// import * as assert from "assert";
-// import * as dsp from "../src";
-
-describe("dsp", () => {
- it("tests pending");
-});
diff --git a/packages/dsp/test/tsconfig.json b/packages/dsp/test/tsconfig.json
index 43124565ec..ad9243e1b4 100644
--- a/packages/dsp/test/tsconfig.json
+++ b/packages/dsp/test/tsconfig.json
@@ -3,7 +3,9 @@
"compilerOptions": {
"outDir": "../build",
"module": "commonjs",
- "isolatedModules": false
+ "isolatedModules": false,
+ "noUnusedParameters": false,
+ "noUnusedLocals": false
},
"include": ["./**/*.ts", "../src/**/*.ts"]
}
diff --git a/packages/dsp/tpl.readme.md b/packages/dsp/tpl.readme.md
index 71ff5729b3..ecfb5bf391 100644
--- a/packages/dsp/tpl.readme.md
+++ b/packages/dsp/tpl.readme.md
@@ -462,19 +462,27 @@ Desmos](https://www.desmos.com/calculator/lkyf2ag3ta) to experiment.
- `scaleFFT()`
- `complexArray()`
- `conjugate()`
+- `powerSumSquared()`
+- `powerMeanSquared()`
+- `powerTimeIntegral()`
- `spectrumMag()`
- `spectrumPow()` (optionally as dBFS)
- `spectrumPhase()`
- `binFreq()`
- `freqBin()`
- `fftFreq()`
+- `integralT()` / `integralTSquared()`
+- `integralF()` / `integralFSquared()`
#### Window functions
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/fft/window.ts)
- `window()`
+- `applyWindow()`
- `windowRect()`
+- `windowBartlett()`
+- `windowWelch()`
- `windowSin()`
- `windowSinPow()`
- `windowLanczos()`
diff --git a/packages/dual-algebra/CHANGELOG.md b/packages/dual-algebra/CHANGELOG.md
index c481d8f33a..abee0c31c4 100644
--- a/packages/dual-algebra/CHANGELOG.md
+++ b/packages/dual-algebra/CHANGELOG.md
@@ -3,31 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/dual-algebra@0.1.3...@thi.ng/dual-algebra@0.1.4) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/dual-algebra
-
-
-
-
-
-## [0.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/dual-algebra@0.1.2...@thi.ng/dual-algebra@0.1.3) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/dual-algebra
-
-
-
-
-
-## [0.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/dual-algebra@0.1.1...@thi.ng/dual-algebra@0.1.2) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/dual-algebra
-
-
-
-
-
-## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/dual-algebra@0.1.0...@thi.ng/dual-algebra@0.1.1) (2020-09-22)
+## [0.1.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/dual-algebra@0.1.4...@thi.ng/dual-algebra@0.1.5) (2020-12-22)
**Note:** Version bump only for package @thi.ng/dual-algebra
diff --git a/packages/dual-algebra/package.json b/packages/dual-algebra/package.json
index 4a8e2edca7..8a009c3137 100644
--- a/packages/dual-algebra/package.json
+++ b/packages/dual-algebra/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dual-algebra",
- "version": "0.1.4",
+ "version": "0.1.5",
"description": "Multivariate dual number algebra, automatic differentiation",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,17 +39,17 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4"
+ "@thi.ng/api": "^6.13.5"
},
"files": [
"*.js",
diff --git a/packages/dynvar/CHANGELOG.md b/packages/dynvar/CHANGELOG.md
index f0984ddf75..8c4daa5259 100644
--- a/packages/dynvar/CHANGELOG.md
+++ b/packages/dynvar/CHANGELOG.md
@@ -3,63 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.1.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/dynvar@0.1.26...@thi.ng/dynvar@0.1.27) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/dynvar
-
-
-
-
-
-## [0.1.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/dynvar@0.1.25...@thi.ng/dynvar@0.1.26) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/dynvar
-
-
-
-
-
-## [0.1.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/dynvar@0.1.24...@thi.ng/dynvar@0.1.25) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/dynvar
-
-
-
-
-
-## [0.1.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/dynvar@0.1.23...@thi.ng/dynvar@0.1.24) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/dynvar
-
-
-
-
-
-## [0.1.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/dynvar@0.1.22...@thi.ng/dynvar@0.1.23) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/dynvar
-
-
-
-
-
-## [0.1.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/dynvar@0.1.21...@thi.ng/dynvar@0.1.22) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/dynvar
-
-
-
-
-
-## [0.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/dynvar@0.1.20...@thi.ng/dynvar@0.1.21) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/dynvar
-
-
-
-
-
-## [0.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/dynvar@0.1.19...@thi.ng/dynvar@0.1.20) (2020-08-16)
+## [0.1.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/dynvar@0.1.27...@thi.ng/dynvar@0.1.28) (2020-12-22)
**Note:** Version bump only for package @thi.ng/dynvar
diff --git a/packages/dynvar/package.json b/packages/dynvar/package.json
index 92427b18a8..8bf7704e7e 100644
--- a/packages/dynvar/package.json
+++ b/packages/dynvar/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/dynvar",
- "version": "0.1.27",
+ "version": "0.1.28",
"description": "Dynamically scoped variable bindings",
"module": "./index.js",
"main": "./lib/index.js",
@@ -31,7 +31,7 @@
"build:check": "tsc --isolatedModules --noEmit",
"test": "mocha test",
"cover": "nyc mocha test && nyc report --reporter=lcov",
- "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib api decorators mixins",
+ "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib",
"doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
"doc": "node_modules/.bin/typedoc --mode modules --out doc --theme ../../tools/doc/typedoc-theme src",
"doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
@@ -39,17 +39,17 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4"
+ "@thi.ng/api": "^6.13.5"
},
"files": [
"*.js",
diff --git a/packages/ecs/CHANGELOG.md b/packages/ecs/CHANGELOG.md
index 3f8e928a12..0dbe9141d9 100644
--- a/packages/ecs/CHANGELOG.md
+++ b/packages/ecs/CHANGELOG.md
@@ -3,23 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.4.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/ecs@0.4.2...@thi.ng/ecs@0.4.3) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/ecs
-
-
-
-
-
-## [0.4.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/ecs@0.4.1...@thi.ng/ecs@0.4.2) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/ecs
-
-
-
-
-
-## [0.4.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/ecs@0.4.0...@thi.ng/ecs@0.4.1) (2020-11-24)
+## [0.4.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/ecs@0.4.3...@thi.ng/ecs@0.4.4) (2020-12-22)
**Note:** Version bump only for package @thi.ng/ecs
@@ -38,46 +22,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.3.34](https://github.com/thi-ng/umbrella/compare/@thi.ng/ecs@0.3.33...@thi.ng/ecs@0.3.34) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/ecs
-
-
-
-
-
-## [0.3.33](https://github.com/thi-ng/umbrella/compare/@thi.ng/ecs@0.3.32...@thi.ng/ecs@0.3.33) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/ecs
-
-
-
-
-
-## [0.3.32](https://github.com/thi-ng/umbrella/compare/@thi.ng/ecs@0.3.31...@thi.ng/ecs@0.3.32) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/ecs
-
-
-
-
-
-## [0.3.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/ecs@0.3.30...@thi.ng/ecs@0.3.31) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/ecs
-
-
-
-
-
-## [0.3.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/ecs@0.3.29...@thi.ng/ecs@0.3.30) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/ecs
-
-
-
-
-
# [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/ecs@0.2.0...@thi.ng/ecs@0.3.0) (2020-01-24)
### Bug Fixes
diff --git a/packages/ecs/package.json b/packages/ecs/package.json
index 01874f15d4..3d50b46a1d 100644
--- a/packages/ecs/package.json
+++ b/packages/ecs/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/ecs",
- "version": "0.4.3",
+ "version": "0.4.4",
"description": "Entity Component System based around typed arrays & sparse sets",
"module": "./index.js",
"main": "./lib/index.js",
@@ -31,7 +31,7 @@
"build:check": "tsc --isolatedModules --noEmit",
"test": "mocha test",
"cover": "nyc mocha test && nyc report --reporter=lcov",
- "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib",
+ "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib caches components groups",
"doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
"doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
"doc": "node_modules/.bin/typedoc --mode modules --out doc --theme ../../tools/doc/typedoc-theme src",
@@ -39,25 +39,25 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@thi.ng/equiv": "^1.0.33",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@thi.ng/equiv": "^1.0.34",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/associative": "^5.0.11",
- "@thi.ng/binary": "^2.0.19",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/dcons": "^2.3.3",
- "@thi.ng/idgen": "^0.2.27",
- "@thi.ng/malloc": "^4.2.3",
- "@thi.ng/transducers": "^7.5.2",
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/associative": "^5.0.12",
+ "@thi.ng/binary": "^2.0.20",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/dcons": "^2.3.4",
+ "@thi.ng/idgen": "^0.2.28",
+ "@thi.ng/malloc": "^4.2.4",
+ "@thi.ng/transducers": "^7.5.3",
"tslib": "2.0.1"
},
"files": [
@@ -65,7 +65,7 @@
"*.d.ts",
"lib",
"caches",
- "component",
+ "components",
"groups"
],
"keywords": [
diff --git a/packages/egf/CHANGELOG.md b/packages/egf/CHANGELOG.md
index 5f50c11930..568f4fbdbd 100644
--- a/packages/egf/CHANGELOG.md
+++ b/packages/egf/CHANGELOG.md
@@ -3,31 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.3.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/egf@0.3.3...@thi.ng/egf@0.3.4) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/egf
-
-
-
-
-
-## [0.3.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/egf@0.3.2...@thi.ng/egf@0.3.3) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/egf
-
-
-
-
-
-## [0.3.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/egf@0.3.1...@thi.ng/egf@0.3.2) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/egf
-
-
-
-
-
-## [0.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/egf@0.3.0...@thi.ng/egf@0.3.1) (2020-10-19)
+## [0.3.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/egf@0.3.4...@thi.ng/egf@0.3.5) (2020-12-22)
**Note:** Version bump only for package @thi.ng/egf
diff --git a/packages/egf/package.json b/packages/egf/package.json
index c681dd829d..0fb144fdc9 100644
--- a/packages/egf/package.json
+++ b/packages/egf/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/egf",
- "version": "0.3.4",
+ "version": "0.3.5",
"description": "Extensible Graph Format",
"module": "./index.js",
"main": "./lib/index.js",
@@ -34,25 +34,25 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@thi.ng/equiv": "^1.0.33",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@thi.ng/equiv": "^1.0.34",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/associative": "^5.0.11",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/dot": "^1.2.21",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/prefixes": "^0.1.8",
- "@thi.ng/strings": "^1.11.2",
- "@thi.ng/transducers-binary": "^0.5.33"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/associative": "^5.0.12",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/dot": "^1.2.22",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/prefixes": "^0.1.9",
+ "@thi.ng/strings": "^1.11.3",
+ "@thi.ng/transducers-binary": "^0.6.0"
},
"files": [
"*.js",
diff --git a/packages/equiv/CHANGELOG.md b/packages/equiv/CHANGELOG.md
index a7af4aa4cf..6256771ff7 100644
--- a/packages/equiv/CHANGELOG.md
+++ b/packages/equiv/CHANGELOG.md
@@ -3,47 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.0.33](https://github.com/thi-ng/umbrella/compare/@thi.ng/equiv@1.0.32...@thi.ng/equiv@1.0.33) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/equiv
-
-
-
-
-
-## [1.0.32](https://github.com/thi-ng/umbrella/compare/@thi.ng/equiv@1.0.31...@thi.ng/equiv@1.0.32) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/equiv
-
-
-
-
-
-## [1.0.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/equiv@1.0.30...@thi.ng/equiv@1.0.31) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/equiv
-
-
-
-
-
-## [1.0.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/equiv@1.0.29...@thi.ng/equiv@1.0.30) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/equiv
-
-
-
-
-
-## [1.0.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/equiv@1.0.28...@thi.ng/equiv@1.0.29) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/equiv
-
-
-
-
-
-## [1.0.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/equiv@1.0.27...@thi.ng/equiv@1.0.28) (2020-08-16)
+## [1.0.34](https://github.com/thi-ng/umbrella/compare/@thi.ng/equiv@1.0.33...@thi.ng/equiv@1.0.34) (2020-12-22)
**Note:** Version bump only for package @thi.ng/equiv
diff --git a/packages/equiv/package.json b/packages/equiv/package.json
index 7b91950317..8eaae3f033 100644
--- a/packages/equiv/package.json
+++ b/packages/equiv/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/equiv",
- "version": "1.0.33",
+ "version": "1.0.34",
"description": "Extensible deep value equivalence checking for any data types",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,15 +39,15 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"benchmark": "^2.1.4",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"files": [
"*.js",
diff --git a/packages/errors/CHANGELOG.md b/packages/errors/CHANGELOG.md
index 6754ef9424..0c59db14c8 100644
--- a/packages/errors/CHANGELOG.md
+++ b/packages/errors/CHANGELOG.md
@@ -3,55 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.2.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/errors@1.2.23...@thi.ng/errors@1.2.24) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/errors
-
-
-
-
-
-## [1.2.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/errors@1.2.22...@thi.ng/errors@1.2.23) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/errors
-
-
-
-
-
-## [1.2.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/errors@1.2.21...@thi.ng/errors@1.2.22) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/errors
-
-
-
-
-
-## [1.2.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/errors@1.2.20...@thi.ng/errors@1.2.21) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/errors
-
-
-
-
-
-## [1.2.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/errors@1.2.19...@thi.ng/errors@1.2.20) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/errors
-
-
-
-
-
-## [1.2.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/errors@1.2.18...@thi.ng/errors@1.2.19) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/errors
-
-
-
-
-
-## [1.2.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/errors@1.2.17...@thi.ng/errors@1.2.18) (2020-08-16)
+## [1.2.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/errors@1.2.24...@thi.ng/errors@1.2.25) (2020-12-22)
**Note:** Version bump only for package @thi.ng/errors
diff --git a/packages/errors/package.json b/packages/errors/package.json
index 5fe606a236..7e28d154ce 100644
--- a/packages/errors/package.json
+++ b/packages/errors/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/errors",
- "version": "1.2.24",
+ "version": "1.2.25",
"description": "Custom error types and error factory functions",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,14 +39,14 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"files": [
"*.js",
diff --git a/packages/fsm/CHANGELOG.md b/packages/fsm/CHANGELOG.md
index c6a4954bf3..9740d59a6e 100644
--- a/packages/fsm/CHANGELOG.md
+++ b/packages/fsm/CHANGELOG.md
@@ -3,71 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [2.4.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.4.28...@thi.ng/fsm@2.4.29) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/fsm
-
-
-
-
-
-## [2.4.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.4.27...@thi.ng/fsm@2.4.28) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/fsm
-
-
-
-
-
-## [2.4.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.4.26...@thi.ng/fsm@2.4.27) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/fsm
-
-
-
-
-
-## [2.4.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.4.25...@thi.ng/fsm@2.4.26) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/fsm
-
-
-
-
-
-## [2.4.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.4.24...@thi.ng/fsm@2.4.25) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/fsm
-
-
-
-
-
-## [2.4.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.4.23...@thi.ng/fsm@2.4.24) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/fsm
-
-
-
-
-
-## [2.4.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.4.22...@thi.ng/fsm@2.4.23) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/fsm
-
-
-
-
-
-## [2.4.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.4.21...@thi.ng/fsm@2.4.22) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/fsm
-
-
-
-
-
-## [2.4.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.4.20...@thi.ng/fsm@2.4.21) (2020-08-16)
+## [2.4.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@2.4.29...@thi.ng/fsm@2.4.30) (2020-12-22)
**Note:** Version bump only for package @thi.ng/fsm
diff --git a/packages/fsm/package.json b/packages/fsm/package.json
index 1b3a223443..49fa3ec98c 100644
--- a/packages/fsm/package.json
+++ b/packages/fsm/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/fsm",
- "version": "2.4.29",
+ "version": "2.4.30",
"description": "Composable primitives for building declarative, transducer based Finite-State Machines & matchers for arbitrary data streams",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,22 +39,22 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/arrays": "^0.8.4",
- "@thi.ng/equiv": "^1.0.33",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/strings": "^1.11.2",
- "@thi.ng/transducers": "^7.5.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/arrays": "^0.8.5",
+ "@thi.ng/equiv": "^1.0.34",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/strings": "^1.11.3",
+ "@thi.ng/transducers": "^7.5.3"
},
"files": [
"*.js",
diff --git a/packages/fuzzy-viz/CHANGELOG.md b/packages/fuzzy-viz/CHANGELOG.md
new file mode 100644
index 0000000000..ed8d761581
--- /dev/null
+++ b/packages/fuzzy-viz/CHANGELOG.md
@@ -0,0 +1,18 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+# 0.1.0 (2020-12-22)
+
+
+### Bug Fixes
+
+* **fuzzy-viz:** update imports ([22f37a5](https://github.com/thi-ng/umbrella/commit/22f37a526acd6911720100e77ad41029d8799004))
+
+
+### Features
+
+* **fuzzy-viz:** add/update instrumentStrategy() & co ([131d137](https://github.com/thi-ng/umbrella/commit/131d13776735e3dd222090a6b514bfbe4878d9f2))
+* **fuzzy-viz:** add/update viz options, fix zero marker ([bee9cd0](https://github.com/thi-ng/umbrella/commit/bee9cd08b32ce43cc6661146dd87f35db9516559))
+* **fuzzy-viz:** import as new pkg ([8b23934](https://github.com/thi-ng/umbrella/commit/8b239347894bf8c7192890151868ecdb1ac3bf2b))
diff --git a/packages/fuzzy-viz/LICENSE b/packages/fuzzy-viz/LICENSE
new file mode 100644
index 0000000000..8dada3edaf
--- /dev/null
+++ b/packages/fuzzy-viz/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/packages/fuzzy-viz/README.md b/packages/fuzzy-viz/README.md
new file mode 100644
index 0000000000..a0c621cc03
--- /dev/null
+++ b/packages/fuzzy-viz/README.md
@@ -0,0 +1,158 @@
+
+
+# ![fuzzy-viz](https://media.thi.ng/umbrella/banners/thing-fuzzy-viz.svg?1ebd05a8)
+
+[![npm version](https://img.shields.io/npm/v/@thi.ng/fuzzy-viz.svg)](https://www.npmjs.com/package/@thi.ng/fuzzy-viz)
+![npm downloads](https://img.shields.io/npm/dm/@thi.ng/fuzzy-viz.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
+
+This project is part of the
+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
+
+- [About](#about)
+ - [Status](#status)
+- [Installation](#installation)
+- [Dependencies](#dependencies)
+- [API](#api)
+ - [Linguistic variable visualization](#linguistic-variable-visualization)
+ - [Instrument a DefuzzStrategy](#instrument-a-defuzzstrategy)
+- [Authors](#authors)
+- [License](#license)
+
+## About
+
+Visualization, instrumentation & introspection utils for [@thi.ng/fuzzy](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy).
+
+### Status
+
+**ALPHA** - bleeding edge / work-in-progress
+
+[Search or submit any issues for this package](https://github.com/thi-ng/umbrella/issues?q=%5Bfuzzy-viz%5D+in%3Atitle)
+
+## Installation
+
+```bash
+yarn add @thi.ng/fuzzy-viz
+```
+
+```html
+// ES module
+
+
+// UMD
+
+```
+
+Package sizes (gzipped, pre-treeshake): ESM: 1.04 KB / CJS: 1.12 KB / UMD: 1.23 KB
+
+## Dependencies
+
+- [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api)
+- [@thi.ng/fuzzy](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy)
+- [@thi.ng/hiccup](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup)
+- [@thi.ng/hiccup-svg](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup-svg)
+- [@thi.ng/math](https://github.com/thi-ng/umbrella/tree/develop/packages/math)
+- [@thi.ng/strings](https://github.com/thi-ng/umbrella/tree/develop/packages/strings)
+- [@thi.ng/text-canvas](https://github.com/thi-ng/umbrella/tree/develop/packages/text-canvas)
+
+## API
+
+[Generated API docs](https://docs.thi.ng/umbrella/fuzzy-viz/)
+
+### Linguistic variable visualization
+
+Generate an SVG visualization of all fuzzy sets defined in a [linguistic
+variable](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy#linguistic-variables):
+
+![fuzzy set visualization of the example l-var](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/fuzzy/temperature-lvar-2.svg)
+
+```ts
+import { varToSvg } from "@thi.ng/fuzzy-viz";
+
+// temperature sets (in celsius)
+const temp = variable(
+ [-20, 40],
+ {
+ freezing: invSigmoid(0, 2),
+ cold: trapezoid(-1, 2, 16, 20),
+ warm: trapezoid(15, 20, 30, 34),
+ hot: sigmoid(32, 2)
+ }
+);
+
+// generate & write SVG file
+writeFileSync("temperature.svg", varToSvg(temp, { samples: 200 }));
+```
+
+See
+[`VizualizeVarOpts`](https://github.com/thi-ng/umbrella/blob/develop/packages/fuzzy-viz/src/api.ts)
+for further options to configure the visualization.
+
+### Instrument a DefuzzStrategy
+
+`instrumentStrategy()` is an higher order function. It takes an existing
+`DefuzzStrategy` and an instrumentation function. Returns new `DefuzzStrategy`
+which first executes original `strategy`, then calls `instrument` with the same
+args AND the computed result obtained from `strategy`. Returns result of
+original `strategy`.
+
+The instrumentation function is intended to perform side effects (e.g. debug
+outputs) and/or produce secondary results (e.g. visualizations). The latter can
+be obtained through the `IDeref` mechanism implemented by the returned function.
+Since `defuzz()` might call the strategy multiple times (i.e. if there are
+multiple output vars used), `.deref()` will always return an array of secondary
+results.
+
+**Note:** The secondary results from the instrumentation function will persist &
+accumulate. If re-using the instrumented strategy for multiple `defuzz()`
+invocations, it's highly recommended to clear any previous results using
+`.clear()`.
+
+```ts
+const strategy = instrumentStrategy(
+ cogStrategy({ samples: 1000 }),
+ fuzzySetToAscii({ width: 40, height: 8 })
+);
+
+// apply strategy as normal (well, usually done via defuzz())
+strategy(gaussian(5, 2), [0, 10]);
+// 4.995
+
+strategy.deref().forEach((viz) => console.log(viz));
+// .................▄▆█|█▆▄.................
+// ...............▅████|████▅...............
+// .............▄██████|██████▄.............
+// ...........▂▇███████|███████▇▂...........
+// ..........▅█████████|█████████▅..........
+// .......▁▅███████████|███████████▅▁.......
+// .....▃▆█████████████|█████████████▆▃.....
+// ▃▄▅▇████████████████|████████████████▇▅▄▃
+// ^ 5.00
+
+// cleanup (optional)
+strategy.clear();
+```
+
+Using `fuzzySetToHiccup()`/`fuzzySetToSvg()` visualizations like below can be
+created following the same pattern as above:
+
+![fuzzySetToSvg() visualization example](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/fuzzy/strategy-viz.svg)
+
+## Authors
+
+Karsten Schmidt
+
+If this project contributes to an academic publication, please cite it as:
+
+```bibtex
+@misc{thing-fuzzy-viz,
+ title = "@thi.ng/fuzzy-viz",
+ author = "Karsten Schmidt",
+ note = "https://thi.ng/fuzzy-viz",
+ year = 2020
+}
+```
+
+## License
+
+© 2020 Karsten Schmidt // Apache Software License 2.0
diff --git a/packages/fuzzy-viz/api-extractor.json b/packages/fuzzy-viz/api-extractor.json
new file mode 100644
index 0000000000..94972e6bed
--- /dev/null
+++ b/packages/fuzzy-viz/api-extractor.json
@@ -0,0 +1,3 @@
+{
+ "extends": "../../api-extractor.json"
+}
diff --git a/packages/fuzzy-viz/package.json b/packages/fuzzy-viz/package.json
new file mode 100644
index 0000000000..6a17a5d86a
--- /dev/null
+++ b/packages/fuzzy-viz/package.json
@@ -0,0 +1,87 @@
+{
+ "name": "@thi.ng/fuzzy-viz",
+ "version": "0.1.0",
+ "description": "Visualization, instrumentation & introspection utils for @thi.ng/fuzzy",
+ "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/fuzzy-viz#readme",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/postspectacular"
+ },
+ {
+ "type": "patreon",
+ "url": "https://patreon.com/thing_umbrella"
+ }
+ ],
+ "author": "Karsten Schmidt ",
+ "license": "Apache-2.0",
+ "scripts": {
+ "build": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module",
+ "build:release": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module all",
+ "build:es6": "tsc --declaration",
+ "build:test": "rimraf build && tsc -p test/tsconfig.json",
+ "build:check": "tsc --isolatedModules --noEmit",
+ "test": "mocha test",
+ "cover": "nyc mocha test && nyc report --reporter=lcov",
+ "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib",
+ "doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
+ "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
+ "doc": "node_modules/.bin/typedoc --mode modules --out doc --theme ../../tools/doc/typedoc-theme src",
+ "pub": "yarn build:release && yarn publish --access public"
+ },
+ "devDependencies": {
+ "@istanbuljs/nyc-config-typescript": "^1.0.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
+ "mocha": "^8.2.1",
+ "nyc": "^15.1.0",
+ "ts-node": "^9.1.1",
+ "typedoc": "^0.19.2",
+ "typescript": "^4.1.3"
+ },
+ "dependencies": {
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/fuzzy": "^0.1.0",
+ "@thi.ng/hiccup": "^3.6.5",
+ "@thi.ng/hiccup-svg": "^3.6.6",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/strings": "^1.11.3",
+ "@thi.ng/text-canvas": "^0.2.36"
+ },
+ "files": [
+ "*.js",
+ "*.d.ts",
+ "lib"
+ ],
+ "keywords": [
+ "area plot",
+ "ascii",
+ "debug",
+ "fuzzy",
+ "hiccup",
+ "inspect",
+ "instrumentation",
+ "logic",
+ "svg",
+ "typescript",
+ "visualization"
+ ],
+ "publishConfig": {
+ "access": "public"
+ },
+ "sideEffects": false,
+ "thi.ng": {
+ "parent": "@thi.ng/fuzzy",
+ "status": "alpha",
+ "year": 2020
+ }
+}
diff --git a/packages/fuzzy-viz/src/api.ts b/packages/fuzzy-viz/src/api.ts
new file mode 100644
index 0000000000..400b71da5b
--- /dev/null
+++ b/packages/fuzzy-viz/src/api.ts
@@ -0,0 +1,62 @@
+import type { Fn, Fn3 } from "@thi.ng/api";
+import type { FuzzyFn, LVarDomain } from "@thi.ng/fuzzy";
+
+export type InstrumentFn = Fn3;
+
+export interface AsciiVizOpts {
+ /**
+ * Width in characters
+ *
+ * @defaultValue 100
+ */
+ width: number;
+ /**
+ * Height in characters
+ *
+ * @defaultValue 16
+ */
+ height: number;
+ /**
+ * Char to use for empty space
+ *
+ * @defaultValue "."
+ */
+ empty: string;
+}
+
+export interface VizualizeVarOpts {
+ /**
+ * Number of samples to evaluate for each fuzzy set.
+ *
+ * @defaultValue 200
+ */
+ samples: number;
+ /**
+ * Visualization width
+ *
+ * @defaultValue 600
+ */
+ width: number;
+ /**
+ * Visualization height
+ *
+ * @defaultValue 100
+ */
+ height: number;
+ /**
+ * If true, includes a legend of color coded labels of the fuzzy sets.
+ *
+ * @defaultValue true
+ */
+ labels: boolean;
+ /**
+ * Color factory function. Converts number in [0..1) interval into an CSS
+ * color string.
+ */
+ stroke: Fn;
+ /**
+ * Color factory function. Converts number in [0..1) interval into an CSS
+ * color string.
+ */
+ fill: Fn;
+}
diff --git a/packages/fuzzy-viz/src/index.ts b/packages/fuzzy-viz/src/index.ts
new file mode 100644
index 0000000000..b3ec9b1356
--- /dev/null
+++ b/packages/fuzzy-viz/src/index.ts
@@ -0,0 +1,2 @@
+export * from "./strategy";
+export * from "./var";
diff --git a/packages/fuzzy-viz/src/strategy.ts b/packages/fuzzy-viz/src/strategy.ts
new file mode 100644
index 0000000000..1eb68b4cfb
--- /dev/null
+++ b/packages/fuzzy-viz/src/strategy.ts
@@ -0,0 +1,127 @@
+import type { Fn3, IClear, IDeref } from "@thi.ng/api";
+import { DefuzzStrategy, FuzzyFn, LVarDomain, variable } from "@thi.ng/fuzzy";
+import { serialize } from "@thi.ng/hiccup";
+import { convertTree } from "@thi.ng/hiccup-svg";
+import { fit } from "@thi.ng/math";
+import { repeat } from "@thi.ng/strings";
+import { barChartHStr } from "@thi.ng/text-canvas";
+import type { AsciiVizOpts, InstrumentFn, VizualizeVarOpts } from "./api";
+import { varToHiccup } from "./var";
+
+/**
+ * Higher order function. Takes an existing {@link @thi.ng/fuzzy#DefuzzStrategy}
+ * and an instrumentation function. Returns new `DefuzzStrategy` which first
+ * executes original `strategy`, then calls `instrument` with the same args AND
+ * the computed result obtained from `strategy`. Returns result of original
+ * `strategy`.
+ *
+ * @remarks
+ * The instrumentation function is intended to perform side effects (e.g. debug
+ * outputs) and/or produce secondary results (e.g. visualizations). The latter
+ * can be obtained through the {@link @thi.ng/api#IDeref} mechanism implemented
+ * by the returned function. Since {@link defuzz} might call the strategy
+ * multiple times (i.e. if there are multiple output vars used), `.deref()` will
+ * always return an array of secondary results.
+ *
+ * Note: The secondary results from the instrumentation function will persist &
+ * accumulate. If re-using the instrumented strategy for multiple `defuzz()`
+ * invocations, it's highly recommended to clear any previous results using
+ * `.clear()`.
+ *
+ * @example
+ * ```ts
+ * const strategy = instrumentStrategy(
+ * cogStrategy({ samples: 1000 }),
+ * fuzzySetToAscii({ width: 40, height: 8 })
+ * );
+ *
+ * strategy(gaussian(5, 2), [0, 10]);
+ * // 4.995
+ *
+ * console.log(strategy.deref()[0])
+ * // .................▄▆█|█▆▄.................
+ * // ...............▅████|████▅...............
+ * // .............▄██████|██████▄.............
+ * // ...........▂▇███████|███████▇▂...........
+ * // ..........▅█████████|█████████▅..........
+ * // .......▁▅███████████|███████████▅▁.......
+ * // .....▃▆█████████████|█████████████▆▃.....
+ * // ▃▄▅▇████████████████|████████████████▇▅▄▃
+ * // ^ 5.00
+ *
+ * // cleanup (optional)
+ * strategy.clear();
+ * ```
+ *
+ * @param strategy
+ * @param instrument
+ */
+export const instrumentStrategy = (
+ strategy: DefuzzStrategy,
+ instrument: Fn3
+) => {
+ const acc: T[] = [];
+ const impl: DefuzzStrategy & IClear & IDeref = (fn, domain) => {
+ const res = strategy(fn, domain);
+ acc.push(instrument(fn, domain, res));
+ return res;
+ };
+ impl.clear = () => (acc.length = 0);
+ impl.deref = () => acc;
+ return impl;
+};
+
+export const fuzzySetToHiccup = (
+ opts?: Partial
+): InstrumentFn => (fn, domain, res) => {
+ const tree = varToHiccup(variable(domain, { main: fn }), {
+ labels: false,
+ stroke: () => "#333",
+ fill: () => "#999",
+ ...opts,
+ });
+ const { width, height } = tree[1];
+ const x = fit(res, domain[0], domain[1], 0, width);
+ tree.push([
+ "g",
+ { translate: [x, 0] },
+ ["line", { stroke: "red" }, [0, 0], [0, height - 12]],
+ [
+ "text",
+ { align: "center", fill: "red" },
+ [0, height - 2],
+ res.toFixed(2),
+ ],
+ ]);
+ return tree;
+};
+
+export const fuzzySetToSvg = (
+ opts?: Partial
+): InstrumentFn => (fn, domain, res) =>
+ serialize(convertTree(fuzzySetToHiccup(opts)(fn, domain, res)));
+
+export const fuzzySetToAscii = (
+ opts?: Partial
+): InstrumentFn => (fn, domain, res) => {
+ const { width, height, empty } = {
+ width: 100,
+ height: 16,
+ empty: ".",
+ ...opts,
+ };
+ const [min, max] = domain;
+ const delta = (max - min) / width;
+ const vals: number[] = [];
+ for (let i = min; i <= max; i += delta) {
+ vals.push(fn(i));
+ }
+ const index = Math.round(fit(res, min, max, 0, vals.length));
+ let chart = barChartHStr(height, vals, 0, 1)
+ .split("\n")
+ .map((line) => line.substr(0, index) + "|" + line.substr(index + 1))
+ .join("\n")
+ .replace(/ /g, empty);
+ const legend = repeat(" ", index) + "^ " + res.toFixed(2);
+ return chart + "\n" + legend;
+};
diff --git a/packages/fuzzy-viz/src/var.ts b/packages/fuzzy-viz/src/var.ts
new file mode 100644
index 0000000000..2eb977189f
--- /dev/null
+++ b/packages/fuzzy-viz/src/var.ts
@@ -0,0 +1,117 @@
+import type { LVar } from "@thi.ng/fuzzy";
+import { serialize } from "@thi.ng/hiccup";
+import { convertTree, svg } from "@thi.ng/hiccup-svg";
+import { fit, inRange } from "@thi.ng/math";
+import type { VizualizeVarOpts } from "./api";
+
+/**
+ * Takes an {@link @thi.ng/fuzzy#LVar} and visualization options. Evaluates all
+ * of the var's fuzzy sets in the var's value domain and visualizes them as
+ * polygons. Returns a {@link @thi.ng/hiccup-canvas#} compatible shape component
+ * tree.
+ *
+ * @param var
+ * @param opts
+ */
+export const varToHiccup = (
+ { domain: [min, max], terms }: LVar,
+ opts: Partial = {}
+) => {
+ const { samples, width, height, labels, stroke: strokeFn, fill: fillFn } = {
+ samples: 200,
+ width: 600,
+ height: 100,
+ labels: true,
+ stroke: (x: number) => `hsl(${(x * 360) | 0},100%,40%)`,
+ fill: (x: number) => `hsla(${(x * 360) | 0},100%,50%,20%)`,
+ ...opts,
+ };
+ const keys = Object.keys(terms);
+ const dt = (max - min) / samples;
+ const ds = width / samples;
+ const dn = 1 / keys.length;
+ const curves: any[] = [];
+ const legend: any[] = [];
+ for (let i = 0; i < keys.length; i++) {
+ const id = keys[i];
+ const f = terms[id];
+ const y = (i + 1) * 12;
+ const stroke = strokeFn(i * dn);
+ const curr: number[][] = [];
+ for (let i = 0; i <= samples; i++) {
+ curr.push([i * ds, (1 - f(min + i * dt)) * height]);
+ }
+ curr.push([width, height], [0, height]);
+ curves.push([
+ "polygon",
+ {
+ stroke,
+ fill: fillFn(i * dn),
+ },
+ curr,
+ ]);
+ if (labels) {
+ legend.push(
+ ["line", { stroke }, [0, y], [20, y]],
+ [
+ "text",
+ {
+ baseline: "middle",
+ fill: "black",
+ },
+ [30, y],
+ id,
+ ]
+ );
+ }
+ }
+ const zero = fit(0, min, max, 0, width);
+ return svg(
+ {
+ width,
+ height: height + 12,
+ fill: "none",
+ "font-family": "sans-serif",
+ "font-size": 10,
+ },
+ ...curves,
+ ...legend,
+ inRange(zero, width * 0.05, width * 0.95)
+ ? [
+ "g",
+ {},
+ [
+ "line",
+ {
+ stroke: "black",
+ dash: [1, 1],
+ },
+ [zero, 0],
+ [zero, height],
+ ],
+ [
+ "text",
+ { align: "center", fill: "black" },
+ [zero, height + 10],
+ "0.00",
+ ],
+ ]
+ : null,
+ [
+ "g",
+ { fill: "black" },
+ ["text", {}, [0, height + 10], min.toFixed(2)],
+ ["text", { align: "end" }, [width, height + 10], max.toFixed(2)],
+ ]
+ );
+};
+
+/**
+ * Similar to {@link varToHiccup}, but then also serializes the result to an
+ * actual SVG string.
+ *
+ * @param $var
+ * @param opts
+ */
+export const varToSvg = ($var: LVar, opts: Partial) =>
+ serialize(convertTree(varToHiccup($var, opts)));
diff --git a/packages/fuzzy-viz/test/index.ts b/packages/fuzzy-viz/test/index.ts
new file mode 100644
index 0000000000..63f5aac0be
--- /dev/null
+++ b/packages/fuzzy-viz/test/index.ts
@@ -0,0 +1,25 @@
+import { centroidStrategy, gaussian } from "@thi.ng/fuzzy";
+import { eqDelta } from "@thi.ng/math";
+import * as assert from "assert";
+import { fuzzySetToAscii, instrumentStrategy } from "../src";
+
+describe("fuzzy-viz", () => {
+ it("strategy (ascii)", () => {
+ const strategy = instrumentStrategy(
+ centroidStrategy({ samples: 1000 }),
+ fuzzySetToAscii({ width: 40, height: 8 })
+ );
+ assert(eqDelta(strategy(gaussian(5, 2), [0, 10]), 5));
+ assert.deepStrictEqual(strategy.deref(), [
+ `.................▄▆█|█▆▄.................
+...............▅████|████▅...............
+.............▄██████|██████▄.............
+...........▂▇███████|███████▇▂...........
+..........▅█████████|█████████▅..........
+.......▁▅███████████|███████████▅▁.......
+.....▃▆█████████████|█████████████▆▃.....
+▃▄▅▇████████████████|████████████████▇▅▄▃
+ ^ 5.00`,
+ ]);
+ });
+});
diff --git a/packages/fuzzy-viz/test/tsconfig.json b/packages/fuzzy-viz/test/tsconfig.json
new file mode 100644
index 0000000000..f6e63560dd
--- /dev/null
+++ b/packages/fuzzy-viz/test/tsconfig.json
@@ -0,0 +1,11 @@
+{
+ "extends": "../../../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "../build",
+ "module": "commonjs"
+ },
+ "include": [
+ "./**/*.ts",
+ "../src/**/*.ts"
+ ]
+}
diff --git a/packages/fuzzy-viz/tpl.readme.md b/packages/fuzzy-viz/tpl.readme.md
new file mode 100644
index 0000000000..157b3807fa
--- /dev/null
+++ b/packages/fuzzy-viz/tpl.readme.md
@@ -0,0 +1,127 @@
+# ${pkg.banner}
+
+[![npm version](https://img.shields.io/npm/v/${pkg.name}.svg)](https://www.npmjs.com/package/${pkg.name})
+![npm downloads](https://img.shields.io/npm/dm/${pkg.name}.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
+
+This project is part of the
+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
+
+
+
+## About
+
+${pkg.description}
+
+${status}
+
+${supportPackages}
+
+${relatedPackages}
+
+${blogPosts}
+
+## Installation
+
+${pkg.install}
+
+${pkg.size}
+
+## Dependencies
+
+${pkg.deps}
+
+${examples}
+
+## API
+
+${docLink}
+
+### Linguistic variable visualization
+
+Generate an SVG visualization of all fuzzy sets defined in a [linguistic
+variable](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy#linguistic-variables):
+
+![fuzzy set visualization of the example l-var](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/fuzzy/temperature-lvar-2.svg)
+
+```ts
+import { varToSvg } from "@thi.ng/fuzzy-viz";
+
+// temperature sets (in celsius)
+const temp = variable(
+ [-20, 40],
+ {
+ freezing: invSigmoid(0, 2),
+ cold: trapezoid(-1, 2, 16, 20),
+ warm: trapezoid(15, 20, 30, 34),
+ hot: sigmoid(32, 2)
+ }
+);
+
+// generate & write SVG file
+writeFileSync("temperature.svg", varToSvg(temp, { samples: 200 }));
+```
+
+See
+[`VizualizeVarOpts`](https://github.com/thi-ng/umbrella/blob/develop/packages/fuzzy-viz/src/api.ts)
+for further options to configure the visualization.
+
+### Instrument a DefuzzStrategy
+
+`instrumentStrategy()` is an higher order function. It takes an existing
+`DefuzzStrategy` and an instrumentation function. Returns new `DefuzzStrategy`
+which first executes original `strategy`, then calls `instrument` with the same
+args AND the computed result obtained from `strategy`. Returns result of
+original `strategy`.
+
+The instrumentation function is intended to perform side effects (e.g. debug
+outputs) and/or produce secondary results (e.g. visualizations). The latter can
+be obtained through the `IDeref` mechanism implemented by the returned function.
+Since `defuzz()` might call the strategy multiple times (i.e. if there are
+multiple output vars used), `.deref()` will always return an array of secondary
+results.
+
+**Note:** The secondary results from the instrumentation function will persist &
+accumulate. If re-using the instrumented strategy for multiple `defuzz()`
+invocations, it's highly recommended to clear any previous results using
+`.clear()`.
+
+```ts
+const strategy = instrumentStrategy(
+ cogStrategy({ samples: 1000 }),
+ fuzzySetToAscii({ width: 40, height: 8 })
+);
+
+// apply strategy as normal (well, usually done via defuzz())
+strategy(gaussian(5, 2), [0, 10]);
+// 4.995
+
+strategy.deref().forEach((viz) => console.log(viz));
+// .................▄▆█|█▆▄.................
+// ...............▅████|████▅...............
+// .............▄██████|██████▄.............
+// ...........▂▇███████|███████▇▂...........
+// ..........▅█████████|█████████▅..........
+// .......▁▅███████████|███████████▅▁.......
+// .....▃▆█████████████|█████████████▆▃.....
+// ▃▄▅▇████████████████|████████████████▇▅▄▃
+// ^ 5.00
+
+// cleanup (optional)
+strategy.clear();
+```
+
+Using `fuzzySetToHiccup()`/`fuzzySetToSvg()` visualizations like below can be
+created following the same pattern as above:
+
+![fuzzySetToSvg() visualization example](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/fuzzy/strategy-viz.svg)
+
+## Authors
+
+${authors}
+
+${pkg.cite}
+
+## License
+
+© ${copyright} // ${license}
diff --git a/packages/fuzzy-viz/tsconfig.json b/packages/fuzzy-viz/tsconfig.json
new file mode 100644
index 0000000000..bd6481a5a6
--- /dev/null
+++ b/packages/fuzzy-viz/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "."
+ },
+ "include": [
+ "./src/**/*.ts"
+ ]
+}
diff --git a/packages/fuzzy/CHANGELOG.md b/packages/fuzzy/CHANGELOG.md
new file mode 100644
index 0000000000..c303ad75b5
--- /dev/null
+++ b/packages/fuzzy/CHANGELOG.md
@@ -0,0 +1,28 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+# 0.1.0 (2020-12-22)
+
+
+### Features
+
+* **fuzzy:** add alphaCut() & implication() fns ([8ec15fa](https://github.com/thi-ng/umbrella/commit/8ec15fa5c0f33fd7342c4047a5523e9fd0597ed1))
+* **fuzzy:** add evaluate() ([0ffc9d0](https://github.com/thi-ng/umbrella/commit/0ffc9d01f9bd40ba616d1f59e3ced74fa7c0dc7f))
+* **fuzzy:** add maxima(), compose(), restructure ([f15d8d7](https://github.com/thi-ng/umbrella/commit/f15d8d73df2a438d4866d57fc25fed625acd7a8a))
+* **fuzzy:** add min true threshold for classify() ([6f49a30](https://github.com/thi-ng/umbrella/commit/6f49a308c62a598f6d0a0e6e5046cd8e24d81eab))
+* **fuzzy:** add shapes, strongAnd(), update combineTerms() ([5bf8f0c](https://github.com/thi-ng/umbrella/commit/5bf8f0c01541afeb367eff21cb45118a1b62549a))
+* **fuzzy:** add strict arg for classify(), update docs ([b39248f](https://github.com/thi-ng/umbrella/commit/b39248f359aa0148ff72c484d78175f8f435fe97))
+* **fuzzy:** add/update/migrate defuzz strategies ([c1ee15f](https://github.com/thi-ng/umbrella/commit/c1ee15fdce2b08176c5bc97ba9ca7a56a84817c7))
+* **fuzzy:** import as new pkg, refactor ([a578194](https://github.com/thi-ng/umbrella/commit/a57819454f38de4c35095b64b9e7028d9ac21454))
+* **fuzzy:** make lvar, rules, defuzz() typesafe ([0b210c3](https://github.com/thi-ng/umbrella/commit/0b210c3841ce9184b8dfb83ca2dde5ceca0a3b6e))
+* **fuzzy:** migrate t-norms from [@thi](https://github.com/thi).ng/math pkg ([f8993e0](https://github.com/thi-ng/umbrella/commit/f8993e0dc1aed0243629a21d36ee85e91b2e938d))
+* **fuzzy:** update defuzz() & strategies ([cf337f3](https://github.com/thi-ng/umbrella/commit/cf337f36dbf24a9cfc4c6f364c3aea82428b5940))
+* **fuzzy:** update defuzz() output prep ([81abe8c](https://github.com/thi-ng/umbrella/commit/81abe8cb718ce335940234aecf693ba53564a715))
+* **fuzzy:** update types, update compose ([566469d](https://github.com/thi-ng/umbrella/commit/566469d5c420cc2c4fdc3b107e04b52929b61915))
+
+
+### Performance Improvements
+
+* **fuzzy:** update defuzz() ([60030dd](https://github.com/thi-ng/umbrella/commit/60030dd9a5ceb02d58ad89766e14f80019f6f72f))
diff --git a/packages/fuzzy/LICENSE b/packages/fuzzy/LICENSE
new file mode 100644
index 0000000000..8dada3edaf
--- /dev/null
+++ b/packages/fuzzy/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/packages/fuzzy/README.md b/packages/fuzzy/README.md
new file mode 100644
index 0000000000..bc551c3f72
--- /dev/null
+++ b/packages/fuzzy/README.md
@@ -0,0 +1,344 @@
+
+
+# ![fuzzy](https://media.thi.ng/umbrella/banners/thing-fuzzy.svg?74e82ef9)
+
+[![npm version](https://img.shields.io/npm/v/@thi.ng/fuzzy.svg)](https://www.npmjs.com/package/@thi.ng/fuzzy)
+![npm downloads](https://img.shields.io/npm/dm/@thi.ng/fuzzy.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
+
+This project is part of the
+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
+
+- [About](#about)
+ - [Features](#features)
+ - [References / Further reading](#references---further-reading)
+ - [Status](#status)
+ - [Support packages](#support-packages)
+- [Installation](#installation)
+- [Dependencies](#dependencies)
+- [API](#api)
+ - [Fuzzy set generators & combinators](#fuzzy-set-generators--combinators)
+ - [Linguistic variables](#linguistic-variables)
+ - [Rule creation & inferencing](#rule-creation--inferencing)
+- [Authors](#authors)
+- [License](#license)
+
+## About
+
+Fuzzy logic operators & configurable rule inferencing engine.
+
+### Features
+
+- Entirely declarative & functional approach
+- Fully type checked
+- Fuzzy set domain shaping & composition functions (incl. negated / inverse)
+- Various [T-norms &
+ S-norms](https://github.com/thi-ng/umbrella/blob/develop/packages/fuzzy/src/tnorms.ts),
+ incl. parametric versions
+- Rules with multiple inputs/outputs and arbitrary term combinators (i.e.
+ T-norms). Syntax sugar for common `and`/`or` rules.
+- Defuzzification via customizable strategies and options to balance precision
+ vs. performance
+ - Maxima: First, Last, Mean
+ - Center-of-Gravity (COG)
+- Linguistic variable creation and term/set classification for given domain
+ values
+- Fuzzy set visualization (via
+ [@thi.ng/fuzzy-viz](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy-viz))
+
+### References / Further reading
+
+- [Fuzzy Logic (Wikipedia)](https://en.wikipedia.org/wiki/Fuzzy_logic)
+- [T-norm (Wikipedia)](https://en.wikipedia.org/wiki/T-Norm)
+- [Fuzzy Logic - University of Western Australia](https://teaching.csse.uwa.edu.au/units/CITS7212/Lectures/Students/Fuzzy.pdf)
+- [Introduction to Fuzzy Logic](https://www.researchgate.net/publication/267041266_Introduction_to_fuzzy_logic)
+- [Defuzzification (Wikipedia)](https://en.wikipedia.org/wiki/Defuzzification)
+- [Defuzzification methods](https://cse.iitkgp.ac.in/~dsamanta/courses/archive/sca/Archives/Chapter%205%20Defuzzification%20Methods.pdf)
+- [Comparison of the COG Defuzzification Technique](https://arxiv.org/pdf/1612.00742.pdf)
+
+### Status
+
+**ALPHA** - bleeding edge / work-in-progress
+
+[Search or submit any issues for this package](https://github.com/thi-ng/umbrella/issues?q=%5Bfuzzy%5D+in%3Atitle)
+
+### Support packages
+
+- [@thi.ng/fuzzy-viz](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy-viz) - Visualization, instrumentation & introspection utils for [@thi.ng/fuzzy](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy)
+
+## Installation
+
+```bash
+yarn add @thi.ng/fuzzy
+```
+
+```html
+// ES module
+
+
+// UMD
+
+```
+
+Package sizes (gzipped, pre-treeshake): ESM: 1.63 KB / CJS: 1.81 KB / UMD: 1.74 KB
+
+## Dependencies
+
+- [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api)
+- [@thi.ng/math](https://github.com/thi-ng/umbrella/tree/develop/packages/math)
+
+## API
+
+[Generated API docs](https://docs.thi.ng/umbrella/fuzzy/)
+
+(See
+[tests](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy/test) for
+more usage examples).
+
+### Fuzzy set generators & combinators
+
+Generators:
+
+- `constant()`
+- `point()`
+- `ramp()` / `invRamp()`
+- `triangle()`
+- `trapezoid()`
+- `sigmoid()` / `invSigmoid()`
+- `gaussian()`
+
+Combinators:
+
+- `negate()`
+- `weighted()`
+- `alphaCut()` / `invAlphaCut()`
+- `compose()` / `intersect()` / `union()`
+
+### Linguistic variables
+
+Linguistic variables (short: **L-var**s) are groupings of named (and possibly
+overlapping) fuzzy sets within a given value domain. The can be used standalone
+or as inputs/outputs in rules (further below).
+
+The
+[@thi.ng/fuzzy-viz](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy-viz)
+package provides utilities to visualize the fuzzy sets of an L-var.
+
+![fuzzy set visualization of the example
+l-var](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/fuzzy/temperature-lvar-2.svg)
+
+```ts
+// temperature sets (in celsius)
+const temp = variable(
+ // value domain
+ [-20, 40],
+ {
+ freezing: invSigmoid(0, 2),
+ cold: trapezoid(-1, 2, 16, 20),
+ warm: trapezoid(15, 20, 30, 34),
+ hot: sigmoid(32, 2)
+ }
+);
+
+evaluate(temp, 18)
+// {
+// freezing: 2.220446049250313e-16,
+// cold: 0.5,
+// warm: 0.6,
+// hot: 6.914400106935423e-13
+// }
+
+evaluate(temp, 28)
+// {
+// freezing: 0,
+// cold: 0,
+// warm: 1,
+// hot: 0.0003353501304664781
+// }
+
+// classify temperature (min confidence 33%, default: 50%)
+classify(temp, 28, 0.33)
+// "warm"
+```
+
+### Rule creation & inferencing
+
+Example taken from Franck Dernoncourt's [Introduction to Fuzzy
+Logic](https://www.researchgate.net/publication/267041266_Introduction_to_fuzzy_logic):
+
+![fuzzy set illustration from F.Dernoncourt's
+tutorial](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/fuzzy/fuzzy-matrix-dernoncourt.png)
+
+```ts
+// define fuzzy input variables
+const inputs = {
+ food: variable([0, 10], {
+ awful: invRamp(1, 3),
+ delicious: ramp(7, 9),
+ }),
+ service: variable([0, 10], {
+ poor: gaussian(0, 1.5),
+ good: gaussian(5, 1.5),
+ excellent: gaussian(10, 1.5),
+ }),
+};
+
+const outputs = {
+ tip: variable([0, 30], {
+ low: triangle(0, 5, 10),
+ medium: triangle(10, 15, 20),
+ high: triangle(20, 25, 30),
+ }),
+};
+
+// l-vars, rules and defuzzification are using generics for type safety
+// we define these 2 type aliases for brevity
+type I = typeof inputs;
+type O = typeof outputs;
+
+// rule definitions:
+// if service is poor OR food is awful -> tip is low
+// if service is normal -> tip is medium
+// if service is excellent OR food is delicious -> tip is high
+const rules = [
+ or({ food: "awful", service: "poor" }, { tip: "low" }),
+ or({ service: "good" }, { tip: "medium" }),
+ or({ food: "delicious", service: "excellent" }, { tip: "high" }),
+];
+
+// defuzzification using default center-of-gravity strategy
+defuzz(
+ inputs,
+ outputs,
+ rules,
+ // input values
+ { food: 7.32, service: 7.83 },
+);
+// { tip: 22.650000000000034 }
+
+// defuzz with custom strategy (note: each has further config options)
+defuzz(
+ inputs,
+ outputs,
+ rules,
+ // input values
+ { food: 7.32, service: 7.83 },
+ // custom defuzz strategy
+ meanOfMaximaStrategy()
+);
+// { tip: 25.050000000000043 }
+```
+
+Note: The results are slightly different than those in the textbook example, due
+to different `gaussian` fuzzy sets used for the `service` L-var.
+
+Using `instrumentStrategy()` from the upcoming
+[@thi.ng/fuzzy-viz](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy-viz)
+package, we can also visualize the final, transformed fuzzy sets used to compute
+crisp results and highlight the position of the crisp result value.
+
+Here is the ASCII art output for the [COG
+strategy](https://github.com/thi-ng/umbrella/blob/develop/packages/fuzzy/src/strategy/centroid.ts)
+and using `tnormMin` (the default) to transform each rule's output set(s):
+
+```ts
+// wrap existing strategy
+const strat = instrumentStrategy(centroidStrategy(), fuzzySetToAscii());
+
+// call defuzz as normal
+defuzz(inputs, outputs, rules, strat);
+
+// obtain secondary results via deref()
+console.log(strat.deref()[0]);
+```
+
+```text
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅.....
+.......................................................................▁|██████████████████████▇....
+......................................................................▁█|███████████████████████▇...
+....................................▅▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▅....▂██|████████████████████████▇..
+...................................▅█████████████████████████████▅..▂███|██████████████████████████.
+..................................▅███████████████████████████████▅▂████|███████████████████████████
+ ^ 21.52
+```
+
+Different results can be obtained by adjusting the
+[T-norm](https://en.wikipedia.org/wiki/T-Norm) used to transform each rule's
+output sets, here using `tnormHamacher(2)`.
+
+```text
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|.........▃▂...............
+.........................................................................|.......▃███▆▂.............
+.........................................................................|....▁▅███████▇▃...........
+................................................▁▃▆▃▁....................|.▁▄▇████████████▆▃........
+...........................................▁▂▄▆███████▆▄▂▁..............▂|▇██████████████████▆▃▁....
+...................................▁▂▃▄▅▆▇█████████████████▇▆▅▄▃▂▁..▂▄▆██|███████████████████████▅▃▁
+ ^ 21.84
+```
+
+...or using `tnormAczelAlsina(2)` (there're many more available):
+
+```text
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|.....▂▃▄▅▅▅▅▅▄▄▃▁..........
+........................................................................|.▂▅▇██████████████▆▄.......
+........................................................................|▇████████████████████▆▂....
+........................................▁▂▃▄▄▅▅▆▆▆▆▆▆▆▅▅▄▄▃▂▁.........▃█|███████████████████████▆▁..
+....................................▂▄▇███████████████████████▇▄▂....▆██|█████████████████████████▄.
+..................................▃▇█████████████████████████████▇▃▂████|██████████████████████████▇
+ ^ 21.58
+```
+
+Just for illustration purposes (and using a different example), SVG output can
+be obtained by merely switching to another instrumentation function (here
+`fuzzySetToSvg()`):
+
+![fuzzySetToSvg() visualization example](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/fuzzy/strategy-viz.svg)
+
+## Authors
+
+Karsten Schmidt
+
+If this project contributes to an academic publication, please cite it as:
+
+```bibtex
+@misc{thing-fuzzy,
+ title = "@thi.ng/fuzzy",
+ author = "Karsten Schmidt",
+ note = "https://thi.ng/fuzzy",
+ year = 2020
+}
+```
+
+## License
+
+© 2020 Karsten Schmidt // Apache Software License 2.0
diff --git a/packages/fuzzy/api-extractor.json b/packages/fuzzy/api-extractor.json
new file mode 100644
index 0000000000..94972e6bed
--- /dev/null
+++ b/packages/fuzzy/api-extractor.json
@@ -0,0 +1,3 @@
+{
+ "extends": "../../api-extractor.json"
+}
diff --git a/packages/fuzzy/package.json b/packages/fuzzy/package.json
new file mode 100644
index 0000000000..342b832069
--- /dev/null
+++ b/packages/fuzzy/package.json
@@ -0,0 +1,80 @@
+{
+ "name": "@thi.ng/fuzzy",
+ "version": "0.1.0",
+ "description": "Fuzzy logic operators & configurable rule inferencing engine",
+ "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/fuzzy#readme",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/postspectacular"
+ },
+ {
+ "type": "patreon",
+ "url": "https://patreon.com/thing_umbrella"
+ }
+ ],
+ "author": "Karsten Schmidt ",
+ "license": "Apache-2.0",
+ "scripts": {
+ "build": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module",
+ "build:release": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module all",
+ "build:es6": "tsc --declaration",
+ "build:test": "rimraf build && tsc -p test/tsconfig.json",
+ "build:check": "tsc --isolatedModules --noEmit",
+ "test": "mocha test",
+ "cover": "nyc mocha test && nyc report --reporter=lcov",
+ "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib strategies",
+ "doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
+ "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
+ "doc": "node_modules/.bin/typedoc --mode modules --out doc --theme ../../tools/doc/typedoc-theme src",
+ "pub": "yarn build:release && yarn publish --access public"
+ },
+ "devDependencies": {
+ "@istanbuljs/nyc-config-typescript": "^1.0.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
+ "mocha": "^8.2.1",
+ "nyc": "^15.1.0",
+ "ts-node": "^9.1.1",
+ "typedoc": "^0.19.2",
+ "typescript": "^4.1.3"
+ },
+ "dependencies": {
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/math": "^3.0.0"
+ },
+ "files": [
+ "*.js",
+ "*.d.ts",
+ "lib",
+ "strategies"
+ ],
+ "keywords": [
+ "agent",
+ "functional",
+ "math",
+ "fuzzy",
+ "inference",
+ "logic",
+ "rule",
+ "t-norm",
+ "typescript"
+ ],
+ "publishConfig": {
+ "access": "public"
+ },
+ "sideEffects": false,
+ "thi.ng": {
+ "status": "alpha",
+ "year": 2020
+ }
+}
diff --git a/packages/fuzzy/src/api.ts b/packages/fuzzy/src/api.ts
new file mode 100644
index 0000000000..9a82b9368f
--- /dev/null
+++ b/packages/fuzzy/src/api.ts
@@ -0,0 +1,65 @@
+import type { Fn2, FnN, FnN2 } from "@thi.ng/api";
+
+export type FuzzyFn = FnN;
+
+export type RuleOp = (x: number, a: FuzzyFn, b: FuzzyFn) => number;
+
+export type DefuzzStrategy = Fn2;
+
+export type LVarDomain = [number, number];
+
+export type LVarTerms = Record;
+
+export type LVarSet = Record>;
+
+export type LVarKeys> = keyof T["terms"];
+
+export type LVarKeySet, K extends keyof I> = Partial<
+ {
+ [k in K]: LVarKeys;
+ }
+>;
+
+/**
+ * Linguistic Variable, defining several (possibly overlapping) fuzzy sets in an
+ * overall global domain.
+ */
+export interface LVar {
+ /**
+ * Value domain/interval used to evaluate (and integrate) all terms during
+ * {@link defuzz}. Interval is semi-open, i.e. `[min, max)`
+ *
+ * @remarks
+ * The domain can be smaller or larger than the actual union bounds of the
+ * defined sets. However, for precision and performance reasons, it's
+ * recommended to keep this interval as compact as possible.
+ */
+ domain: LVarDomain;
+ /**
+ * Object of named fuzzy sets.
+ */
+ terms: LVarTerms;
+}
+
+export interface Rule, O extends LVarSet> {
+ op: FnN2;
+ if: LVarKeySet;
+ then: LVarKeySet;
+ weight: number;
+}
+
+export interface DefuzzStrategyOpts {
+ /**
+ * Number of samples/steps to use for integration of the fuzzy set.
+ *
+ * @defaultValue 100
+ */
+ samples: number;
+ /**
+ * Tolerance value (only used by some strategies, e.g.
+ * {@link meanOfMaximaStrategy}).
+ *
+ * @defaultValue 1e-6
+ */
+ eps: number;
+}
diff --git a/packages/fuzzy/src/defuzz.ts b/packages/fuzzy/src/defuzz.ts
new file mode 100644
index 0000000000..45cdf76468
--- /dev/null
+++ b/packages/fuzzy/src/defuzz.ts
@@ -0,0 +1,75 @@
+import type { IObjectOf } from "@thi.ng/api";
+import type { FuzzyFn, LVarSet, Rule } from "./api";
+import { constant, intersect, union, weighted } from "./shapes";
+import { centroidStrategy } from "./strategies/centroid";
+import { snormMax, tnormMin } from "./tnorms";
+
+/**
+ * Takes an object of input {@link variable}s, an object of output variable,
+ * rule array and an object of input values. Evaluates relevant terms of input
+ * variables in all matching rules, then combines and defuzzes them using given
+ * optional strategy (by default {@link centroidStrategy} w/ its own default
+ * options). Returns object of computed output variable values.
+ *
+ * @remarks
+ * The `imply` T-norm (default: {@link tnormMin} is used to transform each
+ * rule's output set(s) using each rule's computed/aggregated truth value, as
+ * well as each rule's weight. Different T-norms might produce different fuzzy
+ * set shapes and different results, even if the defuzz strategy remains
+ * constant.
+ *
+ * The `combine` S-norm (default: {@link snormMax}) is used to combine the
+ * relevant output sets of all rules for integration/analysis by the given
+ * defuzz `strategy` actually producing the crisp result.
+ *
+ * @param ins
+ * @param outs
+ * @param rules
+ * @param vals
+ * @param strategy
+ * @param imply
+ * @param combine
+ */
+export const defuzz = , O extends LVarSet>(
+ ins: I,
+ outs: O,
+ rules: Rule[],
+ vals: Partial>,
+ strategy = centroidStrategy(),
+ imply = tnormMin,
+ combine = snormMax
+) => {
+ const ruleTerms = rules.map((r) => {
+ let alpha: number | null = null;
+ for (let id in vals) {
+ if (r.if[id]) {
+ const v = ins[id].terms[r.if[id]](vals[id]!);
+ alpha = alpha !== null ? r.op(alpha, v) : v;
+ }
+ }
+ const terms: IObjectOf = {};
+ if (alpha) {
+ const aterm = constant(alpha);
+ for (let id in r.then) {
+ if (outs[id]) {
+ const oterm = outs[id].terms[r.then[id]];
+ terms[id] = intersect(
+ imply,
+ r.weight == 1 ? oterm : weighted(oterm, r.weight),
+ aterm
+ );
+ }
+ }
+ }
+ return terms;
+ });
+
+ const res: Partial> = {};
+ for (let id in outs) {
+ res[id] = strategy(
+ union(combine, ...ruleTerms.map((r) => r[id]).filter((f) => !!f)),
+ outs[id].domain
+ );
+ }
+ return res;
+};
diff --git a/packages/fuzzy/src/index.ts b/packages/fuzzy/src/index.ts
new file mode 100644
index 0000000000..3960cc99e2
--- /dev/null
+++ b/packages/fuzzy/src/index.ts
@@ -0,0 +1,10 @@
+export * from "./api";
+export * from "./defuzz";
+export * from "./rules";
+export * from "./shapes";
+export * from "./tnorms";
+export * from "./var";
+
+export * from "./strategies/bisector";
+export * from "./strategies/centroid";
+export * from "./strategies/maxima";
diff --git a/packages/fuzzy/src/rules.ts b/packages/fuzzy/src/rules.ts
new file mode 100644
index 0000000000..2dc10c5ba3
--- /dev/null
+++ b/packages/fuzzy/src/rules.ts
@@ -0,0 +1,67 @@
+import type { FnN2 } from "@thi.ng/api";
+import type { LVarKeySet, LVarSet, Rule } from "./api";
+import { snormMax, tnormMin, tnormProduct } from "./tnorms";
+
+/**
+ * Defines and returns a new rule object. Takes a T-norm (or S-norm) `op`, an
+ * object of input conditions, an object of results and optional rule `weight`.
+ * The `op` function is used to combine input terms.
+ *
+ * @remarks
+ * The input and output objects are each using LVar names as keys and respective
+ * var terms (their names) as values (see example).
+ *
+ * The optional rule weight (default: 1) is used by {@link defuzz} to adjust
+ * rule importance.
+ *
+ * Also @see {@link and}, {@link strongAnd}, {@link or} for syntax sugar.
+ *
+ * @example
+ * ```ts
+ * // given 3 LVars from a classic fuzzy logic example:
+ * // food, service, tip
+ *
+ * // define this rule:
+ * // "If the food was bad AND service poor, then a small tip only"
+ * // here multiply is used for strong conjunction of the food & service terms
+ * rule(
+ * (a, b) => a * b,
+ * { food: "bad", service: "poor" },
+ * { tip: "small" }
+ * )
+ * ```
+ *
+ * @param op
+ * @param $if
+ * @param then
+ * @param weight
+ */
+export const rule = , O extends LVarSet>(
+ op: FnN2,
+ $if: LVarKeySet,
+ then: LVarKeySet,
+ weight = 1
+): Rule => ({
+ if: $if,
+ then,
+ op,
+ weight,
+});
+
+export const and = , O extends LVarSet>(
+ $if: LVarKeySet,
+ then: LVarKeySet,
+ weight?: number
+) => rule(tnormMin, $if, then, weight);
+
+export const strongAnd = , O extends LVarSet>(
+ $if: LVarKeySet,
+ then: LVarKeySet,
+ weight?: number
+) => rule(tnormProduct, $if, then, weight);
+
+export const or = , O extends LVarSet>(
+ $if: LVarKeySet,
+ then: LVarKeySet,
+ weight?: number
+) => rule(snormMax, $if, then, weight);
diff --git a/packages/fuzzy/src/shapes.ts b/packages/fuzzy/src/shapes.ts
new file mode 100644
index 0000000000..623828f59c
--- /dev/null
+++ b/packages/fuzzy/src/shapes.ts
@@ -0,0 +1,231 @@
+import type { FnN2, FnU, FnU2, FnU3, FnU4 } from "@thi.ng/api";
+import {
+ EPS,
+ eqDelta,
+ fit,
+ fitClamped,
+ gaussian as $gaussian,
+ sigmoid as $sigmoid,
+} from "@thi.ng/math";
+import type { FuzzyFn } from "./api";
+
+/**
+ * HOF {@link FuzzyFn} always yielding given `x` (should be in [0,1]
+ * interval).
+ *
+ * @param x
+ */
+export const constant = (x: number): FuzzyFn => () => x;
+
+/**
+ * HOF {@link FuzzyFn} which takes a value `p` and tolerance `eps`, then yields
+ * a discrete window function: `|p - x| <= eps ? 1 : 0`
+ *
+ * @param p
+ * @param eps
+ */
+export const point = (p: number, eps = EPS): FuzzyFn => (x) =>
+ eqDelta(x, p, eps) ? 1 : 0;
+
+/**
+ * HOF {@link FuzzyFn} yielding a rising ramp in [a,b] interval, clamped to
+ * [0,1] outputs. Returns 0.0 for inputs <= `a` and 1.0 for inputs >= `b`.
+ *
+ * @param a
+ * @param b
+ */
+export const ramp: FnU2 = (a, b) => (x) =>
+ fitClamped(x, a, b, 0, 1);
+
+/**
+ * HOF {@link FuzzyFn} yielding a triangle in the input range `[a..b..c]` with
+ * `b` defining the position of the peak value (1.0). Returns 0.0 for inputs <
+ * `a` or > `c`.
+ *
+ * @param a
+ * @param b
+ * @param c
+ */
+export const triangle: FnU3 = (a, b, c) => (x) =>
+ x < a || x > c ? 0 : x <= b ? fit(x, a, b, 0, 1) : fit(x, b, c, 1, 0);
+
+/**
+ * Similar to {@link triangle}, but yielding a trapezoid for the input range
+ * `[a..b..c..d]` with `b` and `c` defining the peak value range (with 1.0
+ * outputs). Returns 0.0 for inputs < `a` or > `d`.
+ *
+ * @param a
+ * @param b
+ * @param c
+ * @param d
+ */
+export const trapezoid: FnU4 = (a, b, c, d) => (x) =>
+ x < a || x > d
+ ? 0
+ : x > b && x < c
+ ? 1
+ : x <= b
+ ? fit(x, a, b, 0, 1)
+ : fit(x, c, d, 1, 0);
+
+/**
+ * HOF {@link FuzzyFn}, yielding sigmoid curve with configurable `steep` and
+ * positioned such that `f(bias) = 0.5`.
+ *
+ * @param bias
+ * @param steep
+ */
+export const sigmoid: FnU2 = (bias, steep) => (x) =>
+ $sigmoid(bias, steep, x);
+
+/**
+ * HOF {@link FuzzyFn}, yielding gaussian bell curve with its peak at `bias` and
+ * width defined by `sigma`.
+ *
+ * @param bias
+ * @param sigma
+ */
+export const gaussian: FnU2 = (bias, sigma) => (x) =>
+ $gaussian(bias, sigma, x);
+
+/**
+ * Higher-order function: Takes an existing {@link FuzzyFn} `fn` and returns
+ * a new one producing its negated outcome aka `1 - fn(x)`.
+ *
+ * @param fn
+ */
+export const negate: FnU = (fn) => (x) => 1 - fn(x);
+
+/**
+ * Inverse of {@link ramp}, i.e. a falling slope from `a` -> `b`.
+ *
+ * @param a
+ * @param b
+ */
+export const invRamp: FnU2 = (a, b) => negate(ramp(a, b));
+
+/**
+ * Inverse of {@link sigmoid}.
+ *
+ * @param bias
+ * @param steep
+ */
+export const invSigmoid: FnU2 = (bias, steep) =>
+ negate(sigmoid(bias, steep));
+
+/**
+ * Higher-order function: Takes an existing {@link FuzzyFn} `fn` and `weight`
+ * factor. Returns new function which computes: `weight * fn(x)`.
+ *
+ * @param fn
+ * @param weight
+ */
+export const weighted = (fn: FuzzyFn, weight: number): FuzzyFn => (x) =>
+ weight * fn(x);
+
+/**
+ * Higher order function. Returns new function which selects subset of given
+ * fuzzy set where `fn(x) > alpha`, or else returns 0.
+ *
+ * @param fn
+ * @param alpha
+ */
+export const alphaCut = (fn: FuzzyFn, alpha = 0.5): FuzzyFn => (x) => {
+ const y = fn(x);
+ return y > alpha ? y : 0;
+};
+
+/**
+ * Higher order function. Returns new function which selects subset of given
+ * fuzzy set where `fn(x) < alpha`, or else returns 0.
+ *
+ * @param fn
+ * @param alpha
+ */
+export const invAlphaCut = (fn: FuzzyFn, alpha = 0.5): FuzzyFn => (x) => {
+ const y = fn(x);
+ return y < alpha ? y : 0;
+};
+
+/**
+ * Higher order function, complex shape generator. Takes a T-norm (or S-norm) as
+ * reduction function `op` and any number of {@link FuzzyFn}s. Returns new
+ * `FuzzyFn` which evaluates all given `fns` and combines/reduces their results
+ * with `op`.
+ *
+ * @remarks
+ * Depending on the use case and choice of `op`, the `initial` value should
+ * either be set to:
+ *
+ * - T-norm like function: 1.0
+ * - S-norm like function: 0.0
+ *
+ * References:
+ * - https://www.desmos.com/calculator/pnq6kqzfb5 (interactive graph)
+ * - https://en.wikipedia.org/wiki/T-norm
+ * - https://github.com/thi-ng/umbrella/blob/develop/packages/math/src/tnorms.ts
+ *
+ * @example
+ * ```ts
+ * const f = compose(tnormMin, 1, triangle(0,2,4), triangle(1,3,5));
+ * f(1); // 0
+ * f(2); // 0.5
+ * f(3); // 0.5
+ * f(4); // 0
+ * ```
+ *
+ * @example
+ * ```ts
+ * // M-like shape w/ peaks at 3 & 5
+ * const M = compose(
+ * Math.max,
+ * 0,
+ * triangle(1,3,5),
+ * triangle(3,5,7)
+ * )
+ *
+ * M(3) // 1
+ * M(4) // 0.5
+ * M(5) // 1
+ * ```
+ *
+ * @param op
+ * @param initial
+ * @param fns
+ */
+export const compose = (
+ op: FnN2,
+ initial: number,
+ ...fns: FuzzyFn[]
+): FuzzyFn => {
+ const [a, b] = fns;
+ switch (fns.length) {
+ case 0:
+ throw new Error("no fuzzy sets given");
+ case 1:
+ return a;
+ case 2:
+ return (x) => op(a(x), b(x));
+ default:
+ return (x) => fns.reduce((acc, f) => op(acc, f(x)), initial);
+ }
+};
+
+/**
+ * Syntax sugar for {@link compose} with an initial value of 1.0. The `op` is
+ * supposed to be a T-norm.
+ *
+ * @param op
+ * @param fns
+ */
+export const intersect = (op: FnN2, ...fns: FuzzyFn[]) =>
+ compose(op, 1, ...fns);
+
+/**
+ * Syntax sugar for {@link compose} with an initial value of 0.0. The `op` is
+ * supposed to be a S-norm.
+ *
+ * @param op
+ * @param fns
+ */
+export const union = (op: FnN2, ...fns: FuzzyFn[]) => compose(op, 0, ...fns);
diff --git a/packages/fuzzy/src/strategies/bisector.ts b/packages/fuzzy/src/strategies/bisector.ts
new file mode 100644
index 0000000000..667261be0f
--- /dev/null
+++ b/packages/fuzzy/src/strategies/bisector.ts
@@ -0,0 +1,61 @@
+import { fit } from "@thi.ng/math";
+import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api";
+import { defaultOpts } from "./opts";
+
+/**
+ * Higher-order function: Bisector-of-Area defuzzification strategy. Returns
+ * strategy which computes the integral of a given fuzzy set in the defined
+ * `[min,max]` domain and returns the position of the bisector which partitions
+ * the area into 2 equal halves. The domain is sampled at `opts.samples`
+ * uniformly spaced points.
+ *
+ * @remarks
+ * Use `samples` option to adjust precision.
+ *
+ * @see {@Link DefuzzStrategyOpts}
+ *
+ * @example
+ * ```ts
+ * bisectorStrategy()(trapezoid(0,1,5,6), [0,6])
+ * // 2.97
+ *
+ * // ......▁█████████████|█████████████▁.....
+ * // ......██████████████|██████████████.....
+ * // .....███████████████|███████████████....
+ * // ....▇███████████████|███████████████▇...
+ * // ...▅████████████████|████████████████▅..
+ * // ..▃█████████████████|█████████████████▃.
+ * // .▁██████████████████|██████████████████▁
+ * // .███████████████████|███████████████████
+ * // ^ 2.97
+ * ```
+ *
+ * @param opts
+ */
+export const bisectorStrategy = (
+ opts?: Partial
+): DefuzzStrategy => {
+ let { samples } = defaultOpts(opts);
+ return (fn, [min, max]) => {
+ const delta = (max - min) / samples;
+ let sum: number[] = [];
+ for (let i = 0, acc = 0; i <= samples; i++) {
+ acc += fn(min + i * delta);
+ sum.push(acc);
+ }
+ if (!sum.length) return min;
+ const mean = sum[samples] * 0.5;
+ for (let i = 1; i <= samples; i++) {
+ if (sum[i] >= mean) {
+ return fit(
+ mean,
+ sum[i - 1],
+ sum[i],
+ min + (i - 1) * delta,
+ min + i * delta
+ );
+ }
+ }
+ return min;
+ };
+};
diff --git a/packages/fuzzy/src/strategies/centroid.ts b/packages/fuzzy/src/strategies/centroid.ts
new file mode 100644
index 0000000000..0f1d7d2b4b
--- /dev/null
+++ b/packages/fuzzy/src/strategies/centroid.ts
@@ -0,0 +1,50 @@
+import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api";
+import { defaultOpts } from "./opts";
+
+/**
+ * Higher-order function: Centre-of-gravity defuzzification strategy, yielding
+ * the approx. center of gravity position of a given fuzzy set. The domain is
+ * sampled at `opts.samples` uniformly spaced points.
+ *
+ * @remarks
+ * This is the default strategy used by {@link defuzz}. Produces similar results
+ * to {@link bisectorStrategy}, but with lower computational cost. Use `samples`
+ * option to adjust precision.
+ *
+ * @see {@Link DefuzzStrategyOpts}
+ *
+ * @example
+ * ```ts
+ * centroidStrategy()(trapezoid(0,1,5,6), [0,6])
+ * // 3.0000000000000004
+ *
+ * // ......▁█████████████|█████████████▁.....
+ * // ......██████████████|██████████████.....
+ * // .....███████████████|███████████████....
+ * // ....▇███████████████|███████████████▇...
+ * // ...▅████████████████|████████████████▅..
+ * // ..▃█████████████████|█████████████████▃.
+ * // .▁██████████████████|██████████████████▁
+ * // .███████████████████|███████████████████
+ * // ^ 3.00
+ * ```
+ *
+ * @param opts
+ */
+export const centroidStrategy = (
+ opts?: Partial
+): DefuzzStrategy => {
+ let { samples } = defaultOpts(opts);
+ return (fn, [min, max]) => {
+ const delta = (max - min) / samples;
+ let num = 0;
+ let denom = 0;
+ for (let i = 0; i <= samples; i++) {
+ const x = min + i * delta;
+ const y = fn(x);
+ num += x * y;
+ denom += y;
+ }
+ return num / denom;
+ };
+};
diff --git a/packages/fuzzy/src/strategies/maxima.ts b/packages/fuzzy/src/strategies/maxima.ts
new file mode 100644
index 0000000000..684cd0b0d8
--- /dev/null
+++ b/packages/fuzzy/src/strategies/maxima.ts
@@ -0,0 +1,138 @@
+import { eqDelta } from "@thi.ng/math";
+import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api";
+import { defaultOpts } from "./opts";
+
+/**
+ * Higher-order function. Returns Mean-of-Maxima defuzzification strategy,
+ * yielding the approx. mean of the maximum region of a given fuzzy set.
+ *
+ * @remarks
+ * Use `samples` option to adjust precision.
+ *
+ * @see {@Link DefuzzStrategyOpts}
+ *
+ * @example
+ * ```ts
+ * meanOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6])
+ * // 3
+ *
+ * // ......▁█████████████|█████████████▁.....
+ * // ......██████████████|██████████████.....
+ * // .....███████████████|███████████████....
+ * // ....▇███████████████|███████████████▇...
+ * // ...▅████████████████|████████████████▅..
+ * // ..▃█████████████████|█████████████████▃.
+ * // .▁██████████████████|██████████████████▁
+ * // .███████████████████|███████████████████
+ * // ^ 3.00
+ * ```
+ *
+ * @param opts
+ */
+export const meanOfMaximaStrategy = (
+ opts?: Partial
+): DefuzzStrategy => {
+ const { samples, eps } = defaultOpts(opts);
+ return (fn, [min, max]) => {
+ const delta = (max - min) / samples;
+ let peak = -Infinity;
+ let peakPos = min;
+ let n = 1;
+ for (let i = 0; i <= samples; i++) {
+ const t = min + i * delta;
+ const x = fn(t);
+ if (eqDelta(x, peak, eps)) {
+ peakPos += t;
+ n++;
+ } else if (x > peak) {
+ peak = x;
+ peakPos = t;
+ n = 1;
+ }
+ }
+ return peakPos / n;
+ };
+};
+
+/**
+ * Higher-order function. Returns First-of-Maxima defuzzification strategy,
+ * yielding the approx. start position of the maximum region of a given fuzzy
+ * set.
+ *
+ * @remarks
+ * Use `samples` option to adjust precision.
+ *
+ * @see {@Link DefuzzStrategyOpts}
+ *
+ * @example
+ * ```ts
+ * firstOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6])
+ * // 1.02
+ *
+ * // ......▁|██████████████████████████▁.....
+ * // ......█|███████████████████████████.....
+ * // .....██|████████████████████████████....
+ * // ....▇██|████████████████████████████▇...
+ * // ...▅███|█████████████████████████████▅..
+ * // ..▃████|██████████████████████████████▃.
+ * // .▁█████|███████████████████████████████▁
+ * // .██████|████████████████████████████████
+ * // ^ 1.02
+ * ```
+ *
+ * @param opts
+ */
+export const firstOfMaximaStrategy = (
+ opts?: Partial
+): DefuzzStrategy => {
+ const { samples } = defaultOpts(opts);
+ return (fn, [min, max]) => {
+ const delta = (max - min) / samples;
+ let peak = -Infinity;
+ let peakPos = min;
+ for (let i = 0; i <= samples; i++) {
+ const t = min + i * delta;
+ const x = fn(t);
+ if (x > peak) {
+ peak = x;
+ peakPos = t;
+ }
+ }
+ return peakPos;
+ };
+};
+
+/**
+ * Higher-order function. Returns First-of-Maxima defuzzification strategy,
+ * yielding the approx. final position of the maximum region of a given fuzzy
+ * set.
+ *
+ * @remarks
+ * Use `samples` option to adjust precision.
+ *
+ * @see {@Link DefuzzStrategyOpts}
+ *
+ * @example
+ * ```ts
+ * lastOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6])
+ * // 1.02
+ *
+ * // ......▁██████████████████████████|▁.....
+ * // ......███████████████████████████|█.....
+ * // .....████████████████████████████|██....
+ * // ....▇████████████████████████████|██▇...
+ * // ...▅█████████████████████████████|███▅..
+ * // ..▃██████████████████████████████|████▃.
+ * // .▁███████████████████████████████|█████▁
+ * // .████████████████████████████████|██████
+ * // ^ 4.98
+ * ```
+ *
+ * @param opts
+ */
+export const lastOfMaximaStrategy = (
+ opts?: Partial
+): DefuzzStrategy => {
+ const impl = firstOfMaximaStrategy(opts);
+ return (fn, [min, max]) => impl(fn, [max, min]);
+};
diff --git a/packages/fuzzy/src/strategies/opts.ts b/packages/fuzzy/src/strategies/opts.ts
new file mode 100644
index 0000000000..a2d6be0b87
--- /dev/null
+++ b/packages/fuzzy/src/strategies/opts.ts
@@ -0,0 +1,9 @@
+import type { DefuzzStrategyOpts } from "../api";
+
+export const defaultOpts = (
+ opts?: Partial
+): DefuzzStrategyOpts => ({
+ samples: 100,
+ eps: 1e-6,
+ ...opts,
+});
diff --git a/packages/fuzzy/src/tnorms.ts b/packages/fuzzy/src/tnorms.ts
new file mode 100644
index 0000000000..94cec271a3
--- /dev/null
+++ b/packages/fuzzy/src/tnorms.ts
@@ -0,0 +1,135 @@
+import type { FnN2 } from "@thi.ng/api";
+import { norm } from "@thi.ng/math";
+
+// https://en.wikipedia.org/wiki/T-norm
+
+export const tnormMin: FnN2 = (x, y) => Math.min(x, y);
+
+export const tnormProduct: FnN2 = (x, y) => x * y;
+
+export const tnormLukasiewicz: FnN2 = (x, y) => Math.max(0, x + y - 1);
+
+export const tnormDrastic: FnN2 = (x, y) => (x === 1 ? y : y === 1 ? x : 0);
+
+export const tnormNilpotent: FnN2 = (x, y) => (x + y > 1 ? Math.min(x, y) : 0);
+
+/**
+ * HOF T-norm. Parametric Hamacher with `p` controlling curvature.
+ *
+ * @remarks
+ * Interactive graph: https://www.desmos.com/calculator/4bneccqs3p
+ *
+ * @param p - curve param [0..∞], default: 2
+ */
+export const tnormHamacher = (p = 2): FnN2 => (x, y) =>
+ x === 0 && y === 0 ? 0 : (x * y) / (p + (1 - p) * (x + y - x * y));
+
+/**
+ * HOF T-norm. Parametric Yager with `p` controlling curvature.
+ *
+ * @remarks
+ * Interactive graph: https://www.desmos.com/calculator/4bneccqs3p
+ *
+ * @param p - curve param [0..∞], default: 2
+ */
+export const tnormYager = (p = 2): FnN2 =>
+ p === 0
+ ? () => 0
+ : (x, y) => Math.max(0, 1 - ((1 - x) ** p + (1 - y) ** p) ** (1 / p));
+
+/**
+ * HOF T-norm. Parametric Dombi with `p` controlling curvature.
+ *
+ * @remarks
+ * Interactive graph: https://www.desmos.com/calculator/4bneccqs3p
+ *
+ * @param p - curve param [0..∞], default: 2
+ */
+export const tnormDombi = (p = 2): FnN2 =>
+ p === 0
+ ? () => 0
+ : (x, y) =>
+ x === 0 || y === 0
+ ? 0
+ : 1 /
+ (1 + (((1 - x) / x) ** p + ((1 - y) / y) ** p) ** (1 / p));
+
+/**
+ * HOF T-norm. Parametric Aczél–Alsina with `p` controlling curvature.
+ *
+ * @remarks
+ * Interactive graph: https://www.desmos.com/calculator/4bneccqs3p
+ *
+ * @param p - curve param [0..∞], default: 2
+ */
+export const tnormAczelAlsina = (p = 2): FnN2 => (x, y) =>
+ Math.exp(
+ -((Math.abs(Math.log(x)) ** p + Math.abs(Math.log(y)) ** p) ** (1 / p))
+ );
+/**
+ * S-norm (T-conorm), dual of {@link tnormMin}.
+ *
+ * @param x
+ * @param y
+ */
+export const snormMax: FnN2 = (x, y) => Math.max(x, y);
+
+/**
+ * S-norm (T-conorm), dual of {@link tnormProduct}, probabilistic sum:
+ * `a + b - a * b`
+ *
+ * @param x
+ * @param y
+ */
+export const snormProbabilistic: FnN2 = (x, y) => x + y - x * y;
+
+/**
+ * S-norm (T-conorm), dual of {@link tnormLukasiewicz}.
+ *
+ * @param x
+ * @param y
+ */
+export const snormBoundedSum: FnN2 = (x, y) => Math.min(x + y, 1);
+
+/**
+ * S-norm (T-conorm), dual of {@link tnormDrastic}.
+ */
+export const snormDrastic: FnN2 = (x, y) => (x === 0 ? y : y === 0 ? x : 1);
+
+/**
+ * S-norm (T-conorm), dual of {@link tnormNilpotent}.
+ *
+ * @param x
+ * @param y
+ */
+export const snormNilpotent: FnN2 = (x, y) => (x + y < 1 ? Math.max(x, y) : 1);
+
+/**
+ * S-norm (T-conorm), dual of {@link tnormHamacher}, iff that T-norm's curve
+ * param is `p=2`.
+ *
+ * @param x
+ * @param y
+ */
+export const snormEinstein: FnN2 = (x, y) => (x + y) / (1 + x * y);
+
+/**
+ * HOF t-norm. Constructs a new t-norm based on given t-norms for disjoint
+ * subintervals, completing remaining regions via {@link min}.
+ *
+ * @remarks
+ * Reference: https://en.wikipedia.org/wiki/Construction_of_t-norms#Ordinal_sums
+ *
+ * @param specs
+ */
+export const ordinalSum = (
+ specs: { domain: [number, number]; tnorm: FnN2 }[]
+): FnN2 => (x, y) => {
+ for (let s of specs) {
+ const [a, b] = s.domain;
+ if (x >= a && x <= b && y >= a && y <= b) {
+ return a + (b - a) * s.tnorm(norm(x, a, b), norm(y, a, b));
+ }
+ }
+ return Math.min(x, y);
+};
diff --git a/packages/fuzzy/src/var.ts b/packages/fuzzy/src/var.ts
new file mode 100644
index 0000000000..66dd449352
--- /dev/null
+++ b/packages/fuzzy/src/var.ts
@@ -0,0 +1,98 @@
+import type { LVar } from "./api";
+
+/**
+ * Takes a `domain` interval and on object of named fuzzy sets and returns a new
+ * Linguistic variable, which can then be used as input or output var for
+ * {@link defuzz}.
+ *
+ * @example
+ * ```ts
+ * // temperature sets (in celsius)
+ * const temp = variable([-20, 40], {
+ * freezing: invSigmoid(0, 2),
+ * cold: trapezoid(0, 4, 16, 20),
+ * warm: trapezoid(15, 20, 25, 30),
+ * hot: sigmoid(30, 2)
+ * });
+ * ```
+ *
+ * @param domain
+ * @param terms
+ */
+export const variable = (
+ domain: [number, number],
+ terms: LVar["terms"]
+): LVar => ({
+ domain,
+ terms,
+});
+
+/**
+ * Takes an LVar and a domain value `x`. Returns the ID of the var's fuzzy set
+ * term which yields the max truth value for given `x`. If `threshold` is
+ * enabled (default: 0.5), any truth value MUST also be > `threshold` to be
+ * considered. The function returns undefined if classification failed.
+ *
+ * @example
+ * ```ts
+ * // temperature sets (in celsius)
+ * const temp = variable([-20, 40], {
+ * freezing: invSigmoid(0, 2),
+ * cold: trapezoid(0, 4, 16, 20),
+ * warm: trapezoid(15, 20, 25, 30),
+ * hot: sigmoid(30, 2)
+ * });
+ *
+ * classify(temp, 28)
+ * // "warm"
+ * ```
+ *
+ * @param var
+ * @param x
+ * @param threshold
+ */
+export const classify = (
+ { terms }: LVar,
+ x: number,
+ threshold = 0.5
+) => {
+ let max = threshold;
+ let maxID: K | undefined;
+ for (let id in terms) {
+ const t = terms[id](x);
+ if (t >= max) {
+ max = t;
+ maxID = id;
+ }
+ }
+ return maxID;
+};
+
+/**
+ * Takes an LVar and a domain value `x`, evaluates all of var's terms for given
+ * `x` and returns object of results.
+ *
+ * @example
+ * ```ts
+ * // temperature sets (in celsius)
+ * const temp = variable([-20, 40], {
+ * freezing: invSigmoid(0, 2),
+ * cold: trapezoid(0, 4, 16, 20),
+ * warm: trapezoid(15, 20, 25, 30),
+ * hot: sigmoid(30, 2)
+ * });
+ *
+ * evaluate(temp, 28)
+ * // { freezing: 0, cold: 0, warm: 0.4, hot: 0.01798620996209156 }
+ * ```
+ *
+ * @param var
+ * @param x
+ */
+export const evaluate = ({ terms }: LVar, x: number) => {
+ const res = >{};
+ for (let id in terms) {
+ res[id] = terms[id](x);
+ }
+ return res;
+};
diff --git a/packages/fuzzy/test/defuzz.ts b/packages/fuzzy/test/defuzz.ts
new file mode 100644
index 0000000000..d3fc775575
--- /dev/null
+++ b/packages/fuzzy/test/defuzz.ts
@@ -0,0 +1,177 @@
+import { assert } from "@thi.ng/api";
+import { eqDelta, roundTo } from "@thi.ng/math";
+import {
+ bisectorStrategy,
+ centroidStrategy,
+ defuzz,
+ DefuzzStrategy,
+ firstOfMaximaStrategy,
+ gaussian,
+ invRamp,
+ lastOfMaximaStrategy,
+ meanOfMaximaStrategy,
+ or,
+ ramp,
+ triangle,
+ variable,
+} from "../src";
+
+describe("defuzz", () => {
+ it("strategies", () => {
+ // https://www.researchgate.net/publication/267041266_Introduction_to_fuzzy_logic
+ const inputs = {
+ food: variable([0, 10], {
+ awful: invRamp(1, 3),
+ delicious: ramp(7, 9),
+ }),
+ service: variable([0, 10], {
+ poor: gaussian(0, 1.5),
+ good: gaussian(5, 1.5),
+ excellent: gaussian(10, 1.5),
+ }),
+ };
+
+ const outputs = {
+ tip: variable([0, 30], {
+ low: triangle(0, 5, 10),
+ medium: triangle(10, 15, 20),
+ high: triangle(20, 25, 30),
+ }),
+ };
+
+ type I = typeof inputs;
+ type O = typeof outputs;
+
+ // if service is poor OR food is awful -> tip is low
+ // if service is normal -> tip is medium
+ // if service is excellent OR food is delicious -> tip is high
+ const rules = [
+ or({ food: "awful", service: "poor" }, { tip: "low" }),
+ or({ service: "good" }, { tip: "medium" }),
+ or(
+ { food: "delicious", service: "excellent" },
+ { tip: "high" }
+ ),
+ ];
+
+ const testStrategy = (
+ id: string,
+ strategy: DefuzzStrategy,
+ expected: number[]
+ ) => {
+ // const all = [];
+ for (let i = 0, k = 0; i <= 10; i++) {
+ for (let j = 0; j <= 10; j++, k++) {
+ let res = defuzz(
+ inputs,
+ outputs,
+ rules,
+ { food: i, service: j },
+ strategy
+ );
+ assert(
+ eqDelta(roundTo(res.tip!, 0.01), expected[k]),
+ `${id}(${i},${j}): expected: ${expected[k]}, got: ${res.tip}`
+ );
+ // all.push(res.tip!.toFixed(2));
+ }
+ }
+ // for (let i = 0; i <= 10; i++) {
+ // console.log(all.slice(i * 11, (i + 1) * 11).join(", "));
+ // }
+ // console.log("--");
+ };
+
+ // prettier-ignore
+ const centroidResults = [
+ 5.08, 5.54, 7.02, 8.95, 9.91, 10.06, 10.32, 11.08, 13.18, 14.80, 15.00,
+ 5.08, 5.54, 7.02, 8.95, 9.91, 10.06, 10.32, 11.08, 13.18, 14.80, 15.00,
+ 5.08, 5.56, 7.52, 9.66, 10.62, 10.78, 11.07, 11.99, 14.41, 16.19, 16.42,
+ 5.08, 5.56, 7.79, 12.22, 14.46, 15.00, 15.54, 17.78, 22.21, 24.44, 24.92,
+ 5.08, 5.56, 7.79, 12.22, 14.46, 15.00, 15.54, 17.78, 22.21, 24.44, 24.92,
+ 5.08, 5.56, 7.79, 12.22, 14.46, 15.00, 15.54, 17.78, 22.21, 24.44, 24.92,
+ 5.08, 5.56, 7.79, 12.22, 14.46, 15.00, 15.54, 17.78, 22.21, 24.44, 24.92,
+ 5.08, 5.56, 7.79, 12.22, 14.46, 15.00, 15.54, 17.78, 22.21, 24.44, 24.92,
+ 13.58, 13.81, 15.59, 18.01, 18.93, 19.22, 19.38, 20.34, 22.48, 24.44, 24.92,
+ 15.00, 15.20, 16.82, 18.92, 19.68, 19.94, 20.09, 21.05, 22.98, 24.46, 24.92,
+ 15.00, 15.20, 16.82, 18.92, 19.68, 19.94, 20.09, 21.05, 22.98, 24.46, 24.92,
+ ];
+ testStrategy("centroid", centroidStrategy(), centroidResults);
+
+ // prettier-ignore
+ const bisectResults = [
+ 4.87, 5.00, 5.53, 6.91, 8.88, 10.30, 10.50, 8.32, 8.32, 11.41, 14.85,
+ 4.87, 5.00, 5.53, 6.91, 8.88, 10.30, 10.50, 8.32, 8.32, 11.41, 14.85,
+ 4.87, 5.03, 6.12, 8.30, 12.14, 12.39, 12.43, 11.82, 13.06, 21.81, 22.31,
+ 4.87, 5.03, 6.39, 13.32, 14.68, 14.85, 15.02, 16.38, 23.31, 24.67, 24.83,
+ 4.87, 5.03, 6.39, 13.32, 14.68, 14.85, 15.02, 16.38, 23.31, 24.67, 24.83,
+ 4.87, 5.03, 6.39, 13.32, 14.68, 14.85, 15.02, 16.38, 23.31, 24.67, 24.83,
+ 4.87, 5.03, 6.39, 13.32, 14.68, 14.85, 15.02, 16.38, 23.31, 24.67, 24.83,
+ 4.87, 5.03, 6.39, 13.32, 14.68, 14.85, 15.02, 16.38, 23.31, 24.67, 24.83,
+ 7.39, 7.89, 16.64, 17.88, 17.27, 17.31, 17.56, 21.40, 23.58, 24.67, 24.83,
+ 14.85, 18.29, 21.38, 21.38, 19.20, 19.40, 20.82, 22.79, 24.17, 24.70, 24.83,
+ 14.85, 18.29, 21.38, 21.38, 19.20, 19.40, 20.82, 22.79, 24.17, 24.70, 24.83,
+ ];
+
+ testStrategy("bisect", bisectorStrategy(), bisectResults);
+
+ // prettier-ignore
+ const foMaResults = [
+ 5.10, 5.10, 5.10, 5.10, 5.10, 15.00, 5.10, 5.10, 5.10, 5.10, 5.10,
+ 5.10, 5.10, 5.10, 5.10, 5.10, 15.00, 5.10, 5.10, 5.10, 5.10, 5.10,
+ 5.10, 4.20, 2.70, 2.70, 14.10, 15.00, 14.10, 2.70, 2.70, 24.30, 24.90,
+ 5.10, 4.20, 2.10, 12.30, 14.10, 15.00, 14.10, 12.30, 22.20, 24.30, 24.90,
+ 5.10, 4.20, 2.10, 12.30, 14.10, 15.00, 14.10, 12.30, 22.20, 24.30, 24.90,
+ 5.10, 4.20, 2.10, 12.30, 14.10, 15.00, 14.10, 12.30, 22.20, 24.30, 24.90,
+ 5.10, 4.20, 2.10, 12.30, 14.10, 15.00, 14.10, 12.30, 22.20, 24.30, 24.90,
+ 5.10, 4.20, 2.10, 12.30, 14.10, 15.00, 14.10, 12.30, 22.20, 24.30, 24.90,
+ 5.10, 4.20, 22.50, 22.50, 14.10, 15.00, 14.10, 22.50, 22.50, 24.30, 24.90,
+ 5.10, 24.90, 24.90, 24.90, 24.90, 15.00, 24.90, 24.90, 24.90, 24.90, 24.90,
+ 5.10, 24.90, 24.90, 24.90, 24.90, 15.00, 24.90, 24.90, 24.90, 24.90, 24.90,
+ ];
+ testStrategy("first", firstOfMaximaStrategy(), foMaResults);
+
+ // prettier-ignore
+ const loMaResults = [
+ 5.10, 5.10, 5.10, 5.10, 5.10, 15.00, 5.10, 5.10, 5.10, 5.10, 24.90,
+ 5.10, 5.10, 5.10, 5.10, 5.10, 15.00, 5.10, 5.10, 5.10, 5.10, 24.90,
+ 5.10, 5.70, 7.50, 7.50, 15.90, 15.00, 15.90, 7.50, 7.50, 25.80, 24.90,
+ 5.10, 5.70, 7.80, 17.70, 15.90, 15.00, 15.90, 17.70, 27.90, 25.80, 24.90,
+ 5.10, 5.70, 7.80, 17.70, 15.90, 15.00, 15.90, 17.70, 27.90, 25.80, 24.90,
+ 5.10, 5.70, 7.80, 17.70, 15.90, 15.00, 15.90, 17.70, 27.90, 25.80, 24.90,
+ 5.10, 5.70, 7.80, 17.70, 15.90, 15.00, 15.90, 17.70, 27.90, 25.80, 24.90,
+ 5.10, 5.70, 7.80, 17.70, 15.90, 15.00, 15.90, 17.70, 27.90, 25.80, 24.90,
+ 5.10, 5.70, 27.30, 27.30, 15.90, 15.00, 15.90, 27.30, 27.30, 25.80, 24.90,
+ 24.90, 24.90, 24.90, 24.90, 24.90, 15.00, 24.90, 24.90, 24.90, 24.90, 24.90,
+ 24.90, 24.90, 24.90, 24.90, 24.90, 15.00, 24.90, 24.90, 24.90, 24.90, 24.90,
+ ];
+ testStrategy("last", lastOfMaximaStrategy(), loMaResults);
+
+ // prettier-ignore
+ const meoMaResults = [
+ 5.10, 5.10, 5.10, 5.10, 5.10, 15.00, 5.10, 5.10, 5.10, 5.10, 15.00,
+ 5.10, 5.10, 5.10, 5.10, 5.10, 15.00, 5.10, 5.10, 5.10, 5.10, 15.00,
+ 5.10, 4.95, 5.10, 5.10, 15.00, 15.00, 15.00, 5.10, 5.10, 25.05, 24.90,
+ 5.10, 4.95, 4.95, 15.00, 15.00, 15.00, 15.00, 15.00, 25.05, 25.05, 24.90,
+ 5.10, 4.95, 4.95, 15.00, 15.00, 15.00, 15.00, 15.00, 25.05, 25.05, 24.90,
+ 5.10, 4.95, 4.95, 15.00, 15.00, 15.00, 15.00, 15.00, 25.05, 25.05, 24.90,
+ 5.10, 4.95, 4.95, 15.00, 15.00, 15.00, 15.00, 15.00, 25.05, 25.05, 24.90,
+ 5.10, 4.95, 4.95, 15.00, 15.00, 15.00, 15.00, 15.00, 25.05, 25.05, 24.90,
+ 5.10, 4.95, 24.90, 24.90, 15.00, 15.00, 15.00, 24.90, 24.90, 25.05, 24.90,
+ 15.00, 24.90, 24.90, 24.90, 24.90, 15.00, 24.90, 24.90, 24.90, 24.90, 24.90,
+ 15.00, 24.90, 24.90, 24.90, 24.90, 15.00, 24.90, 24.90, 24.90, 24.90, 24.90,
+ ];
+ testStrategy("mean", meanOfMaximaStrategy(), meoMaResults);
+
+ // const strat = instrumentStrategy(centroidStrategy(), fuzzySetToAscii());
+ // defuzz(
+ // inputs,
+ // outputs,
+ // rules,
+ // { food: 7.32, service: 7.83 },
+ // strat,
+ // tnormAczelAlsina(2)
+ // );
+ // console.log(strat.deref()[0]);
+ });
+});
diff --git a/packages/fuzzy/test/lvar.ts b/packages/fuzzy/test/lvar.ts
new file mode 100644
index 0000000000..43c265abc3
--- /dev/null
+++ b/packages/fuzzy/test/lvar.ts
@@ -0,0 +1,54 @@
+import type { IObjectOf } from "@thi.ng/api";
+import { roundTo } from "@thi.ng/math";
+import * as assert from "assert";
+import {
+ classify,
+ evaluate,
+ invSigmoid,
+ sigmoid,
+ trapezoid,
+ variable,
+} from "../src";
+
+const roundVals = (obj: IObjectOf) => {
+ for (let k in obj) obj[k] = roundTo(obj[k], 1e-3);
+ return obj;
+};
+
+const temp = variable([-20, 40], {
+ freezing: invSigmoid(0.01, 2),
+ cold: trapezoid(0, 4, 16, 20),
+ warm: trapezoid(15, 20, 25, 30),
+ hot: sigmoid(29.99, 2),
+});
+
+describe("lvar", () => {
+ it("eval", () => {
+ assert.deepStrictEqual(
+ roundVals(evaluate(temp, 18)),
+ roundVals({
+ freezing: 0,
+ cold: 0.5,
+ warm: 0.6,
+ hot: 0,
+ })
+ );
+ assert.deepStrictEqual(
+ roundVals(evaluate(temp, 28)),
+ roundVals({
+ freezing: 0,
+ cold: 0,
+ warm: 0.4,
+ hot: 0.018,
+ })
+ );
+ });
+
+ it("classify", () => {
+ assert.strictEqual(classify(temp, -1), "freezing");
+ assert.strictEqual(classify(temp, 0), "freezing");
+ assert.strictEqual(classify(temp, 10), "cold");
+ assert.strictEqual(classify(temp, 20), "warm");
+ assert.strictEqual(classify(temp, 30), "hot");
+ });
+});
diff --git a/packages/fuzzy/test/tsconfig.json b/packages/fuzzy/test/tsconfig.json
new file mode 100644
index 0000000000..9655cbea10
--- /dev/null
+++ b/packages/fuzzy/test/tsconfig.json
@@ -0,0 +1,10 @@
+{
+ "extends": "../../../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "../build",
+ "module": "commonjs",
+ "noUnusedLocals": false,
+ "noUnusedParameters": false
+ },
+ "include": ["./**/*.ts", "../src/**/*.ts"]
+}
diff --git a/packages/fuzzy/tpl.readme.md b/packages/fuzzy/tpl.readme.md
new file mode 100644
index 0000000000..9888ca4570
--- /dev/null
+++ b/packages/fuzzy/tpl.readme.md
@@ -0,0 +1,310 @@
+# ${pkg.banner}
+
+[![npm version](https://img.shields.io/npm/v/${pkg.name}.svg)](https://www.npmjs.com/package/${pkg.name})
+![npm downloads](https://img.shields.io/npm/dm/${pkg.name}.svg)
+[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
+
+This project is part of the
+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
+
+
+
+## About
+
+${pkg.description}
+
+### Features
+
+- Entirely declarative & functional approach
+- Fully type checked
+- Fuzzy set domain shaping & composition functions (incl. negated / inverse)
+- Various [T-norms &
+ S-norms](https://github.com/thi-ng/umbrella/blob/develop/packages/fuzzy/src/tnorms.ts),
+ incl. parametric versions
+- Rules with multiple inputs/outputs and arbitrary term combinators (i.e.
+ T-norms). Syntax sugar for common `and`/`or` rules.
+- Defuzzification via customizable strategies and options to balance precision
+ vs. performance
+ - Maxima: First, Last, Mean
+ - Center-of-Gravity (COG)
+- Linguistic variable creation and term/set classification for given domain
+ values
+- Fuzzy set visualization (via
+ [@thi.ng/fuzzy-viz](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy-viz))
+
+### References / Further reading
+
+- [Fuzzy Logic (Wikipedia)](https://en.wikipedia.org/wiki/Fuzzy_logic)
+- [T-norm (Wikipedia)](https://en.wikipedia.org/wiki/T-Norm)
+- [Fuzzy Logic - University of Western Australia](https://teaching.csse.uwa.edu.au/units/CITS7212/Lectures/Students/Fuzzy.pdf)
+- [Introduction to Fuzzy Logic](https://www.researchgate.net/publication/267041266_Introduction_to_fuzzy_logic)
+- [Defuzzification (Wikipedia)](https://en.wikipedia.org/wiki/Defuzzification)
+- [Defuzzification methods](https://cse.iitkgp.ac.in/~dsamanta/courses/archive/sca/Archives/Chapter%205%20Defuzzification%20Methods.pdf)
+- [Comparison of the COG Defuzzification Technique](https://arxiv.org/pdf/1612.00742.pdf)
+
+${status}
+
+${supportPackages}
+
+${relatedPackages}
+
+${blogPosts}
+
+## Installation
+
+${pkg.install}
+
+${pkg.size}
+
+## Dependencies
+
+${pkg.deps}
+
+${examples}
+
+## API
+
+${docLink}
+
+(See
+[tests](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy/test) for
+more usage examples).
+
+### Fuzzy set generators & combinators
+
+Generators:
+
+- `constant()`
+- `point()`
+- `ramp()` / `invRamp()`
+- `triangle()`
+- `trapezoid()`
+- `sigmoid()` / `invSigmoid()`
+- `gaussian()`
+
+Combinators:
+
+- `negate()`
+- `weighted()`
+- `alphaCut()` / `invAlphaCut()`
+- `compose()` / `intersect()` / `union()`
+
+### Linguistic variables
+
+Linguistic variables (short: **L-var**s) are groupings of named (and possibly
+overlapping) fuzzy sets within a given value domain. The can be used standalone
+or as inputs/outputs in rules (further below).
+
+The
+[@thi.ng/fuzzy-viz](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy-viz)
+package provides utilities to visualize the fuzzy sets of an L-var.
+
+![fuzzy set visualization of the example
+l-var](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/fuzzy/temperature-lvar-2.svg)
+
+```ts
+// temperature sets (in celsius)
+const temp = variable(
+ // value domain
+ [-20, 40],
+ {
+ freezing: invSigmoid(0, 2),
+ cold: trapezoid(-1, 2, 16, 20),
+ warm: trapezoid(15, 20, 30, 34),
+ hot: sigmoid(32, 2)
+ }
+);
+
+evaluate(temp, 18)
+// {
+// freezing: 2.220446049250313e-16,
+// cold: 0.5,
+// warm: 0.6,
+// hot: 6.914400106935423e-13
+// }
+
+evaluate(temp, 28)
+// {
+// freezing: 0,
+// cold: 0,
+// warm: 1,
+// hot: 0.0003353501304664781
+// }
+
+// classify temperature (min confidence 33%, default: 50%)
+classify(temp, 28, 0.33)
+// "warm"
+```
+
+### Rule creation & inferencing
+
+Example taken from Franck Dernoncourt's [Introduction to Fuzzy
+Logic](https://www.researchgate.net/publication/267041266_Introduction_to_fuzzy_logic):
+
+![fuzzy set illustration from F.Dernoncourt's
+tutorial](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/fuzzy/fuzzy-matrix-dernoncourt.png)
+
+```ts
+// define fuzzy input variables
+const inputs = {
+ food: variable([0, 10], {
+ awful: invRamp(1, 3),
+ delicious: ramp(7, 9),
+ }),
+ service: variable([0, 10], {
+ poor: gaussian(0, 1.5),
+ good: gaussian(5, 1.5),
+ excellent: gaussian(10, 1.5),
+ }),
+};
+
+const outputs = {
+ tip: variable([0, 30], {
+ low: triangle(0, 5, 10),
+ medium: triangle(10, 15, 20),
+ high: triangle(20, 25, 30),
+ }),
+};
+
+// l-vars, rules and defuzzification are using generics for type safety
+// we define these 2 type aliases for brevity
+type I = typeof inputs;
+type O = typeof outputs;
+
+// rule definitions:
+// if service is poor OR food is awful -> tip is low
+// if service is normal -> tip is medium
+// if service is excellent OR food is delicious -> tip is high
+const rules = [
+ or({ food: "awful", service: "poor" }, { tip: "low" }),
+ or({ service: "good" }, { tip: "medium" }),
+ or({ food: "delicious", service: "excellent" }, { tip: "high" }),
+];
+
+// defuzzification using default center-of-gravity strategy
+defuzz(
+ inputs,
+ outputs,
+ rules,
+ // input values
+ { food: 7.32, service: 7.83 },
+);
+// { tip: 22.650000000000034 }
+
+// defuzz with custom strategy (note: each has further config options)
+defuzz(
+ inputs,
+ outputs,
+ rules,
+ // input values
+ { food: 7.32, service: 7.83 },
+ // custom defuzz strategy
+ meanOfMaximaStrategy()
+);
+// { tip: 25.050000000000043 }
+```
+
+Note: The results are slightly different than those in the textbook example, due
+to different `gaussian` fuzzy sets used for the `service` L-var.
+
+Using `instrumentStrategy()` from the upcoming
+[@thi.ng/fuzzy-viz](https://github.com/thi-ng/umbrella/tree/develop/packages/fuzzy-viz)
+package, we can also visualize the final, transformed fuzzy sets used to compute
+crisp results and highlight the position of the crisp result value.
+
+Here is the ASCII art output for the [COG
+strategy](https://github.com/thi-ng/umbrella/blob/develop/packages/fuzzy/src/strategy/centroid.ts)
+and using `tnormMin` (the default) to transform each rule's output set(s):
+
+```ts
+// wrap existing strategy
+const strat = instrumentStrategy(centroidStrategy(), fuzzySetToAscii());
+
+// call defuzz as normal
+defuzz(inputs, outputs, rules, strat);
+
+// obtain secondary results via deref()
+console.log(strat.deref()[0]);
+```
+
+```text
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅.....
+.......................................................................▁|██████████████████████▇....
+......................................................................▁█|███████████████████████▇...
+....................................▅▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▅....▂██|████████████████████████▇..
+...................................▅█████████████████████████████▅..▂███|██████████████████████████.
+..................................▅███████████████████████████████▅▂████|███████████████████████████
+ ^ 21.52
+```
+
+Different results can be obtained by adjusting the
+[T-norm](https://en.wikipedia.org/wiki/T-Norm) used to transform each rule's
+output sets, here using `tnormHamacher(2)`.
+
+```text
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|..........................
+.........................................................................|.........▃▂...............
+.........................................................................|.......▃███▆▂.............
+.........................................................................|....▁▅███████▇▃...........
+................................................▁▃▆▃▁....................|.▁▄▇████████████▆▃........
+...........................................▁▂▄▆███████▆▄▂▁..............▂|▇██████████████████▆▃▁....
+...................................▁▂▃▄▅▆▇█████████████████▇▆▅▄▃▂▁..▂▄▆██|███████████████████████▅▃▁
+ ^ 21.84
+```
+
+...or using `tnormAczelAlsina(2)` (there're many more available):
+
+```text
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|...........................
+........................................................................|.....▂▃▄▅▅▅▅▅▄▄▃▁..........
+........................................................................|.▂▅▇██████████████▆▄.......
+........................................................................|▇████████████████████▆▂....
+........................................▁▂▃▄▄▅▅▆▆▆▆▆▆▆▅▅▄▄▃▂▁.........▃█|███████████████████████▆▁..
+....................................▂▄▇███████████████████████▇▄▂....▆██|█████████████████████████▄.
+..................................▃▇█████████████████████████████▇▃▂████|██████████████████████████▇
+ ^ 21.58
+```
+
+Just for illustration purposes (and using a different example), SVG output can
+be obtained by merely switching to another instrumentation function (here
+`fuzzySetToSvg()`):
+
+![fuzzySetToSvg() visualization example](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/fuzzy/strategy-viz.svg)
+
+## Authors
+
+${authors}
+
+${pkg.cite}
+
+## License
+
+© ${copyright} // ${license}
diff --git a/packages/fuzzy/tsconfig.json b/packages/fuzzy/tsconfig.json
new file mode 100644
index 0000000000..bd6481a5a6
--- /dev/null
+++ b/packages/fuzzy/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "."
+ },
+ "include": [
+ "./src/**/*.ts"
+ ]
+}
diff --git a/packages/geom-accel/CHANGELOG.md b/packages/geom-accel/CHANGELOG.md
index f695f3552b..be6c740599 100644
--- a/packages/geom-accel/CHANGELOG.md
+++ b/packages/geom-accel/CHANGELOG.md
@@ -3,79 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [2.1.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@2.1.27...@thi.ng/geom-accel@2.1.28) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-accel
-
-
-
-
-
-## [2.1.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@2.1.26...@thi.ng/geom-accel@2.1.27) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-accel
-
-
-
-
-
-## [2.1.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@2.1.25...@thi.ng/geom-accel@2.1.26) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-accel
-
-
-
-
-
-## [2.1.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@2.1.24...@thi.ng/geom-accel@2.1.25) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-accel
-
-
-
-
-
-## [2.1.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@2.1.23...@thi.ng/geom-accel@2.1.24) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-accel
-
-
-
-
-
-## [2.1.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@2.1.22...@thi.ng/geom-accel@2.1.23) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-accel
-
-
-
-
-
-## [2.1.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@2.1.21...@thi.ng/geom-accel@2.1.22) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-accel
-
-
-
-
-
-## [2.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@2.1.20...@thi.ng/geom-accel@2.1.21) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-accel
-
-
-
-
-
-## [2.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@2.1.19...@thi.ng/geom-accel@2.1.20) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-accel
-
-
-
-
-
-## [2.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@2.1.18...@thi.ng/geom-accel@2.1.19) (2020-08-16)
+## [2.1.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@2.1.28...@thi.ng/geom-accel@2.1.29) (2020-12-22)
**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 1e030da668..af0f8d6393 100644
--- a/packages/geom-accel/package.json
+++ b/packages/geom-accel/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-accel",
- "version": "2.1.28",
+ "version": "2.1.29",
"description": "n-D spatial indexing data structures with a shared ES6 Map/Set-like API",
"module": "./index.js",
"main": "./lib/index.js",
@@ -40,26 +40,26 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/arrays": "^0.8.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/equiv": "^1.0.33",
- "@thi.ng/geom-api": "^1.1.4",
- "@thi.ng/geom-isec": "^0.7.2",
- "@thi.ng/heaps": "^1.2.28",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/transducers": "^7.5.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/arrays": "^0.8.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/equiv": "^1.0.34",
+ "@thi.ng/geom-api": "^2.0.0",
+ "@thi.ng/geom-isec": "^0.7.3",
+ "@thi.ng/heaps": "^1.2.29",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/transducers": "^7.5.3",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-api/CHANGELOG.md b/packages/geom-api/CHANGELOG.md
index 5281aae017..a2f7c579c6 100644
--- a/packages/geom-api/CHANGELOG.md
+++ b/packages/geom-api/CHANGELOG.md
@@ -3,33 +3,19 @@
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/geom-api@1.1.3...@thi.ng/geom-api@1.1.4) (2020-12-07)
+# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@1.1.4...@thi.ng/geom-api@2.0.0) (2020-12-22)
-**Note:** Version bump only for package @thi.ng/geom-api
+### Code Refactoring
+* **geom-api:** fix [#256](https://github.com/thi-ng/umbrella/issues/256) remove Type enum ([e2cd24a](https://github.com/thi-ng/umbrella/commit/e2cd24a7fc24af4c2541cd426e5b03431cc8fe86))
+* **geom-api:** fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace enum w/ type alias ([c079a2a](https://github.com/thi-ng/umbrella/commit/c079a2ac620ef731429501d88580b4baada98ab6))
+### BREAKING CHANGES
-## [1.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@1.1.2...@thi.ng/geom-api@1.1.3) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-api
-
-
-
-
-
-## [1.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@1.1.1...@thi.ng/geom-api@1.1.2) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-api
-
-
-
-
-
-## [1.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@1.1.0...@thi.ng/geom-api@1.1.1) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-api
+* **geom-api:** remove obsolete shape Type enum
+* **geom-api:** replace SegmentType enum w/ type alias
@@ -46,46 +32,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [1.0.34](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@1.0.33...@thi.ng/geom-api@1.0.34) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-api
-
-
-
-
-
-## [1.0.33](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@1.0.32...@thi.ng/geom-api@1.0.33) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-api
-
-
-
-
-
-## [1.0.32](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@1.0.31...@thi.ng/geom-api@1.0.32) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-api
-
-
-
-
-
-## [1.0.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@1.0.30...@thi.ng/geom-api@1.0.31) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-api
-
-
-
-
-
-## [1.0.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@1.0.29...@thi.ng/geom-api@1.0.30) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/geom-api
-
-
-
-
-
# [1.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@0.3.8...@thi.ng/geom-api@1.0.0) (2020-01-24)
### Features
diff --git a/packages/geom-api/README.md b/packages/geom-api/README.md
index 8b54a7fe65..86875e5c83 100644
--- a/packages/geom-api/README.md
+++ b/packages/geom-api/README.md
@@ -41,7 +41,7 @@ yarn add @thi.ng/geom-api
```
-Package sizes (gzipped, pre-treeshake): ESM: 618 bytes / CJS: 643 bytes / UMD: 791 bytes
+Package sizes (gzipped, pre-treeshake): ESM: 287 bytes / CJS: 318 bytes / UMD: 441 bytes
## Dependencies
diff --git a/packages/geom-api/package.json b/packages/geom-api/package.json
index 241086a502..e272196a47 100644
--- a/packages/geom-api/package.json
+++ b/packages/geom-api/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-api",
- "version": "1.1.4",
+ "version": "2.0.0",
"description": "Shared type & interface declarations for @thi.ng/geom packages",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,18 +39,18 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-api/src/path.ts b/packages/geom-api/src/path.ts
index 23e3e64bc9..d8b393cca3 100644
--- a/packages/geom-api/src/path.ts
+++ b/packages/geom-api/src/path.ts
@@ -1,15 +1,14 @@
import type { Vec } from "@thi.ng/vectors";
import type { IShape } from "./shape";
-export enum SegmentType {
- MOVE,
- LINE,
- POLYLINE,
- ARC,
- CUBIC,
- QUADRATIC,
- CLOSE,
-}
+export type SegmentType =
+ | "m" // move
+ | "l" // line
+ | "p" // polyline
+ | "a" // arc
+ | "c" // cubic
+ | "q" // quadratic
+ | "z"; // close
export interface PathSegment {
type: SegmentType;
diff --git a/packages/geom-api/src/shape.ts b/packages/geom-api/src/shape.ts
index fe3a573e6f..b24c3ca102 100644
--- a/packages/geom-api/src/shape.ts
+++ b/packages/geom-api/src/shape.ts
@@ -1,41 +1,6 @@
import type { ICopy, IObjectOf, IToHiccup } from "@thi.ng/api";
import type { Vec } from "@thi.ng/vectors";
-export enum Type {
- AABB = 1,
- ARC,
- CIRCLE,
- CONE,
- CUBIC,
- CUBIC3,
- CYLINDER,
- ELLIPSE,
- GROUP,
- LINE,
- LINE3,
- PATH,
- PLANE,
- POINTS,
- POINTS3,
- POLYGON,
- POLYGON3,
- POLYLINE,
- POLYLINE3,
- QUAD,
- QUAD3,
- QUADRATIC,
- QUADRATIC3,
- RECT,
- SPHERE,
- TRIANGLE,
- TRIANGLE3,
- RAY,
- RAY3,
-
- TEXT,
- TEXT3,
-}
-
export type Attribs = IObjectOf;
export interface IShape extends ICopy {
diff --git a/packages/geom-arc/CHANGELOG.md b/packages/geom-arc/CHANGELOG.md
index 037e313419..5e2f3d4cf6 100644
--- a/packages/geom-arc/CHANGELOG.md
+++ b/packages/geom-arc/CHANGELOG.md
@@ -3,79 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.3.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.3.16...@thi.ng/geom-arc@0.3.17) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-arc
-
-
-
-
-
-## [0.3.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.3.15...@thi.ng/geom-arc@0.3.16) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-arc
-
-
-
-
-
-## [0.3.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.3.14...@thi.ng/geom-arc@0.3.15) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-arc
-
-
-
-
-
-## [0.3.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.3.13...@thi.ng/geom-arc@0.3.14) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-arc
-
-
-
-
-
-## [0.3.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.3.12...@thi.ng/geom-arc@0.3.13) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-arc
-
-
-
-
-
-## [0.3.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.3.11...@thi.ng/geom-arc@0.3.12) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-arc
-
-
-
-
-
-## [0.3.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.3.10...@thi.ng/geom-arc@0.3.11) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-arc
-
-
-
-
-
-## [0.3.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.3.9...@thi.ng/geom-arc@0.3.10) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-arc
-
-
-
-
-
-## [0.3.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.3.8...@thi.ng/geom-arc@0.3.9) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-arc
-
-
-
-
-
-## [0.3.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.3.7...@thi.ng/geom-arc@0.3.8) (2020-08-16)
+## [0.3.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.3.17...@thi.ng/geom-arc@0.3.18) (2020-12-22)
**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 d38371f276..f4542e8b25 100644
--- a/packages/geom-arc/package.json
+++ b/packages/geom-arc/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-arc",
- "version": "0.3.17",
+ "version": "0.3.18",
"description": "2D circular / elliptic arc operations",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,21 +39,21 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/geom-api": "^1.1.4",
- "@thi.ng/geom-resample": "^0.2.50",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/geom-api": "^2.0.0",
+ "@thi.ng/geom-resample": "^0.2.51",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-clip-line/CHANGELOG.md b/packages/geom-clip-line/CHANGELOG.md
index 271a6249ab..e70fcc9615 100644
--- a/packages/geom-clip-line/CHANGELOG.md
+++ b/packages/geom-clip-line/CHANGELOG.md
@@ -3,79 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.2.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-line@1.2.12...@thi.ng/geom-clip-line@1.2.13) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-line
-
-
-
-
-
-## [1.2.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-line@1.2.11...@thi.ng/geom-clip-line@1.2.12) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-line
-
-
-
-
-
-## [1.2.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-line@1.2.10...@thi.ng/geom-clip-line@1.2.11) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-line
-
-
-
-
-
-## [1.2.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-line@1.2.9...@thi.ng/geom-clip-line@1.2.10) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-line
-
-
-
-
-
-## [1.2.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-line@1.2.8...@thi.ng/geom-clip-line@1.2.9) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-line
-
-
-
-
-
-## [1.2.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-line@1.2.7...@thi.ng/geom-clip-line@1.2.8) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-line
-
-
-
-
-
-## [1.2.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-line@1.2.6...@thi.ng/geom-clip-line@1.2.7) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-line
-
-
-
-
-
-## [1.2.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-line@1.2.5...@thi.ng/geom-clip-line@1.2.6) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-line
-
-
-
-
-
-## [1.2.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-line@1.2.4...@thi.ng/geom-clip-line@1.2.5) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-line
-
-
-
-
-
-## [1.2.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-line@1.2.3...@thi.ng/geom-clip-line@1.2.4) (2020-08-16)
+## [1.2.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-line@1.2.13...@thi.ng/geom-clip-line@1.2.14) (2020-12-22)
**Note:** Version bump only for package @thi.ng/geom-clip-line
diff --git a/packages/geom-clip-line/package.json b/packages/geom-clip-line/package.json
index 14e1d006d4..f676de3b9a 100644
--- a/packages/geom-clip-line/package.json
+++ b/packages/geom-clip-line/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-clip-line",
- "version": "1.2.13",
+ "version": "1.2.14",
"description": "2D line clipping (Liang-Barsky)",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,19 +39,19 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/geom-isec": "^0.7.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/geom-isec": "^0.7.3",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-clip-poly/CHANGELOG.md b/packages/geom-clip-poly/CHANGELOG.md
index b485492f4a..cea921ddae 100644
--- a/packages/geom-clip-poly/CHANGELOG.md
+++ b/packages/geom-clip-poly/CHANGELOG.md
@@ -3,79 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.0.38](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-poly@1.0.37...@thi.ng/geom-clip-poly@1.0.38) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-poly
-
-
-
-
-
-## [1.0.37](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-poly@1.0.36...@thi.ng/geom-clip-poly@1.0.37) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-poly
-
-
-
-
-
-## [1.0.36](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-poly@1.0.35...@thi.ng/geom-clip-poly@1.0.36) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-poly
-
-
-
-
-
-## [1.0.35](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-poly@1.0.34...@thi.ng/geom-clip-poly@1.0.35) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-poly
-
-
-
-
-
-## [1.0.34](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-poly@1.0.33...@thi.ng/geom-clip-poly@1.0.34) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-poly
-
-
-
-
-
-## [1.0.33](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-poly@1.0.32...@thi.ng/geom-clip-poly@1.0.33) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-poly
-
-
-
-
-
-## [1.0.32](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-poly@1.0.31...@thi.ng/geom-clip-poly@1.0.32) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-poly
-
-
-
-
-
-## [1.0.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-poly@1.0.30...@thi.ng/geom-clip-poly@1.0.31) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-poly
-
-
-
-
-
-## [1.0.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-poly@1.0.29...@thi.ng/geom-clip-poly@1.0.30) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-clip-poly
-
-
-
-
-
-## [1.0.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-poly@1.0.28...@thi.ng/geom-clip-poly@1.0.29) (2020-08-16)
+## [1.0.39](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip-poly@1.0.38...@thi.ng/geom-clip-poly@1.0.39) (2020-12-22)
**Note:** Version bump only for package @thi.ng/geom-clip-poly
diff --git a/packages/geom-clip-poly/package.json b/packages/geom-clip-poly/package.json
index ed002d3907..0ee98efcff 100644
--- a/packages/geom-clip-poly/package.json
+++ b/packages/geom-clip-poly/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-clip-poly",
- "version": "1.0.38",
+ "version": "1.0.39",
"description": "2D convex polygon clipping (Sutherland-Hodgeman)",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,20 +39,20 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/geom-isec": "^0.7.2",
- "@thi.ng/geom-poly-utils": "^0.2.2",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/geom-isec": "^0.7.3",
+ "@thi.ng/geom-poly-utils": "^0.3.0",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-closest-point/CHANGELOG.md b/packages/geom-closest-point/CHANGELOG.md
index 240c3bce44..6ce44a2cc9 100644
--- a/packages/geom-closest-point/CHANGELOG.md
+++ b/packages/geom-closest-point/CHANGELOG.md
@@ -3,31 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.5.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.5.3...@thi.ng/geom-closest-point@0.5.4) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-closest-point
-
-
-
-
-
-## [0.5.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.5.2...@thi.ng/geom-closest-point@0.5.3) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-closest-point
-
-
-
-
-
-## [0.5.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.5.1...@thi.ng/geom-closest-point@0.5.2) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-closest-point
-
-
-
-
-
-## [0.5.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.5.0...@thi.ng/geom-closest-point@0.5.1) (2020-10-03)
+## [0.5.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.5.4...@thi.ng/geom-closest-point@0.5.5) (2020-12-22)
**Note:** Version bump only for package @thi.ng/geom-closest-point
@@ -67,38 +43,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.3.44](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.3.43...@thi.ng/geom-closest-point@0.3.44) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-closest-point
-
-
-
-
-
-## [0.3.43](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.3.42...@thi.ng/geom-closest-point@0.3.43) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-closest-point
-
-
-
-
-
-## [0.3.42](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.3.41...@thi.ng/geom-closest-point@0.3.42) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-closest-point
-
-
-
-
-
-## [0.3.41](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.3.40...@thi.ng/geom-closest-point@0.3.41) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/geom-closest-point
-
-
-
-
-
# [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.2.3...@thi.ng/geom-closest-point@0.3.0) (2019-07-07)
### Bug Fixes
diff --git a/packages/geom-closest-point/package.json b/packages/geom-closest-point/package.json
index f70ff7e857..e0b7967e87 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.5.4",
+ "version": "0.5.5",
"description": "2D / 3D closest point / proximity helpers",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,19 +39,19 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-fuzz/CHANGELOG.md b/packages/geom-fuzz/CHANGELOG.md
index 8fd0e097ca..75235840f5 100644
--- a/packages/geom-fuzz/CHANGELOG.md
+++ b/packages/geom-fuzz/CHANGELOG.md
@@ -3,87 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.1.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.23...@thi.ng/geom-fuzz@0.1.24) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-fuzz
-
-
-
-
-
-## [0.1.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.22...@thi.ng/geom-fuzz@0.1.23) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-fuzz
-
-
-
-
-
-## [0.1.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.21...@thi.ng/geom-fuzz@0.1.22) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-fuzz
-
-
-
-
-
-## [0.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.20...@thi.ng/geom-fuzz@0.1.21) (2020-10-19)
-
-**Note:** Version bump only for package @thi.ng/geom-fuzz
-
-
-
-
-
-## [0.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.19...@thi.ng/geom-fuzz@0.1.20) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-fuzz
-
-
-
-
-
-## [0.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.18...@thi.ng/geom-fuzz@0.1.19) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-fuzz
-
-
-
-
-
-## [0.1.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.17...@thi.ng/geom-fuzz@0.1.18) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-fuzz
-
-
-
-
-
-## [0.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.16...@thi.ng/geom-fuzz@0.1.17) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-fuzz
-
-
-
-
-
-## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.15...@thi.ng/geom-fuzz@0.1.16) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-fuzz
-
-
-
-
-
-## [0.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.14...@thi.ng/geom-fuzz@0.1.15) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-fuzz
-
-
-
-
-
-## [0.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.13...@thi.ng/geom-fuzz@0.1.14) (2020-08-16)
+## [0.1.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-fuzz@0.1.25...@thi.ng/geom-fuzz@0.1.26) (2020-12-22)
**Note:** Version bump only for package @thi.ng/geom-fuzz
diff --git a/packages/geom-fuzz/package.json b/packages/geom-fuzz/package.json
index 5f812abc0b..aebc09d6ac 100644
--- a/packages/geom-fuzz/package.json
+++ b/packages/geom-fuzz/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-fuzz",
- "version": "0.1.24",
+ "version": "0.1.26",
"description": "Highly configurable, fuzzy line & polygon creation with presets and composable fill & stroke styles. Canvas & SVG support",
"module": "./index.js",
"main": "./lib/index.js",
@@ -38,26 +38,26 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/associative": "^5.0.11",
- "@thi.ng/color": "^1.3.2",
- "@thi.ng/geom": "^1.13.3",
- "@thi.ng/geom-api": "^1.1.4",
- "@thi.ng/geom-clip-line": "^1.2.13",
- "@thi.ng/geom-resample": "^0.2.50",
- "@thi.ng/grid-iterators": "^0.4.15",
- "@thi.ng/transducers": "^7.5.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/associative": "^5.0.12",
+ "@thi.ng/color": "^2.0.0",
+ "@thi.ng/geom": "^2.0.0",
+ "@thi.ng/geom-api": "^2.0.0",
+ "@thi.ng/geom-clip-line": "^1.2.14",
+ "@thi.ng/geom-resample": "^0.2.51",
+ "@thi.ng/grid-iterators": "^0.4.16",
+ "@thi.ng/transducers": "^7.5.3",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-hull/CHANGELOG.md b/packages/geom-hull/CHANGELOG.md
index 953ba72390..37991cfed8 100644
--- a/packages/geom-hull/CHANGELOG.md
+++ b/packages/geom-hull/CHANGELOG.md
@@ -3,71 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.0.70](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.69...@thi.ng/geom-hull@0.0.70) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-hull
-
-
-
-
-
-## [0.0.69](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.68...@thi.ng/geom-hull@0.0.69) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-hull
-
-
-
-
-
-## [0.0.68](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.67...@thi.ng/geom-hull@0.0.68) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-hull
-
-
-
-
-
-## [0.0.67](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.66...@thi.ng/geom-hull@0.0.67) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-hull
-
-
-
-
-
-## [0.0.66](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.65...@thi.ng/geom-hull@0.0.66) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-hull
-
-
-
-
-
-## [0.0.65](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.64...@thi.ng/geom-hull@0.0.65) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-hull
-
-
-
-
-
-## [0.0.64](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.63...@thi.ng/geom-hull@0.0.64) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-hull
-
-
-
-
-
-## [0.0.63](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.62...@thi.ng/geom-hull@0.0.63) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-hull
-
-
-
-
-
-## [0.0.62](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.61...@thi.ng/geom-hull@0.0.62) (2020-08-17)
+## [0.0.71](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.70...@thi.ng/geom-hull@0.0.71) (2020-12-22)
**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 d7936bcf88..7dd112c1f4 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.70",
+ "version": "0.0.71",
"description": "Fast 2D convex hull (Graham Scan)",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,18 +39,18 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-io-obj/CHANGELOG.md b/packages/geom-io-obj/CHANGELOG.md
index 4ecd5aef1f..fb0eaeb81a 100644
--- a/packages/geom-io-obj/CHANGELOG.md
+++ b/packages/geom-io-obj/CHANGELOG.md
@@ -3,79 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.1.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-io-obj@0.1.27...@thi.ng/geom-io-obj@0.1.28) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-io-obj
-
-
-
-
-
-## [0.1.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-io-obj@0.1.26...@thi.ng/geom-io-obj@0.1.27) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-io-obj
-
-
-
-
-
-## [0.1.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-io-obj@0.1.25...@thi.ng/geom-io-obj@0.1.26) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-io-obj
-
-
-
-
-
-## [0.1.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-io-obj@0.1.24...@thi.ng/geom-io-obj@0.1.25) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-io-obj
-
-
-
-
-
-## [0.1.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-io-obj@0.1.23...@thi.ng/geom-io-obj@0.1.24) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-io-obj
-
-
-
-
-
-## [0.1.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-io-obj@0.1.22...@thi.ng/geom-io-obj@0.1.23) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-io-obj
-
-
-
-
-
-## [0.1.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-io-obj@0.1.21...@thi.ng/geom-io-obj@0.1.22) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-io-obj
-
-
-
-
-
-## [0.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-io-obj@0.1.20...@thi.ng/geom-io-obj@0.1.21) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-io-obj
-
-
-
-
-
-## [0.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-io-obj@0.1.19...@thi.ng/geom-io-obj@0.1.20) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-io-obj
-
-
-
-
-
-## [0.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-io-obj@0.1.18...@thi.ng/geom-io-obj@0.1.19) (2020-08-16)
+## [0.1.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-io-obj@0.1.28...@thi.ng/geom-io-obj@0.1.29) (2020-12-22)
**Note:** Version bump only for package @thi.ng/geom-io-obj
diff --git a/packages/geom-io-obj/package.json b/packages/geom-io-obj/package.json
index aeb7693eb5..e829cd54b3 100644
--- a/packages/geom-io-obj/package.json
+++ b/packages/geom-io-obj/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-io-obj",
- "version": "0.1.28",
+ "version": "0.1.29",
"description": "Wavefront OBJ parser (& exporter soon)",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,18 +39,18 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-isec/CHANGELOG.md b/packages/geom-isec/CHANGELOG.md
index a9d62e6267..dc8929ad12 100644
--- a/packages/geom-isec/CHANGELOG.md
+++ b/packages/geom-isec/CHANGELOG.md
@@ -3,15 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.7.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.7.1...@thi.ng/geom-isec@0.7.2) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-isec
-
-
-
-
-
-## [0.7.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.7.0...@thi.ng/geom-isec@0.7.1) (2020-11-26)
+## [0.7.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.7.2...@thi.ng/geom-isec@0.7.3) (2020-12-22)
**Note:** Version bump only for package @thi.ng/geom-isec
@@ -30,14 +22,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.6.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.6.0...@thi.ng/geom-isec@0.6.1) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-isec
-
-
-
-
-
# [0.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.5.8...@thi.ng/geom-isec@0.6.0) (2020-09-22)
@@ -54,46 +38,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.5.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.5.7...@thi.ng/geom-isec@0.5.8) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-isec
-
-
-
-
-
-## [0.5.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.5.6...@thi.ng/geom-isec@0.5.7) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-isec
-
-
-
-
-
-## [0.5.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.5.5...@thi.ng/geom-isec@0.5.6) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-isec
-
-
-
-
-
-## [0.5.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.5.4...@thi.ng/geom-isec@0.5.5) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-isec
-
-
-
-
-
-## [0.5.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.5.3...@thi.ng/geom-isec@0.5.4) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/geom-isec
-
-
-
-
-
# [0.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.4.26...@thi.ng/geom-isec@0.5.0) (2020-07-17)
diff --git a/packages/geom-isec/package.json b/packages/geom-isec/package.json
index 9c3c30410a..76c6a5b77d 100644
--- a/packages/geom-isec/package.json
+++ b/packages/geom-isec/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-isec",
- "version": "0.7.2",
+ "version": "0.7.3",
"description": "2D/3D shape intersection checks",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,21 +39,21 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/geom-api": "^1.1.4",
- "@thi.ng/geom-closest-point": "^0.5.4",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/geom-api": "^2.0.0",
+ "@thi.ng/geom-closest-point": "^0.5.5",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-isoline/CHANGELOG.md b/packages/geom-isoline/CHANGELOG.md
index 999deba80a..a85351578a 100644
--- a/packages/geom-isoline/CHANGELOG.md
+++ b/packages/geom-isoline/CHANGELOG.md
@@ -3,79 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.1.68](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.67...@thi.ng/geom-isoline@0.1.68) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-isoline
-
-
-
-
-
-## [0.1.67](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.66...@thi.ng/geom-isoline@0.1.67) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-isoline
-
-
-
-
-
-## [0.1.66](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.65...@thi.ng/geom-isoline@0.1.66) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-isoline
-
-
-
-
-
-## [0.1.65](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.64...@thi.ng/geom-isoline@0.1.65) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-isoline
-
-
-
-
-
-## [0.1.64](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.63...@thi.ng/geom-isoline@0.1.64) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-isoline
-
-
-
-
-
-## [0.1.63](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.62...@thi.ng/geom-isoline@0.1.63) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-isoline
-
-
-
-
-
-## [0.1.62](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.61...@thi.ng/geom-isoline@0.1.62) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-isoline
-
-
-
-
-
-## [0.1.61](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.60...@thi.ng/geom-isoline@0.1.61) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-isoline
-
-
-
-
-
-## [0.1.60](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.59...@thi.ng/geom-isoline@0.1.60) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-isoline
-
-
-
-
-
-## [0.1.59](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.58...@thi.ng/geom-isoline@0.1.59) (2020-08-16)
+## [0.1.69](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.68...@thi.ng/geom-isoline@0.1.69) (2020-12-22)
**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 5a6191e50c..f868c9a3e3 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.68",
+ "version": "0.1.69",
"description": "Fast 2D contour line extraction / generation",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,19 +39,19 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/transducers": "^7.5.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/transducers": "^7.5.3",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-poly-utils/CHANGELOG.md b/packages/geom-poly-utils/CHANGELOG.md
index 110d3fabba..e8a8563739 100644
--- a/packages/geom-poly-utils/CHANGELOG.md
+++ b/packages/geom-poly-utils/CHANGELOG.md
@@ -3,17 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.2.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.2.1...@thi.ng/geom-poly-utils@0.2.2) (2020-12-07)
+# [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.2.2...@thi.ng/geom-poly-utils@0.3.0) (2020-12-22)
-**Note:** Version bump only for package @thi.ng/geom-poly-utils
+### Features
-
-
-
-## [0.2.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.2.0...@thi.ng/geom-poly-utils@0.2.1) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-poly-utils
+* **geom-poly-utils:** add tangents(), smoothTangents() ([12a9d8a](https://github.com/thi-ng/umbrella/commit/12a9d8a641672f4c3e007a80dd08cfe9b54ce650))
@@ -30,62 +25,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [0.1.66](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.65...@thi.ng/geom-poly-utils@0.1.66) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-poly-utils
-
-
-
-
-
-## [0.1.65](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.64...@thi.ng/geom-poly-utils@0.1.65) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-poly-utils
-
-
-
-
-
-## [0.1.64](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.63...@thi.ng/geom-poly-utils@0.1.64) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-poly-utils
-
-
-
-
-
-## [0.1.63](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.62...@thi.ng/geom-poly-utils@0.1.63) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-poly-utils
-
-
-
-
-
-## [0.1.62](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.61...@thi.ng/geom-poly-utils@0.1.62) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-poly-utils
-
-
-
-
-
-## [0.1.61](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.60...@thi.ng/geom-poly-utils@0.1.61) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-poly-utils
-
-
-
-
-
-## [0.1.60](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.59...@thi.ng/geom-poly-utils@0.1.60) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/geom-poly-utils
-
-
-
-
-
## [0.1.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.17...@thi.ng/geom-poly-utils@0.1.18) (2019-07-07)
### Bug Fixes
diff --git a/packages/geom-poly-utils/README.md b/packages/geom-poly-utils/README.md
index d8376f7095..da893dfba4 100644
--- a/packages/geom-poly-utils/README.md
+++ b/packages/geom-poly-utils/README.md
@@ -19,7 +19,7 @@ This project is part of the
## About
-2D polygon / triangle analysis & processing utilities.
+2D polygon/polyline analysis & processing utilities.
- signed 2D polygon & triangle area
- triangle barycentric coord conversion
@@ -55,7 +55,7 @@ yarn add @thi.ng/geom-poly-utils
```
-Package sizes (gzipped, pre-treeshake): ESM: 1.17 KB / CJS: 1.24 KB / UMD: 1.30 KB
+Package sizes (gzipped, pre-treeshake): ESM: 1.44 KB / CJS: 1.51 KB / UMD: 1.57 KB
## Dependencies
diff --git a/packages/geom-poly-utils/package.json b/packages/geom-poly-utils/package.json
index 1da27d2775..23fd265060 100644
--- a/packages/geom-poly-utils/package.json
+++ b/packages/geom-poly-utils/package.json
@@ -1,7 +1,7 @@
{
"name": "@thi.ng/geom-poly-utils",
- "version": "0.2.2",
- "description": "2D polygon / triangle analysis & processing utilities",
+ "version": "0.3.0",
+ "description": "2D polygon/polyline analysis & processing utilities",
"module": "./index.js",
"main": "./lib/index.js",
"umd:main": "./lib/index.umd.js",
@@ -39,21 +39,21 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/geom-api": "^1.1.4",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/geom-api": "^2.0.0",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-poly-utils/src/index.ts b/packages/geom-poly-utils/src/index.ts
index 69b4fc61a3..0ea9562d8d 100644
--- a/packages/geom-poly-utils/src/index.ts
+++ b/packages/geom-poly-utils/src/index.ts
@@ -7,3 +7,4 @@ export * from "./circumcenter";
export * from "./convexity";
export * from "./equilateral";
export * from "./perimeter";
+export * from "./tangent";
diff --git a/packages/geom-poly-utils/src/tangent.ts b/packages/geom-poly-utils/src/tangent.ts
new file mode 100644
index 0000000000..6bd030ef2c
--- /dev/null
+++ b/packages/geom-poly-utils/src/tangent.ts
@@ -0,0 +1,119 @@
+import { EPS } from "@thi.ng/math";
+import {
+ addmN,
+ direction,
+ mag,
+ mixN,
+ normalize,
+ perpendicularCCW,
+ ReadonlyVec,
+ set,
+ sub,
+ Vec,
+} from "@thi.ng/vectors";
+
+/**
+ * Takes an array of polyline/polygon vertices and computes the tangent
+ * directions for each (point).
+ *
+ * @remarks
+ * Use `close=true` to indicate a polygon and cause the last tangent to be the
+ * direction from last vertex to the first. If `close=false`, the last point's
+ * tangent will be the same as the previous one.
+ *
+ * The optional `scale` arg can be used to scale the tangents (default: 1).
+ *
+ * @param pts
+ * @param close
+ * @param scale
+ */
+export const tangents = (pts: ReadonlyVec[], close = false, scale = 1) => {
+ const n = pts.length - 1;
+ const res: Vec[] = [];
+ for (let i = 1; i <= n; i++) {
+ res.push(direction([], pts[i - 1], pts[i], scale));
+ }
+ res.push(
+ close ? direction([], pts[n], pts[0], scale) : set([], res[n - 1])
+ );
+ return res;
+};
+
+/**
+ * Extended version of {@link tangents}. Takes an array of polyline/polygon
+ * vertices and computes the smoothed tangent directions for each (point).
+ *
+ * @remarks
+ * By default, the tangent direction is proportionally influenced by the length
+ * ratio of a point's previous and current line segments: `currLen / (prevLen +
+ * currLen)`.
+ *
+ * If `proportional` is disabled, the tangents will be the simple mean of the
+ * direction of the prev/curr segments.
+ *
+ * The optional `scale` arg can be used to scale the tangents (default: 1).
+ *
+ * @param pts
+ * @param close
+ * @param proportional
+ * @param scale
+ */
+export const smoothTangents = (
+ pts: ReadonlyVec[],
+ close = false,
+ proportional = true,
+ scale = 1
+) => {
+ const res: Vec[] = [];
+ const n = pts.length - 1;
+ if (n < 1) return res;
+ let prev: Vec | undefined;
+ let plen: number | undefined;
+ if (close) {
+ prev = sub([], pts[0], pts[n]);
+ plen = mag(prev!);
+ normalize(null, prev!);
+ }
+ let t: Vec;
+ for (let i = 0; i <= n; i++) {
+ let curr: Vec;
+ let clen: number;
+ if (i === n) {
+ if (close) {
+ curr = sub([], pts[0], pts[i]);
+ } else {
+ res.push(prev!);
+ return res;
+ }
+ } else {
+ curr = sub([], pts[i + 1], pts[i]);
+ }
+ clen = mag(curr);
+ normalize(null, curr);
+ if (i > 0 || close) {
+ t = proportional
+ ? mixN(
+ [],
+ prev!,
+ curr,
+ Math.min(1, clen / (clen + plen! + EPS))
+ )
+ : addmN([], prev!, curr, 0.5);
+ } else {
+ t = set([], curr);
+ }
+ res.push(normalize(null, t, scale));
+ prev = curr;
+ plen = clen;
+ }
+ return res;
+};
+
+/**
+ * Transforms an array of 2d tangent vectors into a new array with each tangent
+ * rotated 90 degrees counter-clockwise.
+ *
+ * @param tangents
+ */
+export const bitangents2 = (tangents: ReadonlyVec[]) =>
+ tangents.map((t) => perpendicularCCW([], t));
diff --git a/packages/geom-resample/CHANGELOG.md b/packages/geom-resample/CHANGELOG.md
index a9d576b2e3..e6643ca89c 100644
--- a/packages/geom-resample/CHANGELOG.md
+++ b/packages/geom-resample/CHANGELOG.md
@@ -3,79 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.2.50](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.49...@thi.ng/geom-resample@0.2.50) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-resample
-
-
-
-
-
-## [0.2.49](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.48...@thi.ng/geom-resample@0.2.49) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-resample
-
-
-
-
-
-## [0.2.48](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.47...@thi.ng/geom-resample@0.2.48) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-resample
-
-
-
-
-
-## [0.2.47](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.46...@thi.ng/geom-resample@0.2.47) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-resample
-
-
-
-
-
-## [0.2.46](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.45...@thi.ng/geom-resample@0.2.46) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-resample
-
-
-
-
-
-## [0.2.45](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.44...@thi.ng/geom-resample@0.2.45) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-resample
-
-
-
-
-
-## [0.2.44](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.43...@thi.ng/geom-resample@0.2.44) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-resample
-
-
-
-
-
-## [0.2.43](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.42...@thi.ng/geom-resample@0.2.43) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-resample
-
-
-
-
-
-## [0.2.42](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.41...@thi.ng/geom-resample@0.2.42) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-resample
-
-
-
-
-
-## [0.2.41](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.40...@thi.ng/geom-resample@0.2.41) (2020-08-16)
+## [0.2.51](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.50...@thi.ng/geom-resample@0.2.51) (2020-12-22)
**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 8d9cbec1f3..1bf3dcb3e7 100644
--- a/packages/geom-resample/package.json
+++ b/packages/geom-resample/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-resample",
- "version": "0.2.50",
+ "version": "0.2.51",
"description": "Customizable nD polyline interpolation, re-sampling, splitting & nearest point computation",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,21 +39,21 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/geom-api": "^1.1.4",
- "@thi.ng/geom-closest-point": "^0.5.4",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/geom-api": "^2.0.0",
+ "@thi.ng/geom-closest-point": "^0.5.5",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-splines/CHANGELOG.md b/packages/geom-splines/CHANGELOG.md
index 42fb017061..350b933e19 100644
--- a/packages/geom-splines/CHANGELOG.md
+++ b/packages/geom-splines/CHANGELOG.md
@@ -3,79 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.5.37](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.36...@thi.ng/geom-splines@0.5.37) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-splines
-
-
-
-
-
-## [0.5.36](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.35...@thi.ng/geom-splines@0.5.36) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-splines
-
-
-
-
-
-## [0.5.35](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.34...@thi.ng/geom-splines@0.5.35) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-splines
-
-
-
-
-
-## [0.5.34](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.33...@thi.ng/geom-splines@0.5.34) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-splines
-
-
-
-
-
-## [0.5.33](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.32...@thi.ng/geom-splines@0.5.33) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-splines
-
-
-
-
-
-## [0.5.32](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.31...@thi.ng/geom-splines@0.5.32) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-splines
-
-
-
-
-
-## [0.5.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.30...@thi.ng/geom-splines@0.5.31) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-splines
-
-
-
-
-
-## [0.5.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.29...@thi.ng/geom-splines@0.5.30) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-splines
-
-
-
-
-
-## [0.5.29](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.28...@thi.ng/geom-splines@0.5.29) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-splines
-
-
-
-
-
-## [0.5.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.27...@thi.ng/geom-splines@0.5.28) (2020-08-16)
+## [0.5.38](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.37...@thi.ng/geom-splines@0.5.38) (2020-12-22)
**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 932275da91..b5aafab5cc 100644
--- a/packages/geom-splines/package.json
+++ b/packages/geom-splines/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-splines",
- "version": "0.5.37",
+ "version": "0.5.38",
"description": "nD cubic & quadratic curve analysis, conversion, interpolation, splitting",
"module": "./index.js",
"main": "./lib/index.js",
@@ -31,7 +31,7 @@
"build:check": "tsc --isolatedModules --noEmit",
"test": "mocha test",
"cover": "nyc mocha test && nyc report --reporter=lcov",
- "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib",
+ "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib internal",
"doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
"doc": "node_modules/.bin/typedoc --mode modules --out doc --theme ../../tools/doc/typedoc-theme src",
"doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
@@ -39,23 +39,23 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/geom-api": "^1.1.4",
- "@thi.ng/geom-arc": "^0.3.17",
- "@thi.ng/geom-resample": "^0.2.50",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/geom-api": "^2.0.0",
+ "@thi.ng/geom-arc": "^0.3.18",
+ "@thi.ng/geom-resample": "^0.2.51",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-subdiv-curve/CHANGELOG.md b/packages/geom-subdiv-curve/CHANGELOG.md
index 4a1251a00d..476e5cfc4a 100644
--- a/packages/geom-subdiv-curve/CHANGELOG.md
+++ b/packages/geom-subdiv-curve/CHANGELOG.md
@@ -3,79 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.1.67](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.66...@thi.ng/geom-subdiv-curve@0.1.67) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-subdiv-curve
-
-
-
-
-
-## [0.1.66](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.65...@thi.ng/geom-subdiv-curve@0.1.66) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-subdiv-curve
-
-
-
-
-
-## [0.1.65](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.64...@thi.ng/geom-subdiv-curve@0.1.65) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-subdiv-curve
-
-
-
-
-
-## [0.1.64](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.63...@thi.ng/geom-subdiv-curve@0.1.64) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-subdiv-curve
-
-
-
-
-
-## [0.1.63](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.62...@thi.ng/geom-subdiv-curve@0.1.63) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-subdiv-curve
-
-
-
-
-
-## [0.1.62](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.61...@thi.ng/geom-subdiv-curve@0.1.62) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-subdiv-curve
-
-
-
-
-
-## [0.1.61](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.60...@thi.ng/geom-subdiv-curve@0.1.61) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-subdiv-curve
-
-
-
-
-
-## [0.1.60](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.59...@thi.ng/geom-subdiv-curve@0.1.60) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-subdiv-curve
-
-
-
-
-
-## [0.1.59](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.58...@thi.ng/geom-subdiv-curve@0.1.59) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-subdiv-curve
-
-
-
-
-
-## [0.1.58](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.57...@thi.ng/geom-subdiv-curve@0.1.58) (2020-08-16)
+## [0.1.69](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.68...@thi.ng/geom-subdiv-curve@0.1.69) (2020-12-22)
**Note:** Version bump only for package @thi.ng/geom-subdiv-curve
diff --git a/packages/geom-subdiv-curve/README.md b/packages/geom-subdiv-curve/README.md
index d40b62bd27..f005c4aaec 100644
--- a/packages/geom-subdiv-curve/README.md
+++ b/packages/geom-subdiv-curve/README.md
@@ -62,6 +62,7 @@ Package sizes (gzipped, pre-treeshake): ESM: 658 bytes / CJS: 736 bytes / UMD: 7
## Dependencies
+- [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api)
- [@thi.ng/geom-api](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-api)
- [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/develop/packages/transducers)
- [@thi.ng/vectors](https://github.com/thi-ng/umbrella/tree/develop/packages/vectors)
diff --git a/packages/geom-subdiv-curve/package.json b/packages/geom-subdiv-curve/package.json
index dbbfd056e5..bd6b1927e0 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.67",
+ "version": "0.1.69",
"description": "Freely customizable, iterative nD subdivision curves for open / closed geometries",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,19 +39,20 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/geom-api": "^1.1.4",
- "@thi.ng/transducers": "^7.5.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/geom-api": "^2.0.0",
+ "@thi.ng/transducers": "^7.5.3",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-tessellate/CHANGELOG.md b/packages/geom-tessellate/CHANGELOG.md
index 314c597af6..d0ed1ce034 100644
--- a/packages/geom-tessellate/CHANGELOG.md
+++ b/packages/geom-tessellate/CHANGELOG.md
@@ -3,79 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.2.51](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.50...@thi.ng/geom-tessellate@0.2.51) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-tessellate
-
-
-
-
-
-## [0.2.50](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.49...@thi.ng/geom-tessellate@0.2.50) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-tessellate
-
-
-
-
-
-## [0.2.49](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.48...@thi.ng/geom-tessellate@0.2.49) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-tessellate
-
-
-
-
-
-## [0.2.48](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.47...@thi.ng/geom-tessellate@0.2.48) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-tessellate
-
-
-
-
-
-## [0.2.47](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.46...@thi.ng/geom-tessellate@0.2.47) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-tessellate
-
-
-
-
-
-## [0.2.46](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.45...@thi.ng/geom-tessellate@0.2.46) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-tessellate
-
-
-
-
-
-## [0.2.45](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.44...@thi.ng/geom-tessellate@0.2.45) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-tessellate
-
-
-
-
-
-## [0.2.44](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.43...@thi.ng/geom-tessellate@0.2.44) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-tessellate
-
-
-
-
-
-## [0.2.43](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.42...@thi.ng/geom-tessellate@0.2.43) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-tessellate
-
-
-
-
-
-## [0.2.42](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.41...@thi.ng/geom-tessellate@0.2.42) (2020-08-16)
+## [0.2.52](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.51...@thi.ng/geom-tessellate@0.2.52) (2020-12-22)
**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 0de128436c..c09806779b 100644
--- a/packages/geom-tessellate/package.json
+++ b/packages/geom-tessellate/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-tessellate",
- "version": "0.2.51",
+ "version": "0.2.52",
"description": "2D/3D convex polygon tessellators",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,22 +39,22 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/geom-api": "^1.1.4",
- "@thi.ng/geom-isec": "^0.7.2",
- "@thi.ng/geom-poly-utils": "^0.2.2",
- "@thi.ng/transducers": "^7.5.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/geom-api": "^2.0.0",
+ "@thi.ng/geom-isec": "^0.7.3",
+ "@thi.ng/geom-poly-utils": "^0.3.0",
+ "@thi.ng/transducers": "^7.5.3",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom-voronoi/CHANGELOG.md b/packages/geom-voronoi/CHANGELOG.md
index 58fd8662ba..0eb5b8aa84 100644
--- a/packages/geom-voronoi/CHANGELOG.md
+++ b/packages/geom-voronoi/CHANGELOG.md
@@ -3,79 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [0.2.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.2.12...@thi.ng/geom-voronoi@0.2.13) (2020-12-07)
-
-**Note:** Version bump only for package @thi.ng/geom-voronoi
-
-
-
-
-
-## [0.2.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.2.11...@thi.ng/geom-voronoi@0.2.12) (2020-11-26)
-
-**Note:** Version bump only for package @thi.ng/geom-voronoi
-
-
-
-
-
-## [0.2.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.2.10...@thi.ng/geom-voronoi@0.2.11) (2020-11-24)
-
-**Note:** Version bump only for package @thi.ng/geom-voronoi
-
-
-
-
-
-## [0.2.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.2.9...@thi.ng/geom-voronoi@0.2.10) (2020-10-03)
-
-**Note:** Version bump only for package @thi.ng/geom-voronoi
-
-
-
-
-
-## [0.2.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.2.8...@thi.ng/geom-voronoi@0.2.9) (2020-09-22)
-
-**Note:** Version bump only for package @thi.ng/geom-voronoi
-
-
-
-
-
-## [0.2.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.2.7...@thi.ng/geom-voronoi@0.2.8) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom-voronoi
-
-
-
-
-
-## [0.2.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.2.6...@thi.ng/geom-voronoi@0.2.7) (2020-08-28)
-
-**Note:** Version bump only for package @thi.ng/geom-voronoi
-
-
-
-
-
-## [0.2.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.2.5...@thi.ng/geom-voronoi@0.2.6) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom-voronoi
-
-
-
-
-
-## [0.2.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.2.4...@thi.ng/geom-voronoi@0.2.5) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom-voronoi
-
-
-
-
-
-## [0.2.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.2.3...@thi.ng/geom-voronoi@0.2.4) (2020-08-16)
+## [0.2.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.2.13...@thi.ng/geom-voronoi@0.2.14) (2020-12-22)
**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 0888119db0..b6dcbf4baa 100644
--- a/packages/geom-voronoi/package.json
+++ b/packages/geom-voronoi/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom-voronoi",
- "version": "0.2.13",
+ "version": "0.2.14",
"description": "Fast, incremental 2D Delaunay & Voronoi mesh implementation",
"module": "./index.js",
"main": "./lib/index.js",
@@ -39,25 +39,25 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/geom-clip-line": "^1.2.13",
- "@thi.ng/geom-clip-poly": "^1.0.38",
- "@thi.ng/geom-isec": "^0.7.2",
- "@thi.ng/geom-poly-utils": "^0.2.2",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/quad-edge": "^0.2.26",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/geom-clip-line": "^1.2.14",
+ "@thi.ng/geom-clip-poly": "^1.0.39",
+ "@thi.ng/geom-isec": "^0.7.3",
+ "@thi.ng/geom-poly-utils": "^0.3.0",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/quad-edge": "^0.2.27",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom/CHANGELOG.md b/packages/geom/CHANGELOG.md
index 7881558ead..1894c2e6ff 100644
--- a/packages/geom/CHANGELOG.md
+++ b/packages/geom/CHANGELOG.md
@@ -3,17 +3,27 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-## [1.13.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.13.2...@thi.ng/geom@1.13.3) (2020-12-07)
+# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.13.4...@thi.ng/geom@2.0.0) (2020-12-22)
-**Note:** Version bump only for package @thi.ng/geom
+### Bug Fixes
+
+* **geom:** fix [#268](https://github.com/thi-ng/umbrella/issues/268) add Group.copyTransformed() ([2da6c63](https://github.com/thi-ng/umbrella/commit/2da6c63b5a2dbc45bc1272eaf592d3d74d8ce74e))
+
+
+### Code Refactoring
+* **geom:** fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace enum w/ type alias ([67988ad](https://github.com/thi-ng/umbrella/commit/67988ad31f478b28de85e40d8ab7c51501ef4acb))
+* **geom:** fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace Type enum w/ alias ([ef7ba74](https://github.com/thi-ng/umbrella/commit/ef7ba74c189755d760d84c700b0c970a281a3b04))
+### BREAKING CHANGES
-## [1.13.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.13.1...@thi.ng/geom@1.13.2) (2020-11-26)
+* **geom:** replace Type enum returned by IShape.type w/ string consts
-**Note:** Version bump only for package @thi.ng/geom
+- update all shape classes
+- update all ops/multimethod dispatches
+* **geom:** replace SegmentType w/ type alias
@@ -58,14 +68,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [1.11.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.11.7...@thi.ng/geom@1.11.8) (2020-09-13)
-
-**Note:** Version bump only for package @thi.ng/geom
-
-
-
-
-
## [1.11.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.11.6...@thi.ng/geom@1.11.7) (2020-08-28)
@@ -77,30 +79,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
-## [1.11.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.11.5...@thi.ng/geom@1.11.6) (2020-08-20)
-
-**Note:** Version bump only for package @thi.ng/geom
-
-
-
-
-
-## [1.11.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.11.4...@thi.ng/geom@1.11.5) (2020-08-17)
-
-**Note:** Version bump only for package @thi.ng/geom
-
-
-
-
-
-## [1.11.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.11.3...@thi.ng/geom@1.11.4) (2020-08-16)
-
-**Note:** Version bump only for package @thi.ng/geom
-
-
-
-
-
# [1.11.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.10.7...@thi.ng/geom@1.11.0) (2020-07-17)
diff --git a/packages/geom/README.md b/packages/geom/README.md
index 2066982aa2..554e0b5023 100644
--- a/packages/geom/README.md
+++ b/packages/geom/README.md
@@ -48,7 +48,7 @@ themselves too):
- [@thi.ng/geom-io-obj](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-io-obj) - Wavefront OBJ parser (& exporter soon)
- [@thi.ng/geom-isec](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-isec) - 2D/3D shape intersection checks
- [@thi.ng/geom-isoline](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-isoline) - Fast 2D contour line extraction / generation
-- [@thi.ng/geom-poly-utils](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-poly-utils) - 2D polygon / triangle analysis & processing utilities
+- [@thi.ng/geom-poly-utils](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-poly-utils) - 2D polygon/polyline analysis & processing utilities
- [@thi.ng/geom-resample](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-resample) - Customizable nD polyline interpolation, re-sampling, splitting & nearest point computation
- [@thi.ng/geom-splines](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-splines) - nD cubic & quadratic curve analysis, conversion, interpolation, splitting
- [@thi.ng/geom-subdiv-curve](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-subdiv-curve) - Freely customizable, iterative nD subdivision curves for open / closed geometries
@@ -75,7 +75,7 @@ yarn add @thi.ng/geom
```
-Package sizes (gzipped, pre-treeshake): ESM: 10.49 KB / CJS: 10.82 KB / UMD: 10.16 KB
+Package sizes (gzipped, pre-treeshake): ESM: 10.27 KB / CJS: 10.50 KB / UMD: 9.93 KB
## Dependencies
diff --git a/packages/geom/package.json b/packages/geom/package.json
index 4b02f6d9ac..cd5d1c6419 100644
--- a/packages/geom/package.json
+++ b/packages/geom/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/geom",
- "version": "1.13.3",
+ "version": "2.0.0",
"description": "Functional, polymorphic API for 2D geometry types & SVG generation",
"module": "./index.js",
"main": "./lib/index.js",
@@ -31,7 +31,7 @@
"build:check": "tsc --isolatedModules --noEmit",
"test": "mocha test",
"cover": "nyc mocha test && nyc report --reporter=lcov",
- "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib ctors internal ops",
+ "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib api ctors internal ops",
"doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
"doc": "node_modules/.bin/typedoc --mode modules --out doc --theme ../../tools/doc/typedoc-theme src",
"doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
@@ -39,42 +39,42 @@
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
- "@microsoft/api-extractor": "^7.12.0",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.6.1",
+ "@microsoft/api-extractor": "^7.12.1",
+ "@types/mocha": "^8.2.0",
+ "@types/node": "^14.14.14",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
- "ts-node": "^9.0.0",
+ "ts-node": "^9.1.1",
"typedoc": "^0.19.2",
- "typescript": "^4.1.2"
+ "typescript": "^4.1.3"
},
"dependencies": {
- "@thi.ng/api": "^6.13.4",
- "@thi.ng/arrays": "^0.8.4",
- "@thi.ng/checks": "^2.7.11",
- "@thi.ng/defmulti": "^1.3.2",
- "@thi.ng/equiv": "^1.0.33",
- "@thi.ng/errors": "^1.2.24",
- "@thi.ng/geom-api": "^1.1.4",
- "@thi.ng/geom-arc": "^0.3.17",
- "@thi.ng/geom-clip-line": "^1.2.13",
- "@thi.ng/geom-clip-poly": "^1.0.38",
- "@thi.ng/geom-closest-point": "^0.5.4",
- "@thi.ng/geom-hull": "^0.0.70",
- "@thi.ng/geom-isec": "^0.7.2",
- "@thi.ng/geom-poly-utils": "^0.2.2",
- "@thi.ng/geom-resample": "^0.2.50",
- "@thi.ng/geom-splines": "^0.5.37",
- "@thi.ng/geom-subdiv-curve": "^0.1.67",
- "@thi.ng/geom-tessellate": "^0.2.51",
- "@thi.ng/hiccup": "^3.6.4",
- "@thi.ng/hiccup-svg": "^3.6.5",
- "@thi.ng/math": "^2.2.2",
- "@thi.ng/matrices": "^0.6.37",
- "@thi.ng/random": "^2.1.2",
- "@thi.ng/strings": "^1.11.2",
- "@thi.ng/transducers": "^7.5.2",
- "@thi.ng/vectors": "^4.8.2"
+ "@thi.ng/api": "^6.13.5",
+ "@thi.ng/arrays": "^0.8.5",
+ "@thi.ng/checks": "^2.7.12",
+ "@thi.ng/defmulti": "^1.3.3",
+ "@thi.ng/equiv": "^1.0.34",
+ "@thi.ng/errors": "^1.2.25",
+ "@thi.ng/geom-api": "^2.0.0",
+ "@thi.ng/geom-arc": "^0.3.18",
+ "@thi.ng/geom-clip-line": "^1.2.14",
+ "@thi.ng/geom-clip-poly": "^1.0.39",
+ "@thi.ng/geom-closest-point": "^0.5.5",
+ "@thi.ng/geom-hull": "^0.0.71",
+ "@thi.ng/geom-isec": "^0.7.3",
+ "@thi.ng/geom-poly-utils": "^0.3.0",
+ "@thi.ng/geom-resample": "^0.2.51",
+ "@thi.ng/geom-splines": "^0.5.38",
+ "@thi.ng/geom-subdiv-curve": "^0.1.69",
+ "@thi.ng/geom-tessellate": "^0.2.52",
+ "@thi.ng/hiccup": "^3.6.5",
+ "@thi.ng/hiccup-svg": "^3.6.6",
+ "@thi.ng/math": "^3.0.0",
+ "@thi.ng/matrices": "^0.6.38",
+ "@thi.ng/random": "^2.1.3",
+ "@thi.ng/strings": "^1.11.3",
+ "@thi.ng/transducers": "^7.5.3",
+ "@thi.ng/vectors": "^4.8.3"
},
"files": [
"*.js",
diff --git a/packages/geom/src/api/aabb.ts b/packages/geom/src/api/aabb.ts
index 50bf93512a..cd28b30443 100644
--- a/packages/geom/src/api/aabb.ts
+++ b/packages/geom/src/api/aabb.ts
@@ -1,5 +1,5 @@
import { isNumber } from "@thi.ng/checks";
-import { AABBLike, Attribs, Type } from "@thi.ng/geom-api";
+import type { AABBLike, Attribs } from "@thi.ng/geom-api";
import { add3, set, Vec } from "@thi.ng/vectors";
import { copyAttribs } from "../internal/copy-attribs";
@@ -15,7 +15,7 @@ export class AABB implements AABBLike {
}
get type() {
- return Type.AABB;
+ return "aabb";
}
copy(): AABB {
diff --git a/packages/geom/src/api/arc.ts b/packages/geom/src/api/arc.ts
index 2c00d686c0..9769203791 100644
--- a/packages/geom/src/api/arc.ts
+++ b/packages/geom/src/api/arc.ts
@@ -1,9 +1,8 @@
import { equiv } from "@thi.ng/equiv";
-import {
+import type {
Attribs,
IHiccupPathSegment,
IHiccupShape,
- Type,
} from "@thi.ng/geom-api";
import {
pointAt as arcPointAt,
@@ -25,7 +24,7 @@ export class Arc implements IHiccupShape, IHiccupPathSegment {
) {}
get type() {
- return Type.ARC;
+ return "arc";
}
copy(): Arc {
diff --git a/packages/geom/src/api/circle.ts b/packages/geom/src/api/circle.ts
index bbc803d3cf..db5020ded4 100644
--- a/packages/geom/src/api/circle.ts
+++ b/packages/geom/src/api/circle.ts
@@ -1,4 +1,4 @@
-import { Attribs, IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { Attribs, IHiccupShape } from "@thi.ng/geom-api";
import { set, Vec } from "@thi.ng/vectors";
import { copyAttribs } from "../internal/copy-attribs";
@@ -10,7 +10,7 @@ export class Circle implements IHiccupShape {
) {}
get type() {
- return Type.CIRCLE;
+ return "circle";
}
copy(): Circle {
diff --git a/packages/geom/src/api/cubic.ts b/packages/geom/src/api/cubic.ts
index a3844efece..1a53f2740b 100644
--- a/packages/geom/src/api/cubic.ts
+++ b/packages/geom/src/api/cubic.ts
@@ -1,10 +1,10 @@
-import { IHiccupPathSegment, Type } from "@thi.ng/geom-api";
+import type { IHiccupPathSegment } from "@thi.ng/geom-api";
import { copyShape } from "../internal/copy-shape";
import { APC } from "./apc";
export class Cubic extends APC implements IHiccupPathSegment {
get type() {
- return Type.CUBIC;
+ return "cubic";
}
copy(): Cubic {
diff --git a/packages/geom/src/api/ellipse.ts b/packages/geom/src/api/ellipse.ts
index 56255d1757..00a43e7ad0 100644
--- a/packages/geom/src/api/ellipse.ts
+++ b/packages/geom/src/api/ellipse.ts
@@ -1,5 +1,5 @@
import { isNumber } from "@thi.ng/checks";
-import { Attribs, IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { Attribs, IHiccupShape } from "@thi.ng/geom-api";
import { set, Vec } from "@thi.ng/vectors";
import { copyAttribs } from "../internal/copy-attribs";
@@ -15,7 +15,7 @@ export class Ellipse implements IHiccupShape {
}
get type() {
- return Type.ELLIPSE;
+ return "ellipse";
}
copy(): Ellipse {
diff --git a/packages/geom/src/api/group.ts b/packages/geom/src/api/group.ts
index 59cc9ef3d1..1ccb532f0d 100644
--- a/packages/geom/src/api/group.ts
+++ b/packages/geom/src/api/group.ts
@@ -1,5 +1,6 @@
+import type { Fn } from "@thi.ng/api";
import { equiv } from "@thi.ng/equiv";
-import { Attribs, IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { Attribs, IHiccupShape } from "@thi.ng/geom-api";
import { copyAttribs } from "../internal/copy-attribs";
export class Group implements IHiccupShape {
@@ -9,7 +10,7 @@ export class Group implements IHiccupShape {
) {}
get type() {
- return Type.GROUP;
+ return "group";
}
*[Symbol.iterator]() {
@@ -17,10 +18,11 @@ export class Group implements IHiccupShape {
}
copy(): Group {
- return new Group(
- copyAttribs(this),
- this.children.map((c) => c.copy())
- );
+ return this.copyTransformed((c) => c.copy());
+ }
+
+ copyTransformed(fn: Fn) {
+ return new Group(copyAttribs(this), this.children.map(fn));
}
equiv(o: any) {
diff --git a/packages/geom/src/api/line.ts b/packages/geom/src/api/line.ts
index 8439f25376..c48bcb4302 100644
--- a/packages/geom/src/api/line.ts
+++ b/packages/geom/src/api/line.ts
@@ -1,10 +1,10 @@
-import { IHiccupPathSegment, IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { IHiccupPathSegment, IHiccupShape } from "@thi.ng/geom-api";
import { copyShape } from "../internal/copy-shape";
import { APC } from "./apc";
export class Line extends APC implements IHiccupShape, IHiccupPathSegment {
get type() {
- return Type.LINE;
+ return "line";
}
copy(): Line {
diff --git a/packages/geom/src/api/path.ts b/packages/geom/src/api/path.ts
index 9e8a03199d..e987afb0da 100644
--- a/packages/geom/src/api/path.ts
+++ b/packages/geom/src/api/path.ts
@@ -1,8 +1,8 @@
import { equiv } from "@thi.ng/equiv";
import { illegalState } from "@thi.ng/errors";
-import { Attribs, IHiccupShape, PathSegment, Type } from "@thi.ng/geom-api";
-import { copyAttribs } from "../internal/copy-attribs";
+import type { Attribs, IHiccupShape, PathSegment } from "@thi.ng/geom-api";
import { copy } from "@thi.ng/vectors";
+import { copyAttribs } from "../internal/copy-attribs";
export class Path implements IHiccupShape {
closed = false;
@@ -13,7 +13,7 @@ export class Path implements IHiccupShape {
) {}
get type() {
- return Type.PATH;
+ return "path";
}
*[Symbol.iterator]() {
diff --git a/packages/geom/src/api/plane.ts b/packages/geom/src/api/plane.ts
index e2b2cd9f89..7225caf488 100644
--- a/packages/geom/src/api/plane.ts
+++ b/packages/geom/src/api/plane.ts
@@ -1,4 +1,4 @@
-import { Attribs, IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { Attribs, IHiccupShape } from "@thi.ng/geom-api";
import { set, Vec } from "@thi.ng/vectors";
import { copyAttribs } from "../internal/copy-attribs";
@@ -10,7 +10,7 @@ export class Plane implements IHiccupShape {
) {}
get type() {
- return Type.PLANE;
+ return "plane";
}
copy(): Plane {
diff --git a/packages/geom/src/api/points.ts b/packages/geom/src/api/points.ts
index f576e23ebb..7b21928915 100644
--- a/packages/geom/src/api/points.ts
+++ b/packages/geom/src/api/points.ts
@@ -1,10 +1,10 @@
-import { IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { IHiccupShape } from "@thi.ng/geom-api";
import { copyShape } from "../internal/copy-shape";
import { APC } from "./apc";
export class Points extends APC implements IHiccupShape {
get type() {
- return Type.POINTS;
+ return "points";
}
copy(): Points {
@@ -18,7 +18,7 @@ export class Points extends APC implements IHiccupShape {
export class Points3 extends APC implements IHiccupShape {
get type() {
- return Type.POINTS3;
+ return "points3";
}
copy(): Points3 {
diff --git a/packages/geom/src/api/polygon.ts b/packages/geom/src/api/polygon.ts
index bb91585e70..5f55351d5c 100644
--- a/packages/geom/src/api/polygon.ts
+++ b/packages/geom/src/api/polygon.ts
@@ -1,10 +1,10 @@
-import { IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { IHiccupShape } from "@thi.ng/geom-api";
import { copyShape } from "../internal/copy-shape";
import { APC } from "./apc";
export class Polygon extends APC implements IHiccupShape {
get type() {
- return Type.POLYGON;
+ return "poly";
}
copy(): Polygon {
diff --git a/packages/geom/src/api/polyline.ts b/packages/geom/src/api/polyline.ts
index 3a46211222..c0cdd39c55 100644
--- a/packages/geom/src/api/polyline.ts
+++ b/packages/geom/src/api/polyline.ts
@@ -1,10 +1,10 @@
-import { IHiccupPathSegment, IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { IHiccupPathSegment, IHiccupShape } from "@thi.ng/geom-api";
import { copyShape } from "../internal/copy-shape";
import { APC } from "./apc";
export class Polyline extends APC implements IHiccupShape, IHiccupPathSegment {
get type() {
- return Type.POLYLINE;
+ return "polyline";
}
copy(): Polyline {
diff --git a/packages/geom/src/api/quad.ts b/packages/geom/src/api/quad.ts
index d5718ec713..cd0de4b7b5 100644
--- a/packages/geom/src/api/quad.ts
+++ b/packages/geom/src/api/quad.ts
@@ -1,10 +1,10 @@
-import { IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { IHiccupShape } from "@thi.ng/geom-api";
import { copyShape } from "../internal/copy-shape";
import { APC } from "./apc";
export class Quad extends APC implements IHiccupShape {
get type() {
- return Type.QUAD;
+ return "quad";
}
copy(): Quad {
diff --git a/packages/geom/src/api/quad3.ts b/packages/geom/src/api/quad3.ts
index 704bf86522..893b6db869 100644
--- a/packages/geom/src/api/quad3.ts
+++ b/packages/geom/src/api/quad3.ts
@@ -1,10 +1,10 @@
-import { IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { IHiccupShape } from "@thi.ng/geom-api";
import { copyShape } from "../internal/copy-shape";
import { APC } from "./apc";
export class Quad3 extends APC implements IHiccupShape {
get type() {
- return Type.QUAD3;
+ return "quad3";
}
copy(): Quad3 {
diff --git a/packages/geom/src/api/quadratic.ts b/packages/geom/src/api/quadratic.ts
index f3c5f63e2b..7011d0a177 100644
--- a/packages/geom/src/api/quadratic.ts
+++ b/packages/geom/src/api/quadratic.ts
@@ -1,10 +1,10 @@
-import { IHiccupPathSegment, IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { IHiccupPathSegment, IHiccupShape } from "@thi.ng/geom-api";
import { copyShape } from "../internal/copy-shape";
import { APC } from "./apc";
export class Quadratic extends APC implements IHiccupShape, IHiccupPathSegment {
get type() {
- return Type.QUADRATIC;
+ return "quadratic";
}
copy(): Quadratic {
diff --git a/packages/geom/src/api/ray.ts b/packages/geom/src/api/ray.ts
index 594f070e58..816db788b5 100644
--- a/packages/geom/src/api/ray.ts
+++ b/packages/geom/src/api/ray.ts
@@ -1,4 +1,4 @@
-import { Attribs, IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { Attribs, IHiccupShape } from "@thi.ng/geom-api";
import { maddN2, set, Vec } from "@thi.ng/vectors";
import { copyAttribs } from "../internal/copy-attribs";
@@ -6,7 +6,7 @@ export class Ray implements IHiccupShape {
constructor(public pos: Vec, public dir: Vec, public attribs?: Attribs) {}
get type() {
- return Type.RAY;
+ return "ray";
}
copy(): Ray {
diff --git a/packages/geom/src/api/rect.ts b/packages/geom/src/api/rect.ts
index ceb4866409..539848029d 100644
--- a/packages/geom/src/api/rect.ts
+++ b/packages/geom/src/api/rect.ts
@@ -1,5 +1,5 @@
import { isNumber } from "@thi.ng/checks";
-import { AABBLike, Attribs, IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { AABBLike, Attribs, IHiccupShape } from "@thi.ng/geom-api";
import { add2, set, Vec } from "@thi.ng/vectors";
import { copyAttribs } from "../internal/copy-attribs";
@@ -15,7 +15,7 @@ export class Rect implements AABBLike, IHiccupShape {
}
get type() {
- return Type.RECT;
+ return "rect";
}
copy(): Rect {
diff --git a/packages/geom/src/api/sphere.ts b/packages/geom/src/api/sphere.ts
index 04fb486ea2..6e38ed3bfe 100644
--- a/packages/geom/src/api/sphere.ts
+++ b/packages/geom/src/api/sphere.ts
@@ -1,4 +1,4 @@
-import { Attribs, IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { Attribs, IHiccupShape } from "@thi.ng/geom-api";
import { set3, Vec } from "@thi.ng/vectors";
import { copyAttribs } from "../internal/copy-attribs";
@@ -10,7 +10,7 @@ export class Sphere implements IHiccupShape {
) {}
get type() {
- return Type.SPHERE;
+ return "sphere";
}
copy(): Sphere {
diff --git a/packages/geom/src/api/text.ts b/packages/geom/src/api/text.ts
index f8f321a5b8..5ad7ab2041 100644
--- a/packages/geom/src/api/text.ts
+++ b/packages/geom/src/api/text.ts
@@ -1,4 +1,4 @@
-import { Attribs, IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { Attribs, IHiccupShape } from "@thi.ng/geom-api";
import { set, Vec } from "@thi.ng/vectors";
import { copyAttribs } from "../internal/copy-attribs";
@@ -12,7 +12,7 @@ export class Text implements IHiccupShape {
constructor(public pos: Vec, public body: any, public attribs?: Attribs) {}
get type() {
- return Type.TEXT;
+ return "text";
}
copy(): Text {
diff --git a/packages/geom/src/api/triangle.ts b/packages/geom/src/api/triangle.ts
index ce078c0dec..3fc7a738b3 100644
--- a/packages/geom/src/api/triangle.ts
+++ b/packages/geom/src/api/triangle.ts
@@ -1,10 +1,10 @@
-import { IHiccupShape, Type } from "@thi.ng/geom-api";
+import type { IHiccupShape } from "@thi.ng/geom-api";
import { copyShape } from "../internal/copy-shape";
import { APC } from "./apc";
export class Triangle extends APC implements IHiccupShape {
get type() {
- return Type.TRIANGLE;
+ return "tri";
}
copy(): Triangle {
diff --git a/packages/geom/src/ctors/path-builder.ts b/packages/geom/src/ctors/path-builder.ts
index bb73eda858..f2395f48fb 100644
--- a/packages/geom/src/ctors/path-builder.ts
+++ b/packages/geom/src/ctors/path-builder.ts
@@ -1,5 +1,5 @@
import { peek } from "@thi.ng/arrays";
-import { Attribs, SegmentType } from "@thi.ng/geom-api";
+import type { Attribs } from "@thi.ng/geom-api";
import { eqDelta } from "@thi.ng/math";
import { add2, copy, mulN2, set2, sub2, Vec, zeroes } from "@thi.ng/vectors";
import { Cubic } from "../api/cubic";
@@ -62,7 +62,7 @@ export class PathBuilder {
set2(this.bezierP, p);
this.curr.add({
point: p,
- type: SegmentType.MOVE,
+ type: "m",
});
return this;
}
@@ -70,7 +70,7 @@ export class PathBuilder {
lineTo(p: Vec, relative = false): PathBuilder {
this.curr.add({
geo: new Line([copy(this.currP), this.updateCurrent(p, relative)]),
- type: SegmentType.LINE,
+ type: "l",
});
set2(this.bezierP, this.currP);
return this;
@@ -101,8 +101,7 @@ export class PathBuilder {
cubicChainTo(cp2: Vec, p: Vec, relative = false) {
const prevMode = peek(this.curr.segments).type;
const c1 = copy(this.currP);
- prevMode === SegmentType.CUBIC &&
- add2(null, sub2([], c1, this.bezierP), c1);
+ prevMode === "c" && add2(null, sub2([], c1, this.bezierP), c1);
this.addCubic(c1, cp2, p, relative);
return this;
}
@@ -110,8 +109,7 @@ export class PathBuilder {
quadraticChainTo(p: Vec, relative = false) {
const prevMode = peek(this.curr.segments).type;
const c1 = copy(this.currP);
- prevMode === SegmentType.QUADRATIC &&
- sub2(null, mulN2(null, c1, 2), this.bezierP);
+ prevMode === "q" && sub2(null, mulN2(null, c1, 2), this.bezierP);
this.addQuadratic(c1, p, relative);
return this;
}
@@ -137,7 +135,7 @@ export class PathBuilder {
xl,
clockwise
),
- type: SegmentType.ARC,
+ type: "a",
});
set2(this.bezierP, this.currP);
return this;
@@ -146,7 +144,7 @@ export class PathBuilder {
closePath() {
this.curr.add({
geo: new Line([copy(this.currP), copy(this.startP)]),
- type: SegmentType.LINE,
+ type: "l",
});
this.curr.closed = true;
return this;
@@ -167,7 +165,7 @@ export class PathBuilder {
set2(this.bezierP, this.currP);
this.curr.add({
geo: new Line([prev, copy(this.currP)]),
- type: SegmentType.LINE,
+ type: "l",
});
}
@@ -181,7 +179,7 @@ export class PathBuilder {
cp2,
this.updateCurrent(p, relative),
]),
- type: SegmentType.CUBIC,
+ type: "c",
});
}
@@ -193,7 +191,7 @@ export class PathBuilder {
cp,
this.updateCurrent(p, relative),
]),
- type: SegmentType.QUADRATIC,
+ type: "q",
});
}
}
diff --git a/packages/geom/src/ctors/path.ts b/packages/geom/src/ctors/path.ts
index 6bce927ad1..96c4d1681a 100644
--- a/packages/geom/src/ctors/path.ts
+++ b/packages/geom/src/ctors/path.ts
@@ -1,5 +1,5 @@
import { isNumber } from "@thi.ng/checks";
-import { Attribs, PathSegment, SegmentType } from "@thi.ng/geom-api";
+import type { Attribs, PathSegment } from "@thi.ng/geom-api";
import { map, mapcat } from "@thi.ng/transducers";
import { maddN2, Vec } from "@thi.ng/vectors";
import type { Cubic } from "../api/cubic";
@@ -12,9 +12,9 @@ export const path = (segments: PathSegment[], attribs?: Attribs) =>
export const pathFromCubics = (cubics: Cubic[], attribs?: Attribs) => {
const path = new Path([], attribs || cubics[0].attribs);
- path.segments.push({ type: SegmentType.MOVE, point: cubics[0].points[0] });
+ path.segments.push({ type: "m", point: cubics[0].points[0] });
for (let c of cubics) {
- path.segments.push({ type: SegmentType.CUBIC, geo: c });
+ path.segments.push({ type: "c", geo: c });
}
return path;
};
@@ -26,7 +26,7 @@ export const normalizedPath = (path: Path) =>
(s) =>
s.geo
? map(
- (c) => ({ type: SegmentType.CUBIC, geo: c }),
+ (c) => ({ type: "c", geo: c }),
asCubic(s.geo)
)
: [{ ...s }],
diff --git a/packages/geom/src/ops/arc-length.ts b/packages/geom/src/ops/arc-length.ts
index 5e0e1f9516..805fe01e21 100644
--- a/packages/geom/src/ops/arc-length.ts
+++ b/packages/geom/src/ops/arc-length.ts
@@ -1,6 +1,6 @@
import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation1 } from "@thi.ng/defmulti";
-import { IShape, Type } from "@thi.ng/geom-api";
+import type { IShape } from "@thi.ng/geom-api";
import { perimeter } from "@thi.ng/geom-poly-utils";
import { PI, TAU } from "@thi.ng/math";
import { dist } from "@thi.ng/vectors";
@@ -34,30 +34,29 @@ import { dispatch } from "../internal/dispatch";
export const arcLength = defmulti(dispatch);
arcLength.addAll(>>{
- [Type.CIRCLE]: ($: Circle) => TAU * $.r,
+ circle: ($: Circle) => TAU * $.r,
- [Type.ELLIPSE]: ({ r: [a, b] }: Ellipse) =>
+ ellipse: ({ r: [a, b] }: Ellipse) =>
// Ramanujan approximation
// https://www.mathsisfun.com/geometry/ellipse-perimeter.html
PI * (3 * (a + b) - Math.sqrt((3 * a + b) * (3 * b + a))),
- [Type.GROUP]: ({ children }: Group) =>
+ group: ({ children }: Group) =>
children.reduce((sum, $) => sum + arcLength($), 0),
- [Type.LINE]: ({ points }: Line) => dist(points[0], points[1]),
+ line: ({ points }: Line) => dist(points[0], points[1]),
- [Type.POLYGON]: ({ points }: Polygon) =>
- perimeter(points, points.length, true),
+ poly: ({ points }: Polygon) => perimeter(points, points.length, true),
- [Type.POLYLINE]: ({ points }: Polygon) => perimeter(points, points.length),
+ polyline: ({ points }: Polygon) => perimeter(points, points.length),
- [Type.RECT]: ({ size }: Rect) => 2 * (size[0] + size[1]),
+ rect: ({ size }: Rect) => 2 * (size[0] + size[1]),
- [Type.TRIANGLE]: ({ points }: Triangle) =>
+ tri: ({ points }: Triangle) =>
dist(points[0], points[1]) +
dist(points[1], points[2]) +
dist(points[2], points[0]),
});
-arcLength.isa(Type.QUAD, Type.POLYGON);
-arcLength.isa(Type.TRIANGLE, Type.POLYGON);
+arcLength.isa("quad", "poly");
+arcLength.isa("tri", "poly");
diff --git a/packages/geom/src/ops/area.ts b/packages/geom/src/ops/area.ts
index 834ee00e86..85ea671c26 100644
--- a/packages/geom/src/ops/area.ts
+++ b/packages/geom/src/ops/area.ts
@@ -5,7 +5,7 @@ import {
Implementation1O,
MultiFn1O,
} from "@thi.ng/defmulti";
-import { IShape, Type } from "@thi.ng/geom-api";
+import type { IShape } from "@thi.ng/geom-api";
import { polyArea2 } from "@thi.ng/geom-poly-utils";
import { PI } from "@thi.ng/math";
import { signedArea2, Vec } from "@thi.ng/vectors";
@@ -57,34 +57,34 @@ export const area: MultiFn1O = defmulti(dispatch);
area.add(DEFAULT, () => 0);
area.addAll(>>{
- [Type.AABB]: ({ size: [w, h, d] }: AABB) => 2 * (w * h + w * d + h * d),
+ aabb: ({ size: [w, h, d] }: AABB) => 2 * (w * h + w * d + h * d),
- [Type.ARC]:
+ arc:
// http://cut-the-knot.org/Generalization/Cavalieri2.shtml
($: Arc) => 0.5 * Math.abs($.start - $.end) * $.r[0] * $.r[1],
- [Type.CIRCLE]: ($: Circle) => PI * $.r ** 2,
+ circle: ($: Circle) => PI * $.r ** 2,
- [Type.ELLIPSE]: ($: Ellipse) => PI * $.r[0] * $.r[1],
+ ellipse: ($: Ellipse) => PI * $.r[0] * $.r[1],
- [Type.GROUP]: ({ children }: Group) =>
+ group: ({ children }: Group) =>
children.reduce((sum, $) => sum + area($, false), 0),
- [Type.PLANE]: () => Infinity,
+ plane: () => Infinity,
- [Type.POLYGON]: ($: Polygon, signed?) => {
+ poly: ($: Polygon, signed?) => {
const area = polyArea2($.points);
return signed ? area : Math.abs(area);
},
- [Type.RECT]: ($: Rect) => $.size[0] * $.size[1],
+ rect: ($: Rect) => $.size[0] * $.size[1],
- [Type.SPHERE]: ($: Sphere) => 4 * PI * $.r ** 2,
+ sphere: ($: Sphere) => 4 * PI * $.r ** 2,
- [Type.TRIANGLE]: ($: Triangle, signed?) => {
+ tri: ($: Triangle, signed?) => {
const area = 0.5 * signedArea2(...(<[Vec, Vec, Vec]>$.points));
return signed ? area : Math.abs(area);
},
});
-area.isa(Type.QUAD, Type.POLYGON);
+area.isa("quad", "poly");
diff --git a/packages/geom/src/ops/as-cubic.ts b/packages/geom/src/ops/as-cubic.ts
index ca6f69b397..960921c852 100644
--- a/packages/geom/src/ops/as-cubic.ts
+++ b/packages/geom/src/ops/as-cubic.ts
@@ -1,6 +1,6 @@
import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation1, MultiFn1O } from "@thi.ng/defmulti";
-import { CubicOpts, IShape, PCLike, Type } from "@thi.ng/geom-api";
+import type { CubicOpts, IShape, PCLike } from "@thi.ng/geom-api";
import {
closedCubicFromBreakPoints,
closedCubicFromControlPoints,
@@ -34,24 +34,23 @@ export const asCubic: MultiFn1O, Cubic[]> = defmulti(
);
asCubic.addAll(>>{
- [Type.ARC]: cubicFromArc,
+ arc: cubicFromArc,
- [Type.CIRCLE]: ($: Circle) =>
- asCubic(arc($.pos, $.r, 0, 0, TAU, true, true)),
+ circle: ($: Circle) => asCubic(arc($.pos, $.r, 0, 0, TAU, true, true)),
- [Type.CUBIC]: ($: Cubic) => [$],
+ cubic: ($: Cubic) => [$],
- [Type.GROUP]: ($: Group) => [...mapcat(asCubic, $.children)],
+ group: ($: Group) => [...mapcat(asCubic, $.children)],
- [Type.LINE]: ({ attribs, points }: Line) => [
+ line: ({ attribs, points }: Line) => [
cubicFromLine(points[0], points[1], { ...attribs }),
],
- [Type.PATH]: ($: Path) => [
+ path: ($: Path) => [
...mapcat((s) => (s.geo ? asCubic(s.geo) : null), $.segments),
],
- [Type.POLYGON]: ($: Polygon, opts: Partial = {}) =>
+ poly: ($: Polygon, opts: Partial = {}) =>
polyCubic(
$,
opts,
@@ -59,7 +58,7 @@ asCubic.addAll(>>{
closedCubicFromControlPoints
),
- [Type.POLYLINE]: ($: Polyline, opts: Partial = {}) =>
+ polyline: ($: Polyline, opts: Partial = {}) =>
polyCubic(
$,
opts,
@@ -67,15 +66,16 @@ asCubic.addAll(>>{
openCubicFromControlPoints
),
- [Type.QUADRATIC]: ({ attribs, points }: Quadratic) => [
+ quadratic: ({ attribs, points }: Quadratic) => [
cubicFromQuadratic(points[0], points[1], points[2], { ...attribs }),
],
- [Type.RECT]: ($: Rect, opts?: Partial) =>
- asCubic(asPolygon($), opts),
+ rect: ($: Rect, opts?: Partial) => asCubic(asPolygon($), opts),
});
-asCubic.isa(Type.ELLIPSE, Type.CIRCLE);
+asCubic.isa("ellipse", "circle");
+asCubic.isa("quad", "poly");
+asCubic.isa("tri", "poly");
// prettier-ignore
const polyCubic = (
diff --git a/packages/geom/src/ops/as-polygon.ts b/packages/geom/src/ops/as-polygon.ts
index b991fc6ada..e84b36a6b3 100644
--- a/packages/geom/src/ops/as-polygon.ts
+++ b/packages/geom/src/ops/as-polygon.ts
@@ -1,5 +1,5 @@
import { defmulti, MultiFn1O } from "@thi.ng/defmulti";
-import { IShape, SamplingOpts, Type } from "@thi.ng/geom-api";
+import type { IShape, SamplingOpts } from "@thi.ng/geom-api";
import { Polygon } from "../api/polygon";
import { copyAttribs } from "../internal/copy-attribs";
import { dispatch } from "../internal/dispatch";
@@ -12,15 +12,15 @@ export const asPolygon: MultiFn1O<
> = defmulti(dispatch);
asPolygon.addAll({
- [Type.POINTS]: ($, opts) => new Polygon(vertices($, opts), copyAttribs($)),
+ points: ($, opts) => new Polygon(vertices($, opts), copyAttribs($)),
});
-asPolygon.isa(Type.CIRCLE, Type.POINTS);
-asPolygon.isa(Type.ELLIPSE, Type.POINTS);
-asPolygon.isa(Type.LINE, Type.POINTS);
-asPolygon.isa(Type.PATH, Type.POINTS);
-asPolygon.isa(Type.POLYGON, Type.POINTS);
-asPolygon.isa(Type.POLYLINE, Type.POINTS);
-asPolygon.isa(Type.QUAD, Type.POINTS);
-asPolygon.isa(Type.RECT, Type.POINTS);
-asPolygon.isa(Type.TRIANGLE, Type.POINTS);
+asPolygon.isa("circle", "points");
+asPolygon.isa("ellipse", "points");
+asPolygon.isa("line", "points");
+asPolygon.isa("path", "points");
+asPolygon.isa("poly", "points");
+asPolygon.isa("polyline", "points");
+asPolygon.isa("quad", "points");
+asPolygon.isa("rect", "points");
+asPolygon.isa("tri", "points");
diff --git a/packages/geom/src/ops/as-polyline.ts b/packages/geom/src/ops/as-polyline.ts
index a46c8c4738..95fde57c00 100644
--- a/packages/geom/src/ops/as-polyline.ts
+++ b/packages/geom/src/ops/as-polyline.ts
@@ -1,6 +1,6 @@
import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation1O, MultiFn1O } from "@thi.ng/defmulti";
-import { IShape, SamplingOpts, Type } from "@thi.ng/geom-api";
+import type { IShape, SamplingOpts } from "@thi.ng/geom-api";
import { set } from "@thi.ng/vectors";
import type { Cubic } from "../api/cubic";
import type { Path } from "../api/path";
@@ -20,30 +20,30 @@ asPolyline.addAll(<
Implementation1O, Polyline>
>
>{
- [Type.CUBIC]: ($: Cubic, opts) => new Polyline(vertices($, opts)),
+ cubic: ($: Cubic, opts) => new Polyline(vertices($, opts)),
- [Type.POINTS]: ($: IShape, opts) =>
+ points: ($: IShape, opts) =>
new Polyline(vertices($, opts), copyAttribs($)),
- [Type.PATH]: ($: Path, opts) => {
+ path: ($: Path, opts) => {
const pts = vertices($, opts);
$.closed && pts.push(set([], pts[0]));
return new Polyline(pts, copyAttribs($));
},
- [Type.POLYGON]: ($: IShape, opts) => {
+ poly: ($: IShape, opts) => {
const pts = vertices($, opts);
pts.push(set([], pts[0]));
return new Polyline(pts, copyAttribs($));
},
});
-asPolyline.isa(Type.ARC, Type.CUBIC);
-asPolyline.isa(Type.CIRCLE, Type.POLYGON);
-asPolyline.isa(Type.ELLIPSE, Type.POLYGON);
-asPolyline.isa(Type.LINE, Type.POINTS);
-asPolyline.isa(Type.POLYLINE, Type.POINTS);
-asPolyline.isa(Type.QUAD, Type.POLYGON);
-asPolyline.isa(Type.QUADRATIC, Type.CUBIC);
-asPolyline.isa(Type.RECT, Type.POLYGON);
-asPolyline.isa(Type.TRIANGLE, Type.POLYGON);
+asPolyline.isa("arc", "cubic");
+asPolyline.isa("circle", "poly");
+asPolyline.isa("ellipse", "poly");
+asPolyline.isa("line", "points");
+asPolyline.isa("polyline", "points");
+asPolyline.isa("quad", "poly");
+asPolyline.isa("quadratic", "cubic");
+asPolyline.isa("rect", "poly");
+asPolyline.isa("tri", "poly");
diff --git a/packages/geom/src/ops/bounds.ts b/packages/geom/src/ops/bounds.ts
index 8af33d660a..120fb46dde 100644
--- a/packages/geom/src/ops/bounds.ts
+++ b/packages/geom/src/ops/bounds.ts
@@ -1,6 +1,6 @@
import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation1 } from "@thi.ng/defmulti";
-import { AABBLike, IShape, PathSegment, PCLike, Type } from "@thi.ng/geom-api";
+import type { AABBLike, IShape, PathSegment, PCLike } from "@thi.ng/geom-api";
import { bounds as arcBounds } from "@thi.ng/geom-arc";
import { bounds as _bounds } from "@thi.ng/geom-poly-utils";
import { cubicBounds, quadraticBounds } from "@thi.ng/geom-splines";
@@ -37,29 +37,29 @@ import { dispatch } from "../internal/dispatch";
export const bounds = defmulti(dispatch);
bounds.addAll(>>{
- [Type.ARC]: ($: Arc) =>
+ arc: ($: Arc) =>
rectFromMinMax(...arcBounds($.pos, $.r, $.axis, $.start, $.end)),
- [Type.CIRCLE]: ($: Circle) =>
+ circle: ($: Circle) =>
new Rect(subN2([], $.pos, $.r), mulN2(null, [2, 2], $.r)),
- [Type.CUBIC]: ({ points }: Cubic) =>
+ cubic: ({ points }: Cubic) =>
rectFromMinMax(
...cubicBounds(points[0], points[1], points[2], points[3])
),
- [Type.ELLIPSE]: ($: Ellipse) =>
+ ellipse: ($: Ellipse) =>
new Rect(sub2([], $.pos, $.r), mul2(null, [2, 2], $.r)),
- [Type.GROUP]: ($: Group) => {
+ group: ($: Group) => {
const res = collBounds($.children, bounds);
return res ? new Rect(...res) : undefined;
},
- [Type.LINE]: ({ points: [a, b] }: Line) =>
+ line: ({ points: [a, b] }: Line) =>
rectFromMinMax(min([], a, b), max([], a, b)),
- [Type.PATH]: (path: Path) => {
+ path: (path: Path) => {
const b = collBounds(
[
...iterator1(
@@ -75,22 +75,22 @@ bounds.addAll(>>{
return b ? new Rect(...b) : undefined;
},
- [Type.POINTS]: ($: PCLike) =>
+ points: ($: PCLike) =>
rectFromMinMax(..._bounds($.points, set2([], MAX2), set2([], MIN2))),
- [Type.POINTS3]: ($: PCLike) =>
+ points3: ($: PCLike) =>
aabbFromMinMax(..._bounds($.points, set3([], MAX3), set3([], MIN3))),
- [Type.QUADRATIC]: ({ points }: Quadratic) =>
+ quadratic: ({ points }: Quadratic) =>
rectFromMinMax(...quadraticBounds(points[0], points[1], points[2])),
- [Type.RECT]: ($: IShape) => $.copy(),
+ rect: ($: IShape) => $.copy(),
- [Type.TEXT]: ($: Text) => new Rect(set2([], $.pos), [0, 0]),
+ text: ($: Text) => new Rect(set2([], $.pos), [0, 0]),
});
-bounds.isa(Type.AABB, Type.RECT);
-bounds.isa(Type.POLYGON, Type.POINTS);
-bounds.isa(Type.POLYLINE, Type.POINTS);
-bounds.isa(Type.QUAD, Type.POINTS);
-bounds.isa(Type.TRIANGLE, Type.POINTS);
+bounds.isa("aabb", "rect");
+bounds.isa("poly", "points");
+bounds.isa("polyline", "points");
+bounds.isa("quad", "points");
+bounds.isa("tri", "points");
diff --git a/packages/geom/src/ops/center.ts b/packages/geom/src/ops/center.ts
index 0cf8383527..fcd3c72c08 100644
--- a/packages/geom/src/ops/center.ts
+++ b/packages/geom/src/ops/center.ts
@@ -1,10 +1,11 @@
+import type { IObjectOf } from "@thi.ng/api";
import {
DEFAULT,
defmulti,
Implementation1O,
MultiFn1O,
} from "@thi.ng/defmulti";
-import { IShape, Type } from "@thi.ng/geom-api";
+import type { IShape } from "@thi.ng/geom-api";
import { ReadonlyVec, set2, set3, submN, ZERO2, ZERO3 } from "@thi.ng/vectors";
import { Arc } from "../api/arc";
import { Circle } from "../api/circle";
@@ -14,7 +15,6 @@ import { copyAttribs } from "../internal/copy-attribs";
import { dispatch } from "../internal/dispatch";
import { centroid } from "./centroid";
import { translate } from "./translate";
-import type { IObjectOf } from "@thi.ng/api";
export const center: MultiFn1O<
IShape,
@@ -30,7 +30,7 @@ center.add(DEFAULT, ($, origin = ZERO3) => {
center.addAll(<
IObjectOf>
>{
- [Type.ARC]: ($: Arc, origin = ZERO2) =>
+ arc: ($: Arc, origin = ZERO2) =>
new Arc(
set2([], origin),
set2([], $.r),
@@ -42,12 +42,12 @@ center.addAll(<
copyAttribs($)
),
- [Type.CIRCLE]: ($: Circle, origin = ZERO2) =>
+ circle: ($: Circle, origin = ZERO2) =>
new Circle(set2([], origin), $.r, copyAttribs($)),
- [Type.ELLIPSE]: ($: Ellipse, origin = ZERO2) =>
+ ellipse: ($: Ellipse, origin = ZERO2) =>
new Ellipse(set2([], origin), set2([], $.r), copyAttribs($)),
- [Type.SPHERE]: ($: Sphere, origin = ZERO3) =>
+ sphere: ($: Sphere, origin = ZERO3) =>
new Sphere(set3([], origin), $.r, copyAttribs($)),
});
diff --git a/packages/geom/src/ops/centroid.ts b/packages/geom/src/ops/centroid.ts
index c190d392ba..0939edb844 100644
--- a/packages/geom/src/ops/centroid.ts
+++ b/packages/geom/src/ops/centroid.ts
@@ -1,6 +1,6 @@
import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation1O, MultiFn1O } from "@thi.ng/defmulti";
-import { AABBLike, IShape, PCLike, Type } from "@thi.ng/geom-api";
+import type { AABBLike, IShape, PCLike } from "@thi.ng/geom-api";
import {
centerOfWeight2,
centroid as _centroid,
@@ -20,25 +20,25 @@ export const centroid: MultiFn1O = defmulti(
);
centroid.addAll(>>{
- [Type.CIRCLE]: ($: Circle, out?) => set(out || [], $.pos),
+ circle: ($: Circle, out?) => set(out || [], $.pos),
- [Type.GROUP]: ($: Group) => {
+ group: ($: Group) => {
const b = bounds($);
return b ? centroid(b) : undefined;
},
- [Type.LINE]: ({ points }: Line, out?) =>
+ line: ({ points }: Line, out?) =>
mixN(out || [], points[0], points[1], 0.5),
- [Type.POINTS]: ($: PCLike, out?) => _centroid($.points, out),
+ points: ($: PCLike, out?) => _centroid($.points, out),
- [Type.PLANE]: ($: Plane, out?) => mulN(out || [], $.normal, $.w),
+ plane: ($: Plane, out?) => mulN(out || [], $.normal, $.w),
- [Type.POLYGON]: ($: Polygon, out?) => centerOfWeight2($.points, out),
+ poly: ($: Polygon, out?) => centerOfWeight2($.points, out),
- [Type.RECT]: ($: AABBLike, out?) => maddN(out || [], $.size, 0.5, $.pos),
+ rect: ($: AABBLike, out?) => maddN(out || [], $.size, 0.5, $.pos),
- [Type.TRIANGLE]: ({ points }: Triangle, out?) =>
+ tri: ({ points }: Triangle, out?) =>
divN(
null,
add(null, add(out || [], points[0], points[1]), points[2]),
@@ -46,13 +46,13 @@ centroid.addAll(>>{
),
});
-centroid.isa(Type.ARC, Type.CIRCLE);
-centroid.isa(Type.AABB, Type.RECT);
-centroid.isa(Type.ELLIPSE, Type.CIRCLE);
-centroid.isa(Type.LINE3, Type.LINE);
-centroid.isa(Type.POINTS3, Type.POINTS);
-centroid.isa(Type.POLYLINE, Type.POINTS);
-centroid.isa(Type.QUAD, Type.POLYGON);
-centroid.isa(Type.SPHERE, Type.CIRCLE);
-centroid.isa(Type.TEXT, Type.CIRCLE);
-centroid.isa(Type.TRIANGLE3, Type.TRIANGLE);
+centroid.isa("arc", "circle");
+centroid.isa("aabb", "rect");
+centroid.isa("ellipse", "circle");
+centroid.isa("line3", "line");
+centroid.isa("points3", "points");
+centroid.isa("polyline", "points");
+centroid.isa("quad", "poly");
+centroid.isa("sphere", "circle");
+centroid.isa("text", "circle");
+centroid.isa("tri3", "tri");
diff --git a/packages/geom/src/ops/classify-point.ts b/packages/geom/src/ops/classify-point.ts
index d0528a7333..afb37ac9cd 100644
--- a/packages/geom/src/ops/classify-point.ts
+++ b/packages/geom/src/ops/classify-point.ts
@@ -1,6 +1,6 @@
import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation2O, MultiFn2O } from "@thi.ng/defmulti";
-import { IShape, Type } from "@thi.ng/geom-api";
+import type { IShape } from "@thi.ng/geom-api";
import {
classifyPointInCircle,
classifyPointInTriangle2,
@@ -22,13 +22,13 @@ export const classifyPoint: MultiFn2O<
classifyPoint.addAll(<
IObjectOf>
>{
- [Type.CIRCLE]: ($: Circle, p, eps = EPS) =>
+ circle: ($: Circle, p, eps = EPS) =>
classifyPointInCircle(p, $.pos, $.r, eps),
- [Type.PLANE]: ($: Plane, p, eps) => sign(dot($.normal, p) - $.w, eps),
+ plane: ($: Plane, p, eps) => sign(dot($.normal, p) - $.w, eps),
- [Type.TRIANGLE]: ({ points }: Triangle, p: ReadonlyVec, eps = EPS) =>
+ tri: ({ points }: Triangle, p: ReadonlyVec, eps = EPS) =>
classifyPointInTriangle2(p, points[0], points[1], points[2], eps),
});
-classifyPoint.isa(Type.SPHERE, Type.CIRCLE);
+classifyPoint.isa("sphere", "circle");
diff --git a/packages/geom/src/ops/clip-convex.ts b/packages/geom/src/ops/clip-convex.ts
index 33febaea68..62ab506d17 100644
--- a/packages/geom/src/ops/clip-convex.ts
+++ b/packages/geom/src/ops/clip-convex.ts
@@ -1,6 +1,6 @@
import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation2 } from "@thi.ng/defmulti";
-import { IHiccupShape, IShape, Type } from "@thi.ng/geom-api";
+import type { IHiccupShape, IShape } from "@thi.ng/geom-api";
import { clipLineSegmentPoly } from "@thi.ng/geom-clip-line";
import { sutherlandHodgeman } from "@thi.ng/geom-clip-poly";
import { centroid } from "@thi.ng/geom-poly-utils";
@@ -23,7 +23,7 @@ clipConvex.addAll(<
Implementation2
>
>{
- [Type.GROUP]: ({ children, attribs }: Group, boundary) => {
+ group: ({ children, attribs }: Group, boundary) => {
boundary = ensureVertices(boundary);
const clipped: IHiccupShape[] = [];
for (let c of children) {
@@ -33,7 +33,7 @@ clipConvex.addAll(<
return new Group({ ...attribs }, clipped);
},
- [Type.LINE]: ($: Line, boundary) => {
+ line: ($: Line, boundary) => {
const segments = clipLineSegmentPoly(
$.points[0],
$.points[1],
@@ -44,13 +44,13 @@ clipConvex.addAll(<
: undefined;
},
- [Type.POLYGON]: ($: Polygon, boundary) => {
+ poly: ($: Polygon, boundary) => {
boundary = ensureVertices(boundary);
const pts = sutherlandHodgeman($.points, boundary, centroid(boundary));
return pts.length ? new Polygon(pts, copyAttribs($)) : undefined;
},
- [Type.RECT]: ($: IShape, boundary) => {
+ rect: ($: IShape, boundary) => {
boundary = ensureVertices(boundary);
const pts = sutherlandHodgeman(
vertices($),
@@ -61,8 +61,8 @@ clipConvex.addAll(<
},
});
-clipConvex.isa(Type.CIRCLE, Type.RECT);
-clipConvex.isa(Type.ELLIPSE, Type.RECT);
-clipConvex.isa(Type.PATH, Type.RECT);
-clipConvex.isa(Type.QUAD, Type.POLYGON);
-clipConvex.isa(Type.TRIANGLE, Type.POLYGON);
+clipConvex.isa("circle", "rect");
+clipConvex.isa("ellipse", "rect");
+clipConvex.isa("path", "rect");
+clipConvex.isa("quad", "poly");
+clipConvex.isa("tri", "poly");
diff --git a/packages/geom/src/ops/closest-point.ts b/packages/geom/src/ops/closest-point.ts
index ff2f718c6f..60ed3c2523 100644
--- a/packages/geom/src/ops/closest-point.ts
+++ b/packages/geom/src/ops/closest-point.ts
@@ -1,6 +1,6 @@
import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation2O, MultiFn2O } from "@thi.ng/defmulti";
-import { IShape, PCLike, Type } from "@thi.ng/geom-api";
+import type { IShape, PCLike } from "@thi.ng/geom-api";
import { closestPoint as closestPointArc } from "@thi.ng/geom-arc";
import {
closestPointAABB,
@@ -33,39 +33,36 @@ export const closestPoint: MultiFn2O<
closestPoint.addAll(<
IObjectOf>
>{
- [Type.AABB]: ($: AABB, p, out) =>
+ aabb: ($: AABB, p, out) =>
closestPointAABB(p, $.pos, add3([], $.pos, $.size), out),
- [Type.ARC]: ($: Arc, p, out) =>
+ arc: ($: Arc, p, out) =>
closestPointArc(p, $.pos, $.r, $.axis, $.start, $.end, out),
- [Type.CIRCLE]: ($: Circle, p, out) =>
- closestPointCircle(p, $.pos, $.r, out),
+ circle: ($: Circle, p, out) => closestPointCircle(p, $.pos, $.r, out),
- [Type.CUBIC]: ({ points }: Cubic, p, out) =>
+ cubic: ({ points }: Cubic, p, out) =>
closestPointCubic(p, points[0], points[1], points[2], points[3], out),
- [Type.LINE]: ({ points }: Line, p, out) =>
+ line: ({ points }: Line, p, out) =>
closestPointSegment(p, points[0], points[1], out),
- [Type.PLANE]: ($: Plane, p, out) =>
- closestPointPlane(p, $.normal, $.w, out),
+ plane: ($: Plane, p, out) => closestPointPlane(p, $.normal, $.w, out),
- [Type.POINTS]: ($: PCLike, p, out) => closestPointArray(p, $.points, out),
+ points: ($: PCLike, p, out) => closestPointArray(p, $.points, out),
- [Type.POLYGON]: ($: PCLike, p, out) =>
- closestPointPolyline(p, $.points, true, out),
+ poly: ($: PCLike, p, out) => closestPointPolyline(p, $.points, true, out),
- [Type.POLYLINE]: ($: PCLike, p, out) =>
+ polyline: ($: PCLike, p, out) =>
closestPointPolyline(p, $.points, false, out),
- [Type.QUADRATIC]: ({ points }: Quadratic, p, out) =>
+ quadratic: ({ points }: Quadratic, p, out) =>
closestPointQuadratic(p, points[0], points[1], points[2], out),
- [Type.RECT]: ($: Rect, p, out) =>
+ rect: ($: Rect, p, out) =>
closestPointRect(p, $.pos, add2([], $.pos, $.size), out),
});
-closestPoint.isa(Type.QUAD, Type.POLYGON);
-closestPoint.isa(Type.SPHERE, Type.CIRCLE);
-closestPoint.isa(Type.TRIANGLE, Type.POLYGON);
+closestPoint.isa("quad", "poly");
+closestPoint.isa("sphere", "circle");
+closestPoint.isa("tri", "poly");
diff --git a/packages/geom/src/ops/convex-hull.ts b/packages/geom/src/ops/convex-hull.ts
index 654d9b41b2..ab38e77850 100644
--- a/packages/geom/src/ops/convex-hull.ts
+++ b/packages/geom/src/ops/convex-hull.ts
@@ -1,6 +1,6 @@
import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation1 } from "@thi.ng/defmulti";
-import { IShape, PCLike, Type } from "@thi.ng/geom-api";
+import type { IShape, PCLike } from "@thi.ng/geom-api";
import { grahamScan2 } from "@thi.ng/geom-hull";
import { Polygon } from "../api/polygon";
import { copyAttribs } from "../internal/copy-attribs";
@@ -10,17 +10,16 @@ import { vertices } from "./vertices";
export const convexHull = defmulti(dispatch);
convexHull.addAll(>>{
- [Type.GROUP]: ($: IShape) => new Polygon(vertices($), copyAttribs($)),
+ group: ($: IShape) => new Polygon(vertices($), copyAttribs($)),
- [Type.POINTS]: ($: PCLike) =>
- new Polygon(grahamScan2($.points), copyAttribs($)),
+ points: ($: PCLike) => new Polygon(grahamScan2($.points), copyAttribs($)),
- [Type.TRIANGLE]: ($: IShape) => $.copy(),
+ tri: ($: IShape) => $.copy(),
});
-convexHull.isa(Type.CIRCLE, Type.TRIANGLE);
-convexHull.isa(Type.ELLIPSE, Type.TRIANGLE);
-convexHull.isa(Type.POLYGON, Type.POINTS);
-convexHull.isa(Type.POLYLINE, Type.POINTS);
-convexHull.isa(Type.QUAD, Type.POINTS);
-convexHull.isa(Type.RECT, Type.TRIANGLE);
+convexHull.isa("circle", "tri");
+convexHull.isa("ellipse", "tri");
+convexHull.isa("poly", "points");
+convexHull.isa("polyline", "points");
+convexHull.isa("quad", "points");
+convexHull.isa("rect", "tri");
diff --git a/packages/geom/src/ops/edges.ts b/packages/geom/src/ops/edges.ts
index 911c6c0ec1..b23018928b 100644
--- a/packages/geom/src/ops/edges.ts
+++ b/packages/geom/src/ops/edges.ts
@@ -1,5 +1,7 @@
+import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation1O, MultiFn1O } from "@thi.ng/defmulti";
-import { IShape, SamplingOpts, Type } from "@thi.ng/geom-api";
+import type { IShape, SamplingOpts } from "@thi.ng/geom-api";
+import type { VecPair } from "@thi.ng/vectors";
import type { AABB } from "../api/aabb";
import type { Polygon } from "../api/polygon";
import type { Polyline } from "../api/polyline";
@@ -7,8 +9,6 @@ import type { Rect } from "../api/rect";
import { dispatch } from "../internal/dispatch";
import { edgeIterator } from "../internal/edges";
import { vertices } from "./vertices";
-import type { VecPair } from "@thi.ng/vectors";
-import type { IObjectOf } from "@thi.ng/api";
export const edges: MultiFn1O<
IShape,
@@ -25,7 +25,7 @@ edges.addAll(<
>
>
>{
- [Type.AABB]: ($: AABB) => {
+ aabb: ($: AABB) => {
const [a, b, c, d, e, f, g, h] = vertices($);
return [
[a, b],
@@ -43,13 +43,13 @@ edges.addAll(<
];
},
- [Type.POLYGON]: ($: Polygon) => edgeIterator($.points, true),
+ poly: ($: Polygon) => edgeIterator($.points, true),
- [Type.POLYLINE]: ($: Polyline) => edgeIterator($.points),
+ polyline: ($: Polyline) => edgeIterator($.points),
- [Type.RECT]: ($: Rect) => edgeIterator(vertices($), true),
+ rect: ($: Rect) => edgeIterator(vertices($), true),
});
-edges.isa(Type.LINE, Type.POLYLINE);
-edges.isa(Type.QUAD, Type.POLYGON);
-edges.isa(Type.TRIANGLE, Type.POLYGON);
+edges.isa("line", "polyline");
+edges.isa("quad", "poly");
+edges.isa("tri", "poly");
diff --git a/packages/geom/src/ops/flip.ts b/packages/geom/src/ops/flip.ts
index 85ee3e9e5c..779dff220d 100644
--- a/packages/geom/src/ops/flip.ts
+++ b/packages/geom/src/ops/flip.ts
@@ -1,18 +1,18 @@
+import type { IObjectOf } from "@thi.ng/api";
import { DEFAULT, defmulti, Implementation1 } from "@thi.ng/defmulti";
-import { IShape, PCLike, Type } from "@thi.ng/geom-api";
+import type { IShape, PCLike } from "@thi.ng/geom-api";
import { neg } from "@thi.ng/vectors";
import type { Arc } from "../api/arc";
import type { Group } from "../api/group";
import type { Path } from "../api/path";
import type { Ray } from "../api/ray";
import { dispatch } from "../internal/dispatch";
-import type { IObjectOf } from "@thi.ng/api";
export const flip = defmulti(dispatch);
flip.add(DEFAULT, ($) => $);
flip.addAll(>>{
- [Type.ARC]: ($: Arc) => {
+ arc: ($: Arc) => {
const t = $.start;
$.start = $.end;
$.end = t;
@@ -20,32 +20,32 @@ flip.addAll(>>{
return $;
},
- [Type.GROUP]: ($: Group) => {
+ group: ($: Group) => {
$.children.forEach(flip);
return $;
},
- [Type.PATH]: ($: Path) => {
+ path: ($: Path) => {
// TODO
return $;
},
- [Type.POINTS]: ($: PCLike) => {
+ points: ($: PCLike) => {
$.points.reverse();
return $;
},
- [Type.RAY]: ($: Ray) => {
+ ray: ($: Ray) => {
$.dir = neg(null, $.dir);
return $;
},
});
-flip.isa(Type.CUBIC, Type.POINTS);
-flip.isa(Type.LINE, Type.POINTS);
-flip.isa(Type.POINTS3, Type.POINTS);
-flip.isa(Type.POLYGON, Type.POINTS);
-flip.isa(Type.POLYLINE, Type.POINTS);
-flip.isa(Type.QUAD, Type.POINTS);
-flip.isa(Type.QUADRATIC, Type.POINTS);
-flip.isa(Type.TRIANGLE, Type.POINTS);
+flip.isa("cubic", "points");
+flip.isa("line", "points");
+flip.isa("points3", "points");
+flip.isa("poly", "points");
+flip.isa("polyline", "points");
+flip.isa("quad", "points");
+flip.isa("quadratic", "points");
+flip.isa("tri", "points");
diff --git a/packages/geom/src/ops/intersects.ts b/packages/geom/src/ops/intersects.ts
index 538cbe3bbc..728ed270c7 100644
--- a/packages/geom/src/ops/intersects.ts
+++ b/packages/geom/src/ops/intersects.ts
@@ -1,10 +1,10 @@
+import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation2O, MultiFn2O } from "@thi.ng/defmulti";
import {
IntersectionResult,
IntersectionType,
IShape,
PCLike,
- Type,
} from "@thi.ng/geom-api";
import {
intersectCircleCircle,
@@ -26,7 +26,6 @@ import type { Ray } from "../api/ray";
import type { Rect } from "../api/rect";
import type { Sphere } from "../api/sphere";
import { dispatch2 } from "../internal/dispatch";
-import type { IObjectOf } from "@thi.ng/api";
export const intersects: MultiFn2O<
IShape,
@@ -38,50 +37,47 @@ export const intersects: MultiFn2O<
intersects.addAll(<
IObjectOf>
>{
- [`${Type.CIRCLE}-${Type.CIRCLE}`]: (a: Sphere, b: Sphere) =>
+ "circle-circle": (a: Sphere, b: Sphere) =>
intersectCircleCircle(a.pos, b.pos, a.r, b.r),
- [`${Type.LINE}-${Type.LINE}`]: ({ points: a }: Line, { points: b }: Line) =>
+ "line-line": ({ points: a }: Line, { points: b }: Line) =>
intersectLineLine(a[0], a[1], b[0], b[1]),
- [`${Type.PLANE}-${Type.PLANE}`]: (a: Plane, b: Plane) =>
+ "plane-plane": (a: Plane, b: Plane) =>
intersectPlanePlane(a.normal, a.w, b.normal, b.w),
- [`${Type.RAY}-${Type.AABB}`]: (ray: Ray, box: AABB) =>
+ "ray-aabb": (ray: Ray, box: AABB) =>
intersectRayAABB(ray.pos, ray.dir, box.pos, box.max()),
- [`${Type.RAY}-${Type.CIRCLE}`]: (ray: Ray, sphere: Sphere) =>
+ "ray-circle": (ray: Ray, sphere: Sphere) =>
intersectRayCircle(ray.pos, ray.dir, sphere.pos, sphere.r),
- [`${Type.RAY}-${Type.PLANE}`]: (ray: Ray, plane: Plane) =>
+ "ray-plane": (ray: Ray, plane: Plane) =>
intersectRayPlane(ray.pos, ray.dir, plane.normal, plane.w),
- [`${Type.RAY}-${Type.POLYGON}`]: (ray: Ray, poly: PCLike) =>
+ "ray-poly": (ray: Ray, poly: PCLike) =>
intersectRayPolyline(ray.pos, ray.dir, poly.points, true),
- [`${Type.RAY}-${Type.POLYLINE}`]: (ray: Ray, poly: PCLike) =>
+ "ray-polyline": (ray: Ray, poly: PCLike) =>
intersectRayPolyline(ray.pos, ray.dir, poly.points, false),
- [`${Type.RAY}-${Type.RECT}`]: (ray: Ray, rect: Rect) =>
+ "ray-rect": (ray: Ray, rect: Rect) =>
intersectRayRect(ray.pos, ray.dir, rect.pos, rect.max()),
- [`${Type.RECT}-${Type.CIRCLE}`]: (rect: Rect, circle: Circle) => ({
+ "rect-circle": (rect: Rect, circle: Circle) => ({
type: testRectCircle(rect.pos, rect.size, circle.pos, circle.r)
? IntersectionType.INTERSECT
: IntersectionType.NONE,
}),
- [`${Type.RECT}-${Type.RECT}`]: (a: Rect, b: Rect) => ({
+ "rect-rect": (a: Rect, b: Rect) => ({
type: testRectRect(a.pos, a.size, b.pos, b.size)
? IntersectionType.INTERSECT
: IntersectionType.NONE,
}),
});
-intersects.isa(`${Type.RAY}-${Type.SPHERE}`, `${Type.RAY}-${Type.CIRCLE}`);
-intersects.isa(`${Type.RAY}-${Type.QUAD}`, `${Type.RAY}-${Type.POLYGON}`);
-intersects.isa(`${Type.RAY}-${Type.TRIANGLE}`, `${Type.RAY}-${Type.POLYGON}`);
-intersects.isa(
- `${Type.SPHERE}-${Type.SPHERE}`,
- `${Type.CIRCLE}-${Type.CIRCLE}`
-);
+intersects.isa(`ray-sphere`, `ray-circle`);
+intersects.isa(`ray-quad`, `ray-poly`);
+intersects.isa(`ray-tri`, `ray-poly`);
+intersects.isa(`sphere-sphere`, `circle-circle`);
diff --git a/packages/geom/src/ops/map-point.ts b/packages/geom/src/ops/map-point.ts
index f92ebeca4f..9782902d00 100644
--- a/packages/geom/src/ops/map-point.ts
+++ b/packages/geom/src/ops/map-point.ts
@@ -1,17 +1,17 @@
+import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation2O, MultiFn2O } from "@thi.ng/defmulti";
-import { IShape, Type } from "@thi.ng/geom-api";
+import type { IShape } from "@thi.ng/geom-api";
import { div, ReadonlyVec, sub, Vec } from "@thi.ng/vectors";
import type { Rect } from "../api/rect";
import { dispatch } from "../internal/dispatch";
-import type { IObjectOf } from "@thi.ng/api";
export const mapPoint: MultiFn2O = defmulti(
dispatch
);
mapPoint.addAll(>>{
- [Type.RECT]: ($: Rect, p: ReadonlyVec, out: Vec = []) =>
+ rect: ($: Rect, p: ReadonlyVec, out: Vec = []) =>
div(null, sub(out, p, $.pos), $.size),
});
-mapPoint.isa(Type.AABB, Type.RECT);
+mapPoint.isa("aabb", "rect");
diff --git a/packages/geom/src/ops/offset.ts b/packages/geom/src/ops/offset.ts
index d75deba4db..cc248ec25f 100644
--- a/packages/geom/src/ops/offset.ts
+++ b/packages/geom/src/ops/offset.ts
@@ -1,6 +1,6 @@
import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation2 } from "@thi.ng/defmulti";
-import { IShape, Type } from "@thi.ng/geom-api";
+import type { IShape } from "@thi.ng/geom-api";
import {
add2,
addN2,
@@ -22,10 +22,9 @@ import { centroid } from "./centroid";
export const offset = defmulti(dispatch);
offset.addAll(>>{
- [Type.CIRCLE]: ($: Circle, n) =>
- new Circle(set2([], $.pos), Math.max($.r + n, 0)),
+ circle: ($: Circle, n) => new Circle(set2([], $.pos), Math.max($.r + n, 0)),
- [Type.LINE]: ({ points: [a, b], attribs }: Line, n) => {
+ line: ({ points: [a, b], attribs }: Line, n) => {
const norm = normalCW([], a, b, n);
return new Quad(
[
@@ -38,7 +37,7 @@ offset.addAll(>>{
);
},
- [Type.RECT]: ($: Rect, n) =>
+ rect: ($: Rect, n) =>
rectFromCentroid(
centroid($)!,
max2(null, addN2([], $.size, n), ZERO2),
diff --git a/packages/geom/src/ops/point-at.ts b/packages/geom/src/ops/point-at.ts
index 5a10a56f1e..6a5bdf7277 100644
--- a/packages/geom/src/ops/point-at.ts
+++ b/packages/geom/src/ops/point-at.ts
@@ -1,6 +1,6 @@
import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation2 } from "@thi.ng/defmulti";
-import { IShape, Type } from "@thi.ng/geom-api";
+import type { IShape } from "@thi.ng/geom-api";
import { Sampler } from "@thi.ng/geom-resample";
import { cossin, fit01, TAU } from "@thi.ng/math";
import {
@@ -28,30 +28,30 @@ import { vertices } from "./vertices";
export const pointAt = defmulti(dispatch);
pointAt.addAll(>>{
- [Type.ARC]: ($: Arc, t: number) => $.pointAtTheta(fit01(t, $.start, $.end)),
+ arc: ($: Arc, t: number) => $.pointAtTheta(fit01(t, $.start, $.end)),
- [Type.CIRCLE]: ($: Circle, t) => cartesian2(null, [$.r, TAU * t], $.pos),
+ circle: ($: Circle, t) => cartesian2(null, [$.r, TAU * t], $.pos),
- [Type.CUBIC]: ({ points }: Cubic, t) =>
+ cubic: ({ points }: Cubic, t) =>
mixCubic([], points[0], points[1], points[2], points[3], t),
- [Type.ELLIPSE]: ($: Ellipse, t) => madd2([], cossin(TAU * t), $.r, $.pos),
+ ellipse: ($: Ellipse, t) => madd2([], cossin(TAU * t), $.r, $.pos),
- [Type.LINE]: ({ points }: Line, t) => mixN2([], points[0], points[1], t),
+ line: ({ points }: Line, t) => mixN2([], points[0], points[1], t),
- [Type.POLYGON]: ($: Polygon, t) => new Sampler($.points, true).pointAt(t),
+ poly: ($: Polygon, t) => new Sampler($.points, true).pointAt(t),
- [Type.POLYLINE]: ($: Polygon, t) => new Sampler($.points).pointAt(t),
+ polyline: ($: Polygon, t) => new Sampler($.points).pointAt(t),
- [Type.QUADRATIC]: ({ points }: Quadratic, t) =>
+ quadratic: ({ points }: Quadratic, t) =>
mixQuadratic([], points[0], points[1], points[2], t),
- [Type.RAY]: ($: Ray, t) => pointOnRay2([], $.pos, $.dir, t),
+ ray: ($: Ray, t) => pointOnRay2([], $.pos, $.dir, t),
- [Type.RAY3]: ($: Ray, t) => pointOnRay3([], $.pos, $.dir, t),
+ ray3: ($: Ray, t) => pointOnRay3([], $.pos, $.dir, t),
- [Type.RECT]: ($: Rect, t) => new Sampler(vertices($), true).pointAt(t),
+ rect: ($: Rect, t) => new Sampler(vertices($), true).pointAt(t),
});
-pointAt.isa(Type.QUAD, Type.POLYGON);
-pointAt.isa(Type.TRIANGLE, Type.POLYGON);
+pointAt.isa("quad", "poly");
+pointAt.isa("tri", "poly");
diff --git a/packages/geom/src/ops/point-inside.ts b/packages/geom/src/ops/point-inside.ts
index a4ebf63379..3dc428cd95 100644
--- a/packages/geom/src/ops/point-inside.ts
+++ b/packages/geom/src/ops/point-inside.ts
@@ -1,5 +1,6 @@
+import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation2 } from "@thi.ng/defmulti";
-import { IShape, Type } from "@thi.ng/geom-api";
+import type { IShape } from "@thi.ng/geom-api";
import {
pointInAABB,
pointInCircle,
@@ -17,27 +18,26 @@ import type { Polygon } from "../api/polygon";
import type { Rect } from "../api/rect";
import type { Triangle } from "../api/triangle";
import { dispatch } from "../internal/dispatch";
-import type { IObjectOf } from "@thi.ng/api";
export const pointInside = defmulti(dispatch);
pointInside.addAll(>>{
- [Type.AABB]: ($: AABB, p: ReadonlyVec) => pointInAABB(p, $.pos, $.size),
+ aabb: ($: AABB, p: ReadonlyVec) => pointInAABB(p, $.pos, $.size),
- [Type.CIRCLE]: ($: Circle, p) => pointInCircle(p, $.pos, $.r),
+ circle: ($: Circle, p) => pointInCircle(p, $.pos, $.r),
- [Type.LINE]: ($: Line, p) => pointInSegment(p, $.points[0], $.points[1]),
+ line: ($: Line, p) => pointInSegment(p, $.points[0], $.points[1]),
- [Type.POINTS]: ({ points }: Points, p) => isInArray(p, points),
+ points: ({ points }: Points, p) => isInArray(p, points),
- [Type.POLYGON]: ($: Polygon, p) => pointInPolygon2(p, $.points) > 0,
+ poly: ($: Polygon, p) => pointInPolygon2(p, $.points) > 0,
- [Type.RECT]: ($: Rect, p: ReadonlyVec) => pointInRect(p, $.pos, $.size),
+ rect: ($: Rect, p: ReadonlyVec) => pointInRect(p, $.pos, $.size),
- [Type.TRIANGLE]: (tri: Triangle, p: ReadonlyVec) =>
+ tri: (tri: Triangle, p: ReadonlyVec) =>
pointInTriangle2(p, ...(<[Vec, Vec, Vec]>tri.points)),
});
-pointInside.isa(Type.POINTS3, Type.POINTS);
-pointInside.isa(Type.QUAD, Type.POLYGON);
-pointInside.isa(Type.SPHERE, Type.CIRCLE);
+pointInside.isa("points3", "points");
+pointInside.isa("quad", "poly");
+pointInside.isa("sphere", "circle");
diff --git a/packages/geom/src/ops/resample.ts b/packages/geom/src/ops/resample.ts
index 577df72323..77a081dac6 100644
--- a/packages/geom/src/ops/resample.ts
+++ b/packages/geom/src/ops/resample.ts
@@ -1,12 +1,12 @@
+import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation2 } from "@thi.ng/defmulti";
-import { IShape, PCLike, SamplingOpts, Type } from "@thi.ng/geom-api";
+import type { IShape, PCLike, SamplingOpts } from "@thi.ng/geom-api";
import { resample as _resample } from "@thi.ng/geom-resample";
import { Polygon } from "../api/polygon";
import { Polyline } from "../api/polyline";
import { copyAttribs } from "../internal/copy-attribs";
import { dispatch } from "../internal/dispatch";
import { asPolygon } from "./as-polygon";
-import type { IObjectOf } from "@thi.ng/api";
export const resample = defmulti<
IShape,
@@ -17,17 +17,17 @@ export const resample = defmulti<
resample.addAll(<
IObjectOf, IShape>>
>{
- [Type.CIRCLE]: ($: IShape, opts) => asPolygon($, opts),
+ circle: ($: IShape, opts) => asPolygon($, opts),
- [Type.POLYGON]: ($: PCLike, opts) =>
+ poly: ($: PCLike, opts) =>
new Polygon(_resample($.points, opts, true, true), copyAttribs($)),
- [Type.POLYLINE]: ($: PCLike, opts) =>
+ polyline: ($: PCLike, opts) =>
new Polyline(_resample($.points, opts, false, true), copyAttribs($)),
});
-resample.isa(Type.ELLIPSE, Type.CIRCLE);
-resample.isa(Type.LINE, Type.POLYLINE);
-resample.isa(Type.QUAD, Type.POLYGON);
-resample.isa(Type.TRIANGLE, Type.POLYGON);
-resample.isa(Type.RECT, Type.CIRCLE);
+resample.isa("ellipse", "circle");
+resample.isa("line", "polyline");
+resample.isa("quad", "poly");
+resample.isa("tri", "poly");
+resample.isa("rect", "circle");
diff --git a/packages/geom/src/ops/simplify.ts b/packages/geom/src/ops/simplify.ts
index 914d442afc..433532d717 100644
--- a/packages/geom/src/ops/simplify.ts
+++ b/packages/geom/src/ops/simplify.ts
@@ -1,20 +1,20 @@
+import type { IObjectOf } from "@thi.ng/api";
import { peek } from "@thi.ng/arrays";
import { defmulti, Implementation2 } from "@thi.ng/defmulti";
-import { IShape, PathSegment, SegmentType, Type } from "@thi.ng/geom-api";
+import type { IShape, PathSegment } from "@thi.ng/geom-api";
import { simplify as _simplify } from "@thi.ng/geom-resample";
+import type { Vec } from "@thi.ng/vectors";
import { Path } from "../api/path";
import { Polygon } from "../api/polygon";
import { Polyline } from "../api/polyline";
import { copyAttribs } from "../internal/copy-attribs";
import { dispatch } from "../internal/dispatch";
import { vertices } from "./vertices";
-import type { IObjectOf } from "@thi.ng/api";
-import type { Vec } from "@thi.ng/vectors";
export const simplify = defmulti(dispatch);
simplify.addAll(>>{
- [Type.PATH]: ($: Path, eps = 0.1) => {
+ path: ($: Path, eps = 0.1) => {
const res: PathSegment[] = [];
const orig = $.segments;
const n = orig.length;
@@ -22,10 +22,7 @@ simplify.addAll(>>{
let lastP!: Vec;
for (let i = 0; i < n; i++) {
const s = orig[i];
- if (
- s.type === SegmentType.LINE ||
- s.type === SegmentType.POLYLINE
- ) {
+ if (s.type === "l" || s.type === "p") {
points = points
? points.concat(vertices(s.geo!))
: vertices(s.geo!);
@@ -34,7 +31,7 @@ simplify.addAll(