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.
- data/README.rdoc +6 -2
- data/Rakefile +1 -0
- data/data/populate +13 -11
- data/lib/controllers/databases.rb +3 -3
- data/lib/controllers/explore.rb +7 -5
- data/lib/helpers/main_helper.rb +24 -0
- data/lib/mongo3/connection.rb +105 -59
- data/lib/mongo3/node.rb +35 -6
- data/lib/mongo3.rb +1 -1
- data/lib/public/javascripts/{Jit/jit.js → jit.js} +0 -0
- data/lib/views/databases/_results.erb +29 -12
- data/lib/views/explore/explore.erb +52 -31
- data/lib/views/layout.erb +2 -6
- data/spec/mongo3/connection_spec.rb +40 -6
- metadata +13 -45
- data/lib/public/javascripts/Jit/Examples/Hypertree/example1.html +0 -57
- data/lib/public/javascripts/Jit/Examples/Hypertree/example1.js +0 -427
- data/lib/public/javascripts/Jit/Examples/Hypertree/example2.html +0 -58
- data/lib/public/javascripts/Jit/Examples/Hypertree/example2.js +0 -310
- data/lib/public/javascripts/Jit/Examples/Hypertree/example3.html +0 -199
- data/lib/public/javascripts/Jit/Examples/Hypertree/example3.js +0 -615
- data/lib/public/javascripts/Jit/Examples/Other/example1.html +0 -58
- data/lib/public/javascripts/Jit/Examples/Other/example1.js +0 -566
- data/lib/public/javascripts/Jit/Examples/Other/example2.html +0 -58
- data/lib/public/javascripts/Jit/Examples/Other/example2.js +0 -304
- data/lib/public/javascripts/Jit/Examples/Other/example3.html +0 -58
- data/lib/public/javascripts/Jit/Examples/Other/example3.js +0 -304
- data/lib/public/javascripts/Jit/Examples/RGraph/example1.html +0 -57
- data/lib/public/javascripts/Jit/Examples/RGraph/example1.js +0 -475
- data/lib/public/javascripts/Jit/Examples/RGraph/example2.html +0 -58
- data/lib/public/javascripts/Jit/Examples/RGraph/example2.js +0 -356
- data/lib/public/javascripts/Jit/Examples/RGraph/example3.html +0 -199
- data/lib/public/javascripts/Jit/Examples/RGraph/example3.js +0 -622
- data/lib/public/javascripts/Jit/Examples/Spacetree/example1.html +0 -91
- data/lib/public/javascripts/Jit/Examples/Spacetree/example1.js +0 -890
- data/lib/public/javascripts/Jit/Examples/Spacetree/example2.html +0 -90
- data/lib/public/javascripts/Jit/Examples/Spacetree/example2.js +0 -213
- data/lib/public/javascripts/Jit/Examples/Spacetree/example3.html +0 -75
- data/lib/public/javascripts/Jit/Examples/Spacetree/example3.js +0 -863
- data/lib/public/javascripts/Jit/Examples/Treemap/example1.html +0 -56
- data/lib/public/javascripts/Jit/Examples/Treemap/example1.js +0 -95
- data/lib/public/javascripts/Jit/Examples/Treemap/example2.html +0 -61
- data/lib/public/javascripts/Jit/Examples/Treemap/example2.js +0 -750
- data/lib/public/javascripts/Jit/Examples/Treemap/example3.html +0 -62
- data/lib/public/javascripts/Jit/Examples/Treemap/example3.js +0 -775
- data/lib/public/javascripts/Jit/Examples/css/Hypertree.css +0 -0
- data/lib/public/javascripts/Jit/Examples/css/Other.css +0 -8
- data/lib/public/javascripts/Jit/Examples/css/RGraph.css +0 -0
- data/lib/public/javascripts/Jit/Examples/css/Spacetree.css +0 -0
- data/lib/public/javascripts/Jit/Examples/css/Treemap.css +0 -78
- data/lib/public/javascripts/Jit/Examples/css/base.css +0 -106
- data/lib/public/javascripts/Jit/Examples/css/col1.png +0 -0
- data/lib/public/javascripts/Jit/Examples/css/col2.png +0 -0
- data/lib/public/javascripts/Jit/Examples/css/gradient.png +0 -0
- data/lib/public/javascripts/Jit/Extras/excanvas.js +0 -35
- data/lib/public/javascripts/Jit/jit-yc.js +0 -1
- data/lib/public/javascripts/Jit-1.1.3.zip +0 -0
@@ -1,566 +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 jsonpie = {
|
20
|
-
'id': 'root',
|
21
|
-
'name': 'RGraph based Pie Chart',
|
22
|
-
'data': {
|
23
|
-
'$type': 'none'
|
24
|
-
},
|
25
|
-
'children':[
|
26
|
-
{
|
27
|
-
'id':'pie1',
|
28
|
-
'name': 'pie1',
|
29
|
-
'data': {
|
30
|
-
'$aw': 20,
|
31
|
-
'$color': '#f55'
|
32
|
-
},
|
33
|
-
'children': []
|
34
|
-
},
|
35
|
-
{
|
36
|
-
'id':'pie2',
|
37
|
-
'name': 'pie2',
|
38
|
-
'data': {
|
39
|
-
'$aw': 40,
|
40
|
-
'$color': '#f77'
|
41
|
-
},
|
42
|
-
'children': []
|
43
|
-
},
|
44
|
-
{
|
45
|
-
'id':'pie3',
|
46
|
-
'name': 'pie3',
|
47
|
-
'data': {
|
48
|
-
'$aw': 10,
|
49
|
-
'$color': '#f99'
|
50
|
-
},
|
51
|
-
'children': []
|
52
|
-
},
|
53
|
-
{
|
54
|
-
'id':'pie4',
|
55
|
-
'name': 'pie4',
|
56
|
-
'data': {
|
57
|
-
'$aw': 30,
|
58
|
-
'$color': '#fbb'
|
59
|
-
},
|
60
|
-
'children': []
|
61
|
-
}
|
62
|
-
]
|
63
|
-
};
|
64
|
-
|
65
|
-
var jsonpie2 = {
|
66
|
-
'id': 'root',
|
67
|
-
'name': 'Making an Extended Pie Chart',
|
68
|
-
'data': {
|
69
|
-
'$type': 'none'
|
70
|
-
},
|
71
|
-
'children':[
|
72
|
-
{
|
73
|
-
'id':'pie10',
|
74
|
-
'name': 'pie1',
|
75
|
-
'data': {
|
76
|
-
'$aw': 20,
|
77
|
-
'$color': '#f55'
|
78
|
-
},
|
79
|
-
'children': [
|
80
|
-
{
|
81
|
-
'id':'pie100',
|
82
|
-
'name': 'pc1',
|
83
|
-
'data': {
|
84
|
-
'$aw': 20,
|
85
|
-
'$color': '#55f'
|
86
|
-
},
|
87
|
-
'children': []
|
88
|
-
|
89
|
-
},
|
90
|
-
{
|
91
|
-
'id':'pie101',
|
92
|
-
'name': 'pc2',
|
93
|
-
'data': {
|
94
|
-
'$aw': 70,
|
95
|
-
'$color': '#66f'
|
96
|
-
},
|
97
|
-
'children': []
|
98
|
-
|
99
|
-
},
|
100
|
-
{
|
101
|
-
'id':'pie102',
|
102
|
-
'name': 'pc3',
|
103
|
-
'data': {
|
104
|
-
'$aw': 10,
|
105
|
-
'$color': '#77f'
|
106
|
-
},
|
107
|
-
'children': []
|
108
|
-
|
109
|
-
}
|
110
|
-
]
|
111
|
-
},
|
112
|
-
{
|
113
|
-
'id':'pie20',
|
114
|
-
'name': 'pie2',
|
115
|
-
'data': {
|
116
|
-
'$aw': 40,
|
117
|
-
'$color': '#f77'
|
118
|
-
},
|
119
|
-
'children': [
|
120
|
-
{
|
121
|
-
'id':'pie200',
|
122
|
-
'name': 'pc1',
|
123
|
-
'data': {
|
124
|
-
'$aw': 40,
|
125
|
-
'$color': '#88f'
|
126
|
-
},
|
127
|
-
'children': []
|
128
|
-
|
129
|
-
},
|
130
|
-
{
|
131
|
-
'id':'pie201',
|
132
|
-
'name': 'pc2',
|
133
|
-
'data': {
|
134
|
-
'$aw': 60,
|
135
|
-
'$color': '#99f'
|
136
|
-
},
|
137
|
-
'children': []
|
138
|
-
|
139
|
-
}
|
140
|
-
]
|
141
|
-
},
|
142
|
-
{
|
143
|
-
'id':'pie30',
|
144
|
-
'name': 'pie3',
|
145
|
-
'data': {
|
146
|
-
'$aw': 10,
|
147
|
-
'$color': '#f99'
|
148
|
-
},
|
149
|
-
'children': [
|
150
|
-
{
|
151
|
-
'id':'pie300',
|
152
|
-
'name': 'pc1',
|
153
|
-
'data': {
|
154
|
-
'$aw': 100,
|
155
|
-
'$color': '#aaf'
|
156
|
-
},
|
157
|
-
'children': []
|
158
|
-
|
159
|
-
}
|
160
|
-
]
|
161
|
-
}
|
162
|
-
]
|
163
|
-
};
|
164
|
-
|
165
|
-
var jsonpie3 = {
|
166
|
-
'id': 'root1',
|
167
|
-
'name': 'ST Bar Chart',
|
168
|
-
'data': {
|
169
|
-
'$type': 'none',
|
170
|
-
'$width': 80,
|
171
|
-
'$height':20
|
172
|
-
},
|
173
|
-
'children':[
|
174
|
-
{
|
175
|
-
'id':'h1',
|
176
|
-
'name': 'h1',
|
177
|
-
'data': {
|
178
|
-
'$color': '#55f',
|
179
|
-
'$height':30
|
180
|
-
},
|
181
|
-
'children': []
|
182
|
-
},
|
183
|
-
{
|
184
|
-
'id':'h2',
|
185
|
-
'name': 'h2',
|
186
|
-
'data': {
|
187
|
-
'$color': '#66f',
|
188
|
-
'$height':50
|
189
|
-
},
|
190
|
-
'children': []
|
191
|
-
},
|
192
|
-
{
|
193
|
-
'id':'h3',
|
194
|
-
'name': 'h3',
|
195
|
-
'data': {
|
196
|
-
'$color': '#77f',
|
197
|
-
'$height':70
|
198
|
-
},
|
199
|
-
'children': []
|
200
|
-
},
|
201
|
-
{
|
202
|
-
'id':'h4',
|
203
|
-
'name': 'h4',
|
204
|
-
'data': {
|
205
|
-
'$height':90,
|
206
|
-
'$color': '#88f'
|
207
|
-
},
|
208
|
-
'children': []
|
209
|
-
},
|
210
|
-
{
|
211
|
-
'id':'h5',
|
212
|
-
'name': 'h5',
|
213
|
-
'data': {
|
214
|
-
'$height':100,
|
215
|
-
'$color': '#99f'
|
216
|
-
},
|
217
|
-
'children': []
|
218
|
-
},
|
219
|
-
{
|
220
|
-
'id':'h6',
|
221
|
-
'name': 'h6',
|
222
|
-
'data': {
|
223
|
-
'$height':110,
|
224
|
-
'$color': '#aaf'
|
225
|
-
},
|
226
|
-
'children': []
|
227
|
-
},
|
228
|
-
{
|
229
|
-
'id':'h7',
|
230
|
-
'name': 'h7',
|
231
|
-
'data': {
|
232
|
-
'$height':150,
|
233
|
-
'$color': '#bbf'
|
234
|
-
},
|
235
|
-
'children': []
|
236
|
-
},
|
237
|
-
{
|
238
|
-
'id':'h8',
|
239
|
-
'name': 'h8',
|
240
|
-
'data': {
|
241
|
-
'$height':110,
|
242
|
-
'$color': '#aaf'
|
243
|
-
},
|
244
|
-
'children': []
|
245
|
-
},
|
246
|
-
{
|
247
|
-
'id':'h9',
|
248
|
-
'name': 'h9',
|
249
|
-
'data': {
|
250
|
-
'$height':100,
|
251
|
-
'$color': '#99f'
|
252
|
-
},
|
253
|
-
'children': []
|
254
|
-
},
|
255
|
-
{
|
256
|
-
'id':'h10',
|
257
|
-
'name': 'h10',
|
258
|
-
'data': {
|
259
|
-
'$height':90,
|
260
|
-
'$color': '#88f'
|
261
|
-
},
|
262
|
-
'children': []
|
263
|
-
},
|
264
|
-
{
|
265
|
-
'id':'h11',
|
266
|
-
'name': 'h11',
|
267
|
-
'data': {
|
268
|
-
'$height':110,
|
269
|
-
'$color': '#aaf'
|
270
|
-
},
|
271
|
-
'children': []
|
272
|
-
},
|
273
|
-
{
|
274
|
-
'id':'h12',
|
275
|
-
'name': 'h12',
|
276
|
-
'data': {
|
277
|
-
'$height':150,
|
278
|
-
'$color': '#bbf'
|
279
|
-
},
|
280
|
-
'children': []
|
281
|
-
},
|
282
|
-
{
|
283
|
-
'id':'h13',
|
284
|
-
'name': 'h13',
|
285
|
-
'data': {
|
286
|
-
'$height':110,
|
287
|
-
'$color': '#aaf'
|
288
|
-
},
|
289
|
-
'children': []
|
290
|
-
},
|
291
|
-
{
|
292
|
-
'id':'h14',
|
293
|
-
'name': 'h14',
|
294
|
-
'data': {
|
295
|
-
'$height':100,
|
296
|
-
'$color': '#99f'
|
297
|
-
},
|
298
|
-
'children': []
|
299
|
-
},
|
300
|
-
{
|
301
|
-
'id':'h15',
|
302
|
-
'name': 'h15',
|
303
|
-
'data': {
|
304
|
-
'$height':90,
|
305
|
-
'$color': '#88f'
|
306
|
-
},
|
307
|
-
'children': []
|
308
|
-
}
|
309
|
-
]
|
310
|
-
};
|
311
|
-
//end
|
312
|
-
|
313
|
-
var infovis = document.getElementById('infovis');
|
314
|
-
var w = infovis.offsetWidth, h = infovis.offsetHeight;
|
315
|
-
|
316
|
-
//create some containers for the visualizations
|
317
|
-
var container = document.createElement('div');
|
318
|
-
container.id = "infovis1";
|
319
|
-
var style = container.style;
|
320
|
-
style.left = "0px";
|
321
|
-
style.top = "0px";
|
322
|
-
style.width = Math.floor(w / 2) + "px";
|
323
|
-
style.height = Math.floor(h / 2) + "px";
|
324
|
-
style.position = 'absolute';
|
325
|
-
infovis.appendChild(container);
|
326
|
-
|
327
|
-
container = document.createElement('div');
|
328
|
-
container.id = "infovis2";
|
329
|
-
var style = container.style;
|
330
|
-
style.left = Math.floor(w / 2) + "px";
|
331
|
-
style.top = "0px";
|
332
|
-
style.width = style.left;
|
333
|
-
style.height = Math.floor(h / 2) + "px";
|
334
|
-
style.position = 'absolute';
|
335
|
-
infovis.appendChild(container);
|
336
|
-
|
337
|
-
container = document.createElement('div');
|
338
|
-
container.id = "infovis3";
|
339
|
-
var style = container.style;
|
340
|
-
style.left = "0px";
|
341
|
-
style.top = Math.floor(h / 2) + "px";
|
342
|
-
style.width = w + "px";
|
343
|
-
style.height = Math.floor(h / 2) + "px";
|
344
|
-
style.position = 'absolute';
|
345
|
-
infovis.appendChild(container);
|
346
|
-
|
347
|
-
//init canvas
|
348
|
-
//Create new canvas instances.
|
349
|
-
var canvas1 = new Canvas('mycanvas1', {
|
350
|
-
'injectInto': 'infovis1',
|
351
|
-
'width': w/2,
|
352
|
-
'height': h/2
|
353
|
-
});
|
354
|
-
|
355
|
-
var canvas2 = new Canvas('mycanvas2', {
|
356
|
-
'injectInto': 'infovis2',
|
357
|
-
'width': w/2,
|
358
|
-
'height': h/2
|
359
|
-
});
|
360
|
-
|
361
|
-
var canvas3 = new Canvas('mycanvas3', {
|
362
|
-
'injectInto': 'infovis3',
|
363
|
-
'width': w,
|
364
|
-
'height': h/2,
|
365
|
-
'backgroundColor': '#1a1a1a'
|
366
|
-
});
|
367
|
-
//end
|
368
|
-
|
369
|
-
//init nodetypes
|
370
|
-
//Here we implement custom node rendering types for the RGraph
|
371
|
-
//Using this feature requires some javascript and canvas experience.
|
372
|
-
RGraph.Plot.NodeTypes.implement({
|
373
|
-
//This node type is used for plotting the upper-left pie chart
|
374
|
-
'nodepie': function(node, canvas) {
|
375
|
-
var span = node.angleSpan, begin = span.begin, end = span.end;
|
376
|
-
var polarNode = node.pos.getp(true);
|
377
|
-
var polar = new Polar(polarNode.rho, begin);
|
378
|
-
var p1coord = polar.getc(true);
|
379
|
-
polar.theta = end;
|
380
|
-
var p2coord = polar.getc(true);
|
381
|
-
|
382
|
-
var ctx = canvas.getCtx();
|
383
|
-
ctx.beginPath();
|
384
|
-
ctx.moveTo(0, 0);
|
385
|
-
ctx.lineTo(p1coord.x, p1coord.y);
|
386
|
-
ctx.moveTo(0, 0);
|
387
|
-
ctx.lineTo(p2coord.x, p2coord.y);
|
388
|
-
ctx.moveTo(0, 0);
|
389
|
-
ctx.arc(0, 0, polarNode.rho, begin, end, false);
|
390
|
-
ctx.fill();
|
391
|
-
},
|
392
|
-
//This node type is used for plotting the upper-right pie chart
|
393
|
-
'shortnodepie': function(node, canvas) {
|
394
|
-
var ldist = this.config.levelDistance;
|
395
|
-
var span = node.angleSpan, begin = span.begin, end = span.end;
|
396
|
-
var polarNode = node.pos.getp(true);
|
397
|
-
|
398
|
-
var polar = new Polar(polarNode.rho, begin);
|
399
|
-
var p1coord = polar.getc(true);
|
400
|
-
|
401
|
-
polar.theta = end;
|
402
|
-
var p2coord = polar.getc(true);
|
403
|
-
|
404
|
-
polar.rho += ldist;
|
405
|
-
var p3coord = polar.getc(true);
|
406
|
-
|
407
|
-
polar.theta = begin;
|
408
|
-
var p4coord = polar.getc(true);
|
409
|
-
|
410
|
-
|
411
|
-
var ctx = canvas.getCtx();
|
412
|
-
ctx.beginPath();
|
413
|
-
ctx.moveTo(p1coord.x, p1coord.y);
|
414
|
-
ctx.lineTo(p4coord.x, p4coord.y);
|
415
|
-
ctx.moveTo(0, 0);
|
416
|
-
ctx.arc(0, 0, polarNode.rho, begin, end, false);
|
417
|
-
|
418
|
-
ctx.moveTo(p2coord.x, p2coord.y);
|
419
|
-
ctx.lineTo(p3coord.x, p3coord.y);
|
420
|
-
ctx.moveTo(0, 0);
|
421
|
-
ctx.arc(0, 0, polarNode.rho + ldist, end, begin, true);
|
422
|
-
|
423
|
-
ctx.fill();
|
424
|
-
}
|
425
|
-
});
|
426
|
-
//end
|
427
|
-
|
428
|
-
//init rgraph
|
429
|
-
//This RGraph is used to plot the upper-left pie chart.
|
430
|
-
//It has custom *pie-chart-nodes*.
|
431
|
-
var rgraph = new RGraph(canvas1, {
|
432
|
-
//Add node/edge styles and set
|
433
|
-
//overridable=true if you want your
|
434
|
-
//styles to be individually overriden
|
435
|
-
Node: {
|
436
|
-
'overridable': true,
|
437
|
-
'type': 'nodepie'
|
438
|
-
},
|
439
|
-
Edge: {
|
440
|
-
'overridable': true
|
441
|
-
},
|
442
|
-
//Parent-children distance
|
443
|
-
levelDistance: 135,
|
444
|
-
|
445
|
-
//Add styles to node labels on label creation
|
446
|
-
onCreateLabel: function(domElement, node){
|
447
|
-
domElement.innerHTML = node.name;
|
448
|
-
if(node.data.$aw)
|
449
|
-
domElement.innerHTML += " " + node.data.$aw + "%";
|
450
|
-
var style = domElement.style;
|
451
|
-
style.fontSize = "0.8em";
|
452
|
-
style.color = "#fff";
|
453
|
-
},
|
454
|
-
//Add some offset to the labels when placed.
|
455
|
-
onPlaceLabel: function(domElement, node){
|
456
|
-
var style = domElement.style;
|
457
|
-
var left = parseInt(style.left);
|
458
|
-
var w = domElement.offsetWidth;
|
459
|
-
style.left = (left - w / 2) + 'px';
|
460
|
-
}
|
461
|
-
});
|
462
|
-
//load graph.
|
463
|
-
rgraph.loadJSON(jsonpie);
|
464
|
-
rgraph.refresh();
|
465
|
-
//end
|
466
|
-
//init rgraph2
|
467
|
-
//This RGraph instance is used for plotting the upper-right
|
468
|
-
//pie chart.
|
469
|
-
var rgraph2 = new RGraph(canvas2, {
|
470
|
-
//Add node/edge styles and set
|
471
|
-
//overridable=true if you want your
|
472
|
-
//styles to be individually overriden
|
473
|
-
Node: {
|
474
|
-
'overridable': true,
|
475
|
-
'type':'shortnodepie'
|
476
|
-
},
|
477
|
-
Edge: {
|
478
|
-
'overridable': true
|
479
|
-
},
|
480
|
-
//Parent-children distance
|
481
|
-
levelDistance: 45,
|
482
|
-
|
483
|
-
//Add styles to node labels on label creation
|
484
|
-
onCreateLabel: function(domElement, node){
|
485
|
-
if(node.id == rgraph2.root) return;
|
486
|
-
domElement.innerHTML = node.name;
|
487
|
-
if(node.data.$aw) {
|
488
|
-
domElement.innerHTML += " " + node.data.$aw + "%";
|
489
|
-
}
|
490
|
-
var style = domElement.style;
|
491
|
-
style.fontSize = "0.8em";
|
492
|
-
style.color = "#fff";
|
493
|
-
},
|
494
|
-
|
495
|
-
onPlaceLabel: function(domElement, node){
|
496
|
-
var style = domElement.style;
|
497
|
-
var left = parseInt(style.left);
|
498
|
-
var w = domElement.offsetWidth;
|
499
|
-
style.left = (left - w / 2) + 'px';
|
500
|
-
}
|
501
|
-
});
|
502
|
-
//load graph.
|
503
|
-
rgraph2.loadJSON(jsonpie2);
|
504
|
-
rgraph2.refresh();
|
505
|
-
//end
|
506
|
-
//init st
|
507
|
-
//This Spacetree nodes' heights are overriden individually
|
508
|
-
//so that it serves as a bar chart.
|
509
|
-
var st = new ST(canvas3, {
|
510
|
-
//set orientarion
|
511
|
-
orientation:'bottom',
|
512
|
-
//set duration for the animation
|
513
|
-
duration: 800,
|
514
|
-
//set parent-children distance
|
515
|
-
levelDistance: 30,
|
516
|
-
//set node and edge styles
|
517
|
-
//set overridable=true for styling individual
|
518
|
-
//nodes or edges
|
519
|
-
Node: {
|
520
|
-
overridable: true,
|
521
|
-
width: 30,
|
522
|
-
type: 'rectangle',
|
523
|
-
color: '#aaa',
|
524
|
-
align: 'right'
|
525
|
-
},
|
526
|
-
|
527
|
-
Edge: {
|
528
|
-
type: 'bezier',
|
529
|
-
color: '#444'
|
530
|
-
},
|
531
|
-
|
532
|
-
//This method is called on DOM label creation.
|
533
|
-
//Use this method to add styles to
|
534
|
-
//your node label.
|
535
|
-
onCreateLabel: function(label, node){
|
536
|
-
label.id = node.id;
|
537
|
-
label.innerHTML = node.name;
|
538
|
-
//set label styles
|
539
|
-
var style = label.style;
|
540
|
-
style.fontSize = '0.7em';
|
541
|
-
style.textAlign= 'center';
|
542
|
-
style.paddingTop = '3px';
|
543
|
-
style.height = node.data.$height + 'px';
|
544
|
-
|
545
|
-
if(node.id == st.root) {
|
546
|
-
style.color = '#eee';
|
547
|
-
style.width = node.data.$width + 'px';
|
548
|
-
} else {
|
549
|
-
style.color = '#fff';
|
550
|
-
style.width = 30 + 'px';
|
551
|
-
}
|
552
|
-
}
|
553
|
-
});
|
554
|
-
//load json data
|
555
|
-
st.loadJSON(jsonpie3);
|
556
|
-
//compute node positions and layout
|
557
|
-
st.compute();
|
558
|
-
//emulate a click on the root node and
|
559
|
-
//add an offset position to the tree
|
560
|
-
st.onClick(st.root, {
|
561
|
-
Move: {
|
562
|
-
offsetY: -110
|
563
|
-
}
|
564
|
-
});
|
565
|
-
//end
|
566
|
-
}
|
@@ -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>Other - Composing Visualizations</title>
|
6
|
-
|
7
|
-
<!-- CSS Files -->
|
8
|
-
<link type="text/css" href="../css/base.css" rel="stylesheet" />
|
9
|
-
<link type="text/css" href="../css/Other.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
|
-
Composing Visualizations
|
30
|
-
</h4>
|
31
|
-
|
32
|
-
In this example a RGraph is composed with another RGraph (for node rendering).<br /><br />
|
33
|
-
The RGraph used for node rendering implements a custom node type defined in the <em>"Implementing Node Types"</em> example.<br /><br />
|
34
|
-
This example shows that many visualizations can be composed to create new visualizations.
|
35
|
-
|
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>
|