Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomize all slider options? #1

Open
wahidshafique opened this issue May 28, 2021 · 1 comment
Open

Randomize all slider options? #1

wahidshafique opened this issue May 28, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@wahidshafique
Copy link

Hey, super cool! I was thinking, as a feature request, the option to randomize within sets, it might lend to more easily discovering cool patterns.

@doersino
Copy link
Owner

I actually implemented this early on in UJI's development – the code's still there, albeit commented-out:

uji/script.js

Lines 309 to 327 in 59f8519

// commented-out since it only very rarely produces interesting results – the
// space is just way too n-dimensional. also, would need to deal with floating
// point stringification stuff, which ugh
/*function randomize() {
let randomized = JSON.parse(JSON.stringify(defaults));
Object.keys(options).forEach(n => {
const o = options[n];
const v = optionValues[n];
const minScaled = o.min / o.step;
const maxScaled = o.max / o.step;
let rand = parseInt(minScaled + Math.random() * (maxScaled - minScaled)) * o.step;
if (!o.step.toString().includes(".")) {
rand = parseInt(rand);
}
randomized[n] = rand;
});
applyOptions(randomized);
}*/

It worked fairly well when there were only a few options, but as I added more, it started delivering bad results exceedingly frequently. (Because: If randomizing any one option has a, say, 50% probability of yielding a cool image, with 20 options, the total probability is more or less 0.5²⁰, which is a really tiny number.)

So a button to randomize all sliders won't yield many interesting results, but randomizing within sets as you suggest (or randomly jiggling a few sliders) might be worth a shot. How to communicate that through the UI is another challenge. I think it makes sense to postpone this, though, until I implement an undo/redo feature as mentioned in README.md.

@doersino doersino added the enhancement New feature or request label May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants