-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
collaboration.go
85 lines (80 loc) · 3.23 KB
/
collaboration.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
package wardleyToGo
import (
"gonum.org/v1/gonum/graph"
)
// A Collaboration is an edge between two components with a certain type
type Collaboration interface {
graph.Edge
GetType() EdgeType
}
/*
func (e Edge) SVGTT(s *svg.SVG, width, height, padLeft, padBottom int) {
fromCoord := e.F.(Element).GetCoordinates()
toCoord := e.T.(Element).GetCoordinates()
switch e.EdgeType {
case CollaborationEdge:
s.Line(fromCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-fromCoord[0]*(height-padLeft)/100,
toCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-toCoord[0]*(height-padLeft)/100,
`stroke="grey"`, `stroke-width="1"`)
s.Line(fromCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-fromCoord[0]*(height-padLeft)/100,
toCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-toCoord[0]*(height-padLeft)/100,
`stroke-dasharray="15 10"`, `stroke="rgb(250,216,120)"`, `stroke-width="10"`)
case FacilitatingEdge:
s.Line(fromCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-fromCoord[0]*(height-padLeft)/100,
toCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-toCoord[0]*(height-padLeft)/100,
`stroke="grey"`, `stroke-width="1"`)
s.Line(fromCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-fromCoord[0]*(height-padLeft)/100,
toCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-toCoord[0]*(height-padLeft)/100,
`stroke-dasharray="8 8"`, `stroke="rgb(200,159,182)"`, `stroke-width="10"`)
case XAsAServiceEdge:
s.Line(fromCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-fromCoord[0]*(height-padLeft)/100,
toCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-toCoord[0]*(height-padLeft)/100,
`stroke="grey"`, `stroke-width="1"`)
s.Line(fromCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-fromCoord[0]*(height-padLeft)/100,
toCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-toCoord[0]*(height-padLeft)/100,
`stroke-dasharray="2 14"`, `stroke="grey"`, `stroke-width="20"`)
}
}
func (e Edge) SVG(s *svg.SVG, width, height, padLeft, padBottom int) {
fromCoord := e.F.(Element).GetCoordinates()
toCoord := e.T.(Element).GetCoordinates()
switch e.EdgeType {
case RegularEdge:
s.Line(fromCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-fromCoord[0]*(height-padLeft)/100,
toCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-toCoord[0]*(height-padLeft)/100,
`stroke="grey"`, `stroke-width="1"`)
case EvolvedComponentEdge:
s.Line(fromCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-fromCoord[0]*(height-padLeft)/100,
toCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-toCoord[0]*(height-padLeft)/100,
`stroke-dasharray="5 5"`, `stroke="red"`, `stroke-width="1"`, `marker-end="url(#arrow)"`)
case EvolvedEdge:
s.Line(fromCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-fromCoord[0]*(height-padLeft)/100,
toCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-toCoord[0]*(height-padLeft)/100,
`stroke="red"`, `stroke-width="1"`)
default:
s.Line(fromCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-fromCoord[0]*(height-padLeft)/100,
toCoord[1]*(width-padLeft)/100+padLeft,
(height-padLeft)-toCoord[0]*(height-padLeft)/100,
`stroke="grey"`, `stroke-width="1"`)
}
}
*/