-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
87 lines (74 loc) · 1.9 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// English:
//
// This example was taken from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d
//
// Português:
//
// Este exemplo foi retirado do site https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d
//
// <svg viewBox="0 -1 30 11" xmlns="http://www.w3.org/2000/svg">
//
// <!--
// An open shape with the last point of
// the path different to the first one
// -->
// <path stroke="red"
// d="M 5,1
// l -4,8 8,0" />
//
// <!--
// An open shape with the last point of
// the path matching the first one
// -->
// <path stroke="red"
// d="M 15,1
// l -4,8 8,0 -4,-8" />
//
// <!--
// A closed shape with the last point of
// the path different to the first one
// -->
// <path stroke="red"
// d="M 25,1
// l -4,8 8,0
// z" />
// </svg>
//go:build js
// +build js
package main
import (
"github.com/helmutkemper/iotmaker.webassembly/browser/factoryBrowser"
"github.com/helmutkemper/iotmaker.webassembly/platform/factoryColor"
)
func main() {
done := make(chan struct{}, 0)
stage := factoryBrowser.NewStage()
s1 := factoryBrowser.NewTagSvg().ViewBox([]float64{0, -1, 30, 11}).Append(
// An open shape with the last point of
// the path different to the first one
factoryBrowser.NewTagSvgPath().Stroke(factoryColor.NewRed()).D(factoryBrowser.NewPath().M(5, 1).Ld(-4, 8).Ld(8, 0)),
// An open shape with the last point of
// the path matching the first one
factoryBrowser.NewTagSvgPath().Stroke(factoryColor.NewRed()).D(factoryBrowser.NewPath().M(15, 1).Ld(-4, 8).Ld(8, 0).Ld(-4, -8)),
// A closed shape with the last point of
// the path different to the first one
factoryBrowser.NewTagSvgPath().Stroke(factoryColor.NewRed()).D(factoryBrowser.NewPath().M(25, 1).Ld(-4, 8).Ld(8, 0).Z()),
)
stage.Append(s1)
<-done
}
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//