Skip to main content

LayerManager

Struct LayerManager 

Source
pub struct LayerManager { /* private fields */ }
Expand description

Layer manager for organizing and rendering multiple layers

Implementations§

Source§

impl LayerManager

Source

pub fn new() -> Self

Create a new empty layer manager

Source

pub fn add_layer(&mut self, layer: Box<dyn Layer>)

Add a layer to the manager

Source

pub fn remove_layer(&mut self, name: &str) -> Option<Box<dyn Layer>>

Remove a layer by name

Source

pub fn get_layer_mut(&mut self, name: &str) -> Option<&mut (dyn Layer + '_)>

Get a mutable reference to a layer by name

Source

pub fn get_layer(&self, name: &str) -> Option<&dyn Layer>

Get an immutable reference to a layer by name

Source

pub fn update_all( &mut self, data: &ChartData, viewport: &Viewport, theme: &ChartTheme, style: &ChartStyle, )

Update all layers with new data

Source

pub fn render_all( &self, context: &mut RenderContext, render_pass: &mut RenderPass<'_>, ) -> Result<()>

Render all enabled layers in Z-order

Source

pub fn needs_render(&self) -> bool

Check if any layer needs rendering

Source

pub fn mark_clean(&mut self)

Mark the layer manager as clean (after rendering)

Source

pub fn layer_count(&self) -> usize

Get the number of layers

Source

pub fn enabled_layer_count(&self) -> usize

Get the number of enabled layers

Source

pub fn layer_names(&self) -> Vec<&str>

List all layer names

Source

pub fn set_layer_enabled(&mut self, name: &str, enabled: bool) -> bool

Enable or disable a layer by name

Source

pub fn clear(&mut self)

Clear all layers

Trait Implementations§

Source§

impl Default for LayerManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl LayerBuilder for LayerManager

Source§

fn basic_range_chart() -> LayerManager

Create a basic range bar chart with grid and axes
Source§

fn basic_financial_chart() -> LayerManager

Backwards compatibility alias
Source§

fn chart_with_watermark(label: String) -> LayerManager

Create a chart with watermark

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,