MCPcopy Create free account
hub / github.com/cogentcore/core / SVGToFile

Method SVGToFile

plot/draw.go:41–52  ·  view source on GitHub ↗

SVGToFile saves the SVG to given file

(filename string)

Source from the content-addressed store, hash-verified

39
40// SVGToFile saves the SVG to given file
41func (pt *Plot) SVGToFile(filename string) error {
42 fp, err := os.Create(filename)
43 if err != nil {
44 return err
45 }
46 defer fp.Close()
47 bw := bufio.NewWriter(fp)
48 pt.Paint.SVGOut = bw
49 pt.svgDraw()
50 pt.Paint.SVGOut = nil
51 return bw.Flush()
52}
53
54// drawConfig configures everything for drawing
55func (pt *Plot) drawConfig() {

Callers

nothing calls this directly

Calls 4

svgDrawMethod · 0.95
CreateMethod · 0.80
CloseMethod · 0.65
FlushMethod · 0.45

Tested by

no test coverage detected