-
Notifications
You must be signed in to change notification settings - Fork 29
Fix update_axes to respect selector duration instead of hardcoded 1000ms #277
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
base: master
Are you sure you want to change the base?
Conversation
- Modified update_axes() to accept v_name parameter - Changed duration from hardcoded 1000ms to Selectors[v_name].duration - Defaults to 0ms (no transition) when duration not specified - Added test to verify 2000ms custom duration is respected
tdhock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix test failures before asking for review
- Changed condition from 'Selectors[v_name].duration' to 'hasOwnProperty("duration")'
- Previous check failed when duration explicitly set to 0 (falsy value)
- Now properly distinguishes between 'duration not specified' vs 'duration=0'
- Updated test to use factor selector for reliable axis domain changes
Added typeof check to ensure duration is a valid number before using it. This prevents issues if duration is set to undefined, null, or other types.
Test now properly creates axis domains that change between years.
tdhock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please simplify
JavaScript: Use simple '|| 0' instead of multiple checks Test: Check tick changes instead of axis transform positions
The test was passing the entire HTML document to getTickDiff() instead of extracting the axis node first using getNodeSet(). This follows the pattern used in test-renderer3-update-axes.R.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #277 +/- ##
==========================================
+ Coverage 69.53% 73.08% +3.55%
==========================================
Files 163 164 +1
Lines 6004 8766 +2762
==========================================
+ Hits 4175 6407 +2232
- Misses 1829 2359 +530
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Sir @tdhock Can you please review this PR now and give your feedback is there anything I need to change . |
|
Replaced magic numbers with unequal() function using tolerance parameter, following the same pattern as [test-renderer3-update-axes. |
|
I sincerely apologize Sir you are absolutely right I should have followed your previous feedback
|
38b2082 to
8e9d103
Compare
…ctor - Pass v_name parameter to update_axes() to access selector duration - Use selector's duration instead of hardcoded 1000ms - Fix selector to use Plots[p_name].plot_id instead of manual construction - Add null check for v_name before accessing Selectors
…ctor - Pass v_name parameter to update_axes() to access selector duration - Use selector's duration instead of hardcoded 1000ms - Fix selector to use Plots[p_name].plot_id instead of manual construction - Add null check for v_name before accessing Selectors - Fix test-compiler-ghpages.R to exclude common chunk TSV files from count
Fixes #276
Problem
The
update_axes()function in the JavaScript renderer was using a hardcoded transition duration of 1000ms, regardless of what duration was set for the selector triggering the axis update.This meant that when a user specified
duration=list(year=2000)for a year selector, clicking to change years would cause:Testing
Added
test-renderer3-update-axes-duration.Rwhich:duration=list(year=2000)This failing test committed first, then the fix in a upcoming commits .