Add a realization status indicator
This commit is contained in:
parent
6d2e3d776b
commit
b54a8a92e7
4 changed files with 105 additions and 29 deletions
|
@ -10,9 +10,37 @@ use sycamore::prelude::*;
|
|||
|
||||
use crate::AppState;
|
||||
|
||||
// a realization status indicator
|
||||
#[component]
|
||||
pub fn RealizationStatus() -> View {
|
||||
let state = use_context::<AppState>();
|
||||
let realization_status = state.assembly.realization_status;
|
||||
view! {
|
||||
div(
|
||||
id="realization-status",
|
||||
class=realization_status.with(
|
||||
|status| match status {
|
||||
Ok(_) => "",
|
||||
Err(_) => "invalid"
|
||||
}
|
||||
)
|
||||
) {
|
||||
div(class="status")
|
||||
div {
|
||||
(realization_status.with(
|
||||
|status| match status {
|
||||
Ok(_) => "Target accuracy achieved".to_string(),
|
||||
Err(message) => message.clone()
|
||||
}
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// a plot of the loss history from the last realization
|
||||
#[component]
|
||||
pub fn Diagnostics() -> View {
|
||||
pub fn LossHistory() -> View {
|
||||
const CONTAINER_ID: &str = "loss-history";
|
||||
let state = use_context::<AppState>();
|
||||
let renderer = WasmRenderer::new_opt(None, Some(180)).theme(Theme::Walden);
|
||||
|
@ -62,4 +90,14 @@ pub fn Diagnostics() -> View {
|
|||
view! {
|
||||
div(id=CONTAINER_ID)
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn Diagnostics() -> View {
|
||||
view! {
|
||||
div(id="diagnostics") {
|
||||
RealizationStatus {}
|
||||
LossHistory {}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue