Skip to content

Negative values don't work #36

Open
@maxp-hover

Description

@maxp-hover

If I use a params object like this:

{
  val: -1,
  valMin: -5,
  valMax: 0,
  valStep: 0.1
}

The interface doesn't work properly. The minimum value for the slider works, but not the maximum. The slider goes all the way up to 100 (the default behavior, I believe), not to 0 as I specified.

I might suggest a refactor which internally makes all sliders go from 0 to 1, then implements a remapping function which takes those values and remaps them to the user-specified range. This would solve the issue I mentioned above, but also handle situations where the user provided "min" is greater than the "max". Though not technically correct in a mathematical sense, a user might want bigger values to be on the left side of the slider, and the library might as well support that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions