Skip to content

Instantly share code, notes, and snippets.

@nwillc
Last active October 18, 2018 01:40
Show Gist options
  • Save nwillc/a19348131b15e600090e4ad77ad930c8 to your computer and use it in GitHub Desktop.
Save nwillc/a19348131b15e600090e4ad77ad930c8 to your computer and use it in GitHub Desktop.
KSVG Example
val svg = svg {
width = 200
height = 200
rect {
title {
body = "A Blue Rectangle"
}
x = 50
y = 50
width = 20
height = 10
fill = "blue"
}
circle {
cx = 100
cy = 150
r = 20
fill = "red"
}
}
val sb = StringBuilder()
svg.render(sb)
System.out.println("<html><body>$sb</body></html>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment