-
Notifications
You must be signed in to change notification settings - Fork 3.4k
mdSlider: Allow non-linear slider values #623
Comments
One option is to support a <md-slider ng-model='playRate' md-steps='[0.25,0.5,1,1.25,1.5, 2]' /> If the developer needs to control the ability to visually position the steps (on the track), the steps could be an array of $scope.playOptions = [
{ value : 0.25, distance : 0.125 },
{ value : 0.5, distance : 0.25 },
{ value : 1.0, distance: 0.5 },
{ value : 1.25, distance : 0.625 },
{ value : 1.5, distance : 0.75 },
{ value : 2.0, distance: 1.0 }
]; <md-slider ng-model='selectedRate' md-steps='playOptions' /> |
html5 On Wed, Nov 12, 2014 at 12:06 PM, Thomas Burleson [email protected]
|
@plato-cambrian I'm fully aware of that, but I don't believe Angular-Material is aiming to only support those features that HTML5 supports natively. This issue was raised as it's a feature that could be supported to allow the angular-material slider to provide maximum flexibility. @ThomasBurleson That's a pretty neat idea. Your suggestion would also allow us to support having a different "display value" to be rendered in the discreet bubble. In example use case above the values are 1, 1.25, 1.5 etc yet in the UI these are actually represented as "1x", "1.25x", "1.5x". We could easily support this by simply adding an extra key/value pair to |
@wills bithrey I certainly agree that it would be great to implement custom On Wed, Nov 12, 2014 at 2:08 PM, Wills Bithrey [email protected]
|
+1 |
+1 |
1 similar comment
+1 |
I am working on this PR. I think I find it cleaner to have a separate directive for this as there so many differences especially since I'm not sure if my tailored use case will match others (I am told I need mine to be evenly split based on the custom steps rather than their value)... |
…#645) * fix(stack-blitz): add more configuration files to the template allow the exported/downloaded project from StackBlitz to be functional - move files into /src and /src/app to match a normal configuration rename Stackblitz to StackBlitz use StackBlitz logo to launch examples use a relative URL for downloading `versions.json` update Ivy fix for VersionPicker log errors during app bootstrap in StackBlitz switch StackBlitz examples to SCSS fix lint warnings in deploy script add ignores for Firebase Fixes angular#623. Fixes angular#629. Relates to angular#642. * migrate workspace for @angular/[email protected] Decorates all declared undecorated provider classes with @Injectable * feat: update to 9.0.0-next.x and enable Ivy rendering engine add 9.0.0-next.0 to versions list - point it to material2-docs-dev for now * fix(ci): update docker image to latest CircleCI NodeJS LTS the prior version used `[email protected]` - @angular-devkit/[email protected] throws an error - Expected version ">= 1.13.0". Got "1.10.1" * refactor(tools): convert deploy script from npm to yarn re-enable Angular CLI's build-optimizer
Sometimes a slider may be required which does not have a linear scale for it's possible values. We have a use case where a slider represents the playback speed of a YouTube video where the available values are: 0.25, 0.5, 1, 1.25, 1.5, 2. This is not possible with the current angular-material implementation.
This is just one example, you could have a slider that required a logarithmic scale for instance.
It'd be nice if there was a way to explicitly determine the available steps of a slider. Alternatively, if it were possible to define a mapping of UI values to actual model values that might also be a solution.
The text was updated successfully, but these errors were encountered: