feat(reports): leftover-map singular values on grouping comparison graphic (v2.78.0) - #861
Conversation
…aphic (v2.78.0) Caption persisted leftover-map singular values σ_k on the grouping comparison leftover-map graphic from already-named leftover-map axes (ADR 0321). Share and singular value omit independently. Rank-0 unused axes still name σ 0.00. Do not invent σ from leftover-map axis share. Synthetic fixtures only.
|
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 |
|
Stacked on #860 @ |
| return tf(LEFTOVER_MAP_COMPARE_PLOT_AXIS_SINGULAR_SHARE, { | ||
| axis: axisIndex, | ||
| value: singular, | ||
| share: percent, | ||
| }); |
There was a problem hiding this comment.
🟡 Second-axis singular value is clipped
When axis 2 has a singular value, leftoverMapPlotAxisText expands its fixed-position label beyond the 480-pixel SVG. The value is visibly clipped.
Prompt for agents
The comparison variant now renders a substantially longer axis label, but axis 2 remains positioned at layout.originX + 8 with the default start anchor in frontend/src/components/LeftoverMapPlot.tsx. In the fixed 480px SVG, the English singular-value label already extends beyond the right boundary; translations can be longer. Adjust the axis-label rendering so the full singular value and optional share remain visible for both axes and all supported locales. Consider separate visible SVG text and accessible naming, wrapping, repositioning, or a compact visual format, while preserving the ADR 0321 accessible-name contract and the independent omission behavior.
Was this helpful? React with 👍 or 👎 to provide feedback.
| export function leftoverSingularForAxis( | ||
| axes: ReadonlyArray<LeftoverMapPlotAxisSingular> | null | undefined, | ||
| axisIndex: number, | ||
| ): number | null { | ||
| const axis = axes?.find((candidate) => candidate.axis_index === axisIndex); | ||
| if ( | ||
| axis == null || | ||
| axis.leftover_singular_value == null || | ||
| !Number.isFinite(axis.leftover_singular_value) || | ||
| axis.leftover_singular_value < 0 | ||
| ) { | ||
| return null; | ||
| } | ||
| return axis.leftover_singular_value; |
| if (variant === "comparison") { | ||
| if (percent === null) { | ||
| const singular = formatLeftoverMapPlotAxisSingular( | ||
| leftoverSingularForAxis(leftoverMapAxes, axisIndex), | ||
| ); | ||
| if (singular === null && percent === null) { | ||
| return t(axisIndex === 1 ? LEFTOVER_MAP_COMPARE_PLOT_AXIS_1 : LEFTOVER_MAP_COMPARE_PLOT_AXIS_2); | ||
| } | ||
| return tf(LEFTOVER_MAP_COMPARE_PLOT_AXIS_SHARE, { axis: axisIndex, share: percent }); | ||
| if (singular === null) { | ||
| return tf(LEFTOVER_MAP_COMPARE_PLOT_AXIS_SHARE, { axis: axisIndex, share: percent }); | ||
| } | ||
| if (percent === null) { | ||
| return tf(LEFTOVER_MAP_COMPARE_PLOT_AXIS_SINGULAR, { axis: axisIndex, value: singular }); | ||
| } | ||
| return tf(LEFTOVER_MAP_COMPARE_PLOT_AXIS_SINGULAR_SHARE, { | ||
| axis: axisIndex, | ||
| value: singular, | ||
| share: percent, | ||
| }); | ||
| } | ||
| if (percent === null) { | ||
| return t(axisIndex === 1 ? "leftover-map axis 1" : "leftover-map axis 2"); |
There was a problem hiding this comment.
📝 Info: Report labels remain isolated
The singular-value branch runs only for comparison graphics. Report graphics retain their existing share-only labels.
(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
make seed, closest and farthest leftover pairs sit above the member list with leftover-map singular values σ_k on that grouping comparison leftover-map graphic when those persisted singular values are finite and non-negative; click a post marker or a pair button opens that post.leftover map comparison graphic leftover-map axis {axis} σ {value}so it stays distinct from hyphenleftover-map axis {axis} σ {value}, from pair-listleftover axis {axis} σ {value}, from comparison axis-shareleftover map comparison axis {axis} ({share}%), and from comparison ticksleftover map comparison graphic leftover-map axis {axis} tick {value}.leftover map comparison axis {k}; share only staysleftover map comparison axis {k} ({share}%); σ_k only isleftover map comparison graphic leftover-map axis {k} σ {value}; both isleftover map comparison graphic leftover-map axis {k} σ {value} ({share}%). A missing, non-finite, or negative singular value omits that σ badge and keeps leftover-map axis share when finite. Rank-0 origin cells still nameσ 0.00when that persisted singular value is a finite non-negative number.feat/leftover-map-compare-plot-ticks-v2770/ feat(reports): leftover-map coordinate ticks on grouping comparison graphic (v2.77.0) #860 @40fa5bd). 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. Issues Milestone 2: port verified direct-PostgreSQL analysis into the protected product architecture #79 and Milestone 2.1: add normalized runtime-analysis schema bridge after v0.77 #87 stay open. Do not merge revert: undo #782 squash until independent APPROVE #808 without independent APPROVE.Test plan
leftoverMapPlotAxisSingular.test.tsreads 1.84/0.86, names rank-0 0, omits NaN/Infinity/null/negative, does not invent σ from leftover-map axis share, keeps comparison copy distinct from hyphen graphic σ, pair-list σ, comparison axis share, and comparison ticksLeftoverMapPlot.test.tsxcomparison graphic: namesσ 1.84 (82%)/σ 0.86 (18%); omits invented σ when share-only; names rank-0σ 0.00; σ-only when share is NaN; does not useleftover-map axis 1 σ 1.84orleftover axis 1 σ 1.84App.test.tsxgrouping comparison leftover-map graphic names leftover-map comparison graphic leftover-map axis σ; period-report graphic keeps leftover-map axis share copyi18n.test.tsrequired keys for σ + σ-share in ko/zh/ja/viApp.test.tsx,LeftoverMapPlot.test.tsx,LeftoverPairList.test.tsx,i18n.test.ts, leftover-map helpers)make seed, grouping comparison leftover pairs name leftover-map singular values on the comparison graphic; click opens that post.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.