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

Timeslider labels - Create option to hide or disable them #300

Open
dan-bowerman opened this issue May 16, 2024 · 4 comments
Open

Timeslider labels - Create option to hide or disable them #300

dan-bowerman opened this issue May 16, 2024 · 4 comments
Labels
Consult UI/UX Issues that require consultation with the UI/UX team to move forward Enhancement New feature or request Maps Issues concerning map config generation or the FGPA tool Priority: High This task is high priority and should be tackled soon WCAG Compliance Tasks related to Accessibility and WCAG compliance

Comments

@dan-bowerman
Copy link
Member

Description

image

If a timeslider has too many notches on it, labels can overlap and look messy. Since the value ranges are already described by the label above the slider, perhaps we can have an option to omit labels entirely, showing only the notches.

Alternatives considered

Open to ideas!

@dan-bowerman dan-bowerman added Enhancement New feature or request WCAG Compliance Tasks related to Accessibility and WCAG compliance Priority: Urgent This task should be grabbed before any others Maps Issues concerning map config generation or the FGPA tool labels May 16, 2024
@james-rae
Copy link
Member

If we get dinged for a11y (for no labels or start-end labels not enough), here is a terrible mockup of something that might work. It might also violate a11y rules though (e.g. Rule 1.3, though it can be subjectively interpreted).

image

@james-rae
Copy link
Member

Less visually impressive but I imagine would satisfy a11y. The combos would render upwards when opened on the site (i'm just being lazy with mockups)

image

@dan-bowerman
Copy link
Member Author

From James in the Slack chat:

https://developer.mozilla.org/en-US/docs/Web/CSS/:first-child
So if there's a class targeting whatever contains all the slider ticks, you could probably do something like (CSS will be wrong, just the gist of it)

.listTickClass {
  display: none;
}

.listTickClass:first-child, .listTickClass:last-child {
  display: allgood;
}

Spencer replies:

What James suggested (only first and last label) was done for https://climate-viewer.canada.ca/#/?v=rdpa6&d=capa&cp=-95.80098000546008,59.67409464609375&z=2&ts=1715904000000 and I think it works well.
If we want more labels I remember it being fairly straightforward to have the slider library show every Nth label. Could also be configurable.

@dan-bowerman dan-bowerman added the Consult UI/UX Issues that require consultation with the UI/UX team to move forward label May 17, 2024
@dan-bowerman dan-bowerman added Priority: High This task is high priority and should be tackled soon and removed Priority: Urgent This task should be grabbed before any others labels Jun 6, 2024
@dan-bowerman
Copy link
Member Author

An easy Editor-friendly workaround is to stick the following snippet into any slide:
<style>.time-slider .noUi-value-horizontal { display: none; }</style>

Be advised: This will remove all timesliders labels on the page. There don't appear to be any WCAG or functional consequences to hiding these labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Consult UI/UX Issues that require consultation with the UI/UX team to move forward Enhancement New feature or request Maps Issues concerning map config generation or the FGPA tool Priority: High This task is high priority and should be tackled soon WCAG Compliance Tasks related to Accessibility and WCAG compliance
Projects
None yet
Development

No branches or pull requests

2 participants