Skip to content

Commit

Permalink
chore: update example
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed May 7, 2024
1 parent 4b0b1c4 commit 8b6b01c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ func ExampleNew() {
svg.Title(svg.CharData("Example triangle01- simple example of a 'path'")),
svg.Desc(svg.CharData("A path that draws a triangle")),
svg.Rect().XYWidthHeight(1, 1, 398, 398, svg.Number).Fill("none").Stroke("blue"),
svg.Path().D("M 100 100 L 300 100 L 200 300 z").Fill("red").Stroke("blue").StrokeWidth(svg.Number(3)),
svg.Path().D(svgpath.New(
svgpath.MoveToAbs([]float64{100, 100}),
svgpath.LineToAbs([]float64{300, 100}),
svgpath.LineToAbs([]float64{200, 300}),
svgpath.ClosePath(),
)).Fill("red").Stroke("blue").StrokeWidth(svg.Number(3)),
)
if _, err := svgElement.WriteToIndent(os.Stdout, "", " "); err != nil {
panic(err)
Expand All @@ -36,7 +41,7 @@ Output:
<title>Example triangle01- simple example of a &#39;path&#39;</title>
<desc>A path that draws a triangle</desc>
<rect fill="none" height="398" stroke="blue" width="398" x="1" y="1"></rect>
<path d="M 100 100 L 300 100 L 200 300 z" fill="red" stroke="blue" stroke-width="3"></path>
<path d="M100,100 L300,100 L200,300 z" fill="red" stroke="blue" stroke-width="3"></path>
</svg>
```

Expand Down

0 comments on commit 8b6b01c

Please sign in to comment.