-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pure refactor] Fix viewport to timepanel dependency (#2256)
<!-- Open the PR up as a draft until you feel it is ready for a proper review. Do not make PR:s from your own `main` branch, as that makes it difficult for reviewers to add their own fixes. Add any improvements to the branch as new commits to make it easier for reviewers to follow the progress. All commits will be squashed to a single commit once the PR is merged into `main`. Make sure you mention any issues that this PR closes in the description, as well as any other related issues. To get an auto-generated PR description you can put "copilot:summary" or "copilot:walkthrough" anywhere. --> ### What Follow up to * #2251 Improves out dependency graph around re_viewer a little bit! ``` cargo install cargo-depgraph cargo depgraph --all-deps --workspace-only --all-features --dedup-transitive-deps | dot -Tpng > rerun-dependency-graph.png ``` ![image](https://github.com/rerun-io/rerun/assets/1220815/2c6e4098-efc8-45ec-a44f-98a488d497fa) ### 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) <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2256
- Loading branch information
Showing
11 changed files
with
114 additions
and
110 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// When showing grid-lines representing time. | ||
/// | ||
/// Given some spacing (e.g. 10s), return the next spacing (60s). | ||
pub fn next_grid_tick_magnitude_ns(spacing_ns: i64) -> i64 { | ||
if spacing_ns <= 1_000_000_000 { | ||
spacing_ns * 10 // up to 10 second ticks | ||
} else if spacing_ns == 10_000_000_000 { | ||
spacing_ns * 6 // to the whole minute | ||
} else if spacing_ns == 60_000_000_000 { | ||
spacing_ns * 10 // to ten minutes | ||
} else if spacing_ns == 600_000_000_000 { | ||
spacing_ns * 6 // to an hour | ||
} else if spacing_ns == 60 * 60 * 1_000_000_000 { | ||
spacing_ns * 12 // to 12 h | ||
} else if spacing_ns == 12 * 60 * 60 * 1_000_000_000 { | ||
spacing_ns * 2 // to a day | ||
} else { | ||
spacing_ns.checked_mul(10).unwrap_or(spacing_ns) // multiple of ten days | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters