Scripts/New-AnimateSvg.ps1
<# .SYNOPSIS Sample control for UniversalDashboard. .DESCRIPTION Sample control function for UniversalDashboard. This function must have an ID and return a hash table. .PARAMETER Id An id for the component default value will be generated by new-guid. .EXAMPLE PS C:\> New-AnimateSvg Will display a 5 second animated bar chart SVG icon as the default .INPUTS Inputs (if any) .OUTPUTS Output (if any) .NOTES General notes #> function New-AnimateSvg { param( [Parameter()] [string]$Id = (New-Guid).ToString(), [Parameter()] [int]$Duration = 3000, [Parameter()] [string]$ViewBox = "0 0 20 20", [Parameter()] [string]$Stroke = "black", [Parameter()] [decimal]$StrokeWidth = 0.2, [Parameter()] [string]$Fill = "none", [Parameter()] [string]$d = "M17.431,2.156h-3.715c-0.228,0-0.413,0.186-0.413,0.413v6.973h-2.89V6.687c0-0.229-0.186-0.413-0.413-0.413H6.285c-0.228,0-0.413,0.184-0.413,0.413v6.388H2.569c-0.227,0-0.413,0.187-0.413,0.413v3.942c0,0.228,0.186,0.413,0.413,0.413h14.862c0.228,0,0.413-0.186,0.413-0.413V2.569C17.844,2.342,17.658,2.156,17.431,2.156 M5.872,17.019h-2.89v-3.117h2.89V17.019zM9.587,17.019h-2.89V7.1h2.89V17.019z M13.303,17.019h-2.89v-6.651h2.89V17.019z M17.019,17.019h-2.891V2.982h2.891V17.019z" ) End { @{ # The AssetID of the main JS File assetId = $AssetId # Tell UD this is a plugin isPlugin = $true # This ID must be the same as the one used in the JavaScript to register the control with UD type = "Animate-Svg" # An ID is mandatory id = $Id # This is where you can put any other properties. They are passed to the React control's props # The keys are case-sensitive in JS. duration = $Duration viewBox = $ViewBox stroke = $Stroke strokeWidth = $StrokeWidth fill = $Fill d = $d } } } |