5 <meta charset=
"utf-8"/>
6 <title>erdiag tool
</title>
10 <h2>Graph description
</h2>
11 <button onClick=
"processGraphDesc()">Send
</button>
13 <span>MCD graph type:
</span>
14 <input type=
"radio" name=
"mcd" value=
"compact" checked
/> compact
15 <input type=
"radio" name=
"mcd" value=
"bubble"/> bubble
18 <span>Output type:
</span>
19 <input type=
"radio" name=
"output" value=
"graph" checked
/> drawn graph
20 <input type=
"radio" name=
"output" value=
"text"/> graphviz input
23 <span>Image type:
</span>
24 <input type=
"radio" name=
"image" value=
"svg" checked
/> SVG
25 <input type=
"radio" name=
"image" value=
"png"/> PNG
28 <textarea id=
"graphDesc" rows=
"15" style=
"width:100%"></textarea>
29 <div id=
"result" style=
"display:none">
34 <h2>SQL instructions:
</h2>
38 <script src=
"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
39 <script src=
"parser.js"></script>
41 const result = document.getElementById("result");
42 function getRadioValue(name) {
43 for (let el of document.getElementsByName(name))
49 function processGraphDesc() {
50 const graphDesc = document.getElementById("graphDesc").value;
51 const mcdType = getRadioValue("mcd");
52 const outputType = getRadioValue("output");
53 const imageType = getRadioValue("image");
54 const er = new ErDiags(graphDesc, outputType, imageType);
55 er.drawMcd("mcd", mcdType);
58 result.style.display = "block";
59 //document.location.href = "#result"; //TODO: not working (auto-scroll)