Skip to content

legend selector lookups - #322

Merged
interim17 merged 4 commits into
mainfrom
perf/legend-selector-lookups
Nov 12, 2026
Merged

interim17 merged 4 commits into
mainfrom
perf/legend-selector-lookups

Conversation

@interim17

@interim17 interim17 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Advances #318

Features with large number of categories were causing memory use to balloon, slowing down performance or crashing.

This was one PR with #319, split for size/scope.

Solution

Use of .includes when looping over categories is inefficient and can be optimized, saving on resources when loading datasets with large numbers of categories.

  • Count names once in a Map when disambiguating category names
  • Use a Set instead of .includes to check filters and displayable groups

Along with 319, this prevented crashes on the test dataset that Peyton linked in the issue.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.6.3
Preview removed because the pull request was closed.
2026-11-12 20:38 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the category-lookup and legend-state changes.

No open issues 🎉

What changed in this PR

Improves category lookup performance in selection and legend selectors, addressing part of #318’s slowdown with large category counts.

Changes:

  • Replaces repeated array searches with Set lookups and map-based name counting.
  • Derives the “check all” indeterminate state from legend rows, including the N/A category.
  • Adds tests for category naming, excluded categories, and checkbox states.
File Description
src/​state/​selection/​selectors.ts Uses a Set to check excluded categories while filtering cells.
src/​containers/​ColorByMenu/​test/​selectors.test.ts Adds naming, exclusion, and checkbox-state regression tests.
src/​containers/​ColorByMenu/​selectors.ts Optimizes legend lookups and updates indeterminate-state calculation.

Review effort: Balanced

@interim17
interim17 marked this pull request as ready for review November 3, 2026 19:47
@interim17
interim17 requested a review from a team as a code owner November 3, 2026 19:47
@interim17
interim17 requested review from ascibisz and frasercl and removed request for a team November 3, 2026 19:47
@interim17 interim17 changed the title Perf/legend selector lookups legend selector lookups Nov 3, 2026
@interim17
interim17 merged commit 73c47f2 into main Nov 12, 2026
2 checks passed
@interim17
interim17 deleted the perf/legend-selector-lookups branch November 12, 2026 20:37
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.

4 participants