Mercurial > hg > NetworkVis
comparison ismi-python-neo4jrestclient/static/commentaries.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 |
---|---|
79 | 79 |
80 <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script> | 80 <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> --> | 81 <!-- <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> | 82 <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" type="text/javascript"></script> |
83 <script type="text/javascript"> | 83 <script type="text/javascript"> |
84 backendApiPrefix = ""; | |
84 $(function () { | 85 $(function () { |
85 function showMovie(text_id) { | 86 function showMovie(text_id) { |
86 $.get("/netvis-ismi/text/" + encodeURIComponent(text_id), | 87 $.get(backendApiPrefix+"/text/" + encodeURIComponent(text_id), |
87 function (data) { | 88 function (data) { |
88 if (!data) return; | 89 if (!data) return; |
89 $("#title").text(data.title); | 90 $("#title").text(data.title); |
90 // $("#poster").attr("src","//neo4j-contrib.github.io/developer-resources/language-guides/assets/posters/"+encodeURIComponent(data.title)+".jpg"); | 91 // $("#poster").attr("src","//neo4j-contrib.github.io/developer-resources/language-guides/assets/posters/"+encodeURIComponent(data.title)+".jpg"); |
91 var $list = $("#info").empty(); | 92 var $list = $("#info").empty(); |
99 }, "json"); | 100 }, "json"); |
100 return false; | 101 return false; |
101 } | 102 } |
102 function search() { | 103 function search() { |
103 var query=$("#search").find("input[name=search]").val(); | 104 var query=$("#search").find("input[name=search]").val(); |
104 $.get("/netvis-ismi/search?q=" + encodeURIComponent(query), | 105 $.get(backendApiPrefix+"/search?q=" + encodeURIComponent(query), |
105 function (data) { | 106 function (data) { |
106 var t = $("table#results tbody").empty(); | 107 var t = $("table#results tbody").empty(); |
107 if (!data || data.length == 0) return; | 108 if (!data || data.length == 0) return; |
108 data.forEach(function (row) { | 109 data.forEach(function (row) { |
109 var text = row.text; | 110 var text = row.text; |
128 | 129 |
129 var svg = d3.select("#graph").append("svg") | 130 var svg = d3.select("#graph").append("svg") |
130 .attr("width", "100%").attr("height", "100%") | 131 .attr("width", "100%").attr("height", "100%") |
131 .attr("pointer-events", "all"); | 132 .attr("pointer-events", "all"); |
132 | 133 |
133 d3.json("/netvis-ismi/graph", function(error, graph) { | 134 d3.json(backendApiPrefix+"/graph", function(error, graph) { |
134 if (error) return; | 135 if (error) return; |
135 | 136 |
136 force.nodes(graph.nodes).links(graph.links).start(); | 137 force.nodes(graph.nodes).links(graph.links).start(); |
137 | 138 |
138 var link = svg.selectAll(".link") | 139 var link = svg.selectAll(".link") |