Skip to content

Feature/wasm svg support#212

Open
JaminMartin wants to merge 2 commits into
yuankunzhang:mainfrom
JaminMartin:feature/wasm_svg_support
Open

Feature/wasm svg support#212
JaminMartin wants to merge 2 commits into
yuankunzhang:mainfrom
JaminMartin:feature/wasm_svg_support

Conversation

@JaminMartin

Copy link
Copy Markdown

After some great help from @LukaOber in #211 I have added the ability to choose the rendering backend for the WasmRenderer

Key changes at the user level:

let renderer = WasmRenderer::new(600, 400).renderer(Renderer::Svg);

The user can now specify the rendering backend, if the .renderer method is not added, the current default behaviour is used (i.e. defaults to canvas

Under the hood, the WasmRenderer now accepts additional init options, not just its size. I have also renamed ChartSize to InitOptions to reflect this.

I believe some of these could be renamed further, e.g. let renderer = WasmRenderer::new(600, 400).backend(Renderer::Svg);
The Renderer enum could also be renamed if there is a more appropriate name.

I have updated the Leptos example to include this and it works well, replicating the same results as was provided by #211
This should work for all Wasm supporting frameworks e.g Dioxus, Yew etc.

JaminMartin added 2 commits December 19, 2025 14:13
This adds the ability to override the default "canvas" backend for the WASM renderer.

ChartSize has been replaced by InitOptions to better reflect adding of additional initialisation options.
@LukaOber

Copy link
Copy Markdown
Collaborator

CI is failing due to another problem. I will review the code on the weekend.

@JaminMartin

Copy link
Copy Markdown
Author

@LukaOber Is this still failing due to another issue? or something I have done? happy to fix if there is an issue.

@JaminMartin

Copy link
Copy Markdown
Author

@LukaOber any progress on this? Understandable if you are busy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants