fix: render previous-period comparison lines in the TDD line chart - #9817
Merged
Conversation
With time comparison on and dimension values selected, the Vega TDD charts (grouped bar, stacked bar, stacked area) render a faded mark per dimension value for the previous period, but the custom SVG line chart dropped the comparison data entirely: `buildChartSeries` only emitted current-period series, even though the per-dimension comparison values were already fetched and merged into `DimensionSeriesData`. - Emit a previous-period series per dimension value in the same color, faded to the same opacity the Vega comparison marks use; the value is extracted as `ComparisonMarkOpacity` in `comparison-builder.ts` so both renderers stay in sync. The series order keeps every faded line beneath every current-period line, since `TimeSeriesChart` paints `series[0]` last. - Include dimension comparison values in `computeYExtent`, so a previous period that peaks above the current one is not clipped. - Let hover snapping reach dimension comparison points, which matters for trailing buckets where only previous-period data exists yet. Claude-Session: https://claude.ai/code/session_01HZg85dzz4bkcY53V1AEa7z
AdityaHegde
approved these changes
Aug 19, 2026
nishantmonu51
added a commit
that referenced
this pull request
Aug 20, 2026
…9817) With time comparison on and dimension values selected, the Vega TDD charts (grouped bar, stacked bar, stacked area) render a faded mark per dimension value for the previous period, but the custom SVG line chart dropped the comparison data entirely: `buildChartSeries` only emitted current-period series, even though the per-dimension comparison values were already fetched and merged into `DimensionSeriesData`. - Emit a previous-period series per dimension value in the same color, faded to the same opacity the Vega comparison marks use; the value is extracted as `ComparisonMarkOpacity` in `comparison-builder.ts` so both renderers stay in sync. The series order keeps every faded line beneath every current-period line, since `TimeSeriesChart` paints `series[0]` last. - Include dimension comparison values in `computeYExtent`, so a previous period that peaks above the current one is not clipped. - Let hover snapping reach dimension comparison points, which matters for trailing buckets where only previous-period data exists yet. Claude-Session: https://claude.ai/code/session_01HZg85dzz4bkcY53V1AEa7z (cherry picked from commit 674ab65)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the Time Dimension Detail view with time comparison on, the Vega chart types (grouped bar, stacked bar, stacked area) render a faded mark per dimension value for the previous period, but the line chart rendered nothing:
buildChartSeriesonly emitted current-period series, even though the per-dimension comparison values were already fetched and merged intoDimensionSeriesData.buildChartSeriesnow emits a comparison series per dimension value in the same color, faded to the same opacity the Vega comparison marks use — extracted asComparisonMarkOpacityincomparison-builder.tsso both renderers stay in sync. The series order keeps every faded line beneath every current-period line, sinceTimeSeriesChartpaintsseries[0]last.computeYExtentnow includes dimension comparison values when comparison is shown, so a previous period that peaks above the current one is not clipped.snapSeriesinMeasureChartBodyincludes the dimension comparison points, so trailing buckets where only previous-period data exists yet (e.g. an incomplete current day) are hoverable.Checklist:
https://claude.ai/code/session_01HZg85dzz4bkcY53V1AEa7z