pub trait WebRenderer: Renderer {
// Required methods
fn new(backend: &GPUBackend) -> Result<Self, String>
where Self: Sized;
fn render_with_backend(
&mut self,
backend: &GPUBackend,
data: &ChartData,
options: &RenderOptions,
) -> Result<(), String>;
fn update_data(
&mut self,
backend: &GPUBackend,
data: &ChartData,
) -> Result<(), String>;
}Expand description
WebRenderer trait - specialized for web/WASM contexts
Use this when:
- Building web applications (WASM targets)
- You need GPUBackend for resource management
- You want full control over the render loop
Required Methods§
Sourcefn new(backend: &GPUBackend) -> Result<Self, String>where
Self: Sized,
fn new(backend: &GPUBackend) -> Result<Self, String>where
Self: Sized,
Create a new renderer with GPUBackend
Sourcefn render_with_backend(
&mut self,
backend: &GPUBackend,
data: &ChartData,
options: &RenderOptions,
) -> Result<(), String>
fn render_with_backend( &mut self, backend: &GPUBackend, data: &ChartData, options: &RenderOptions, ) -> Result<(), String>
Render with full backend context
Sourcefn update_data(
&mut self,
backend: &GPUBackend,
data: &ChartData,
) -> Result<(), String>
fn update_data( &mut self, backend: &GPUBackend, data: &ChartData, ) -> Result<(), String>
Update data using backend