Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SeriesLine visualizer work with several scalars per time #9033

Merged
merged 8 commits into from
Feb 14, 2025

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Feb 13, 2025

Related

What

image

Try the example in the browser:
https://rerun.io/viewer/pr/9033?url=https://static.rerun.io/rrd/0.22.0/multiplot_0a77742f7ddd55361c4b7bd9976caa1cc45f9c14.rrd

SeriesLine visualizer now operates as-if...

  • scalars was a primary component (not new really actually) which is an array of arbitrary length on each timestamp
  • colors, name and stroke-width are components that are splatted upon each scalar

In other words: Single entity, multiple plots

To test this out I added a manual "test" for now (to be removed again) which tests both static & varying color & widths as well as gaps.

In a follow-up I'll add automated tests for this.
This PR intentionally does NOT touch any APIs. Logging happens right now via the same generic APIs we use for column batches. That API didn't really make sense before here but works pretty much how one would expect, begging the question if this isn't already good enough 🤔

Performance before/after was verified to be unchanged using
cargo run --release --bin plot_dashboard_stress -- --num-plots 16 --num-series-per-plot 32
(curiously it actually improved a lil bit from 30.1ms 29.6ms overall viewer time but that's probably just measurement fluctuation / background task activity)
after

@Wumpf Wumpf added include in changelog 📈 plot Plots, charts, graphs, timeseries, … labels Feb 13, 2025
Copy link

github-actions bot commented Feb 13, 2025

Web viewer failed to build.

Result Commit Link Manifest
https://rerun.io/viewer/pr/9033 +nightly +main

Note: This comment is updated whenever you push a commit.

@Wumpf Wumpf added the 📺 re_viewer affects re_viewer itself label Feb 13, 2025
@teh-cmc
Copy link
Member

teh-cmc commented Feb 14, 2025

To test this out I added a manual "test" for now (to be removed again) which tests both static & varying color & widths as well as gaps.

I actually would like to make this part of the Plots example. This is valuable both for our users and us, as something easily accessible from the welcome screen.

(Case in point, I would have liked to try out this feature in the web viewer generated for this PR)

@teh-cmc teh-cmc self-requested a review February 14, 2025 09:30
Copy link
Member

@teh-cmc teh-cmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't digged into every single detail, but the general approach of having two dedicated code paths makes a lot of sense to me. Let's get this soaked.

docs/snippets/all/archetypes/scalar_simple.rs Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat

@Wumpf Wumpf merged commit 8c23962 into main Feb 14, 2025
15 of 20 checks passed
@Wumpf Wumpf deleted the andreas/series-line-multi branch February 14, 2025 14:58
Wumpf added a commit that referenced this pull request Feb 14, 2025
* Fixes #9031

Adds a small handful of tests to the time series.
Replaces the `check_scalar_clears.py` manual test. We have other manual
tests involving plots but they are all about overrides which I
considered out of scope for this round of testing for the very moment.

Upcoming TODO: Add multi-plot version for
* #9033
Wumpf added a commit that referenced this pull request Feb 17, 2025
Follow-up to both
* #9036
* #9033

Since the code paths for multiple time series (mostly due to
optimization) can vary quite a bit, I duplicated the previously added
tests to account for this.

Point series don't yet support multiple series on a single entity, so
all errors around them are expected - once we implement
#9020 these tests should then
automatically reflect this.


Fixed an issue when the number of names specified is smaller than the
number of series -- this sort of issue led me to adding a third variant
where we have a have a single property but multiple series. This ensure
that splatting where appropriate happens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog 📈 plot Plots, charts, graphs, timeseries, … 📺 re_viewer affects re_viewer itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make line series visualizer handle vectors of scalars per time index
2 participants