Mercurial > hg > NetworkVis
annotate query_builder/ismi.html @ 39:88c5232f9d48 default tip
fix click on author name.
author | casties |
---|---|
date | Thu, 04 Feb 2016 18:56:48 +0100 |
parents | 5384b71df52a |
children |
rev | line source |
---|---|
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
1 <!DOCTYPE html> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
2 <html> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
3 <head> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
4 <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
5 <title>Query Builder</title> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
6 <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"> |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
7 <link rel="stylesheet" href="select2-4.0.1/dist/css/select2.min.css"> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
8 |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
9 <script type="text/javascript" src="js/d3.min.js"></script> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
10 <script type="text/javascript" src="select2-4.0.1/vendor/jquery-2.1.0.js"></script> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
11 <script type="text/javascript" src="select2-4.0.1/dist/js/select2.full.min.js"></script> |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
12 |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
13 |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
14 </head> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
15 <body style="background:none;"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
16 <div role="navigation" class="navbar navbar-default navbar-static-top"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
17 <div class="container"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
18 <div class="row"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
19 <div class="col-sm-6 col-md-6"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
20 <ul class="nav navbar-nav"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
21 </ul> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
22 </div> |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
23 <div class="navbar-header col-sm-6 col-md-6" style="height: 105px;"> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
24 <div class="col-md-6"> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
25 <div class="navbar-brand"> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
26 <div class="brand">ISMI Query Builder</div> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
27 </div> |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
28 </div> |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
29 <div class="col-md-offset-6"> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
30 <div class="logo-well" style="height: 60%; width: 60%;"> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
31 <a href="//neo4j.com/developer-resources"> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
32 <img src="//neo4j-contrib.github.io/developer-resources/language-guides/assets/img/logo-white.svg" alt="Neo4j World's Leading Graph Database" id="logo" style="max-height: 50%; width: 50%"> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
33 </a> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
34 </div> |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
35 </div> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
36 </div> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
37 </div> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
38 </div> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
39 </div> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
40 <div class="container"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
41 <div class="row" style="width: 95%"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
42 <div class="col-md-12"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
43 <div class="panel panel-default"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
44 <div class="panel-heading" id="title">Query Builder</div> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
45 |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
46 <section> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
47 <div class="s2-example"> |
28 | 48 <div id="filter" class="row"> |
49 <div class="col-sm-3 col-md-3"> | |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
50 <select class="js-example-data-array form-control"></select> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
51 </div> |
28 | 52 <div class="col-sm-3 col-md-3"> |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
53 <select class="js-example-data-array2 form-control"></select> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
54 </div> |
28 | 55 <div class="col-sm-3 col-md-3"> |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
56 <select class="js-example-data-array3 form-control"> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
57 <option value="" disabled selected>Loading...</option> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
58 </select> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
59 </div> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
60 </div> |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
61 </div> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
62 |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
63 <!-- <pre data-fill-from=".js-code-data-array"></pre> --> |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
64 </section> |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
65 |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
66 </div> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
67 </div> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
68 </div> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
69 </div> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
70 |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
71 <script type="text/javascript" class="js-code-data-array"> |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
72 |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
73 |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
74 var queryData = []; |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
75 |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
76 var data = [{ id: 0, text: 'TEXT' }, { id: 1, text: 'CODEX' }, { id: 2, text: 'WITNESS' }, { id: 3, text: 'COLLECTION' }, { id: 4, text: 'PERSON' }]; |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
77 |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
78 var relations = [{ id: 0, text: 'equal' }, { id: 1, text: 'in' }]; |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
79 |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
80 $(".js-example-data-array").select2({ |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
81 data: data |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
82 }); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
83 ajax1("TEXT"); |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
84 |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
85 $(".js-example-data-array2").select2({ |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
86 data: relations |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
87 }); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
88 |
28 | 89 $(".js-example-data-array3").select2(); |
90 | |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
91 // Ajax request function |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
92 function ajax1(q) { |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
93 var combinedQuery = "match (n:TEXT) return n"; |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
94 if (q !== undefined) combinedQuery = "match (n:" + q + ") return n"; |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
95 console.log(combinedQuery); |
28 | 96 $.ajaxSetup({ |
97 headers: { | |
98 "Authorization": 'Basic ' + window.btoa("neo4j"+":"+"neo5j") | |
99 } | |
100 }); | |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
101 return $.ajax({ |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
102 type: "POST", |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
103 url: "https://ismi-dev.mpiwg-berlin.mpg.de/neo4j-ismi/db/data/cypher", |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
104 accepts: "application/json", |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
105 dataType: "json", |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
106 data: { |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
107 "query": combinedQuery, |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
108 "params": {} |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
109 }, |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
110 beforeSend: function (xhr) { |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
111 xhr.setRequestHeader ("Authorization", "Basic " + btoa('neo4j' + ":" + 'neo5j')); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
112 }, |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
113 processResults: function (data, params) { |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
114 // parse the results into the format expected by Select2 |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
115 // since we are using custom formatting functions we do not need to |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
116 // alter the remote JSON data, except to indicate that infinite |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
117 // scrolling can be used |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
118 params.page = params.page || 1; |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
119 console.log(data.length); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
120 return { |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
121 pagination: { |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
122 more: (params.page * 30) < data.length |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
123 } |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
124 }; |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
125 }, |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
126 success: function (res, textStatus, jqXHR) { |
28 | 127 console.log(res); |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
128 ajaxCheck(res, textStatus); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
129 }, |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
130 error: function (jqXHR, textStatus, errorThrown) { |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
131 console.log(textStatus); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
132 } |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
133 }); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
134 } |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
135 |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
136 // Check if request was successful |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
137 function ajaxCheck(a1, status){ |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
138 if (status === 'error') console.log("error: bad ajax request"); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
139 else dataGen(a1); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
140 } |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
141 |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
142 // On success, generate new data |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
143 function dataGen(a1){ |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
144 console.log("next started"); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
145 var d = a1.data; |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
146 // Consider implementing localStorage to avoid reloading every time |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
147 queryData = []; |
28 | 148 |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
149 for (var i= 0; i<d.length; i++) { |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
150 var j = d[i][0].data.ismi_id; |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
151 queryData.push({ id: j, text: d[i][0].data.label }); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
152 } |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
153 // Now that queryData array has been defined we will sort it by its label value and initialize the option. |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
154 queryData.sort(function(a,b){ |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
155 return a.text.localeCompare(b.text); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
156 }); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
157 console.log(queryData); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
158 |
28 | 159 // TODO: currently the queryData is being added onto the previous query data, need to REMOVE OLD. |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
160 |
28 | 161 $(".js-example-data-array3").select2('data', null); |
27
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
162 |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
163 $(".js-example-data-array3").select2({ |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
164 data: queryData |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
165 }); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
166 $(".js-example-data-array3").select2('val', "Select an option"); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
167 } |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
168 |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
169 // If first box is changed generates new queryData with updated query |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
170 $('body').on('change', ".js-example-data-array", function(e){ |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
171 var query = '' + data[$(this).val()].text; |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
172 //for(var i=0, n=queryData.length; i<n; i++) { |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
173 // FIXME: Trying to get the data in the drop down menu to be erased when first menu changed. Not quite working... |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
174 $(".js-example-data-array3").select2('data',[]); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
175 //} |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
176 ajax1(query); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
177 }); |
ed8b4e3f2a73
ISMI.HTML -- Better implementation of query boxes using Select2 on ismi.html, however when the first drop down is changed the ccorresponding one doesn't delete old data. select2('data', null) and similar methods of deleting has been unsuccessful so far
arussell
parents:
26
diff
changeset
|
178 |
28 | 179 |
180 $("#plus_filter_button").click(function() { | |
181 console.log("add filter"); | |
182 $("#s2-example").append("<div id='filter'/>"); | |
183 //$(".js-example-data-array").select2({ | |
184 // data: filters | |
185 //}, console.log("created")); | |
186 }); | |
187 | |
188 | |
189 | |
190 | |
191 | |
192 | |
193 | |
194 | |
195 | |
196 | |
197 | |
198 | |
199 | |
200 | |
201 | |
202 | |
203 | |
204 | |
205 | |
206 | |
207 | |
208 | |
209 // TODO: **** NOTE, could have each ajax fn be called with an extra parameter of what type of result to return **** | |
210 // TODO: (objects, attributes, attribute, relationships) | |
211 // TODO: in this way you could have each onchange trigger supply the appropriate result of the box it will modify. | |
212 // TODO: this would allow the json to be returned in the same way for each result. and we could also pass | |
213 // TODO: the return type param to the data gen | |
214 | |
215 | |
216 /* CURRENT IMPLEMENTATION | |
217 TODO: Make custom dataGen function for each dropdown type: object, attribute, display | |
218 TODO: we need to do this because we need to deal with the returned json differently depending on | |
219 TODO: what we want the dropdown to hold. This will be determined by the body.on(change function | |
220 TODO: and what the type of box is changing. Eg. changing the object type will trigger a change in | |
221 TODO: attributes and clear the display. Change in attribute will combine with object type to form | |
222 TODO: full query and trigger a dataGen of the appropriate info eg. TEXT.label in the display. | |
223 TODO: In this implementation, each box determines the next | |
224 TODO: Also, object changing can be used to update the list of relationships between it and any other object | |
225 TODO: for the next line. | |
226 | |
227 | |
228 CYPHER IMPLEMENTATION | |
229 TODO: Implement exactly like a cypher query. | |
230 TODO: first line: MATCH ---- object. relationship. object. | |
231 TODO: first object on choice sends ajax query to determine available relationships --> second box | |
232 TODO: relationship on choice determines the other types of possible objects to relate to. | |
233 TODO: second line: WHERE ---- object. attribute. equals. | |
234 TODO: the object can be either of the ones from line one. the attribute is generated by that object. | |
235 TODO: choose to return | |
236 | |
237 */ | |
238 | |
239 | |
240 | |
241 | |
242 | |
243 | |
244 | |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
245 |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
246 |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
247 </script> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
248 |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
249 </body> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
diff
changeset
|
250 </html> |