Step Log visualization optimization#62
Conversation
…ined in top of file. Less color repetition in subplots
…n stay hidden while switching episode
There was a problem hiding this comment.
Pull request overview
This PR optimizes the step log visualization tool to address performance and usability issues. The key improvement is replacing the approach of pre-plotting all episodes (and hiding unselected ones) with dynamically updating trace data via the slider control. This change significantly reduces file sizes (e.g., from 374MB to 78MB in large cases) and improves responsiveness while fixing trace hiding bugs and color repetition issues.
Key changes:
- Refactored slider implementation to update trace data dynamically instead of toggling visibility of pre-rendered traces
- Added separate legends for each subplot instead of a single shared legend
- Improved memory management with explicit cleanup of intermediate dataframes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
danielwolff1
left a comment
There was a problem hiding this comment.
Looks good to me so far, thanks for the very valuable improvements.
I would say let's have a brief discussion about this next Tuesday and merge it after that.
Co-authored-by: Daniel Wolff <39346676+danielwolff1@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
While using the step log visualization tool more and more a few issue came to light.
To combat this the visualization was optimized. The biggest part is the fix for 1, 4, and 5 which were fixed by changing how the slider works. Before all episode traces were plotted separately at the same time but than hidden for all episode but the one that was shown. Now one one trace is plotted for each variable and the data is exchanged for each episode. This solves both the responsiveness, file size and trace hiding problems.
Quantifiable is the easiest for point 4: For a specifically large step log we get a visualization file that is 374Mb in size and for the optimized the file size shrinks to 78Mb.
The new visualization looks like this:
