-
Notifications
You must be signed in to change notification settings - Fork 0
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
Map - add forward backward step buttons to easy timeslider - add date pickers too (animation on the cheap) #775
Comments
UPDATE: we can hopefully control the brush directly using the It's still a medium cost ticket but at least this part should be straightforward. |
Has this been discussed in a ux meeting? Just wondering what sort of consensus we have. |
@bobular As a part of this ticket, I have extensively investigated the drift/offset issue. In summary, I found that somehow there exist additional
Thus, I think that we need to consider this inherent drift when changing range at |
Hi @moontrip - did you see my comment above #775 (comment) ? I think we can control the brush without fudge factors? It's a while since I looked at this though. |
@bobular I didn't see that carefully now (but saw that before) as I just focused on the drift issue. I am not quite sure if that updateBrush works better than the current approach: I saw a developer's comment that it is not for fully controlled brush and it is not done yet. The updateBrush approach existed before when I used Reset button: Brush example code used it that way to reset range. Anyway I feel that we would still need to offset the drift either way because the Brush itself seems to have such an inherent drift. |
Ah, I see. I thought the drift arose from the round-trip of setting the brush position from our props, and then reading the brush position back from the visx component, or something. This would be avoided if the component was fully controlled. I'll have to look at it in more detail. |
@bobular From my observation, it is not a kind of numerical error as I can see drift at initial condition: well the term drift may not be appropriate as it looks like Brush just adds additional 2 pixels at start and end (for Brush handle or bound edges? IDK). |
Not sure if either of you have looked at this, but it could account for the offset: https://airbnb.io/visx/docs/brush#Brush_brushRegion. I'm not sure what value we're using, but might be worth playing with it. |
It looks like the option is just to choose what will be filtered via Brush, e.g., chart, xAxis, or yAxis, not range: default value is |
This part of the description caught my eye:
|
@dmfalke Yeah it's indeed confusing 😅 |
@bobular I have tested to consider the inherent(?) offset of 2 pixels as I mentioned earlier. For the example of the Geolocation visualizations of field-based studies and time slider's variable of 'species collection start date', such a 2 pixel results in about 4 months, because the data ranges widely (from 1907 to 2024). I made a draft PR just in case: #1076 |
So - after #1076 there is probably no need to use the |
As per title.
It's not trivial, however, because of the issue below. The
Brush
component will need to be controlled/controllable. If/when it's controllable, we can add date pickers (date inputs) in the expanded version of the component to allowed precise settting of the window.After a lot of back and forth between controlled and uncontrolled behaviour of the visx
Brush
sub-component of the time-slider, we decided to leave it uncontroled. The main problem was with a drift/offset being introduced in the "round trip" between appState and component state as described in this comment:web-monorepo/packages/libs/components/src/components/plotControls/TimeSlider.tsx
Lines 159 to 162 in a942e92
The text was updated successfully, but these errors were encountered: