jellyflow-runtime 0.1.0

Headless store, rules, schema, profile, and change pipeline for Jellyflow.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::super::endpoints::EdgeEndpointPosition;
use super::label::edge_center_label;
use super::types::{EdgePath, PathCommand};

pub fn straight_edge_path(
    source: EdgeEndpointPosition,
    target: EdgeEndpointPosition,
) -> Option<EdgePath> {
    let label = edge_center_label(source.point, target.point)?;
    Some(EdgePath {
        commands: vec![
            PathCommand::MoveTo(source.point),
            PathCommand::LineTo(target.point),
        ],
        label,
    })
}