annotate ismi-python-neo4jrestclient/static/index.html @ 9:0f4846255b20

updated for ismi-dev.
author casties
date Thu, 01 Oct 2015 17:35:56 +0200
parents 45dad9e38c82
children 394bd5cfc508
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>
7
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
47 <th>Title (translit)</th>
9
0f4846255b20 updated for ismi-dev.
casties
parents: 7
diff changeset
48 <th>Title (arabic)</th>
7
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
49 <th>ismi_id</th>
6
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
50 </tr>
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
51 </thead>
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
52 <tbody>
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 </table>
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
55 </div>
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 class="col-md-7">
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
58 <div class="panel panel-default">
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
59 <div class="panel-heading" id="title">Details</div>
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
60 <div class="row">
7
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
61 <!-- <div class="col-sm-4 col-md-4">
6
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
62 <img src="" class="well" id="poster"/>
7
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
63 </div> -->
6
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
64 <div class="col-md-8 col-sm-8">
7
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
65 <h4>Details</h4>
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
66 <ul id="info">
6
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
67 </ul>
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
68 </div>
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 <style type="text/css">
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
74 .node { stroke: #222; stroke-width: 1.5px; }
7
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
75 .node.TEXT { fill: #888; }
6
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
76 .node.movie { fill: #BBB; }
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
77 .link { stroke: #999; stroke-opacity: .6; stroke-width: 1px; }
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
78 </style>
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
79
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
80 <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
81 <!-- <script src="https://d3js.org/d3.v3.min.js" type="text/javascript"></script> -->
0f4846255b20 updated for ismi-dev.
casties
parents: 7
diff changeset
82 <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
83 <script type="text/javascript">
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
84 $(function () {
7
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
85 function showMovie(text_id) {
9
0f4846255b20 updated for ismi-dev.
casties
parents: 7
diff changeset
86 $.get("/netvis-ismi/text/" + encodeURIComponent(text_id),
6
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
87 function (data) {
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
88 if (!data) return;
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
89 $("#title").text(data.title);
9
0f4846255b20 updated for ismi-dev.
casties
parents: 7
diff changeset
90 // $("#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
91 var $list = $("#info").empty();
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
92 for (key in data.attrs) {
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
93 $list.append($("<li>" + key + ": " + data.attrs[key] + "</li>"));
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
94 };
6
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
95 }, "json");
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
96 return false;
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
97 }
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
98 function search() {
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
99 var query=$("#search").find("input[name=search]").val();
9
0f4846255b20 updated for ismi-dev.
casties
parents: 7
diff changeset
100 $.get("/netvis-ismi/search?q=" + encodeURIComponent(query),
6
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
101 function (data) {
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
102 var t = $("table#results tbody").empty();
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
103 if (!data || data.length == 0) return;
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
104 data.forEach(function (row) {
7
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
105 var text = row.text;
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
106 $("<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
107 .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
108 });
7
45dad9e38c82 first functional version of commentary visualisation.
casties
parents: 6
diff changeset
109 showMovie(data[0].text.ismi_id);
6
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
110 }, "json");
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
111 return false;
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
112 }
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
113
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
114 $("#search").submit(search);
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
115 search();
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
116 })
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
117 </script>
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 type="text/javascript">
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
120 var width = 800, height = 800;
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
121
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
122 var force = d3.layout.force()
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
123 .charge(-200).linkDistance(30).size([width, height]);
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
124
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
125 var svg = d3.select("#graph").append("svg")
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
126 .attr("width", "100%").attr("height", "100%")
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
127 .attr("pointer-events", "all");
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
128
9
0f4846255b20 updated for ismi-dev.
casties
parents: 7
diff changeset
129 d3.json("/netvis-ismi/graph", function(error, graph) {
6
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
130 if (error) return;
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
131
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
132 force.nodes(graph.nodes).links(graph.links).start();
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 var link = svg.selectAll(".link")
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
135 .data(graph.links).enter()
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
136 .append("line").attr("class", "link");
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
137
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
138 var node = svg.selectAll(".node")
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
139 .data(graph.nodes).enter()
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
140 .append("circle")
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
141 .attr("class", function (d) { return "node "+d.label })
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
142 .attr("r", 10)
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
143 .call(force.drag);
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
144
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
145 // html title attribute
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
146 node.append("title")
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
147 .text(function (d) { return d.title; })
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
148
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
149 // force feed algo ticks
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
150 force.on("tick", function() {
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
151 link.attr("x1", function(d) { return d.source.x; })
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
152 .attr("y1", function(d) { return d.source.y; })
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
153 .attr("x2", function(d) { return d.target.x; })
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
154 .attr("y2", function(d) { return d.target.y; });
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
155
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
156 node.attr("cx", function(d) { return d.x; })
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
157 .attr("cy", function(d) { return d.y; });
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
158 });
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
159 });
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
160 </script>
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
161 </body>
aeef1fedd899 first version of ismi-python-neo4jrestclient. doesn't work yet.
casties
parents:
diff changeset
162 </html>