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

Resizing or Redrawing the knob #342

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Resizing or Redrawing the knob #342

wants to merge 8 commits into from

Conversation

HeroofOne
Copy link

@HeroofOne HeroofOne commented Dec 19, 2016

Hello. I just inherited a solution that uses Knobs and noticed a few problems with the API.

First, there is no easy way to redraw the Knobs. I found the pull request here where you mentioned that triggering "configure" on the Knob would resize the Knob. This is partially true, but it removes certain configurations like the "format" function.

I assumed that I could simply trigger "configure" with the same "format" function, but this is not the case. This "format" function seems to be disregarded and the "value" is displayed instead of the "actualValue". As do many other "hacks" that I tried. It seems the only way to preserve this "actualValue/displayValue" is to build a Knob from scratch. Again, I set my "format" function to return "this.o.displayValue", but that only seems to work for the initial creation of a Knob.

I also attempted to use relative height/width for the Knobs, but found that the code wouldn't work for our solution. It simply hard-codes the resize handler into "window", instead of providing the option to NOT automatically bind an event handler to the window or call the handler without triggering a resize to the whole window. This causes problems as we use a debounce function to avoid re-drawing too much on screen. This means that the Knobs are "resized" before the actual document, which does nothing. Additionally, this native behavior also clears the "format" function and doesn't display what it should.

I know these changes aren't likely to occur soon, but I hope that these enhancements could be made to improve the API.

@ismatim
Copy link

ismatim commented Sep 8, 2017

You missed to trigger change.

#187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants