-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelationship.html
120 lines (112 loc) · 3.66 KB
/
relationship.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Relationship</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.1/css/bulma.min.css">
<script src="https://unpkg.com/vue"></script>
<script src="https://cdn.rawgit.com/simplesmiler/vue-clickaway/2.1.0/dist/vue-clickaway.js"></script>
<script src="js/d3.v4.min.js"></script>
<script src="js/d3.tip.js"></script>
<script src="js/forcegraph.js"></script>
<link rel="stylesheet" type="text/css" href="/css/style.css">
<style>
#forcegraph {
width: 960px;
margin: auto;
border-color: #a5a5a5;
}
#legendarea {
width: 960px;
margin: auto;
}
.legend text {
font-size: 13px;
fill: #3c3c3c;
}
#yearSlider {
-webkit-appearance: none;
outline: none;
border-radius: 5px;
background: #d7dcdf;
height: 10px;
width: 80%;
margin-left: 5%;
margin-top; 0;
}
#yearSlider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 20px;
height: 20px;
border-radius: 50%;
background: #2c3e50;
cursor: pointer;
-webkit-transition: background .15s ease-in-out;
transition: background .15s ease-in-out;
}
#yearSlider::-webkit-slider-thumb:hover {
background: #1abc9c;
}
#sliderDisplay {
display: inline-block;
position: relative;
width: 10%;
color: #fff;
line-height: 20px;
text-align: center;
border-radius: 3px;
background: #2c3e50;
padding: 5px 10px;
margin-left: 8px;
}
</style>
</head>
<body>
<section class="section">
<div class="container is-fluid">
<div id="filter" class="columns is-multiline">
<div class="column is-4">
<div class="tags has-addons" id="level-filter">
<span class="tag is-dark is-medium labeltag">{{ filterName }}</span>
<input class="button tag is-white is-medium input-text" type="text" placeholder="depth of network" v-model="level">
</div>
</div>
<div class="column">
<div class="tags has-addons" id="paper-filter">
<span class="tag is-dark is-medium labeltag">{{ filterName }}</span>
<input class="button tag is-white is-medium input-text" type="text" placeholder="center of network" v-model="paperNames">
</div>
</div>
</div>
<div class="columns">
<div class="column is-2">
<a id="submit-button" class="button" onclick="filterFunction()">Submit</a>
</div>
</div>
</div>
</section>
<div id="chartarea">
<div id="slider"></div>
<div id="forcegraph"></div>
<div id="legendarea"></div>
</div>
<script src="js/vue-userinput.js"></script>
<script>
function filterFunction() {
d3.selectAll("svg").remove();
d3.selectAll("#slider > *").remove();
var paper = paperFilter.paperNames;
var level = levelFilter.level;
if (level < 1) {
alert("Level must be positive number");
return;
}
var url = "http://128.199.249.171/web?level=" + level + "&paper=" + paper;
drawForceGraph(url);
}
</script>
</body>
</html>