annotate query_builder/index.html @ 35:9f0d4fd3a412

cleanup and layout tweaks.
author casties
date Thu, 04 Feb 2016 15:23:15 +0100
parents ed8b4e3f2a73
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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");
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
114 console.log(res.data);
26
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
115 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
116 },
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
117 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
118 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
119 return null;
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 }
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
123 $.when(ajax1()).done(function(a1){
25
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
124
26
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
125 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
126 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
127 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
128 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
129 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
130 //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
131 //that.renderCache = {};
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
132 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
133 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
134 }
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
135 }
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
136 else {
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
137 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
138 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
139 //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
140 //that.renderCache = {};
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
141 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
142 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
143 //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
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 },
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
150 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
151 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
152 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
153 },
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
154 }],
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
155 rules: rules_widgets
25
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
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
158 $('#btn-reset').on('click', function() {
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
159 $('#builder-widgets').queryBuilder('reset');
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
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
162 $('#btn-set').on('click', function() {
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
163 $('#builder-widgets').queryBuilder('setRules', rules_widgets);
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
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
166 $('#btn-get').on('click', function() {
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
167 var result = $('#builder-widgets').queryBuilder('getRules');
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
168
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
169 if (!$.isEmptyObject(result)) {
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
170 alert(JSON.stringify(result, null, 2));
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
171 }
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
172 });
26
22be4ea663a7 Trying to work out having json request from neo4j display properly in drop down selectize box
arussell
parents: 25
diff changeset
173 </script>
25
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
174
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
175 <script type="text/javascript">
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
176 var width = 1400, height = 1400;
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
177
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
178 var force = d3.layout.force()
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
179 .charge(-100) // -200
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
180 .linkDistance(30) // 30
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
181 .size([width, height]);
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
182
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
183 var svg = d3.select("#graph").append("svg")
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
184 .attr("width", "1400px").attr("height", "1400px")
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
185 .attr("pointer-events", "all");
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
186
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
187 // arrow head marker
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
188 var defs = svg.append("defs").append("marker")
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
189 .attr({
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
190 "id":"arrow",
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
191 "markerUnits": "strokeWidth",
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
192 "viewBox":"0 -5 10 10",
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
193 "refX": 20, // 5
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
194 "refY":0,
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
195 "markerWidth":4,
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
196 "markerHeight":4,
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
197 "orient":"auto"
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
198 })
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
199 .append("path")
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
200 .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
201 .attr("class","arrowHead");
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
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
206 </script>
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
207 </body>
f82512502b31 Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff changeset
208 </html>