Skip to content

Commit

Permalink
Merge pull request #89 from KevinMarquette/subgraphcrashes !deploy
Browse files Browse the repository at this point in the history
mitigate sub graph crashes
  • Loading branch information
KevinMarquette committed Dec 16, 2018
2 parents 16cf788 + 2a93ea5 commit e74bcb9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Expand Up @@ -3,7 +3,6 @@
"powershell.codeFormatting.openBraceOnSameLine": false,
"powershell.codeFormatting.newLineAfterOpenBrace": true,
"powershell.codeFormatting.preset": "Allman",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"files.defaultLanguage": "powershell",
Expand Down
12 changes: 9 additions & 3 deletions PSGraph/Public/Edge.ps1
Expand Up @@ -165,16 +165,22 @@ function Edge
{
foreach ( $tNode in $To )
{
if ([string]::IsNullOrEmpty( $LiteralAttribute ) )
if ( [string]::IsNullOrEmpty( $LiteralAttribute ) )
{
$GraphVizAttribute = ConvertTo-GraphVizAttribute -Attributes $Attributes -From $sNode -To $tNode
}

( '{0}{1}->{2} {3}' -f (Get-Indent),
if ($GraphVizAttribute -match 'ltail=' -or $GraphVizAttribute -match 'lhead=')
{
# our subgraph to subgraph edges can crash the layout engine
# adding invisible edge for layout hints helps resolve this
Edge -From $sNode -To $tNode -LiteralAttribute '[style=invis]'
}

'{0}{1}->{2} {3}' -f (Get-Indent),
(Format-Value $sNode -Edge),
(Format-Value $tNode -Edge),
$GraphVizAttribute
)
}
}
}
Expand Down

0 comments on commit e74bcb9

Please sign in to comment.