|
28
|
1 |
// .................................................................... |
|
|
2 |
// Load Lib |
|
|
3 |
// .................................................................... |
|
|
4 |
|
|
|
5 |
var scripts = document.getElementsByTagName('script'), |
|
|
6 |
currentScriptSrc = scripts[scripts.length-1].src, |
|
|
7 |
_vsDirectory = currentScriptSrc.replace('_VisualSedimentation.js', ''); |
|
|
8 |
|
|
|
9 |
// external Librairy |
|
|
10 |
includeJS(_vsDirectory+'lib/d3/d3.v2.js'); |
|
|
11 |
includeJS(_vsDirectory+'lib/jQuery/jquery-1.4.2.min.js'); |
|
|
12 |
includeJS(_vsDirectory+'lib/Box2DWeb/Box2DWeb-2.1.a.3.min.js'); |
|
|
13 |
|
|
|
14 |
// Core, n_vsDirectory+'d |
|
|
15 |
includeJS(_vsDirectory+'_vs.js'); |
|
|
16 |
includeJS(_vsDirectory+'_vs.phy.js'); |
|
|
17 |
includeJS(_vsDirectory+'_vs.chart.js'); |
|
|
18 |
includeJS(_vsDirectory+'_vs.draw.js'); |
|
|
19 |
includeJS(_vsDirectory+'_vs.token2.js'); |
|
|
20 |
includeJS(_vsDirectory+'_vs.stream.js'); |
|
|
21 |
includeJS(_vsDirectory+'_vs.decay.js'); |
|
|
22 |
includeJS(_vsDirectory+'_vs.strata.js'); |
|
|
23 |
|
|
|
24 |
|
|
|
25 |
includeJS(_vsDirectory+'_vs.flocculate.js'); |
|
|
26 |
includeJS(_vsDirectory+'_vs.aggregate.js'); |
|
|
27 |
|
|
|
28 |
// js by C_vsDirectory+' type |
|
|
29 |
includeJS(_vsDirectory+'_vs.chart.stackedareachart.js'); |
|
|
30 |
includeJS(_vsDirectory+'_vs.chart.circlelayout.js'); |
|
|
31 |
|
|
|
32 |
//console.log("stratas",$.fn._vs.strata) |
|
|
33 |
|
|
|
34 |
|
|
|
35 |
if(typeof(_vsCustomlayout)!="undefined"){ |
|
|
36 |
includeJS(_vsCustomlayout); |
|
|
37 |
console.log("custom layout") |
|
|
38 |
} |
|
|
39 |
|
|
|
40 |
function includeJS(fJS){ |
|
|
41 |
document.write('<script type="text/javascript" src="'+ fJS + '"></script>'); |
|
|
42 |
} |
|
|
43 |
|
|
|
44 |
function includeCSS(fCSS) { |
|
|
45 |
document.write(' <link type="text/css" href="'+ fCSS + '" rel="stylesheet"/>'); |
|
|
46 |
} |
|
|
47 |
|
|
|
48 |
function GUID() |
|
|
49 |
{ |
|
|
50 |
var S4 = function () |
|
|
51 |
{ |
|
|
52 |
return Math.floor( |
|
|
53 |
Math.random() * 0x10000 /* 65536 */ |
|
|
54 |
).toString(16); |
|
|
55 |
}; |
|
|
56 |
|
|
|
57 |
return ( |
|
|
58 |
S4() + S4() + "-" + |
|
|
59 |
S4() + "-" + |
|
|
60 |
S4() + "-" + |
|
|
61 |
S4() + "-" + |
|
|
62 |
S4() + S4() + S4() |
|
|
63 |
); |
|
|
64 |
} |
|
|
65 |
|
|
|
66 |
// .................................................................... |
|
|
67 |
// If we want to replace Jquery ... |
|
|
68 |
// .................................................................... |
|
|
69 |
//var visualSedimentation, _vs; |
|
|
70 |
//(function() { |
|
|
71 |
// |
|
|
72 |
// visualSedimentation = _vs = function(selector) { |
|
|
73 |
// return new VisualSedimentation(selector); |
|
|
74 |
// }; |
|
|
75 |
// |
|
|
76 |
// var VisualSedimentation = function(selector) { |
|
|
77 |
// // Lets make a really simplistic selector implementation for demo purposes |
|
|
78 |
// this.node = document.getElementById(selector); |
|
|
79 |
// /* |
|
|
80 |
// for (var i = 0; i < nodes.length; i++) { |
|
|
81 |
// this[i] = nodes[i]; |
|
|
82 |
// } |
|
|
83 |
// this.length = nodes.length; |
|
|
84 |
// */ |
|
|
85 |
// return this; |
|
|
86 |
// }; |
|
|
87 |
// |
|
|
88 |
// // Expose the prototype object via visualSedimentation.fn so methods can be added later |
|
|
89 |
// visualSedimentation.fn = VisualSedimentation.prototype = { |
|
|
90 |
// // API Methods |
|
|
91 |
// hide: function() { |
|
|
92 |
// this.node.style.display = 'none'; |
|
|
93 |
// return this; |
|
|
94 |
// }, |
|
|
95 |
// show: function() { |
|
|
96 |
// this.node.style.display = 'block'; |
|
|
97 |
// return this; |
|
|
98 |
// }, |
|
|
99 |
// remove: function() { |
|
|
100 |
// for (var i = 0; i < this.length; i++) { |
|
|
101 |
// this[i].parentNode.removeChild(this[i]); |
|
|
102 |
// } |
|
|
103 |
// return this; |
|
|
104 |
// } |
|
|
105 |
// // More methods here, each using 'return this', to enable chaining |
|
|
106 |
// }; |
|
|
107 |
// |
|
|
108 |
//}()); |