Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AsBuiltReport.Diagram/AsBuiltReport.Diagram.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AsBuiltReport.Diagram.psm1'

# Version number of this module.
ModuleVersion = '1.0.7'
ModuleVersion = '1.0.8'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
25 changes: 22 additions & 3 deletions AsBuiltReport.Diagram/Src/Private/Add-HtmlNodeTable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ function Add-HtmlNodeTable {
.PARAMETER SubgraphIconHeight
Allow to set a subgraph icon height.

.PARAMETER IconWidth
Allow to set the icon width. When combined with IconHeight, the icon's table cell is fixed to that size and the image is scaled to fit.

.PARAMETER IconHeight
Allow to set the icon height. When combined with IconWidth, the icon's table cell is fixed to that size and the image is scaled to fit.

.PARAMETER TableBackgroundColor
Allow to set a table background color (Hex format EX: #FFFFFF).

Expand Down Expand Up @@ -400,6 +406,18 @@ function Add-HtmlNodeTable {
)]
[string] $SubgraphIconHeight,

[Parameter(
Mandatory = $false,
HelpMessage = 'Allow to set the icon width'
)]
[string] $IconWidth,

[Parameter(
Mandatory = $false,
HelpMessage = 'Allow to set the icon height'
)]
[string] $IconHeight,

[Parameter(
Mandatory = $false,
HelpMessage = 'Allow to set a table background color'
Expand Down Expand Up @@ -634,16 +652,17 @@ function Add-HtmlNodeTable {
}
}
} else {
$IconSizeAttr = if ($IconWidth -and $IconHeight) { ' fixedsize="true" width="{0}" height="{1}"' -f $IconWidth, $IconHeight } else { '' }
if ($MultiIcon) {
while ($Number -ne $Group.Count) {
if ($Icon.Count -gt 1) {
foreach ($Element in $Group[$Number]) {
$TDICON += '<TD ALIGN="{0}" colspan="1"><img src="{1}"/></TD>' -f $Align, $Icon[$iconNumber]
$TDICON += '<TD ALIGN="{0}" colspan="1"{1}><img src="{2}"/></TD>' -f $Align, $IconSizeAttr, $Icon[$iconNumber]
$iconNumber++
}
} else {
foreach ($Element in $Group[$Number]) {
$TDICON += '<TD ALIGN="{0}" colspan="1"><img src="{1}"/></TD>' -f $Align, $Icon
$TDICON += '<TD ALIGN="{0}" colspan="1"{1}><img src="{2}"/></TD>' -f $Align, $IconSizeAttr, $Icon
}
}
$TR += '<TR>{0}</TR>' -f $TDICON
Expand Down Expand Up @@ -708,7 +727,7 @@ function Add-HtmlNodeTable {
} else {

$TDICONMatch = if ($Icon.Count -eq 1) { $Icon } else { $Icon[0] }
$TDICON += '<TD ALIGN="{0}" colspan="{1}"><img src="{2}"/></TD>' -f $Align, $inputObject.Count, $TDICONMatch
$TDICON += '<TD ALIGN="{0}" colspan="{1}"{2}><img src="{3}"/></TD>' -f $Align, $inputObject.Count, $IconSizeAttr, $TDICONMatch

$TR += '<TR>{0}</TR>' -f $TDICON

Expand Down
16 changes: 15 additions & 1 deletion AsBuiltReport.Diagram/Src/Public/New-AbrDiagram.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
.PARAMETER MainGraphAttributes
Hashtable of graph attributes to override or augment defaults (examples: fontname, fontcolor, imagepath, style, nodesep, ranksep, bgcolor).

.PARAMETER Dpi
Raster output resolution in dots per inch for PNG/JPG formats (Ex: 300). Default: 96 (Graphviz default).

.PARAMETER WaterMarkColor
Color used for watermark text. Default: 'DarkGray'.

Expand Down Expand Up @@ -488,7 +491,14 @@
HelpMessage = 'Set the image size in percent (100% is default)'
)]
[ValidateRange(1, 100)]
[int] $MainGraphLogoSizePercent = 100
[int] $MainGraphLogoSizePercent = 100,
Comment thread
rebelinux marked this conversation as resolved.
Dismissed

[Parameter(
Mandatory = $false,
HelpMessage = 'Allow to set the raster output resolution in dots per inch (Ex: 300). Default: 96 (Graphviz default)'
)]
[ValidateRange(72, 600)]
[int] $Dpi
)

begin {
Expand Down Expand Up @@ -567,6 +577,10 @@
if ($MainGraphSize) {
$MainGraphAttributes['size'] = $MainGraphSize
}

if ($Dpi) {
$MainGraphAttributes['dpi'] = $Dpi
}
}

process {
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.8] - 2026-06-16

### :rocket: Added

- Add `-Dpi` parameter to `New-AbrDiagram`, allowing the raster output resolution (PNG/JPG) to be set directly via the Graphviz `dpi` graph attribute instead of being fixed at the Graphviz default of 96
- Add `-IconWidth`/`-IconHeight` parameters to `Add-HtmlNodeTable`, allowing the rendered icon size in a node's HTML table to be set explicitly instead of being derived solely from the source image's pixel dimensions

## [1.0.7] - 2026-05-02

### :arrows_clockwise: Changed
Expand Down
Loading