Skip to main content

leptos_node_graph/
layout.rs

1use std::collections::HashMap;
2
3use crate::types::*;
4
5#[derive(Clone, Debug)]
6pub struct LayoutGraph<N: NodeId, P: PortId> {
7    pub nodes: HashMap<N, Size>,
8    pub edges: Vec<(N, N)>,
9    pub port_to_node: HashMap<P, N>,
10}
11
12pub trait LayoutEngine<N: NodeId, P: PortId> {
13    fn compute(&self, graph: &LayoutGraph<N, P>) -> HashMap<N, Position>;
14}