-
Notifications
You must be signed in to change notification settings - Fork 947
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
noUiSlider implementation #2712
Conversation
With this: |
|
@ibdafna - I'm just playing around with this and making notes where I see issues. |
@ibdafna has already pointed this out, but I'll note it here to make sure we take another look: |
Just like with the FloatLogSlider, |
For the lagginess, I tried turning off animation in some cases: diff --git a/packages/controls/src/widget_float.ts b/packages/controls/src/widget_float.ts
index 2aee38fb8..94503c90f 100644
--- a/packages/controls/src/widget_float.ts
+++ b/packages/controls/src/widget_float.ts
@@ -147,13 +147,14 @@ class FloatLogSliderView extends BaseIntSliderView {
log_value = min;
}
- return log_value
+ return log_value;
}
createSlider() {
console.log("Twitter");
noUiSlider.create(this.$slider, {
start: this.logCalc(this.model.get('value')),
+ animate: this.model.get('max') % 2 === 0,
connect: this.connect,
range: {
'min': this.model.get('min'),
diff --git a/packages/controls/src/widget_int.ts b/packages/controls/src/widget_int.ts
index 43665d2be..cabbee91f 100644
--- a/packages/controls/src/widget_int.ts
+++ b/packages/controls/src/widget_int.ts
@@ -228,6 +228,7 @@ abstract class BaseIntSliderView extends DescriptionView {
noUiSlider.create(this.$slider, {
start: this.model.get('value'),
connect: this.connect,
+ animate: this.model.get('max') % 2 === 0,
range: {
'min': this.model.get('min'),
'max': this.model.get('max')
diff --git a/packages/controls/src/widget_selection.ts b/packages/controls/src/widget_selection.ts
index 4369564bb..f2335f4f8 100644
--- a/packages/controls/src/widget_selection.ts
+++ b/packages/controls/src/widget_selection.ts
@@ -686,6 +686,7 @@ class SelectionSliderView extends DescriptionView {
noUiSlider.create(this.$slider, {
start: this.model.get('index'),
connect: true,
+ animate: max % 2 === 0,
range: {
'min': min,
'max': max It made a world of difference (just try doing |
…us implementation
Just did another round of testing. Outstanding issues:
All other functionality seems to be working fine! |
I think that is intentional? The attribute specification says that 0.1 is the default step for a float slider. |
Also finish fixing the thickening of the connection between range slider handles for the horizontal case. |
Changed some of the function signatures to accept the updated_view attribute. This is now used to validate whether the slider should update its value when the updateSliderValue callback is invoked. This now enables smooth animations with no lags - shall we revisit this before merging? |
Sure, let's look at it tomorrow. Thanks for looking into it! |
Thanks so much for your hard work on this! |
Congrats @ibdafna ! |
Thanks a lot @ibdafna ! Awesome work |
WIP PR for the new slider implementation.
Fixes #630
Todo: