Replies: 3 comments 2 replies
-
|
The initial (beta implementation) is ready - there are however a lot of features that need to be tested before we can release it. use appcui::{prelude::*, ui::graphview::{Edge, NodeBuilder}};
fn get_graph_1() -> graphview::Graph<&'static str> {
graphview::Graph::with_slices_and_border(
&["A", "Node B", "C", "D12"],
&[(0, 1), (0, 2), (1, 2), (2, 3)],
LineType::Single
)
}
fn get_graph_2() -> graphview::Graph<&'static str> {
let sz = Size::new(5,1);
let v = vec![
NodeBuilder::new("Hello world !").size(sz).border(LineType::Double).build(),
NodeBuilder::new("Color").size(sz).border(LineType::Double).build(),
NodeBuilder::new("100").size(sz).border(LineType::Double).build(),
NodeBuilder::new("Turbo car").size(sz).border(LineType::Double).build(),
];
let e = vec![
Edge::bidirectional(0,1),
Edge::bidirectional(0,2),
Edge::bidirectional(1,2),
Edge::bidirectional(2,3),
];
graphview::Graph::new(v, e)
}
fn main() -> Result<(), appcui::system::Error> {
let mut a = App::new().build()?;
let mut w = window!("Test,d:f");
let mut gv = GraphView::new(Layout::fill(), graphview::Flags::None);
gv.set_graph(get_graph_2());
w.add(gv);
a.add_window(w);
a.run();
Ok(())
}and while it can work with any type of Object - this example is using strings ( |
Beta Was this translation helpful? Give feedback.
-
|
A video to highlight how the new control works: Currently the code is on the main branch (and will be updated to crates.io soon). |
Beta Was this translation helpful? Give feedback.
-
|
Updated on crates.io |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Discuss about how a Node Graph control / widget should be constructed
Beta Was this translation helpful? Give feedback.
All reactions