studio: replace separate Solver and Performance charts with a unified Profiler, bound to F3

Combines the "Solver" and "Performance" chart windows into a single "Profiler" window for better ergonomics and visual layout:
- Unified Dashboard: Groups the Solver block (Counts & Convergence) and the Performance block (Dimensions & CPU Time) in a single viewable window that scales cleanly without vertical scrollbars.
- Adaptive Stacking: Uses ImGui grouping so each block internally stacks its charts vertically, but tiles side-by-side horizontally when the window is stretched wide.
- Default Docking & Width: Integrates the Profiler into the default dockspace layout attached to the right of the main viewable area, with an optimized initial width scaling factor of 0.42.
- Shortcut and Menus: Adds a toggle shortcut bound to `F3`, updates the Help Shortcuts overlay, and replaces old separate entries in the Charts menu.

PiperOrigin-RevId: 912491435
Change-Id: I1f9215e5498866a01ce48b6aeb4a7461191fa01d
This commit is contained in:
Yuval Tassa
2026-05-08 06:24:53 -07:00
committed by Copybara-Service
parent 395a002801
commit 531a571dda
5 changed files with 77 additions and 44 deletions
+10 -37
View File
@@ -625,14 +625,12 @@ void App::HandleKeyboardEvents() {
ToggleWindow(tmp_.help);
} else if (ImGui_IsChordJustPressed(ImGuiKey_F2)) {
ToggleWindow(tmp_.stats);
} else if (ImGui_IsChordJustPressed(ImGuiKey_F3)) {
ToggleWindow(tmp_.profiler);
} else if (ImGui_IsChordJustPressed(ImGuiKey_F6)) {
vis_options_.frame = (vis_options_.frame + 1) % mjNFRAME;
} else if (ImGui_IsChordJustPressed(ImGuiKey_F7)) {
vis_options_.label = (vis_options_.label + 1) % mjNLABEL;
} else if (ImGui_IsChordJustPressed(ImGuiKey_F9)) {
tmp_.chart_solver = !tmp_.chart_solver;
} else if (ImGui_IsChordJustPressed(ImGuiKey_F10)) {
tmp_.chart_performance = !tmp_.chart_performance;
} else if (ImGui_IsChordJustPressed(ImGuiKey_F11)) {
tmp_.full_screen = !tmp_.full_screen;
} else if (ImGui_IsChordJustPressed(ImGuiKey_H)) {
@@ -887,30 +885,10 @@ void App::BuildGui() {
ImGui::End();
}
if (tmp_.chart_performance) {
ImGui::SetNextWindowPos(chart_pos, ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(chart_size, ImGuiCond_FirstUseEver);
if (ImGui::Begin("Performance", &tmp_.chart_performance)) {
auto layout = platform::ImPlot_ComputePairLayout();
profiler_.CpuTimeGraph(layout.plot_size);
if (layout.direction == platform::ImPlotLayoutDirection::kHorizontal) {
ImGui::SameLine();
}
profiler_.DimensionsGraph(layout.plot_size);
}
ImGui::End();
}
if (tmp_.chart_solver) {
ImGui::SetNextWindowPos(chart_pos, ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(chart_size, ImGuiCond_FirstUseEver);
if (ImGui::Begin("Solver", &tmp_.chart_solver)) {
auto layout = platform::ImPlot_ComputePairLayout();
platform::CountsGui(model(), data(), layout.plot_size);
if (layout.direction == platform::ImPlotLayoutDirection::kHorizontal) {
ImGui::SameLine();
}
platform::ConvergenceGui(model(), data(), layout.plot_size);
if (tmp_.profiler) {
if (ImGui::Begin("Profiler", &tmp_.profiler,
ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) {
platform::ProfilerGui(model(), data(), &profiler_);
}
ImGui::End();
}
@@ -1311,10 +1289,9 @@ void App::HelpGui() {
ImGui::Text("Help");
ImGui::Text("Stats");
ImGui::Text("Profiler");
ImGui::Text("Cycle Frames");
ImGui::Text("Cycle Labels");
ImGui::Text("Solver Charts");
ImGui::Text("Perf. Charts");
ImGui::Text("Toggle Fullscreen");
ImGui::Text("Free Camera");
ImGui::Text("Toggle Pause");
@@ -1338,10 +1315,9 @@ void App::HelpGui() {
ImGui::Indent(indent);
ImGui::Text("F1");
ImGui::Text("F2");
ImGui::Text("F3");
ImGui::Text("F6");
ImGui::Text("F7");
ImGui::Text("F9");
ImGui::Text("F10");
ImGui::Text("F11");
ImGui::Text("Esc");
ImGui::Text("Spc");
@@ -1733,11 +1709,8 @@ void App::MainMenuGui() {
}
if (ImGui::BeginMenu("Charts")) {
if (ImGui::MenuItem("Solver", "F9")) {
tmp_.chart_solver = !tmp_.chart_solver;
}
if (ImGui::MenuItem("Performance", "F10")) {
tmp_.chart_performance = !tmp_.chart_performance;
if (ImGui::MenuItem("Profiler", "F3")) {
ToggleWindow(tmp_.profiler);
}
ImGui::EndMenu();
}
+1 -2
View File
@@ -120,8 +120,7 @@ class App {
// Windows.
bool help = false;
bool stats = false;
bool chart_solver = false;
bool chart_performance = false;
bool profiler = false;
bool picture_in_picture = false;
bool options_panel = true;
bool inspector_panel = true;