30 lines
558 B
Rust
30 lines
558 B
Rust
use yew::prelude::*;
|
|
|
|
pub struct Canvas {}
|
|
|
|
pub enum Msg {
|
|
Reset,
|
|
SamplesLoaded,
|
|
}
|
|
|
|
impl Component for Canvas {
|
|
type Message = Msg;
|
|
type Properties = ();
|
|
|
|
fn create(_: Self::Properties, _: ComponentLink<Self>) -> Self {
|
|
Self {}
|
|
}
|
|
|
|
fn update(&mut self, _: Self::Message) -> ShouldRender {
|
|
true
|
|
}
|
|
|
|
fn change(&mut self, _: Self::Properties) -> ShouldRender {
|
|
false
|
|
}
|
|
|
|
fn view(&self) -> Html {
|
|
html! { <canvas width="800" height="300" style="border: 1px solid grey"></canvas> }
|
|
}
|
|
}
|