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

Add ShowLabels component, which controls whether instances’ labels are shown. #7249

Merged
merged 4 commits into from
Aug 24, 2024

Conversation

kpreid
Copy link
Collaborator

@kpreid kpreid commented Aug 21, 2024

What

  • Each archetype which has labels gets a ShowLabels non-repeated component. (I figured having it set per-instance would be hardly ever useful.)
  • Visualizers pass this component to process_labels().
  • process_labels() uses it to override the existing “show labels if less than 30” policy.
  • Refactoring: process_labels() and friends now take a struct instead of 8 separate parameters. This makes the callsites more legible and maintainable, and might eventually be useful for further refinement of the label rendering system (it's basically a "ComponentData" struct for labels).

One element is currently missing: the automatic policy is not expressed as a component fallback. That means that the viewer UI does not know about it and won't display the real fallback value, but a bogus constant true. Other than that, it should be fully ready to go, so feel free to either merge or wait for that further work as you see fit.

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@emilk
Copy link
Member

emilk commented Aug 23, 2024

Works like a charm!

@kpreid kpreid merged commit dc4e3f3 into rerun-io:main Aug 24, 2024
29 of 31 checks passed
jleibs pushed a commit that referenced this pull request Aug 28, 2024
…#7266)

### What

* Followup to #7249
* Fixes #3465

The default value for the `ShowLabels` component now passes through
`ComponentFallbackProvider`, so the viewer UI will properly show the
fallback value derived from the number of instances.

Further possible work in this area would be to define “number of
instances” as something that can be generically fetched based on an
archetype, rather than requiring each visualizer to communicate how it
counts that.

### Checklist
* [X] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [X] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7266?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7266?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [X] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [X] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [X] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/7266)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
jleibs pushed a commit that referenced this pull request Aug 28, 2024
…#7266)

### What

* Followup to #7249
* Fixes #3465

The default value for the `ShowLabels` component now passes through
`ComponentFallbackProvider`, so the viewer UI will properly show the
fallback value derived from the number of instances.

Further possible work in this area would be to define “number of
instances” as something that can be generically fetched based on an
archetype, rather than requiring each visualizer to communicate how it
counts that.

### Checklist
* [X] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [X] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7266?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7266?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [X] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [X] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [X] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/7266)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
emilk added a commit that referenced this pull request Aug 28, 2024
@emilk emilk added the 🪵 Log & send APIs Affects the user-facing API for all languages label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog 🪵 Log & send APIs Affects the user-facing API for all languages 📺 re_viewer affects re_viewer itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants