Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to insert a canvas into the body ? #2222

Closed
wangxiaochuTHU opened this issue Nov 29, 2021 · 0 comments
Closed

How to insert a canvas into the body ? #2222

wangxiaochuTHU opened this issue Nov 29, 2021 · 0 comments
Labels

Comments

@wangxiaochuTHU
Copy link

I failed to find a guide to creating&inserting a canvas. After reading the official book, I guessed and tested out that the inserting pattern might be somehow like

html!{
    <canvas id = "my_canvas"> {" some text"} </canvas>
}

However, where to call its creating function (say fn create_my_canvas) puzzles me much.

fn create_my_canvas() -> HtmlCanvasElement {
   ................................
   canvas
}

I found only one related example mount_point, but this example is far different from and inconsistent with the patterns shown in official book. Besides, this example compiled with errors saying that the crate yew has no function start_app_in_element.

Above all, my question would be threefold:

  1. what's the pattern to insert a canvas with a default context.
  2. what's the pattern to insert a canvas with an external input (I mean something like plotters)
  3. where can I learn all the inserting patterns for all supported html tags.

Thanks for giving any guidelines.

@yewstack yewstack locked and limited conversation to collaborators Nov 29, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants