Build a readable Mermaid node label.
(node: dict)
| 1061 | |
| 1062 | |
| 1063 | def node_label(node: dict) -> str: |
| 1064 | """Build a readable Mermaid node label.""" |
| 1065 | label = humanize_label(node.get("label") or node.get("id"), node.get("source_file", "")) |
| 1066 | source_file = safe_file_path(node.get("source_file", "")) |
| 1067 | if source_file and not label.endswith(Path(source_file).name): |
| 1068 | return f"{safe_mermaid_text(label)}<br/><small>{safe_mermaid_text(source_file)}</small>" |
| 1069 | return safe_mermaid_text(label) |
| 1070 | |
| 1071 | |
| 1072 | def group_nodes_by_file(nodes: list) -> dict: |
no test coverage detected