msawired / opc Goto Github PK
View Code? Open in Web Editor NEWOP Configurator 3000
License: MIT License
OP Configurator 3000
License: MIT License
Sometimes is useful to add a different label other than the variable name, or even add a text above the variable name, to provide more information to the viewer of the options. This would not change existing functionality and the internal variable name is kept.
There are several ways this could be achieved, as to modify as little as possible existing API:
OPC.slider('someValue', 1, 0, 10, 1, 'Some description')
OPC.slider('someValue', 1, 0, 10, 1, {
label: 'Some label',
description: 'Some long description'
}
OPC.slider('someValue', ...);
OPC.label('someValue', 'some label');
OPC.description('someValue', 'some long description')
OPC.slider('someValue', ...).label('some label').description('some long description')
I would like to hear your thoughts if this is a useful change, I'm willing to implement it
In the slider generation, the step parameter doesn't work. The line
step = variableNameOrConfig ?? step;
should probably be
step = variableNameOrConfig.step ?? step;
I created a rotation cypher encoding/decoding sketch, and today I found this project library had been added to OpenProcessing, so I added the UI elements for inputting the text and a slider for changing the rotation. However, my initial sketch used the keyboard up/down keys in order to change the rotation, and I would like to update the slider value to reflect when that input is used to change the rotation.
Sketch here: https://openprocessing.org/sketch/1527550
Add this fonction :
// VariableName store the value of the element, like a toggle element …
OPC.delete(VariableName)
// Or :
VariableName.delete();
Use case: In this sketch, the Y and Z sliders are initially independent. The toggle option allows the user to lock Y to Z. When toggled, the present ratio of Y to Z is computed and then, as the Z slider is dragged, the Y slider automatically remains in correspondence.
Problem: All works well when the Z slider is moved, but if the user attempts to move the Y slider, erratic behavior occurs and ultimately resets.
Solution: The ideal behavior would be to allow the sketch creator to programmatically disable/enable the Y slider in accord with the toggle, like this sketch. Disable means the control is still visible, but not adjustable by the user. Perhaps the blue color in the UI changes to gray. The corresponding numeric value should remain visible.
Question: Is there an alternative approach to this use case?
When I want to make some classes’ attributes modifiables in the OP menu, I meet a problem : some attributes have the same name.
So, I had an idea : accordion menus (look-like three.js config menu)
I think that can be helpful to explicit the appartenance of an attribute to him.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.