-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
104 lines (101 loc) · 3.66 KB
/
index.html
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!doctype html>
<html>
<head>
<title>Tester</title>
<link type="text/css" rel="stylesheet" href="build/css/angular-d3-draw.css"></link>
<style>
/*
#drawSvg .rectText {
text-align: center;
font-size: 32px;
line-height: 200px;
}
#drawSvg .rectStyle {
fill: #f60;
stroke: black;
stroke-width: 5;
opacity: 0.3
}
*/
.rrr {
fill: #960;
}
.ttt {
fill: #609;
}
.test {
color: #000;
}
#group-1 {
fill: red;
stroke: white;
}
#group-2 {
fill: blue;
stroke: black;
}
.linkarrow {
stroke: #609;
stroke-width: 5;
}
</style>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/d3/d3.js"></script>
<script src="src/angular-d3-draw.js"></script>
<!-- for min version
<script src="build/angular-d3-draw.min.js"></script>
-->
<script src="app.js"></script>
</head>
<body ng-app="examples" ng-controller="main">
<div ng-show="d3">Current d3 version number: {{ d3.version }}</div>
<div ng-hide="d3">Failing test :(</div>
<div style="width: 600px; height: 500px">
<svg id="drawSvg" width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<g id="rect-group">
<rect x="0" y="0" width="60" height="30" />
<rect x="20" y="10" width="20" height="50" />
</g>
</defs>
<g id="group-1" transform="translate(10.5,20.5)">
<use xlink:href="#rect-group" />
</g>
<g id="group-2" transform="translate(55.5,32.5)">
<use xlink:href="#rect-group" />
</g>
</svg>
</div>
<svg-adaptor svgid="drawSvg" ng-transclude>
<rect-text id="svgtext" x="50" y="50" rx="20" ry="50" width="200" height="150"
style="fill:#fc0;" text-class="test" rect-class="great" text="{{d3text}}"></rect-text>
<right-rounded-rect id="rrr01" x="{{rrr01.x}}" y="{{rrr01.y}}" width="{{rrr01.width}}" height="{{rrr01.height}}" radius="{{rrr01.radius}}" class="rrr"></right-rounded-rect>
<right-rounded-rect id="rrr02" x="0" y="60" width="30" height="20" radius="10" class="ttt"></right-rounded-rect>
<link-arrow id='la01' x1='{{ladata.x1}}' y1='{{ladata.y1}}' x2='{{ladata.x2}}' y2='{{ladata.y2}}'
stroke-width='2' stroke='#069' class="linkarrow"></link-arrow>
<link-arrow id='la02' x1='50' y1='300' x2='20' y2='50'
stroke-width='2' stroke='#069' class="linkarrow"></link-arrow>
</svg-adaptor>
<div>
[ test area:<input type="text" ng-model="testNum" value="3" />||<label>{{testNum}}==>{{addZeros(testNum)}}</label> ]
</div>
<div>
<input type="text" ng-model="d3text" size="50" />
<button ng-click="pointArrow()">Point arrow</button>
<button ng-click="changeRRR01()">Change rrr01</button>
</div>
<div>These example below shows that the chrome or what ever browser can not render
svg element dynamically.</div>
<div>
<svg-here id="hsvg" width="100" height="80" ng-transclude>
<rect x="5" y="5" width="20" height="20"></rect>
</svg-here>
</div>
<div>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" id="hsvg" width="100" height="80">
<circle-test></circle-test>
</svg>
</div>
</body>
</html>