Mercurial > hg > NetworkVis
annotate query_builder/index.html @ 26:22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
author | arussell |
---|---|
date | Tue, 01 Dec 2015 02:07:13 -0500 |
parents | f82512502b31 |
children | ed8b4e3f2a73 |
rev | line source |
---|---|
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
1 <!DOCTYPE html> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
2 <html> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
3 <head> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
4 <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
5 <title>Query Builder</title> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
6 <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
7 <link rel="stylesheet" href="bootstrap/bootstrap-slider/css/bootstrap-slider.css"> |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
8 <link rel="stylesheet" href="selectize/dist/css/selectize.default.css"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
9 <link rel="stylesheet" href="bootstrap-select/dist/css/bootstrap-select.min.css"> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
10 <link rel="stylesheet" href="selectize/dist/css/selectize.bootstrap3.css"> |
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
11 <link rel="stylesheet" href="css/query-builder.default.min.css"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
12 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
13 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
14 </head> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
15 <body style="background:none;"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
16 <div role="navigation" class="navbar navbar-default navbar-static-top"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
17 <div class="container"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
18 <div class="row"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
19 <div class="col-sm-6 col-md-6"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
20 <ul class="nav navbar-nav"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
21 </ul> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
22 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
23 <div class="navbar-header col-sm-6 col-md-6"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
24 <div class="logo-well"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
25 <a href="//neo4j.com/developer-resources"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
26 <img src="//neo4j-contrib.github.io/developer-resources/language-guides/assets/img/logo-white.svg" alt="Neo4j World's Leading Graph Database" id="logo"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
27 </a> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
28 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
29 <div class="navbar-brand"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
30 <div class="brand">ISMI Query Builder</div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
31 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
32 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
33 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
34 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
35 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
36 <div class="container"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
37 <div class="row" style="width: 95%"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
38 <div class="col-md-12"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
39 <div class="panel panel-default"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
40 <div class="panel-heading" id="title">Query Builder</div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
41 |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
42 <div id="builder-widgets"></div> |
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
43 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
44 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
45 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
46 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
47 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
48 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
49 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
50 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
51 <script type="text/javascript" src="js/jquery-1.11.3.js"></script> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
52 <script type="text/javascript" src="js/d3.min.js"></script> |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
53 <script type="text/javascript" src="moment/min/moment.min.js"></script> |
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
54 <script type="text/javascript" src="bootstrap/bootstrap-datepicker/js/bootstrap-datepicker.js"></script> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
55 <script type="text/javascript" src="bootstrap/bootstrap-slider/js/bootstrap-slider.js"></script> |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
56 <script type="text/javascript" src="selectize/dist/js/standalone/selectize.min.js"></script> |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
57 <script type="text/javascript" src="bootstrap-select/dist/js/bootstrap-select.min.js"></script> |
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
58 <script type="text/javascript" src="js/query-builder.standalone.min.js"></script> |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
59 |
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
60 <script> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
61 var rules_widgets = { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
62 condition: 'OR', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
63 rules: [{ |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
64 id: 'codex', |
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
65 operator: 'equal', |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
66 values: [], |
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
67 }] |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
68 }; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
69 |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
70 // Fix for Selectize |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
71 $('#builder-widgets').on('afterCreateRuleInput.queryBuilder', function(e, rule) { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
72 if (rule.filter.plugin == 'selectize') { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
73 rule.$el.find('.rule-value-container').css('min-width', '200px') |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
74 .find('.selectize-control').removeClass('form-control'); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
75 } |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
76 }); |
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
77 |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
78 $('#builder-widgets').queryBuilder({ |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
79 //plugins: ['bt-tooltip-errors'], |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
80 filters: [{ |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
81 id: 'name', |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
82 label: 'Name', |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
83 type: 'string' |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
84 }, { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
85 id: 'codex', |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
86 label: 'Codex', |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
87 type: 'string', |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
88 plugin: 'selectize', |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
89 plugin_config: { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
90 valueField: 'id', |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
91 labelField: 'name', |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
92 searchField: 'name', |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
93 sortField: 'name', |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
94 create: true, |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
95 maxItems: 1, |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
96 plugins: ['remove_button'], |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
97 onInitialize: function() { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
98 var that = this; |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
99 function ajax1() { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
100 return $.ajax({ |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
101 type: "POST", |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
102 url: "https://ismi-dev.mpiwg-berlin.mpg.de/neo4j-ismi/db/data/cypher", |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
103 accepts: "application/json", |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
104 dataType: "json", |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
105 data: { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
106 "query": "match (codex:CODEX) return codex limit 25", |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
107 "params": {} |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
108 }, |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
109 beforeSend: function (xhr) { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
110 xhr.setRequestHeader ("Authorization", "Basic " + btoa('neo4j' + ":" + 'neo5j')); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
111 }, |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
112 success: function (res, textStatus, jqXHR) { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
113 console.log("success"); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
114 return res.data; |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
115 }, |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
116 error: function (jqXHR, textStatus, errorThrown) { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
117 console.log("error"); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
118 return null; |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
119 } |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
120 }); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
121 } |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
122 $.when(ajax1()).done(function(a1){ |
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
123 |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
124 var d = a1.data; |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
125 if (localStorage.demoData === undefined) { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
126 console.log(localStorage.demoData); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
127 localStorage.demoData = JSON.stringify(a1); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
128 for (var i= 0; i<d.length; i++) { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
129 //that.clearOptions(); // clear the data |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
130 //that.renderCache = {}; |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
131 console.log("addOption = " + d[i][0].data.label); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
132 that.addOption(d[i][0].data.label); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
133 } |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
134 } |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
135 else { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
136 var obj = JSON.parse(localStorage.demoData).data; |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
137 for(i=0; i<obj.length; i++) { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
138 //that.clearOptions(); // clear the data |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
139 //that.renderCache = {}; |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
140 console.log("addOption = " + d[i][0].data.label); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
141 that.addOption(obj[i][0].data.label); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
142 //that.values.push(d[i][0].data.label); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
143 } |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
144 } |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
145 }); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
146 }, |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
147 |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
148 }, |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
149 valueSetter: function(rule, value) { |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
150 console.log('SETTER EXECUTED'); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
151 rule.$el.find('.rule-value-container input')[0].selectize.setValue(value); |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
152 }, |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
153 }], |
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
154 rules: rules_widgets |
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
155 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
156 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
157 $('#btn-reset').on('click', function() { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
158 $('#builder-widgets').queryBuilder('reset'); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
159 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
160 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
161 $('#btn-set').on('click', function() { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
162 $('#builder-widgets').queryBuilder('setRules', rules_widgets); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
163 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
164 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
165 $('#btn-get').on('click', function() { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
166 var result = $('#builder-widgets').queryBuilder('getRules'); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
167 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
168 if (!$.isEmptyObject(result)) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
169 alert(JSON.stringify(result, null, 2)); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
170 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
171 }); |
26
22be4ea663a7
Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents:
25
diff
changeset
|
172 </script> |
25
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
173 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
174 <script type="text/javascript"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
175 var width = 1400, height = 1400; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
176 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
177 var force = d3.layout.force() |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
178 .charge(-100) // -200 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
179 .linkDistance(30) // 30 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
180 .size([width, height]); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
181 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
182 var svg = d3.select("#graph").append("svg") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
183 .attr("width", "1400px").attr("height", "1400px") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
184 .attr("pointer-events", "all"); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
185 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
186 // arrow head marker |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
187 var defs = svg.append("defs").append("marker") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
188 .attr({ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
189 "id":"arrow", |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
190 "markerUnits": "strokeWidth", |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
191 "viewBox":"0 -5 10 10", |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
192 "refX": 20, // 5 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
193 "refY":0, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
194 "markerWidth":4, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
195 "markerHeight":4, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
196 "orient":"auto" |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
197 }) |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
198 .append("path") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
199 .attr("d", "M0,-5 L10,0 L0,5") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
200 .attr("class","arrowHead"); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
201 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
202 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
203 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
204 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
205 </script> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
206 </body> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
207 </html> |