Skip to content

Enable spike lines on scatter plot axes#267

Draft
Copilot wants to merge 20 commits into
mainfrom
copilot/display-x-and-y-values
Draft

Enable spike lines on scatter plot axes#267
Copilot wants to merge 20 commits into
mainfrom
copilot/display-x-and-y-values

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 9, 2026

Time to review: Medium

Problem
Closes #102

Solution
Changed the settings for the plot to include spike lines and the x and y values in the pop over card. Having the background of the plot set to transparent made the spike lines render white.

Question:
Should the spike lines go under the annotation popup?

Screenshot 2026-05-28 at 5 28 50 PM

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 9, 2026

PR Preview Action v1.6.3

🚀 View preview at
https://allen-cell-animated.github.io/cell-feature-explorer/pr-preview/pr-267/

Built to branch gh-pages at 2026-05-29 00:37 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Co-authored-by: meganrm <5170636+meganrm@users.noreply.github.com>
Copilot AI changed the title [WIP] Display x and y values on plot axes Enable spike lines on scatter plot axes Mar 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enables Plotly spike lines on the scatter plot's main x/y axes and surfaces the hovered point's x and y values inside the existing PopoverCard, so users can read precise coordinates without relying on Plotly's unavailable axis spike labels (the app uses hovermode: "closest"). To make spike lines render correctly, plot_bgcolor is changed from transparent to solid black, and a palette is introduced for shared color constants.

Changes:

  • Configure showspikes/spike styling on main axes in MainPlot and set a solid dark plot_bgcolor via a new spikeColor constant.
  • Capture hovered x/y on the point, plumb them through SelectedPointData, add selectors (getXDisplayName, getYDisplayName, getFormattedHoveredX/YValue) with categorical-aware formatting, and render them in PopoverCard.
  • Add selector unit tests and design/plan docs.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/components/MainPlot/index.tsx Adds spike line settings to the main axes.
src/constants/index.ts Reorganizes palette and adds spikeColor; changes backgroundColor to opaque black.
src/state/selection/types.ts Adds optional xValue/yValue to SelectedPointData.
src/containers/MainPlotContainer/index.tsx Captures hovered x/y and passes formatted values + labels to PopoverCard.
src/containers/MainPlotContainer/selectors.ts New display-name and formatted-hovered-value selectors.
src/containers/MainPlotContainer/test/selectors.test.ts Tests for new selectors.
src/components/PopoverCard/index.tsx Renders optional x/y rows in the popover.
src/components/PopoverCard/style.css Styles for the new axis-value rows.
docs/superpowers/specs/2026-05-28-spike-lines-styling-design.md New design doc.
docs/superpowers/plans/2026-05-28-spike-lines-styling.md New implementation plan.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

export const getYDisplayName = createSelector(
[getPlotByOnY, getMeasuredFeaturesDefs],
(plotByOnY, featureDefs): string => {
const feature = find(featureDefs, { key: plotByOnY });
Comment on lines +84 to +86
### 3. Spike line color (already done)

`GENERAL_PLOT_SETTINGS.spikeColor` was updated to `"rgb(0, 0, 0)"` in Task 1. This remains correct.
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.

Display x and y values on axes

3 participants