yuankunzhang / charming

A visualization library for Rust
Apache License 2.0
1.85k stars 73 forks source link

Allowing not specify size to WasmRenderer #61

Closed MikhailNazarov closed 1 month ago

MikhailNazarov commented 5 months ago

Now you need to specify the exact size of the chart. This does not allow you to fill all the available space and the resize() method without parameters also does not change the size when the parent is resized.

If you do not set the width, for example, then the chart adjusts to the width of the parent and when it is resized, you can call resize() and chart fits parent.

Added new function new_opt for constructing WasmRenderer with optional arguments. Function new() also working.

 let renderer = WasmRenderer::new_opt(None, Some(300));
 renderer.render("chart", &chart).unwrap();

initial chart width set automatic to full width:

image image