@thi.ng/imgui 3.1.18 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-01-29T16:25:48Z
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
@@ -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
@@ -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 = 100) => map((p) => mix2(p, pos, maxPos, p), ramp2.samples(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.1.18",
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",
@@ -162,5 +162,5 @@
162
162
  ],
163
163
  "year": 2019
164
164
  },
165
- "gitHead": "fc1d498e8d4b690db873c30cc594352a804e7a65\n"
165
+ "gitHead": "71aa5c93fddd00b159db8f46cb6a53e413e0e261\n"
166
166
  }