Fix #140: Add ability to disable automatic showSelected on legends#292
Fix #140: Add ability to disable automatic showSelected on legends#292ANAMASGARD wants to merge 9 commits intomasterfrom
Conversation
- Add check for showSelected=character() to opt out of auto-selector - Clear legend when user explicitly disables showSelected - Selector not created in info when opted out - Legend still renders with entries (display-only) FIXES #140
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #292 +/- ##
=======================================
Coverage 77.71% 77.72%
=======================================
Files 164 164
Lines 8769 8771 +2
Branches 555 555
=======================================
+ Hits 6815 6817 +2
Misses 1954 1954
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:
|
|
No obvious timing issues in HEAD=fix/legend-without-showSelected Generated via commit cac3261 Download link for the artifact containing the test results: ↓ atime-results.zip
|
| ## Proposed API: empty character vector disables auto showSelected from legend | ||
| ## This is consistent with existing API where showSelected accepts character vectors |
There was a problem hiding this comment.
I like this API idea, thanks!
But I don’t know if this is the right approach.
Can you please re-do https://tdhock.github.io/2024-07-10-figure-scatter-qsip/ with this new code so we can see the result?
|
Sir @tdhock! Done — here is the re-done visualization: I added a 4th plot "NEW: legend with color, no auto showSelected" that demonstrates the fix for #140 :-
Confirmed in Please let me know if this is the result you were expecting and review it , thank you . |
|
ok this is definitely better, but the legend in the new plot is non-interactive. |
…ected=character() opt-out
tdhock
left a comment
There was a problem hiding this comment.
please remove empty lines in test_that blocks
|
Also Sir @tdhock Sorry to tell you that in the gallery by mistake without your permission I merged it. |
tdhock
left a comment
There was a problem hiding this comment.
instead of testing not null, test the value
|
please can you update https://anamasgard.github.io/2024-07-10-figure-scatter-qsip ? |
|
Updated :- https://anamasgard.github.io/2024-07-10-figure-scatter-qsip/ |


Issue
FIXES #140
Problem
Using
aes(color=variable)forcesshowSelectedbehavior on the legend with no opt-out.This PR { First commit }
Adds failing test proposing
showSelected=character()to disable automatic selector.