annotate ismi-python-neo4jrestclient/static/commentaries_authors2.html @ 16:ad3eefa2cb80

pimped commentaries_authors.html visualisation.
author casties
date Tue, 06 Oct 2015 19:26:46 +0200
parents
children 09c0a9ceb778
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
1 <html>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
2 <head>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
3 <meta name="viewport" content="width=device-width, initial-scale=1.0">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
4 <link rel="stylesheet" href="static/main.css">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
5 <title>ISMI commentary relations</title>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
6 </head>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
7
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
8 <body style="background:none;">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
9 <div role="navigation" class="navbar navbar-default navbar-static-top">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
10 <div class="container">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
11 <div class="row">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
12 <div class="col-sm-6 col-md-6">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
13 <ul class="nav navbar-nav">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
14 <li>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
15 <form role="search" class="navbar-form" id="search">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
16 <div class="form-group">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
17 <input type="text" value="7437" placeholder="Search for person-id" class="form-control" name="search">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
18 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
19 <button class="btn btn-default" type="submit">Search</button>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
20 </form>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
21 </li>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
22 </ul>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
23 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
24 <div class="navbar-header col-sm-6 col-md-6">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
25 <div class="logo-well">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
26 <a href="//neo4j.com/developer-resources">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
27 <img src="//neo4j-contrib.github.io/developer-resources/language-guides/assets/img/logo-white.svg" alt="Neo4j World's Leading Graph Database" id="logo">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
28 </a>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
29 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
30 <div class="navbar-brand">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
31 <div class="brand">ISMI Commentary relations between Texts</div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
32 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
33 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
34 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
35 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
36 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
37
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
38 <div class="row">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
39 <div class="col-md-5">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
40 <div class="panel panel-default">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
41 <div class="panel-heading">Search Results</div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
42 <table id="results" class="table table-striped table-hover">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
43 <thead>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
44 <tr>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
45 <th>Author (translit)</th>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
46 <th>Title (translit)</th>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
47 <th>Title (arabic)</th>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
48 <th>ismi_id</th>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
49 </tr>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
50 </thead>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
51 <tbody>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
52 </tbody>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
53 </table>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
54 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
55 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
56 <div class="col-md-7">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
57 <div class="panel panel-default">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
58 <div class="panel-heading" id="title">Details</div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
59 <div class="row">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
60 <!-- <div class="col-sm-4 col-md-4">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
61 <img src="" class="well" id="poster"/>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
62 </div> -->
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
63 <div class="col-md-8 col-sm-8">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
64 <h4>Details</h4>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
65 <ul id="info">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
66 </ul>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
67 <h4>Commenting on</h4>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
68 <ul id="commenting">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
69 </ul>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
70 <h4>Commentaries</h4>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
71 <ul id="commentaries">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
72 </ul>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
73 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
74 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
75 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
76 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
77 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
78 <div class="col-lg-12">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
79 <div id="graph" class="panel panel-default">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
80 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
81 </div>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
82
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
83 <style type="text/css">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
84 .node { stroke: #222; stroke-width: 1.5px; }
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
85 .node.TEXT { fill: #888; }
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
86 .node.TEXT.marked { stroke: red; }
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
87 .node.TEXT.selected { fill: red; }
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
88 .link { stroke: #999; stroke-opacity: .6; stroke-width: 1px; }
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
89 </style>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
90
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
91 <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
92 <!-- <script src="https://d3js.org/d3.v3.min.js" type="text/javascript"></script> -->
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
93 <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" type="text/javascript"></script>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
94 <script type="text/javascript">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
95 backendApiPrefix = "";
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
96 $(function () {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
97 function showText(text_id) {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
98 $.get(backendApiPrefix+"/textandcommentaries/" + encodeURIComponent(text_id),
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
99 function (data) {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
100 if (!data) return;
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
101 $("#title").text(data.title);
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
102 var $list = $("#info").empty();
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
103 $list.append($("<li> author: " + data.author + "</li>"));
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
104 for (var key in data.attrs) {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
105 var val = data.attrs[key];
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
106 if (key === "link") {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
107 val = "<a href=\"" + val + "\" target=\"_blank\">" + val + "</a>";
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
108 }
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
109 $list.append($("<li>" + key + ": " + val + "</li>"));
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
110 };
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
111 // re-set selected
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
112 $("#graph .selected").each(function(){this.classList.remove("selected")});
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
113 $("#graph .ismi-"+data.attrs.ismi_id).each(function(){this.classList.add("selected")});
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
114 var $commentaries = $("#commentaries").empty();
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
115 for (var key in data.commentaries) {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
116 var val = data.commentaries[key];
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
117 $commentaries.append($("<li>" + val.title + " [<span class=\"text_id\">" + key + "</span>] by " + val.author + "</li>")
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
118 .click(function() { showText($(this).find("span.text_id").text());}));
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
119 }
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
120 var $commenting = $("#commenting").empty();
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
121 for (var key in data.commenting) {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
122 var val = data.commenting[key];
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
123 $commenting.append($("<li>" + val.title + " [<span class=\"text_id\">" + key + "</span>] by " + val.author + "</li>")
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
124 .click(function() { showText($(this).find("span.text_id").text());}));
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
125 }
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
126 }, "json");
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
127 return false;
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
128 }
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
129 function search() {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
130 var query=$("#search").find("input[name=search]").val();
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
131 $.get(backendApiPrefix+"/search?q=" + encodeURIComponent(query),
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
132 function (data) {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
133 var t = $("table#results tbody").empty();
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
134 if (!data || data.length == 0) return;
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
135 // clear all marks
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
136 $("#graph .marked").each(function(){this.classList.remove("marked")});
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
137 data.forEach(function (row) {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
138 var text = row.text;
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
139 var author = row.author;
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
140 $("<tr><td>" + author.label + "</td><td>" + text.label + "</td><td>" + text.full_title + "</td><td class='text_id'>" + text.ismi_id + "</td></tr>").appendTo(t)
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
141 .click(function() { showText($(this).find("td.text_id").text());});
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
142 // set mark
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
143 $("#graph .ismi-"+text.ismi_id).each(function(){this.classList.add("marked")});
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
144 });
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
145 showText(data[0].text.ismi_id);
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
146 }, "json");
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
147 return false;
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
148 }
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
149
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
150 $("#search").submit(search);
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
151 search();
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
152 })
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
153 </script>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
154
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
155 <script type="text/javascript">
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
156 var width = 1800, height = 1800;
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
157
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
158 var force = d3.layout.force()
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
159 .charge(-200).linkDistance(30).size([width, height]);
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
160
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
161 var svg = d3.select("#graph").append("svg")
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
162 .attr("width", "1800px").attr("height", "1800px")
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
163 .attr("pointer-events", "all");
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
164
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
165 d3.json(backendApiPrefix+"/graph?limit=1000", function(error, graph) {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
166 if (error) return;
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
167
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
168 force.nodes(graph.nodes).links(graph.links).start();
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
169
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
170 var link = svg.selectAll(".link")
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
171 .data(graph.links).enter()
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
172 .append("line").attr("class", "link");
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
173
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
174 var node = svg.selectAll(".node")
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
175 .data(graph.nodes).enter()
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
176 .append("circle")
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
177 .attr("class", function (d) { return "node "+d.label+" ismi-"+d.ismi_id})
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
178 .attr("r", 10)
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
179 .call(force.drag);
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
180
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
181 // html title attribute
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
182 node.append("title")
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
183 .text(function (d) { return d.title; })
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
184
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
185 // force feed algo ticks
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
186 force.on("tick", function() {
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
187 link.attr("x1", function(d) { return d.source.x; })
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
188 .attr("y1", function(d) { return d.source.y; })
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
189 .attr("x2", function(d) { return d.target.x; })
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
190 .attr("y2", function(d) { return d.target.y; });
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
191
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
192 node.attr("cx", function(d) { return d.x; })
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
193 .attr("cy", function(d) { return d.y; });
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
194 });
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
195 });
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
196 </script>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
197 </body>
ad3eefa2cb80 pimped commentaries_authors.html visualisation.
casties
parents:
diff changeset
198 </html>