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

Proposal for graphics-centric minimized time slider #505

Merged
merged 29 commits into from
Nov 9, 2023

Conversation

bobular
Copy link
Member

@bobular bobular commented Sep 15, 2023

Fixes #514

This is a draft until we get UX approval.

I went further than anticipated and did the following

  1. changed the background to match the header - though I see there's a hardcoded === 'VectorBase' that I copied - do we not have a VectorBase theme? @asizemore was asking about this the other day
  2. changed the layout
    • variable name picker is the axis label in expanded mode
    • no more text to show the selected range, removed "choose a different date variable:"
    • timeline is slimmer when minimized
  3. hiding behaviour is now fully manual
  4. z-index changes
    • header (including EZ slider) is now only at level 2 - this allows draggable panels to be placed over the header (and EZ-slider). Before, it was possible to lose the handle of the draggable under the header or EZ slider.
    • left hand menu is at 10 - it is now not possible to cover the menu expand handle with a draggable.

Still do to

  • z-axis issues w.r.t. floaters (may wait until after refactor merge)
  • when switched off, the x-axis label is not greyed out.
  • rename components
  • remove subset-sensitivity of the timeslider x-axis (the black bars will still be subset-sensitive of course)
  • comment out fake controlled behaviour and investigate any "drift" that might occur from saved analyses (hopefully not)
  • add ticket for figuring out extending "little filters" throughout the app, e.g. the little filter from the marker variable config to the timeslider and floating viz.

@bobular
Copy link
Member Author

bobular commented Sep 15, 2023

Video on Slack https://epvb.slack.com/archives/CMQ8K9XRS/p1694787354770699

If you look carefully, there's a bit of a clash of drop shadows (in the join between header and the slider) - not sure how to fix that.

@bobular bobular marked this pull request as ready for review October 6, 2023 15:17
@bobular
Copy link
Member Author

bobular commented Oct 6, 2023

Ready for review. Open to styling/layout suggestions as always!

Copy link
Contributor

@jernestmyers jernestmyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is looking good, but I have some questions/comments that come to mind that may serve as a start to a future UX discussion.

  1. Should we have an info icon w/ tooltip as part of the on/off toggle that articulates what the actual component is doing? Or does this icon w/ tooltip need to be in a position that would render in the "unexpanded" state?
  2. Because I'm clearly seeing something in the "unexpanded" state that first renders, my brain sort of overlooks the toggle as a way to expand the filter. Instead, my brain sees that toggle as a way to collapse the filter in spite of the arrow down (which should suggest to me that it expands). Perhaps the cognitive dissonance is specific to my feeble brain, though!
  3. Nothing comes to mind as a fix for the drop shadow clashing, though it's not that severe either.

@bobular
Copy link
Member Author

bobular commented Oct 6, 2023

Thanks @jernestmyers - I think we need a small group to figure out the UX issues. Maybe unexpanded is still showing too much?

@jernestmyers jernestmyers self-requested a review October 12, 2023 19:46
@bobular bobular requested a review from dmfalke October 18, 2023 14:36
@bobular
Copy link
Member Author

bobular commented Oct 18, 2023

I merged the filter-sensitivity into this PR.

Then I found an edge case where if you make a selection in the time slider and then change the filters so that the old selection is outside the time range of the current filtered data, that selection lives "off screen" and is still applied as a little filter, giving no results and a 500 (see VEuPathDB/EdaDataService#312)

I thought it would be better to remove the selection/little filter if it has gone off-screen, so added this in the recent commit.

It uses a useEffect however, so would appreciate @dmfalke giving it the once-over.

@dmfalke
Copy link
Member

dmfalke commented Oct 18, 2023

I merged the filter-sensitivity into this PR.

Then I found an edge case where if you make a selection in the time slider and then change the filters so that the old selection is outside the time range of the current filtered data, that selection lives "off screen" and is still applied as a little filter, giving no results and a 500 (see VEuPathDB/EdaDataService#312)

I thought it would be better to remove the selection/little filter if it has gone off-screen, so added this in the recent commit.

It uses a useEffect however, so would appreciate @dmfalke giving it the once-over.

I'm not sure I like the UX here, since it might not be obvious that the time filter was removed. Instead, could we extend the range of the filter to include the selection? Or maybe we should always show the full range (at least for this phase)?

@bobular
Copy link
Member Author

bobular commented Oct 18, 2023

Yes, this is a good point. I was wondering about a snackbar.

But extending the range to include the selection might be good - hadn't thought of that!

@dmfalke
Copy link
Member

dmfalke commented Oct 19, 2023

One other idea... we can turn the slider off and have a message indicating that it contains a selection outside of the subset, and that the user must change the selection to enable it again (or something like that).

@bobular
Copy link
Member Author

bobular commented Oct 19, 2023

Thanks @dmfalke - I have been working on this today and will have something available for testing soon.

I got into a bit of a rabbit hole with semantic zooming and making sure the histogram is robustly showing the correct bin start/ends etc. Nearly done!

@bobular
Copy link
Member Author

bobular commented Oct 23, 2023

Hi all - @jernestmyers @dmfalke @moontrip @chowington

On Friday I did some major readjustments:

  • The "key hack" to make the visx Brush behave like a controlled component wasn't actually working. When I fixed it, it introduced a secondary bug where the brush selection drifted wider with each handle adjustment. I made a very hacky fix (see the +2/-2 discussion). I don't think reverting to uncontrolled behaviour is a great idea (I'm pretty sure the drifting would still happen upon every fresh render of the object (e.g. when opening a saved analysis)).
  • The timeslider visualisation only deals in binStart coordinates. It renders the final bin with a width of zero. Selecting/brushing the entire timeslider was NOT applying a little filter for the whole time range because the right-most date was the binStart of the final bin, not the bin end. Therefore in this line an extra "bin" is added as input to the slider component.
  • The filter-aware (big filters directly on the date variable) behaviour needed to also set the bin width resolution (year/month/week/day).
  • The black bars drawn on the timeslider needed to be different widths in February vs August (for example) - fixed
  • The "auto zoom" (filter and subset sensitive at the moment) behaviour also takes into account the user's pink selection. This means that the selection doesn't go off-screen while still active.
  • Structured, and hopefully improved, the tooltip text

@bobular bobular requested a review from jernestmyers November 1, 2023 13:45
Copy link
Member Author

@bobular bobular left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to @dmfalke and @jernestmyers for the sync review. Notes below

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call it TimeSlider.tsx?

@@ -143,23 +149,28 @@ function EzTimeFilter(props: EzTimeFilterProps) {
() =>
selectedRange != null
? {
start: { x: xBrushScale(new Date(selectedRange.start)) },
end: { x: xBrushScale(new Date(selectedRange.end)) },
// The +2 and -2 are a nasty hack that seems to solve a problem
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion to remove fake controlled behaviour - bring it back only when we need to (date picker inputs)

Investigate need for adjustment +2/-2 when loading saved analysis - check for no "drift" at either end of range after adjusting the other... - remove it if not needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe don't let the range be subset sensitive
image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also take care of non-date number handling

@bobular
Copy link
Member Author

bobular commented Nov 5, 2023

I removed the "controlled" nature of the Brush.

If you duplicate a browser tab with a pink date range, it will shift to the left a bit, but the underlying little filter does not change. I think this OK.

@bobular
Copy link
Member Author

bobular commented Nov 7, 2023

This is ready for final review. Feedback from our meeting has been taken on board and sorted, thanks! :-) @dmfalke @jernestmyers

end: xAxisRange
? endDate > xAxisRange.end
? xAxisRange.end
: endDate
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just spotted I need to fix up the dependencies below. Will do so.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ✔️

@bobular
Copy link
Member Author

bobular commented Nov 7, 2023

With react-query's client-side caching we are a step closer to DIY timeline animations.
To demo this, expand the tab, make a time selection and toggle it on and off.

If we add the ⬅️ and ➡️ buttons that move the selection left/right, that will eventually all get cached.

However, such controls will need re-enabling the fake controlled component behaviour.

@jernestmyers
Copy link
Contributor

If I have no filters and select the entire time slider, should my View count not also match the All and Filtered counts?
image

Copy link
Member

@dmfalke dmfalke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good to me

new Date(filterRange.max as string),
unit as DateMath.Unit
);
return diff >= 12;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you arrive at 12?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left home at about 11:30 !

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it was more "if there are more than 12 days, use weeks. If there are more than 12 weeks, use months, and so on."

Maybe it's too small. If there are 13 months, do we really want year bins? Perhaps 30 would be better.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll go with 30. And leave a comment.

@dmfalke
Copy link
Member

dmfalke commented Nov 7, 2023

If I have no filters and select the entire time slider, should my View count not also match the All and Filtered counts? image

Could this be explained by only a subset of markers having data for the time filter variable?

@bobular
Copy link
Member Author

bobular commented Nov 8, 2023

Could this be explained by only a subset of markers having data for the time filter variable?

Yes, and/or lat/long and/or the marker variable (though species has 100% coverage - a rarity)

@bobular bobular merged commit 5c2a920 into main Nov 9, 2023
1 check passed
@bobular bobular deleted the timeslider-mini-graphical branch November 9, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Map - slim down time slider and address some usability issues.
5 participants