-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyRepotTestChild3.html
More file actions
106 lines (91 loc) · 4.03 KB
/
Copy pathMyRepotTestChild3.html
File metadata and controls
106 lines (91 loc) · 4.03 KB
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
105
106
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Local HTML Report</title>
<link rel="stylesheet" href="css/jquery-ui.css" type="text/css">
<link rel="stylesheet" href="css/bootstrap.css" type="text/css">
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css" type="text/css">
<link rel="stylesheet" href="css/nv.d3.css" type="text/css">
<link rel="stylesheet" href="css/bootstrap-select.min.css" type="text/css">
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-select.min.js"></script>
<script src="js/d3.v3.js"></script>
<script src="js/nv.d3.js"></script>
<script src="js/d3.layout.cloud.js"></script>
</head>
<body><div class="container">
<script>
</script>
<div class="page-wrapper">
<div class="doc-wrapper">
<div class="container">
<div class="doc-body">
<div class="doc-sidebar hidden-xs">
<nav id="doc-nav">
<ul id="doc-menu" class="nav doc-menu" data-apy="affix">
<li><a href="title_0">I am a child 3</a></li>
</ul></nav></div>
<H1 id="title_2">Fourth Page</H1>
</div></div></div></div>
<H1 id="title_0">I am a child 3</H1>
<div id="chart1" class="None">
<svg width="960" height="500"></svg>
</div>
<script>
nv.addGraph(function() {
var fill = d3.scale.category20();
var data_1 = [{'size': 23, 'text': '9N4MWS'}, {'size': 33, 'text': '70CZPQ'}, {'size': 34, 'text': 'FL4YVN'}, {'size': 29, 'text': 'IXHW6Q'}, {'size': 15, 'text': 'VMH3RH'}, {'size': 22, 'text': 'WQGU8C'}, {'size': 33, 'text': 'KJY3NI'}, {'size': 12, 'text': '4RVH7Y'}, {'size': 26, 'text': '8HNWZI'}, {'size': 9, 'text': '1LAC92'}] ;
d3.layout.cloud().size([960, 600])
.words(data_1) // Refer to the data variable
.rotate(function() { return ~~(Math.random() * 2) * 90; })
.font("Impact")
.fontSize(function(d) { return d.size; })
.on("end", draw)
.start()
;
function draw(words) {
d3.select("#chart1 svg") // Refer to the chart variable
.append("g")
.attr("transform", "translate(150,150)")
.selectAll("text")
.data(words)
.enter().append("text")
.style("font-size", function(d) { return d.size + "px"; })
.style("font-family", "Impact")
.style("fill", function(d, i) { return fill(i); })
.attr("text-anchor", "middle")
.attr("transform", function(d) { return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; })
.text(function(d) { return d.text; });
}
;
// words should be the javascript version of the data set expected by the graph
// Should be the select to the svg component
function drawCloudUpdate(words, jsGraphRef){
d3.layout.cloud().size([500, 500])
.words(words)
.padding(5)
.rotate(function() { return ~~(Math.random() * 2) * 90; })
.font("Impact")
.fontSize(function(d) { return d.size; })
.start();
jsGraphRef
.selectAll("g").attr("transform", "translate(150,150)")
.selectAll("text")
.data(words).enter().append("text")
.style("font-size", function(d) { return d.size + "px"; })
.style("font-family", "Impact")
.style("fill", function(d, i) { return fill(i); })
.attr("transform", function(d) { return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; })
.text(function(d) { return d.text; });
};
});
</script>
</div>
</body>
</html>