github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/gno.land/p/demo/svg/z1_filetest.gno (about)

     1  // PKGPATH: gno.land/p/demo/svg_test
     2  package svg_test
     3  
     4  import "gno.land/p/demo/svg"
     5  
     6  func main() {
     7  	canvas := svg.Canvas{
     8  		Width: 500, Height: 500,
     9  		Elems: []svg.Elem{
    10  			svg.Rectangle{50, 50, 100, 100, "red"},
    11  			svg.Circle{50, 50, 100, "red"},
    12  			svg.Text{100, 100, "hello world!", "magenta"},
    13  		},
    14  	}
    15  	println(canvas)
    16  }
    17  
    18  // Output:
    19  // <svg xmlns="http://www.w3.org/2000/svg" width="500" height="500"><rect x="50" y="50" width="100" height="100" fill="red" /><circle cx="50" cy="50" r="100" fill="red" /><text x="100" y="100" fill="magenta">hello world!</text></svg>