Make Studio's monitoring charts responsive and full-window

* **Dynamic Full-Window Scaling**: Charts in the Performance and Solver panels now expand to fill the entire pane, automatically arranging side-by-side or stacked based on window orientation to eliminate scrollbars.

  * **Responsive Decorators**: Added reusable C++ ImPlot helper functions that auto-hide titles, legends, and tick labels when the plot surface is small.

  * **Cleaner Visualization**: Refined chart titles (e.g., "CPU msec vs frame", "Convergence vs iter") and removed redundant axis labels for improved scannability.

These changes were based on the plot behavior of //third_party/mujoco/src/experimental/py/sample/implot.py This is an incremental improvement, we can make the plots even nicer in future.

PiperOrigin-RevId: 906351914
Change-Id: I8cb19c19bf807f0107c717066250a71bcf7e325f
This commit is contained in:
Matija Kecman
2026-04-27 07:42:16 -07:00
committed by Copybara-Service
parent 2e3205229c
commit 9cd89eec2f
7 changed files with 162 additions and 39 deletions
+12 -5
View File
@@ -884,8 +884,12 @@ void App::BuildGui() {
ImGui::SetNextWindowPos(chart_pos, ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(chart_size, ImGuiCond_FirstUseEver);
if (ImGui::Begin("Performance", &tmp_.chart_performance)) {
profiler_.CpuTimeGraph();
profiler_.DimensionsGraph();
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();
}
@@ -894,8 +898,12 @@ void App::BuildGui() {
ImGui::SetNextWindowPos(chart_pos, ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(chart_size, ImGuiCond_FirstUseEver);
if (ImGui::Begin("Solver", &tmp_.chart_solver)) {
platform::CountsGui(model(), data());
platform::ConvergenceGui(model(), data());
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);
}
ImGui::End();
}
@@ -1452,7 +1460,6 @@ void App::ToolBarGui() {
}
ImGui::SetItemTooltip("%s", "Reset");
// Combined (Normal Pause, Viscous Pause, Play) widget and Speed selection.
ImGui::SameLine(0, separator_width);
platform::StepControlGui(model(), &step_control_, tmp_.speed_index);