mongo3 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. data/README.rdoc +6 -2
  2. data/Rakefile +1 -0
  3. data/data/populate +13 -11
  4. data/lib/controllers/databases.rb +3 -3
  5. data/lib/controllers/explore.rb +7 -5
  6. data/lib/helpers/main_helper.rb +24 -0
  7. data/lib/mongo3/connection.rb +105 -59
  8. data/lib/mongo3/node.rb +35 -6
  9. data/lib/mongo3.rb +1 -1
  10. data/lib/public/javascripts/{Jit/jit.js → jit.js} +0 -0
  11. data/lib/views/databases/_results.erb +29 -12
  12. data/lib/views/explore/explore.erb +52 -31
  13. data/lib/views/layout.erb +2 -6
  14. data/spec/mongo3/connection_spec.rb +40 -6
  15. metadata +13 -45
  16. data/lib/public/javascripts/Jit/Examples/Hypertree/example1.html +0 -57
  17. data/lib/public/javascripts/Jit/Examples/Hypertree/example1.js +0 -427
  18. data/lib/public/javascripts/Jit/Examples/Hypertree/example2.html +0 -58
  19. data/lib/public/javascripts/Jit/Examples/Hypertree/example2.js +0 -310
  20. data/lib/public/javascripts/Jit/Examples/Hypertree/example3.html +0 -199
  21. data/lib/public/javascripts/Jit/Examples/Hypertree/example3.js +0 -615
  22. data/lib/public/javascripts/Jit/Examples/Other/example1.html +0 -58
  23. data/lib/public/javascripts/Jit/Examples/Other/example1.js +0 -566
  24. data/lib/public/javascripts/Jit/Examples/Other/example2.html +0 -58
  25. data/lib/public/javascripts/Jit/Examples/Other/example2.js +0 -304
  26. data/lib/public/javascripts/Jit/Examples/Other/example3.html +0 -58
  27. data/lib/public/javascripts/Jit/Examples/Other/example3.js +0 -304
  28. data/lib/public/javascripts/Jit/Examples/RGraph/example1.html +0 -57
  29. data/lib/public/javascripts/Jit/Examples/RGraph/example1.js +0 -475
  30. data/lib/public/javascripts/Jit/Examples/RGraph/example2.html +0 -58
  31. data/lib/public/javascripts/Jit/Examples/RGraph/example2.js +0 -356
  32. data/lib/public/javascripts/Jit/Examples/RGraph/example3.html +0 -199
  33. data/lib/public/javascripts/Jit/Examples/RGraph/example3.js +0 -622
  34. data/lib/public/javascripts/Jit/Examples/Spacetree/example1.html +0 -91
  35. data/lib/public/javascripts/Jit/Examples/Spacetree/example1.js +0 -890
  36. data/lib/public/javascripts/Jit/Examples/Spacetree/example2.html +0 -90
  37. data/lib/public/javascripts/Jit/Examples/Spacetree/example2.js +0 -213
  38. data/lib/public/javascripts/Jit/Examples/Spacetree/example3.html +0 -75
  39. data/lib/public/javascripts/Jit/Examples/Spacetree/example3.js +0 -863
  40. data/lib/public/javascripts/Jit/Examples/Treemap/example1.html +0 -56
  41. data/lib/public/javascripts/Jit/Examples/Treemap/example1.js +0 -95
  42. data/lib/public/javascripts/Jit/Examples/Treemap/example2.html +0 -61
  43. data/lib/public/javascripts/Jit/Examples/Treemap/example2.js +0 -750
  44. data/lib/public/javascripts/Jit/Examples/Treemap/example3.html +0 -62
  45. data/lib/public/javascripts/Jit/Examples/Treemap/example3.js +0 -775
  46. data/lib/public/javascripts/Jit/Examples/css/Hypertree.css +0 -0
  47. data/lib/public/javascripts/Jit/Examples/css/Other.css +0 -8
  48. data/lib/public/javascripts/Jit/Examples/css/RGraph.css +0 -0
  49. data/lib/public/javascripts/Jit/Examples/css/Spacetree.css +0 -0
  50. data/lib/public/javascripts/Jit/Examples/css/Treemap.css +0 -78
  51. data/lib/public/javascripts/Jit/Examples/css/base.css +0 -106
  52. data/lib/public/javascripts/Jit/Examples/css/col1.png +0 -0
  53. data/lib/public/javascripts/Jit/Examples/css/col2.png +0 -0
  54. data/lib/public/javascripts/Jit/Examples/css/gradient.png +0 -0
  55. data/lib/public/javascripts/Jit/Extras/excanvas.js +0 -35
  56. data/lib/public/javascripts/Jit/jit-yc.js +0 -1
  57. data/lib/public/javascripts/Jit-1.1.3.zip +0 -0
@@ -1,57 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
- <title>RGraph - Tree Animation</title>
6
-
7
- <!-- CSS Files -->
8
- <link type="text/css" href="../css/base.css" rel="stylesheet" />
9
- <link type="text/css" href="../css/RGraph.css" rel="stylesheet" />
10
-
11
- <!--[if IE]><script language="javascript" type="text/javascript" src="../../Extras/excanvas.js"></script><![endif]-->
12
-
13
- <!-- JIT Library File -->
14
- <script language="javascript" type="text/javascript" src="../../jit.js"></script>
15
-
16
- <!-- Example File -->
17
- <script language="javascript" type="text/javascript" src="example1.js"></script>
18
- </head>
19
-
20
- <body onload="init();">
21
- <div id="container">
22
-
23
- <div id="left-container">
24
-
25
-
26
-
27
- <div class="text">
28
- <h4>
29
- Tree Animation
30
- </h4>
31
-
32
- A static JSON Tree structure is used as input for this animation.<br /><br />
33
- Clicking on a node should move the tree and center that node.<br /><br />
34
- The centered node's children are displayed in a relations list in the right column.
35
-
36
- </div>
37
-
38
- <div id="id-list"></div>
39
-
40
-
41
- <div style="text-align:center;"><a href="example1.js">See the Example Code</a></div>
42
- </div>
43
-
44
- <div id="center-container">
45
- <div id="infovis"></div>
46
- </div>
47
-
48
- <div id="right-container">
49
-
50
- <div id="inner-details"></div>
51
-
52
- </div>
53
-
54
- <div id="log"></div>
55
- </div>
56
- </body>
57
- </html>
@@ -1,475 +0,0 @@
1
- var Log = {
2
- elem: false,
3
- write: function(text){
4
- if (!this.elem)
5
- this.elem = document.getElementById('log');
6
- this.elem.innerHTML = text;
7
- this.elem.style.left = (500 - this.elem.offsetWidth / 2) + 'px';
8
- }
9
- };
10
-
11
- function addEvent(obj, type, fn) {
12
- if (obj.addEventListener) obj.addEventListener(type, fn, false);
13
- else obj.attachEvent('on' + type, fn);
14
- };
15
-
16
-
17
- function init(){
18
- //init data
19
- var json = {
20
- id: "190_0",
21
- name: "Pearl Jam",
22
- children: [{
23
- id: "306208_1",
24
- name: "Pearl Jam &amp; Cypress Hill",
25
- data: {
26
- relation: "<h4>Pearl Jam &amp; Cypress Hill</h4><b>Connections:</b><ul><li>Pearl Jam <div>(relation: collaboration)</div></li><li>Cypress Hill <div>(relation: collaboration)</div></li></ul>"
27
- },
28
- children: [{
29
- id: "84_2",
30
- name: "Cypress Hill",
31
- data: {
32
- relation: "<h4>Cypress Hill</h4><b>Connections:</b><ul><li>Pearl Jam &amp; Cypress Hill <div>(relation: collaboration)</div></li></ul>"
33
- },
34
- children: []
35
- }]
36
- }, {
37
- id: "107877_3",
38
- name: "Neil Young &amp; Pearl Jam",
39
- data: {
40
- relation: "<h4>Neil Young &amp; Pearl Jam</h4><b>Connections:</b><ul><li>Pearl Jam <div>(relation: collaboration)</div></li><li>Neil Young <div>(relation: collaboration)</div></li></ul>"
41
- },
42
- children: [{
43
- id: "964_4",
44
- name: "Neil Young",
45
- data: {
46
- relation: "<h4>Neil Young</h4><b>Connections:</b><ul><li>Neil Young &amp; Pearl Jam <div>(relation: collaboration)</div></li></ul>"
47
- },
48
- children: []
49
- }]
50
- }, {
51
- id: "236797_5",
52
- name: "Jeff Ament",
53
- data: {
54
- relation: "<h4>Jeff Ament</h4><b>Connections:</b><ul><li>Pearl Jam <div>(relation: member of band)</div></li><li>Temple of the Dog <div>(relation: member of band)</div></li><li>Mother Love Bone <div>(relation: member of band)</div></li><li>Green River <div>(relation: member of band)</div></li><li>M.A.C.C. <div>(relation: collaboration)</div></li><li>Three Fish <div>(relation: member of band)</div></li><li>Gossman Project <div>(relation: member of band)</div></li></ul>"
55
- },
56
- children: [{
57
- id: "1756_6",
58
- name: "Temple of the Dog",
59
- data: {
60
- relation: "<h4>Temple of the Dog</h4><b>Connections:</b><ul><li>Jeff Ament <div>(relation: member of band)</div></li></ul>"
61
- },
62
- children: []
63
- }, {
64
- id: "14581_7",
65
- name: "Mother Love Bone",
66
- data: {
67
- relation: "<h4>Mother Love Bone</h4><b>Connections:</b><ul><li>Jeff Ament <div>(relation: member of band)</div></li></ul>"
68
- },
69
- children: []
70
- }, {
71
- id: "50188_8",
72
- name: "Green River",
73
- data: {
74
- relation: "<h4>Green River</h4><b>Connections:</b><ul><li>Jeff Ament <div>(relation: member of band)</div></li></ul>"
75
- },
76
- children: []
77
- }, {
78
- id: "65452_9",
79
- name: "M.A.C.C.",
80
- data: {
81
- relation: "<h4>M.A.C.C.</h4><b>Connections:</b><ul><li>Jeff Ament <div>(relation: collaboration)</div></li></ul>"
82
- },
83
- children: []
84
- }, {
85
- id: "115632_10",
86
- name: "Three Fish",
87
- data: {
88
- relation: "<h4>Three Fish</h4><b>Connections:</b><ul><li>Jeff Ament <div>(relation: member of band)</div></li></ul>"
89
- },
90
- children: []
91
- }, {
92
- id: "346850_11",
93
- name: "Gossman Project",
94
- data: {
95
- relation: "<h4>Gossman Project</h4><b>Connections:</b><ul><li>Jeff Ament <div>(relation: member of band)</div></li></ul>"
96
- },
97
- children: []
98
- }]
99
- }, {
100
- id: "41529_12",
101
- name: "Stone Gossard",
102
- data: {
103
- relation: "<h4>Stone Gossard</h4><b>Connections:</b><ul><li>Pearl Jam <div>(relation: member of band)</div></li><li>Temple of the Dog <div>(relation: member of band)</div></li><li>Mother Love Bone <div>(relation: member of band)</div></li><li>Brad <div>(relation: member of band)</div></li><li>Green River <div>(relation: member of band)</div></li><li>Gossman Project <div>(relation: member of band)</div></li></ul>"
104
- },
105
- children: [{
106
- id: "1756_13",
107
- name: "Temple of the Dog",
108
- data: {
109
- relation: "<h4>Temple of the Dog</h4><b>Connections:</b><ul><li>Stone Gossard <div>(relation: member of band)</div></li></ul>"
110
- },
111
- children: []
112
- }, {
113
- id: "14581_14",
114
- name: "Mother Love Bone",
115
- data: {
116
- relation: "<h4>Mother Love Bone</h4><b>Connections:</b><ul><li>Stone Gossard <div>(relation: member of band)</div></li></ul>"
117
- },
118
- children: []
119
- }, {
120
- id: "24119_15",
121
- name: "Brad",
122
- data: {
123
- relation: "<h4>Brad</h4><b>Connections:</b><ul><li>Stone Gossard <div>(relation: member of band)</div></li></ul>"
124
- },
125
- children: []
126
- }, {
127
- id: "50188_16",
128
- name: "Green River",
129
- data: {
130
- relation: "<h4>Green River</h4><b>Connections:</b><ul><li>Stone Gossard <div>(relation: member of band)</div></li></ul>"
131
- },
132
- children: []
133
- }, {
134
- id: "346850_17",
135
- name: "Gossman Project",
136
- data: {
137
- relation: "<h4>Gossman Project</h4><b>Connections:</b><ul><li>Stone Gossard <div>(relation: member of band)</div></li></ul>"
138
- },
139
- children: []
140
- }]
141
- }, {
142
- id: "131161_18",
143
- name: "Eddie Vedder",
144
- data: {
145
- relation: "<h4>Eddie Vedder</h4><b>Connections:</b><ul><li>Pearl Jam <div>(relation: member of band)</div></li><li>Temple of the Dog <div>(relation: member of band)</div></li><li>Eddie Vedder &amp; Zeke <div>(relation: collaboration)</div></li><li>Bad Radio <div>(relation: member of band)</div></li><li>Beck &amp; Eddie Vedder <div>(relation: collaboration)</div></li></ul>"
146
- },
147
- children: [{
148
- id: "1756_19",
149
- name: "Temple of the Dog",
150
- data: {
151
- relation: "<h4>Temple of the Dog</h4><b>Connections:</b><ul><li>Eddie Vedder <div>(relation: member of band)</div></li></ul>"
152
- },
153
- children: []
154
- }, {
155
- id: "72007_20",
156
- name: "Eddie Vedder &amp; Zeke",
157
- data: {
158
- relation: "<h4>Eddie Vedder &amp; Zeke</h4><b>Connections:</b><ul><li>Eddie Vedder <div>(relation: collaboration)</div></li></ul>"
159
- },
160
- children: []
161
- }, {
162
- id: "236657_21",
163
- name: "Bad Radio",
164
- data: {
165
- relation: "<h4>Bad Radio</h4><b>Connections:</b><ul><li>Eddie Vedder <div>(relation: member of band)</div></li></ul>"
166
- },
167
- children: []
168
- }, {
169
- id: "432176_22",
170
- name: "Beck &amp; Eddie Vedder",
171
- data: {
172
- relation: "<h4>Beck &amp; Eddie Vedder</h4><b>Connections:</b><ul><li>Eddie Vedder <div>(relation: collaboration)</div></li></ul>"
173
- },
174
- children: []
175
- }]
176
- }, {
177
- id: "236583_23",
178
- name: "Mike McCready",
179
- data: {
180
- relation: "<h4>Mike McCready</h4><b>Connections:</b><ul><li>Pearl Jam <div>(relation: member of band)</div></li><li>Mad Season <div>(relation: member of band)</div></li><li>Temple of the Dog <div>(relation: member of band)</div></li><li>$10,000 Gold Chain <div>(relation: collaboration)</div></li><li>M.A.C.C. <div>(relation: collaboration)</div></li><li>The Rockfords <div>(relation: member of band)</div></li><li>Gossman Project <div>(relation: member of band)</div></li></ul>"
181
- },
182
- children: [{
183
- id: "1744_24",
184
- name: "Mad Season",
185
- data: {
186
- relation: "<h4>Mad Season</h4><b>Connections:</b><ul><li>Mike McCready <div>(relation: member of band)</div></li></ul>"
187
- },
188
- children: []
189
- }, {
190
- id: "1756_25",
191
- name: "Temple of the Dog",
192
- data: {
193
- relation: "<h4>Temple of the Dog</h4><b>Connections:</b><ul><li>Mike McCready <div>(relation: member of band)</div></li></ul>"
194
- },
195
- children: []
196
- }, {
197
- id: "43661_26",
198
- name: "$10,000 Gold Chain",
199
- data: {
200
- relation: "<h4>$10,000 Gold Chain</h4><b>Connections:</b><ul><li>Mike McCready <div>(relation: collaboration)</div></li></ul>"
201
- },
202
- children: []
203
- }, {
204
- id: "65452_27",
205
- name: "M.A.C.C.",
206
- data: {
207
- relation: "<h4>M.A.C.C.</h4><b>Connections:</b><ul><li>Mike McCready <div>(relation: collaboration)</div></li></ul>"
208
- },
209
- children: []
210
- }, {
211
- id: "153766_28",
212
- name: "The Rockfords",
213
- data: {
214
- relation: "<h4>The Rockfords</h4><b>Connections:</b><ul><li>Mike McCready <div>(relation: member of band)</div></li></ul>"
215
- },
216
- children: []
217
- }, {
218
- id: "346850_29",
219
- name: "Gossman Project",
220
- data: {
221
- relation: "<h4>Gossman Project</h4><b>Connections:</b><ul><li>Mike McCready <div>(relation: member of band)</div></li></ul>"
222
- },
223
- children: []
224
- }]
225
- }, {
226
- id: "236585_30",
227
- name: "Matt Cameron",
228
- data: {
229
- relation: "<h4>Matt Cameron</h4><b>Connections:</b><ul><li>Pearl Jam <div>(relation: member of band)</div></li><li>Soundgarden <div>(relation: member of band)</div></li><li>Temple of the Dog <div>(relation: member of band)</div></li><li>Eleven <div>(relation: supporting musician)</div></li><li>Queens of the Stone Age <div>(relation: member of band)</div></li><li>Wellwater Conspiracy <div>(relation: member of band)</div></li><li>M.A.C.C. <div>(relation: collaboration)</div></li><li>Tone Dogs <div>(relation: member of band)</div></li></ul>"
230
- },
231
- children: [{
232
- id: "1111_31",
233
- name: "Soundgarden",
234
- data: {
235
- relation: "<h4>Soundgarden</h4><b>Connections:</b><ul><li>Matt Cameron <div>(relation: member of band)</div></li></ul>"
236
- },
237
- children: []
238
- }, {
239
- id: "1756_32",
240
- name: "Temple of the Dog",
241
- data: {
242
- relation: "<h4>Temple of the Dog</h4><b>Connections:</b><ul><li>Matt Cameron <div>(relation: member of band)</div></li></ul>"
243
- },
244
- children: []
245
- }, {
246
- id: "9570_33",
247
- name: "Eleven",
248
- data: {
249
- relation: "<h4>Eleven</h4><b>Connections:</b><ul><li>Matt Cameron <div>(relation: supporting musician)</div></li></ul>"
250
- },
251
- children: []
252
- }, {
253
- id: "11783_34",
254
- name: "Queens of the Stone Age",
255
- data: {
256
- relation: "<h4>Queens of the Stone Age</h4><b>Connections:</b><ul><li>Matt Cameron <div>(relation: member of band)</div></li></ul>"
257
- },
258
- children: []
259
- }, {
260
- id: "61972_35",
261
- name: "Wellwater Conspiracy",
262
- data: {
263
- relation: "<h4>Wellwater Conspiracy</h4><b>Connections:</b><ul><li>Matt Cameron <div>(relation: member of band)</div></li></ul>"
264
- },
265
- children: []
266
- }, {
267
- id: "65452_36",
268
- name: "M.A.C.C.",
269
- data: {
270
- relation: "<h4>M.A.C.C.</h4><b>Connections:</b><ul><li>Matt Cameron <div>(relation: collaboration)</div></li></ul>"
271
- },
272
- children: []
273
- }, {
274
- id: "353097_37",
275
- name: "Tone Dogs",
276
- data: {
277
- relation: "<h4>Tone Dogs</h4><b>Connections:</b><ul><li>Matt Cameron <div>(relation: member of band)</div></li></ul>"
278
- },
279
- children: []
280
- }]
281
- }, {
282
- id: "236594_38",
283
- name: "Dave Krusen",
284
- data: {
285
- relation: "<h4>Dave Krusen</h4><b>Connections:</b><ul><li>Pearl Jam <div>(relation: member of band)</div></li><li>Candlebox <div>(relation: member of band)</div></li></ul>"
286
- },
287
- children: [{
288
- id: "2092_39",
289
- name: "Candlebox",
290
- data: {
291
- relation: "<h4>Candlebox</h4><b>Connections:</b><ul><li>Dave Krusen <div>(relation: member of band)</div></li></ul>"
292
- },
293
- children: []
294
- }]
295
- }, {
296
- id: "236022_40",
297
- name: "Matt Chamberlain",
298
- data: {
299
- relation: "<h4>Matt Chamberlain</h4><b>Connections:</b><ul><li>Pearl Jam <div>(relation: member of band)</div></li><li>Critters Buggin <div>(relation: member of band)</div></li><li>Edie Brickell and New Bohemians <div>(relation: member of band)</div></li></ul>"
300
- },
301
- children: [{
302
- id: "54761_41",
303
- name: "Critters Buggin",
304
- data: {
305
- relation: "<h4>Critters Buggin</h4><b>Connections:</b><ul><li>Matt Chamberlain <div>(relation: member of band)</div></li></ul>"
306
- },
307
- children: []
308
- }, {
309
- id: "92043_42",
310
- name: "Edie Brickell and New Bohemians",
311
- data: {
312
- relation: "<h4>Edie Brickell and New Bohemians</h4><b>Connections:</b><ul><li>Matt Chamberlain <div>(relation: member of band)</div></li></ul>"
313
- },
314
- children: []
315
- }]
316
- }, {
317
- id: "236611_43",
318
- name: "Dave Abbruzzese",
319
- data: {
320
- relation: "<h4>Dave Abbruzzese</h4><b>Connections:</b><ul><li>Pearl Jam <div>(relation: member of band)</div></li><li>Green Romance Orchestra <div>(relation: member of band)</div></li></ul>"
321
- },
322
- children: [{
323
- id: "276933_44",
324
- name: "Green Romance Orchestra",
325
- data: {
326
- relation: "<h4>Green Romance Orchestra</h4><b>Connections:</b><ul><li>Dave Abbruzzese <div>(relation: member of band)</div></li></ul>"
327
- },
328
- children: []
329
- }]
330
- }, {
331
- id: "236612_45",
332
- name: "Jack Irons",
333
- data: {
334
- relation: "<h4>Jack Irons</h4><b>Connections:</b><ul><li>Pearl Jam <div>(relation: member of band)</div></li><li>Redd Kross <div>(relation: member of band)</div></li><li>Eleven <div>(relation: member of band)</div></li><li>Red Hot Chili Peppers <div>(relation: member of band)</div></li><li>Anthym <div>(relation: member of band)</div></li><li>What Is This? <div>(relation: member of band)</div></li></ul>"
335
- },
336
- children: [{
337
- id: "4619_46",
338
- name: "Redd Kross",
339
- data: {
340
- relation: "<h4>Redd Kross</h4><b>Connections:</b><ul><li>Jack Irons <div>(relation: member of band)</div></li></ul>"
341
- },
342
- children: []
343
- }, {
344
- id: "9570_47",
345
- name: "Eleven",
346
- data: {
347
- relation: "<h4>Eleven</h4><b>Connections:</b><ul><li>Jack Irons <div>(relation: member of band)</div></li></ul>"
348
- },
349
- children: []
350
- }, {
351
- id: "12389_48",
352
- name: "Red Hot Chili Peppers",
353
- data: {
354
- relation: "<h4>Red Hot Chili Peppers</h4><b>Connections:</b><ul><li>Jack Irons <div>(relation: member of band)</div></li></ul>"
355
- },
356
- children: []
357
- }, {
358
- id: "114288_49",
359
- name: "Anthym",
360
- data: {
361
- relation: "<h4>Anthym</h4><b>Connections:</b><ul><li>Jack Irons <div>(relation: member of band)</div></li></ul>"
362
- },
363
- children: []
364
- }, {
365
- id: "240013_50",
366
- name: "What Is This?",
367
- data: {
368
- relation: "<h4>What Is This?</h4><b>Connections:</b><ul><li>Jack Irons <div>(relation: member of band)</div></li></ul>"
369
- },
370
- children: []
371
- }]
372
- }],
373
- data: {
374
- relation: "<h4>Pearl Jam</h4><b>Connections:</b><ul><li>Pearl Jam &amp; Cypress Hill <div>(relation: collaboration)</div></li><li>Neil Young &amp; Pearl Jam <div>(relation: collaboration)</div></li><li>Jeff Ament <div>(relation: member of band)</div></li><li>Stone Gossard <div>(relation: member of band)</div></li><li>Eddie Vedder <div>(relation: member of band)</div></li><li>Mike McCready <div>(relation: member of band)</div></li><li>Matt Cameron <div>(relation: member of band)</div></li><li>Dave Krusen <div>(relation: member of band)</div></li><li>Matt Chamberlain <div>(relation: member of band)</div></li><li>Dave Abbruzzese <div>(relation: member of band)</div></li><li>Jack Irons <div>(relation: member of band)</div></li></ul>"
375
- }
376
- };
377
- //end
378
-
379
- var infovis = document.getElementById('infovis');
380
- var w = infovis.offsetWidth, h = infovis.offsetHeight;
381
-
382
- //init canvas
383
- //Create a new canvas instance.
384
- var canvas = new Canvas('mycanvas', {
385
- //Where to append the canvas widget
386
- 'injectInto': 'infovis',
387
- 'width': w,
388
- 'height': h,
389
-
390
- //Optional: create a background canvas and plot
391
- //concentric circles in it.
392
- 'backgroundCanvas': {
393
- 'styles': {
394
- 'strokeStyle': '#555'
395
- },
396
-
397
- 'impl': {
398
- 'init': function(){},
399
- 'plot': function(canvas, ctx){
400
- var times = 6, d = 100;
401
- var pi2 = Math.PI * 2;
402
- for (var i = 1; i <= times; i++) {
403
- ctx.beginPath();
404
- ctx.arc(0, 0, i * d, 0, pi2, true);
405
- ctx.stroke();
406
- ctx.closePath();
407
- }
408
- }
409
- }
410
- }
411
- });
412
- //end
413
- //init RGraph
414
- var rgraph = new RGraph(canvas, {
415
- //Set Node and Edge colors.
416
- Node: {
417
- color: '#ccddee'
418
- },
419
-
420
- Edge: {
421
- color: '#772277'
422
- },
423
-
424
- onBeforeCompute: function(node){
425
- Log.write("centering " + node.name + "...");
426
- //Add the relation list in the right column.
427
- //This list is taken from the data property of each JSON node.
428
- document.getElementById('inner-details').innerHTML = node.data.relation;
429
- },
430
-
431
- onAfterCompute: function(){
432
- Log.write("done");
433
- },
434
- //Add the name of the node in the correponding label
435
- //and a click handler to move the graph.
436
- //This method is called once, on label creation.
437
- onCreateLabel: function(domElement, node){
438
- domElement.innerHTML = node.name;
439
- domElement.onclick = function(){
440
- rgraph.onClick(node.id);
441
- };
442
- },
443
- //Change some label dom properties.
444
- //This method is called each time a label is plotted.
445
- onPlaceLabel: function(domElement, node){
446
- var style = domElement.style;
447
- style.display = '';
448
- style.cursor = 'pointer';
449
-
450
- if (node._depth <= 1) {
451
- style.fontSize = "0.8em";
452
- style.color = "#ccc";
453
-
454
- } else if(node._depth == 2){
455
- style.fontSize = "0.7em";
456
- style.color = "#494949";
457
-
458
- } else {
459
- style.display = 'none';
460
- }
461
-
462
- var left = parseInt(style.left);
463
- var w = domElement.offsetWidth;
464
- style.left = (left - w / 2) + 'px';
465
- }
466
- });
467
-
468
- //load JSON data
469
- rgraph.loadJSON(json);
470
- //compute positions and make the first plot
471
- rgraph.refresh();
472
- //end
473
- //append information about the root relations in the right column
474
- document.getElementById('inner-details').innerHTML = rgraph.graph.getNode(rgraph.root).data.relation;
475
- }
@@ -1,58 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
- <title>RGraph - Weighted Graph Animation</title>
6
-
7
- <!-- CSS Files -->
8
- <link type="text/css" href="../css/base.css" rel="stylesheet" />
9
- <link type="text/css" href="../css/RGraph.css" rel="stylesheet" />
10
-
11
- <!--[if IE]><script language="javascript" type="text/javascript" src="../../Extras/excanvas.js"></script><![endif]-->
12
-
13
- <!-- JIT Library File -->
14
- <script language="javascript" type="text/javascript" src="../../jit.js"></script>
15
-
16
- <!-- Example File -->
17
- <script language="javascript" type="text/javascript" src="example2.js"></script>
18
- </head>
19
-
20
- <body onload="init();">
21
- <div id="container">
22
-
23
- <div id="left-container">
24
-
25
-
26
-
27
- <div class="text">
28
- <h4>
29
- Weighted Graph Animation
30
- </h4>
31
-
32
- A static JSON graph structure is used for this animation.<br /><br />
33
- For each JSON node/edge the properties prefixed with the dollar sign ($) set the type of node/edge to be plotted, its style and its dimensions.<br /><br />
34
- Line weights are added programmatically, <em>onBeforePlotLine</em>.<br /><br />
35
- An <b>Elastic</b> transition is used instead of the linear transition for the animation.
36
-
37
- </div>
38
-
39
- <div id="id-list"></div>
40
-
41
-
42
- <div style="text-align:center;"><a href="example2.js">See the Example Code</a></div>
43
- </div>
44
-
45
- <div id="center-container">
46
- <div id="infovis"></div>
47
- </div>
48
-
49
- <div id="right-container">
50
-
51
- <div id="inner-details"></div>
52
-
53
- </div>
54
-
55
- <div id="log"></div>
56
- </div>
57
- </body>
58
- </html>