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 > decouple ticks, labels and stops #5827

Open
richiecarmichael opened this issue Nov 29, 2022 · 9 comments
Open

calcite-slider > decouple ticks, labels and stops #5827

richiecarmichael opened this issue Nov 29, 2022 · 9 comments
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. c-slider Issues that pertain to the calcite-slider component enhancement Issues tied to a new feature or request. estimate - 8 Requires input from team, consider smaller steps. p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@richiecarmichael
Copy link

Description

At present calcite-slider assumes that ticks, tick labels and stops coincide and that all three are at regular intervals. This is rarely the case. The solution is to have independent properties for all three. For examples:

{
  min: 0,
  max: 100,
  // Place small ticks at 10 unit spacing
  ticks: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
  // Label each quarter.
  labels: [0, 25, 50, 75, 100], 
  // Slider thumbs will snap at 10 unit intervals.
  steps: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
}

What are Labels?

Label will consist of text and longer tick mark, See #2584 for proposal on custom label formatter.

Design

class slider {
  ticks: number[];
  labels: number[];
  steps: number[];
}

Breaking changes:

  1. slider.labelTicks is obsolete
  2. slider.ticks changes from number to number[]

// @driskull @jcfranco

Acceptance Criteria

See above.

Relevant Info

Related issues:

#5522 - calcite-slider > layout vertical and horizontal
#2584 - Enhancement: calcite-slider - custom tick label formatters
#1631 - Enhancement: Configurable slider highlighting

Which Component

calcite-slider

Example Use Case

image

Esri team

ArcGIS API for JavaScript

@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 Nov 29, 2022
@github-actions github-actions bot added the ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. label Nov 29, 2022
@ubatsukh
Copy link

@driskull can you please change the priority of this issue to high as MV is asking for dimension/range slider. @jcfranco, we hope you can work the slider issues when you get back from your paternity leave. :)

The other slider issues that need to be addressed before the Ranger slider widget can be implemented in the API:
#5522
#2584
#1631

Here are the API requirements for the Range Slider: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/46032#issuecomment-3805946

@geospatialem geospatialem added the p - high Issue should be addressed in the current milestone, impacts component or core functionality label Nov 29, 2022
@driskull
Copy link
Member

@ubatsukh marked them as higher priority. We will figure out which milestone these can be taken care of after the 1.0 release.

@brittneytewks brittneytewks added estimate - 13 Requires planning and input from team, consider smaller steps. estimate - 8 Requires input from team, consider smaller steps. and removed estimate - 13 Requires planning and input from team, consider smaller steps. labels Mar 22, 2023
@brittneytewks
Copy link

Better understand user priority. Start in April for future milestone implementation

@brittneytewks brittneytewks added research Issues that require additional research in order to resolve or make decision. and removed needs triage Planning workflow - pending design/dev review. labels Mar 22, 2023
@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 Mar 29, 2023
@geospatialem geospatialem added 0 - new New issues that need assignment. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Apr 6, 2023
@geospatialem geospatialem added p - medium Issue is non core or affecting less that 60% of people using the library and removed p - high Issue should be addressed in the current milestone, impacts component or core functionality labels Apr 6, 2023
@jcfranco jcfranco added 1 - assigned Issues that are assigned to a sprint and a team member. 2 - in development Issues that are actively being worked on. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Nov 13, 2023
@jcfranco
Copy link
Member

jcfranco commented Nov 23, 2023

Apologies for the belated update, but I think I have an idea on how to implement this without introducing a breaking change.

This is what it could look like:

class Slider {
  ticks: number | number[]; 
  labelTicks: boolean | number[];
  step: number | number[];
}

Worth noting that we cannot rely entirely on arrays for these properties because they would prevent users from setting these in markup (we don't support passing rich data as attributes, see https://web.dev/articles/custom-elements-best-practices#aim-to-only-accept-rich-data-objects,-arrays-as-properties for more info).

I'm planning to sync up with @richiecarmichael and also have some additional time for testing. With that said, this would have to be pushed to December.

@jcfranco jcfranco removed the breaking change Issues and pull requests with code changes that are not backwards compatible. label Nov 23, 2023
@jcfranco jcfranco added p - high Issue should be addressed in the current milestone, impacts component or core functionality and removed p - medium Issue is non core or affecting less that 60% of people using the library labels Nov 23, 2023
@jcfranco
Copy link
Member

Bumped the priority on this one. cc @brittneytewks @geospatialem

@geospatialem
Copy link
Member

Additional efforts are needed to address prior to landing the fix, which are now targeted for the January 2024 release.

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. c-slider Issues that pertain to the calcite-slider component enhancement Issues tied to a new feature or request. estimate - 8 Requires input from team, consider smaller steps. p - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

7 participants