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

Spatial2D: allow setting data range / clip rectangle via blueprint & ui #6247

Open
Wumpf opened this issue May 7, 2024 · 1 comment
Open
Labels
🟦 blueprint The data that defines our UI 📺 re_viewer affects re_viewer itself ui concerns graphical user interface

Comments

@Wumpf
Copy link
Member

Wumpf commented May 7, 2024

@jleibs and @Wumpf came up with this design for the blueprint interface, comments meant to be ready as-is:

/// Controls the valid range of data for a 2D view.
///
/// Data outside of this range will not be shown.
/// This acts as a maximum outer clipping rectangle for this view.
/// For controlling panning & zoom of a 2D view, see [`VisualBounds`].
///
/// If no data range is set, it will be determined automatically,
/// based on the bounding-box of the data or other camera information present in the view.
table DataRange (
    "attr.rerun.scope": "blueprint",
    "attr.rust.derive": "Copy"
) {
    /// Controls the valid range of data for a 2D view.
    ///
    /// Use this to control the clipping of the view.
    // TODO(jleibs): start out with a 2D range, but make this 3D in the future and use it also on the 3d view?
    range: rerun.components.DataRange ("attr.rerun.component_required", nullable, order: 1000);
}

/// Controls the visual bounds of a 2D view.
///
/// Everything within these bounds are guaranteed to be visible.
/// Somethings outside of these bounds may also be visible due to letterboxing.
/// For controlling the clipping of a 2D view, see [`DataRange`].
///
/// If no visual bounds are set, they default to the [`DataRange`].
/// Note, that if no [`DataRange`] is set, it will be determined automatically,
/// based on the bounding-box of the data or other camera information present in the view.
table VisualBounds2D (
    "attr.rerun.scope": "blueprint",
    "attr.rust.derive": "Copy"
) {
    /// Controls the visible range of a 2D view.
    ///
    /// Use this to control pan & zoom of the view.
    range: rerun.components.VisualBounds2D ("attr.rerun.component_required", nullable, order: 1000);
}
@Wumpf Wumpf added ui concerns graphical user interface 📺 re_viewer affects re_viewer itself 🟦 blueprint The data that defines our UI labels May 7, 2024
@Wumpf
Copy link
Member Author

Wumpf commented May 7, 2024

For 0.16 we should at least make sure that visual bounds don't change api wise. Implementing DataRange is secondary

@Wumpf Wumpf added this to the 0.16 milestone May 7, 2024
@Wumpf Wumpf removed this from the 0.16 milestone May 15, 2024
Wumpf added a commit that referenced this issue May 15, 2024
…nent replacing Range2D component (#6333)

### What

This changeset makes the 2D visual bound more similar to what we want it
to look like once introducing `DataRange`, i.e. it means that when we
fix:
* #6247

the api won't break

### 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/6333?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/6333?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)!

- [PR Build Summary](https://build.rerun.io/pr/6333)
- [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`.
Wumpf added a commit that referenced this issue May 15, 2024
…nent replacing Range2D component (#6333)

### What

This changeset makes the 2D visual bound more similar to what we want it
to look like once introducing `DataRange`, i.e. it means that when we
fix:
* #6247

the api won't break

### 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/6333?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/6333?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)!

- [PR Build Summary](https://build.rerun.io/pr/6333)
- [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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🟦 blueprint The data that defines our UI 📺 re_viewer affects re_viewer itself ui concerns graphical user interface
Projects
None yet
Development

No branches or pull requests

1 participant