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

calcite-slider > capabilities wishlist #10607

Open
2 of 6 tasks
richiecarmichael opened this issue Oct 25, 2024 · 1 comment
Open
2 of 6 tasks

calcite-slider > capabilities wishlist #10607

richiecarmichael opened this issue Oct 25, 2024 · 1 comment
Assignees
Labels
1 - assigned Issues that are assigned to a sprint and a team member. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 5 A few days of work, definitely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@richiecarmichael
Copy link

richiecarmichael commented Oct 25, 2024

Check existing issues

Description

The ArcGIS Maps for JavaScript (aka JSSDK) team have a project underway to modernize/update the TimeSlider widget. TimeSlider currently utilizes the JSSDK's Slider widget.

Moving forward it is advantageous to adopt the Calcite's Slider. The Calcite alternative is modern, accessible, attractive, and actively maintained.

The JSSDK team is aware of #5827, an issue to add support for irregular and independent ticks, labels and steps. This issue goes further to suggest other capabilities that would make TimeSlider's transition from the JSSDK's Slider to Calcite's Slider easier.

Temporarily change the primary color

TimeSlider has an invalid state when assigned values that fall outside the slider's min/max range. An example of this is when a TimeSlider is configured for dates between 1990 and 2000 but is indirectly assigned 1980 (e.g. when associated with a View).

Perhaps to handle this, the user just needs to temporarily change the slider's primary color to indicate an invalid state? For example.

image

Locking a range

A frequent enhancement request for TimeSlider is the ability to lock a range so that the range-bar moves without increasing in width. This is advantageous when the user wants the range to always span a specific timeframe like one month. Another use case is when the range is tiny compared to the min/max making sliding the range impossible without adjusting the end thumbs.

image

Note that when a slider's range bar is moved, the end thumbs should snap to the nearest steps. This is important when steps are irregularly spaced. For example month in a year are not eqi-spaced.

Additionally, when a range is locked clicking on the adjacent track will cause the range-bar to slide. When unlocked this action would cause the nearest thumb to snap to the clicked position.

Methods to support playback

TimeSlider needs to support playback capabilities, both interactively and as an animation. It would be useful for slider to have methods to advance to the next or previous step and to have properties that can inform the user if values are at the beginning or end.

Consider adding previous(), next(), moveToStart(), moveToEnd(), isAtStart and isAtEnd.

document.getElementById('buttonNext').addEventListener('click', () => {
  const slider = document.querySelector('slider');
  if (slider.isAtEnd) {
    if (this._allowLooping) {
      slider.moveToStart();
    }
  } else {
    slider.next();
  }
});

Free movement

It is currently for JSSDK's Slider and TimeSlider to have no steps. That is, thumbs, do not snap to any preset values between min and max when moved. Internally it is no unreasonable for thumbs to snap to individual pixels.

Related:

#1631 calcite-slider > configurable highlighting
#2584, #4004 calcite-slider > custom tick label formatters
#5522 calcite-slider > layout vertical and horizontal (in progress)
#5827 calcite-slider > decouple ticks, labels and stops

Acceptance Criteria

See above.

Relevant Info

No response

Which Component

calcite-slider

Example Use Case

No response

Priority impact

impact - p2 - want for an upcoming milestone

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Maps SDK for JavaScript

// @jcfranco @ubatsukh

@richiecarmichael richiecarmichael added 0 - new New issues that need assignment. enhancement Issues tied to a new feature or request. needs triage Planning workflow - pending design/dev review. labels Oct 25, 2024
@github-actions github-actions bot added ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. calcite-components Issues specific to the @esri/calcite-components package. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone labels Oct 25, 2024
@ubatsukh
Copy link

cc @mitc7862

@geospatialem geospatialem added p - high Issue should be addressed in the current milestone, impacts component or core functionality estimate - 5 A few days of work, definitely requires updates to tests. and removed needs triage Planning workflow - pending design/dev review. labels Nov 4, 2024
@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - assigned Issues that are assigned to a sprint and a team member. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 5 A few days of work, definitely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

4 participants