philogb / jit

JavaScript InfoVis Toolkit - An Information Visualization Toolkit for implementing Data Visualizations for the Web

This URL has Read+Write access

jit / tests.py
100644 463 lines (449 sloc) 20.02 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
#tests models
tests_model = {
 
    'RGraph': [
        {
            'Title': 'Tree Animation',
            'Description':
            """
A static JSON Tree structure is used as input for this animation.<br /><br />
Clicking on a node should move the tree and center that node.<br /><br />
The centered node's children are displayed in a relations list in the right column.
""",
            'Extras': ['excanvas.js'],
            'Example': True
        },
        {
            'Title': 'Test removing nodes.',
            'Description':
            """
Testing the RGraph with a simple static JSON structure and removing a subtree.
The Subtree having "Matt Cameron" as root node should be removed with an animation
customized by the form parameters when clicking on the "remove" button.
The centered node's children should be displayed in a relations list.
""",
            'Extras': ['excanvas.js']
        },
        {
            'Title': 'Test removing edges.',
            'Description':
            """
Testing the RGraph with a simple static JSON structure and removing edges.
The edges Matt Cameron-Pearl Jam and Matt Cameron-Red Kross should be removed with
an animation when clicking in the "remove" button.
The centered node's children should be displayed in a relations list.
""",
            'Extras': ['excanvas.js']
        },
        {
            'Title': 'Test Sum.',
            'Description':
            """
Testing the RGraph with a simple static JSON structure and adding a subgraph.
Clicking on the sum button should add a subgraph as subtree of Pearl-Jam while performing
a fade-in animation.
The centered node's children should be displayed in a relations list.
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Test Morph.',
            'Description':
            """
Testing the RGraph with a simple static JSON structure and morphing the structure to a graph.
Clicking on the morph button should transform the current graph into another graph, performing
fade-in-out animations.
The centered node's children should be displayed in a relations list.
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Weighted Graph Animation',
            'Description':
            """
A static JSON graph structure is used for this animation.<br /><br />
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 />
Line weights are added programmatically, <em>onBeforePlotLine</em>.<br /><br />
An <b>Elastic</b> transition is used instead of the linear transition for the animation.
""",
            'Extras': ['excanvas.js'],
            'Example':True
        },
        {
            'Title': 'Test with node styles and edge styles.',
            'Description':
            """
Testing the RGraph with a simple static JSON structure.
You can choose different node styles and edge styles that should be globally applied to the vis.
Also, you can choose the random option, that sets random node and edges configuration. It overrides global configurations.
Default values are none, that means that neither nodes nor edges are drawn by default.
The centered node's children should be displayed in a relations list.
""",
            'Extras': ['excanvas.js']
        },
        {
            'Title': 'Graph Operations',
            'Description':
            """
You can do the following operations with the RGraph<br /><br />
1.- Removing subtrees or nodes<br /><br />
2.- Removing edges<br /><br />
3.- Adding another graph, also called sum<br /><br />
4.- Morphing (or transforming) the graph into another one<br />
""",
            'Extras': ['excanvas.js'],
            'Example':True
        }
    ],
 
    
    'Hypertree': [
        {
            'Title': 'Tree Animation',
            'Description':
            """
A static JSON Tree structure is used as input for this animation.<br /><br />
Clicking on a node should move the tree and center that node.<br /><br />
The centered node's children are displayed in a relations list in the right column.
""",
            'Extras': ['excanvas.js'],
            'Example':True
        },
        {
            'Title': 'Test with single node.',
            'Description':
            """
Loads a single node JSON dataset to the Hypertree.
""",
            'Extras': ['excanvas.js']
        },
        {
            'Title': 'Test removing nodes.',
            'Description':
            """
Testing the Hypertree with a simple static JSON structure and removing a subtree.
The Subtree having "Matt Cameron" as root node should be removed with an animation
customized by the form parameters when clicking on the "remove" button.
The centered node's children should be displayed in a relations list.
""",
            'Extras': ['excanvas.js']
        },
        {
            'Title': 'Test removing edges.',
            'Description':
            """
Testing the Hypertree with a simple static JSON structure and removing edges.
The edges Matt Cameron-Pearl Jam and Matt Cameron-Red Kross should be removed with
an animation when clicking in the "remove" button.
The centered node's children should be displayed in a relations list.
""",
            'Extras': ['excanvas.js']
        },
        {
            'Title': 'Test Sum.',
            'Description':
            """
Testing the Hypertree with a simple static JSON structure and adding a subgraph.
Clicking on the sum button should add a subgraph as subtree of Pearl-Jam while performing
a fade-in animation.
The centered node's children should be displayed in a relations list.
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Test Morph.',
            'Description':
            """
Testing the Hypertree with a simple static JSON structure and morphing the structure to a graph.
Clicking on the morph button should transform the current graph into another graph, performing
fade-in-out animations.
The centered node's children should be displayed in a relations list.
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Weighted Graph Animation',
            'Description':
            """
A static JSON graph structure is used for this animation.<br /><br />
For each JSON node the "$type" and "$dim" parameters set the type of node to be plotted and its dimensions.<br /><br />
Line weights are added programmatically, <em>onBeforePlotLine</em>.<br /><br />
A <b>Back</b> transition is used instead of the linear transition for the animation.
""",
            'Extras': ['excanvas.js'],
            'Example':True
        },
        {
            'Title': 'Test with not weighted random generated tree.',
            'Description':
            """
Just plotting a random not weighted Hypertree.
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Test with weighted random generated tree.',
            'Description':
            """
Just plotting a random weighted Hypertree.
Nodes diameters must vary.
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Test with custom nodes and edges.',
            'Description':
            """
Testing Hypertree with custom nodes and edges.
The user can select custom nodes (circle, square, etc). and
custom edges from the form.
He can also choose different animation options and easings.
This test can be improved, for example by changing the color or
overriding each node's style differently.
""",
            'Extras': ['excanvas.js']
        },
        {
            'Title': 'Graph Operations',
            'Description':
            """
You can do the following operations with the Hypertree<br /><br />
1.- Removing subtrees or nodes<br /><br />
2.- Removing edges<br /><br />
3.- Adding another graph, also called sum<br /><br />
4.- Morphing (or transforming) the graph into another one<br />
""",
            'Extras': ['excanvas.js'],
            'Example':True
        }
    ],
    
    'Spacetree': [
        {
            'Title': 'Test the Spacetree with an infinite client-side generator.',
            'Description':
            """
Testing the Spacetree with a client-side generator that returns a Tree of level = 3
when the controller request method is called.<br>
This should lead to an infinite Spacetree.<br>
Also, the edges should have arrow as style.<br>
The nodes belonging in the path between the clicked node and the root node are selected with a
different color.<br>
Clicking on a node should set focus to that node.<br>
This test uses the generator.js file to create random generated trees.
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Test adding a subtree',
            'Description':
            """
Loads a static Spacetree and should add a subtree when clicking on the add button.<br>
You can change the parameters for adding the subtree in the form.
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Test removing a subtree.',
            'Description':
            """
Loads a static Spacetree and should remove a subtree when clicking on the remove button.<br>
You can change the parameters for removing the subtree in the form.
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Test unbalanced tree.',
            'Description':
            """
Tests the Spacetree layout algorithm with an unbalanced tree. <br>
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Test Different node sizes',
            'Description':
            """
Testing a static Spacetree with rectangle nodes with different widths and heights.<br>
You can also click on a node's name in the list to add focus to that node.
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Test Node types, Edge types, Animation types.',
            'Description':
            """
Tests a static Spacetree with different node, edge and animation types that you can choose from
a form.
""",
            'Extras': ['generators.js', 'excanvas.js']
        },
        {
            'Title': 'Tree Animation',
            'Description':
            """
A static JSON Tree structure is used as input for this animation.<br /><br />
Clicking on a node should move the tree and center that node.<br /><br />
Leaves color depend on the number of children they actually have.<br /><br />
You can select the <b>tree orientation</b> by changing the select box in the right column.
""",
            'Extras': ['excanvas.js'],
            'Example': True
        },
        {
            'Title': 'SpaceTree with on-demand nodes',
            'Description':
            """
This example shows how you can use the <b>request</b> controller method to create a SpaceTree with <b>on demand</b> nodes<br /><br />
The basic JSON Tree structure is cloned and appended on demand on each node to create an <b>infinite large SpaceTree</b><br /><br />
You can select the <b>tree orientation</b> by changing the select box in the right column.
""",
            'Extras': ['excanvas.js'],
            'Example': True
        },
        {
            'Title': 'Add/Remove Subtrees',
            'Description':
            """
This example shows how to add/remove subtrees with the SpaceTree.<br /><br />
<b>Add</b> a subtree by clicking on the <em>Add</em> button located in the right column.<br /><br />
<b>Remove</b> a subtree by clicking on a red colored node
""",
            'Extras': ['excanvas.js'],
            'Example': True
        },
        {
            'Title': 'MultiTree',
            'Description':
            """
A static JSON Tree structure is used as input for this animation.<br /><br />
Clicking on a node should move the tree and center that node.<br /><br />
Leaves color depend on the number of children they actually have.<br /><br />
You can select the <b>tree orientation</b> by changing the select box in the right column.
""",
            'Extras': ['excanvas.js'],
            'Example': False
        },
        {
            'Title': 'loadJSON multiple times',
            'Description':
            """
Testing if loading different JSON tree/graph structures affects how the SpaceTree is displayed.
""",
            'Extras': ['excanvas.js', 'generators.js'],
            'Example': False
        }
   ],
    
    'Treemap': [
        {
            'Title': 'Test Squarified, SliceAndDice, and Strip Treemap with static 50 artist feed.',
            'Description':
            """
Test Squarified, SliceAndDice, and Strip Treemap with static 50 artist dataset.<br>
Clicking on a Node should set the Node as root. <br>
Right clicking should set the current root's parent as root.<br>
Hovering the Treemap nodes should pop-up a tooltip. <br>
Treemap nodes should have colors by default. <br>
Hovering a node should change the style of all parents nodes, forming a path. <br>
You can toggle nodes' color, title display, offset and layout (for SliceAndDice and Strip).
""",
            'Extras': []
        },
        {
            'Title': 'Test Squarified, SliceAndDice and Strip Treemap with random Tree.',
            'Description':
            """
Loads a random generated weighted tree and renders it as Squarified Tree by default.<br>
Treemap nodes should have colors by default. <br>
You can toggle nodes' color, title display, offset and layout (for SliceAndDice and Strip).<br>
Each time an option is changed, a new random tree is generated and rendered.
""",
            'Extras': ['generators.js']
        },
        {
            'Title': 'Squarified Treemap with on-demand nodes',
            'Description':
            """
This example shows how you can use the <b>request</b> controller method to create a Treemap with <em>on demand</em> nodes<br /><br />
There should be only one level shown at a time. <br /><br />
Clicking on a band should show a new treemap with its most listened albums.
""",
            'Extras': [],
            'Example': True
        },
        {
            'Title': 'Squarified Treemap',
            'Description':
            """
In this example a static JSON tree is loaded into a Squarified Treemap.<br /><br />
Tooltips are manually added for each Treemap DOM node.<br /><br />
<b>Left click</b> to set a node as root for the visualization.<br /><br />
<b>Right click</b> to set the parent node as root for the visualization.
""",
            'Extras': [],
            'Example':True
        },
        {
            'Title': 'Strip Cushioned Treemap',
            'Description':
            """
In this example a static JSON tree is loaded into a Strip Treemap.<br /><br />
Tooltips are manually added for each Treemap DOM node.<br /><br />
Also an image is added as background for each leaf node to simulate cushions.<br /><br />
<b>Left click</b> to set a node as root for the visualization.<br /><br />
<b>Right click</b> to set the parent node as root for the visualization.
""",
            'Extras': [],
            'Example':True
        }
   ],
    
    'Other': [
        {
            'Title': 'Implementing Node Types',
            'Description':
            """
In this example some custom node types are created for rendering pie charts with the RGraph.<br /><br />
Multiple instances of the RGraph are created using these node types. (top)<br /><br />
The SpaceTree is loaded with some custom data that individually changes nodes dimensions, making a bar chart (bottom).
""",
            'Extras': ['excanvas.js'],
            'Build': ['RGraph', 'Spacetree'],
            'Example': True
            
        },
        {
            'Title': 'Composing Visualizations',
            'Description':
            """
In this example a RGraph is composed with another RGraph (for node rendering).<br /><br />
The RGraph used for node rendering implements a custom node type defined in the <em>"Implementing Node Types"</em> example.<br /><br />
This example shows that many visualizations can be composed to create new visualizations.
""",
            'Extras': ['excanvas.js'],
            'Build': ['RGraph'],
            'Example': True
            
        },
        {
            'Title': 'Composing Visualizations 2',
            'Description':
            """
In this example a SpaceTree is composed with a RGraph (for node rendering).<br /><br />
The RGraph used for node rendering implements a custom node type defined in the <em>"Implementing Node Types"</em> example.<br /><br />
This example shows that many visualizations can be composed to create new visualizations.
""",
            'Extras': ['excanvas.js'],
            'Build': ['RGraph', 'Spacetree'],
            'Example': True
            
        },
        {
            'Title': 'SVG and Native Labels',
            'Description':
            """
In this example we're using three different types of labels.<br /><br />
HTML labels are classic DOM elements.<br />
SVG labels are very similar to HTML labels (they're also DOM elements) but they can be rotated and transformed.<br />
Native labels are drawn with the Native Canvas HTML5 API.<br /><br />.
HTML labels are supported by all browsers. SVG labels are supported by all browsers except IE. Native Canvas labels are
supported by all browsers except Opera.
""",
            'Extras': ['excanvas.js'],
            'Build': ['RGraph', 'Hypertree'],
            'Example': False
            
        }
  ]
}