Git Product home page Git Product logo

Comments (14)

 avatar commented on May 24, 2024 10

Hi there!

Logarithmic scaling: http://jsfiddle.net/7dbowqfd/5/

from ion.rangeslider.

Lajdak avatar Lajdak commented on May 24, 2024 3

Ok I got it just if i need right 'selected' value i will get it via this.prettify(data.from) not only data.from.

from ion.rangeslider.

IonDen avatar IonDen commented on May 24, 2024 1

Hi, @ilanfreoua, check this demo: http://jsfiddle.net/IonDen/7dbowqfd/
This means, that you can do anything you want with numbers using build-in prettify function.

from ion.rangeslider.

IonDen avatar IonDen commented on May 24, 2024

Hi again, in future i will try to implement this feature.

from ion.rangeslider.

IonDen avatar IonDen commented on May 24, 2024

Hi, it could be done now with prettify function.

from ion.rangeslider.

popovae avatar popovae commented on May 24, 2024

Hello everyone!

@scooterlord Did you manage to get this work?
@IonDen maybe you can give some example? I tried to make it work, but as far as I can understand Pretiffy functions have nothing to do with logarithmic value increase (steps)...?

from ion.rangeslider.

IonDen avatar IonDen commented on May 24, 2024

Hello, @popovae, your are looking for this: http://jsfiddle.net/IonDen/7dbowqfd/ ?
At least this example could be a good starting point.

from ion.rangeslider.

popovae avatar popovae commented on May 24, 2024

Hello, @IonDen
No, I was looking for something like it was described in the original question:

If there is a large range of numbers, for example 0.1-150.000, is is really difficult to select a range of 10s or 100s.
It would be great if the values increased logarithmically with small values for small numbers and values increasing as you go at the end of the range.

In other words - we have a range From 1 To 100 000, selecting 100 will be nearly impossible in current implemention of ION RangeSlider, it only works with the nearest values of max/min. In this case using logarithmically decreasing Steps it will be really easy to select any value in any range...
Please have a look at the example here - http://stackoverflow.com/a/846249

from ion.rangeslider.

ilanfreoua avatar ilanfreoua commented on May 24, 2024

UP ! we use ion.rangeSlider in our project and would love to have a logarithmic step grid instead of a linear grid (or the ability to manually set grid step)

from ion.rangeslider.

smajl avatar smajl commented on May 24, 2024

The problem I found with the approach posted by @nicktabolich is that it distributes logarithmic range in this form on X axis:
1111111111|222222222|33333333|4444444|55555|6666|777|88|9|1010101010|...

I assumed that I will always use logarithmic ranges starting from 0 and ending in some power of ten (10, 100, 1000, ...). Then I ended up with something like this:

    // assume this.max = 1000000
    _convertFromAxisToLinearLog(value: number): number {
        const logAxisPow = this._getIntegerDigitCount(this.max) - 1; // 1 000 000 -> 7-1 -> 6
        const logAxisLinearStep = this.max / (logAxisPow * 10);
        const stepsInValue = Math.round(value / logAxisLinearStep);
        const valuePow = Math.floor(stepsInValue / 10);
        const remainder = stepsInValue % 10;

        if (value === 0) {
            return 0;
        } else if (remainder) {
            return Math.pow(10, valuePow) * remainder;
        } else {
            return Math.pow(10, valuePow);
        }
    }

Which produces something much more usable for an user:
1111|2222|3333|4444|5555|6666|7777|8888|9999|1010|...

from ion.rangeslider.

Lajdak avatar Lajdak commented on May 24, 2024

@nicktabolich There is problem :( Slider and his values seems be ok on look, but if you need work with selected value there are 'old' value (by linear). Range is 1-10000, there is 10 segments on your example and ending first segment is with value 2 but if you choose this value then real value is 1000 or if you pick second segment with 6 real value is 2000 and so on... Look for better understand http://jsfiddle.net/7dbowqfd/75/

from ion.rangeslider.

haim3307 avatar haim3307 commented on May 24, 2024

thanks for the example, however i added two inputs to adjust the min and max value ,
but when i try to update the slider from the input value i don't know if to update the position using input value or try to reverse the prettify and how to do either.

from ion.rangeslider.

florent-dehanne avatar florent-dehanne commented on May 24, 2024

Hi,

I've made it work using this version:

Hi there!

Logarithmic scaling: http://jsfiddle.net/7dbowqfd/5/

However, if I set from and to values, the value displayed is incorrect.
https://jsfiddle.net/fdehanne/jn0sf6v2/16/

from ion.rangeslider.

xwiz avatar xwiz commented on May 24, 2024

This would be a cool feature and will be negligible to the js size. Implementation works better than most I've seen but the on change values need updates. https://codepen.io/flostrasser/pen/NWxJXMY

I think the major thing missing is an API to use or get prettified values instead of actual values.

from ion.rangeslider.

Related Issues (20)

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.