gantz_egui 0.6.1

UI traits and widgets that make up the GUI for gantz, an environment for creative systems.
Documentation
use crate::{Env, NodeCtx, NodeUi, NodeUiResponse, SocketDoc, SocketKind};

impl NodeUi for gantz_core::node::Delay {
    fn name(&self, _: &Env<'_>) -> std::borrow::Cow<'_, str> {
        "delay".into()
    }

    fn description(&self) -> Option<&'static str> {
        Some("Output the previous evaluation's value")
    }

    fn ui(&mut self, _ctx: NodeCtx, uictx: egui_graph::NodeCtx) -> NodeUiResponse {
        let framed =
            uictx.framed(|ui, _sockets| ui.add(egui::Label::new("delay").selectable(false)));
        NodeUiResponse::new(framed)
    }

    fn socket_doc(&self, _: &Env<'_>, kind: SocketKind, _ix: usize) -> Option<SocketDoc> {
        Some(match kind {
            SocketKind::Input => {
                SocketDoc::ty("any").with_description("value stored for the next evaluation")
            }
            SocketKind::Output => SocketDoc::ty("any").with_description(
                "value from the previous evaluation (initially '()); enables feedback cycles",
            ),
        })
    }
}