UNPKG

5.45 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.DOT_TEMPLATE = exports.LEGEND = void 0;
4exports.LEGEND = "<\n<table BORDER=\"0\">\n <tr>\n <td colspan=\"5\" align=\"center\"><b>Legend</b></td>\n </tr>\n <tr>\n <td>\n <table BORDER=\"0\">\n <tr>\n <td bgcolor=\"#ffffb3\" width=\"20\"></td>\n <td> Declarations</td>\n </tr>\n </table>\n </td>\n <td>\n <table BORDER=\"0\">\n <tr>\n <td bgcolor=\"#8dd3c7\" width=\"20\"></td>\n <td> Module</td>\n </tr>\n </table>\n </td>\n <td>\n <table BORDER=\"0\">\n <tr>\n <td bgcolor=\"#80b1d3\" width=\"20\"></td>\n <td> Bootstrap</td>\n </tr>\n </table>\n </td>\n <td>\n <table BORDER=\"0\">\n <tr>\n <td bgcolor=\"#fdb462\" width=\"20\"></td>\n <td> Providers</td>\n </tr>\n </table>\n </td>\n <td>\n <table BORDER=\"0\">\n <tr>\n <td bgcolor=\"#fb8072\" width=\"20\"></td>\n <td> Exports</td>\n </tr>\n </table>\n </td>\n </tr>\n</table>\n>";
5var loopBlock = function (symbols, attrs, edge) {
6 if (edge === void 0) { edge = ''; }
7 var str = '';
8 if (edge === '->') {
9 str = "\n {{~mod.".concat(symbols, " :_symbol}}\n\n {{?_symbol.alias}}\n \"{{=_symbol.alias}}\" -> \"{{=mod.name}}\" [").concat(attrs, "];\n {{??_symbol.name}}\n \"{{=_symbol.name}}\" -> \"{{=mod.name}}\" [").concat(attrs, "];\n {{?}}\n\n {{~}}\n ");
10 }
11 else {
12 str = "\n {{~mod.".concat(symbols, " :_symbol}}\n\n {{?_symbol.alias}}\n \"{{=_symbol.alias}}\" [label=\"{{=_symbol.alias}}\", ").concat(attrs, "];\n {{??_symbol.name}}\n \"{{=_symbol.name}}\" [label=\"{{=_symbol.name}}\", ").concat(attrs, "];\n {{?}}\n\n {{~}}");
13 }
14 return str;
15};
16exports.DOT_TEMPLATE = "\ndigraph dependencies {\n node [shape=\"rect\", style=\"filled\", colorscheme=###scheme###];\n ranksep=0.4;\n compound=false;\n remincross=true;\n splines=true;\n splines=ortho;\n\n rankdir=LR;\n rankdir=TB;\n rankdir=BT;\n\n label=###legend###;\n\n ratio=compress;\n fontname=\"Times-12\";\n\n {{~it.modules :mod}}\n subgraph \"cluster_{{=mod.name}}\" {\n label=\"\";\n style=\"dotted\";\n\t\tnode [shape=\"folder\", fillcolor=1];\n\n /* declarations:start */\n\n\t\tsubgraph cluster_{{=mod.name}}_declarations {\n style=\"solid\";\n\t\t\tnode [style=\"filled\", shape=\"rect\"];\n\n\t {{~mod.declarations :declaration}}\n\t\t\t\tnode [fillcolor=2];\n\t \"{{=declaration.name}}\";\n\t {{~}}\n\n\t\t}\n\n {{~mod.declarations :declaration}}\n \"{{=declaration.name}}\" -> \"{{=mod.name}}\" [style=\"solid\", lhead=\"cluster_{{=mod.name}}\" ltail=\"cluster_{{=mod.name}}_declarations\"];\n\n subgraph \"cluster_{{=mod.name}}_{{=declaration.name}}_providers\" {\n style=\"solid\";\n {{~declaration.providers :prov}}\n node [fillcolor=6, shape=\"oval\", style=\"filled\"];\n \"{{=prov.name}}\" -> \"{{=declaration.name}}\" [lhead=\"cluster_{{=mod.name}}_declarations\" ltail=\"cluster_{{=mod.name}}_{{=declaration.name}}_providers\"];\n {{~}}\n }\n\n {{~}}\n\n /* declarations:end */\n\n /* imports:start */\n\n subgraph cluster_{{=mod.name}}_imports {\n style=\"solid\";\n node [style=\"filled\", fillcolor=1, shape=\"rect\"];\n\n ".concat(loopBlock('imports', 'shape="folder"'), "\n }\n\n ").concat(loopBlock('imports', 'lhead="cluster_{{=mod.name}}", ltail="cluster_{{=mod.name}}_imports"', '->'), "\n\n /* imports:end */\n\n /* exports:start */\n\n\t\tsubgraph cluster_{{=mod.name}}_exports {\n style=\"solid\";\n\t\t\tnode [style=\"filled\", fillcolor=4, shape=\"rect\"];\n\t\t\t{{~mod.exports :exp}}\n\t\t\t\t\"{{=exp.name}} \" [label=\"{{=exp.name}} \", shape=\"rect\"]\n\t\t\t{{~}}\n\t\t}\n\n {{~mod.exports :exp}}\n \"{{=mod.name}}\" -> \"{{=exp.name}} \" [style=\"dashed\", ltail=\"cluster_{{=mod.name}}\" lhead=\"cluster_{{=mod.name}}_exports\"];\n {{~}}\n\n /* exports:end */\n\n /* bootstrap:start */\n\n subgraph cluster_{{=mod.name}}_bootstrap {\n style=\"solid\";\n node [style=\"filled\", fillcolor=5, shape=\"rect\"];\n {{~mod.bootstrap :bts}}\n \"{{=bts.name}} \" [label=\"{{=bts.name}} \", shape=\"rect\"]\n {{~}}\n }\n\n {{~mod.bootstrap :bts}}\n \"{{=mod.name}}\" -> \"{{=bts.name}} \" [style=\"dotted\", lhead=\"cluster_{{=mod.name}}_bootstrap\" ltail=\"cluster_{{=mod.name}}\"];\n {{~}}\n\n /* bootstrap:end */\n\n /* providers:start */\n\n subgraph cluster_{{=mod.name}}_providers {\n style=\"solid\";\n node [style=\"filled\", fillcolor=6, shape=\"rect\"];\n\n ").concat(loopBlock('providers', 'shape="oval"'), "\n }\n\n ").concat(loopBlock('providers', 'lhead="cluster_{{=mod.name}}", ltail="cluster_{{=mod.name}}_providers"', '->'), "\n\n /* providers:end */\n }\n {{~}}\n\n /* ").concat(exports.LEGEND, " */\n}\n");