feat(reports): leftover residual on pair segments (v2.34.0) - #806
Conversation
Caption leftover-map graphic-display pair segments with persisted leftover residual R so U + R̂ = R is graphic-auditable. UI-only; no new columns. Do not invent R from Y and E, from U and R̂, or from plotted coordinates.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Leave open for independent review. Do not squash-merge onto the unprotected leftover base. Do not self-approve. Copilot review is not independent APPROVE. After independent review, retarget onto leftover-coordinates (#782) rather than squash-merging here. |
| const residualY = leftoverMapStackedCaptionY( | ||
| labelPosition.labelY, | ||
| (distanceLabel !== null ? 1 : 0) + | ||
| (reconstructionLabel !== null ? 1 : 0) + | ||
| (explainedShareLabel !== null ? 1 : 0) + | ||
| (unexplainedShareLabel !== null ? 1 : 0) + | ||
| (crossShareLabel !== null ? 1 : 0) + | ||
| (unexplainedLeftoverLabel !== null ? 1 : 0), | ||
| ); |
There was a problem hiding this comment.
🟡 Bottom segment residuals are clipped
When a segment lies near the plot bottom, residualY places its residual label beyond the fixed SVG height. The new caption disappears.
Prompt for agents
The new residual caption uses the seventh downward stack position from the segment midpoint, but the SVG has a fixed 320-pixel height and 40-pixel plot padding. For segments whose endpoints are near the lowest plotted axis value, residualY can exceed the view box and the finite residual caption is clipped. Update the segment-label layout in frontend/src/leftoverMapPlotLayout.ts to choose a stack direction or reserve sufficient bounds based on the complete caption stack. Add a test with a segment near the lower plot boundary that verifies every finite label, including residualLabel, remains inside the SVG view box.
Was this helpful? React with 👍 or 👎 to provide feedback.
| export function formatLeftoverMapResidual(value: number | null | undefined): string | null { | ||
| if (value == null || !Number.isFinite(value)) { | ||
| return null; | ||
| } | ||
| return `R ${formatLeftoverResidual(value)}`; |
|
Independent APPROVE is still required on exact head |
Summary
R = Y − E[Y|θ, item](ADR 0277 / v2.34.0).make seed, closest and farthest leftover pairs sit above the member list with the Gabriel biplot of already-named coordinates, leftover-map axis share when finite, axis ticks that matchξ (x, y) ζ (x, y)on the pair row, pair segments that matchdon the pair row, pair segments that matchR̂on the pair row, pair segments that matchR̂²/R²on the pair row, pair segments that matchU²/R²on the pair row, pair segments that match2R̂U/R²on the pair row, pair segments that matchUon the pair row, and pair segments that matchRon the pair row; click a post marker or a pair button opens that post.Romits that leftover residual caption and keeps the connecting line and any leftover-map distance, reconstruction, explained leftover share, unexplained leftover share, leftover-map cross share, or unexplained leftover caption. Rank-0 origin cells still nameR 0.00when that persisted leftover is finite. A finite negative leftover is shown; do not clamp to nonnegative. Do not inventRfromYandE, fromUandR̂, or from plotted coordinates.feat/leftover-map-segment-unexplained-leftover-v2330/ feat(reports): leftover-map unexplained leftover on pair segments (v2.33.0) #805 @e3fdfd74). Leave this PR open for independent review. Do not squash-merge onto the unprotected leftover base. Do not self-approve. After independent review, retarget onto leftover-coordinates (feat/leftover-map-coordinates-v2240/ feat(reports): persist leftover-map coordinates (v2.24.0) #782) rather than squash-merging here.Verification
tests/test_leftover_pairs.pyand PostgreSQL period-report tests were not executed here (UI-only; no schema change)Evidence boundary
Authenticated PostgreSQL API and k6 runtime acceptance are not claimed. No real records or credentials. Synthetic fixtures only.
Independent approval is required. No self-approval, admin bypass, or force push.
Jeon, M., Jin, I. H., Schweinberger, M., & Baugh, S. (2021). Mapping unobserved item–respondent interactions: A latent space item response model with interaction map. Psychometrika, 86(2), 378–403.
Gabriel, K. R. (1971). The biplot graphic display of matrices with application to principal component analysis. Biometrika, 58(3), 453–467.