From 55add8fb48d1f696e057da202508378e64aa4f2e Mon Sep 17 00:00:00 2001 From: ankurjuneja Date: Mon, 17 Aug 2026 14:05:46 -0700 Subject: [PATCH 1/2] Limit the ordinal x-axis padding removal to the calendar axis --- core/webapp/vis/src/plot.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/core/webapp/vis/src/plot.js b/core/webapp/vis/src/plot.js index 2a3e1469657..f62852276af 100644 --- a/core/webapp/vis/src/plot.js +++ b/core/webapp/vis/src/plot.js @@ -2464,8 +2464,19 @@ boxPlot.render(); } } - // Previously the ordinal x-axis was padded out to a minimum of 10 slots; that left trailing dateless ticks - // when only a few days had data, so the axis now spans just the real (and selected-range) dates. + // min x-axis tick length is 10 by default; the calendar axis floors its own domain at 10 slots instead, so + // filler rows there would land on real day offsets + if (!timeBasedXTick) { + const maxSeqValue = config.data.length > 0 ? config.data[config.data.length - 1].seqValue + 1 : 0; + for (let i = maxSeqValue; i < 10; i++) { + const temp = {type: 'empty', seqValue: i}; + temp[config.properties.xTickLabel] = ""; + if (config.properties.color && config.data[0]) { + temp[config.properties.color] = config.data[0][config.properties.color]; + } + config.data.push(temp); + } + } // Dateless range/separator markers (rangeTick) carry a meaningful label (selected-range endpoints, the guide-set // "always show" separator) - distinct from the Issue-31678 missing-date FILL rows that share the axis across @@ -2705,7 +2716,7 @@ boxPlot.render(); config.layers = []; } else { - // Slot count floored at 9 - the ordinal axis is no longer padded to 10 slots, so one slot would divide by zero. + // Slot count floored at 9 - the calendar axis has no filler rows, so a single-day plot would divide by zero. const lastRow = config.data.length > 0 ? config.data[config.data.length - 1] : undefined; const barWidthDenom = Math.max(timeBasedXTick ? uniqueDayOffsets.length - 1 : (lastRow ? lastRow.seqValue : 0), 9); const barWidth = Math.max(config.width / barWidthDenom / 4, 3); From 60e46d03f32339d4dfbe2bcdfdfa5988320a3844 Mon Sep 17 00:00:00 2001 From: ankurjuneja Date: Tue, 18 Aug 2026 11:24:12 -0700 Subject: [PATCH 2/2] update comment based on claude code review --- core/webapp/vis/src/plot.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/webapp/vis/src/plot.js b/core/webapp/vis/src/plot.js index f62852276af..924b723b66e 100644 --- a/core/webapp/vis/src/plot.js +++ b/core/webapp/vis/src/plot.js @@ -2464,8 +2464,7 @@ boxPlot.render(); } } - // min x-axis tick length is 10 by default; the calendar axis floors its own domain at 10 slots instead, so - // filler rows there would land on real day offsets + // pad the ordinal axis to a 10-slot minimum; on the calendar axis a filler's synthetic seqValue would read as a real day offset, so it floors its slot width (not its domain) at 10 instead if (!timeBasedXTick) { const maxSeqValue = config.data.length > 0 ? config.data[config.data.length - 1].seqValue + 1 : 0; for (let i = maxSeqValue; i < 10; i++) {