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

add the option to use ticksArray as array of objects, with legend and value properties #662

Merged
merged 2 commits into from Feb 23, 2019

Conversation

vdiez
Copy link
Contributor

@vdiez vdiez commented Feb 20, 2019

same as we do with steps array, but to customize the ticks without limiting the selection steps.

I know this can be already done with a variety of methods, but AFAIK only with functions. In my case I store these labels in a mongo db, so storing logic is not ideal. Putting those labels in a table of objects without limiting the selection as stepsArray solves both issues, storing and displaying.

@codecov-io
Copy link

codecov-io commented Feb 20, 2019

Codecov Report

Merging #662 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #662   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines         970    974    +4     
=====================================
+ Hits          970    974    +4
Impacted Files Coverage Δ
src/rzslider.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64c3f86...e6f070f. Read the comment docs.

@ValentinH
Copy link
Member

Hey @vdiez, thanks for this PR!

Could you create a JSFiddle showing how to use this option? For this you can fork the example one from the ReadMe and point the script (angular-slider.js) to your repo instead of this one. You'll need to run the build script on your PR to generate the different needed files.

Also, please provide a unit test for this option so we keep the coverage at the same level as before.

Thanks :)

…ray, allowing value and legend

Accept TicksArray to be an array of object as stepsArray, allowing value and legend properties. This
functionality was possible with translate function, but now it's also possible with a simple array
@vdiez
Copy link
Contributor Author

vdiez commented Feb 21, 2019

Hi @ValentinH,

fiddle here: http://jsfiddle.net/3jgzv4wc/1/

Cheers

@ValentinH ValentinH self-requested a review February 21, 2019 21:28
Copy link
Member

@ValentinH ValentinH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome sauce! Thanks for this PR. 🙂

@ValentinH ValentinH merged commit 4492603 into angular-slider:master Feb 23, 2019
@ValentinH
Copy link
Member

Released under 6.7.0 🎉

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.

None yet

3 participants