Repository navigation
Fix/318 single trace categorical coloring - #319
Merged
Merged
Conversation
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The master checkbox omits the conditional N/A row from its category count, causing an incorrect indeterminate state when rows with missing data are shown or hidden.
1 open issue
What changed in this PR
This PR addresses #318 by reducing memory use and processing overhead when plotting features with thousands of categories.
Changes:
- Replace Plotly category transforms with a single scatter trace using per-point colors.
- Use maps and sets for category lookups, and avoid mutating memoized category arrays.
- Simplify scatter types and hover handling, with regression tests for coloring and category-panel behavior.
| File | Description |
|---|---|
src/state/types.ts |
Unify scatter data under ScatterPlotData. |
src/state/selection/selectors.ts |
Use a set for excluded-category filtering. |
src/state/plotlyjs-types.ts |
Remove custom Plotly transform types. |
src/containers/MainPlotContainer/test/selectors.test.ts |
Test single-trace coloring, overrides, and fallback colors. |
src/containers/MainPlotContainer/selectors.ts |
Replace category transforms with per-point colors. |
src/containers/MainPlotContainer/index.tsx |
Simplify hover handling for prefiltered scatter points. |
src/containers/ColorByMenu/test/selectors.test.ts |
Test category names, exclusions, and stable N/A rows. |
src/containers/ColorByMenu/selectors.ts |
Optimize category processing and copy arrays before adding N/A. |
Review effort: Balanced
…o one WebGL trace per category and could not scale to thousands of categories, with a single trace whose marker.color is resolved per point.
interim17
force-pushed
the
fix/318-single-trace-categorical-coloring
branch
from
November 3, 2026 19:30
384b53c to
3dbb05a
Compare
Merged
interim17
marked this pull request as ready for review
November 3, 2026 19:45
interim17
requested review from
ShrimpCryptid and
meganrm
and
a balanced review from Copilot
and removed request for
a team
November 3, 2026 19:45
ShrimpCryptid
approved these changes
Nov 4, 2026
frasercl
approved these changes
Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Advances #318
Features with large number of categories were causing memory use to balloon, slowing down performance or crashing.
Solution
Was able to reproduce the issue, asked Claude to review the repo for performance issues related to the problem, and highlighted a few issues.
This PR addresses the fact that using
plotly'sgroupbytransform was creating a WebGL trace per transform, which allocated memory for each category on many events.mapCategoriesToColorsand directly assign colors to categorical pointsMajid tested a preview branch with the changes here and in #322 and it didn't totally solve the problem, but it prevented crashed on the test data set on my local machine, so seems like this is moving in the right direction.
Screenshots (optional):