Skip to content

Fix ParallelCoordinates/Legend bugs, add general hide-data-point filtering - #269

Merged
IPWright83 merged 4 commits into
masterfrom
claude/parallel-coords-fixes-6tj328
Aug 25, 2026
Merged

IPWright83 merged 4 commits into
masterfrom
claude/parallel-coords-fixes-6tj328

Conversation

@IPWright83

@IPWright83 IPWright83 commented Aug 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up fixes/features on the recently-merged <ParallelCoordinates> chart:

  1. Canvas brushing demo - added a CanvasBrushFiltering story showing brushing works identically with useCanvas.
  2. 10,000-row batch canvas demo - added a LargeDataset story (combined with brushing, per the ask) exercising Canvas's progressive/batched rendering (PROGRESSIVE_RENDER_THRESHOLD).
  3. Fixed a real bug: a row a brush had faded out (BRUSHED_OUT_OPACITY) still responded to mouseover/click - on Canvas this was especially bad, since the virtual hit-test canvas always hit-tests at full opacity/a widened stroke (renderPolyline's overrideColor path), so a nearly-invisible brushed-out row could still pop up a tooltip. A brushed-out row is now purely visual - still drawn faded for context, but non-interactive.
  4. General "hide data point" filtering: added chartActions.hideDataPoint/clearHiddenData, read by chartSelectors.data so a hidden datum disappears for every plot/axis/scale, not just faded (unlike the existing per-field chartActions.setFilter). Wired the previously-stubbed "Hide data point" <ContextMenu> action up to it via a new useDatumContextMenu hook, left-clickable on <Scatter>, <Bar>/<GroupedBar>/<StackedBar>, <Column>/<GroupedColumn>/<StackedColumn>, <Pie>/<Donut>, <Line>/<Area>/<StackedArea>, <Radar>, <RadialArea>, <Treemap>, <CirclePacking>, <WordCloud> and <Funnel> - alongside whatever that plot's own onClick prop already does. Right-clicking a mark is deliberately left alone (falling through to the browser's native menu), reserved for the background menu. Not supported on <ParallelCoordinates>, which already has its own brush-based filtering. <ContextMenuOverlay>'s default getItems now shows the datum items automatically for a "datum" context, and the background "Reset filters" action (now also part of getDefaultBackgroundItems) clears hidden data too.
  5. Fixed a real bug: dragging the <Legend> around resized it - picking it up substituted generic, direction-agnostic maxWidth/maxHeight for whatever direction-specific clamp (getLegendMaxDimensions) it was rendered with while docked, and since the box has no explicit size of its own, that mismatch reflowed/clipped it the instant it was grabbed. Its on-screen size is now pinned to whatever it was at pickup for the whole drag.

Test plan

  • pnpm --filter '@chart-io/core' build + types - no errors in changed files
  • Full core Jest suite: 19 suites, 276 tests passing
  • Full react Jest suite: 93 suites, 482 tests passing
  • eslint clean on all changed files
  • Added/updated unit tests for every behavioural change, including two regression tests verified to fail against the pre-fix code (ParallelCoordinates brushed-out-row interactivity, Legend drag-resize) and pass against the fix
  • Added a changeset (.changeset/parallel-coordinates-followups.md)
  • Manual/visual check of the new Storybook stories (Canvas brushing, 10k-row dataset) - recommend a Storybook/Chromatic run before merge

🤖 Generated with Claude Code

https://claude.ai/code/session_012eVUkMSsPgX1LbWuFDkRJy


Generated by Claude Code

…ering

- ParallelCoordinates: a brush-filtered-out row no longer responds to
  mouseover/click (it stayed hit-testable, especially on Canvas where the
  virtual hit-test layer always paints at full opacity/width), even though
  it's still drawn faded for context.
- LegendOverlay: dragging no longer resizes the Legend - its on-screen size
  is now pinned at pickup instead of falling back to generic, direction-
  agnostic max-width/max-height mid-drag.
- Add a general chartActions.hideDataPoint/clearHiddenData mechanism, read
  by chartSelectors.data so a hidden datum is excluded for every plot/axis/
  scale, not just faded. Wires up the previously-stubbed "Hide data point"
  ContextMenu action via a new useDatumContextMenu hook, right-clickable on
  Scatter, Bar/GroupedBar/StackedBar, Column/GroupedColumn/StackedColumn,
  Pie/Donut, Line/Area/StackedArea, Radar, RadialArea, Treemap,
  CirclePacking, WordCloud and Funnel. <ContextMenuOverlay>'s default
  getItems now shows datum items automatically for that context, and the
  background "Reset filters" action clears hidden data too.
- Add Storybook stories demonstrating brushing on Canvas and with a
  10,000-row dataset exercising Canvas's progressive/batched rendering.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eVUkMSsPgX1LbWuFDkRJy
@changeset-bot

changeset-bot Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: edca195

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@chart-io/core Minor
@chart-io/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Right-click is reserved for the chart's own background menu. A mark's
datum context menu now opens via the same left-click handler as the
plot's existing onClick prop (calling both), instead of a separate
"contextmenu" listener - which also simplifies the Canvas plumbing back
to just click/mousemove, since a left click already flows through the
existing virtual-canvas click handling.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eVUkMSsPgX1LbWuFDkRJy
@IPWright83
IPWright83 marked this pull request as ready for review August 25, 2026 17:41
claude added 2 commits August 25, 2026 19:34
The chromatic job only runs when pull_request.draft == false, but the
workflow triggers on opened/synchronize/reopened - not
ready_for_review - so marking the PR ready didn't fire a new run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eVUkMSsPgX1LbWuFDkRJy
A single colour with a low theme.series.opacity lets overlapping rows
blend into visibly darker bands wherever the data is denser, instead of
categorical colouring drowning out that signal at 10,000 rows.

Also exclude the story from Chromatic snapshotting - a large,
progressively-rendered Canvas capture adds little as a pixel-diff
baseline, the same call already made for Scatter's own large-dataset
story.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eVUkMSsPgX1LbWuFDkRJy
@IPWright83
IPWright83 merged commit 904c3c2 into master Aug 25, 2026
7 checks passed
@IPWright83
IPWright83 deleted the claude/parallel-coords-fixes-6tj328 branch August 25, 2026 20:00
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.

2 participants