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 auto_bounds/set_auto_bounds to PlotUi #3586

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

abey79
Copy link
Collaborator

@abey79 abey79 commented Nov 20, 2023

Part 2 of 2 of adding a better API for egui_plot's auto-bounds feature.

In this PR: add auto_bounds()/set_auto_bounds() APIs to PlotUI

@abey79 abey79 changed the title Add API to PlotUI to get/set the Plot's current auto-bounds state Plot auto-bounds API improvement (part 2): add API Nov 20, 2023
@abey79 abey79 changed the title Plot auto-bounds API improvement (part 2): add API Plot auto-bounds API improvement (part 2/2): add API Nov 20, 2023
@abey79 abey79 added rerun Desired for Rerun.io egui_plot Related to egui_plot labels Nov 20, 2023
Copy link
Collaborator

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

nice :)

@@ -854,7 +854,7 @@ impl Plot {
PlotMemory::load(ui.ctx(), plot_id)
}
.unwrap_or_else(|| PlotMemory {
auto_bounds: true.into(),
auto_bounds: default_auto_bounds,
Copy link
Collaborator

@Wumpf Wumpf Nov 20, 2023

Choose a reason for hiding this comment

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

was wondering about this one on the previous PR that added default_auto_bounds. Got me, I should have commented 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah the default_auto_bounds were just renamed, so that was a pre-existing bug I believe.

Base automatically changed from antoine/plot-auto-bounds-api-part-1 to master November 21, 2023 10:22
@abey79 abey79 force-pushed the antoine/plot-auto-bounds-api-part-2 branch from 66ca3bf to cc6f3df Compare November 21, 2023 10:34
@abey79 abey79 merged commit 05a3c4c into master Nov 21, 2023
35 checks passed
@abey79 abey79 deleted the antoine/plot-auto-bounds-api-part-2 branch November 21, 2023 10:56
@emilk emilk changed the title Plot auto-bounds API improvement (part 2/2): add API Add auto_bounds/set_auto_bounds to PlotUi Nov 23, 2023
abey79 added a commit to rerun-io/rerun that referenced this pull request Dec 1, 2023
…in timeseries space views (#4270)

### What

* Fixes #4246
* Depends on emilk/egui#3586
* Blocked on #4111

![Export-1701442441839](https://github.com/rerun-io/rerun/assets/49431240/d02f7d64-801a-4fe4-8ec1-20524ba78bd5)


### 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 [demo.rerun.io](https://demo.rerun.io/pr/4270) (if
applicable)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4270)
- [Docs
preview](https://rerun.io/preview/2706326572e06cf2623136a62fee75d75b490fdd/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/2706326572e06cf2623136a62fee75d75b490fdd/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Wumpf pushed a commit that referenced this pull request Dec 19, 2023
These PR recently cleaned up the code around auto-bounds, but introduced
an involuntary change whereby auto-bounds would not be enabled by
default. All plots would default to being not properly centred as a
result.

- #3587
- #3586

This PR changes the default back to enabled. It also deprecates
`auto_bounds_x()` and `auto_bounds_y()`, which could only enable
auto-bounds (which is not very useful as auto-bounds were, and now are
again, enabled by default). A new `auto_bounds()` API can now be sued to
disable auto-bounds if needed.

Fixes #3712 
Fixes rerun-io/rerun#4503
emilk pushed a commit that referenced this pull request Jan 3, 2024
These PR recently cleaned up the code around auto-bounds, but introduced
an involuntary change whereby auto-bounds would not be enabled by
default. All plots would default to being not properly centred as a
result.

- #3587
- #3586

This PR changes the default back to enabled. It also deprecates
`auto_bounds_x()` and `auto_bounds_y()`, which could only enable
auto-bounds (which is not very useful as auto-bounds were, and now are
again, enabled by default). A new `auto_bounds()` API can now be sued to
disable auto-bounds if needed.

Fixes #3712 
Fixes rerun-io/rerun#4503
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui_plot Related to egui_plot rerun Desired for Rerun.io
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants