import io.data2viz.color.*
import io.data2viz.geom.*
import io.data2viz.math.*
import io.data2viz.viz.*
fun main() {
viz {
size = size(600, 600) //<- you need a viz size
// but change everything from here
val gradient =
Colors.Gradient.linear(point(0, 0), point(600, 0))
.withColor(Colors.Web.hotpink)
.andColor(Colors.Web.blueviolet)
text {
x = 10.0
y = 70.0
textContent = "Sketch your Viz!"
textColor = gradient
fontSize = 12.0
}
// to here
}.bindRendererOnNewCanvas()
}
Sketch Settings
Sketch Thumbnail
To save a thumbnail that will be displayed on the sketches page, click on the Snapshot button from the editor page.
If your visualization is animated, choose the best moment to take the snapshot.