Skip to content

feat: connect null gaps in KPI sparkline#8985

Open
djbarnwal wants to merge 1 commit intomainfrom
feat/fill-null-gaps-kpi-sparkline
Open

feat: connect null gaps in KPI sparkline#8985
djbarnwal wants to merge 1 commit intomainfrom
feat/fill-null-gaps-kpi-sparkline

Conversation

@djbarnwal
Copy link
Member

@djbarnwal djbarnwal commented Mar 6, 2026

  • Extract bridgeSmallGaps and computeSegments into a shared sparse-data-utils.ts module, making the logic generic over any data type via valueAccessor/cloneWithValue callbacks
  • Reuse the shared utility in the KPI sparkline (Chart.svelte) to bridge small null gaps with linear interpolation, matching the existing behavior in explore dashboard time-series charts
  • Add bridgedSegments to BridgeResult so callers no longer need a separate computeSegments call on the output
  • Use SVG clip paths in the sparkline to prevent area fill from rendering across gaps
  • Show isolated singleton points as dots when they have no adjacent non-null neighbors
    https://linear.app/rilldata/issue/APP-571/spark-charts-on-canvas-are-just-displaying-singular-data-points

Before
image

After
image

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@djbarnwal djbarnwal requested a review from ericpgreen2 March 6, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant