Skip to content

Conversation

@ANAMASGARD
Copy link
Contributor

@ANAMASGARD ANAMASGARD commented Jan 23, 2026

Issue

FIXES #140

Problem

Using aes(color=variable) forces showSelected behavior on the legend with no opt-out.

This PR { First commit }

Adds failing test proposing showSelected=character() to disable automatic selector.

Screenshot From 2026-01-23 18-03-07

- 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
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.46%. Comparing base (68b074e) to head (8dcae4f).

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #292       +/-   ##
===========================================
+ Coverage   73.06%   95.46%   +22.39%     
===========================================
  Files         164        1      -163     
  Lines        8758     2754     -6004     
  Branches        0      554      +554     
===========================================
- Hits         6399     2629     -3770     
+ Misses       2359      125     -2234     
Flag Coverage Δ
javascript 95.46% <ø> (+14.70%) ⬆️
r ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tdhock
Copy link
Collaborator

tdhock commented Jan 23, 2026

  • HEAD=fix/legend-without-showSelected slower P<0.01 for getCommonChunk improved in #238
    Comparison Plot

Generated via commit 8dcae4f

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 4 minutes and 32 seconds
Installing different package versions 59 seconds
Running and plotting the test cases 3 minutes and 46 seconds

@ANAMASGARD ANAMASGARD requested a review from tdhock January 23, 2026 15:14
@ANAMASGARD
Copy link
Contributor Author

ANAMASGARD commented Jan 23, 2026

Screenshot From 2026-01-23 20-42-45

Regarding performance

  • The slight slowdown is due to the additional check for showSelected = character().
  • This check is O(1) and runs once per legend per layer.
  • Happy to optimize if needed, but the impact { slowdown } seems minimal.
  • The ghpages test failure is unrelated , All 2116 other tests pass, including the 8 new legend tests.

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.

legend forces showSelected, no way to opt out

3 participants