comparison 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
comparison
equal deleted inserted replaced
12:d67c5ad47709 13:394bd5cfc508
42 <div class="panel panel-default"> 42 <div class="panel panel-default">
43 <div class="panel-heading">Search Results</div> 43 <div class="panel-heading">Search Results</div>
44 <table id="results" class="table table-striped table-hover"> 44 <table id="results" class="table table-striped table-hover">
45 <thead> 45 <thead>
46 <tr> 46 <tr>
47 <th>Author (translit)</th>
47 <th>Title (translit)</th> 48 <th>Title (translit)</th>
48 <th>Title (arabic)</th> 49 <th>Title (arabic)</th>
49 <th>ismi_id</th> 50 <th>ismi_id</th>
50 </tr> 51 </tr>
51 </thead> 52 </thead>
71 </div> 72 </div>
72 </div> 73 </div>
73 <style type="text/css"> 74 <style type="text/css">
74 .node { stroke: #222; stroke-width: 1.5px; } 75 .node { stroke: #222; stroke-width: 1.5px; }
75 .node.TEXT { fill: #888; } 76 .node.TEXT { fill: #888; }
76 .node.movie { fill: #BBB; } 77 .node.PERSON { fill: #BBB; }
77 .link { stroke: #999; stroke-opacity: .6; stroke-width: 1px; } 78 .link { stroke: #999; stroke-opacity: .6; stroke-width: 1px; }
78 </style> 79 </style>
79 80
80 <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script> 81 <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
81 <!-- <script src="https://d3js.org/d3.v3.min.js" type="text/javascript"></script> --> 82 <!-- <script src="https://d3js.org/d3.v3.min.js" type="text/javascript"></script> -->
82 <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" type="text/javascript"></script> 83 <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" type="text/javascript"></script>
83 <script type="text/javascript"> 84 <script type="text/javascript">
85 backendApiPrefix = "";
84 $(function () { 86 $(function () {
85 function showMovie(text_id) { 87 function showMovie(text_id) {
86 $.get("/netvis-ismi/text/" + encodeURIComponent(text_id), 88 $.get(backendApiPrefix+"/text/" + encodeURIComponent(text_id),
87 function (data) { 89 function (data) {
88 if (!data) return; 90 if (!data) return;
89 $("#title").text(data.title); 91 $("#title").text(data.title);
90 // $("#poster").attr("src","//neo4j-contrib.github.io/developer-resources/language-guides/assets/posters/"+encodeURIComponent(data.title)+".jpg"); 92 // $("#poster").attr("src","//neo4j-contrib.github.io/developer-resources/language-guides/assets/posters/"+encodeURIComponent(data.title)+".jpg");
91 var $list = $("#info").empty(); 93 var $list = $("#info").empty();
95 }, "json"); 97 }, "json");
96 return false; 98 return false;
97 } 99 }
98 function search() { 100 function search() {
99 var query=$("#search").find("input[name=search]").val(); 101 var query=$("#search").find("input[name=search]").val();
100 $.get("/netvis-ismi/search?q=" + encodeURIComponent(query), 102 $.get(backendApiPrefix+"/search?q=" + encodeURIComponent(query),
101 function (data) { 103 function (data) {
102 var t = $("table#results tbody").empty(); 104 var t = $("table#results tbody").empty();
103 if (!data || data.length == 0) return; 105 if (!data || data.length == 0) return;
104 data.forEach(function (row) { 106 data.forEach(function (row) {
105 var text = row.text; 107 var text = row.text;
124 126
125 var svg = d3.select("#graph").append("svg") 127 var svg = d3.select("#graph").append("svg")
126 .attr("width", "100%").attr("height", "100%") 128 .attr("width", "100%").attr("height", "100%")
127 .attr("pointer-events", "all"); 129 .attr("pointer-events", "all");
128 130
129 d3.json("/netvis-ismi/graph", function(error, graph) { 131 d3.json(backendApiPrefix"/graph", function(error, graph) {
130 if (error) return; 132 if (error) return;
131 133
132 force.nodes(graph.nodes).links(graph.links).start(); 134 force.nodes(graph.nodes).links(graph.links).start();
133 135
134 var link = svg.selectAll(".link") 136 var link = svg.selectAll(".link")