@@ -1,24 +1,23 @@
1−use std::cell::RefCell;
4use dodrio::bumpalo::{self, Bump};
1use dodrio::bumpalo::{self, Bump};
5use dodrio::{Node, Render, Vdom};
2use dodrio::{Node, Render, Vdom};
3+use std::cell::RefCell;
6use wasm_bindgen::prelude::*;
5use wasm_bindgen::prelude::*;
7use wasm_bindgen::JsCast;
6use wasm_bindgen::JsCast;
8use web_sys::Window;
7use web_sys::Window;
10−// Triangle container defining target size
9+// Triangle container defining target size.
11struct Container {
10struct Container {
12 size: f64,
11 size: f64,
15impl Container {
14impl Container {
16− // Construct a new container
15+ // Construct a new container.
17 pub fn new() -> Container {
16 pub fn new() -> Container {
18 Container { size: 25.0 }
17 Container { size: 25.0 }
21− // Generate the container style to fluctuate triangle width
20+ // Generate the container style to fluctuate triangle width.
22 fn container_transform<'a, 'bump>(&'a self, bump: &'bump Bump, elapsed: f64) -> &'bump str
21 fn container_transform<'a, 'bump>(&'a self, bump: &'bump Bump, elapsed: f64) -> &'bump str
24 'a: 'bump,
23 'a: 'bump,
@@ -33,7 +32,7 @@ impl Container {
33 transform.into_bump_str()
32 transform.into_bump_str()
36− // Generate the dot's position on the grid
35+ // Generate the dot's position on the grid.
37 fn dot_style<'a, 'bump>(&'a self, bump: &'bump Bump, x: f64, y: f64) -> &'bump str
36 fn dot_style<'a, 'bump>(&'a self, bump: &'bump Bump, x: f64, y: f64) -> &'bump str
39 'a: 'bump,
38 'a: 'bump,
@@ -55,7 +54,7 @@ impl Container {
55 styles.into_bump_str()
54 styles.into_bump_str()
58− // Create a dot node
57+ // Create a dot node.
59 fn dot<'a, 'bump>(&'a self, bump: &'bump Bump, x: f64, y: f64, content: u32) -> Node<'bump>
58 fn dot<'a, 'bump>(&'a self, bump: &'bump Bump, x: f64, y: f64, content: u32) -> Node<'bump>
61 'a: 'bump,
60 'a: 'bump,