Git Product home page Git Product logo

opc's People

Contributors

msawired avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

opc's Issues

Feature request: Labels / descriptions

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.

  • Label: as an alternative text in place of the variable name
  • Description: as a longer text that can be placed above the control

There are several ways this could be achieved, as to modify as little as possible existing API:

  • Passed as an extra parameter to the existing ones, e.g.
OPC.slider('someValue', 1, 0, 10, 1, 'Some description')
  • Passed as an options extra parameter, which also gives some flexibility to further customize controls in the future, e.g.
OPC.slider('someValue', 1, 0, 10, 1, {
  label: 'Some label',
  description: 'Some long description'
}
  • Associated using the variable name, e.g.
OPC.slider('someValue', ...);
OPC.label('someValue', 'some label');
OPC.description('someValue', 'some long description')
  • Willing to change the internal API a bit, chaining the call, e.g.
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

The step parameter in slider doesn't work

In the slider generation, the step parameter doesn't work. The line
step = variableNameOrConfig ?? step;
should probably be
step = variableNameOrConfig.step ?? step;

How does one change the value of the UI elements?

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

Feature request: API to disable/enable a control

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?

Make elements deletable

Add this fonction :

//  VariableName store the value of the element, like a toggle element …
OPC.delete(VariableName)
// Or : 
VariableName.delete();

feature request : Accordion categories

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.

The same function seems to appear twice.

First appearance:

OPC/opc.js

Lines 130 to 132 in 2b91bcb

static set = function (variableName, value){
window[variableName] = value;
}

Second appearance:

OPC/opc.js

Lines 147 to 149 in 2b91bcb

static set = function (variableName, value){
window[variableName] = value;
}

Does it have special meanings that I don't know?
Thanks for making short but useful library :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.