Function
validateNonNegativeEdgeWeights
(
graph: Graph<N, E, T> | MutableGraph<N, E, T>,
cost: (edgeData: E) => number,
algorithm: string
)
Source from the content-addressed store, hash-verified
| 3150 | */ |
| 3151 | readonly direction?: MermaidDirection |
| 3152 | |
| 3153 | /** |
| 3154 | * Function to determine node shape for each node. |
| 3155 | * Defaults to "rectangle" for all nodes if not provided. |
| 3156 | */ |
| 3157 | readonly nodeShape?: (data: N) => MermaidNodeShape |
| 3158 | } |
| 3159 | |
| 3160 | /** |
| 3161 | * Escapes special characters in labels for Mermaid syntax compatibility. |
| 3162 | */ |
| 3163 | const escapeMermaidLabel = (label: string): string => { |
| 3164 | // Escape special characters for Mermaid using HTML entity codes |
| 3165 | // According to: https://mermaid.js.org/syntax/flowchart.html#special-characters-that-break-syntax |
| 3166 | return label |
| 3167 | .replace(/#/g, "#35;") |
| 3168 | .replace(/"/g, "#quot;") |
| 3169 | .replace(/</g, "#lt;") |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…