A egui port of https://github.com/Nelarius/imnodes
``` rust pub fn examplegraph(ctx: &mut Context, links: &mut Vec<(usize, usize)>, ui: &mut Ui) { // add nodes with attributes let nodes = vec![ NodeConstructor::new(0, Default::default()) .withtitle(|ui| ui.label("Example Node A")) .withinputattribute(0, Default::default(), |ui| ui.label("Input")) .withstaticattribute(1, |ui| ui.label("Can't Connect to Me")) .withoutputattribute(2, Default::default(), |ui| ui.label("Output")), NodeConstructor::new(1, Default::default()) .withtitle(|ui| ui.label("Example Node B")) .withstaticattribute(3, |ui| ui.label("Can't Connect to Me")) .withoutputattribute(4, Default::default(), |ui| ui.label("Output")) .withinput_attribute(5, Default::default(), |ui| ui.label("Input")) ];
// add them to the ui
ctx.show(
nodes,
links.iter().enumerate().map(|(i, (start, end))| (i, *start, *end, LinkArgs::default())),
ui
);
// remove destroyed links
if let Some(idx) = ctx.link_destroyed() {
links.remove(idx);
}
// add created links
if let Some((start, end, _)) = ctx.link_created() {
links.push((start, end))
}
} ```