const waveData = new Array(100).fill(0);
+const waveData2 = new Array(100).fill(0);
const gui = new GUI();
helpers.graph(
@@ -330,6 +341,14 @@ Canvas:
max: +2,
interval: 200,
});
+helpers.graph(
+ gui.addCanvas('wave 2').canvas,
+ waveData2,
+ {
+ min: -2,
+ max: +2,
+ interval: 10,
+ });
@@ -502,9 +521,34 @@ Get called when the user changes a value.
+ +
+const s = {
+ count: 123,
+ name: 'Buffy',
+ speed: 45,
+};
+
+const gui = new GUI();
+gui.add(s, 'count').onChange(logCount);
+gui.add(s, 'name').onChange(logName);
+gui.add(s, 'speed', 0, 100).onChange(logSpeed);
+gui.onChange(logAll); // or folder
+
+function logCount(v) { log('count:', v); }
+function logName(v) { log('name:', v); }
+function logSpeed(v) { log('speed:', v); }
+function logAll() { log(JSON.stringify(s)); }
+
+ Listens for changes.
+Listens for changes. (auto update)
diff --git a/package-lock.json b/package-lock.json
index 9bbaea5..200178f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "muigui",
- "version": "0.0.20",
+ "version": "0.0.21",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "muigui",
- "version": "0.0.20",
+ "version": "0.0.21",
"license": "MIT",
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.0.1",
diff --git a/package.json b/package.json
index 75887b3..7e24fac 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "muigui",
- "version": "0.0.20",
+ "version": "0.0.21",
"description": "A Simple GUI",
"main": "dist/0.x/muigui.js",
"module": "dist/0.x/muigui.module.js",
diff --git a/src/styles/muigui.css.js b/src/styles/muigui.css.js
index 876733d..e96dff2 100644
--- a/src/styles/muigui.css.js
+++ b/src/styles/muigui.css.js
@@ -150,6 +150,10 @@ export default {
--value-color: var(--disabled-color) !important;
--range-left-color: var(--disabled-color) !important;
}
+/* this shouldn't be needed! */
+.muigui-disabled label {
+ color: var(--disabled-color)
+}
.muigui canvas,
.muigui svg {