Mercurial > hg > NetworkVis
annotate query_builder/index.html @ 25:f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
author | alistair |
---|---|
date | Mon, 23 Nov 2015 02:03:51 -0500 |
parents | |
children | 22be4ea663a7 |
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"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
8 <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
|
9 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
10 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
11 </head> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
12 <body style="background:none;"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
13 <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
|
14 <div class="container"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
15 <div class="row"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
16 <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
|
17 <ul class="nav navbar-nav"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
18 </ul> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
19 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
20 <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
|
21 <div class="logo-well"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
22 <a href="//neo4j.com/developer-resources"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
23 <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
|
24 </a> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
25 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
26 <div class="navbar-brand"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
27 <div class="brand">ISMI Query Builder</div> |
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> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
30 </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 class="container"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
34 <div class="row" style="width: 95%"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
35 <div class="col-md-12"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
36 <div class="panel panel-default"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
37 <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
|
38 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
39 <div id="builder"></div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
40 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
41 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
42 </div> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
43 </div> |
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 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
46 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
47 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
48 <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
|
49 <script type="text/javascript" src="js/d3.min.js"></script> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
50 <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
|
51 <script type="text/javascript" src="bootstrap/bootstrap-slider/js/bootstrap-slider.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/query-builder.standalone.min.js"></script> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
53 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
54 <script> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
55 var rules_widgets = { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
56 condition: 'OR', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
57 rules: [{ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
58 id: 'date', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
59 operator: 'equal', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
60 value: '1991/11/17' |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
61 }, { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
62 id: 'commentaries', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
63 operator: 'equal', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
64 value: 2 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
65 }, { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
66 id: 'author', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
67 operator: 'equal', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
68 value: 'Šaraf al-Dīn Maḥmūd ibn Muḥammad ibn ʿUmar al-Jaġmīnī al-Ḫwārizmī' |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
69 }, { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
70 condition: 'AND', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
71 rules: [{ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
72 id: 'coord', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
73 operator: 'equal', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
74 value: 'B.3' |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
75 }] |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
76 }] |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
77 }; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
78 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
79 $('#builder').queryBuilder({ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
80 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
81 filters: [{ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
82 id: 'date', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
83 label: 'Date', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
84 type: 'date', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
85 validation: { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
86 format: 'YYYY/MM/DD' |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
87 }, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
88 plugin: 'datepicker', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
89 plugin_config: { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
90 format: 'yyyy/mm/dd', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
91 todayBtn: 'linked', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
92 todayHighlight: true, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
93 autoclose: true |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
94 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
95 }, { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
96 id: 'commentaries', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
97 label: 'Number of Commentaries', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
98 type: 'integer', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
99 validation: { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
100 min: 0, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
101 max: 15 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
102 }, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
103 plugin: 'slider', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
104 plugin_config: { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
105 min: 0, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
106 max: 15, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
107 value: 0 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
108 }, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
109 valueSetter: function(rule, value) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
110 rule.$el.find('.rule-value-container input').slider('setValue', value); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
111 }, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
112 valueGetter: function(rule) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
113 return rule.$el.find('.rule-value-container input').slider('getValue'); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
114 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
115 }, { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
116 id: 'author', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
117 label: 'Author', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
118 alias: 'Witness', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
119 type: 'string', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
120 plugin: 'selectize', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
121 plugin_config: { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
122 valueField: 'id', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
123 labelField: 'name', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
124 searchField: 'name', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
125 sortField: 'name', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
126 create: true, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
127 maxItems: 1, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
128 plugins: ['remove_button'], |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
129 onInitialize: function() { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
130 var that = this; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
131 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
132 if (localStorage.demoData === undefined) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
133 $.getJSON(baseurl + '/assets/demo-data.json', function(data) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
134 localStorage.demoData = JSON.stringify(data); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
135 data.forEach(function(item) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
136 that.addOption(item); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
137 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
138 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
139 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
140 else { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
141 JSON.parse(localStorage.demoData).forEach(function(item) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
142 that.addOption(item); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
143 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
144 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
145 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
146 }, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
147 valueSetter: function(rule, value) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
148 rule.$el.find('.rule-value-container input')[0].selectize.setValue(value); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
149 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
150 }, { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
151 id: 'coord', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
152 label: 'Coordinates', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
153 type: 'string', |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
154 validation: { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
155 format: /^[A-C]{1}.[1-6]{1}$/ |
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 input: function(rule, name) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
158 var $container = rule.$el.find('.rule-value-container'); |
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 $container.on('change', '[name='+ name +'_1]', function(){ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
161 var h = ''; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
162 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
163 switch ($(this).val()) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
164 case 'A': |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
165 h = '<option value="-1">-</option> <option value="1">1</option> <option value="2">2</option>'; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
166 break; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
167 case 'B': |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
168 h = '<option value="-1">-</option> <option value="3">3</option> <option value="4">4</option>'; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
169 break; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
170 case 'C': |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
171 h = '<option value="-1">-</option> <option value="5">5</option> <option value="6">6</option>'; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
172 break; |
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 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
175 $container.find('[name='+ name +'_2]').html(h).toggle(h!=''); |
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 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
178 return '\ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
179 <select name="'+ name +'_1"> \ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
180 <option value="-1">-</option> \ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
181 <option value="A">A</option> \ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
182 <option value="B">B</option> \ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
183 <option value="C">C</option> \ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
184 </select> \ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
185 <select name="'+ name +'_2" style="display:none;"></select>'; |
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 valueGetter: function(rule) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
188 return rule.$el.find('.rule-value-container [name$=_1]').val() |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
189 +'.'+ rule.$el.find('.rule-value-container [name$=_2]').val(); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
190 }, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
191 valueSetter: function(rule, value) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
192 if (rule.operator.nb_inputs > 0) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
193 var val = value.split('.'); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
194 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
195 rule.$el.find('.rule-value-container [name$=_1]').val(val[0]).trigger('change'); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
196 rule.$el.find('.rule-value-container [name$=_2]').val(val[1]).trigger('change'); |
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 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
199 }], |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
200 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
201 rules: rules_widgets |
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 $('#btn-reset').on('click', function() { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
205 $('#builder-widgets').queryBuilder('reset'); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
206 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
207 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
208 $('#btn-set').on('click', function() { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
209 $('#builder-widgets').queryBuilder('setRules', rules_widgets); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
210 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
211 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
212 $('#btn-get').on('click', function() { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
213 var result = $('#builder-widgets').queryBuilder('getRules'); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
214 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
215 if (!$.isEmptyObject(result)) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
216 alert(JSON.stringify(result, null, 2)); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
217 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
218 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
219 </script> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
220 <!-- <script type="text/javascript"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
221 111 // make panels roll-up |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
222 112 $(".panel-heading").on("click", function() { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
223 113 $(this).find(".clickhide").toggle(); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
224 114 $(this).next().slideToggle(); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
225 115 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
226 116 // provide search and graph |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
227 117 backendApiPrefix = "/netvis-ismi"; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
228 118 searchApi = {}; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
229 119 $(function () { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
230 120 function showText(text_id) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
231 121 $.get(backendApiPrefix+"/textandcommentaries/" + encodeURIComponent(text_id), |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
232 122 function (data) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
233 123 if (!data) return; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
234 124 $("#title").text("Title: "+data.title); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
235 125 var $list = $("#info").empty(); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
236 126 $list.append($("<li>Author: " + data.author.label + " [" + data.author.ismi_id + "]</li>") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
237 127 .click(function() { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
238 128 search(data.author.ismi_id, true); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
239 129 })); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
240 130 for (var key in data.attrs) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
241 131 var val = data.attrs[key]; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
242 132 if (key === "link") { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
243 133 val = "<a href=\"" + val + "\" target=\"_blank\">" + val + "</a>"; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
244 134 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
245 135 $list.append($("<li>" + key + ": " + val + "</li>")); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
246 136 }; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
247 137 // re-set selected |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
248 138 $("#graph .selected").each(function(){this.classList.remove("selected")}); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
249 139 $("#graph .ismi-"+data.attrs.ismi_id).each(function(){this.classList.add("selected")}); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
250 140 // add commentaries |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
251 141 var $commentaries = $("#commentaries").empty(); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
252 142 for (var key in data.commentaries) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
253 143 var val = data.commentaries[key]; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
254 144 $commentaries.append($("<li>" + val.title + " [<span class=\"text_id\">" + key + "</span>] by " + val.author + "</li>") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
255 145 .click(function() { showText($(this).find("span.text_id").text());})); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
256 146 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
257 147 var $commenting = $("#commenting").empty(); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
258 148 for (var key in data.commenting) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
259 149 var val = data.commenting[key]; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
260 150 $commenting.append($("<li>" + val.title + " [<span class=\"text_id\">" + key + "</span>] by " + val.author + "</li>") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
261 151 .click(function() { showText($(this).find("span.text_id").text());})); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
262 152 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
263 153 }, "json"); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
264 154 return false; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
265 155 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
266 156 function search(query, keep_detail_view) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
267 157 console.log("search query=", typeof query); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
268 158 if (query == null || typeof query === "object") { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
269 159 query=$("#search").find("input[name=search]").val(); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
270 160 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
271 161 $.get(backendApiPrefix+"/search?q=" + encodeURIComponent(query), |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
272 162 function (data) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
273 163 var t = $("table#results tbody").empty(); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
274 164 if (!data || data.length == 0) return; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
275 165 // clear all marks |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
276 166 $("#graph .marked").each(function(){this.classList.remove("marked")}); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
277 167 // fill table of titles |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
278 168 data.forEach(function (row) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
279 169 var text = row.text; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
280 170 var author = row.author; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
281 171 $("#author").text("Titles by Author: "+author.label+" ["+author.ismi_id+"]"); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
282 172 var comm = row.is_commentary || row.has_commentaries; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
283 173 var $row = $("<tr><td>" + text.label + "</td><td>" + text.full_title + "</td><td class='text_id'>" + text.ismi_id + "</td></tr>").appendTo(t) |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
284 174 .click(function() { showText($(this).find("td.text_id").text());}); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
285 175 if (comm) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
286 176 $row.addClass("marked"); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
287 177 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
288 178 // set mark |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
289 179 $("#graph .ismi-"+text.ismi_id).each(function(){this.classList.add("marked")}); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
290 180 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
291 181 if (!keep_detail_view) { |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
292 182 // show first title |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
293 183 showText(data[0].text.ismi_id); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
294 184 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
295 185 }, "json"); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
296 186 return false; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
297 187 } |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
298 188 // export API |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
299 189 searchApi.showText = showText; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
300 190 searchApi.search = search; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
301 191 // start search |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
302 192 $("#search").submit(search); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
303 193 search(); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
304 194 }); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
305 195 </script> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
306 --> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
307 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
308 <script type="text/javascript"> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
309 var width = 1400, height = 1400; |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
310 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
311 var force = d3.layout.force() |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
312 .charge(-100) // -200 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
313 .linkDistance(30) // 30 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
314 .size([width, height]); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
315 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
316 var svg = d3.select("#graph").append("svg") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
317 .attr("width", "1400px").attr("height", "1400px") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
318 .attr("pointer-events", "all"); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
319 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
320 // arrow head marker |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
321 var defs = svg.append("defs").append("marker") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
322 .attr({ |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
323 "id":"arrow", |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
324 "markerUnits": "strokeWidth", |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
325 "viewBox":"0 -5 10 10", |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
326 "refX": 20, // 5 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
327 "refY":0, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
328 "markerWidth":4, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
329 "markerHeight":4, |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
330 "orient":"auto" |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
331 }) |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
332 .append("path") |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
333 .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
|
334 .attr("class","arrowHead"); |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
335 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
336 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
337 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
338 |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
339 </script> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
340 </body> |
f82512502b31
Initial commit for query builder, still need to tailor for ISMI purposes
alistair
parents:
diff
changeset
|
341 </html> |