-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
45 lines (36 loc) · 949 Bytes
/
main.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
const PostProcessing = require("./src/PostProcessing.js");
let pps = new PostProcessing();
const Visualization = require("./src/Visualization.js");
let vis = new Visualization();
const shexParser = require("./src/ShExParser.js");
function shexToUML(id, text, options) {
let muml = "";
let ops = options;
if (!options) {
ops = {};
}
try {
muml = shexParser.parseShExToMUML(text);
} catch(ex) {
alert("An error has occurred when generating the diagram data: \n" + ex);
}
vis.originalNames = shexParser.mg.originalNames;
pps.relationships = shexParser.mg.relationships;
vis.rpTerms = shexParser.mg.rpTerms;
try {
vis.crearSVG(id, muml, ops);
} catch(ex) {
alert("An error has occurred when generating the visualization: \n" + ex);
}
}
function asignarEventos(id) {
pps.asignarEventos(id);
}
function base64SVG(idsvg) {
return pps.base64SVG(idsvg);
}
module.exports = {
shexToUML,
base64SVG,
asignarEventos
}