From 5657191f12035045238b6bd5e8e1e291565fd02f Mon Sep 17 00:00:00 2001 From: holoros Date: Thu, 11 Jun 2026 21:19:38 -0400 Subject: [PATCH] fix(chart): mark short-span stub series with endpoint dots gcbm_moja_v6 (CBM) spans only 2022-2026 on Maine while every other engine runs to 2072+. On the full-horizon chart it rendered as a short floating dashed segment that read like a glitch. Short-span series (<=3 pts or spanning <25% of the x-range) now get endpoint dot markers so they read as the measured anchor points they are. No data dropped; the line still draws. Build verified. --- src/GrowthChart.jsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/GrowthChart.jsx b/src/GrowthChart.jsx index 19c7073..a3dc65d 100644 --- a/src/GrowthChart.jsx +++ b/src/GrowthChart.jsx @@ -133,6 +133,17 @@ export default function GrowthChart({ node, fiaRef, fiaYear, unit, classCol, const col = shadeFor(s); const d = s.pts.map((p,k)=> (k? "L":"M") + X(p[0]).toFixed(1) + " " + Y(p[1]).toFixed(1)).join(" "); const tag = dashed ? `${s.label} · ${overlayLabel||"compare"}` : `${s.label}`; + // A few engines are short anchor stubs (e.g. gcbm_moja_v6 spans only + // 2022-2026) rather than full trajectories. On a chart that runs to 2125 + // they render as a short floating segment that reads like a glitch. Mark + // such short-span series with endpoint dots so they read as the measured + // anchor points they are — no data is dropped, the line still draws. + const spanFrac = (s.pts.length>1) ? (s.pts[s.pts.length-1][0]-s.pts[0][0])/((x1-x0)||1) : 0; + const stub = s.pts.length<=3 || spanFrac < 0.25; + const dots = stub ? s.pts.map((p,k)=>( + + )) : null; return + {dots} ; }; // Collision-avoided trailing labels: stack each line's end label in the right