1use ferrum_flow::*;
2use gpui::{AppContext as _, Application, WindowOptions};
3
4fn main() {
5 Application::new().run(|cx| {
6 let mut graph = Graph::new();
7
8 graph
9 .create_node("")
10 .position(100.0, 100.0)
11 .output()
12 .build(&mut graph);
13
14 graph
15 .create_node("")
16 .position(300.0, 400.0)
17 .input()
18 .output()
19 .build(&mut graph);
20
21 graph
22 .create_node("")
23 .position(500.0, 500.0)
24 .input()
25 .output()
26 .build(&mut graph);
27
28 cx.open_window(WindowOptions::default(), |_, cx| {
29 cx.new(|fc| {
30 let mut flow = FlowCanvas::new(graph, fc)
31 .plugin(SelectionPlugin::new())
32 .plugin(NodeInteractionPlugin::new())
33 .plugin(ViewportPlugin::new())
34 .plugin(Background::new())
35 .plugin(NodePlugin::new())
36 .plugin(PortInteractionPlugin::new())
37 .plugin(EdgePlugin::new())
38 .plugin(DeletePlugin::new())
39 .plugin(HistoryPlugin::new());
40 flow.init_plugins();
41 flow
42 })
43 })
44 .unwrap();
45 });
46}