Skip to content

Instantly share code, notes, and snippets.

@adamdriscoll
Created January 22, 2018 12:06
Show Gist options
  • Save adamdriscoll/4c4f6bdc702fbe150666548ed7e1fa8b to your computer and use it in GitHub Desktop.
Save adamdriscoll/4c4f6bdc702fbe150666548ed7e1fa8b to your computer and use it in GitHub Desktop.
Using SVG in UD
function New-Circle {
param($Color)
New-UDElement -Tag "svg" -Content {
New-UDElement -Tag "circle" -Attributes @{
cx = "50"
cy = "50"
r = "40"
stroke = "black"
strokeWidth = 1
fill = $color
}
} -Attributes @{ height = "100px"; width = "100px"}
}
$Dashboard = New-UDDashboard -Title "VS Code" -Content {
New-UDCard -Title "Hello, Code!" -Content {
New-Circle -Color "Red"
New-UDElement -Tag "span" -Content { "Oh geez!" }
}
New-UDCard -Title "Hello, Code!" -Content {
New-Circle -Color "Green"
New-UDElement -Tag "span" -Content { "Everything is good!" }
}
}
Start-UDDashboard -Port 10000 -Dashboard $Dashboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment