Skip to main content

runmat_runtime/
plotting_hooks.rs

1//! Lightweight wrappers that expose plotting-specific helpers without requiring
2//! downstream crates to depend directly on the plotting feature flag.
3
4/// Reset the per-thread "figures touched" set. No-op when plotting is disabled.
5pub fn reset_recent_figures() {
6    #[cfg(feature = "plot-core")]
7    {
8        crate::builtins::plotting::reset_recent_figures();
9    }
10}
11
12/// Drain the per-thread "figures touched" set, returning the raw handles.
13pub fn take_recent_figures() -> Vec<u32> {
14    #[cfg(feature = "plot-core")]
15    {
16        crate::builtins::plotting::take_recent_figures()
17            .into_iter()
18            .map(|handle| handle.as_u32())
19            .collect()
20    }
21    #[cfg(not(feature = "plot-core"))]
22    {
23        Vec::new()
24    }
25}