annotate ismi-python-neo4jrestclient/static/index.html @ 13:394bd5cfc508

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