Mercurial > hg > NetworkVis
comparison 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 |
comparison
equal
deleted
inserted
replaced
7:45dad9e38c82 | 9:0f4846255b20 |
---|---|
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <meta name="viewport" content="width=device-width, initial-scale=1.0"> | 3 <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
4 <link rel="stylesheet" href="http://neo4j-contrib.github.io/developer-resources/language-guides/assets/css/main.css"> | 4 <link rel="stylesheet" href="//neo4j-contrib.github.io/developer-resources/language-guides/assets/css/main.css"> |
5 <title>Neo4j Movies</title> | 5 <title>Neo4j Movies</title> |
6 </head> | 6 </head> |
7 | 7 |
8 <body> | 8 <body style="background:none;"> |
9 <div id="graph"> | 9 <div id="graph"> |
10 </div> | 10 </div> |
11 <div role="navigation" class="navbar navbar-default navbar-static-top"> | 11 <div role="navigation" class="navbar navbar-default navbar-static-top"> |
12 <div class="container"> | 12 <div class="container"> |
13 <div class="row"> | 13 <div class="row"> |
23 </li> | 23 </li> |
24 </ul> | 24 </ul> |
25 </div> | 25 </div> |
26 <div class="navbar-header col-sm-6 col-md-6"> | 26 <div class="navbar-header col-sm-6 col-md-6"> |
27 <div class="logo-well"> | 27 <div class="logo-well"> |
28 <a href="http://neo4j.com/developer-resources"> | 28 <a href="//neo4j.com/developer-resources"> |
29 <img src="http://neo4j-contrib.github.io/developer-resources/language-guides/assets/img/logo-white.svg" alt="Neo4j World's Leading Graph Database" id="logo"> | 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"> |
30 </a> | 30 </a> |
31 </div> | 31 </div> |
32 <div class="navbar-brand"> | 32 <div class="navbar-brand"> |
33 <div class="brand">ISMI Commentary relations between Texts</div> | 33 <div class="brand">ISMI Commentary relations between Texts</div> |
34 </div> | 34 </div> |
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>Title (translit)</th> | 47 <th>Title (translit)</th> |
48 <th>Title (arabic)</th> | |
48 <th>ismi_id</th> | 49 <th>ismi_id</th> |
49 <th>Title (arabic)</th> | |
50 </tr> | 50 </tr> |
51 </thead> | 51 </thead> |
52 <tbody> | 52 <tbody> |
53 </tbody> | 53 </tbody> |
54 </table> | 54 </table> |
76 .node.movie { fill: #BBB; } | 76 .node.movie { fill: #BBB; } |
77 .link { stroke: #999; stroke-opacity: .6; stroke-width: 1px; } | 77 .link { stroke: #999; stroke-opacity: .6; stroke-width: 1px; } |
78 </style> | 78 </style> |
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="http://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 type="text/javascript"> | 83 <script type="text/javascript"> |
83 $(function () { | 84 $(function () { |
84 function showMovie(text_id) { | 85 function showMovie(text_id) { |
85 $.get("/text/" + encodeURIComponent(text_id), | 86 $.get("/netvis-ismi/text/" + encodeURIComponent(text_id), |
86 function (data) { | 87 function (data) { |
87 if (!data) return; | 88 if (!data) return; |
88 $("#title").text(data.title); | 89 $("#title").text(data.title); |
89 // $("#poster").attr("src","http://neo4j-contrib.github.io/developer-resources/language-guides/assets/posters/"+encodeURIComponent(data.title)+".jpg"); | 90 // $("#poster").attr("src","//neo4j-contrib.github.io/developer-resources/language-guides/assets/posters/"+encodeURIComponent(data.title)+".jpg"); |
90 var $list = $("#info").empty(); | 91 var $list = $("#info").empty(); |
91 for (key in data.attrs) { | 92 for (key in data.attrs) { |
92 $list.append($("<li>" + key + ": " + data.attrs[key] + "</li>")); | 93 $list.append($("<li>" + key + ": " + data.attrs[key] + "</li>")); |
93 }; | 94 }; |
94 }, "json"); | 95 }, "json"); |
95 return false; | 96 return false; |
96 } | 97 } |
97 function search() { | 98 function search() { |
98 var query=$("#search").find("input[name=search]").val(); | 99 var query=$("#search").find("input[name=search]").val(); |
99 $.get("/search?q=" + encodeURIComponent(query), | 100 $.get("/netvis-ismi/search?q=" + encodeURIComponent(query), |
100 function (data) { | 101 function (data) { |
101 var t = $("table#results tbody").empty(); | 102 var t = $("table#results tbody").empty(); |
102 if (!data || data.length == 0) return; | 103 if (!data || data.length == 0) return; |
103 data.forEach(function (row) { | 104 data.forEach(function (row) { |
104 var text = row.text; | 105 var text = row.text; |
123 | 124 |
124 var svg = d3.select("#graph").append("svg") | 125 var svg = d3.select("#graph").append("svg") |
125 .attr("width", "100%").attr("height", "100%") | 126 .attr("width", "100%").attr("height", "100%") |
126 .attr("pointer-events", "all"); | 127 .attr("pointer-events", "all"); |
127 | 128 |
128 d3.json("/graph", function(error, graph) { | 129 d3.json("/netvis-ismi/graph", function(error, graph) { |
129 if (error) return; | 130 if (error) return; |
130 | 131 |
131 force.nodes(graph.nodes).links(graph.links).start(); | 132 force.nodes(graph.nodes).links(graph.links).start(); |
132 | 133 |
133 var link = svg.selectAll(".link") | 134 var link = svg.selectAll(".link") |