Skip to content

Control New-DiagramLink arrow width #328

Description

@PatrickOnGit

Dear Przemyslaw

Is it possible to control the width of an arrow between two nodes?
I have written a little function that visualizes AD Site configuration and would like to have different arrow sizes based on site costs.
Later I also want to add also option to click on a site / site link to get additional information. But that is a different topic;-)

The code currently looks like this:

`Import-Module PSWriteHTML -Force

New-HTML -TitleText 'AD Sites' -Online -FilePath $PSScriptRoot\ADSites.html {

New-HTMLSection {

    New-HTMLDiagram -Height 800 {
        New-DiagramOptionsPhysics -StabilizationEnabled $true -Solver repulsion 
        Get-ADReplicationSite -filter * |
            ForEach-Object {
                $Site = $_
                Switch -Regex ($_.Name) {
                    "^Default-First-Site-Name$" { New-DiagramNode -Label "$($Site.Name)" -Id "$($Site.DistinguishedName)" -ColorBackground Amber }
                    "^(MainSite-0|MainSite-2)$" { New-DiagramNode -Label "$($Site.Name)" -Id "$($Site.DistinguishedName)" -ColorBackground Amber }
                    Default {New-DiagramNode -Label "$($Site.Name)" -Id "$($Site.DistinguishedName)" }
                }

            }
        Get-ADReplicationSiteLink -filter * |
            ForEach-Object {
                 If ( $_.SitesIncluded.count -lt 2 ) {
                     Write-Warning $( "Sitelink {0} has {1} sites included." -f $_.Name, $_.SitesIncluded.Count )
                 }
                 # Create all possible links
                 for ($i = 0; $i -lt $_.SitesIncluded.count; $i++) {
                    for ($n = ($i + 1); $n -lt $_.SitesIncluded.count; $n++) {
                        New-DiagramLink -From $_.SitesIncluded[$i] -To $_.SitesIncluded[$n] -Label $_.Name
                        
                    }
                 }
                 
            }
    } #-DisableLoadingBar

}

} -ShowHTML`

Thank you for your support.
Patrick

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions