Working formatting of weights for nodes and edges

This commit is contained in:
elvis
2025-07-12 15:32:21 +02:00
parent dcb1e63c35
commit 483260c2a3
5 changed files with 206 additions and 41 deletions

View File

@ -48,6 +48,7 @@ pub fn digraph(
// Nodes -----------------------------------------------------------------------
/// Helper structure that specifies what information to display for nodes.
#[derive(Clone)]
pub enum GraphMapNodes {
Hide,
Entities,
@ -55,7 +56,8 @@ pub enum GraphMapNodes {
Context,
}
type GraphMapNodesFnTy = dyn Fn(petgraph::prelude::NodeIndex, &RSsystem) -> String;
type GraphMapNodesFnTy =
dyn Fn(petgraph::prelude::NodeIndex, &RSsystem) -> String;
/// Helper structure that holds a formatting function from node as RSsystem to
/// string
pub struct GraphMapNodesTy {
@ -133,6 +135,7 @@ impl From<GraphMapNodesTy> for Box<GraphMapNodesFnTy> {
// Edges -----------------------------------------------------------------------
/// Helper structure that specifies what information to display for edges
#[derive(Clone)]
pub enum GraphMapEdges {
Hide,
Products,