forked from prodest/Agenda-ES
-
Notifications
You must be signed in to change notification settings - Fork 1
/
system.yuml.js
51 lines (38 loc) · 1.42 KB
/
system.yuml.js
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
System.trace = true;
window.showModuleRelationships = function() {
var name;
var definitions;
var dependencies;
var modules;
var moduleDefinitions;
var dependencyDefinitions = [];
modules = Object.keys( System.loads ).map( function( moduleName ) {
return System.loads[ moduleName ];
} );
function displayName( module ) {
return module.replace( System.baseURL, '' );
}
moduleDefinitions = modules.map( function( module ) {
name = displayName( module.name );
return '[' + name + '|' + module.metadata.format + ']';
} );
modules.filter( function( module ) {
return module.deps.length > 0;
} )
.forEach( function( module ) {
name = displayName( module.name );
dependencies = module.deps.map( function( dependency ) {
return System.normalizeSync( dependency, module.name, module.address );
} )
.map( displayName )
.map( function( dependencyName ) {
return '[' + name + ']->[' + dependencyName + ']';
} );
dependencyDefinitions = dependencyDefinitions.concat( dependencies );
} );
definitions = moduleDefinitions.concat( dependencyDefinitions );
definitions = definitions.filter( function( definition ) {
return definition.indexOf( 'jspm_packages' ) === -1;
} );
window.open( 'http://yuml.me/diagram/plain/class/' + definitions );
};