diff --git a/app-proto/src/components/add_remove.rs b/app-proto/src/components/add_remove.rs index 77a6412..4196640 100644 --- a/app-proto/src/components/add_remove.rs +++ b/app-proto/src/components/add_remove.rs @@ -10,9 +10,9 @@ use crate::{ #[component] pub fn AddRemove() -> View { view! { - div(id="add-remove") { + div(id = "add-remove") { button( - on:click=|_| { + on:click = |_| { let state = use_context::(); batch(|| { // this call is batched to avoid redundant realizations. @@ -33,18 +33,18 @@ pub fn AddRemove() -> View { } ) { "Add sphere" } button( - on:click=|_| { + on:click = |_| { let state = use_context::(); state.assembly.insert_element_default::(); } ) { "Add point" } button( - class="emoji", /* KLUDGE */ // for convenience, we're using an emoji as a temporary icon for this button - disabled={ + class = "emoji", /* KLUDGE */ // for convenience, we're using an emoji as a temporary icon for this button + disabled = { let state = use_context::(); state.selection.with(|sel| sel.len() != 2) }, - on:click=|_| { + on:click = |_| { let state = use_context::(); let subjects: [_; 2] = state.selection.with( // the button is only enabled when two elements are diff --git a/app-proto/src/components/diagnostics.rs b/app-proto/src/components/diagnostics.rs index f802684..b274dca 100644 --- a/app-proto/src/components/diagnostics.rs +++ b/app-proto/src/components/diagnostics.rs @@ -27,15 +27,15 @@ fn RealizationStatus() -> View { let realization_status = state.assembly.realization_status; view! { div( - id="realization-status", - class=realization_status.with( + id = "realization-status", + class = realization_status.with( |status| match status { Ok(_) => "", Err(_) => "invalid", } ) ) { - div(class="status") + div(class = "status") div { (realization_status.with( |status| match status { @@ -103,7 +103,7 @@ fn LossHistory() -> View { }); view! { - div(id=CONTAINER_ID, class="diagnostics-chart") + div(id = CONTAINER_ID, class = "diagnostics-chart") } } @@ -209,7 +209,7 @@ fn SpectrumHistory() -> View { }); view! { - div(id=CONTAINER_ID, class="diagnostics-chart") + div(id = CONTAINER_ID, class = "diagnostics-chart") } } @@ -218,8 +218,8 @@ fn DiagnosticsPanel(name: &'static str, children: Children) -> View { let diagnostics_state = use_context::(); view! { div( - class="diagnostics-panel", - "hidden"=diagnostics_state.active_tab.with( + class = "diagnostics-panel", + "hidden" = diagnostics_state.active_tab.with( |active_tab| { if active_tab == name { None @@ -241,16 +241,16 @@ pub fn Diagnostics() -> View { provide_context(diagnostics_state); view! { - div(id="diagnostics") { - div(id="diagnostics-bar") { + div(id = "diagnostics") { + div(id = "diagnostics-bar") { RealizationStatus {} - select(bind:value=active_tab) { - option(value="loss") { "Loss" } - option(value="spectrum") { "Spectrum" } + select(bind:value = active_tab) { + option(value = "loss") { "Loss" } + option(value = "spectrum") { "Spectrum" } } } - DiagnosticsPanel(name="loss") { LossHistory {} } - DiagnosticsPanel(name="spectrum") { SpectrumHistory {} } + DiagnosticsPanel(name = "loss") { LossHistory {} } + DiagnosticsPanel(name = "spectrum") { SpectrumHistory {} } } } } \ No newline at end of file diff --git a/app-proto/src/components/display.rs b/app-proto/src/components/display.rs index 64a1ba3..09970de 100644 --- a/app-proto/src/components/display.rs +++ b/app-proto/src/components/display.rs @@ -833,12 +833,12 @@ pub fn Display() -> View { // switch back to integer-valued parameters when that becomes possible // again canvas( - ref=display, - id="display", - width="600", - height="600", - tabindex="0", - on:keydown=move |event: KeyboardEvent| { + ref = display, + id = "display", + width = "600", + height = "600", + tabindex = "0", + on:keydown = move |event: KeyboardEvent| { if event.key() == "Shift" { // swap navigation inputs roll_cw.set(yaw_right.get()); @@ -864,7 +864,7 @@ pub fn Display() -> View { set_manip_signal(&event, 1.0); } }, - on:keyup=move |event: KeyboardEvent| { + on:keyup = move |event: KeyboardEvent| { if event.key() == "Shift" { // swap navigation inputs yaw_right.set(roll_cw.get()); @@ -886,7 +886,7 @@ pub fn Display() -> View { set_manip_signal(&event, 0.0); } }, - on:blur=move |_| { + on:blur = move |_| { pitch_up.set(0.0); pitch_down.set(0.0); yaw_right.set(0.0); @@ -894,7 +894,7 @@ pub fn Display() -> View { roll_ccw.set(0.0); roll_cw.set(0.0); }, - on:click=move |event: MouseEvent| { + on:click = move |event: MouseEvent| { // find the nearest element along the pointer direction let (dir, pixel_size) = event_dir(&event); console::log_1(&JsValue::from(dir.to_string())); diff --git a/app-proto/src/components/outline.rs b/app-proto/src/components/outline.rs index 6929fa6..5355042 100644 --- a/app-proto/src/components/outline.rs +++ b/app-proto/src/components/outline.rs @@ -45,8 +45,8 @@ fn RegulatorInput(regulator: Rc) -> View { view! { input( - r#type="text", - class=move || { + r#type = "text", + class = move || { if valid.get() { set_point.with(|set_pt| { if set_pt.is_present() { @@ -59,9 +59,9 @@ fn RegulatorInput(regulator: Rc) -> View { "regulator-input invalid" } }, - placeholder=measurement.with(|result| result.to_string()), - bind:value=value, - on:change=move |_| { + placeholder = measurement.with(|result| result.to_string()), + bind:value = value, + on:change = move |_| { valid.set( match SpecifiedValue::try_from(value.get_clone_untracked()) { Ok(set_pt) => { @@ -72,11 +72,11 @@ fn RegulatorInput(regulator: Rc) -> View { } ) }, - on:keydown={ + on:keydown = { move |event: KeyboardEvent| { match event.key().as_str() { "Escape" => reset_value(), - _ => () + _ => (), } } }, @@ -96,11 +96,11 @@ impl OutlineItem for InversiveDistanceRegulator { self.subjects[0].label() }.clone(); view! { - li(class="regulator") { - div(class="regulator-label") { (other_subject_label) } - div(class="regulator-type") { "Inversive distance" } - RegulatorInput(regulator=self) - div(class="status") + li(class = "regulator") { + div(class = "regulator-label") { (other_subject_label) } + div(class = "regulator-type") { "Inversive distance" } + RegulatorInput(regulator = self) + div(class = "status") } } } @@ -109,11 +109,11 @@ impl OutlineItem for InversiveDistanceRegulator { impl OutlineItem for HalfCurvatureRegulator { fn outline_item(self: Rc, _element: &Rc) -> View { view! { - li(class="regulator") { - div(class="regulator-label") // for spacing - div(class="regulator-type") { "Half-curvature" } - RegulatorInput(regulator=self) - div(class="status") + li(class = "regulator") { + div(class = "regulator-label") // for spacing + div(class = "regulator-type") { "Half-curvature" } + RegulatorInput(regulator = self) + div(class = "status") } } } @@ -152,10 +152,10 @@ fn ElementOutlineItem(element: Rc) -> View { let details_node = create_node_ref(); view! { li { - details(ref=details_node) { + details(ref = details_node) { summary( - class=class.get(), - on:keydown={ + class = class.get(), + on:keydown = { let element_for_handler = element.clone(); move |event: KeyboardEvent| { match event.key().as_str() { @@ -181,12 +181,12 @@ fn ElementOutlineItem(element: Rc) -> View { } ) { div( - class="element-switch", - on:click=|event: MouseEvent| event.stop_propagation() + class = "element-switch", + on:click = |event: MouseEvent| event.stop_propagation() ) div( - class="element", - on:click={ + class = "element", + on:click = { let state_for_handler = state.clone(); let element_for_handler = element.clone(); move |event: MouseEvent| { @@ -196,20 +196,20 @@ fn ElementOutlineItem(element: Rc) -> View { } } ) { - div(class="element-label") { (label) } - div(class="element-representation") { (rep_components) } + div(class = "element-label") { (label) } + div(class = "element-representation") { (rep_components) } input( - r#type="checkbox", - bind:checked=element.ghost(), - on:click=|event: MouseEvent| event.stop_propagation() + r#type = "checkbox", + bind:checked = element.ghost(), + on:click = |event: MouseEvent| event.stop_propagation() ) } } - ul(class="regulators") { + ul(class = "regulators") { Keyed( - list=regulator_list, - view=move |reg| reg.outline_item(&element), - key=|reg| reg.serial() + list = regulator_list, + view = move |reg| reg.outline_item(&element), + key = |reg| reg.serial() ) } } @@ -242,18 +242,18 @@ pub fn Outline() -> View { view! { ul( - id="outline", - on:click={ + id = "outline", + on:click = { let state = use_context::(); move |_| state.selection.update(|sel| sel.clear()) } ) { Keyed( - list=element_list, - view=|elt| view! { - ElementOutlineItem(element=elt) + list = element_list, + view = |elt| view! { + ElementOutlineItem(element = elt) }, - key=|elt| elt.serial() + key = |elt| elt.serial() ) } } diff --git a/app-proto/src/components/test_assembly_chooser.rs b/app-proto/src/components/test_assembly_chooser.rs index 8b5bbac..5ed94ad 100644 --- a/app-proto/src/components/test_assembly_chooser.rs +++ b/app-proto/src/components/test_assembly_chooser.rs @@ -925,17 +925,17 @@ pub fn TestAssemblyChooser() -> View { // build the chooser view! { - select(bind:value=assembly_name) { - option(value="general") { "General" } - option(value="low-curv") { "Low-curvature" } - option(value="pointed") { "Pointed" } - option(value="tridim-icosahedron") { "Tridiminished icosahedron" } - option(value="dodeca-packing") { "Dodecahedral packing" } - option(value="balanced") { "Balanced" } - option(value="off-center") { "Off-center" } - option(value="radius-ratio") { "Radius ratio" } - option(value="irisawa-hexlet") { "Irisawa hexlet" } - option(value="empty") { "Empty" } + select(bind:value = assembly_name) { + option(value = "general") { "General" } + option(value = "low-curv") { "Low-curvature" } + option(value = "pointed") { "Pointed" } + option(value = "tridim-icosahedron") { "Tridiminished icosahedron" } + option(value = "dodeca-packing") { "Dodecahedral packing" } + option(value = "balanced") { "Balanced" } + option(value = "off-center") { "Off-center" } + option(value = "radius-ratio") { "Radius ratio" } + option(value = "irisawa-hexlet") { "Irisawa hexlet" } + option(value = "empty") { "Empty" } } } } \ No newline at end of file diff --git a/app-proto/src/main.rs b/app-proto/src/main.rs index 0e5456b..7ca0731 100644 --- a/app-proto/src/main.rs +++ b/app-proto/src/main.rs @@ -58,7 +58,7 @@ fn main() { provide_context(AppState::new()); view! { - div(id="sidebar") { + div(id = "sidebar") { AddRemove {} Outline {} Diagnostics {}