Skip to content

Conversation

@bencap
Copy link
Collaborator

@bencap bencap commented Dec 15, 2025

This pull request implements several improvements to the histogram and heatmap components, focusing on selection synchronization, user interaction enhancements, and code maintainability. The most significant changes include adding selection synchronization between multiple histograms, introducing a lockable selection mode, and enhancing the heatmap tooltip experience with persistent, dismissible tooltips. Additionally, new event APIs and utility methods were added to support these features.

Histogram Selection Synchronization and Locking:

  • Added a lockSelection prop and logic to ScoreSetHistogram.vue to allow locking the selection, preventing user changes when set. This is used in VariantMeasurementView.vue to keep the focus on a specific variant. [1] [2] [3] [4]
  • Introduced a new selection-changed event in ScoreSetHistogram.vue and corresponding handler logic in ScoreSetView.vue to synchronize bin selections across multiple histogram instances. The new syncSelectBin method enables programmatic selection of bins by range. [1] [2] [3] [4] [5]

Heatmap Tooltip and Interaction Enhancements:

  • Improved the heatmap's selection tooltip in heatmap.ts to be persistent, dismissible with a close button, and to prevent accidental closure from inside clicks. Tooltip content is now managed inside a persistent container, and outside-click handling is instance-scoped for better reliability. [1] [2] [3] [4] [5]
  • Refined tooltip positioning and ensured proper cleanup of event handlers and DOM elements when heatmap instances are destroyed or re-rendered. [1] [2] [3]

API and Type Improvements:

  • Extended the histogram API in histogram.ts to include a selectionChanged event accessor and a bins getter, facilitating better external control and synchronization. [1] [2] [3]

These changes collectively improve the usability and maintainability of histogram and heatmap visualizations, especially in workflows requiring coordinated selection or persistent focus.

Enhancements to the heatmap selection tooltip to treat it more as an overlay panel than a tooltip.
- Added the ability to close/minimize the tooltip.
    - Added a close button to the top right of the tooltip.
    - Clicking outside of the tooltip (inside the heatmap container) will also close the tooltip. Note that a body watcher was also considered, but was decided on being too aggresive given the amount of interactive elements on the page.
- Altered the behavior for clicking a selected datum:
    - If the tooltip was been dismissed: bring it up again
    - If the tooltip is up: deselect the datum
    - If the datum is unselected: select it and bring up the tooltip
- Added an instanceId retain a reference to a constructed heatmap when multiple are registered
- Improved the positioning of tooltips which would have overflowed the right of the current viewport.
- Histogram selection tooltip upgraded to an overlay panel with persistent content and a close button; outside-click closes within container; handlers cleaned up on destroy/render.
- Bin click behavior standardized: clicking an unselected bin selects + shows panel; clicking the selected bin re-shows panel (datum content if available); clicks don’t deselect; stopPropagation prevents accidental close.
- Hover behavior refined: hover shows hover tooltip and hides selection panel; panel only returns on click.
- Positioning fixed: tooltip uses bin width for spacing, flips to avoid overflow, and clamps within container bounds; improved vertical placement.
- Selection events added: binSelected callback emits on bin selection, datum selection (after resolving bin), and clear to inform external components.
In addition, implements an interface for selecting a bin based on a bins [x0, x1] range. This is useful for keeping bins in sync across histogram instances on the same page.
@bencap bencap requested review from jstone-dev and sallybg December 15, 2025 22:59
@bencap bencap linked an issue Dec 16, 2025 that may be closed by this pull request
Base automatically changed from davereinhart/primevue-upgrade to release-2025.5.3 December 18, 2025 00:19
@bencap bencap changed the base branch from release-2025.5.3 to release-2025.6.0 January 5, 2026 22:14
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.

Variant tooltip can cover interactive elements

2 participants