Skip to content

fix: TimeSeries disappearing series lines on zoom#9690

Open
raworks-software wants to merge 1 commit intoHumanSignal:developfrom
raworks-software:patch-1
Open

fix: TimeSeries disappearing series lines on zoom#9690
raworks-software wants to merge 1 commit intoHumanSignal:developfrom
raworks-software:patch-1

Conversation

@raworks-software
Copy link
Copy Markdown

@raworks-software raworks-software commented Apr 14, 2026

Reason for change

This PR fixes a TimeSeries rendering issue where some channels disappear while zooming, and the rendered SVG <path> ends up with an empty d="" attribute.

Observed behavior:

  • while zooming into a narrow range, some series become invisible
  • in DevTools, the corresponding SVG path is rendered as <path ... d=""></path>

This appears related to:

Root cause:

  • the zoomed line rendering path could be built from sparse/optimized slices that did not contain enough valid points for the current visible range
  • when that happened, the D3 line generator produced an empty path

Solution:

  • preserve the full filtered series for each channel
  • build the zoom-visible segment from the full channel series instead of relying on pre-sliced zoom buckets
  • include neighboring boundary points around the visible range so narrow zoom windows still produce a valid line segment
  • add guards for degenerate Y-scaling cases and invalid numeric values

What changed

In TimeSeriesVisualizer.jsx:

  • store channel.fullSeries for each channel
  • add channel.getVisibleSegment(...) to derive the visible segment from the full series using a bisector
  • render the zoomed path from channel.fullSeries instead of this.slices[left/right]
  • guard Y-scale recalculation against null / non-finite values and flat segments

In Channel.jsx:

  • include related multiaxis handling changes so the visualizer receives the expected set of channels when rendering shared charts

Screenshots / Representation

before.mp4
after.mp4

Rollout strategy

No feature flag.
This is a direct bug fix to TimeSeries rendering behavior.

Testing

Manual verification performed locally:

  • opened a TimeSeries project with affected data
  • zoomed repeatedly into narrow ranges where some channels previously disappeared
  • checked the rendered SVG in DevTools
  • verified that the affected paths no longer collapse to d="" in the tested cases

Additional validation performed:

  • confirmed that normal non-zoomed rendering still works
  • confirmed that the code still handles optimized/full-series switching
  • confirmed that narrow visible windows still render using boundary points from the full series

Risks

Low to moderate.

Potential risks:

  • slight performance impact during zoom because the visible segment is now derived from the full channel series instead of relying entirely on sparse slices
  • edge-case behavior may change for extremely large datasets with many channels
  • multiaxis behavior should be reviewed carefully because channel aggregation affects shared rendering paths

Risk mitigations:

  • only a small visible segment is extracted from the full series
  • optimized rendering is still used outside the narrow zoom-path case
  • changes are limited to TimeSeries rendering logic

Reviewer notes

The most important logic is in:

  • initializeChannel(...)
  • setChannelRangeWithScaling(...)

Please review:

  • how channel.fullSeries is constructed
  • how channel.getVisibleSegment(...) selects boundary points
  • the switch away from rendering zoom paths from this.slices[left/right]

General notes

This fix targets the specific failure mode where D3 receives too few valid points for the current visible range and emits an empty SVG path.

The intended behavior after this change is:

  • channels remain visible while zooming
  • the SVG path for visible data remains valid
  • narrow zoom ranges still render a line if neighboring points exist

Overall fixes performed by ChatGPT, I barely did any review of source code.

Build zoomed paths from the full channel series to avoid empty SVG d attributes.
@raworks-software raworks-software requested a review from a team as a code owner April 14, 2026 14:21
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

👷 Deploy request for label-studio-docs-new-theme pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2be8ff8

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

👷 Deploy request for heartex-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2be8ff8

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit 2be8ff8
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/69de4d7054ec00000839a9ad
😎 Deploy Preview https://deploy-preview-9690--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 2be8ff8
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/69de4d70c3004b00086869d5
😎 Deploy Preview https://deploy-preview-9690--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@raworks-software raworks-software changed the title Fix TimeSeries disappearing series lines on zoom fix: TimeSeries disappearing series lines on zoom Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with timeseries rendering Missing data display in time series

1 participant