@thi.ng/imgui 3.1.17 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/README.md +1 -1
- package/components/ramp.d.ts +9 -1
- package/components/ramp.js +4 -3
- package/package.json +11 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2025-
|
|
3
|
+
- **Last updated**: 2025-02-05T13:48:14Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -11,6 +11,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
11
11
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
12
12
|
and/or version bumps of transitive dependencies.
|
|
13
13
|
|
|
14
|
+
## [3.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/imgui@3.2.0) (2025-02-05)
|
|
15
|
+
|
|
16
|
+
#### 🚀 Features
|
|
17
|
+
|
|
18
|
+
- add RampOpts.samples ([8aaaae5](https://github.com/thi-ng/umbrella/commit/8aaaae5))
|
|
19
|
+
|
|
14
20
|
## [3.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/imgui@3.1.0) (2024-10-07)
|
|
15
21
|
|
|
16
22
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 201 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/components/ramp.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface RampOpts extends Omit<ComponentOpts, "label"> {
|
|
|
7
7
|
* User defined interpolation mode. Only used to compute internal hash of
|
|
8
8
|
* ramp curve geometry, i.e. if the {@link RampOpts.ramp} interpolation
|
|
9
9
|
* method changes, so should this mode value.
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue 0
|
|
10
12
|
*/
|
|
11
13
|
mode?: number;
|
|
12
14
|
/**
|
|
@@ -15,6 +17,12 @@ export interface RampOpts extends Omit<ComponentOpts, "label"> {
|
|
|
15
17
|
* @defaultValue 0.05
|
|
16
18
|
*/
|
|
17
19
|
eps?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Ramp resolution (number of vertices for area plot)
|
|
22
|
+
*
|
|
23
|
+
* @defaultValue 100
|
|
24
|
+
*/
|
|
25
|
+
samples?: number;
|
|
18
26
|
}
|
|
19
|
-
export declare const ramp: ({ gui, layout, id, ramp, mode, info, eps, }: RampOpts) => Maybe<Ramp<number>>;
|
|
27
|
+
export declare const ramp: ({ gui, layout, id, ramp, mode, info, eps, samples, }: RampOpts) => Maybe<Ramp<number>>;
|
|
20
28
|
//# sourceMappingURL=ramp.d.ts.map
|
package/components/ramp.js
CHANGED
|
@@ -22,7 +22,8 @@ const ramp = ({
|
|
|
22
22
|
ramp: ramp2,
|
|
23
23
|
mode = 0,
|
|
24
24
|
info,
|
|
25
|
-
eps = 0.05
|
|
25
|
+
eps = 0.05,
|
|
26
|
+
samples = 100
|
|
26
27
|
}) => {
|
|
27
28
|
const { x, y, w, h } = layoutBox(layout);
|
|
28
29
|
const maxX = x + w;
|
|
@@ -74,7 +75,7 @@ const ramp = ({
|
|
|
74
75
|
[
|
|
75
76
|
[x, maxY],
|
|
76
77
|
mix2([], pos, maxPos, [0, stops[0][1]]),
|
|
77
|
-
...__rampVertices(ramp2, pos, maxPos),
|
|
78
|
+
...__rampVertices(ramp2, pos, maxPos, samples),
|
|
78
79
|
mix2([], pos, maxPos, [1, stops[stops.length - 1][1]]),
|
|
79
80
|
[maxX, maxY]
|
|
80
81
|
],
|
|
@@ -106,7 +107,7 @@ const ramp = ({
|
|
|
106
107
|
gui.lastID = id;
|
|
107
108
|
return res;
|
|
108
109
|
};
|
|
109
|
-
const __rampVertices = (ramp2, pos, maxPos, numSamples
|
|
110
|
+
const __rampVertices = (ramp2, pos, maxPos, numSamples) => map((p) => mix2(p, pos, maxPos, p), ramp2.samples(numSamples));
|
|
110
111
|
const __handleRampKeys = (gui, ramp2, selID) => {
|
|
111
112
|
switch (gui.key) {
|
|
112
113
|
case Key.TAB:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/imgui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Immediate mode GUI with flexible state handling & data only shape output",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -33,22 +33,21 @@
|
|
|
33
33
|
"build:esbuild": "esbuild --format=esm --platform=neutral --target=es2022 --tsconfig=tsconfig.json --outdir=. src/**/*.ts",
|
|
34
34
|
"clean": "bun ../../tools/src/clean-package.ts behaviors components",
|
|
35
35
|
"doc": "typedoc --options ../../typedoc.json --out doc src/index.ts",
|
|
36
|
-
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
37
36
|
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
38
37
|
"pub": "yarn npm publish --access public",
|
|
39
38
|
"test": "bun test",
|
|
40
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
40
|
},
|
|
42
41
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.11.
|
|
44
|
-
"@thi.ng/checks": "^3.6.
|
|
45
|
-
"@thi.ng/geom": "^8.1.
|
|
46
|
-
"@thi.ng/geom-isec": "^4.0.
|
|
47
|
-
"@thi.ng/layout": "^3.1.
|
|
48
|
-
"@thi.ng/math": "^5.11.
|
|
49
|
-
"@thi.ng/ramp": "^3.3.
|
|
50
|
-
"@thi.ng/transducers": "^9.2.
|
|
51
|
-
"@thi.ng/vectors": "^7.12.
|
|
42
|
+
"@thi.ng/api": "^8.11.19",
|
|
43
|
+
"@thi.ng/checks": "^3.6.22",
|
|
44
|
+
"@thi.ng/geom": "^8.1.28",
|
|
45
|
+
"@thi.ng/geom-isec": "^4.0.31",
|
|
46
|
+
"@thi.ng/layout": "^3.1.15",
|
|
47
|
+
"@thi.ng/math": "^5.11.19",
|
|
48
|
+
"@thi.ng/ramp": "^3.3.21",
|
|
49
|
+
"@thi.ng/transducers": "^9.2.17",
|
|
50
|
+
"@thi.ng/vectors": "^7.12.19"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
53
|
"esbuild": "^0.24.2",
|
|
@@ -163,5 +162,5 @@
|
|
|
163
162
|
],
|
|
164
163
|
"year": 2019
|
|
165
164
|
},
|
|
166
|
-
"gitHead": "
|
|
165
|
+
"gitHead": "71aa5c93fddd00b159db8f46cb6a53e413e0e261\n"
|
|
167
166
|
}
|