Skip to content

feat: Show connect by feature value in tooltip - #301

Open
ShrimpCryptid wants to merge 6 commits into
feat/line-smoothingfrom
feat/line-tooltip
Open

feat: Show connect by feature value in tooltip#301
ShrimpCryptid wants to merge 6 commits into
feat/line-smoothingfrom
feat/line-tooltip

Conversation

@ShrimpCryptid

@ShrimpCryptid ShrimpCryptid commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Problem

This change adds an additional line of text to the tooltip, that appears when connecting points by a feature value. This shows the feature name and value for the hovered point.

Estimated review size: small, 10 minutes

Solution

  • Updated MainPlotContainer/selectors.ts to write the connect by feature's values to the Plotly customdata.
  • Updated the type of the hovered cell data to include the connect by feature.
  • Passed the connect by feature name + value to the mouse popup shown in the main plot view.

Type of change

  • New feature (non-breaking change which adds functionality)

Steps to Verify:

  1. Open PR preview: https://allencell.github.io/cell-feature-explorer/pr-preview/pr-301/?cellSelectedFor3D=2800&colorBy=trajectory_id&dataset=csv&csvUrl=https%253A%252F%252Fvast-files.int.allencell.org%252Fusers%252Fmajid.farhadloo%252F2026-07-23%252Fdetect_normal_abnormal_growth%252Flumenoid_laca_8593__frame_embeddings.csv&plotByOnX=pacmap_y&plotByOnY=pacmap_x&groupBy=trajectory_id&connectByCategory=trajectory_id&connectByFeature=timepoint&connectBy=true&selectedPoint%5B0%5D=2800
  2. Hover over any cell. The current timepoint should appear in the tooltip.
  3. Turn off the connecting lines from the left panel. Hover points again; the timepoint feature will not be shown.

Screenshots (optional):

Video talk-through (🔊):

2026-08-12.14-45-48.mp4
{174A923B-D7E9-4E86-913F-A837087F2458}

@ShrimpCryptid ShrimpCryptid self-assigned this Aug 11, 2026
@ShrimpCryptid ShrimpCryptid added the enhancement New feature or request label Aug 11, 2026
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
PR Preview Action v1.6.3

🚀 View preview at
https://AllenCell.github.io/cell-feature-explorer/pr-preview/pr-301/

Built to branch gh-pages at 2026-08-20 18:21 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment thread src/state/types.ts
export interface PlotlyCustomData {
thumbnailPath: string;
index: number;
srcPath?: string;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added srcPath, since it was being defined in getPlotlyCustomData() in MainPlotContainers/selectors.ts.

Comment on lines +559 to +568
const getFeatureTickConversion = (
featureKey: string,
featureDefs: MeasuredFeatureDef[]
): TickConversion => {
const feature = find(featureDefs, { key: featureKey });
if (feature && feature.discrete) {
return makeNumberToTextConversion(feature.options);
}
return makeNumberAxis();
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved repeated logic out of getXTickConversion and getYTickConversion.

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.

Pull request overview

Adds support for showing the “connect-by” feature value in the main plot hover tooltip (line tooltip), wiring the value through Plotly customdata, selection hover state, formatting selectors, and the PopoverCard UI.

Changes:

  • Extend hover/customdata types to carry srcPath and a connect-by feature value.
  • Add selectors to format/display the connect-by feature name/value (including tick conversion).
  • Render connect-by label/value in PopoverCard when available.

Reviewed changes

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

Show a summary per file
File Description
src/state/types.ts Extends PlotlyCustomData to include srcPath and connect-by value.
src/state/selection/types.ts Extends hovered point payload type to include connect-by value.
src/containers/MainPlotContainer/selectors.ts Populates Plotly customdata with connect-by values; adds formatting/display selectors for connect-by.
src/containers/MainPlotContainer/index.tsx Passes connect-by hover value into state and down to the tooltip UI.
src/components/PopoverCard/index.tsx Adds optional line label/value rows to the tooltip card.
Suppressed comments (1)

src/containers/MainPlotContainer/index.tsx:284

  • lineValue is always passed as a string, so PopoverCard will render the line row even when the formatted value is empty (e.g., when connect-by lines are disabled and the value is missing). Pass undefined when there is no value to display so the row is suppressed.
                    lineLabel={connectByFeatureDisplayName}
                    lineValue={hoveredConnectByFeatureValue}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/containers/MainPlotContainer/index.tsx Outdated
Comment thread src/containers/MainPlotContainer/selectors.ts
@ShrimpCryptid ShrimpCryptid changed the title Feat/line tooltip feat: Show connect by feature value in tooltip Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Image

Updated rendering for the feature values at the bottom of this popover

Comment on lines 203 to +211
changeHoveredPoint({
[CELL_ID_KEY]: point.id,
index: point.customdata.index,
thumbnailPath: point.customdata.thumbnailPath,
srcPath: point.customdata.srcPath,
xValue: point.x,
yValue: point.y,
});
connectByFeatureValue: point.customdata.connectByFeature,
} satisfies SelectedPointData);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The type of SelectedPointData was updated to include the new field. I added in the satisfies syntax because changeHoveredPoint seems to take any by default.

@ShrimpCryptid
ShrimpCryptid marked this pull request as ready for review August 12, 2026 21:25
@ShrimpCryptid
ShrimpCryptid marked this pull request as draft August 12, 2026 21:28
@ShrimpCryptid
ShrimpCryptid marked this pull request as ready for review August 12, 2026 21:48
(
filteredCellData: DataForPlot,
showConnectByLines: boolean,
connectByFeature: string

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What are the potential values of connectByFeature? It's not immediately obvious to me. Is it an enum in practice or something else?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's the string key of any feature in the currently-loaded dataset!

@pgarrison pgarrison left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants