1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory();
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define([], factory);
|
6 | else if(typeof exports === 'object')
|
7 | exports["mermaid"] = factory();
|
8 | else
|
9 | root["mermaid"] = factory();
|
10 | })(window, function() {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId]) {
|
20 | return installedModules[moduleId].exports;
|
21 | }
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | i: moduleId,
|
25 | l: false,
|
26 | exports: {}
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.l = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
47 | __webpack_require__.d = function(exports, name, getter) {
|
48 | if(!__webpack_require__.o(exports, name)) {
|
49 | Object.defineProperty(exports, name, {
|
50 | configurable: false,
|
51 | enumerable: true,
|
52 | get: getter
|
53 | /******/ });
|
54 | /******/ }
|
55 | /******/ };
|
56 | /******/
|
57 | /******/ // define __esModule on exports
|
58 | /******/ __webpack_require__.r = function(exports) {
|
59 | Object.defineProperty(exports, '__esModule', { value: true });
|
60 | };
|
61 |
|
62 |
|
63 | __webpack_require__.n = function(module) {
|
64 | var getter = module && module.__esModule ?
|
65 | function getDefault() { return module['default']; } :
|
66 | function getModuleExports() { return module; };
|
67 | __webpack_require__.d(getter, 'a', getter);
|
68 | return getter;
|
69 | };
|
70 |
|
71 |
|
72 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
73 |
|
74 |
|
75 | __webpack_require__.p = "";
|
76 |
|
77 |
|
78 |
|
79 | return __webpack_require__(__webpack_require__.s = "./src/mermaid.js");
|
80 | })
|
81 |
|
82 | ({
|
83 |
|
84 | "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/dark/index.scss":
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | (function(module, exports, __webpack_require__) {
|
90 |
|
91 | exports = module.exports = __webpack_require__( "./node_modules/css-loader/lib/css-base.js")(false);
|
92 |
|
93 |
|
94 |
|
95 |
|
96 | exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1px; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: lightgrey; }\n\n.edgePath .path {\n stroke: lightgrey;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8; }\n\n.cluster rect {\n fill: #6D6D65 !important;\n stroke: rgba(255, 255, 255, 0.25) !important;\n stroke-width: 1px !important; }\n\n.cluster text {\n fill: #F9FFFE; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 12px;\n background: #6D6D65;\n border: 1px solid rgba(255, 255, 255, 0.25);\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #81B1DB;\n fill: #BDD5EA; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: lightgrey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: lightgrey; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: lightgrey; }\n\n#arrowhead {\n fill: lightgrey; }\n\n#crosshead path {\n fill: lightgrey !important;\n stroke: lightgrey !important; }\n\n.messageText {\n fill: lightgrey;\n stroke: none; }\n\n.labelBox {\n stroke: #81B1DB;\n fill: #BDD5EA; }\n\n.labelText {\n fill: lightgrey;\n stroke: none; }\n\n.loopText {\n fill: lightgrey;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #81B1DB; }\n\n.note {\n stroke: rgba(255, 255, 255, 0.25);\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 14px; }\n\n/** Section styling */\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: rgba(255, 255, 255, 0.3); }\n\n.section2 {\n fill: #EAE8B9; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #F9FFFE; }\n\n.sectionTitle1 {\n fill: #F9FFFE; }\n\n.sectionTitle2 {\n fill: #F9FFFE; }\n\n.sectionTitle3 {\n fill: #F9FFFE; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px; }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: #DB5757;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: #323D47;\n text-anchor: start;\n font-size: 11px; }\n\n.taskTextOutsideLeft {\n fill: #323D47;\n text-anchor: end;\n font-size: 11px; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: #323D47; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #BDD5EA;\n stroke: rgba(255, 255, 255, 0.5); }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: lightgrey; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: lightgrey; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #81B1DB;\n stroke: rgba(255, 255, 255, 0.5); }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: #323D47 !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: #323D47 !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #E83737;\n fill: #E83737;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #E83737;\n fill: #81B1DB;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #E83737;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: #323D47 !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: #323D47 !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: #323D47; }\n\ng.classGroup text {\n fill: purple;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\n\ng.classGroup rect {\n fill: #BDD5EA;\n stroke: purple; }\n\ng.classGroup line {\n stroke: purple;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #BDD5EA;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: purple;\n font-size: 10px; }\n\n.relation {\n stroke: purple;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#extensionStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey; }\n", ""]);
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | }),
|
102 |
|
103 | "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/default/index.scss":
|
104 |
|
105 |
|
106 |
|
107 |
|
108 | (function(module, exports, __webpack_require__) {
|
109 |
|
110 | exports = module.exports = __webpack_require__( "./node_modules/css-loader/lib/css-base.js")(false);
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1px; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: #333333; }\n\n.edgePath .path {\n stroke: #333333;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8; }\n\n.cluster rect {\n fill: #ffffde !important;\n stroke: #aaaa33 !important;\n stroke-width: 1px !important; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 12px;\n background: #ffffde;\n border: 1px solid #aaaa33;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #CCCCFF;\n fill: #ECECFF; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: grey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #CCCCFF;\n fill: #ECECFF; }\n\n.labelText {\n fill: black;\n stroke: none; }\n\n.loopText {\n fill: black;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #CCCCFF; }\n\n.note {\n stroke: #aaaa33;\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 14px; }\n\n/** Section styling */\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: rgba(102, 102, 255, 0.49); }\n\n.section2 {\n fill: #fff400; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px; }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: red;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: black;\n text-anchor: start;\n font-size: 11px; }\n\n.taskTextOutsideLeft {\n fill: black;\n text-anchor: end;\n font-size: 11px; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #8a90dd;\n stroke: #534fbc; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: black; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: black; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #bfc7ff;\n stroke: #534fbc; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: black !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: black !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #ff8888;\n fill: red;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #ff8888;\n fill: #bfc7ff;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #ff8888;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: black !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: black !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: black; }\n\ng.classGroup text {\n fill: #9370DB;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\n\ng.classGroup rect {\n fill: #ECECFF;\n stroke: #9370DB; }\n\ng.classGroup line {\n stroke: #9370DB;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #ECECFF;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #9370DB;\n font-size: 10px; }\n\n.relation {\n stroke: #9370DB;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey; }\n", ""]);
|
116 |
|
117 |
|
118 |
|
119 |
|
120 | }),
|
121 |
|
122 | "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/forest/index.scss":
|
123 |
|
124 |
|
125 |
|
126 |
|
127 | (function(module, exports, __webpack_require__) {
|
128 |
|
129 | exports = module.exports = __webpack_require__( "./node_modules/css-loader/lib/css-base.js")(false);
|
130 |
|
131 |
|
132 |
|
133 |
|
134 | exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1px; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: green; }\n\n.edgePath .path {\n stroke: green;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8; }\n\n.cluster rect {\n fill: #cdffb2 !important;\n stroke: #6eaa49 !important;\n stroke-width: 1px !important; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 12px;\n background: #cdffb2;\n border: 1px solid #6eaa49;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #13540c;\n fill: #cde498; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: grey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #326932;\n fill: #cde498; }\n\n.labelText {\n fill: black;\n stroke: none; }\n\n.loopText {\n fill: black;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #326932; }\n\n.note {\n stroke: #6eaa49;\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 14px; }\n\n/** Section styling */\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: #6eaa49; }\n\n.section2 {\n fill: #6eaa49; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px; }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: red;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: black;\n text-anchor: start;\n font-size: 11px; }\n\n.taskTextOutsideLeft {\n fill: black;\n text-anchor: end;\n font-size: 11px; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #487e3a;\n stroke: #13540c; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: black; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: black; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #cde498;\n stroke: #13540c; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: black !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: black !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #ff8888;\n fill: red;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #ff8888;\n fill: #cde498;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #ff8888;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: black !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: black !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: black; }\n\ng.classGroup text {\n fill: #13540c;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\n\ng.classGroup rect {\n fill: #cde498;\n stroke: #13540c; }\n\ng.classGroup line {\n stroke: #13540c;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #cde498;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #13540c;\n font-size: 10px; }\n\n.relation {\n stroke: #13540c;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey; }\n", ""]);
|
135 |
|
136 |
|
137 |
|
138 |
|
139 | }),
|
140 |
|
141 | "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/neutral/index.scss":
|
142 |
|
143 |
|
144 |
|
145 |
|
146 | (function(module, exports, __webpack_require__) {
|
147 |
|
148 | exports = module.exports = __webpack_require__( "./node_modules/css-loader/lib/css-base.js")(false);
|
149 |
|
150 |
|
151 |
|
152 |
|
153 | exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #eee;\n stroke: #999;\n stroke-width: 1px; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: #333333; }\n\n.edgePath .path {\n stroke: #666;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: white; }\n\n.cluster rect {\n fill: #eaf2fb !important;\n stroke: #26a !important;\n stroke-width: 1px !important; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 12px;\n background: #eaf2fb;\n border: 1px solid #26a;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #999;\n fill: #eee; }\n\ntext.actor {\n fill: #333;\n stroke: none; }\n\n.actor-line {\n stroke: #666; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #999;\n fill: #eee; }\n\n.labelText {\n fill: white;\n stroke: none; }\n\n.loopText {\n fill: white;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n marker-end: 'url(#arrowhead)';\n stroke: #999; }\n\n.note {\n stroke: #777700;\n fill: #ffa; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 14px; }\n\n/** Section styling */\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: #80b3e6; }\n\n.section2 {\n fill: #80b3e6; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px; }\n\n/* Grid and axis */\n.grid .tick {\n stroke: #e6e6e6;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: #d42;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: #333;\n text-anchor: start;\n font-size: 11px; }\n\n.taskTextOutsideLeft {\n fill: #333;\n text-anchor: end;\n font-size: 11px; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #26a;\n stroke: #1a4d80; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: #333; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: #333; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #eee;\n stroke: #1a4d80; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: #333 !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: #666;\n fill: #bbb;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: #333 !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #b1361b;\n fill: #d42;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #b1361b;\n fill: #eee;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #b1361b;\n fill: #bbb;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: #333 !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: #333 !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: #333; }\n\ng.classGroup text {\n fill: #999;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\n\ng.classGroup rect {\n fill: #eee;\n stroke: #999; }\n\ng.classGroup line {\n stroke: #999;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #eee;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #999;\n font-size: 10px; }\n\n.relation {\n stroke: #999;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #eee;\n stroke: #999;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #eee;\n stroke: #999;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey; }\n", ""]);
|
154 |
|
155 |
|
156 |
|
157 |
|
158 | }),
|
159 |
|
160 | "./node_modules/css-loader/lib/css-base.js":
|
161 |
|
162 |
|
163 |
|
164 |
|
165 | (function(module, exports) {
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 | module.exports = function(useSourceMap) {
|
173 | var list = [];
|
174 |
|
175 |
|
176 | list.toString = function toString() {
|
177 | return this.map(function (item) {
|
178 | var content = cssWithMappingToString(item, useSourceMap);
|
179 | if(item[2]) {
|
180 | return "@media " + item[2] + "{" + content + "}";
|
181 | } else {
|
182 | return content;
|
183 | }
|
184 | }).join("");
|
185 | };
|
186 |
|
187 |
|
188 | list.i = function(modules, mediaQuery) {
|
189 | if(typeof modules === "string")
|
190 | modules = [[null, modules, ""]];
|
191 | var alreadyImportedModules = {};
|
192 | for(var i = 0; i < this.length; i++) {
|
193 | var id = this[i][0];
|
194 | if(typeof id === "number")
|
195 | alreadyImportedModules[id] = true;
|
196 | }
|
197 | for(i = 0; i < modules.length; i++) {
|
198 | var item = modules[i];
|
199 |
|
200 |
|
201 |
|
202 |
|
203 | if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
|
204 | if(mediaQuery && !item[2]) {
|
205 | item[2] = mediaQuery;
|
206 | } else if(mediaQuery) {
|
207 | item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
|
208 | }
|
209 | list.push(item);
|
210 | }
|
211 | }
|
212 | };
|
213 | return list;
|
214 | };
|
215 |
|
216 | function cssWithMappingToString(item, useSourceMap) {
|
217 | var content = item[1] || '';
|
218 | var cssMapping = item[3];
|
219 | if (!cssMapping) {
|
220 | return content;
|
221 | }
|
222 |
|
223 | if (useSourceMap && typeof btoa === 'function') {
|
224 | var sourceMapping = toComment(cssMapping);
|
225 | var sourceURLs = cssMapping.sources.map(function (source) {
|
226 | return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
|
227 | });
|
228 |
|
229 | return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
|
230 | }
|
231 |
|
232 | return [content].join('\n');
|
233 | }
|
234 |
|
235 |
|
236 | function toComment(sourceMap) {
|
237 |
|
238 | var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
|
239 | var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
|
240 |
|
241 | return '/*# ' + data + ' */';
|
242 | }
|
243 |
|
244 |
|
245 | }),
|
246 |
|
247 | "./node_modules/node-libs-browser/mock/empty.js":
|
248 |
|
249 |
|
250 |
|
251 |
|
252 | (function(module, exports) {
|
253 |
|
254 |
|
255 |
|
256 | }),
|
257 |
|
258 | "./node_modules/path-browserify/index.js":
|
259 |
|
260 |
|
261 |
|
262 |
|
263 | (function(module, exports, __webpack_require__) {
|
264 |
|
265 | (function(process) {
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 |
|
282 |
|
283 |
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 | function normalizeArray(parts, allowAboveRoot) {
|
291 |
|
292 | var up = 0;
|
293 | for (var i = parts.length - 1; i >= 0; i--) {
|
294 | var last = parts[i];
|
295 | if (last === '.') {
|
296 | parts.splice(i, 1);
|
297 | } else if (last === '..') {
|
298 | parts.splice(i, 1);
|
299 | up++;
|
300 | } else if (up) {
|
301 | parts.splice(i, 1);
|
302 | up--;
|
303 | }
|
304 | }
|
305 |
|
306 |
|
307 | if (allowAboveRoot) {
|
308 | for (; up--; up) {
|
309 | parts.unshift('..');
|
310 | }
|
311 | }
|
312 |
|
313 | return parts;
|
314 | }
|
315 |
|
316 |
|
317 |
|
318 | var splitPathRe =
|
319 | /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
|
320 | var splitPath = function(filename) {
|
321 | return splitPathRe.exec(filename).slice(1);
|
322 | };
|
323 |
|
324 |
|
325 |
|
326 | exports.resolve = function() {
|
327 | var resolvedPath = '',
|
328 | resolvedAbsolute = false;
|
329 |
|
330 | for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
331 | var path = (i >= 0) ? arguments[i] : process.cwd();
|
332 |
|
333 |
|
334 | if (typeof path !== 'string') {
|
335 | throw new TypeError('Arguments to path.resolve must be strings');
|
336 | } else if (!path) {
|
337 | continue;
|
338 | }
|
339 |
|
340 | resolvedPath = path + '/' + resolvedPath;
|
341 | resolvedAbsolute = path.charAt(0) === '/';
|
342 | }
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 | resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
|
349 | return !!p;
|
350 | }), !resolvedAbsolute).join('/');
|
351 |
|
352 | return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
|
353 | };
|
354 |
|
355 |
|
356 |
|
357 | exports.normalize = function(path) {
|
358 | var isAbsolute = exports.isAbsolute(path),
|
359 | trailingSlash = substr(path, -1) === '/';
|
360 |
|
361 |
|
362 | path = normalizeArray(filter(path.split('/'), function(p) {
|
363 | return !!p;
|
364 | }), !isAbsolute).join('/');
|
365 |
|
366 | if (!path && !isAbsolute) {
|
367 | path = '.';
|
368 | }
|
369 | if (path && trailingSlash) {
|
370 | path += '/';
|
371 | }
|
372 |
|
373 | return (isAbsolute ? '/' : '') + path;
|
374 | };
|
375 |
|
376 |
|
377 | exports.isAbsolute = function(path) {
|
378 | return path.charAt(0) === '/';
|
379 | };
|
380 |
|
381 |
|
382 | exports.join = function() {
|
383 | var paths = Array.prototype.slice.call(arguments, 0);
|
384 | return exports.normalize(filter(paths, function(p, index) {
|
385 | if (typeof p !== 'string') {
|
386 | throw new TypeError('Arguments to path.join must be strings');
|
387 | }
|
388 | return p;
|
389 | }).join('/'));
|
390 | };
|
391 |
|
392 |
|
393 |
|
394 |
|
395 | exports.relative = function(from, to) {
|
396 | from = exports.resolve(from).substr(1);
|
397 | to = exports.resolve(to).substr(1);
|
398 |
|
399 | function trim(arr) {
|
400 | var start = 0;
|
401 | for (; start < arr.length; start++) {
|
402 | if (arr[start] !== '') break;
|
403 | }
|
404 |
|
405 | var end = arr.length - 1;
|
406 | for (; end >= 0; end--) {
|
407 | if (arr[end] !== '') break;
|
408 | }
|
409 |
|
410 | if (start > end) return [];
|
411 | return arr.slice(start, end - start + 1);
|
412 | }
|
413 |
|
414 | var fromParts = trim(from.split('/'));
|
415 | var toParts = trim(to.split('/'));
|
416 |
|
417 | var length = Math.min(fromParts.length, toParts.length);
|
418 | var samePartsLength = length;
|
419 | for (var i = 0; i < length; i++) {
|
420 | if (fromParts[i] !== toParts[i]) {
|
421 | samePartsLength = i;
|
422 | break;
|
423 | }
|
424 | }
|
425 |
|
426 | var outputParts = [];
|
427 | for (var i = samePartsLength; i < fromParts.length; i++) {
|
428 | outputParts.push('..');
|
429 | }
|
430 |
|
431 | outputParts = outputParts.concat(toParts.slice(samePartsLength));
|
432 |
|
433 | return outputParts.join('/');
|
434 | };
|
435 |
|
436 | exports.sep = '/';
|
437 | exports.delimiter = ':';
|
438 |
|
439 | exports.dirname = function(path) {
|
440 | var result = splitPath(path),
|
441 | root = result[0],
|
442 | dir = result[1];
|
443 |
|
444 | if (!root && !dir) {
|
445 |
|
446 | return '.';
|
447 | }
|
448 |
|
449 | if (dir) {
|
450 |
|
451 | dir = dir.substr(0, dir.length - 1);
|
452 | }
|
453 |
|
454 | return root + dir;
|
455 | };
|
456 |
|
457 |
|
458 | exports.basename = function(path, ext) {
|
459 | var f = splitPath(path)[2];
|
460 |
|
461 | if (ext && f.substr(-1 * ext.length) === ext) {
|
462 | f = f.substr(0, f.length - ext.length);
|
463 | }
|
464 | return f;
|
465 | };
|
466 |
|
467 |
|
468 | exports.extname = function(path) {
|
469 | return splitPath(path)[3];
|
470 | };
|
471 |
|
472 | function filter (xs, f) {
|
473 | if (xs.filter) return xs.filter(f);
|
474 | var res = [];
|
475 | for (var i = 0; i < xs.length; i++) {
|
476 | if (f(xs[i], i, xs)) res.push(xs[i]);
|
477 | }
|
478 | return res;
|
479 | }
|
480 |
|
481 |
|
482 | var substr = 'ab'.substr(-1) === 'b'
|
483 | ? function (str, start, len) { return str.substr(start, len) }
|
484 | : function (str, start, len) {
|
485 | if (start < 0) start = str.length + start;
|
486 | return str.substr(start, len);
|
487 | }
|
488 | ;
|
489 |
|
490 | }.call(this, __webpack_require__( "./node_modules/process/browser.js")))
|
491 |
|
492 | }),
|
493 |
|
494 | "./node_modules/process/browser.js":
|
495 |
|
496 |
|
497 |
|
498 |
|
499 | (function(module, exports) {
|
500 |
|
501 |
|
502 | var process = module.exports = {};
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 | var cachedSetTimeout;
|
510 | var cachedClearTimeout;
|
511 |
|
512 | function defaultSetTimout() {
|
513 | throw new Error('setTimeout has not been defined');
|
514 | }
|
515 | function defaultClearTimeout () {
|
516 | throw new Error('clearTimeout has not been defined');
|
517 | }
|
518 | (function () {
|
519 | try {
|
520 | if (typeof setTimeout === 'function') {
|
521 | cachedSetTimeout = setTimeout;
|
522 | } else {
|
523 | cachedSetTimeout = defaultSetTimout;
|
524 | }
|
525 | } catch (e) {
|
526 | cachedSetTimeout = defaultSetTimout;
|
527 | }
|
528 | try {
|
529 | if (typeof clearTimeout === 'function') {
|
530 | cachedClearTimeout = clearTimeout;
|
531 | } else {
|
532 | cachedClearTimeout = defaultClearTimeout;
|
533 | }
|
534 | } catch (e) {
|
535 | cachedClearTimeout = defaultClearTimeout;
|
536 | }
|
537 | } ())
|
538 | function runTimeout(fun) {
|
539 | if (cachedSetTimeout === setTimeout) {
|
540 |
|
541 | return setTimeout(fun, 0);
|
542 | }
|
543 |
|
544 | if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
545 | cachedSetTimeout = setTimeout;
|
546 | return setTimeout(fun, 0);
|
547 | }
|
548 | try {
|
549 |
|
550 | return cachedSetTimeout(fun, 0);
|
551 | } catch(e){
|
552 | try {
|
553 |
|
554 | return cachedSetTimeout.call(null, fun, 0);
|
555 | } catch(e){
|
556 |
|
557 | return cachedSetTimeout.call(this, fun, 0);
|
558 | }
|
559 | }
|
560 |
|
561 |
|
562 | }
|
563 | function runClearTimeout(marker) {
|
564 | if (cachedClearTimeout === clearTimeout) {
|
565 |
|
566 | return clearTimeout(marker);
|
567 | }
|
568 |
|
569 | if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
570 | cachedClearTimeout = clearTimeout;
|
571 | return clearTimeout(marker);
|
572 | }
|
573 | try {
|
574 |
|
575 | return cachedClearTimeout(marker);
|
576 | } catch (e){
|
577 | try {
|
578 |
|
579 | return cachedClearTimeout.call(null, marker);
|
580 | } catch (e){
|
581 |
|
582 |
|
583 | return cachedClearTimeout.call(this, marker);
|
584 | }
|
585 | }
|
586 |
|
587 |
|
588 |
|
589 | }
|
590 | var queue = [];
|
591 | var draining = false;
|
592 | var currentQueue;
|
593 | var queueIndex = -1;
|
594 |
|
595 | function cleanUpNextTick() {
|
596 | if (!draining || !currentQueue) {
|
597 | return;
|
598 | }
|
599 | draining = false;
|
600 | if (currentQueue.length) {
|
601 | queue = currentQueue.concat(queue);
|
602 | } else {
|
603 | queueIndex = -1;
|
604 | }
|
605 | if (queue.length) {
|
606 | drainQueue();
|
607 | }
|
608 | }
|
609 |
|
610 | function drainQueue() {
|
611 | if (draining) {
|
612 | return;
|
613 | }
|
614 | var timeout = runTimeout(cleanUpNextTick);
|
615 | draining = true;
|
616 |
|
617 | var len = queue.length;
|
618 | while(len) {
|
619 | currentQueue = queue;
|
620 | queue = [];
|
621 | while (++queueIndex < len) {
|
622 | if (currentQueue) {
|
623 | currentQueue[queueIndex].run();
|
624 | }
|
625 | }
|
626 | queueIndex = -1;
|
627 | len = queue.length;
|
628 | }
|
629 | currentQueue = null;
|
630 | draining = false;
|
631 | runClearTimeout(timeout);
|
632 | }
|
633 |
|
634 | process.nextTick = function (fun) {
|
635 | var args = new Array(arguments.length - 1);
|
636 | if (arguments.length > 1) {
|
637 | for (var i = 1; i < arguments.length; i++) {
|
638 | args[i - 1] = arguments[i];
|
639 | }
|
640 | }
|
641 | queue.push(new Item(fun, args));
|
642 | if (queue.length === 1 && !draining) {
|
643 | runTimeout(drainQueue);
|
644 | }
|
645 | };
|
646 |
|
647 |
|
648 | function Item(fun, array) {
|
649 | this.fun = fun;
|
650 | this.array = array;
|
651 | }
|
652 | Item.prototype.run = function () {
|
653 | this.fun.apply(null, this.array);
|
654 | };
|
655 | process.title = 'browser';
|
656 | process.browser = true;
|
657 | process.env = {};
|
658 | process.argv = [];
|
659 | process.version = '';
|
660 | process.versions = {};
|
661 |
|
662 | function noop() {}
|
663 |
|
664 | process.on = noop;
|
665 | process.addListener = noop;
|
666 | process.once = noop;
|
667 | process.off = noop;
|
668 | process.removeListener = noop;
|
669 | process.removeAllListeners = noop;
|
670 | process.emit = noop;
|
671 | process.prependListener = noop;
|
672 | process.prependOnceListener = noop;
|
673 |
|
674 | process.listeners = function (name) { return [] }
|
675 |
|
676 | process.binding = function (name) {
|
677 | throw new Error('process.binding is not supported');
|
678 | };
|
679 |
|
680 | process.cwd = function () { return '/' };
|
681 | process.chdir = function (dir) {
|
682 | throw new Error('process.chdir is not supported');
|
683 | };
|
684 | process.umask = function() { return 0; };
|
685 |
|
686 |
|
687 | }),
|
688 |
|
689 | "./node_modules/webpack/buildin/module.js":
|
690 |
|
691 |
|
692 |
|
693 |
|
694 | (function(module, exports) {
|
695 |
|
696 | module.exports = function(module) {
|
697 | if (!module.webpackPolyfill) {
|
698 | module.deprecate = function() {};
|
699 | module.paths = [];
|
700 |
|
701 | if (!module.children) module.children = [];
|
702 | Object.defineProperty(module, "loaded", {
|
703 | enumerable: true,
|
704 | get: function() {
|
705 | return module.l;
|
706 | }
|
707 | });
|
708 | Object.defineProperty(module, "id", {
|
709 | enumerable: true,
|
710 | get: function() {
|
711 | return module.i;
|
712 | }
|
713 | });
|
714 | module.webpackPolyfill = 1;
|
715 | }
|
716 | return module;
|
717 | };
|
718 |
|
719 |
|
720 | }),
|
721 |
|
722 | "./src/diagrams/class/classDb.js":
|
723 |
|
724 |
|
725 |
|
726 |
|
727 | (function(module, exports, __webpack_require__) {
|
728 |
|
729 | "use strict";
|
730 |
|
731 |
|
732 | Object.defineProperty(exports, "__esModule", {
|
733 | value: true
|
734 | });
|
735 | exports.relationType = exports.lineType = exports.cleanupLabel = exports.addMembers = exports.addRelation = exports.getRelations = exports.getClasses = exports.getClass = exports.clear = exports.addClass = undefined;
|
736 |
|
737 | var _logger = __webpack_require__( "./src/logger.js");
|
738 |
|
739 | var relations = [];
|
740 | var classes = {};
|
741 |
|
742 |
|
743 |
|
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 | var addClass = exports.addClass = function addClass(id) {
|
750 | if (typeof classes[id] === 'undefined') {
|
751 | classes[id] = {
|
752 | id: id,
|
753 | methods: [],
|
754 | members: []
|
755 | };
|
756 | }
|
757 | };
|
758 |
|
759 | var clear = exports.clear = function clear() {
|
760 | relations = [];
|
761 | classes = {};
|
762 | };
|
763 |
|
764 | var getClass = exports.getClass = function getClass(id) {
|
765 | return classes[id];
|
766 | };
|
767 | var getClasses = exports.getClasses = function getClasses() {
|
768 | return classes;
|
769 | };
|
770 |
|
771 | var getRelations = exports.getRelations = function getRelations() {
|
772 | return relations;
|
773 | };
|
774 |
|
775 | var addRelation = exports.addRelation = function addRelation(relation) {
|
776 | _logger.logger.debug('Adding relation: ' + JSON.stringify(relation));
|
777 | addClass(relation.id1);
|
778 | addClass(relation.id2);
|
779 | relations.push(relation);
|
780 | };
|
781 |
|
782 | var addMembers = exports.addMembers = function addMembers(className, MembersArr) {
|
783 | var theClass = classes[className];
|
784 | if (typeof MembersArr === 'string') {
|
785 | if (MembersArr.substr(-1) === ')') {
|
786 | theClass.methods.push(MembersArr);
|
787 | } else {
|
788 | theClass.members.push(MembersArr);
|
789 | }
|
790 | }
|
791 | };
|
792 |
|
793 | var cleanupLabel = exports.cleanupLabel = function cleanupLabel(label) {
|
794 | if (label.substring(0, 1) === ':') {
|
795 | return label.substr(2).trim();
|
796 | } else {
|
797 | return label.trim();
|
798 | }
|
799 | };
|
800 |
|
801 | var lineType = exports.lineType = {
|
802 | LINE: 0,
|
803 | DOTTED_LINE: 1
|
804 | };
|
805 |
|
806 | var relationType = exports.relationType = {
|
807 | AGGREGATION: 0,
|
808 | EXTENSION: 1,
|
809 | COMPOSITION: 2,
|
810 | DEPENDENCY: 3
|
811 | };
|
812 |
|
813 | exports.default = {
|
814 | addClass: addClass,
|
815 | clear: clear,
|
816 | getClass: getClass,
|
817 | getClasses: getClasses,
|
818 | getRelations: getRelations,
|
819 | addRelation: addRelation,
|
820 | addMembers: addMembers,
|
821 | cleanupLabel: cleanupLabel,
|
822 | lineType: lineType,
|
823 | relationType: relationType
|
824 | };
|
825 |
|
826 | }),
|
827 |
|
828 | "./src/diagrams/class/classRenderer.js":
|
829 |
|
830 |
|
831 |
|
832 |
|
833 | (function(module, exports, __webpack_require__) {
|
834 |
|
835 | "use strict";
|
836 |
|
837 |
|
838 | Object.defineProperty(exports, "__esModule", {
|
839 | value: true
|
840 | });
|
841 | exports.draw = exports.setConf = undefined;
|
842 |
|
843 | var _dagreLayout = __webpack_require__( "dagre-layout");
|
844 |
|
845 | var _dagreLayout2 = _interopRequireDefault(_dagreLayout);
|
846 |
|
847 | var _graphlibrary = __webpack_require__( "graphlibrary");
|
848 |
|
849 | var _graphlibrary2 = _interopRequireDefault(_graphlibrary);
|
850 |
|
851 | var _d = __webpack_require__( "d3");
|
852 |
|
853 | var d3 = _interopRequireWildcard(_d);
|
854 |
|
855 | var _classDb = __webpack_require__( "./src/diagrams/class/classDb.js");
|
856 |
|
857 | var _classDb2 = _interopRequireDefault(_classDb);
|
858 |
|
859 | var _logger = __webpack_require__( "./src/logger.js");
|
860 |
|
861 | var _classDiagram = __webpack_require__( "./src/diagrams/class/parser/classDiagram.js");
|
862 |
|
863 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
864 |
|
865 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
866 |
|
867 | _classDiagram.parser.yy = _classDb2.default;
|
868 |
|
869 | var idCache = {};
|
870 |
|
871 | var classCnt = 0;
|
872 | var conf = {
|
873 | dividerMargin: 10,
|
874 | padding: 5,
|
875 | textHeight: 10
|
876 |
|
877 |
|
878 | };var getGraphId = function getGraphId(label) {
|
879 | var keys = Object.keys(idCache);
|
880 |
|
881 | for (var i = 0; i < keys.length; i++) {
|
882 | if (idCache[keys[i]].label === label) {
|
883 | return keys[i];
|
884 | }
|
885 | }
|
886 |
|
887 | return undefined;
|
888 | };
|
889 |
|
890 |
|
891 |
|
892 |
|
893 | var insertMarkers = function insertMarkers(elem) {
|
894 | elem.append('defs').append('marker').attr('id', 'extensionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 1,7 L18,13 V 1 Z');
|
895 |
|
896 | elem.append('defs').append('marker').attr('id', 'extensionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 1,1 V 13 L18,7 Z');
|
897 |
|
898 | elem.append('defs').append('marker').attr('id', 'compositionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
|
899 |
|
900 | elem.append('defs').append('marker').attr('id', 'compositionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
|
901 |
|
902 | elem.append('defs').append('marker').attr('id', 'aggregationStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
|
903 |
|
904 | elem.append('defs').append('marker').attr('id', 'aggregationEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
|
905 |
|
906 | elem.append('defs').append('marker').attr('id', 'dependencyStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');
|
907 |
|
908 | elem.append('defs').append('marker').attr('id', 'dependencyEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');
|
909 | };
|
910 |
|
911 | var edgeCount = 0;
|
912 | var drawEdge = function drawEdge(elem, path, relation) {
|
913 | var getRelationType = function getRelationType(type) {
|
914 | switch (type) {
|
915 | case _classDb2.default.relationType.AGGREGATION:
|
916 | return 'aggregation';
|
917 | case _classDb2.default.relationType.EXTENSION:
|
918 | return 'extension';
|
919 | case _classDb2.default.relationType.COMPOSITION:
|
920 | return 'composition';
|
921 | case _classDb2.default.relationType.DEPENDENCY:
|
922 | return 'dependency';
|
923 | }
|
924 | };
|
925 |
|
926 |
|
927 | var lineData = path.points;
|
928 |
|
929 |
|
930 | var lineFunction = d3.line().x(function (d) {
|
931 | return d.x;
|
932 | }).y(function (d) {
|
933 | return d.y;
|
934 | }).curve(d3.curveBasis);
|
935 |
|
936 | var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'relation');
|
937 | var url = '';
|
938 | if (conf.arrowMarkerAbsolute) {
|
939 | url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
|
940 | url = url.replace(/\(/g, '\\(');
|
941 | url = url.replace(/\)/g, '\\)');
|
942 | }
|
943 |
|
944 | if (relation.relation.type1 !== 'none') {
|
945 | svgPath.attr('marker-start', 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')');
|
946 | }
|
947 | if (relation.relation.type2 !== 'none') {
|
948 | svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')');
|
949 | }
|
950 |
|
951 | var x = void 0,
|
952 | y = void 0;
|
953 | var l = path.points.length;
|
954 | if (l % 2 !== 0) {
|
955 | var p1 = path.points[Math.floor(l / 2)];
|
956 | var p2 = path.points[Math.ceil(l / 2)];
|
957 | x = (p1.x + p2.x) / 2;
|
958 | y = (p1.y + p2.y) / 2;
|
959 | } else {
|
960 | var p = path.points[Math.floor(l / 2)];
|
961 | x = p.x;
|
962 | y = p.y;
|
963 | }
|
964 |
|
965 | if (typeof relation.title !== 'undefined') {
|
966 | var g = elem.append('g').attr('class', 'classLabel');
|
967 | var label = g.append('text').attr('class', 'label').attr('x', x).attr('y', y).attr('fill', 'red').attr('text-anchor', 'middle').text(relation.title);
|
968 |
|
969 | window.label = label;
|
970 | var bounds = label.node().getBBox();
|
971 |
|
972 | g.insert('rect', ':first-child').attr('class', 'box').attr('x', bounds.x - conf.padding / 2).attr('y', bounds.y - conf.padding / 2).attr('width', bounds.width + conf.padding).attr('height', bounds.height + conf.padding);
|
973 | }
|
974 |
|
975 | edgeCount++;
|
976 | };
|
977 |
|
978 | var drawClass = function drawClass(elem, classDef) {
|
979 | _logger.logger.info('Rendering class ' + classDef);
|
980 |
|
981 | var addTspan = function addTspan(textEl, txt, isFirst) {
|
982 | var tSpan = textEl.append('tspan').attr('x', conf.padding).text(txt);
|
983 | if (!isFirst) {
|
984 | tSpan.attr('dy', conf.textHeight);
|
985 | }
|
986 | };
|
987 |
|
988 | var id = 'classId' + classCnt;
|
989 | var classInfo = {
|
990 | id: id,
|
991 | label: classDef.id,
|
992 | width: 0,
|
993 | height: 0
|
994 | };
|
995 |
|
996 | var g = elem.append('g').attr('id', id).attr('class', 'classGroup');
|
997 | var title = g.append('text').attr('x', conf.padding).attr('y', conf.textHeight + conf.padding).text(classDef.id);
|
998 |
|
999 | var titleHeight = title.node().getBBox().height;
|
1000 |
|
1001 | var membersLine = g.append('line')
|
1002 | .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2).attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2);
|
1003 |
|
1004 | var members = g.append('text')
|
1005 | .attr('x', conf.padding).attr('y', titleHeight + conf.dividerMargin + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
|
1006 |
|
1007 | var isFirst = true;
|
1008 | classDef.members.forEach(function (member) {
|
1009 | addTspan(members, member, isFirst);
|
1010 | isFirst = false;
|
1011 | });
|
1012 |
|
1013 | var membersBox = members.node().getBBox();
|
1014 |
|
1015 | var methodsLine = g.append('line')
|
1016 | .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height);
|
1017 |
|
1018 | var methods = g.append('text')
|
1019 | .attr('x', conf.padding).attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
|
1020 |
|
1021 | isFirst = true;
|
1022 |
|
1023 | classDef.methods.forEach(function (method) {
|
1024 | addTspan(methods, method, isFirst);
|
1025 | isFirst = false;
|
1026 | });
|
1027 |
|
1028 | var classBox = g.node().getBBox();
|
1029 | g.insert('rect', ':first-child').attr('x', 0).attr('y', 0).attr('width', classBox.width + 2 * conf.padding).attr('height', classBox.height + conf.padding + 0.5 * conf.dividerMargin);
|
1030 |
|
1031 | membersLine.attr('x2', classBox.width + 2 * conf.padding);
|
1032 | methodsLine.attr('x2', classBox.width + 2 * conf.padding);
|
1033 |
|
1034 | classInfo.width = classBox.width + 2 * conf.padding;
|
1035 | classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;
|
1036 |
|
1037 | idCache[id] = classInfo;
|
1038 | classCnt++;
|
1039 | return classInfo;
|
1040 | };
|
1041 |
|
1042 | var setConf = exports.setConf = function setConf(cnf) {
|
1043 | var keys = Object.keys(cnf);
|
1044 |
|
1045 | keys.forEach(function (key) {
|
1046 | conf[key] = cnf[key];
|
1047 | });
|
1048 | };
|
1049 |
|
1050 |
|
1051 |
|
1052 |
|
1053 |
|
1054 | var draw = exports.draw = function draw(text, id) {
|
1055 | _classDiagram.parser.yy.clear();
|
1056 | _classDiagram.parser.parse(text);
|
1057 |
|
1058 | _logger.logger.info('Rendering diagram ' + text);
|
1059 |
|
1060 |
|
1061 | var diagram = d3.select('[id="' + id + '"]');
|
1062 | insertMarkers(diagram);
|
1063 |
|
1064 |
|
1065 | var g = new _graphlibrary2.default.Graph({
|
1066 | multigraph: true
|
1067 | });
|
1068 |
|
1069 |
|
1070 | g.setGraph({
|
1071 | isMultiGraph: true
|
1072 | });
|
1073 |
|
1074 |
|
1075 | g.setDefaultEdgeLabel(function () {
|
1076 | return {};
|
1077 | });
|
1078 |
|
1079 | var classes = _classDb2.default.getClasses();
|
1080 | var keys = Object.keys(classes);
|
1081 | for (var i = 0; i < keys.length; i++) {
|
1082 | var classDef = classes[keys[i]];
|
1083 | var node = drawClass(diagram, classDef);
|
1084 |
|
1085 |
|
1086 |
|
1087 | g.setNode(node.id, node);
|
1088 | _logger.logger.info('Org height: ' + node.height);
|
1089 | }
|
1090 |
|
1091 | var relations = _classDb2.default.getRelations();
|
1092 | relations.forEach(function (relation) {
|
1093 | _logger.logger.info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation));
|
1094 | g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), { relation: relation });
|
1095 | });
|
1096 | _dagreLayout2.default.layout(g);
|
1097 | g.nodes().forEach(function (v) {
|
1098 | if (typeof v !== 'undefined') {
|
1099 | _logger.logger.debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));
|
1100 | d3.select('#' + v).attr('transform', 'translate(' + (g.node(v).x - g.node(v).width / 2) + ',' + (g.node(v).y - g.node(v).height / 2) + ' )');
|
1101 | }
|
1102 | });
|
1103 | g.edges().forEach(function (e) {
|
1104 | _logger.logger.debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));
|
1105 | drawEdge(diagram, g.edge(e), g.edge(e).relation);
|
1106 | });
|
1107 |
|
1108 | diagram.attr('height', '100%');
|
1109 | diagram.attr('width', '100%');
|
1110 | diagram.attr('viewBox', '0 0 ' + (g.graph().width + 20) + ' ' + (g.graph().height + 20));
|
1111 | };
|
1112 |
|
1113 | exports.default = {
|
1114 | setConf: setConf,
|
1115 | draw: draw
|
1116 | };
|
1117 |
|
1118 | }),
|
1119 |
|
1120 | "./src/diagrams/class/parser/classDiagram.js":
|
1121 |
|
1122 |
|
1123 |
|
1124 |
|
1125 | (function(module, exports, __webpack_require__) {
|
1126 |
|
1127 | "use strict";
|
1128 | (function(process, module) {
|
1129 |
|
1130 |
|
1131 |
|
1132 |
|
1133 |
|
1134 |
|
1135 |
|
1136 |
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 |
|
1149 |
|
1150 |
|
1151 |
|
1152 |
|
1153 |
|
1154 |
|
1155 |
|
1156 |
|
1157 |
|
1158 |
|
1159 |
|
1160 |
|
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 |
|
1167 |
|
1168 |
|
1169 |
|
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 |
|
1175 |
|
1176 |
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 |
|
1192 |
|
1193 |
|
1194 |
|
1195 |
|
1196 |
|
1197 |
|
1198 |
|
1199 |
|
1200 |
|
1201 |
|
1202 |
|
1203 | var parser = function () {
|
1204 | var o = function o(k, v, _o, l) {
|
1205 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
1206 | },
|
1207 | $V0 = [1, 11],
|
1208 | $V1 = [1, 12],
|
1209 | $V2 = [1, 13],
|
1210 | $V3 = [1, 15],
|
1211 | $V4 = [1, 16],
|
1212 | $V5 = [1, 17],
|
1213 | $V6 = [6, 8],
|
1214 | $V7 = [1, 26],
|
1215 | $V8 = [1, 27],
|
1216 | $V9 = [1, 28],
|
1217 | $Va = [1, 29],
|
1218 | $Vb = [1, 30],
|
1219 | $Vc = [1, 31],
|
1220 | $Vd = [6, 8, 13, 17, 23, 26, 27, 28, 29, 30, 31],
|
1221 | $Ve = [6, 8, 13, 17, 23, 26, 27, 28, 29, 30, 31, 45, 46, 47],
|
1222 | $Vf = [23, 45, 46, 47],
|
1223 | $Vg = [23, 30, 31, 45, 46, 47],
|
1224 | $Vh = [23, 26, 27, 28, 29, 45, 46, 47],
|
1225 | $Vi = [6, 8, 13],
|
1226 | $Vj = [1, 46];
|
1227 | var parser = { trace: function trace() {},
|
1228 | yy: {},
|
1229 | symbols_: { "error": 2, "mermaidDoc": 3, "graphConfig": 4, "CLASS_DIAGRAM": 5, "NEWLINE": 6, "statements": 7, "EOF": 8, "statement": 9, "className": 10, "alphaNumToken": 11, "relationStatement": 12, "LABEL": 13, "classStatement": 14, "methodStatement": 15, "CLASS": 16, "STRUCT_START": 17, "members": 18, "STRUCT_STOP": 19, "MEMBER": 20, "SEPARATOR": 21, "relation": 22, "STR": 23, "relationType": 24, "lineType": 25, "AGGREGATION": 26, "EXTENSION": 27, "COMPOSITION": 28, "DEPENDENCY": 29, "LINE": 30, "DOTTED_LINE": 31, "commentToken": 32, "textToken": 33, "graphCodeTokens": 34, "textNoTagsToken": 35, "TAGSTART": 36, "TAGEND": 37, "==": 38, "--": 39, "PCT": 40, "DEFAULT": 41, "SPACE": 42, "MINUS": 43, "keywords": 44, "UNICODE_TEXT": 45, "NUM": 46, "ALPHA": 47, "$accept": 0, "$end": 1 },
|
1230 | terminals_: { 2: "error", 5: "CLASS_DIAGRAM", 6: "NEWLINE", 8: "EOF", 13: "LABEL", 16: "CLASS", 17: "STRUCT_START", 19: "STRUCT_STOP", 20: "MEMBER", 21: "SEPARATOR", 23: "STR", 26: "AGGREGATION", 27: "EXTENSION", 28: "COMPOSITION", 29: "DEPENDENCY", 30: "LINE", 31: "DOTTED_LINE", 34: "graphCodeTokens", 36: "TAGSTART", 37: "TAGEND", 38: "==", 39: "--", 40: "PCT", 41: "DEFAULT", 42: "SPACE", 43: "MINUS", 44: "keywords", 45: "UNICODE_TEXT", 46: "NUM", 47: "ALPHA" },
|
1231 | productions_: [0, [3, 1], [4, 4], [7, 1], [7, 3], [10, 2], [10, 1], [9, 1], [9, 2], [9, 1], [9, 1], [14, 2], [14, 5], [18, 1], [18, 2], [15, 1], [15, 2], [15, 1], [15, 1], [12, 3], [12, 4], [12, 4], [12, 5], [22, 3], [22, 2], [22, 2], [22, 1], [24, 1], [24, 1], [24, 1], [24, 1], [25, 1], [25, 1], [32, 1], [32, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [35, 1], [35, 1], [35, 1], [35, 1], [11, 1], [11, 1], [11, 1]],
|
1232 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
1233 |
|
1234 |
|
1235 | var $0 = $$.length - 1;
|
1236 | switch (yystate) {
|
1237 | case 5:
|
1238 | this.$ = $$[$0 - 1] + $$[$0];
|
1239 | break;
|
1240 | case 6:
|
1241 | this.$ = $$[$0];
|
1242 | break;
|
1243 | case 7:
|
1244 | yy.addRelation($$[$0]);
|
1245 | break;
|
1246 | case 8:
|
1247 | $$[$0 - 1].title = yy.cleanupLabel($$[$0]);yy.addRelation($$[$0 - 1]);
|
1248 | break;
|
1249 | case 12:
|
1250 | yy.addMembers($$[$0 - 3], $$[$0 - 1]);
|
1251 | break;
|
1252 | case 13:
|
1253 | this.$ = [$$[$0]];
|
1254 | break;
|
1255 | case 14:
|
1256 | $$[$0].push($$[$0 - 1]);this.$ = $$[$0];
|
1257 | break;
|
1258 | case 15:
|
1259 |
|
1260 | break;
|
1261 | case 16:
|
1262 | yy.addMembers($$[$0 - 1], yy.cleanupLabel($$[$0]));
|
1263 | break;
|
1264 | case 17:
|
1265 | console.warn('Member', $$[$0]);
|
1266 | break;
|
1267 | case 18:
|
1268 |
|
1269 | break;
|
1270 | case 19:
|
1271 | this.$ = { 'id1': $$[$0 - 2], 'id2': $$[$0], relation: $$[$0 - 1], relationTitle1: 'none', relationTitle2: 'none' };
|
1272 | break;
|
1273 | case 20:
|
1274 | this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: $$[$0 - 2], relationTitle2: 'none' };
|
1275 | break;
|
1276 | case 21:
|
1277 | this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: 'none', relationTitle2: $$[$0 - 1] };
|
1278 | break;
|
1279 | case 22:
|
1280 | this.$ = { id1: $$[$0 - 4], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: $$[$0 - 3], relationTitle2: $$[$0 - 1] };
|
1281 | break;
|
1282 | case 23:
|
1283 | this.$ = { type1: $$[$0 - 2], type2: $$[$0], lineType: $$[$0 - 1] };
|
1284 | break;
|
1285 | case 24:
|
1286 | this.$ = { type1: 'none', type2: $$[$0], lineType: $$[$0 - 1] };
|
1287 | break;
|
1288 | case 25:
|
1289 | this.$ = { type1: $$[$0 - 1], type2: 'none', lineType: $$[$0] };
|
1290 | break;
|
1291 | case 26:
|
1292 | this.$ = { type1: 'none', type2: 'none', lineType: $$[$0] };
|
1293 | break;
|
1294 | case 27:
|
1295 | this.$ = yy.relationType.AGGREGATION;
|
1296 | break;
|
1297 | case 28:
|
1298 | this.$ = yy.relationType.EXTENSION;
|
1299 | break;
|
1300 | case 29:
|
1301 | this.$ = yy.relationType.COMPOSITION;
|
1302 | break;
|
1303 | case 30:
|
1304 | this.$ = yy.relationType.DEPENDENCY;
|
1305 | break;
|
1306 | case 31:
|
1307 | this.$ = yy.lineType.LINE;
|
1308 | break;
|
1309 | case 32:
|
1310 | this.$ = yy.lineType.DOTTED_LINE;
|
1311 | break;
|
1312 | }
|
1313 | },
|
1314 | table: [{ 3: 1, 4: 2, 5: [1, 3] }, { 1: [3] }, { 1: [2, 1] }, { 6: [1, 4] }, { 7: 5, 9: 6, 10: 10, 11: 14, 12: 7, 14: 8, 15: 9, 16: $V0, 20: $V1, 21: $V2, 45: $V3, 46: $V4, 47: $V5 }, { 8: [1, 18] }, { 6: [1, 19], 8: [2, 3] }, o($V6, [2, 7], { 13: [1, 20] }), o($V6, [2, 9]), o($V6, [2, 10]), o($V6, [2, 15], { 22: 21, 24: 24, 25: 25, 13: [1, 23], 23: [1, 22], 26: $V7, 27: $V8, 28: $V9, 29: $Va, 30: $Vb, 31: $Vc }), { 10: 32, 11: 14, 45: $V3, 46: $V4, 47: $V5 }, o($V6, [2, 17]), o($V6, [2, 18]), o($Vd, [2, 6], { 11: 14, 10: 33, 45: $V3, 46: $V4, 47: $V5 }), o($Ve, [2, 46]), o($Ve, [2, 47]), o($Ve, [2, 48]), { 1: [2, 2] }, { 7: 34, 9: 6, 10: 10, 11: 14, 12: 7, 14: 8, 15: 9, 16: $V0, 20: $V1, 21: $V2, 45: $V3, 46: $V4, 47: $V5 }, o($V6, [2, 8]), { 10: 35, 11: 14, 23: [1, 36], 45: $V3, 46: $V4, 47: $V5 }, { 22: 37, 24: 24, 25: 25, 26: $V7, 27: $V8, 28: $V9, 29: $Va, 30: $Vb, 31: $Vc }, o($V6, [2, 16]), { 25: 38, 30: $Vb, 31: $Vc }, o($Vf, [2, 26], { 24: 39, 26: $V7, 27: $V8, 28: $V9, 29: $Va }), o($Vg, [2, 27]), o($Vg, [2, 28]), o($Vg, [2, 29]), o($Vg, [2, 30]), o($Vh, [2, 31]), o($Vh, [2, 32]), o($V6, [2, 11], { 17: [1, 40] }), o($Vd, [2, 5]), { 8: [2, 4] }, o($Vi, [2, 19]), { 10: 41, 11: 14, 45: $V3, 46: $V4, 47: $V5 }, { 10: 42, 11: 14, 23: [1, 43], 45: $V3, 46: $V4, 47: $V5 }, o($Vf, [2, 25], { 24: 44, 26: $V7, 27: $V8, 28: $V9, 29: $Va }), o($Vf, [2, 24]), { 18: 45, 20: $Vj }, o($Vi, [2, 21]), o($Vi, [2, 20]), { 10: 47, 11: 14, 45: $V3, 46: $V4, 47: $V5 }, o($Vf, [2, 23]), { 19: [1, 48] }, { 18: 49, 19: [2, 13], 20: $Vj }, o($Vi, [2, 22]), o($V6, [2, 12]), { 19: [2, 14] }],
|
1315 | defaultActions: { 2: [2, 1], 18: [2, 2], 34: [2, 4], 49: [2, 14] },
|
1316 | parseError: function parseError(str, hash) {
|
1317 | if (hash.recoverable) {
|
1318 | this.trace(str);
|
1319 | } else {
|
1320 | var error = new Error(str);
|
1321 | error.hash = hash;
|
1322 | throw error;
|
1323 | }
|
1324 | },
|
1325 | parse: function parse(input) {
|
1326 | var self = this,
|
1327 | stack = [0],
|
1328 | tstack = [],
|
1329 | vstack = [null],
|
1330 | lstack = [],
|
1331 | table = this.table,
|
1332 | yytext = '',
|
1333 | yylineno = 0,
|
1334 | yyleng = 0,
|
1335 | recovering = 0,
|
1336 | TERROR = 2,
|
1337 | EOF = 1;
|
1338 | var args = lstack.slice.call(arguments, 1);
|
1339 | var lexer = Object.create(this.lexer);
|
1340 | var sharedState = { yy: {} };
|
1341 | for (var k in this.yy) {
|
1342 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
1343 | sharedState.yy[k] = this.yy[k];
|
1344 | }
|
1345 | }
|
1346 | lexer.setInput(input, sharedState.yy);
|
1347 | sharedState.yy.lexer = lexer;
|
1348 | sharedState.yy.parser = this;
|
1349 | if (typeof lexer.yylloc == 'undefined') {
|
1350 | lexer.yylloc = {};
|
1351 | }
|
1352 | var yyloc = lexer.yylloc;
|
1353 | lstack.push(yyloc);
|
1354 | var ranges = lexer.options && lexer.options.ranges;
|
1355 | if (typeof sharedState.yy.parseError === 'function') {
|
1356 | this.parseError = sharedState.yy.parseError;
|
1357 | } else {
|
1358 | this.parseError = Object.getPrototypeOf(this).parseError;
|
1359 | }
|
1360 | function popStack(n) {
|
1361 | stack.length = stack.length - 2 * n;
|
1362 | vstack.length = vstack.length - n;
|
1363 | lstack.length = lstack.length - n;
|
1364 | }
|
1365 | function lex() {
|
1366 | var token;
|
1367 | token = tstack.pop() || lexer.lex() || EOF;
|
1368 | if (typeof token !== 'number') {
|
1369 | if (token instanceof Array) {
|
1370 | tstack = token;
|
1371 | token = tstack.pop();
|
1372 | }
|
1373 | token = self.symbols_[token] || token;
|
1374 | }
|
1375 | return token;
|
1376 | }
|
1377 | var symbol,
|
1378 | preErrorSymbol,
|
1379 | state,
|
1380 | action,
|
1381 | a,
|
1382 | r,
|
1383 | yyval = {},
|
1384 | p,
|
1385 | len,
|
1386 | newState,
|
1387 | expected;
|
1388 | while (true) {
|
1389 | state = stack[stack.length - 1];
|
1390 | if (this.defaultActions[state]) {
|
1391 | action = this.defaultActions[state];
|
1392 | } else {
|
1393 | if (symbol === null || typeof symbol == 'undefined') {
|
1394 | symbol = lex();
|
1395 | }
|
1396 | action = table[state] && table[state][symbol];
|
1397 | }
|
1398 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
1399 | var errStr = '';
|
1400 | expected = [];
|
1401 | for (p in table[state]) {
|
1402 | if (this.terminals_[p] && p > TERROR) {
|
1403 | expected.push('\'' + this.terminals_[p] + '\'');
|
1404 | }
|
1405 | }
|
1406 | if (lexer.showPosition) {
|
1407 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
1408 | } else {
|
1409 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
1410 | }
|
1411 | this.parseError(errStr, {
|
1412 | text: lexer.match,
|
1413 | token: this.terminals_[symbol] || symbol,
|
1414 | line: lexer.yylineno,
|
1415 | loc: yyloc,
|
1416 | expected: expected
|
1417 | });
|
1418 | }
|
1419 | if (action[0] instanceof Array && action.length > 1) {
|
1420 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
1421 | }
|
1422 | switch (action[0]) {
|
1423 | case 1:
|
1424 | stack.push(symbol);
|
1425 | vstack.push(lexer.yytext);
|
1426 | lstack.push(lexer.yylloc);
|
1427 | stack.push(action[1]);
|
1428 | symbol = null;
|
1429 | if (!preErrorSymbol) {
|
1430 | yyleng = lexer.yyleng;
|
1431 | yytext = lexer.yytext;
|
1432 | yylineno = lexer.yylineno;
|
1433 | yyloc = lexer.yylloc;
|
1434 | if (recovering > 0) {
|
1435 | recovering--;
|
1436 | }
|
1437 | } else {
|
1438 | symbol = preErrorSymbol;
|
1439 | preErrorSymbol = null;
|
1440 | }
|
1441 | break;
|
1442 | case 2:
|
1443 | len = this.productions_[action[1]][1];
|
1444 | yyval.$ = vstack[vstack.length - len];
|
1445 | yyval._$ = {
|
1446 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
1447 | last_line: lstack[lstack.length - 1].last_line,
|
1448 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
1449 | last_column: lstack[lstack.length - 1].last_column
|
1450 | };
|
1451 | if (ranges) {
|
1452 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
1453 | }
|
1454 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
1455 | if (typeof r !== 'undefined') {
|
1456 | return r;
|
1457 | }
|
1458 | if (len) {
|
1459 | stack = stack.slice(0, -1 * len * 2);
|
1460 | vstack = vstack.slice(0, -1 * len);
|
1461 | lstack = lstack.slice(0, -1 * len);
|
1462 | }
|
1463 | stack.push(this.productions_[action[1]][0]);
|
1464 | vstack.push(yyval.$);
|
1465 | lstack.push(yyval._$);
|
1466 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
1467 | stack.push(newState);
|
1468 | break;
|
1469 | case 3:
|
1470 | return true;
|
1471 | }
|
1472 | }
|
1473 | return true;
|
1474 | } };
|
1475 |
|
1476 |
|
1477 | var lexer = function () {
|
1478 | var lexer = {
|
1479 |
|
1480 | EOF: 1,
|
1481 |
|
1482 | parseError: function parseError(str, hash) {
|
1483 | if (this.yy.parser) {
|
1484 | this.yy.parser.parseError(str, hash);
|
1485 | } else {
|
1486 | throw new Error(str);
|
1487 | }
|
1488 | },
|
1489 |
|
1490 |
|
1491 | setInput: function setInput(input, yy) {
|
1492 | this.yy = yy || this.yy || {};
|
1493 | this._input = input;
|
1494 | this._more = this._backtrack = this.done = false;
|
1495 | this.yylineno = this.yyleng = 0;
|
1496 | this.yytext = this.matched = this.match = '';
|
1497 | this.conditionStack = ['INITIAL'];
|
1498 | this.yylloc = {
|
1499 | first_line: 1,
|
1500 | first_column: 0,
|
1501 | last_line: 1,
|
1502 | last_column: 0
|
1503 | };
|
1504 | if (this.options.ranges) {
|
1505 | this.yylloc.range = [0, 0];
|
1506 | }
|
1507 | this.offset = 0;
|
1508 | return this;
|
1509 | },
|
1510 |
|
1511 |
|
1512 | input: function input() {
|
1513 | var ch = this._input[0];
|
1514 | this.yytext += ch;
|
1515 | this.yyleng++;
|
1516 | this.offset++;
|
1517 | this.match += ch;
|
1518 | this.matched += ch;
|
1519 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
1520 | if (lines) {
|
1521 | this.yylineno++;
|
1522 | this.yylloc.last_line++;
|
1523 | } else {
|
1524 | this.yylloc.last_column++;
|
1525 | }
|
1526 | if (this.options.ranges) {
|
1527 | this.yylloc.range[1]++;
|
1528 | }
|
1529 |
|
1530 | this._input = this._input.slice(1);
|
1531 | return ch;
|
1532 | },
|
1533 |
|
1534 |
|
1535 | unput: function unput(ch) {
|
1536 | var len = ch.length;
|
1537 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
1538 |
|
1539 | this._input = ch + this._input;
|
1540 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
1541 |
|
1542 | this.offset -= len;
|
1543 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
1544 | this.match = this.match.substr(0, this.match.length - 1);
|
1545 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
1546 |
|
1547 | if (lines.length - 1) {
|
1548 | this.yylineno -= lines.length - 1;
|
1549 | }
|
1550 | var r = this.yylloc.range;
|
1551 |
|
1552 | this.yylloc = {
|
1553 | first_line: this.yylloc.first_line,
|
1554 | last_line: this.yylineno + 1,
|
1555 | first_column: this.yylloc.first_column,
|
1556 | last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
|
1557 | };
|
1558 |
|
1559 | if (this.options.ranges) {
|
1560 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
1561 | }
|
1562 | this.yyleng = this.yytext.length;
|
1563 | return this;
|
1564 | },
|
1565 |
|
1566 |
|
1567 | more: function more() {
|
1568 | this._more = true;
|
1569 | return this;
|
1570 | },
|
1571 |
|
1572 |
|
1573 | reject: function reject() {
|
1574 | if (this.options.backtrack_lexer) {
|
1575 | this._backtrack = true;
|
1576 | } else {
|
1577 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
|
1578 | text: "",
|
1579 | token: null,
|
1580 | line: this.yylineno
|
1581 | });
|
1582 | }
|
1583 | return this;
|
1584 | },
|
1585 |
|
1586 |
|
1587 | less: function less(n) {
|
1588 | this.unput(this.match.slice(n));
|
1589 | },
|
1590 |
|
1591 |
|
1592 | pastInput: function pastInput() {
|
1593 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
1594 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
1595 | },
|
1596 |
|
1597 |
|
1598 | upcomingInput: function upcomingInput() {
|
1599 | var next = this.match;
|
1600 | if (next.length < 20) {
|
1601 | next += this._input.substr(0, 20 - next.length);
|
1602 | }
|
1603 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
1604 | },
|
1605 |
|
1606 |
|
1607 | showPosition: function showPosition() {
|
1608 | var pre = this.pastInput();
|
1609 | var c = new Array(pre.length + 1).join("-");
|
1610 | return pre + this.upcomingInput() + "\n" + c + "^";
|
1611 | },
|
1612 |
|
1613 |
|
1614 | test_match: function test_match(match, indexed_rule) {
|
1615 | var token, lines, backup;
|
1616 |
|
1617 | if (this.options.backtrack_lexer) {
|
1618 |
|
1619 | backup = {
|
1620 | yylineno: this.yylineno,
|
1621 | yylloc: {
|
1622 | first_line: this.yylloc.first_line,
|
1623 | last_line: this.last_line,
|
1624 | first_column: this.yylloc.first_column,
|
1625 | last_column: this.yylloc.last_column
|
1626 | },
|
1627 | yytext: this.yytext,
|
1628 | match: this.match,
|
1629 | matches: this.matches,
|
1630 | matched: this.matched,
|
1631 | yyleng: this.yyleng,
|
1632 | offset: this.offset,
|
1633 | _more: this._more,
|
1634 | _input: this._input,
|
1635 | yy: this.yy,
|
1636 | conditionStack: this.conditionStack.slice(0),
|
1637 | done: this.done
|
1638 | };
|
1639 | if (this.options.ranges) {
|
1640 | backup.yylloc.range = this.yylloc.range.slice(0);
|
1641 | }
|
1642 | }
|
1643 |
|
1644 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
1645 | if (lines) {
|
1646 | this.yylineno += lines.length;
|
1647 | }
|
1648 | this.yylloc = {
|
1649 | first_line: this.yylloc.last_line,
|
1650 | last_line: this.yylineno + 1,
|
1651 | first_column: this.yylloc.last_column,
|
1652 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
1653 | };
|
1654 | this.yytext += match[0];
|
1655 | this.match += match[0];
|
1656 | this.matches = match;
|
1657 | this.yyleng = this.yytext.length;
|
1658 | if (this.options.ranges) {
|
1659 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
1660 | }
|
1661 | this._more = false;
|
1662 | this._backtrack = false;
|
1663 | this._input = this._input.slice(match[0].length);
|
1664 | this.matched += match[0];
|
1665 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
1666 | if (this.done && this._input) {
|
1667 | this.done = false;
|
1668 | }
|
1669 | if (token) {
|
1670 | return token;
|
1671 | } else if (this._backtrack) {
|
1672 |
|
1673 | for (var k in backup) {
|
1674 | this[k] = backup[k];
|
1675 | }
|
1676 | return false;
|
1677 | }
|
1678 | return false;
|
1679 | },
|
1680 |
|
1681 |
|
1682 | next: function next() {
|
1683 | if (this.done) {
|
1684 | return this.EOF;
|
1685 | }
|
1686 | if (!this._input) {
|
1687 | this.done = true;
|
1688 | }
|
1689 |
|
1690 | var token, match, tempMatch, index;
|
1691 | if (!this._more) {
|
1692 | this.yytext = '';
|
1693 | this.match = '';
|
1694 | }
|
1695 | var rules = this._currentRules();
|
1696 | for (var i = 0; i < rules.length; i++) {
|
1697 | tempMatch = this._input.match(this.rules[rules[i]]);
|
1698 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
1699 | match = tempMatch;
|
1700 | index = i;
|
1701 | if (this.options.backtrack_lexer) {
|
1702 | token = this.test_match(tempMatch, rules[i]);
|
1703 | if (token !== false) {
|
1704 | return token;
|
1705 | } else if (this._backtrack) {
|
1706 | match = false;
|
1707 | continue;
|
1708 | } else {
|
1709 |
|
1710 | return false;
|
1711 | }
|
1712 | } else if (!this.options.flex) {
|
1713 | break;
|
1714 | }
|
1715 | }
|
1716 | }
|
1717 | if (match) {
|
1718 | token = this.test_match(match, rules[index]);
|
1719 | if (token !== false) {
|
1720 | return token;
|
1721 | }
|
1722 |
|
1723 | return false;
|
1724 | }
|
1725 | if (this._input === "") {
|
1726 | return this.EOF;
|
1727 | } else {
|
1728 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
1729 | text: "",
|
1730 | token: null,
|
1731 | line: this.yylineno
|
1732 | });
|
1733 | }
|
1734 | },
|
1735 |
|
1736 |
|
1737 | lex: function lex() {
|
1738 | var r = this.next();
|
1739 | if (r) {
|
1740 | return r;
|
1741 | } else {
|
1742 | return this.lex();
|
1743 | }
|
1744 | },
|
1745 |
|
1746 |
|
1747 | begin: function begin(condition) {
|
1748 | this.conditionStack.push(condition);
|
1749 | },
|
1750 |
|
1751 |
|
1752 | popState: function popState() {
|
1753 | var n = this.conditionStack.length - 1;
|
1754 | if (n > 0) {
|
1755 | return this.conditionStack.pop();
|
1756 | } else {
|
1757 | return this.conditionStack[0];
|
1758 | }
|
1759 | },
|
1760 |
|
1761 |
|
1762 | _currentRules: function _currentRules() {
|
1763 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
1764 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
1765 | } else {
|
1766 | return this.conditions["INITIAL"].rules;
|
1767 | }
|
1768 | },
|
1769 |
|
1770 |
|
1771 | topState: function topState(n) {
|
1772 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
1773 | if (n >= 0) {
|
1774 | return this.conditionStack[n];
|
1775 | } else {
|
1776 | return "INITIAL";
|
1777 | }
|
1778 | },
|
1779 |
|
1780 |
|
1781 | pushState: function pushState(condition) {
|
1782 | this.begin(condition);
|
1783 | },
|
1784 |
|
1785 |
|
1786 | stateStackSize: function stateStackSize() {
|
1787 | return this.conditionStack.length;
|
1788 | },
|
1789 | options: {},
|
1790 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
1791 | var YYSTATE = YY_START;
|
1792 | switch ($avoiding_name_collisions) {
|
1793 | case 0:
|
1794 |
|
1795 | break;
|
1796 | case 1:
|
1797 | return 6;
|
1798 | break;
|
1799 | case 2:
|
1800 |
|
1801 | break;
|
1802 | case 3:
|
1803 | return 5;
|
1804 | break;
|
1805 | case 4:
|
1806 | this.begin("struct"); return 17;
|
1807 | break;
|
1808 | case 5:
|
1809 | this.popState();return 19;
|
1810 | break;
|
1811 | case 6:
|
1812 |
|
1813 | break;
|
1814 | case 7:
|
1815 | return "MEMBER";
|
1816 | break;
|
1817 | case 8:
|
1818 | return 16;
|
1819 | break;
|
1820 | case 9:
|
1821 | this.begin("string");
|
1822 | break;
|
1823 | case 10:
|
1824 | this.popState();
|
1825 | break;
|
1826 | case 11:
|
1827 | return "STR";
|
1828 | break;
|
1829 | case 12:
|
1830 | return 27;
|
1831 | break;
|
1832 | case 13:
|
1833 | return 27;
|
1834 | break;
|
1835 | case 14:
|
1836 | return 29;
|
1837 | break;
|
1838 | case 15:
|
1839 | return 29;
|
1840 | break;
|
1841 | case 16:
|
1842 | return 28;
|
1843 | break;
|
1844 | case 17:
|
1845 | return 26;
|
1846 | break;
|
1847 | case 18:
|
1848 | return 30;
|
1849 | break;
|
1850 | case 19:
|
1851 | return 31;
|
1852 | break;
|
1853 | case 20:
|
1854 | return 13;
|
1855 | break;
|
1856 | case 21:
|
1857 | return 43;
|
1858 | break;
|
1859 | case 22:
|
1860 | return 'DOT';
|
1861 | break;
|
1862 | case 23:
|
1863 | return 'PLUS';
|
1864 | break;
|
1865 | case 24:
|
1866 | return 40;
|
1867 | break;
|
1868 | case 25:
|
1869 | return 'EQUALS';
|
1870 | break;
|
1871 | case 26:
|
1872 | return 'EQUALS';
|
1873 | break;
|
1874 | case 27:
|
1875 | return 47;
|
1876 | break;
|
1877 | case 28:
|
1878 | return 'PUNCTUATION';
|
1879 | break;
|
1880 | case 29:
|
1881 | return 46;
|
1882 | break;
|
1883 | case 30:
|
1884 | return 45;
|
1885 | break;
|
1886 | case 31:
|
1887 | return 42;
|
1888 | break;
|
1889 | case 32:
|
1890 | return 8;
|
1891 | break;
|
1892 | }
|
1893 | },
|
1894 | rules: [/^(?:%%[^\n]*)/, /^(?:\n+)/, /^(?:\s+)/, /^(?:classDiagram\b)/, /^(?:[\{])/, /^(?:\})/, /^(?:[\n])/, /^(?:[^\{\}\n]*)/, /^(?:class\b)/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:--)/, /^(?:\.\.)/, /^(?::[^#\n;]+)/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:[A-Za-z]+)/, /^(?:[!"#$%&'*+,-.`?\\_\/])/, /^(?:[0-9]+)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\s)/, /^(?:$)/],
|
1895 | conditions: { "string": { "rules": [10, 11], "inclusive": false }, "struct": { "rules": [5, 6, 7], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], "inclusive": true } }
|
1896 | };
|
1897 | return lexer;
|
1898 | }();
|
1899 | parser.lexer = lexer;
|
1900 | function Parser() {
|
1901 | this.yy = {};
|
1902 | }
|
1903 | Parser.prototype = parser;parser.Parser = Parser;
|
1904 | return new Parser();
|
1905 | }();
|
1906 |
|
1907 | if (true) {
|
1908 | exports.parser = parser;
|
1909 | exports.Parser = parser.Parser;
|
1910 | exports.parse = function () {
|
1911 | return parser.parse.apply(parser, arguments);
|
1912 | };
|
1913 | exports.main = function commonjsMain(args) {
|
1914 | if (!args[1]) {
|
1915 | console.log('Usage: ' + args[0] + ' FILE');
|
1916 | process.exit(1);
|
1917 | }
|
1918 | var source = __webpack_require__( "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__( "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
|
1919 | return exports.parser.parse(source);
|
1920 | };
|
1921 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
1922 | exports.main(process.argv.slice(1));
|
1923 | }
|
1924 | }
|
1925 | }.call(this, __webpack_require__( "./node_modules/process/browser.js"), __webpack_require__( "./node_modules/webpack/buildin/module.js")(module)))
|
1926 |
|
1927 | }),
|
1928 |
|
1929 | "./src/diagrams/flowchart/flowDb.js":
|
1930 |
|
1931 |
|
1932 |
|
1933 |
|
1934 | (function(module, exports, __webpack_require__) {
|
1935 |
|
1936 | "use strict";
|
1937 |
|
1938 |
|
1939 | Object.defineProperty(exports, "__esModule", {
|
1940 | value: true
|
1941 | });
|
1942 | exports.getSubGraphs = exports.indexNodes = exports.getDepthFirstPos = exports.addSubGraph = exports.defaultStyle = exports.clear = exports.getClasses = exports.getEdges = exports.getVertices = exports.getDirection = exports.bindFunctions = exports.setClickEvent = exports.getTooltip = exports.setClass = exports.setDirection = exports.addClass = exports.updateLink = exports.updateLinkInterpolate = exports.addLink = exports.addVertex = undefined;
|
1943 |
|
1944 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
1945 |
|
1946 | var _d = __webpack_require__( "d3");
|
1947 |
|
1948 | var d3 = _interopRequireWildcard(_d);
|
1949 |
|
1950 | var _logger = __webpack_require__( "./src/logger.js");
|
1951 |
|
1952 | var _utils = __webpack_require__( "./src/utils.js");
|
1953 |
|
1954 | var _utils2 = _interopRequireDefault(_utils);
|
1955 |
|
1956 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1957 |
|
1958 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
1959 |
|
1960 | var vertices = {};
|
1961 | var edges = [];
|
1962 | var classes = [];
|
1963 | var subGraphs = [];
|
1964 | var tooltips = {};
|
1965 | var subCount = 0;
|
1966 | var direction = void 0;
|
1967 |
|
1968 | var funs = [];
|
1969 |
|
1970 |
|
1971 |
|
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 | var addVertex = exports.addVertex = function addVertex(id, text, type, style) {
|
1977 | var txt = void 0;
|
1978 |
|
1979 | if (typeof id === 'undefined') {
|
1980 | return;
|
1981 | }
|
1982 | if (id.trim().length === 0) {
|
1983 | return;
|
1984 | }
|
1985 |
|
1986 | if (typeof vertices[id] === 'undefined') {
|
1987 | vertices[id] = { id: id, styles: [], classes: [] };
|
1988 | }
|
1989 | if (typeof text !== 'undefined') {
|
1990 | txt = text.trim();
|
1991 |
|
1992 |
|
1993 | if (txt[0] === '"' && txt[txt.length - 1] === '"') {
|
1994 | txt = txt.substring(1, txt.length - 1);
|
1995 | }
|
1996 |
|
1997 | vertices[id].text = txt;
|
1998 | }
|
1999 | if (typeof type !== 'undefined') {
|
2000 | vertices[id].type = type;
|
2001 | }
|
2002 | if (typeof type !== 'undefined') {
|
2003 | vertices[id].type = type;
|
2004 | }
|
2005 | if (typeof style !== 'undefined') {
|
2006 | if (style !== null) {
|
2007 | style.forEach(function (s) {
|
2008 | vertices[id].styles.push(s);
|
2009 | });
|
2010 | }
|
2011 | }
|
2012 | };
|
2013 |
|
2014 |
|
2015 |
|
2016 |
|
2017 |
|
2018 |
|
2019 |
|
2020 |
|
2021 | var addLink = exports.addLink = function addLink(start, end, type, linktext) {
|
2022 | _logger.logger.info('Got edge...', start, end);
|
2023 | var edge = { start: start, end: end, type: undefined, text: '' };
|
2024 | linktext = type.text;
|
2025 |
|
2026 | if (typeof linktext !== 'undefined') {
|
2027 | edge.text = linktext.trim();
|
2028 |
|
2029 |
|
2030 | if (edge.text[0] === '"' && edge.text[edge.text.length - 1] === '"') {
|
2031 | edge.text = edge.text.substring(1, edge.text.length - 1);
|
2032 | }
|
2033 | }
|
2034 |
|
2035 | if (typeof type !== 'undefined') {
|
2036 | edge.type = type.type;
|
2037 | edge.stroke = type.stroke;
|
2038 | }
|
2039 | edges.push(edge);
|
2040 | };
|
2041 |
|
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 |
|
2047 | var updateLinkInterpolate = exports.updateLinkInterpolate = function updateLinkInterpolate(pos, interp) {
|
2048 | if (pos === 'default') {
|
2049 | edges.defaultInterpolate = interp;
|
2050 | } else {
|
2051 | edges[pos].interpolate = interp;
|
2052 | }
|
2053 | };
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 |
|
2059 |
|
2060 | var updateLink = exports.updateLink = function updateLink(pos, style) {
|
2061 | if (pos === 'default') {
|
2062 | edges.defaultStyle = style;
|
2063 | } else {
|
2064 | if (_utils2.default.isSubstringInArray('fill', style) === -1) {
|
2065 | style.push('fill:none');
|
2066 | }
|
2067 | edges[pos].style = style;
|
2068 | }
|
2069 | };
|
2070 |
|
2071 | var addClass = exports.addClass = function addClass(id, style) {
|
2072 | if (typeof classes[id] === 'undefined') {
|
2073 | classes[id] = { id: id, styles: [] };
|
2074 | }
|
2075 |
|
2076 | if (typeof style !== 'undefined') {
|
2077 | if (style !== null) {
|
2078 | style.forEach(function (s) {
|
2079 | classes[id].styles.push(s);
|
2080 | });
|
2081 | }
|
2082 | }
|
2083 | };
|
2084 |
|
2085 |
|
2086 |
|
2087 |
|
2088 |
|
2089 | var setDirection = exports.setDirection = function setDirection(dir) {
|
2090 | direction = dir;
|
2091 | };
|
2092 |
|
2093 |
|
2094 |
|
2095 |
|
2096 |
|
2097 | var setClass = exports.setClass = function setClass(id, className) {
|
2098 | if (id.indexOf(',') > 0) {
|
2099 | id.split(',').forEach(function (id2) {
|
2100 | if (typeof vertices[id2] !== 'undefined') {
|
2101 | vertices[id2].classes.push(className);
|
2102 | }
|
2103 | });
|
2104 | } else {
|
2105 | if (typeof vertices[id] !== 'undefined') {
|
2106 | vertices[id].classes.push(className);
|
2107 | }
|
2108 | }
|
2109 | };
|
2110 |
|
2111 | var setTooltip = function setTooltip(id, tooltip) {
|
2112 | if (typeof tooltip !== 'undefined') {
|
2113 | tooltips[id] = tooltip;
|
2114 | }
|
2115 | };
|
2116 |
|
2117 | var setClickFun = function setClickFun(id, functionName) {
|
2118 | if (typeof functionName === 'undefined') {
|
2119 | return;
|
2120 | }
|
2121 | if (typeof vertices[id] !== 'undefined') {
|
2122 | funs.push(function (element) {
|
2123 | var elem = d3.select(element).select('[id="' + id + '"]');
|
2124 | if (elem !== null) {
|
2125 | elem.on('click', function () {
|
2126 | window[functionName](id);
|
2127 | });
|
2128 | }
|
2129 | });
|
2130 | }
|
2131 | };
|
2132 |
|
2133 | var setLink = function setLink(id, linkStr) {
|
2134 | if (typeof linkStr === 'undefined') {
|
2135 | return;
|
2136 | }
|
2137 | if (typeof vertices[id] !== 'undefined') {
|
2138 | funs.push(function (element) {
|
2139 | var elem = d3.select(element).select('[id="' + id + '"]');
|
2140 | if (elem !== null) {
|
2141 | elem.on('click', function () {
|
2142 | window.open(linkStr, 'newTab');
|
2143 | });
|
2144 | }
|
2145 | });
|
2146 | }
|
2147 | };
|
2148 | var getTooltip = exports.getTooltip = function getTooltip(id) {
|
2149 | return tooltips[id];
|
2150 | };
|
2151 |
|
2152 |
|
2153 |
|
2154 |
|
2155 |
|
2156 | var setClickEvent = exports.setClickEvent = function setClickEvent(id, functionName, link, tooltip) {
|
2157 | if (id.indexOf(',') > 0) {
|
2158 | id.split(',').forEach(function (id2) {
|
2159 | setTooltip(id2, tooltip);
|
2160 | setClickFun(id2, functionName);
|
2161 | setLink(id2, link);
|
2162 | setClass(id, 'clickable');
|
2163 | });
|
2164 | } else {
|
2165 | setTooltip(id, tooltip);
|
2166 | setClickFun(id, functionName);
|
2167 | setLink(id, link);
|
2168 | setClass(id, 'clickable');
|
2169 | }
|
2170 | };
|
2171 |
|
2172 | var bindFunctions = exports.bindFunctions = function bindFunctions(element) {
|
2173 | funs.forEach(function (fun) {
|
2174 | fun(element);
|
2175 | });
|
2176 | };
|
2177 | var getDirection = exports.getDirection = function getDirection() {
|
2178 | return direction;
|
2179 | };
|
2180 |
|
2181 |
|
2182 |
|
2183 |
|
2184 | var getVertices = exports.getVertices = function getVertices() {
|
2185 | return vertices;
|
2186 | };
|
2187 |
|
2188 |
|
2189 |
|
2190 |
|
2191 |
|
2192 | var getEdges = exports.getEdges = function getEdges() {
|
2193 | return edges;
|
2194 | };
|
2195 |
|
2196 |
|
2197 |
|
2198 |
|
2199 |
|
2200 | var getClasses = exports.getClasses = function getClasses() {
|
2201 | return classes;
|
2202 | };
|
2203 |
|
2204 | var setupToolTips = function setupToolTips(element) {
|
2205 | var tooltipElem = d3.select('.mermaidTooltip');
|
2206 | if ((tooltipElem._groups || tooltipElem)[0][0] === null) {
|
2207 | tooltipElem = d3.select('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0);
|
2208 | }
|
2209 |
|
2210 | var svg = d3.select(element).select('svg');
|
2211 |
|
2212 | var nodes = svg.selectAll('g.node');
|
2213 | nodes.on('mouseover', function () {
|
2214 | var el = d3.select(this);
|
2215 | var title = el.attr('title');
|
2216 |
|
2217 | if (title === null) {
|
2218 | return;
|
2219 | }
|
2220 | var rect = this.getBoundingClientRect();
|
2221 |
|
2222 | tooltipElem.transition().duration(200).style('opacity', '.9');
|
2223 | tooltipElem.html(el.attr('title')).style('left', rect.left + (rect.right - rect.left) / 2 + 'px').style('top', rect.top - 14 + document.body.scrollTop + 'px');
|
2224 | el.classed('hover', true);
|
2225 | }).on('mouseout', function () {
|
2226 | tooltipElem.transition().duration(500).style('opacity', 0);
|
2227 | var el = d3.select(this);
|
2228 | el.classed('hover', false);
|
2229 | });
|
2230 | };
|
2231 | funs.push(setupToolTips);
|
2232 |
|
2233 |
|
2234 |
|
2235 |
|
2236 | var clear = exports.clear = function clear() {
|
2237 | vertices = {};
|
2238 | classes = {};
|
2239 | edges = [];
|
2240 | funs = [];
|
2241 | funs.push(setupToolTips);
|
2242 | subGraphs = [];
|
2243 | subCount = 0;
|
2244 | tooltips = [];
|
2245 | };
|
2246 |
|
2247 |
|
2248 |
|
2249 |
|
2250 | var defaultStyle = exports.defaultStyle = function defaultStyle() {
|
2251 | return 'fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;';
|
2252 | };
|
2253 |
|
2254 |
|
2255 |
|
2256 |
|
2257 | var addSubGraph = exports.addSubGraph = function addSubGraph(list, title) {
|
2258 | function uniq(a) {
|
2259 | var prims = { 'boolean': {}, 'number': {}, 'string': {} };
|
2260 | var objs = [];
|
2261 |
|
2262 | return a.filter(function (item) {
|
2263 | var type = typeof item === 'undefined' ? 'undefined' : _typeof(item);
|
2264 | if (item.trim() === '') {
|
2265 | return false;
|
2266 | }
|
2267 | if (type in prims) {
|
2268 | return prims[type].hasOwnProperty(item) ? false : prims[type][item] = true;
|
2269 | } else {
|
2270 | return objs.indexOf(item) >= 0 ? false : objs.push(item);
|
2271 | }
|
2272 | });
|
2273 | }
|
2274 |
|
2275 | var nodeList = [];
|
2276 |
|
2277 | nodeList = uniq(nodeList.concat.apply(nodeList, list));
|
2278 |
|
2279 | var subGraph = { id: 'subGraph' + subCount, nodes: nodeList, title: title.trim() };
|
2280 | subGraphs.push(subGraph);
|
2281 | subCount = subCount + 1;
|
2282 | return subGraph.id;
|
2283 | };
|
2284 |
|
2285 | var getPosForId = function getPosForId(id) {
|
2286 | for (var i = 0; i < subGraphs.length; i++) {
|
2287 | if (subGraphs[i].id === id) {
|
2288 | return i;
|
2289 | }
|
2290 | }
|
2291 | return -1;
|
2292 | };
|
2293 | var secCount = -1;
|
2294 | var posCrossRef = [];
|
2295 | var indexNodes2 = function indexNodes2(id, pos) {
|
2296 | var nodes = subGraphs[pos].nodes;
|
2297 | secCount = secCount + 1;
|
2298 | if (secCount > 2000) {
|
2299 | return;
|
2300 | }
|
2301 | posCrossRef[secCount] = pos;
|
2302 |
|
2303 | if (subGraphs[pos].id === id) {
|
2304 | return {
|
2305 | result: true,
|
2306 | count: 0
|
2307 | };
|
2308 | }
|
2309 |
|
2310 | var count = 0;
|
2311 | var posCount = 1;
|
2312 | while (count < nodes.length) {
|
2313 | var childPos = getPosForId(nodes[count]);
|
2314 |
|
2315 | if (childPos >= 0) {
|
2316 | var res = indexNodes2(id, childPos);
|
2317 | if (res.result) {
|
2318 | return {
|
2319 | result: true,
|
2320 | count: posCount + res.count
|
2321 | };
|
2322 | } else {
|
2323 | posCount = posCount + res.count;
|
2324 | }
|
2325 | }
|
2326 | count = count + 1;
|
2327 | }
|
2328 |
|
2329 | return {
|
2330 | result: false,
|
2331 | count: posCount
|
2332 | };
|
2333 | };
|
2334 |
|
2335 | var getDepthFirstPos = exports.getDepthFirstPos = function getDepthFirstPos(pos) {
|
2336 | return posCrossRef[pos];
|
2337 | };
|
2338 | var indexNodes = exports.indexNodes = function indexNodes() {
|
2339 | secCount = -1;
|
2340 | if (subGraphs.length > 0) {
|
2341 | indexNodes2('none', subGraphs.length - 1, 0);
|
2342 | }
|
2343 | };
|
2344 |
|
2345 | var getSubGraphs = exports.getSubGraphs = function getSubGraphs() {
|
2346 | return subGraphs;
|
2347 | };
|
2348 |
|
2349 | exports.default = {
|
2350 | addVertex: addVertex,
|
2351 | addLink: addLink,
|
2352 | updateLinkInterpolate: updateLinkInterpolate,
|
2353 | updateLink: updateLink,
|
2354 | addClass: addClass,
|
2355 | setDirection: setDirection,
|
2356 | setClass: setClass,
|
2357 | getTooltip: getTooltip,
|
2358 | setClickEvent: setClickEvent,
|
2359 | bindFunctions: bindFunctions,
|
2360 | getDirection: getDirection,
|
2361 | getVertices: getVertices,
|
2362 | getEdges: getEdges,
|
2363 | getClasses: getClasses,
|
2364 | clear: clear,
|
2365 | defaultStyle: defaultStyle,
|
2366 | addSubGraph: addSubGraph,
|
2367 | getDepthFirstPos: getDepthFirstPos,
|
2368 | indexNodes: indexNodes,
|
2369 | getSubGraphs: getSubGraphs
|
2370 | };
|
2371 |
|
2372 | }),
|
2373 |
|
2374 | "./src/diagrams/flowchart/flowRenderer.js":
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 | (function(module, exports, __webpack_require__) {
|
2380 |
|
2381 | "use strict";
|
2382 |
|
2383 |
|
2384 | Object.defineProperty(exports, "__esModule", {
|
2385 | value: true
|
2386 | });
|
2387 | exports.draw = exports.getClasses = exports.addEdges = exports.addVertices = exports.setConf = undefined;
|
2388 |
|
2389 | var _graphlibrary = __webpack_require__( "graphlibrary");
|
2390 |
|
2391 | var _graphlibrary2 = _interopRequireDefault(_graphlibrary);
|
2392 |
|
2393 | var _d = __webpack_require__( "d3");
|
2394 |
|
2395 | var d3 = _interopRequireWildcard(_d);
|
2396 |
|
2397 | var _flowDb = __webpack_require__( "./src/diagrams/flowchart/flowDb.js");
|
2398 |
|
2399 | var _flowDb2 = _interopRequireDefault(_flowDb);
|
2400 |
|
2401 | var _flow = __webpack_require__( "./src/diagrams/flowchart/parser/flow.js");
|
2402 |
|
2403 | var _flow2 = _interopRequireDefault(_flow);
|
2404 |
|
2405 | var _dagreD3Renderer = __webpack_require__( "dagre-d3-renderer");
|
2406 |
|
2407 | var _dagreD3Renderer2 = _interopRequireDefault(_dagreD3Renderer);
|
2408 |
|
2409 | var _logger = __webpack_require__( "./src/logger.js");
|
2410 |
|
2411 | var _utils = __webpack_require__( "./src/utils.js");
|
2412 |
|
2413 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
2414 |
|
2415 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2416 |
|
2417 | var conf = {};
|
2418 | var setConf = exports.setConf = function setConf(cnf) {
|
2419 | var keys = Object.keys(cnf);
|
2420 | for (var i = 0; i < keys.length; i++) {
|
2421 | conf[keys[i]] = cnf[keys[i]];
|
2422 | }
|
2423 | };
|
2424 |
|
2425 |
|
2426 |
|
2427 |
|
2428 |
|
2429 |
|
2430 | var addVertices = exports.addVertices = function addVertices(vert, g) {
|
2431 | var keys = Object.keys(vert);
|
2432 |
|
2433 | var styleFromStyleArr = function styleFromStyleArr(styleStr, arr) {
|
2434 |
|
2435 | for (var i = 0; i < arr.length; i++) {
|
2436 | if (typeof arr[i] !== 'undefined') {
|
2437 | styleStr = styleStr + arr[i] + ';';
|
2438 | }
|
2439 | }
|
2440 |
|
2441 | return styleStr;
|
2442 | };
|
2443 |
|
2444 |
|
2445 | keys.forEach(function (id) {
|
2446 | var vertice = vert[id];
|
2447 | var verticeText = void 0;
|
2448 |
|
2449 | |
2450 |
|
2451 |
|
2452 |
|
2453 | var classStr = '';
|
2454 | if (vertice.classes.length > 0) {
|
2455 | classStr = vertice.classes.join(' ');
|
2456 | }
|
2457 |
|
2458 | |
2459 |
|
2460 |
|
2461 |
|
2462 | var style = '';
|
2463 |
|
2464 | style = styleFromStyleArr(style, vertice.styles);
|
2465 |
|
2466 |
|
2467 | if (typeof vertice.text === 'undefined') {
|
2468 | verticeText = vertice.id;
|
2469 | } else {
|
2470 | verticeText = vertice.text;
|
2471 | }
|
2472 |
|
2473 | var labelTypeStr = '';
|
2474 | if (conf.htmlLabels) {
|
2475 | labelTypeStr = 'html';
|
2476 | verticeText = verticeText.replace(/fa:fa[\w-]+/g, function (s) {
|
2477 | return '<i class="fa ' + s.substring(3) + '"></i>';
|
2478 | });
|
2479 | } else {
|
2480 | var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');
|
2481 |
|
2482 | var rows = verticeText.split(/<br>/);
|
2483 |
|
2484 | for (var j = 0; j < rows.length; j++) {
|
2485 | var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');
|
2486 | tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
|
2487 | tspan.setAttribute('dy', '1em');
|
2488 | tspan.setAttribute('x', '1');
|
2489 | tspan.textContent = rows[j];
|
2490 | svgLabel.appendChild(tspan);
|
2491 | }
|
2492 |
|
2493 | labelTypeStr = 'svg';
|
2494 | verticeText = svgLabel;
|
2495 | }
|
2496 |
|
2497 | var radious = 0;
|
2498 | var _shape = '';
|
2499 |
|
2500 | switch (vertice.type) {
|
2501 | case 'round':
|
2502 | radious = 5;
|
2503 | _shape = 'rect';
|
2504 | break;
|
2505 | case 'square':
|
2506 | _shape = 'rect';
|
2507 | break;
|
2508 | case 'diamond':
|
2509 | _shape = 'question';
|
2510 | break;
|
2511 | case 'odd':
|
2512 | _shape = 'rect_left_inv_arrow';
|
2513 | break;
|
2514 | case 'odd_right':
|
2515 | _shape = 'rect_left_inv_arrow';
|
2516 | break;
|
2517 | case 'circle':
|
2518 | _shape = 'circle';
|
2519 | break;
|
2520 | case 'ellipse':
|
2521 | _shape = 'ellipse';
|
2522 | break;
|
2523 | case 'group':
|
2524 | _shape = 'rect';
|
2525 |
|
2526 | verticeText = conf.htmlLabels ? '' : document.createElementNS('http://www.w3.org/2000/svg', 'text');
|
2527 | break;
|
2528 | default:
|
2529 | _shape = 'rect';
|
2530 | }
|
2531 |
|
2532 | g.setNode(vertice.id, { labelType: labelTypeStr, shape: _shape, label: verticeText, rx: radious, ry: radious, 'class': classStr, style: style, id: vertice.id });
|
2533 | });
|
2534 | };
|
2535 |
|
2536 |
|
2537 |
|
2538 |
|
2539 |
|
2540 |
|
2541 | var addEdges = exports.addEdges = function addEdges(edges, g) {
|
2542 | var cnt = 0;
|
2543 |
|
2544 | var defaultStyle = void 0;
|
2545 | if (typeof edges.defaultStyle !== 'undefined') {
|
2546 | defaultStyle = edges.defaultStyle.toString().replace(/,/g, ';');
|
2547 | }
|
2548 |
|
2549 | edges.forEach(function (edge) {
|
2550 | cnt++;
|
2551 | var edgeData = {};
|
2552 |
|
2553 |
|
2554 | if (edge.type === 'arrow_open') {
|
2555 | edgeData.arrowhead = 'none';
|
2556 | } else {
|
2557 | edgeData.arrowhead = 'normal';
|
2558 | }
|
2559 |
|
2560 | var style = '';
|
2561 | if (typeof edge.style !== 'undefined') {
|
2562 | edge.style.forEach(function (s) {
|
2563 | style = style + s + ';';
|
2564 | });
|
2565 | } else {
|
2566 | switch (edge.stroke) {
|
2567 | case 'normal':
|
2568 | style = 'fill:none';
|
2569 | if (typeof defaultStyle !== 'undefined') {
|
2570 | style = defaultStyle;
|
2571 | }
|
2572 | break;
|
2573 | case 'dotted':
|
2574 | style = 'stroke: #333; fill:none;stroke-width:2px;stroke-dasharray:3;';
|
2575 | break;
|
2576 | case 'thick':
|
2577 | style = 'stroke: #333; stroke-width: 3.5px;fill:none';
|
2578 | break;
|
2579 | }
|
2580 | }
|
2581 | edgeData.style = style;
|
2582 |
|
2583 | if (typeof edge.interpolate !== 'undefined') {
|
2584 | edgeData.curve = (0, _utils.interpolateToCurve)(edge.interpolate, d3.curveLinear);
|
2585 | } else if (typeof edges.defaultInterpolate !== 'undefined') {
|
2586 | edgeData.curve = (0, _utils.interpolateToCurve)(edges.defaultInterpolate, d3.curveLinear);
|
2587 | } else {
|
2588 | edgeData.curve = (0, _utils.interpolateToCurve)(conf.curve, d3.curveLinear);
|
2589 | }
|
2590 |
|
2591 | if (typeof edge.text === 'undefined') {
|
2592 | if (typeof edge.style !== 'undefined') {
|
2593 | edgeData.arrowheadStyle = 'fill: #333';
|
2594 | }
|
2595 | } else {
|
2596 | edgeData.arrowheadStyle = 'fill: #333';
|
2597 | if (typeof edge.style === 'undefined') {
|
2598 | edgeData.labelpos = 'c';
|
2599 | if (conf.htmlLabels) {
|
2600 | edgeData.labelType = 'html';
|
2601 | edgeData.label = '<span class="edgeLabel">' + edge.text + '</span>';
|
2602 | } else {
|
2603 | edgeData.labelType = 'text';
|
2604 | edgeData.style = 'stroke: #333; stroke-width: 1.5px;fill:none';
|
2605 | edgeData.label = edge.text.replace(/<br>/g, '\n');
|
2606 | }
|
2607 | } else {
|
2608 | edgeData.label = edge.text.replace(/<br>/g, '\n');
|
2609 | }
|
2610 | }
|
2611 |
|
2612 | g.setEdge(edge.start, edge.end, edgeData, cnt);
|
2613 | });
|
2614 | };
|
2615 |
|
2616 |
|
2617 |
|
2618 |
|
2619 |
|
2620 | var getClasses = exports.getClasses = function getClasses(text) {
|
2621 | _flowDb2.default.clear();
|
2622 | var parser = _flow2.default.parser;
|
2623 | parser.yy = _flowDb2.default;
|
2624 |
|
2625 |
|
2626 | parser.parse(text);
|
2627 | return _flowDb2.default.getClasses();
|
2628 | };
|
2629 |
|
2630 |
|
2631 |
|
2632 |
|
2633 |
|
2634 |
|
2635 | var draw = exports.draw = function draw(text, id) {
|
2636 | _logger.logger.debug('Drawing flowchart');
|
2637 | _flowDb2.default.clear();
|
2638 | var parser = _flow2.default.parser;
|
2639 | parser.yy = _flowDb2.default;
|
2640 |
|
2641 |
|
2642 | try {
|
2643 | parser.parse(text);
|
2644 | } catch (err) {
|
2645 | _logger.logger.debug('Parsing failed');
|
2646 | }
|
2647 |
|
2648 |
|
2649 | var dir = _flowDb2.default.getDirection();
|
2650 | if (typeof dir === 'undefined') {
|
2651 | dir = 'TD';
|
2652 | }
|
2653 |
|
2654 |
|
2655 | var g = new _graphlibrary2.default.Graph({
|
2656 | multigraph: true,
|
2657 | compound: true
|
2658 | }).setGraph({
|
2659 | rankdir: dir,
|
2660 | marginx: 20,
|
2661 | marginy: 20
|
2662 |
|
2663 | }).setDefaultEdgeLabel(function () {
|
2664 | return {};
|
2665 | });
|
2666 |
|
2667 | var subG = void 0;
|
2668 | var subGraphs = _flowDb2.default.getSubGraphs();
|
2669 | for (var _i = subGraphs.length - 1; _i >= 0; _i--) {
|
2670 | subG = subGraphs[_i];
|
2671 | _flowDb2.default.addVertex(subG.id, subG.title, 'group', undefined);
|
2672 | }
|
2673 |
|
2674 |
|
2675 | var vert = _flowDb2.default.getVertices();
|
2676 |
|
2677 | var edges = _flowDb2.default.getEdges();
|
2678 |
|
2679 | var i = 0;
|
2680 | for (i = subGraphs.length - 1; i >= 0; i--) {
|
2681 | subG = subGraphs[i];
|
2682 |
|
2683 | d3.selectAll('cluster').append('text');
|
2684 |
|
2685 | for (var j = 0; j < subG.nodes.length; j++) {
|
2686 | g.setParent(subG.nodes[j], subG.id);
|
2687 | }
|
2688 | }
|
2689 | addVertices(vert, g);
|
2690 | addEdges(edges, g);
|
2691 |
|
2692 |
|
2693 | var Render = _dagreD3Renderer2.default.render;
|
2694 | var render = new Render();
|
2695 |
|
2696 |
|
2697 | render.shapes().question = function (parent, bbox, node) {
|
2698 | var w = bbox.width;
|
2699 | var h = bbox.height;
|
2700 | var s = (w + h) * 0.9;
|
2701 | var points = [{ x: s / 2, y: 0 }, { x: s, y: -s / 2 }, { x: s / 2, y: -s }, { x: 0, y: -s / 2 }];
|
2702 | var shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
|
2703 | return d.x + ',' + d.y;
|
2704 | }).join(' ')).attr('rx', 5).attr('ry', 5).attr('transform', 'translate(' + -s / 2 + ',' + s * 2 / 4 + ')');
|
2705 | node.intersect = function (point) {
|
2706 | return _dagreD3Renderer2.default.intersect.polygon(node, points, point);
|
2707 | };
|
2708 | return shapeSvg;
|
2709 | };
|
2710 |
|
2711 |
|
2712 | render.shapes().rect_left_inv_arrow = function (parent, bbox, node) {
|
2713 | var w = bbox.width;
|
2714 | var h = bbox.height;
|
2715 | var points = [{ x: -h / 2, y: 0 }, { x: w, y: 0 }, { x: w, y: -h }, { x: -h / 2, y: -h }, { x: 0, y: -h / 2 }];
|
2716 | var shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
|
2717 | return d.x + ',' + d.y;
|
2718 | }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
|
2719 | node.intersect = function (point) {
|
2720 | return _dagreD3Renderer2.default.intersect.polygon(node, points, point);
|
2721 | };
|
2722 | return shapeSvg;
|
2723 | };
|
2724 |
|
2725 |
|
2726 | render.shapes().rect_right_inv_arrow = function (parent, bbox, node) {
|
2727 | var w = bbox.width;
|
2728 | var h = bbox.height;
|
2729 | var points = [{ x: 0, y: 0 }, { x: w + h / 2, y: 0 }, { x: w, y: -h / 2 }, { x: w + h / 2, y: -h }, { x: 0, y: -h }];
|
2730 | var shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
|
2731 | return d.x + ',' + d.y;
|
2732 | }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
|
2733 | node.intersect = function (point) {
|
2734 | return _dagreD3Renderer2.default.intersect.polygon(node, points, point);
|
2735 | };
|
2736 | return shapeSvg;
|
2737 | };
|
2738 |
|
2739 |
|
2740 | render.arrows().none = function normal(parent, id, edge, type) {
|
2741 | var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto');
|
2742 |
|
2743 | var path = marker.append('path').attr('d', 'M 0 0 L 0 0 L 0 0 z');
|
2744 | _dagreD3Renderer2.default.util.applyStyle(path, edge[type + 'Style']);
|
2745 | };
|
2746 |
|
2747 |
|
2748 | render.arrows().normal = function normal(parent, id, edge, type) {
|
2749 | var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto');
|
2750 |
|
2751 | marker.append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z').attr('class', 'arrowheadPath').style('stroke-width', 1).style('stroke-dasharray', '1,0');
|
2752 | };
|
2753 |
|
2754 |
|
2755 | var svg = d3.select('[id="' + id + '"]');
|
2756 |
|
2757 |
|
2758 | var element = d3.select('#' + id + ' g');
|
2759 | render(element, g);
|
2760 |
|
2761 | element.selectAll('g.node').attr('title', function () {
|
2762 | return _flowDb2.default.getTooltip(this.id);
|
2763 | });
|
2764 |
|
2765 | var padding = 8;
|
2766 | var width = g.maxX - g.minX + padding * 2;
|
2767 | var height = g.maxY - g.minY + padding * 2;
|
2768 | svg.attr('width', '100%');
|
2769 | svg.attr('style', 'max-width: ' + width + 'px;');
|
2770 | svg.attr('viewBox', '0 0 ' + width + ' ' + height);
|
2771 | svg.select('g').attr('transform', 'translate(' + (padding - g.minX) + ', ' + (padding - g.minY) + ')');
|
2772 |
|
2773 |
|
2774 | _flowDb2.default.indexNodes('subGraph' + i);
|
2775 |
|
2776 | for (i = 0; i < subGraphs.length; i++) {
|
2777 | subG = subGraphs[i];
|
2778 |
|
2779 | if (subG.title !== 'undefined') {
|
2780 | var clusterRects = document.querySelectorAll('#' + id + ' #' + subG.id + ' rect');
|
2781 | var clusterEl = document.querySelectorAll('#' + id + ' #' + subG.id);
|
2782 |
|
2783 | var xPos = clusterRects[0].x.baseVal.value;
|
2784 | var yPos = clusterRects[0].y.baseVal.value;
|
2785 | var _width = clusterRects[0].width.baseVal.value;
|
2786 | var cluster = d3.select(clusterEl[0]);
|
2787 | var te = cluster.append('text');
|
2788 | te.attr('x', xPos + _width / 2);
|
2789 | te.attr('y', yPos + 14);
|
2790 | te.attr('fill', 'black');
|
2791 | te.attr('stroke', 'none');
|
2792 | te.attr('id', id + 'Text');
|
2793 | te.style('text-anchor', 'middle');
|
2794 |
|
2795 | if (typeof subG.title === 'undefined') {
|
2796 | te.text('Undef');
|
2797 | } else {
|
2798 | te.text(subG.title);
|
2799 | }
|
2800 | }
|
2801 | }
|
2802 |
|
2803 |
|
2804 | if (!conf.htmlLabels) {
|
2805 | var labels = document.querySelectorAll('#' + id + ' .edgeLabel .label');
|
2806 | for (var k = 0; k < labels.length; k++) {
|
2807 | var label = labels[k];
|
2808 |
|
2809 |
|
2810 | var dim = label.getBBox();
|
2811 |
|
2812 | var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
|
2813 | rect.setAttribute('rx', 0);
|
2814 | rect.setAttribute('ry', 0);
|
2815 | rect.setAttribute('width', dim.width);
|
2816 | rect.setAttribute('height', dim.height);
|
2817 | rect.setAttribute('style', 'fill:#e8e8e8;');
|
2818 |
|
2819 | label.insertBefore(rect, label.firstChild);
|
2820 | }
|
2821 | }
|
2822 | };
|
2823 |
|
2824 | exports.default = {
|
2825 | setConf: setConf,
|
2826 | addVertices: addVertices,
|
2827 | addEdges: addEdges,
|
2828 | getClasses: getClasses,
|
2829 | draw: draw
|
2830 | };
|
2831 |
|
2832 | }),
|
2833 |
|
2834 | "./src/diagrams/flowchart/parser/flow.js":
|
2835 |
|
2836 |
|
2837 |
|
2838 |
|
2839 | (function(module, exports, __webpack_require__) {
|
2840 |
|
2841 | "use strict";
|
2842 | (function(process, module) {
|
2843 |
|
2844 |
|
2845 |
|
2846 |
|
2847 |
|
2848 |
|
2849 |
|
2850 |
|
2851 |
|
2852 |
|
2853 |
|
2854 |
|
2855 |
|
2856 |
|
2857 |
|
2858 |
|
2859 |
|
2860 |
|
2861 |
|
2862 |
|
2863 |
|
2864 |
|
2865 |
|
2866 |
|
2867 |
|
2868 |
|
2869 |
|
2870 |
|
2871 |
|
2872 |
|
2873 |
|
2874 |
|
2875 |
|
2876 |
|
2877 |
|
2878 |
|
2879 |
|
2880 |
|
2881 |
|
2882 |
|
2883 |
|
2884 |
|
2885 |
|
2886 |
|
2887 |
|
2888 |
|
2889 |
|
2890 |
|
2891 |
|
2892 |
|
2893 |
|
2894 |
|
2895 |
|
2896 |
|
2897 |
|
2898 |
|
2899 |
|
2900 |
|
2901 |
|
2902 |
|
2903 |
|
2904 |
|
2905 |
|
2906 |
|
2907 |
|
2908 |
|
2909 |
|
2910 |
|
2911 |
|
2912 |
|
2913 |
|
2914 |
|
2915 |
|
2916 |
|
2917 | var parser = function () {
|
2918 | var o = function o(k, v, _o, l) {
|
2919 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
2920 | },
|
2921 | $V0 = [1, 4],
|
2922 | $V1 = [1, 3],
|
2923 | $V2 = [1, 5],
|
2924 | $V3 = [1, 8, 9, 10, 11, 13, 18, 30, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
2925 | $V4 = [2, 2],
|
2926 | $V5 = [1, 12],
|
2927 | $V6 = [1, 13],
|
2928 | $V7 = [1, 14],
|
2929 | $V8 = [1, 15],
|
2930 | $V9 = [1, 31],
|
2931 | $Va = [1, 33],
|
2932 | $Vb = [1, 22],
|
2933 | $Vc = [1, 34],
|
2934 | $Vd = [1, 24],
|
2935 | $Ve = [1, 25],
|
2936 | $Vf = [1, 26],
|
2937 | $Vg = [1, 27],
|
2938 | $Vh = [1, 28],
|
2939 | $Vi = [1, 38],
|
2940 | $Vj = [1, 40],
|
2941 | $Vk = [1, 35],
|
2942 | $Vl = [1, 39],
|
2943 | $Vm = [1, 45],
|
2944 | $Vn = [1, 44],
|
2945 | $Vo = [1, 36],
|
2946 | $Vp = [1, 37],
|
2947 | $Vq = [1, 41],
|
2948 | $Vr = [1, 42],
|
2949 | $Vs = [1, 43],
|
2950 | $Vt = [1, 8, 9, 10, 11, 13, 18, 30, 32, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
2951 | $Vu = [1, 53],
|
2952 | $Vv = [1, 52],
|
2953 | $Vw = [1, 54],
|
2954 | $Vx = [1, 72],
|
2955 | $Vy = [1, 80],
|
2956 | $Vz = [1, 81],
|
2957 | $VA = [1, 66],
|
2958 | $VB = [1, 65],
|
2959 | $VC = [1, 85],
|
2960 | $VD = [1, 84],
|
2961 | $VE = [1, 82],
|
2962 | $VF = [1, 83],
|
2963 | $VG = [1, 73],
|
2964 | $VH = [1, 68],
|
2965 | $VI = [1, 67],
|
2966 | $VJ = [1, 63],
|
2967 | $VK = [1, 75],
|
2968 | $VL = [1, 76],
|
2969 | $VM = [1, 77],
|
2970 | $VN = [1, 78],
|
2971 | $VO = [1, 79],
|
2972 | $VP = [1, 70],
|
2973 | $VQ = [1, 69],
|
2974 | $VR = [8, 9, 11],
|
2975 | $VS = [8, 9, 11, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64],
|
2976 | $VT = [1, 115],
|
2977 | $VU = [8, 9, 10, 11, 13, 15, 18, 36, 38, 40, 42, 46, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
2978 | $VV = [8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 30, 32, 36, 37, 38, 39, 40, 41, 42, 43, 46, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 71, 72, 73, 74, 75, 78, 81, 84, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
2979 | $VW = [1, 117],
|
2980 | $VX = [1, 118],
|
2981 | $VY = [8, 9, 10, 11, 13, 18, 30, 32, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
2982 | $VZ = [8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 30, 32, 37, 39, 41, 43, 46, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 71, 72, 73, 74, 75, 78, 81, 84, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
2983 | $V_ = [13, 18, 46, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
2984 | $V$ = [13, 18, 46, 49, 65, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98],
|
2985 | $V01 = [1, 191],
|
2986 | $V11 = [1, 188],
|
2987 | $V21 = [1, 195],
|
2988 | $V31 = [1, 192],
|
2989 | $V41 = [1, 189],
|
2990 | $V51 = [1, 196],
|
2991 | $V61 = [1, 186],
|
2992 | $V71 = [1, 187],
|
2993 | $V81 = [1, 190],
|
2994 | $V91 = [1, 193],
|
2995 | $Va1 = [1, 194],
|
2996 | $Vb1 = [1, 213],
|
2997 | $Vc1 = [8, 9, 11, 86],
|
2998 | $Vd1 = [8, 9, 10, 11, 46, 71, 80, 81, 84, 86, 88, 89, 90, 91, 92];
|
2999 | var parser = { trace: function trace() {},
|
3000 | yy: {},
|
3001 | symbols_: { "error": 2, "mermaidDoc": 3, "graphConfig": 4, "document": 5, "line": 6, "statement": 7, "SEMI": 8, "NEWLINE": 9, "SPACE": 10, "EOF": 11, "GRAPH": 12, "DIR": 13, "FirstStmtSeperator": 14, "TAGEND": 15, "TAGSTART": 16, "UP": 17, "DOWN": 18, "ending": 19, "endToken": 20, "spaceList": 21, "spaceListNewline": 22, "verticeStatement": 23, "separator": 24, "styleStatement": 25, "linkStyleStatement": 26, "classDefStatement": 27, "classStatement": 28, "clickStatement": 29, "subgraph": 30, "text": 31, "end": 32, "vertex": 33, "link": 34, "alphaNum": 35, "SQS": 36, "SQE": 37, "PS": 38, "PE": 39, "(-": 40, "-)": 41, "DIAMOND_START": 42, "DIAMOND_STOP": 43, "alphaNumStatement": 44, "alphaNumToken": 45, "MINUS": 46, "linkStatement": 47, "arrowText": 48, "TESTSTR": 49, "--": 50, "ARROW_POINT": 51, "ARROW_CIRCLE": 52, "ARROW_CROSS": 53, "ARROW_OPEN": 54, "-.": 55, "DOTTED_ARROW_POINT": 56, "DOTTED_ARROW_CIRCLE": 57, "DOTTED_ARROW_CROSS": 58, "DOTTED_ARROW_OPEN": 59, "==": 60, "THICK_ARROW_POINT": 61, "THICK_ARROW_CIRCLE": 62, "THICK_ARROW_CROSS": 63, "THICK_ARROW_OPEN": 64, "PIPE": 65, "textToken": 66, "STR": 67, "commentText": 68, "commentToken": 69, "keywords": 70, "STYLE": 71, "LINKSTYLE": 72, "CLASSDEF": 73, "CLASS": 74, "CLICK": 75, "textNoTags": 76, "textNoTagsToken": 77, "DEFAULT": 78, "stylesOpt": 79, "HEX": 80, "NUM": 81, "INTERPOLATE": 82, "commentStatement": 83, "PCT": 84, "style": 85, "COMMA": 86, "styleComponent": 87, "ALPHA": 88, "COLON": 89, "UNIT": 90, "BRKT": 91, "DOT": 92, "graphCodeTokens": 93, "PUNCTUATION": 94, "UNICODE_TEXT": 95, "PLUS": 96, "EQUALS": 97, "MULT": 98, "TAG_START": 99, "TAG_END": 100, "QUOTE": 101, "$accept": 0, "$end": 1 },
|
3002 | terminals_: { 2: "error", 8: "SEMI", 9: "NEWLINE", 10: "SPACE", 11: "EOF", 12: "GRAPH", 13: "DIR", 15: "TAGEND", 16: "TAGSTART", 17: "UP", 18: "DOWN", 30: "subgraph", 32: "end", 36: "SQS", 37: "SQE", 38: "PS", 39: "PE", 40: "(-", 41: "-)", 42: "DIAMOND_START", 43: "DIAMOND_STOP", 46: "MINUS", 49: "TESTSTR", 50: "--", 51: "ARROW_POINT", 52: "ARROW_CIRCLE", 53: "ARROW_CROSS", 54: "ARROW_OPEN", 55: "-.", 56: "DOTTED_ARROW_POINT", 57: "DOTTED_ARROW_CIRCLE", 58: "DOTTED_ARROW_CROSS", 59: "DOTTED_ARROW_OPEN", 60: "==", 61: "THICK_ARROW_POINT", 62: "THICK_ARROW_CIRCLE", 63: "THICK_ARROW_CROSS", 64: "THICK_ARROW_OPEN", 65: "PIPE", 67: "STR", 71: "STYLE", 72: "LINKSTYLE", 73: "CLASSDEF", 74: "CLASS", 75: "CLICK", 78: "DEFAULT", 80: "HEX", 81: "NUM", 82: "INTERPOLATE", 84: "PCT", 86: "COMMA", 88: "ALPHA", 89: "COLON", 90: "UNIT", 91: "BRKT", 92: "DOT", 94: "PUNCTUATION", 95: "UNICODE_TEXT", 96: "PLUS", 97: "EQUALS", 98: "MULT", 99: "TAG_START", 100: "TAG_END", 101: "QUOTE" },
|
3003 | productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [19, 2], [19, 1], [20, 1], [20, 1], [20, 1], [14, 1], [14, 1], [14, 2], [22, 2], [22, 2], [22, 1], [22, 1], [21, 2], [21, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 5], [7, 4], [24, 1], [24, 1], [24, 1], [23, 3], [23, 1], [33, 4], [33, 5], [33, 6], [33, 7], [33, 4], [33, 5], [33, 4], [33, 5], [33, 4], [33, 5], [33, 4], [33, 5], [33, 1], [33, 2], [35, 1], [35, 2], [44, 1], [44, 1], [44, 1], [44, 1], [34, 2], [34, 3], [34, 3], [34, 1], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [48, 3], [31, 1], [31, 2], [31, 1], [68, 1], [68, 2], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [76, 1], [76, 2], [27, 5], [27, 5], [28, 5], [29, 5], [29, 7], [29, 5], [29, 7], [25, 5], [25, 5], [26, 5], [26, 5], [26, 9], [26, 9], [26, 7], [26, 7], [83, 3], [79, 1], [79, 3], [85, 1], [85, 2], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [69, 1], [69, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [77, 1], [77, 1], [77, 1], [77, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1]],
|
3004 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
3005 |
|
3006 |
|
3007 | var $0 = $$.length - 1;
|
3008 | switch (yystate) {
|
3009 | case 2:
|
3010 | this.$ = [];
|
3011 | break;
|
3012 | case 3:
|
3013 |
|
3014 | if ($$[$0] !== []) {
|
3015 | $$[$0 - 1].push($$[$0]);
|
3016 | }
|
3017 | this.$ = $$[$0 - 1];
|
3018 | break;
|
3019 | case 4:case 57:case 59:case 60:case 92:case 94:case 95:case 108:
|
3020 | this.$ = $$[$0];
|
3021 | break;
|
3022 | case 11:
|
3023 | yy.setDirection($$[$0 - 1]);this.$ = $$[$0 - 1];
|
3024 | break;
|
3025 | case 12:
|
3026 | yy.setDirection("LR");this.$ = $$[$0 - 1];
|
3027 | break;
|
3028 | case 13:
|
3029 | yy.setDirection("RL");this.$ = $$[$0 - 1];
|
3030 | break;
|
3031 | case 14:
|
3032 | yy.setDirection("BT");this.$ = $$[$0 - 1];
|
3033 | break;
|
3034 | case 15:
|
3035 | yy.setDirection("TB");this.$ = $$[$0 - 1];
|
3036 | break;
|
3037 | case 30:
|
3038 | this.$ = $$[$0 - 1];
|
3039 | break;
|
3040 | case 31:case 32:case 33:case 34:case 35:
|
3041 | this.$ = [];
|
3042 | break;
|
3043 | case 36:
|
3044 | this.$ = yy.addSubGraph($$[$0 - 1], $$[$0 - 3]);
|
3045 | break;
|
3046 | case 37:
|
3047 | this.$ = yy.addSubGraph($$[$0 - 1], undefined);
|
3048 | break;
|
3049 | case 41:
|
3050 | yy.addLink($$[$0 - 2], $$[$0], $$[$0 - 1]);this.$ = [$$[$0 - 2], $$[$0]];
|
3051 | break;
|
3052 | case 42:
|
3053 | this.$ = [$$[$0]];
|
3054 | break;
|
3055 | case 43:
|
3056 | this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'square');
|
3057 | break;
|
3058 | case 44:
|
3059 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'square');
|
3060 | break;
|
3061 | case 45:
|
3062 | this.$ = $$[$0 - 5];yy.addVertex($$[$0 - 5], $$[$0 - 2], 'circle');
|
3063 | break;
|
3064 | case 46:
|
3065 | this.$ = $$[$0 - 6];yy.addVertex($$[$0 - 6], $$[$0 - 3], 'circle');
|
3066 | break;
|
3067 | case 47:
|
3068 | this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'ellipse');
|
3069 | break;
|
3070 | case 48:
|
3071 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'ellipse');
|
3072 | break;
|
3073 | case 49:
|
3074 | this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'round');
|
3075 | break;
|
3076 | case 50:
|
3077 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'round');
|
3078 | break;
|
3079 | case 51:
|
3080 | this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'diamond');
|
3081 | break;
|
3082 | case 52:
|
3083 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'diamond');
|
3084 | break;
|
3085 | case 53:
|
3086 | this.$ = $$[$0 - 3];yy.addVertex($$[$0 - 3], $$[$0 - 1], 'odd');
|
3087 | break;
|
3088 | case 54:
|
3089 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 4], $$[$0 - 2], 'odd');
|
3090 | break;
|
3091 | case 55:
|
3092 | this.$ = $$[$0];yy.addVertex($$[$0]);
|
3093 | break;
|
3094 | case 56:
|
3095 | this.$ = $$[$0 - 1];yy.addVertex($$[$0 - 1]);
|
3096 | break;
|
3097 | case 58:case 93:case 96:case 109:
|
3098 | this.$ = $$[$0 - 1] + '' + $$[$0];
|
3099 | break;
|
3100 | case 61:
|
3101 | this.$ = 'v';
|
3102 | break;
|
3103 | case 62:
|
3104 | this.$ = '-';
|
3105 | break;
|
3106 | case 63:
|
3107 | $$[$0 - 1].text = $$[$0];this.$ = $$[$0 - 1];
|
3108 | break;
|
3109 | case 64:case 65:
|
3110 | $$[$0 - 2].text = $$[$0 - 1];this.$ = $$[$0 - 2];
|
3111 | break;
|
3112 | case 66:
|
3113 | this.$ = $$[$0];
|
3114 | break;
|
3115 | case 67:
|
3116 | this.$ = { "type": "arrow", "stroke": "normal", "text": $$[$0 - 1] };
|
3117 | break;
|
3118 | case 68:
|
3119 | this.$ = { "type": "arrow_circle", "stroke": "normal", "text": $$[$0 - 1] };
|
3120 | break;
|
3121 | case 69:
|
3122 | this.$ = { "type": "arrow_cross", "stroke": "normal", "text": $$[$0 - 1] };
|
3123 | break;
|
3124 | case 70:
|
3125 | this.$ = { "type": "arrow_open", "stroke": "normal", "text": $$[$0 - 1] };
|
3126 | break;
|
3127 | case 71:
|
3128 | this.$ = { "type": "arrow", "stroke": "dotted", "text": $$[$0 - 1] };
|
3129 | break;
|
3130 | case 72:
|
3131 | this.$ = { "type": "arrow_circle", "stroke": "dotted", "text": $$[$0 - 1] };
|
3132 | break;
|
3133 | case 73:
|
3134 | this.$ = { "type": "arrow_cross", "stroke": "dotted", "text": $$[$0 - 1] };
|
3135 | break;
|
3136 | case 74:
|
3137 | this.$ = { "type": "arrow_open", "stroke": "dotted", "text": $$[$0 - 1] };
|
3138 | break;
|
3139 | case 75:
|
3140 | this.$ = { "type": "arrow", "stroke": "thick", "text": $$[$0 - 1] };
|
3141 | break;
|
3142 | case 76:
|
3143 | this.$ = { "type": "arrow_circle", "stroke": "thick", "text": $$[$0 - 1] };
|
3144 | break;
|
3145 | case 77:
|
3146 | this.$ = { "type": "arrow_cross", "stroke": "thick", "text": $$[$0 - 1] };
|
3147 | break;
|
3148 | case 78:
|
3149 | this.$ = { "type": "arrow_open", "stroke": "thick", "text": $$[$0 - 1] };
|
3150 | break;
|
3151 | case 79:
|
3152 | this.$ = { "type": "arrow", "stroke": "normal" };
|
3153 | break;
|
3154 | case 80:
|
3155 | this.$ = { "type": "arrow_circle", "stroke": "normal" };
|
3156 | break;
|
3157 | case 81:
|
3158 | this.$ = { "type": "arrow_cross", "stroke": "normal" };
|
3159 | break;
|
3160 | case 82:
|
3161 | this.$ = { "type": "arrow_open", "stroke": "normal" };
|
3162 | break;
|
3163 | case 83:
|
3164 | this.$ = { "type": "arrow", "stroke": "dotted" };
|
3165 | break;
|
3166 | case 84:
|
3167 | this.$ = { "type": "arrow_circle", "stroke": "dotted" };
|
3168 | break;
|
3169 | case 85:
|
3170 | this.$ = { "type": "arrow_cross", "stroke": "dotted" };
|
3171 | break;
|
3172 | case 86:
|
3173 | this.$ = { "type": "arrow_open", "stroke": "dotted" };
|
3174 | break;
|
3175 | case 87:
|
3176 | this.$ = { "type": "arrow", "stroke": "thick" };
|
3177 | break;
|
3178 | case 88:
|
3179 | this.$ = { "type": "arrow_circle", "stroke": "thick" };
|
3180 | break;
|
3181 | case 89:
|
3182 | this.$ = { "type": "arrow_cross", "stroke": "thick" };
|
3183 | break;
|
3184 | case 90:
|
3185 | this.$ = { "type": "arrow_open", "stroke": "thick" };
|
3186 | break;
|
3187 | case 91:
|
3188 | this.$ = $$[$0 - 1];
|
3189 | break;
|
3190 | case 110:case 111:
|
3191 | this.$ = $$[$0 - 4];yy.addClass($$[$0 - 2], $$[$0]);
|
3192 | break;
|
3193 | case 112:
|
3194 | this.$ = $$[$0 - 4];yy.setClass($$[$0 - 2], $$[$0]);
|
3195 | break;
|
3196 | case 113:
|
3197 | this.$ = $$[$0 - 4];yy.setClickEvent($$[$0 - 2], $$[$0], undefined, undefined);
|
3198 | break;
|
3199 | case 114:
|
3200 | this.$ = $$[$0 - 6];yy.setClickEvent($$[$0 - 4], $$[$0 - 2], undefined, $$[$0]);
|
3201 | break;
|
3202 | case 115:
|
3203 | this.$ = $$[$0 - 4];yy.setClickEvent($$[$0 - 2], undefined, $$[$0], undefined);
|
3204 | break;
|
3205 | case 116:
|
3206 | this.$ = $$[$0 - 6];yy.setClickEvent($$[$0 - 4], undefined, $$[$0 - 2], $$[$0]);
|
3207 | break;
|
3208 | case 117:
|
3209 | this.$ = $$[$0 - 4];yy.addVertex($$[$0 - 2], undefined, undefined, $$[$0]);
|
3210 | break;
|
3211 | case 118:case 119:case 120:
|
3212 | this.$ = $$[$0 - 4];yy.updateLink($$[$0 - 2], $$[$0]);
|
3213 | break;
|
3214 | case 121:case 122:
|
3215 | this.$ = $$[$0 - 8];yy.updateLinkInterpolate($$[$0 - 6], $$[$0 - 2]);yy.updateLink($$[$0 - 6], $$[$0]);
|
3216 | break;
|
3217 | case 123:case 124:
|
3218 | this.$ = $$[$0 - 6];yy.updateLinkInterpolate($$[$0 - 4], $$[$0]);
|
3219 | break;
|
3220 | case 126:
|
3221 | this.$ = [$$[$0]];
|
3222 | break;
|
3223 | case 127:
|
3224 | $$[$0 - 2].push($$[$0]);this.$ = $$[$0 - 2];
|
3225 | break;
|
3226 | case 129:
|
3227 | this.$ = $$[$0 - 1] + $$[$0];
|
3228 | break;
|
3229 | }
|
3230 | },
|
3231 | table: [{ 3: 1, 4: 2, 9: $V0, 10: $V1, 12: $V2 }, { 1: [3] }, o($V3, $V4, { 5: 6 }), { 4: 7, 9: $V0, 10: $V1, 12: $V2 }, { 4: 8, 9: $V0, 10: $V1, 12: $V2 }, { 10: [1, 9] }, { 1: [2, 1], 6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V3, [2, 9]), o($V3, [2, 10]), { 13: [1, 46], 15: [1, 47], 16: [1, 48], 17: [1, 49], 18: [1, 50] }, o($Vt, [2, 3]), o($Vt, [2, 4]), o($Vt, [2, 5]), o($Vt, [2, 6]), o($Vt, [2, 7]), o($Vt, [2, 8]), { 8: $Vu, 9: $Vv, 11: $Vw, 24: 51 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 55 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 56 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 57 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 58 }, { 8: $Vu, 9: $Vv, 11: $Vw, 24: 59 }, { 8: $Vu, 9: $Vv, 10: $Vx, 11: $Vw, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 24: 61, 30: $VE, 31: 60, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VR, [2, 42], { 34: 86, 47: 87, 50: [1, 88], 51: [1, 91], 52: [1, 92], 53: [1, 93], 54: [1, 94], 55: [1, 89], 56: [1, 95], 57: [1, 96], 58: [1, 97], 59: [1, 98], 60: [1, 90], 61: [1, 99], 62: [1, 100], 63: [1, 101], 64: [1, 102] }), { 10: [1, 103] }, { 10: [1, 104] }, { 10: [1, 105] }, { 10: [1, 106] }, { 10: [1, 107] }, o($VS, [2, 55], { 45: 32, 21: 113, 44: 114, 10: $VT, 13: $V9, 15: [1, 112], 18: $Va, 36: [1, 108], 38: [1, 109], 40: [1, 110], 42: [1, 111], 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VU, [2, 57]), o($VU, [2, 59]), o($VU, [2, 60]), o($VU, [2, 61]), o($VU, [2, 62]), o($VV, [2, 154]), o($VV, [2, 155]), o($VV, [2, 156]), o($VV, [2, 157]), o($VV, [2, 158]), o($VV, [2, 159]), o($VV, [2, 160]), o($VV, [2, 161]), o($VV, [2, 162]), o($VV, [2, 163]), o($VV, [2, 164]), { 8: $VW, 9: $VX, 10: $VT, 14: 116, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 120, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 121, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 122, 21: 119 }, { 8: $VW, 9: $VX, 10: $VT, 14: 123, 21: 119 }, o($Vt, [2, 30]), o($Vt, [2, 38]), o($Vt, [2, 39]), o($Vt, [2, 40]), o($Vt, [2, 31]), o($Vt, [2, 32]), o($Vt, [2, 33]), o($Vt, [2, 34]), o($Vt, [2, 35]), { 8: $Vu, 9: $Vv, 10: $Vx, 11: $Vw, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 24: 124, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VY, $V4, { 5: 126 }), o($VZ, [2, 92]), o($VZ, [2, 94]), o($VZ, [2, 143]), o($VZ, [2, 144]), o($VZ, [2, 145]), o($VZ, [2, 146]), o($VZ, [2, 147]), o($VZ, [2, 148]), o($VZ, [2, 149]), o($VZ, [2, 150]), o($VZ, [2, 151]), o($VZ, [2, 152]), o($VZ, [2, 153]), o($VZ, [2, 97]), o($VZ, [2, 98]), o($VZ, [2, 99]), o($VZ, [2, 100]), o($VZ, [2, 101]), o($VZ, [2, 102]), o($VZ, [2, 103]), o($VZ, [2, 104]), o($VZ, [2, 105]), o($VZ, [2, 106]), o($VZ, [2, 107]), { 13: $V9, 18: $Va, 33: 127, 35: 29, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V_, [2, 66], { 48: 128, 49: [1, 129], 65: [1, 130] }), { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 131, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 132, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 133, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V$, [2, 79]), o($V$, [2, 80]), o($V$, [2, 81]), o($V$, [2, 82]), o($V$, [2, 83]), o($V$, [2, 84]), o($V$, [2, 85]), o($V$, [2, 86]), o($V$, [2, 87]), o($V$, [2, 88]), o($V$, [2, 89]), o($V$, [2, 90]), { 13: $V9, 18: $Va, 35: 134, 44: 30, 45: 32, 46: $Vc, 80: [1, 135], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 78: [1, 136], 81: [1, 137] }, { 13: $V9, 18: $Va, 35: 139, 44: 30, 45: 32, 46: $Vc, 78: [1, 138], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 140, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 141, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 142, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 144, 32: $VF, 38: [1, 143], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 145, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 146, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 147, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 56]), o($VU, [2, 58]), o($VS, [2, 29], { 21: 148, 10: $VT }), o($V3, [2, 11]), o($V3, [2, 21]), o($V3, [2, 22]), { 9: [1, 149] }, o($V3, [2, 12]), o($V3, [2, 13]), o($V3, [2, 14]), o($V3, [2, 15]), o($VY, $V4, { 5: 150 }), o($VZ, [2, 93]), { 6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 32: [1, 151], 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VR, [2, 41]), o($V_, [2, 63], { 10: [1, 152] }), { 10: [1, 153] }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 154, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 51: [1, 155], 52: [1, 156], 53: [1, 157], 54: [1, 158], 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 56: [1, 159], 57: [1, 160], 58: [1, 161], 59: [1, 162], 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 61: [1, 163], 62: [1, 164], 63: [1, 165], 64: [1, 166], 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 167], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 168] }, { 10: [1, 169] }, { 10: [1, 170] }, { 10: [1, 171] }, { 10: [1, 172], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 173], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: [1, 174], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 37: [1, 175], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 176, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 39: [1, 177], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 41: [1, 178], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 43: [1, 179], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 37: [1, 180], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 28]), o($V3, [2, 23]), { 6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 32: [1, 181], 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($Vt, [2, 37]), o($V_, [2, 65]), o($V_, [2, 64]), { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 65: [1, 182], 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($V_, [2, 67]), o($V_, [2, 68]), o($V_, [2, 69]), o($V_, [2, 70]), o($V_, [2, 71]), o($V_, [2, 72]), o($V_, [2, 73]), o($V_, [2, 74]), o($V_, [2, 75]), o($V_, [2, 76]), o($V_, [2, 77]), o($V_, [2, 78]), { 10: $V01, 46: $V11, 71: $V21, 79: 183, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 197, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 198, 80: $V31, 81: $V41, 82: [1, 199], 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 200, 80: $V31, 81: $V41, 82: [1, 201], 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 202, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 203, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 13: $V9, 18: $Va, 35: 204, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 205, 44: 30, 45: 32, 46: $Vc, 67: [1, 206], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 43], { 21: 207, 10: $VT }), { 10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 39: [1, 208], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, o($VS, [2, 49], { 21: 209, 10: $VT }), o($VS, [2, 47], { 21: 210, 10: $VT }), o($VS, [2, 51], { 21: 211, 10: $VT }), o($VS, [2, 53], { 21: 212, 10: $VT }), o($Vt, [2, 36]), o([10, 13, 18, 46, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], [2, 91]), o($VR, [2, 117], { 86: $Vb1 }), o($Vc1, [2, 126], { 87: 214, 10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }), o($Vd1, [2, 128]), o($Vd1, [2, 130]), o($Vd1, [2, 131]), o($Vd1, [2, 132]), o($Vd1, [2, 133]), o($Vd1, [2, 134]), o($Vd1, [2, 135]), o($Vd1, [2, 136]), o($Vd1, [2, 137]), o($Vd1, [2, 138]), o($Vd1, [2, 139]), o($Vd1, [2, 140]), o($VR, [2, 118], { 86: $Vb1 }), o($VR, [2, 119], { 86: $Vb1 }), { 10: [1, 215] }, o($VR, [2, 120], { 86: $Vb1 }), { 10: [1, 216] }, o($VR, [2, 110], { 86: $Vb1 }), o($VR, [2, 111], { 86: $Vb1 }), o($VR, [2, 112], { 45: 32, 44: 114, 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 113], { 45: 32, 44: 114, 10: [1, 217], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 115], { 10: [1, 218] }), o($VS, [2, 44]), { 39: [1, 219] }, o($VS, [2, 50]), o($VS, [2, 48]), o($VS, [2, 52]), o($VS, [2, 54]), { 10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 85: 220, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, o($Vd1, [2, 129]), { 13: $V9, 18: $Va, 35: 221, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 13: $V9, 18: $Va, 35: 222, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }, { 67: [1, 223] }, { 67: [1, 224] }, o($VS, [2, 45], { 21: 225, 10: $VT }), o($Vc1, [2, 127], { 87: 214, 10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }), o($VR, [2, 123], { 45: 32, 44: 114, 10: [1, 226], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 124], { 45: 32, 44: 114, 10: [1, 227], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs }), o($VR, [2, 114]), o($VR, [2, 116]), o($VS, [2, 46]), { 10: $V01, 46: $V11, 71: $V21, 79: 228, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, { 10: $V01, 46: $V11, 71: $V21, 79: 229, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1 }, o($VR, [2, 121], { 86: $Vb1 }), o($VR, [2, 122], { 86: $Vb1 })],
|
3232 | defaultActions: {},
|
3233 | parseError: function parseError(str, hash) {
|
3234 | if (hash.recoverable) {
|
3235 | this.trace(str);
|
3236 | } else {
|
3237 | var error = new Error(str);
|
3238 | error.hash = hash;
|
3239 | throw error;
|
3240 | }
|
3241 | },
|
3242 | parse: function parse(input) {
|
3243 | var self = this,
|
3244 | stack = [0],
|
3245 | tstack = [],
|
3246 | vstack = [null],
|
3247 | lstack = [],
|
3248 | table = this.table,
|
3249 | yytext = '',
|
3250 | yylineno = 0,
|
3251 | yyleng = 0,
|
3252 | recovering = 0,
|
3253 | TERROR = 2,
|
3254 | EOF = 1;
|
3255 | var args = lstack.slice.call(arguments, 1);
|
3256 | var lexer = Object.create(this.lexer);
|
3257 | var sharedState = { yy: {} };
|
3258 | for (var k in this.yy) {
|
3259 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
3260 | sharedState.yy[k] = this.yy[k];
|
3261 | }
|
3262 | }
|
3263 | lexer.setInput(input, sharedState.yy);
|
3264 | sharedState.yy.lexer = lexer;
|
3265 | sharedState.yy.parser = this;
|
3266 | if (typeof lexer.yylloc == 'undefined') {
|
3267 | lexer.yylloc = {};
|
3268 | }
|
3269 | var yyloc = lexer.yylloc;
|
3270 | lstack.push(yyloc);
|
3271 | var ranges = lexer.options && lexer.options.ranges;
|
3272 | if (typeof sharedState.yy.parseError === 'function') {
|
3273 | this.parseError = sharedState.yy.parseError;
|
3274 | } else {
|
3275 | this.parseError = Object.getPrototypeOf(this).parseError;
|
3276 | }
|
3277 | function popStack(n) {
|
3278 | stack.length = stack.length - 2 * n;
|
3279 | vstack.length = vstack.length - n;
|
3280 | lstack.length = lstack.length - n;
|
3281 | }
|
3282 | function lex() {
|
3283 | var token;
|
3284 | token = tstack.pop() || lexer.lex() || EOF;
|
3285 | if (typeof token !== 'number') {
|
3286 | if (token instanceof Array) {
|
3287 | tstack = token;
|
3288 | token = tstack.pop();
|
3289 | }
|
3290 | token = self.symbols_[token] || token;
|
3291 | }
|
3292 | return token;
|
3293 | }
|
3294 | var symbol,
|
3295 | preErrorSymbol,
|
3296 | state,
|
3297 | action,
|
3298 | a,
|
3299 | r,
|
3300 | yyval = {},
|
3301 | p,
|
3302 | len,
|
3303 | newState,
|
3304 | expected;
|
3305 | while (true) {
|
3306 | state = stack[stack.length - 1];
|
3307 | if (this.defaultActions[state]) {
|
3308 | action = this.defaultActions[state];
|
3309 | } else {
|
3310 | if (symbol === null || typeof symbol == 'undefined') {
|
3311 | symbol = lex();
|
3312 | }
|
3313 | action = table[state] && table[state][symbol];
|
3314 | }
|
3315 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
3316 | var errStr = '';
|
3317 | expected = [];
|
3318 | for (p in table[state]) {
|
3319 | if (this.terminals_[p] && p > TERROR) {
|
3320 | expected.push('\'' + this.terminals_[p] + '\'');
|
3321 | }
|
3322 | }
|
3323 | if (lexer.showPosition) {
|
3324 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
3325 | } else {
|
3326 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
3327 | }
|
3328 | this.parseError(errStr, {
|
3329 | text: lexer.match,
|
3330 | token: this.terminals_[symbol] || symbol,
|
3331 | line: lexer.yylineno,
|
3332 | loc: yyloc,
|
3333 | expected: expected
|
3334 | });
|
3335 | }
|
3336 | if (action[0] instanceof Array && action.length > 1) {
|
3337 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
3338 | }
|
3339 | switch (action[0]) {
|
3340 | case 1:
|
3341 | stack.push(symbol);
|
3342 | vstack.push(lexer.yytext);
|
3343 | lstack.push(lexer.yylloc);
|
3344 | stack.push(action[1]);
|
3345 | symbol = null;
|
3346 | if (!preErrorSymbol) {
|
3347 | yyleng = lexer.yyleng;
|
3348 | yytext = lexer.yytext;
|
3349 | yylineno = lexer.yylineno;
|
3350 | yyloc = lexer.yylloc;
|
3351 | if (recovering > 0) {
|
3352 | recovering--;
|
3353 | }
|
3354 | } else {
|
3355 | symbol = preErrorSymbol;
|
3356 | preErrorSymbol = null;
|
3357 | }
|
3358 | break;
|
3359 | case 2:
|
3360 | len = this.productions_[action[1]][1];
|
3361 | yyval.$ = vstack[vstack.length - len];
|
3362 | yyval._$ = {
|
3363 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
3364 | last_line: lstack[lstack.length - 1].last_line,
|
3365 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
3366 | last_column: lstack[lstack.length - 1].last_column
|
3367 | };
|
3368 | if (ranges) {
|
3369 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
3370 | }
|
3371 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
3372 | if (typeof r !== 'undefined') {
|
3373 | return r;
|
3374 | }
|
3375 | if (len) {
|
3376 | stack = stack.slice(0, -1 * len * 2);
|
3377 | vstack = vstack.slice(0, -1 * len);
|
3378 | lstack = lstack.slice(0, -1 * len);
|
3379 | }
|
3380 | stack.push(this.productions_[action[1]][0]);
|
3381 | vstack.push(yyval.$);
|
3382 | lstack.push(yyval._$);
|
3383 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
3384 | stack.push(newState);
|
3385 | break;
|
3386 | case 3:
|
3387 | return true;
|
3388 | }
|
3389 | }
|
3390 | return true;
|
3391 | } };
|
3392 |
|
3393 |
|
3394 | var lexer = function () {
|
3395 | var lexer = {
|
3396 |
|
3397 | EOF: 1,
|
3398 |
|
3399 | parseError: function parseError(str, hash) {
|
3400 | if (this.yy.parser) {
|
3401 | this.yy.parser.parseError(str, hash);
|
3402 | } else {
|
3403 | throw new Error(str);
|
3404 | }
|
3405 | },
|
3406 |
|
3407 |
|
3408 | setInput: function setInput(input, yy) {
|
3409 | this.yy = yy || this.yy || {};
|
3410 | this._input = input;
|
3411 | this._more = this._backtrack = this.done = false;
|
3412 | this.yylineno = this.yyleng = 0;
|
3413 | this.yytext = this.matched = this.match = '';
|
3414 | this.conditionStack = ['INITIAL'];
|
3415 | this.yylloc = {
|
3416 | first_line: 1,
|
3417 | first_column: 0,
|
3418 | last_line: 1,
|
3419 | last_column: 0
|
3420 | };
|
3421 | if (this.options.ranges) {
|
3422 | this.yylloc.range = [0, 0];
|
3423 | }
|
3424 | this.offset = 0;
|
3425 | return this;
|
3426 | },
|
3427 |
|
3428 |
|
3429 | input: function input() {
|
3430 | var ch = this._input[0];
|
3431 | this.yytext += ch;
|
3432 | this.yyleng++;
|
3433 | this.offset++;
|
3434 | this.match += ch;
|
3435 | this.matched += ch;
|
3436 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
3437 | if (lines) {
|
3438 | this.yylineno++;
|
3439 | this.yylloc.last_line++;
|
3440 | } else {
|
3441 | this.yylloc.last_column++;
|
3442 | }
|
3443 | if (this.options.ranges) {
|
3444 | this.yylloc.range[1]++;
|
3445 | }
|
3446 |
|
3447 | this._input = this._input.slice(1);
|
3448 | return ch;
|
3449 | },
|
3450 |
|
3451 |
|
3452 | unput: function unput(ch) {
|
3453 | var len = ch.length;
|
3454 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
3455 |
|
3456 | this._input = ch + this._input;
|
3457 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
3458 |
|
3459 | this.offset -= len;
|
3460 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
3461 | this.match = this.match.substr(0, this.match.length - 1);
|
3462 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
3463 |
|
3464 | if (lines.length - 1) {
|
3465 | this.yylineno -= lines.length - 1;
|
3466 | }
|
3467 | var r = this.yylloc.range;
|
3468 |
|
3469 | this.yylloc = {
|
3470 | first_line: this.yylloc.first_line,
|
3471 | last_line: this.yylineno + 1,
|
3472 | first_column: this.yylloc.first_column,
|
3473 | last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
|
3474 | };
|
3475 |
|
3476 | if (this.options.ranges) {
|
3477 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
3478 | }
|
3479 | this.yyleng = this.yytext.length;
|
3480 | return this;
|
3481 | },
|
3482 |
|
3483 |
|
3484 | more: function more() {
|
3485 | this._more = true;
|
3486 | return this;
|
3487 | },
|
3488 |
|
3489 |
|
3490 | reject: function reject() {
|
3491 | if (this.options.backtrack_lexer) {
|
3492 | this._backtrack = true;
|
3493 | } else {
|
3494 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
|
3495 | text: "",
|
3496 | token: null,
|
3497 | line: this.yylineno
|
3498 | });
|
3499 | }
|
3500 | return this;
|
3501 | },
|
3502 |
|
3503 |
|
3504 | less: function less(n) {
|
3505 | this.unput(this.match.slice(n));
|
3506 | },
|
3507 |
|
3508 |
|
3509 | pastInput: function pastInput() {
|
3510 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
3511 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
3512 | },
|
3513 |
|
3514 |
|
3515 | upcomingInput: function upcomingInput() {
|
3516 | var next = this.match;
|
3517 | if (next.length < 20) {
|
3518 | next += this._input.substr(0, 20 - next.length);
|
3519 | }
|
3520 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
3521 | },
|
3522 |
|
3523 |
|
3524 | showPosition: function showPosition() {
|
3525 | var pre = this.pastInput();
|
3526 | var c = new Array(pre.length + 1).join("-");
|
3527 | return pre + this.upcomingInput() + "\n" + c + "^";
|
3528 | },
|
3529 |
|
3530 |
|
3531 | test_match: function test_match(match, indexed_rule) {
|
3532 | var token, lines, backup;
|
3533 |
|
3534 | if (this.options.backtrack_lexer) {
|
3535 |
|
3536 | backup = {
|
3537 | yylineno: this.yylineno,
|
3538 | yylloc: {
|
3539 | first_line: this.yylloc.first_line,
|
3540 | last_line: this.last_line,
|
3541 | first_column: this.yylloc.first_column,
|
3542 | last_column: this.yylloc.last_column
|
3543 | },
|
3544 | yytext: this.yytext,
|
3545 | match: this.match,
|
3546 | matches: this.matches,
|
3547 | matched: this.matched,
|
3548 | yyleng: this.yyleng,
|
3549 | offset: this.offset,
|
3550 | _more: this._more,
|
3551 | _input: this._input,
|
3552 | yy: this.yy,
|
3553 | conditionStack: this.conditionStack.slice(0),
|
3554 | done: this.done
|
3555 | };
|
3556 | if (this.options.ranges) {
|
3557 | backup.yylloc.range = this.yylloc.range.slice(0);
|
3558 | }
|
3559 | }
|
3560 |
|
3561 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
3562 | if (lines) {
|
3563 | this.yylineno += lines.length;
|
3564 | }
|
3565 | this.yylloc = {
|
3566 | first_line: this.yylloc.last_line,
|
3567 | last_line: this.yylineno + 1,
|
3568 | first_column: this.yylloc.last_column,
|
3569 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
3570 | };
|
3571 | this.yytext += match[0];
|
3572 | this.match += match[0];
|
3573 | this.matches = match;
|
3574 | this.yyleng = this.yytext.length;
|
3575 | if (this.options.ranges) {
|
3576 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
3577 | }
|
3578 | this._more = false;
|
3579 | this._backtrack = false;
|
3580 | this._input = this._input.slice(match[0].length);
|
3581 | this.matched += match[0];
|
3582 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
3583 | if (this.done && this._input) {
|
3584 | this.done = false;
|
3585 | }
|
3586 | if (token) {
|
3587 | return token;
|
3588 | } else if (this._backtrack) {
|
3589 |
|
3590 | for (var k in backup) {
|
3591 | this[k] = backup[k];
|
3592 | }
|
3593 | return false;
|
3594 | }
|
3595 | return false;
|
3596 | },
|
3597 |
|
3598 |
|
3599 | next: function next() {
|
3600 | if (this.done) {
|
3601 | return this.EOF;
|
3602 | }
|
3603 | if (!this._input) {
|
3604 | this.done = true;
|
3605 | }
|
3606 |
|
3607 | var token, match, tempMatch, index;
|
3608 | if (!this._more) {
|
3609 | this.yytext = '';
|
3610 | this.match = '';
|
3611 | }
|
3612 | var rules = this._currentRules();
|
3613 | for (var i = 0; i < rules.length; i++) {
|
3614 | tempMatch = this._input.match(this.rules[rules[i]]);
|
3615 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
3616 | match = tempMatch;
|
3617 | index = i;
|
3618 | if (this.options.backtrack_lexer) {
|
3619 | token = this.test_match(tempMatch, rules[i]);
|
3620 | if (token !== false) {
|
3621 | return token;
|
3622 | } else if (this._backtrack) {
|
3623 | match = false;
|
3624 | continue;
|
3625 | } else {
|
3626 |
|
3627 | return false;
|
3628 | }
|
3629 | } else if (!this.options.flex) {
|
3630 | break;
|
3631 | }
|
3632 | }
|
3633 | }
|
3634 | if (match) {
|
3635 | token = this.test_match(match, rules[index]);
|
3636 | if (token !== false) {
|
3637 | return token;
|
3638 | }
|
3639 |
|
3640 | return false;
|
3641 | }
|
3642 | if (this._input === "") {
|
3643 | return this.EOF;
|
3644 | } else {
|
3645 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
3646 | text: "",
|
3647 | token: null,
|
3648 | line: this.yylineno
|
3649 | });
|
3650 | }
|
3651 | },
|
3652 |
|
3653 |
|
3654 | lex: function lex() {
|
3655 | var r = this.next();
|
3656 | if (r) {
|
3657 | return r;
|
3658 | } else {
|
3659 | return this.lex();
|
3660 | }
|
3661 | },
|
3662 |
|
3663 |
|
3664 | begin: function begin(condition) {
|
3665 | this.conditionStack.push(condition);
|
3666 | },
|
3667 |
|
3668 |
|
3669 | popState: function popState() {
|
3670 | var n = this.conditionStack.length - 1;
|
3671 | if (n > 0) {
|
3672 | return this.conditionStack.pop();
|
3673 | } else {
|
3674 | return this.conditionStack[0];
|
3675 | }
|
3676 | },
|
3677 |
|
3678 |
|
3679 | _currentRules: function _currentRules() {
|
3680 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
3681 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
3682 | } else {
|
3683 | return this.conditions["INITIAL"].rules;
|
3684 | }
|
3685 | },
|
3686 |
|
3687 |
|
3688 | topState: function topState(n) {
|
3689 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
3690 | if (n >= 0) {
|
3691 | return this.conditionStack[n];
|
3692 | } else {
|
3693 | return "INITIAL";
|
3694 | }
|
3695 | },
|
3696 |
|
3697 |
|
3698 | pushState: function pushState(condition) {
|
3699 | this.begin(condition);
|
3700 | },
|
3701 |
|
3702 |
|
3703 | stateStackSize: function stateStackSize() {
|
3704 | return this.conditionStack.length;
|
3705 | },
|
3706 | options: {},
|
3707 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
3708 | var YYSTATE = YY_START;
|
3709 | switch ($avoiding_name_collisions) {
|
3710 | case 0:
|
3711 |
|
3712 | break;
|
3713 | case 1:
|
3714 | this.begin("string");
|
3715 | break;
|
3716 | case 2:
|
3717 | this.popState();
|
3718 | break;
|
3719 | case 3:
|
3720 | return "STR";
|
3721 | break;
|
3722 | case 4:
|
3723 | return 71;
|
3724 | break;
|
3725 | case 5:
|
3726 | return 78;
|
3727 | break;
|
3728 | case 6:
|
3729 | return 72;
|
3730 | break;
|
3731 | case 7:
|
3732 | return 82;
|
3733 | break;
|
3734 | case 8:
|
3735 | return 73;
|
3736 | break;
|
3737 | case 9:
|
3738 | return 74;
|
3739 | break;
|
3740 | case 10:
|
3741 | return 75;
|
3742 | break;
|
3743 | case 11:
|
3744 | return 12;
|
3745 | break;
|
3746 | case 12:
|
3747 | return 30;
|
3748 | break;
|
3749 | case 13:
|
3750 | return 32;
|
3751 | break;
|
3752 | case 14:
|
3753 | return 13;
|
3754 | break;
|
3755 | case 15:
|
3756 | return 13;
|
3757 | break;
|
3758 | case 16:
|
3759 | return 13;
|
3760 | break;
|
3761 | case 17:
|
3762 | return 13;
|
3763 | break;
|
3764 | case 18:
|
3765 | return 13;
|
3766 | break;
|
3767 | case 19:
|
3768 | return 13;
|
3769 | break;
|
3770 | case 20:
|
3771 | return 81;
|
3772 | break;
|
3773 | case 21:
|
3774 | return 91;
|
3775 | break;
|
3776 | case 22:
|
3777 | return 89;
|
3778 | break;
|
3779 | case 23:
|
3780 | return 8;
|
3781 | break;
|
3782 | case 24:
|
3783 | return 86;
|
3784 | break;
|
3785 | case 25:
|
3786 | return 98;
|
3787 | break;
|
3788 | case 26:
|
3789 | return 16;
|
3790 | break;
|
3791 | case 27:
|
3792 | return 15;
|
3793 | break;
|
3794 | case 28:
|
3795 | return 17;
|
3796 | break;
|
3797 | case 29:
|
3798 | return 18;
|
3799 | break;
|
3800 | case 30:
|
3801 | return 53;
|
3802 | break;
|
3803 | case 31:
|
3804 | return 51;
|
3805 | break;
|
3806 | case 32:
|
3807 | return 52;
|
3808 | break;
|
3809 | case 33:
|
3810 | return 54;
|
3811 | break;
|
3812 | case 34:
|
3813 | return 58;
|
3814 | break;
|
3815 | case 35:
|
3816 | return 56;
|
3817 | break;
|
3818 | case 36:
|
3819 | return 57;
|
3820 | break;
|
3821 | case 37:
|
3822 | return 59;
|
3823 | break;
|
3824 | case 38:
|
3825 | return 58;
|
3826 | break;
|
3827 | case 39:
|
3828 | return 56;
|
3829 | break;
|
3830 | case 40:
|
3831 | return 57;
|
3832 | break;
|
3833 | case 41:
|
3834 | return 59;
|
3835 | break;
|
3836 | case 42:
|
3837 | return 63;
|
3838 | break;
|
3839 | case 43:
|
3840 | return 61;
|
3841 | break;
|
3842 | case 44:
|
3843 | return 62;
|
3844 | break;
|
3845 | case 45:
|
3846 | return 64;
|
3847 | break;
|
3848 | case 46:
|
3849 | return 50;
|
3850 | break;
|
3851 | case 47:
|
3852 | return 55;
|
3853 | break;
|
3854 | case 48:
|
3855 | return 60;
|
3856 | break;
|
3857 | case 49:
|
3858 | return 40;
|
3859 | break;
|
3860 | case 50:
|
3861 | return 41;
|
3862 | break;
|
3863 | case 51:
|
3864 | return 46;
|
3865 | break;
|
3866 | case 52:
|
3867 | return 92;
|
3868 | break;
|
3869 | case 53:
|
3870 | return 96;
|
3871 | break;
|
3872 | case 54:
|
3873 | return 84;
|
3874 | break;
|
3875 | case 55:
|
3876 | return 97;
|
3877 | break;
|
3878 | case 56:
|
3879 | return 97;
|
3880 | break;
|
3881 | case 57:
|
3882 | return 88;
|
3883 | break;
|
3884 | case 58:
|
3885 | return 94;
|
3886 | break;
|
3887 | case 59:
|
3888 | return 95;
|
3889 | break;
|
3890 | case 60:
|
3891 | return 65;
|
3892 | break;
|
3893 | case 61:
|
3894 | return 38;
|
3895 | break;
|
3896 | case 62:
|
3897 | return 39;
|
3898 | break;
|
3899 | case 63:
|
3900 | return 36;
|
3901 | break;
|
3902 | case 64:
|
3903 | return 37;
|
3904 | break;
|
3905 | case 65:
|
3906 | return 42;
|
3907 | break;
|
3908 | case 66:
|
3909 | return 43;
|
3910 | break;
|
3911 | case 67:
|
3912 | return 101;
|
3913 | break;
|
3914 | case 68:
|
3915 | return 9;
|
3916 | break;
|
3917 | case 69:
|
3918 | return 10;
|
3919 | break;
|
3920 | case 70:
|
3921 | return 11;
|
3922 | break;
|
3923 | }
|
3924 | },
|
3925 | rules: [/^(?:%%[^\n]*)/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:click\b)/, /^(?:graph\b)/, /^(?:subgraph\b)/, /^(?:end\b\s*)/, /^(?:LR\b)/, /^(?:RL\b)/, /^(?:TB\b)/, /^(?:BT\b)/, /^(?:TD\b)/, /^(?:BR\b)/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:v\b)/, /^(?:\s*--[x]\s*)/, /^(?:\s*-->\s*)/, /^(?:\s*--[o]\s*)/, /^(?:\s*---\s*)/, /^(?:\s*-\.-[x]\s*)/, /^(?:\s*-\.->\s*)/, /^(?:\s*-\.-[o]\s*)/, /^(?:\s*-\.-\s*)/, /^(?:\s*.-[x]\s*)/, /^(?:\s*\.->\s*)/, /^(?:\s*\.-[o]\s*)/, /^(?:\s*\.-\s*)/, /^(?:\s*==[x]\s*)/, /^(?:\s*==>\s*)/, /^(?:\s*==[o]\s*)/, /^(?:\s*==[\=]\s*)/, /^(?:\s*--\s*)/, /^(?:\s*-\.\s*)/, /^(?:\s*==\s*)/, /^(?:\(-)/, /^(?:-\))/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:[A-Za-z]+)/, /^(?:[!"#$%&'*+,-.`?\\_\/])/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\()/, /^(?:\))/, /^(?:\[)/, /^(?:\])/, /^(?:\{)/, /^(?:\})/, /^(?:")/, /^(?:\n+)/, /^(?:\s)/, /^(?:$)/],
|
3926 | conditions: { "string": { "rules": [2, 3], "inclusive": false }, "INITIAL": { "rules": [0, 1, 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, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70], "inclusive": true } }
|
3927 | };
|
3928 | return lexer;
|
3929 | }();
|
3930 | parser.lexer = lexer;
|
3931 | function Parser() {
|
3932 | this.yy = {};
|
3933 | }
|
3934 | Parser.prototype = parser;parser.Parser = Parser;
|
3935 | return new Parser();
|
3936 | }();
|
3937 |
|
3938 | if (true) {
|
3939 | exports.parser = parser;
|
3940 | exports.Parser = parser.Parser;
|
3941 | exports.parse = function () {
|
3942 | return parser.parse.apply(parser, arguments);
|
3943 | };
|
3944 | exports.main = function commonjsMain(args) {
|
3945 | if (!args[1]) {
|
3946 | console.log('Usage: ' + args[0] + ' FILE');
|
3947 | process.exit(1);
|
3948 | }
|
3949 | var source = __webpack_require__( "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__( "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
|
3950 | return exports.parser.parse(source);
|
3951 | };
|
3952 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
3953 | exports.main(process.argv.slice(1));
|
3954 | }
|
3955 | }
|
3956 | }.call(this, __webpack_require__( "./node_modules/process/browser.js"), __webpack_require__( "./node_modules/webpack/buildin/module.js")(module)))
|
3957 |
|
3958 | }),
|
3959 |
|
3960 | "./src/diagrams/gantt/ganttDb.js":
|
3961 |
|
3962 |
|
3963 |
|
3964 |
|
3965 | (function(module, exports, __webpack_require__) {
|
3966 |
|
3967 | "use strict";
|
3968 |
|
3969 |
|
3970 | Object.defineProperty(exports, "__esModule", {
|
3971 | value: true
|
3972 | });
|
3973 | exports.addTaskOrg = exports.findTaskById = exports.addTask = exports.getTasks = exports.addSection = exports.getTitle = exports.setTitle = exports.setDateFormat = exports.getAxisFormat = exports.setAxisFormat = exports.clear = undefined;
|
3974 |
|
3975 | var _moment = __webpack_require__( "moment");
|
3976 |
|
3977 | var _moment2 = _interopRequireDefault(_moment);
|
3978 |
|
3979 | var _logger = __webpack_require__( "./src/logger.js");
|
3980 |
|
3981 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
3982 |
|
3983 | var dateFormat = '';
|
3984 | var axisFormat = '';
|
3985 | var title = '';
|
3986 | var sections = [];
|
3987 | var tasks = [];
|
3988 | var currentSection = '';
|
3989 |
|
3990 | var clear = exports.clear = function clear() {
|
3991 | sections = [];
|
3992 | tasks = [];
|
3993 | currentSection = '';
|
3994 | title = '';
|
3995 | taskCnt = 0;
|
3996 | lastTask = undefined;
|
3997 | lastTaskID = undefined;
|
3998 | rawTasks = [];
|
3999 | };
|
4000 |
|
4001 | var setAxisFormat = exports.setAxisFormat = function setAxisFormat(txt) {
|
4002 | axisFormat = txt;
|
4003 | };
|
4004 |
|
4005 | var getAxisFormat = exports.getAxisFormat = function getAxisFormat() {
|
4006 | return axisFormat;
|
4007 | };
|
4008 |
|
4009 | var setDateFormat = exports.setDateFormat = function setDateFormat(txt) {
|
4010 | dateFormat = txt;
|
4011 | };
|
4012 |
|
4013 | var setTitle = exports.setTitle = function setTitle(txt) {
|
4014 | title = txt;
|
4015 | };
|
4016 |
|
4017 | var getTitle = exports.getTitle = function getTitle() {
|
4018 | return title;
|
4019 | };
|
4020 |
|
4021 | var addSection = exports.addSection = function addSection(txt) {
|
4022 | currentSection = txt;
|
4023 | sections.push(txt);
|
4024 | };
|
4025 |
|
4026 | var getTasks = exports.getTasks = function getTasks() {
|
4027 | var allItemsPricessed = compileTasks();
|
4028 | var maxDepth = 10;
|
4029 | var iterationCount = 0;
|
4030 | while (!allItemsPricessed && iterationCount < maxDepth) {
|
4031 | allItemsPricessed = compileTasks();
|
4032 | iterationCount++;
|
4033 | }
|
4034 |
|
4035 | tasks = rawTasks;
|
4036 |
|
4037 | return tasks;
|
4038 | };
|
4039 |
|
4040 | var getStartDate = function getStartDate(prevTime, dateFormat, str) {
|
4041 | str = str.trim();
|
4042 |
|
4043 |
|
4044 | var re = /^after\s+([\d\w-]+)/;
|
4045 | var afterStatement = re.exec(str.trim());
|
4046 |
|
4047 | if (afterStatement !== null) {
|
4048 | var task = findTaskById(afterStatement[1]);
|
4049 |
|
4050 | if (typeof task === 'undefined') {
|
4051 | var dt = new Date();
|
4052 | dt.setHours(0, 0, 0, 0);
|
4053 | return dt;
|
4054 | }
|
4055 | return task.endTime;
|
4056 | }
|
4057 |
|
4058 |
|
4059 | if ((0, _moment2.default)(str, dateFormat.trim(), true).isValid()) {
|
4060 | return (0, _moment2.default)(str, dateFormat.trim(), true).toDate();
|
4061 | } else {
|
4062 | _logger.logger.debug('Invalid date:' + str);
|
4063 | _logger.logger.debug('With date format:' + dateFormat.trim());
|
4064 | }
|
4065 |
|
4066 |
|
4067 | return new Date();
|
4068 | };
|
4069 |
|
4070 | var getEndDate = function getEndDate(prevTime, dateFormat, str) {
|
4071 | str = str.trim();
|
4072 |
|
4073 |
|
4074 | if ((0, _moment2.default)(str, dateFormat.trim(), true).isValid()) {
|
4075 | return (0, _moment2.default)(str, dateFormat.trim()).toDate();
|
4076 | }
|
4077 |
|
4078 | var d = (0, _moment2.default)(prevTime);
|
4079 |
|
4080 | var re = /^([\d]+)([wdhms])/;
|
4081 | var durationStatement = re.exec(str.trim());
|
4082 |
|
4083 | if (durationStatement !== null) {
|
4084 | switch (durationStatement[2]) {
|
4085 | case 's':
|
4086 | d.add(durationStatement[1], 'seconds');
|
4087 | break;
|
4088 | case 'm':
|
4089 | d.add(durationStatement[1], 'minutes');
|
4090 | break;
|
4091 | case 'h':
|
4092 | d.add(durationStatement[1], 'hours');
|
4093 | break;
|
4094 | case 'd':
|
4095 | d.add(durationStatement[1], 'days');
|
4096 | break;
|
4097 | case 'w':
|
4098 | d.add(durationStatement[1], 'weeks');
|
4099 | break;
|
4100 | }
|
4101 | return d.toDate();
|
4102 | }
|
4103 |
|
4104 | return d.toDate();
|
4105 | };
|
4106 |
|
4107 | var taskCnt = 0;
|
4108 | var parseId = function parseId(idStr) {
|
4109 | if (typeof idStr === 'undefined') {
|
4110 | taskCnt = taskCnt + 1;
|
4111 | return 'task' + taskCnt;
|
4112 | }
|
4113 | return idStr;
|
4114 | };
|
4115 |
|
4116 |
|
4117 |
|
4118 |
|
4119 |
|
4120 |
|
4121 |
|
4122 |
|
4123 |
|
4124 |
|
4125 |
|
4126 | var compileData = function compileData(prevTask, dataStr) {
|
4127 | var ds = void 0;
|
4128 |
|
4129 | if (dataStr.substr(0, 1) === ':') {
|
4130 | ds = dataStr.substr(1, dataStr.length);
|
4131 | } else {
|
4132 | ds = dataStr;
|
4133 | }
|
4134 |
|
4135 | var data = ds.split(',');
|
4136 |
|
4137 | var task = {};
|
4138 |
|
4139 |
|
4140 | var matchFound = true;
|
4141 | while (matchFound) {
|
4142 | matchFound = false;
|
4143 | if (data[0].match(/^\s*active\s*$/)) {
|
4144 | task.active = true;
|
4145 | data.shift(1);
|
4146 | matchFound = true;
|
4147 | }
|
4148 | if (data[0].match(/^\s*done\s*$/)) {
|
4149 | task.done = true;
|
4150 | data.shift(1);
|
4151 | matchFound = true;
|
4152 | }
|
4153 | if (data[0].match(/^\s*crit\s*$/)) {
|
4154 | task.crit = true;
|
4155 | data.shift(1);
|
4156 | matchFound = true;
|
4157 | }
|
4158 | }
|
4159 | for (var i = 0; i < data.length; i++) {
|
4160 | data[i] = data[i].trim();
|
4161 | }
|
4162 |
|
4163 | switch (data.length) {
|
4164 | case 1:
|
4165 | task.id = parseId();
|
4166 | task.startTime = prevTask.endTime;
|
4167 | task.endTime = getEndDate(task.startTime, dateFormat, data[0]);
|
4168 | break;
|
4169 | case 2:
|
4170 | task.id = parseId();
|
4171 | task.startTime = getStartDate(undefined, dateFormat, data[0]);
|
4172 | task.endTime = getEndDate(task.startTime, dateFormat, data[1]);
|
4173 | break;
|
4174 | case 3:
|
4175 | task.id = parseId(data[0]);
|
4176 | task.startTime = getStartDate(undefined, dateFormat, data[1]);
|
4177 | task.endTime = getEndDate(task.startTime, dateFormat, data[2]);
|
4178 | break;
|
4179 | default:
|
4180 | }
|
4181 |
|
4182 | return task;
|
4183 | };
|
4184 |
|
4185 | var parseData = function parseData(prevTaskId, dataStr) {
|
4186 | var ds = void 0;
|
4187 | if (dataStr.substr(0, 1) === ':') {
|
4188 | ds = dataStr.substr(1, dataStr.length);
|
4189 | } else {
|
4190 | ds = dataStr;
|
4191 | }
|
4192 |
|
4193 | var data = ds.split(',');
|
4194 |
|
4195 | var task = {};
|
4196 |
|
4197 |
|
4198 | var matchFound = true;
|
4199 | while (matchFound) {
|
4200 | matchFound = false;
|
4201 | if (data[0].match(/^\s*active\s*$/)) {
|
4202 | task.active = true;
|
4203 | data.shift(1);
|
4204 | matchFound = true;
|
4205 | }
|
4206 | if (data[0].match(/^\s*done\s*$/)) {
|
4207 | task.done = true;
|
4208 | data.shift(1);
|
4209 | matchFound = true;
|
4210 | }
|
4211 | if (data[0].match(/^\s*crit\s*$/)) {
|
4212 | task.crit = true;
|
4213 | data.shift(1);
|
4214 | matchFound = true;
|
4215 | }
|
4216 | }
|
4217 | for (var i = 0; i < data.length; i++) {
|
4218 | data[i] = data[i].trim();
|
4219 | }
|
4220 |
|
4221 | switch (data.length) {
|
4222 | case 1:
|
4223 | task.id = parseId();
|
4224 | task.startTime = { type: 'prevTaskEnd', id: prevTaskId };
|
4225 | task.endTime = { data: data[0] };
|
4226 | break;
|
4227 | case 2:
|
4228 | task.id = parseId();
|
4229 | task.startTime = { type: 'getStartDate', startData: data[0] };
|
4230 | task.endTime = { data: data[1] };
|
4231 | break;
|
4232 | case 3:
|
4233 | task.id = parseId(data[0]);
|
4234 | task.startTime = { type: 'getStartDate', startData: data[1] };
|
4235 | task.endTime = { data: data[2] };
|
4236 | break;
|
4237 | default:
|
4238 | }
|
4239 |
|
4240 | return task;
|
4241 | };
|
4242 |
|
4243 | var lastTask = void 0;
|
4244 | var lastTaskID = void 0;
|
4245 | var rawTasks = [];
|
4246 | var taskDb = {};
|
4247 | var addTask = exports.addTask = function addTask(descr, data) {
|
4248 | var rawTask = {
|
4249 | section: currentSection,
|
4250 | type: currentSection,
|
4251 | processed: false,
|
4252 | raw: { data: data },
|
4253 | task: descr
|
4254 | };
|
4255 | var taskInfo = parseData(lastTaskID, data);
|
4256 | rawTask.raw.startTime = taskInfo.startTime;
|
4257 | rawTask.raw.endTime = taskInfo.endTime;
|
4258 | rawTask.id = taskInfo.id;
|
4259 | rawTask.prevTaskId = lastTaskID;
|
4260 | rawTask.active = taskInfo.active;
|
4261 | rawTask.done = taskInfo.done;
|
4262 | rawTask.crit = taskInfo.crit;
|
4263 |
|
4264 | var pos = rawTasks.push(rawTask);
|
4265 |
|
4266 | lastTaskID = rawTask.id;
|
4267 |
|
4268 | taskDb[rawTask.id] = pos - 1;
|
4269 | };
|
4270 |
|
4271 | var findTaskById = exports.findTaskById = function findTaskById(id) {
|
4272 | var pos = taskDb[id];
|
4273 | return rawTasks[pos];
|
4274 | };
|
4275 |
|
4276 | var addTaskOrg = exports.addTaskOrg = function addTaskOrg(descr, data) {
|
4277 | var newTask = {
|
4278 | section: currentSection,
|
4279 | type: currentSection,
|
4280 | description: descr,
|
4281 | task: descr
|
4282 | };
|
4283 | var taskInfo = compileData(lastTask, data);
|
4284 | newTask.startTime = taskInfo.startTime;
|
4285 | newTask.endTime = taskInfo.endTime;
|
4286 | newTask.id = taskInfo.id;
|
4287 | newTask.active = taskInfo.active;
|
4288 | newTask.done = taskInfo.done;
|
4289 | newTask.crit = taskInfo.crit;
|
4290 | lastTask = newTask;
|
4291 | tasks.push(newTask);
|
4292 | };
|
4293 |
|
4294 | var compileTasks = function compileTasks() {
|
4295 | var compileTask = function compileTask(pos) {
|
4296 | var task = rawTasks[pos];
|
4297 | var startTime = '';
|
4298 | switch (rawTasks[pos].raw.startTime.type) {
|
4299 | case 'prevTaskEnd':
|
4300 | var prevTask = findTaskById(task.prevTaskId);
|
4301 | task.startTime = prevTask.endTime;
|
4302 | break;
|
4303 | case 'getStartDate':
|
4304 | startTime = getStartDate(undefined, dateFormat, rawTasks[pos].raw.startTime.startData);
|
4305 | if (startTime) {
|
4306 | rawTasks[pos].startTime = startTime;
|
4307 | }
|
4308 | break;
|
4309 | }
|
4310 |
|
4311 | if (rawTasks[pos].startTime) {
|
4312 | rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, dateFormat, rawTasks[pos].raw.endTime.data);
|
4313 | if (rawTasks[pos].endTime) {
|
4314 | rawTasks[pos].processed = true;
|
4315 | }
|
4316 | }
|
4317 |
|
4318 | return rawTasks[pos].processed;
|
4319 | };
|
4320 |
|
4321 | var allProcessed = true;
|
4322 | for (var i = 0; i < rawTasks.length; i++) {
|
4323 | compileTask(i);
|
4324 |
|
4325 | allProcessed = allProcessed && rawTasks[i].processed;
|
4326 | }
|
4327 | return allProcessed;
|
4328 | };
|
4329 |
|
4330 | exports.default = {
|
4331 | clear: clear,
|
4332 | setDateFormat: setDateFormat,
|
4333 | setAxisFormat: setAxisFormat,
|
4334 | getAxisFormat: getAxisFormat,
|
4335 | setTitle: setTitle,
|
4336 | getTitle: getTitle,
|
4337 | addSection: addSection,
|
4338 | getTasks: getTasks,
|
4339 | addTask: addTask,
|
4340 | findTaskById: findTaskById,
|
4341 | addTaskOrg: addTaskOrg
|
4342 | };
|
4343 |
|
4344 | }),
|
4345 |
|
4346 | "./src/diagrams/gantt/ganttRenderer.js":
|
4347 |
|
4348 |
|
4349 |
|
4350 |
|
4351 | (function(module, exports, __webpack_require__) {
|
4352 |
|
4353 | "use strict";
|
4354 |
|
4355 |
|
4356 | Object.defineProperty(exports, "__esModule", {
|
4357 | value: true
|
4358 | });
|
4359 | exports.draw = exports.setConf = undefined;
|
4360 |
|
4361 | var _d = __webpack_require__( "d3");
|
4362 |
|
4363 | var d3 = _interopRequireWildcard(_d);
|
4364 |
|
4365 | var _gantt = __webpack_require__( "./src/diagrams/gantt/parser/gantt.js");
|
4366 |
|
4367 | var _ganttDb = __webpack_require__( "./src/diagrams/gantt/ganttDb.js");
|
4368 |
|
4369 | var _ganttDb2 = _interopRequireDefault(_ganttDb);
|
4370 |
|
4371 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
4372 |
|
4373 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
4374 |
|
4375 | _gantt.parser.yy = _ganttDb2.default;
|
4376 |
|
4377 | var conf = {
|
4378 | titleTopMargin: 25,
|
4379 | barHeight: 20,
|
4380 | barGap: 4,
|
4381 | topPadding: 50,
|
4382 | rightPadding: 75,
|
4383 | leftPadding: 75,
|
4384 | gridLineStartPadding: 35,
|
4385 | fontSize: 11,
|
4386 | fontFamily: '"Open-Sans", "sans-serif"'
|
4387 | };
|
4388 | var setConf = exports.setConf = function setConf(cnf) {
|
4389 | var keys = Object.keys(cnf);
|
4390 |
|
4391 | keys.forEach(function (key) {
|
4392 | conf[key] = cnf[key];
|
4393 | });
|
4394 | };
|
4395 | var w = void 0;
|
4396 | var draw = exports.draw = function draw(text, id) {
|
4397 | _gantt.parser.yy.clear();
|
4398 | _gantt.parser.parse(text);
|
4399 |
|
4400 | var elem = document.getElementById(id);
|
4401 | w = elem.parentElement.offsetWidth;
|
4402 |
|
4403 | if (typeof w === 'undefined') {
|
4404 | w = 1200;
|
4405 | }
|
4406 |
|
4407 | if (typeof conf.useWidth !== 'undefined') {
|
4408 | w = conf.useWidth;
|
4409 | }
|
4410 |
|
4411 | var taskArray = _gantt.parser.yy.getTasks();
|
4412 |
|
4413 |
|
4414 | var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
|
4415 |
|
4416 | elem.setAttribute('height', '100%');
|
4417 |
|
4418 | elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h);
|
4419 | var svg = d3.select('[id="' + id + '"]');
|
4420 |
|
4421 |
|
4422 | var timeScale = d3.scaleTime().domain([d3.min(taskArray, function (d) {
|
4423 | return d.startTime;
|
4424 | }), d3.max(taskArray, function (d) {
|
4425 | return d.endTime;
|
4426 | })]).rangeRound([0, w - conf.leftPadding - conf.rightPadding]);
|
4427 |
|
4428 | var categories = [];
|
4429 |
|
4430 | for (var i = 0; i < taskArray.length; i++) {
|
4431 | categories.push(taskArray[i].type);
|
4432 | }
|
4433 |
|
4434 | var catsUnfiltered = categories;
|
4435 |
|
4436 | categories = checkUnique(categories);
|
4437 |
|
4438 | makeGant(taskArray, w, h);
|
4439 | if (typeof conf.useWidth !== 'undefined') {
|
4440 | elem.setAttribute('width', w);
|
4441 | }
|
4442 |
|
4443 | svg.append('text').text(_gantt.parser.yy.getTitle()).attr('x', w / 2).attr('y', conf.titleTopMargin).attr('class', 'titleText');
|
4444 |
|
4445 | function makeGant(tasks, pageWidth, pageHeight) {
|
4446 | var barHeight = conf.barHeight;
|
4447 | var gap = barHeight + conf.barGap;
|
4448 | var topPadding = conf.topPadding;
|
4449 | var leftPadding = conf.leftPadding;
|
4450 |
|
4451 | var colorScale = d3.scaleLinear().domain([0, categories.length]).range(['#00B9FA', '#F95002']).interpolate(d3.interpolateHcl);
|
4452 |
|
4453 | makeGrid(leftPadding, topPadding, pageWidth, pageHeight);
|
4454 | drawRects(tasks, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth, pageHeight);
|
4455 | vertLabels(gap, topPadding, leftPadding, barHeight, colorScale);
|
4456 | drawToday(leftPadding, topPadding, pageWidth, pageHeight);
|
4457 | }
|
4458 |
|
4459 | function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w, h) {
|
4460 | svg.append('g').selectAll('rect').data(theArray).enter().append('rect').attr('x', 0).attr('y', function (d, i) {
|
4461 | return i * theGap + theTopPad - 2;
|
4462 | }).attr('width', function () {
|
4463 | return w - conf.rightPadding / 2;
|
4464 | }).attr('height', theGap).attr('class', function (d) {
|
4465 | for (var _i = 0; _i < categories.length; _i++) {
|
4466 | if (d.type === categories[_i]) {
|
4467 | return 'section section' + _i % conf.numberSectionStyles;
|
4468 | }
|
4469 | }
|
4470 | return 'section section0';
|
4471 | });
|
4472 |
|
4473 | var rectangles = svg.append('g').selectAll('rect').data(theArray).enter();
|
4474 |
|
4475 | rectangles.append('rect').attr('rx', 3).attr('ry', 3).attr('x', function (d) {
|
4476 | return timeScale(d.startTime) + theSidePad;
|
4477 | }).attr('y', function (d, i) {
|
4478 | return i * theGap + theTopPad;
|
4479 | }).attr('width', function (d) {
|
4480 | return timeScale(d.endTime) - timeScale(d.startTime);
|
4481 | }).attr('height', theBarHeight).attr('class', function (d) {
|
4482 | var res = 'task ';
|
4483 |
|
4484 | var secNum = 0;
|
4485 | for (var _i2 = 0; _i2 < categories.length; _i2++) {
|
4486 | if (d.type === categories[_i2]) {
|
4487 | secNum = _i2 % conf.numberSectionStyles;
|
4488 | }
|
4489 | }
|
4490 |
|
4491 | if (d.active) {
|
4492 | if (d.crit) {
|
4493 | return res + ' activeCrit' + secNum;
|
4494 | } else {
|
4495 | return res + ' active' + secNum;
|
4496 | }
|
4497 | }
|
4498 |
|
4499 | if (d.done) {
|
4500 | if (d.crit) {
|
4501 | return res + ' doneCrit' + secNum;
|
4502 | } else {
|
4503 | return res + ' done' + secNum;
|
4504 | }
|
4505 | }
|
4506 |
|
4507 | if (d.crit) {
|
4508 | return res + ' crit' + secNum;
|
4509 | }
|
4510 |
|
4511 | return res + ' task' + secNum;
|
4512 | });
|
4513 |
|
4514 | rectangles.append('text').text(function (d) {
|
4515 | return d.task;
|
4516 | }).attr('font-size', conf.fontSize).attr('x', function (d) {
|
4517 | var startX = timeScale(d.startTime);
|
4518 | var endX = timeScale(d.endTime);
|
4519 | var textWidth = this.getBBox().width;
|
4520 |
|
4521 |
|
4522 | if (textWidth > endX - startX) {
|
4523 | if (endX + textWidth + 1.5 * conf.leftPadding > w) {
|
4524 | return startX + theSidePad - 5;
|
4525 | } else {
|
4526 | return endX + theSidePad + 5;
|
4527 | }
|
4528 | } else {
|
4529 | return (endX - startX) / 2 + startX + theSidePad;
|
4530 | }
|
4531 | }).attr('y', function (d, i) {
|
4532 | return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;
|
4533 | }).attr('text-height', theBarHeight).attr('class', function (d) {
|
4534 | var startX = timeScale(d.startTime);
|
4535 | var endX = timeScale(d.endTime);
|
4536 | var textWidth = this.getBBox().width;
|
4537 | var secNum = 0;
|
4538 | for (var _i3 = 0; _i3 < categories.length; _i3++) {
|
4539 | if (d.type === categories[_i3]) {
|
4540 | secNum = _i3 % conf.numberSectionStyles;
|
4541 | }
|
4542 | }
|
4543 |
|
4544 | var taskType = '';
|
4545 | if (d.active) {
|
4546 | if (d.crit) {
|
4547 | taskType = 'activeCritText' + secNum;
|
4548 | } else {
|
4549 | taskType = 'activeText' + secNum;
|
4550 | }
|
4551 | }
|
4552 |
|
4553 | if (d.done) {
|
4554 | if (d.crit) {
|
4555 | taskType = taskType + ' doneCritText' + secNum;
|
4556 | } else {
|
4557 | taskType = taskType + ' doneText' + secNum;
|
4558 | }
|
4559 | } else {
|
4560 | if (d.crit) {
|
4561 | taskType = taskType + ' critText' + secNum;
|
4562 | }
|
4563 | }
|
4564 |
|
4565 |
|
4566 | if (textWidth > endX - startX) {
|
4567 | if (endX + textWidth + 1.5 * conf.leftPadding > w) {
|
4568 | return 'taskTextOutsideLeft taskTextOutside' + secNum + ' ' + taskType;
|
4569 | } else {
|
4570 | return 'taskTextOutsideRight taskTextOutside' + secNum + ' ' + taskType;
|
4571 | }
|
4572 | } else {
|
4573 | return 'taskText taskText' + secNum + ' ' + taskType;
|
4574 | }
|
4575 | });
|
4576 | }
|
4577 |
|
4578 | function makeGrid(theSidePad, theTopPad, w, h) {
|
4579 | var xAxis = d3.axisBottom(timeScale).tickSize(-h + theTopPad + conf.gridLineStartPadding).tickFormat(d3.timeFormat(_gantt.parser.yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d'));
|
4580 |
|
4581 | svg.append('g').attr('class', 'grid').attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')').call(xAxis).selectAll('text').style('text-anchor', 'middle').attr('fill', '#000').attr('stroke', 'none').attr('font-size', 10).attr('dy', '1em');
|
4582 | }
|
4583 |
|
4584 | function vertLabels(theGap, theTopPad) {
|
4585 | var numOccurances = [];
|
4586 | var prevGap = 0;
|
4587 |
|
4588 | for (var _i4 = 0; _i4 < categories.length; _i4++) {
|
4589 | numOccurances[_i4] = [categories[_i4], getCount(categories[_i4], catsUnfiltered)];
|
4590 | }
|
4591 |
|
4592 | svg.append('g')
|
4593 | .selectAll('text').data(numOccurances).enter().append('text').text(function (d) {
|
4594 | return d[0];
|
4595 | }).attr('x', 10).attr('y', function (d, i) {
|
4596 | if (i > 0) {
|
4597 | for (var j = 0; j < i; j++) {
|
4598 | prevGap += numOccurances[i - 1][1];
|
4599 | return d[1] * theGap / 2 + prevGap * theGap + theTopPad;
|
4600 | }
|
4601 | } else {
|
4602 | return d[1] * theGap / 2 + theTopPad;
|
4603 | }
|
4604 | }).attr('class', function (d) {
|
4605 | for (var _i5 = 0; _i5 < categories.length; _i5++) {
|
4606 | if (d[0] === categories[_i5]) {
|
4607 | return 'sectionTitle sectionTitle' + _i5 % conf.numberSectionStyles;
|
4608 | }
|
4609 | }
|
4610 | return 'sectionTitle';
|
4611 | });
|
4612 | }
|
4613 |
|
4614 | function drawToday(theSidePad, theTopPad, w, h) {
|
4615 | var todayG = svg.append('g').attr('class', 'today');
|
4616 |
|
4617 | var today = new Date();
|
4618 |
|
4619 | todayG.append('line').attr('x1', timeScale(today) + theSidePad).attr('x2', timeScale(today) + theSidePad).attr('y1', conf.titleTopMargin).attr('y2', h - conf.titleTopMargin).attr('class', 'today');
|
4620 | }
|
4621 |
|
4622 |
|
4623 | function checkUnique(arr) {
|
4624 | var hash = {};
|
4625 | var result = [];
|
4626 | for (var _i6 = 0, l = arr.length; _i6 < l; ++_i6) {
|
4627 | if (!hash.hasOwnProperty(arr[_i6])) {
|
4628 |
|
4629 | hash[arr[_i6]] = true;
|
4630 | result.push(arr[_i6]);
|
4631 | }
|
4632 | }
|
4633 | return result;
|
4634 | }
|
4635 |
|
4636 |
|
4637 | function getCounts(arr) {
|
4638 | var i = arr.length;
|
4639 | var obj = {};
|
4640 | while (i) {
|
4641 | obj[arr[--i]] = (obj[arr[i]] || 0) + 1;
|
4642 | }
|
4643 | return obj;
|
4644 | }
|
4645 |
|
4646 |
|
4647 | function getCount(word, arr) {
|
4648 | return getCounts(arr)[word] || 0;
|
4649 | }
|
4650 | };
|
4651 |
|
4652 | exports.default = {
|
4653 | setConf: setConf,
|
4654 | draw: draw
|
4655 | };
|
4656 |
|
4657 | }),
|
4658 |
|
4659 | "./src/diagrams/gantt/parser/gantt.js":
|
4660 |
|
4661 |
|
4662 |
|
4663 |
|
4664 | (function(module, exports, __webpack_require__) {
|
4665 |
|
4666 | "use strict";
|
4667 | (function(process, module) {
|
4668 |
|
4669 |
|
4670 |
|
4671 |
|
4672 |
|
4673 |
|
4674 |
|
4675 |
|
4676 |
|
4677 |
|
4678 |
|
4679 |
|
4680 |
|
4681 |
|
4682 |
|
4683 |
|
4684 |
|
4685 |
|
4686 |
|
4687 |
|
4688 |
|
4689 |
|
4690 |
|
4691 |
|
4692 |
|
4693 |
|
4694 |
|
4695 |
|
4696 |
|
4697 |
|
4698 |
|
4699 |
|
4700 |
|
4701 |
|
4702 |
|
4703 |
|
4704 |
|
4705 |
|
4706 |
|
4707 |
|
4708 |
|
4709 |
|
4710 |
|
4711 |
|
4712 |
|
4713 |
|
4714 |
|
4715 |
|
4716 |
|
4717 |
|
4718 |
|
4719 |
|
4720 |
|
4721 |
|
4722 |
|
4723 |
|
4724 |
|
4725 |
|
4726 |
|
4727 |
|
4728 |
|
4729 |
|
4730 |
|
4731 |
|
4732 |
|
4733 |
|
4734 |
|
4735 |
|
4736 |
|
4737 |
|
4738 |
|
4739 |
|
4740 |
|
4741 |
|
4742 | var parser = function () {
|
4743 | var o = function o(k, v, _o, l) {
|
4744 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
4745 | },
|
4746 | $V0 = [6, 8, 10, 11, 12, 13, 14, 15],
|
4747 | $V1 = [1, 9],
|
4748 | $V2 = [1, 10],
|
4749 | $V3 = [1, 11],
|
4750 | $V4 = [1, 12],
|
4751 | $V5 = [1, 13];
|
4752 | var parser = { trace: function trace() {},
|
4753 | yy: {},
|
4754 | symbols_: { "error": 2, "start": 3, "gantt": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NL": 10, "dateFormat": 11, "axisFormat": 12, "title": 13, "section": 14, "taskTxt": 15, "taskData": 16, "$accept": 0, "$end": 1 },
|
4755 | terminals_: { 2: "error", 4: "gantt", 6: "EOF", 8: "SPACE", 10: "NL", 11: "dateFormat", 12: "axisFormat", 13: "title", 14: "section", 15: "taskTxt", 16: "taskData" },
|
4756 | productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2]],
|
4757 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
4758 |
|
4759 |
|
4760 | var $0 = $$.length - 1;
|
4761 | switch (yystate) {
|
4762 | case 1:
|
4763 | return $$[$0 - 1];
|
4764 | break;
|
4765 | case 2:
|
4766 | this.$ = [];
|
4767 | break;
|
4768 | case 3:
|
4769 | $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1];
|
4770 | break;
|
4771 | case 4:case 5:
|
4772 | this.$ = $$[$0];
|
4773 | break;
|
4774 | case 6:case 7:
|
4775 | this.$ = [];
|
4776 | break;
|
4777 | case 8:
|
4778 | yy.setDateFormat($$[$0].substr(11));this.$ = $$[$0].substr(11);
|
4779 | break;
|
4780 | case 9:
|
4781 | yy.setAxisFormat($$[$0].substr(11));this.$ = $$[$0].substr(11);
|
4782 | break;
|
4783 | case 10:
|
4784 | yy.setTitle($$[$0].substr(6));this.$ = $$[$0].substr(6);
|
4785 | break;
|
4786 | case 11:
|
4787 | yy.addSection($$[$0].substr(8));this.$ = $$[$0].substr(8);
|
4788 | break;
|
4789 | case 12:
|
4790 | yy.addTask($$[$0 - 1], $$[$0]);this.$ = 'task';
|
4791 | break;
|
4792 | }
|
4793 | },
|
4794 | table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 13: $V3, 14: $V4, 15: $V5 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 14, 11: $V1, 12: $V2, 13: $V3, 14: $V4, 15: $V5 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 8]), o($V0, [2, 9]), o($V0, [2, 10]), o($V0, [2, 11]), { 16: [1, 15] }, o($V0, [2, 4]), o($V0, [2, 12])],
|
4795 | defaultActions: {},
|
4796 | parseError: function parseError(str, hash) {
|
4797 | if (hash.recoverable) {
|
4798 | this.trace(str);
|
4799 | } else {
|
4800 | var error = new Error(str);
|
4801 | error.hash = hash;
|
4802 | throw error;
|
4803 | }
|
4804 | },
|
4805 | parse: function parse(input) {
|
4806 | var self = this,
|
4807 | stack = [0],
|
4808 | tstack = [],
|
4809 | vstack = [null],
|
4810 | lstack = [],
|
4811 | table = this.table,
|
4812 | yytext = '',
|
4813 | yylineno = 0,
|
4814 | yyleng = 0,
|
4815 | recovering = 0,
|
4816 | TERROR = 2,
|
4817 | EOF = 1;
|
4818 | var args = lstack.slice.call(arguments, 1);
|
4819 | var lexer = Object.create(this.lexer);
|
4820 | var sharedState = { yy: {} };
|
4821 | for (var k in this.yy) {
|
4822 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
4823 | sharedState.yy[k] = this.yy[k];
|
4824 | }
|
4825 | }
|
4826 | lexer.setInput(input, sharedState.yy);
|
4827 | sharedState.yy.lexer = lexer;
|
4828 | sharedState.yy.parser = this;
|
4829 | if (typeof lexer.yylloc == 'undefined') {
|
4830 | lexer.yylloc = {};
|
4831 | }
|
4832 | var yyloc = lexer.yylloc;
|
4833 | lstack.push(yyloc);
|
4834 | var ranges = lexer.options && lexer.options.ranges;
|
4835 | if (typeof sharedState.yy.parseError === 'function') {
|
4836 | this.parseError = sharedState.yy.parseError;
|
4837 | } else {
|
4838 | this.parseError = Object.getPrototypeOf(this).parseError;
|
4839 | }
|
4840 | function popStack(n) {
|
4841 | stack.length = stack.length - 2 * n;
|
4842 | vstack.length = vstack.length - n;
|
4843 | lstack.length = lstack.length - n;
|
4844 | }
|
4845 | function lex() {
|
4846 | var token;
|
4847 | token = tstack.pop() || lexer.lex() || EOF;
|
4848 | if (typeof token !== 'number') {
|
4849 | if (token instanceof Array) {
|
4850 | tstack = token;
|
4851 | token = tstack.pop();
|
4852 | }
|
4853 | token = self.symbols_[token] || token;
|
4854 | }
|
4855 | return token;
|
4856 | }
|
4857 | var symbol,
|
4858 | preErrorSymbol,
|
4859 | state,
|
4860 | action,
|
4861 | a,
|
4862 | r,
|
4863 | yyval = {},
|
4864 | p,
|
4865 | len,
|
4866 | newState,
|
4867 | expected;
|
4868 | while (true) {
|
4869 | state = stack[stack.length - 1];
|
4870 | if (this.defaultActions[state]) {
|
4871 | action = this.defaultActions[state];
|
4872 | } else {
|
4873 | if (symbol === null || typeof symbol == 'undefined') {
|
4874 | symbol = lex();
|
4875 | }
|
4876 | action = table[state] && table[state][symbol];
|
4877 | }
|
4878 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
4879 | var errStr = '';
|
4880 | expected = [];
|
4881 | for (p in table[state]) {
|
4882 | if (this.terminals_[p] && p > TERROR) {
|
4883 | expected.push('\'' + this.terminals_[p] + '\'');
|
4884 | }
|
4885 | }
|
4886 | if (lexer.showPosition) {
|
4887 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
4888 | } else {
|
4889 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
4890 | }
|
4891 | this.parseError(errStr, {
|
4892 | text: lexer.match,
|
4893 | token: this.terminals_[symbol] || symbol,
|
4894 | line: lexer.yylineno,
|
4895 | loc: yyloc,
|
4896 | expected: expected
|
4897 | });
|
4898 | }
|
4899 | if (action[0] instanceof Array && action.length > 1) {
|
4900 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
4901 | }
|
4902 | switch (action[0]) {
|
4903 | case 1:
|
4904 | stack.push(symbol);
|
4905 | vstack.push(lexer.yytext);
|
4906 | lstack.push(lexer.yylloc);
|
4907 | stack.push(action[1]);
|
4908 | symbol = null;
|
4909 | if (!preErrorSymbol) {
|
4910 | yyleng = lexer.yyleng;
|
4911 | yytext = lexer.yytext;
|
4912 | yylineno = lexer.yylineno;
|
4913 | yyloc = lexer.yylloc;
|
4914 | if (recovering > 0) {
|
4915 | recovering--;
|
4916 | }
|
4917 | } else {
|
4918 | symbol = preErrorSymbol;
|
4919 | preErrorSymbol = null;
|
4920 | }
|
4921 | break;
|
4922 | case 2:
|
4923 | len = this.productions_[action[1]][1];
|
4924 | yyval.$ = vstack[vstack.length - len];
|
4925 | yyval._$ = {
|
4926 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
4927 | last_line: lstack[lstack.length - 1].last_line,
|
4928 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
4929 | last_column: lstack[lstack.length - 1].last_column
|
4930 | };
|
4931 | if (ranges) {
|
4932 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
4933 | }
|
4934 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
4935 | if (typeof r !== 'undefined') {
|
4936 | return r;
|
4937 | }
|
4938 | if (len) {
|
4939 | stack = stack.slice(0, -1 * len * 2);
|
4940 | vstack = vstack.slice(0, -1 * len);
|
4941 | lstack = lstack.slice(0, -1 * len);
|
4942 | }
|
4943 | stack.push(this.productions_[action[1]][0]);
|
4944 | vstack.push(yyval.$);
|
4945 | lstack.push(yyval._$);
|
4946 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
4947 | stack.push(newState);
|
4948 | break;
|
4949 | case 3:
|
4950 | return true;
|
4951 | }
|
4952 | }
|
4953 | return true;
|
4954 | } };
|
4955 |
|
4956 |
|
4957 | var lexer = function () {
|
4958 | var lexer = {
|
4959 |
|
4960 | EOF: 1,
|
4961 |
|
4962 | parseError: function parseError(str, hash) {
|
4963 | if (this.yy.parser) {
|
4964 | this.yy.parser.parseError(str, hash);
|
4965 | } else {
|
4966 | throw new Error(str);
|
4967 | }
|
4968 | },
|
4969 |
|
4970 |
|
4971 | setInput: function setInput(input, yy) {
|
4972 | this.yy = yy || this.yy || {};
|
4973 | this._input = input;
|
4974 | this._more = this._backtrack = this.done = false;
|
4975 | this.yylineno = this.yyleng = 0;
|
4976 | this.yytext = this.matched = this.match = '';
|
4977 | this.conditionStack = ['INITIAL'];
|
4978 | this.yylloc = {
|
4979 | first_line: 1,
|
4980 | first_column: 0,
|
4981 | last_line: 1,
|
4982 | last_column: 0
|
4983 | };
|
4984 | if (this.options.ranges) {
|
4985 | this.yylloc.range = [0, 0];
|
4986 | }
|
4987 | this.offset = 0;
|
4988 | return this;
|
4989 | },
|
4990 |
|
4991 |
|
4992 | input: function input() {
|
4993 | var ch = this._input[0];
|
4994 | this.yytext += ch;
|
4995 | this.yyleng++;
|
4996 | this.offset++;
|
4997 | this.match += ch;
|
4998 | this.matched += ch;
|
4999 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
5000 | if (lines) {
|
5001 | this.yylineno++;
|
5002 | this.yylloc.last_line++;
|
5003 | } else {
|
5004 | this.yylloc.last_column++;
|
5005 | }
|
5006 | if (this.options.ranges) {
|
5007 | this.yylloc.range[1]++;
|
5008 | }
|
5009 |
|
5010 | this._input = this._input.slice(1);
|
5011 | return ch;
|
5012 | },
|
5013 |
|
5014 |
|
5015 | unput: function unput(ch) {
|
5016 | var len = ch.length;
|
5017 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
5018 |
|
5019 | this._input = ch + this._input;
|
5020 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
5021 |
|
5022 | this.offset -= len;
|
5023 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
5024 | this.match = this.match.substr(0, this.match.length - 1);
|
5025 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
5026 |
|
5027 | if (lines.length - 1) {
|
5028 | this.yylineno -= lines.length - 1;
|
5029 | }
|
5030 | var r = this.yylloc.range;
|
5031 |
|
5032 | this.yylloc = {
|
5033 | first_line: this.yylloc.first_line,
|
5034 | last_line: this.yylineno + 1,
|
5035 | first_column: this.yylloc.first_column,
|
5036 | last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
|
5037 | };
|
5038 |
|
5039 | if (this.options.ranges) {
|
5040 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
5041 | }
|
5042 | this.yyleng = this.yytext.length;
|
5043 | return this;
|
5044 | },
|
5045 |
|
5046 |
|
5047 | more: function more() {
|
5048 | this._more = true;
|
5049 | return this;
|
5050 | },
|
5051 |
|
5052 |
|
5053 | reject: function reject() {
|
5054 | if (this.options.backtrack_lexer) {
|
5055 | this._backtrack = true;
|
5056 | } else {
|
5057 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
|
5058 | text: "",
|
5059 | token: null,
|
5060 | line: this.yylineno
|
5061 | });
|
5062 | }
|
5063 | return this;
|
5064 | },
|
5065 |
|
5066 |
|
5067 | less: function less(n) {
|
5068 | this.unput(this.match.slice(n));
|
5069 | },
|
5070 |
|
5071 |
|
5072 | pastInput: function pastInput() {
|
5073 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
5074 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
5075 | },
|
5076 |
|
5077 |
|
5078 | upcomingInput: function upcomingInput() {
|
5079 | var next = this.match;
|
5080 | if (next.length < 20) {
|
5081 | next += this._input.substr(0, 20 - next.length);
|
5082 | }
|
5083 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
5084 | },
|
5085 |
|
5086 |
|
5087 | showPosition: function showPosition() {
|
5088 | var pre = this.pastInput();
|
5089 | var c = new Array(pre.length + 1).join("-");
|
5090 | return pre + this.upcomingInput() + "\n" + c + "^";
|
5091 | },
|
5092 |
|
5093 |
|
5094 | test_match: function test_match(match, indexed_rule) {
|
5095 | var token, lines, backup;
|
5096 |
|
5097 | if (this.options.backtrack_lexer) {
|
5098 |
|
5099 | backup = {
|
5100 | yylineno: this.yylineno,
|
5101 | yylloc: {
|
5102 | first_line: this.yylloc.first_line,
|
5103 | last_line: this.last_line,
|
5104 | first_column: this.yylloc.first_column,
|
5105 | last_column: this.yylloc.last_column
|
5106 | },
|
5107 | yytext: this.yytext,
|
5108 | match: this.match,
|
5109 | matches: this.matches,
|
5110 | matched: this.matched,
|
5111 | yyleng: this.yyleng,
|
5112 | offset: this.offset,
|
5113 | _more: this._more,
|
5114 | _input: this._input,
|
5115 | yy: this.yy,
|
5116 | conditionStack: this.conditionStack.slice(0),
|
5117 | done: this.done
|
5118 | };
|
5119 | if (this.options.ranges) {
|
5120 | backup.yylloc.range = this.yylloc.range.slice(0);
|
5121 | }
|
5122 | }
|
5123 |
|
5124 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
5125 | if (lines) {
|
5126 | this.yylineno += lines.length;
|
5127 | }
|
5128 | this.yylloc = {
|
5129 | first_line: this.yylloc.last_line,
|
5130 | last_line: this.yylineno + 1,
|
5131 | first_column: this.yylloc.last_column,
|
5132 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
5133 | };
|
5134 | this.yytext += match[0];
|
5135 | this.match += match[0];
|
5136 | this.matches = match;
|
5137 | this.yyleng = this.yytext.length;
|
5138 | if (this.options.ranges) {
|
5139 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
5140 | }
|
5141 | this._more = false;
|
5142 | this._backtrack = false;
|
5143 | this._input = this._input.slice(match[0].length);
|
5144 | this.matched += match[0];
|
5145 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
5146 | if (this.done && this._input) {
|
5147 | this.done = false;
|
5148 | }
|
5149 | if (token) {
|
5150 | return token;
|
5151 | } else if (this._backtrack) {
|
5152 |
|
5153 | for (var k in backup) {
|
5154 | this[k] = backup[k];
|
5155 | }
|
5156 | return false;
|
5157 | }
|
5158 | return false;
|
5159 | },
|
5160 |
|
5161 |
|
5162 | next: function next() {
|
5163 | if (this.done) {
|
5164 | return this.EOF;
|
5165 | }
|
5166 | if (!this._input) {
|
5167 | this.done = true;
|
5168 | }
|
5169 |
|
5170 | var token, match, tempMatch, index;
|
5171 | if (!this._more) {
|
5172 | this.yytext = '';
|
5173 | this.match = '';
|
5174 | }
|
5175 | var rules = this._currentRules();
|
5176 | for (var i = 0; i < rules.length; i++) {
|
5177 | tempMatch = this._input.match(this.rules[rules[i]]);
|
5178 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
5179 | match = tempMatch;
|
5180 | index = i;
|
5181 | if (this.options.backtrack_lexer) {
|
5182 | token = this.test_match(tempMatch, rules[i]);
|
5183 | if (token !== false) {
|
5184 | return token;
|
5185 | } else if (this._backtrack) {
|
5186 | match = false;
|
5187 | continue;
|
5188 | } else {
|
5189 |
|
5190 | return false;
|
5191 | }
|
5192 | } else if (!this.options.flex) {
|
5193 | break;
|
5194 | }
|
5195 | }
|
5196 | }
|
5197 | if (match) {
|
5198 | token = this.test_match(match, rules[index]);
|
5199 | if (token !== false) {
|
5200 | return token;
|
5201 | }
|
5202 |
|
5203 | return false;
|
5204 | }
|
5205 | if (this._input === "") {
|
5206 | return this.EOF;
|
5207 | } else {
|
5208 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
5209 | text: "",
|
5210 | token: null,
|
5211 | line: this.yylineno
|
5212 | });
|
5213 | }
|
5214 | },
|
5215 |
|
5216 |
|
5217 | lex: function lex() {
|
5218 | var r = this.next();
|
5219 | if (r) {
|
5220 | return r;
|
5221 | } else {
|
5222 | return this.lex();
|
5223 | }
|
5224 | },
|
5225 |
|
5226 |
|
5227 | begin: function begin(condition) {
|
5228 | this.conditionStack.push(condition);
|
5229 | },
|
5230 |
|
5231 |
|
5232 | popState: function popState() {
|
5233 | var n = this.conditionStack.length - 1;
|
5234 | if (n > 0) {
|
5235 | return this.conditionStack.pop();
|
5236 | } else {
|
5237 | return this.conditionStack[0];
|
5238 | }
|
5239 | },
|
5240 |
|
5241 |
|
5242 | _currentRules: function _currentRules() {
|
5243 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
5244 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
5245 | } else {
|
5246 | return this.conditions["INITIAL"].rules;
|
5247 | }
|
5248 | },
|
5249 |
|
5250 |
|
5251 | topState: function topState(n) {
|
5252 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
5253 | if (n >= 0) {
|
5254 | return this.conditionStack[n];
|
5255 | } else {
|
5256 | return "INITIAL";
|
5257 | }
|
5258 | },
|
5259 |
|
5260 |
|
5261 | pushState: function pushState(condition) {
|
5262 | this.begin(condition);
|
5263 | },
|
5264 |
|
5265 |
|
5266 | stateStackSize: function stateStackSize() {
|
5267 | return this.conditionStack.length;
|
5268 | },
|
5269 | options: { "case-insensitive": true },
|
5270 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
5271 |
|
5272 |
|
5273 | var YYSTATE = YY_START;
|
5274 | switch ($avoiding_name_collisions) {
|
5275 | case 0:
|
5276 | return 10;
|
5277 | break;
|
5278 | case 1:
|
5279 |
|
5280 | break;
|
5281 | case 2:
|
5282 |
|
5283 | break;
|
5284 | case 3:
|
5285 |
|
5286 | break;
|
5287 | case 4:
|
5288 | return 4;
|
5289 | break;
|
5290 | case 5:
|
5291 | return 11;
|
5292 | break;
|
5293 | case 6:
|
5294 | return 12;
|
5295 | break;
|
5296 | case 7:
|
5297 | return 'date';
|
5298 | break;
|
5299 | case 8:
|
5300 | return 13;
|
5301 | break;
|
5302 | case 9:
|
5303 | return 14;
|
5304 | break;
|
5305 | case 10:
|
5306 | return 15;
|
5307 | break;
|
5308 | case 11:
|
5309 | return 16;
|
5310 | break;
|
5311 | case 12:
|
5312 | return ':';
|
5313 | break;
|
5314 | case 13:
|
5315 | return 6;
|
5316 | break;
|
5317 | case 14:
|
5318 | return 'INVALID';
|
5319 | break;
|
5320 | }
|
5321 | },
|
5322 | rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gantt\b)/i, /^(?:dateFormat\s[^#\n;]+)/i, /^(?:axisFormat\s[^#\n;]+)/i, /^(?:\d\d\d\d-\d\d-\d\d\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i],
|
5323 | conditions: { "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "inclusive": true } }
|
5324 | };
|
5325 | return lexer;
|
5326 | }();
|
5327 | parser.lexer = lexer;
|
5328 | function Parser() {
|
5329 | this.yy = {};
|
5330 | }
|
5331 | Parser.prototype = parser;parser.Parser = Parser;
|
5332 | return new Parser();
|
5333 | }();
|
5334 |
|
5335 | if (true) {
|
5336 | exports.parser = parser;
|
5337 | exports.Parser = parser.Parser;
|
5338 | exports.parse = function () {
|
5339 | return parser.parse.apply(parser, arguments);
|
5340 | };
|
5341 | exports.main = function commonjsMain(args) {
|
5342 | if (!args[1]) {
|
5343 | console.log('Usage: ' + args[0] + ' FILE');
|
5344 | process.exit(1);
|
5345 | }
|
5346 | var source = __webpack_require__( "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__( "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
|
5347 | return exports.parser.parse(source);
|
5348 | };
|
5349 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
5350 | exports.main(process.argv.slice(1));
|
5351 | }
|
5352 | }
|
5353 | }.call(this, __webpack_require__( "./node_modules/process/browser.js"), __webpack_require__( "./node_modules/webpack/buildin/module.js")(module)))
|
5354 |
|
5355 | }),
|
5356 |
|
5357 | "./src/diagrams/git/gitGraphAst.js":
|
5358 |
|
5359 |
|
5360 |
|
5361 |
|
5362 | (function(module, exports, __webpack_require__) {
|
5363 |
|
5364 | "use strict";
|
5365 |
|
5366 |
|
5367 | Object.defineProperty(exports, "__esModule", {
|
5368 | value: true
|
5369 | });
|
5370 | exports.getHead = exports.getDirection = exports.getCurrentBranch = exports.getCommitsArray = exports.getCommits = exports.getBranches = exports.getBranchesAsObjArray = exports.clear = exports.prettyPrint = exports.reset = exports.checkout = exports.merge = exports.branch = exports.commit = exports.getOptions = exports.setOptions = exports.setDirection = undefined;
|
5371 |
|
5372 | var _lodash = __webpack_require__( "lodash");
|
5373 |
|
5374 | var _lodash2 = _interopRequireDefault(_lodash);
|
5375 |
|
5376 | var _logger = __webpack_require__( "./src/logger.js");
|
5377 |
|
5378 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
5379 |
|
5380 | var commits = {};
|
5381 | var head = null;
|
5382 | var branches = { 'master': head };
|
5383 | var curBranch = 'master';
|
5384 | var direction = 'LR';
|
5385 | var seq = 0;
|
5386 |
|
5387 | function getRandomInt(min, max) {
|
5388 | return Math.floor(Math.random() * (max - min)) + min;
|
5389 | }
|
5390 |
|
5391 | function getId() {
|
5392 | var pool = '0123456789abcdef';
|
5393 | var id = '';
|
5394 | for (var i = 0; i < 7; i++) {
|
5395 | id += pool[getRandomInt(0, 16)];
|
5396 | }
|
5397 | return id;
|
5398 | }
|
5399 |
|
5400 | function isfastforwardable(currentCommit, otherCommit) {
|
5401 | _logger.logger.debug('Entering isfastforwardable:', currentCommit.id, otherCommit.id);
|
5402 | while (currentCommit.seq <= otherCommit.seq && currentCommit !== otherCommit) {
|
5403 |
|
5404 | if (otherCommit.parent == null) break;
|
5405 | if (Array.isArray(otherCommit.parent)) {
|
5406 | _logger.logger.debug('In merge commit:', otherCommit.parent);
|
5407 | return isfastforwardable(currentCommit, commits[otherCommit.parent[0]]) || isfastforwardable(currentCommit, commits[otherCommit.parent[1]]);
|
5408 | } else {
|
5409 | otherCommit = commits[otherCommit.parent];
|
5410 | }
|
5411 | }
|
5412 | _logger.logger.debug(currentCommit.id, otherCommit.id);
|
5413 | return currentCommit.id === otherCommit.id;
|
5414 | }
|
5415 |
|
5416 | function isReachableFrom(currentCommit, otherCommit) {
|
5417 | var currentSeq = currentCommit.seq;
|
5418 | var otherSeq = otherCommit.seq;
|
5419 | if (currentSeq > otherSeq) return isfastforwardable(otherCommit, currentCommit);
|
5420 | return false;
|
5421 | }
|
5422 |
|
5423 | var setDirection = exports.setDirection = function setDirection(dir) {
|
5424 | direction = dir;
|
5425 | };
|
5426 | var options = {};
|
5427 | var setOptions = exports.setOptions = function setOptions(rawOptString) {
|
5428 | _logger.logger.debug('options str', rawOptString);
|
5429 | rawOptString = rawOptString && rawOptString.trim();
|
5430 | rawOptString = rawOptString || '{}';
|
5431 | try {
|
5432 | options = JSON.parse(rawOptString);
|
5433 | } catch (e) {
|
5434 | _logger.logger.error('error while parsing gitGraph options', e.message);
|
5435 | }
|
5436 | };
|
5437 |
|
5438 | var getOptions = exports.getOptions = function getOptions() {
|
5439 | return options;
|
5440 | };
|
5441 |
|
5442 | var commit = exports.commit = function commit(msg) {
|
5443 | var commit = {
|
5444 | id: getId(),
|
5445 | message: msg,
|
5446 | seq: seq++,
|
5447 | parent: head == null ? null : head.id
|
5448 | };
|
5449 | head = commit;
|
5450 | commits[commit.id] = commit;
|
5451 | branches[curBranch] = commit.id;
|
5452 | _logger.logger.debug('in pushCommit ' + commit.id);
|
5453 | };
|
5454 |
|
5455 | var branch = exports.branch = function branch(name) {
|
5456 | branches[name] = head != null ? head.id : null;
|
5457 | _logger.logger.debug('in createBranch');
|
5458 | };
|
5459 |
|
5460 | var merge = exports.merge = function merge(otherBranch) {
|
5461 | var currentCommit = commits[branches[curBranch]];
|
5462 | var otherCommit = commits[branches[otherBranch]];
|
5463 | if (isReachableFrom(currentCommit, otherCommit)) {
|
5464 | _logger.logger.debug('Already merged');
|
5465 | return;
|
5466 | }
|
5467 | if (isfastforwardable(currentCommit, otherCommit)) {
|
5468 | branches[curBranch] = branches[otherBranch];
|
5469 | head = commits[branches[curBranch]];
|
5470 | } else {
|
5471 |
|
5472 | var _commit = {
|
5473 | id: getId(),
|
5474 | message: 'merged branch ' + otherBranch + ' into ' + curBranch,
|
5475 | seq: seq++,
|
5476 | parent: [head == null ? null : head.id, branches[otherBranch]]
|
5477 | };
|
5478 | head = _commit;
|
5479 | commits[_commit.id] = _commit;
|
5480 | branches[curBranch] = _commit.id;
|
5481 | }
|
5482 | _logger.logger.debug(branches);
|
5483 | _logger.logger.debug('in mergeBranch');
|
5484 | };
|
5485 |
|
5486 | var checkout = exports.checkout = function checkout(branch) {
|
5487 | _logger.logger.debug('in checkout');
|
5488 | curBranch = branch;
|
5489 | var id = branches[curBranch];
|
5490 | head = commits[id];
|
5491 | };
|
5492 |
|
5493 | var reset = exports.reset = function reset(commitRef) {
|
5494 | _logger.logger.debug('in reset', commitRef);
|
5495 | var ref = commitRef.split(':')[0];
|
5496 | var parentCount = parseInt(commitRef.split(':')[1]);
|
5497 | var commit = ref === 'HEAD' ? head : commits[branches[ref]];
|
5498 | _logger.logger.debug(commit, parentCount);
|
5499 | while (parentCount > 0) {
|
5500 | commit = commits[commit.parent];
|
5501 | parentCount--;
|
5502 | if (!commit) {
|
5503 | var err = 'Critical error - unique parent commit not found during reset';
|
5504 | _logger.logger.error(err);
|
5505 | throw err;
|
5506 | }
|
5507 | }
|
5508 | head = commit;
|
5509 | branches[curBranch] = commit.id;
|
5510 | };
|
5511 |
|
5512 | function upsert(arr, key, newval) {
|
5513 | var index = arr.indexOf(key);
|
5514 | if (index === -1) {
|
5515 | arr.push(newval);
|
5516 | } else {
|
5517 | arr.splice(index, 1, newval);
|
5518 | }
|
5519 | }
|
5520 |
|
5521 | function prettyPrintCommitHistory(commitArr) {
|
5522 | var commit = _lodash2.default.maxBy(commitArr, 'seq');
|
5523 | var line = '';
|
5524 | commitArr.forEach(function (c) {
|
5525 | if (c === commit) {
|
5526 | line += '\t*';
|
5527 | } else {
|
5528 | line += '\t|';
|
5529 | }
|
5530 | });
|
5531 | var label = [line, commit.id, commit.seq];
|
5532 | _lodash2.default.each(branches, function (value, key) {
|
5533 | if (value === commit.id) label.push(key);
|
5534 | });
|
5535 | _logger.logger.debug(label.join(' '));
|
5536 | if (Array.isArray(commit.parent)) {
|
5537 | var newCommit = commits[commit.parent[0]];
|
5538 | upsert(commitArr, commit, newCommit);
|
5539 | commitArr.push(commits[commit.parent[1]]);
|
5540 | } else if (commit.parent == null) {
|
5541 | return;
|
5542 | } else {
|
5543 | var nextCommit = commits[commit.parent];
|
5544 | upsert(commitArr, commit, nextCommit);
|
5545 | }
|
5546 | commitArr = _lodash2.default.uniqBy(commitArr, 'id');
|
5547 | prettyPrintCommitHistory(commitArr);
|
5548 | }
|
5549 |
|
5550 | var prettyPrint = exports.prettyPrint = function prettyPrint() {
|
5551 | _logger.logger.debug(commits);
|
5552 | var node = getCommitsArray()[0];
|
5553 | prettyPrintCommitHistory([node]);
|
5554 | };
|
5555 |
|
5556 | var clear = exports.clear = function clear() {
|
5557 | commits = {};
|
5558 | head = null;
|
5559 | branches = { 'master': head };
|
5560 | curBranch = 'master';
|
5561 | seq = 0;
|
5562 | };
|
5563 |
|
5564 | var getBranchesAsObjArray = exports.getBranchesAsObjArray = function getBranchesAsObjArray() {
|
5565 | var branchArr = _lodash2.default.map(branches, function (value, key) {
|
5566 | return { 'name': key, 'commit': commits[value] };
|
5567 | });
|
5568 | return branchArr;
|
5569 | };
|
5570 |
|
5571 | var getBranches = exports.getBranches = function getBranches() {
|
5572 | return branches;
|
5573 | };
|
5574 | var getCommits = exports.getCommits = function getCommits() {
|
5575 | return commits;
|
5576 | };
|
5577 | var getCommitsArray = exports.getCommitsArray = function getCommitsArray() {
|
5578 | var commitArr = Object.keys(commits).map(function (key) {
|
5579 | return commits[key];
|
5580 | });
|
5581 | commitArr.forEach(function (o) {
|
5582 | _logger.logger.debug(o.id);
|
5583 | });
|
5584 | return _lodash2.default.orderBy(commitArr, ['seq'], ['desc']);
|
5585 | };
|
5586 | var getCurrentBranch = exports.getCurrentBranch = function getCurrentBranch() {
|
5587 | return curBranch;
|
5588 | };
|
5589 | var getDirection = exports.getDirection = function getDirection() {
|
5590 | return direction;
|
5591 | };
|
5592 | var getHead = exports.getHead = function getHead() {
|
5593 | return head;
|
5594 | };
|
5595 |
|
5596 | exports.default = {
|
5597 | setDirection: setDirection,
|
5598 | setOptions: setOptions,
|
5599 | getOptions: getOptions,
|
5600 | commit: commit,
|
5601 | branch: branch,
|
5602 | merge: merge,
|
5603 | checkout: checkout,
|
5604 | reset: reset,
|
5605 | prettyPrint: prettyPrint,
|
5606 | clear: clear,
|
5607 | getBranchesAsObjArray: getBranchesAsObjArray,
|
5608 | getBranches: getBranches,
|
5609 | getCommits: getCommits,
|
5610 | getCommitsArray: getCommitsArray,
|
5611 | getCurrentBranch: getCurrentBranch,
|
5612 | getDirection: getDirection,
|
5613 | getHead: getHead
|
5614 | };
|
5615 |
|
5616 | }),
|
5617 |
|
5618 | "./src/diagrams/git/gitGraphRenderer.js":
|
5619 |
|
5620 |
|
5621 |
|
5622 |
|
5623 | (function(module, exports, __webpack_require__) {
|
5624 |
|
5625 | "use strict";
|
5626 |
|
5627 |
|
5628 | Object.defineProperty(exports, "__esModule", {
|
5629 | value: true
|
5630 | });
|
5631 | exports.draw = exports.setConf = undefined;
|
5632 |
|
5633 | var _lodash = __webpack_require__( "lodash");
|
5634 |
|
5635 | var _lodash2 = _interopRequireDefault(_lodash);
|
5636 |
|
5637 | var _d = __webpack_require__( "d3");
|
5638 |
|
5639 | var d3 = _interopRequireWildcard(_d);
|
5640 |
|
5641 | var _gitGraphAst = __webpack_require__( "./src/diagrams/git/gitGraphAst.js");
|
5642 |
|
5643 | var _gitGraphAst2 = _interopRequireDefault(_gitGraphAst);
|
5644 |
|
5645 | var _gitGraph = __webpack_require__( "./src/diagrams/git/parser/gitGraph.js");
|
5646 |
|
5647 | var _gitGraph2 = _interopRequireDefault(_gitGraph);
|
5648 |
|
5649 | var _logger = __webpack_require__( "./src/logger.js");
|
5650 |
|
5651 | var _utils = __webpack_require__( "./src/utils.js");
|
5652 |
|
5653 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
5654 |
|
5655 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
5656 |
|
5657 | var allCommitsDict = {};
|
5658 | var branchNum = void 0;
|
5659 | var config = {
|
5660 | nodeSpacing: 150,
|
5661 | nodeFillColor: 'yellow',
|
5662 | nodeStrokeWidth: 2,
|
5663 | nodeStrokeColor: 'grey',
|
5664 | lineStrokeWidth: 4,
|
5665 | branchOffset: 50,
|
5666 | lineColor: 'grey',
|
5667 | leftMargin: 50,
|
5668 | branchColors: ['#442f74', '#983351', '#609732', '#AA9A39'],
|
5669 | nodeRadius: 10,
|
5670 | nodeLabel: {
|
5671 | width: 75,
|
5672 | height: 100,
|
5673 | x: -25,
|
5674 | y: 0
|
5675 | }
|
5676 | };
|
5677 | var apiConfig = {};
|
5678 | var setConf = exports.setConf = function setConf(c) {
|
5679 | apiConfig = c;
|
5680 | };
|
5681 |
|
5682 | function svgCreateDefs(svg) {
|
5683 | svg.append('defs').append('g').attr('id', 'def-commit').append('circle').attr('r', config.nodeRadius).attr('cx', 0).attr('cy', 0);
|
5684 | svg.select('#def-commit').append('foreignObject').attr('width', config.nodeLabel.width).attr('height', config.nodeLabel.height).attr('x', config.nodeLabel.x).attr('y', config.nodeLabel.y).attr('class', 'node-label').attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility').append('p').html('');
|
5685 | }
|
5686 |
|
5687 | function svgDrawLine(svg, points, colorIdx, interpolate) {
|
5688 | var curve = (0, _utils.interpolateToCurve)(interpolate, d3.curveBasis);
|
5689 | var color = config.branchColors[colorIdx % config.branchColors.length];
|
5690 | var lineGen = d3.line().x(function (d) {
|
5691 | return Math.round(d.x);
|
5692 | }).y(function (d) {
|
5693 | return Math.round(d.y);
|
5694 | }).curve(curve);
|
5695 |
|
5696 | svg.append('svg:path').attr('d', lineGen(points)).style('stroke', color).style('stroke-width', config.lineStrokeWidth).style('fill', 'none');
|
5697 | }
|
5698 |
|
5699 |
|
5700 | function getElementCoords(element, coords) {
|
5701 | coords = coords || element.node().getBBox();
|
5702 | var ctm = element.node().getCTM();
|
5703 | var xn = ctm.e + coords.x * ctm.a;
|
5704 | var yn = ctm.f + coords.y * ctm.d;
|
5705 | return {
|
5706 | left: xn,
|
5707 | top: yn,
|
5708 | width: coords.width,
|
5709 | height: coords.height
|
5710 | };
|
5711 | }
|
5712 |
|
5713 | function svgDrawLineForCommits(svg, fromId, toId, direction, color) {
|
5714 | _logger.logger.debug('svgDrawLineForCommits: ', fromId, toId);
|
5715 | var fromBbox = getElementCoords(svg.select('#node-' + fromId + ' circle'));
|
5716 | var toBbox = getElementCoords(svg.select('#node-' + toId + ' circle'));
|
5717 | switch (direction) {
|
5718 | case 'LR':
|
5719 |
|
5720 |
|
5721 |
|
5722 | if (fromBbox.left - toBbox.left > config.nodeSpacing) {
|
5723 | var lineStart = { x: fromBbox.left - config.nodeSpacing, y: toBbox.top + toBbox.height / 2 };
|
5724 | var lineEnd = { x: toBbox.left + toBbox.width, y: toBbox.top + toBbox.height / 2 };
|
5725 | svgDrawLine(svg, [lineStart, lineEnd], color, 'linear');
|
5726 | svgDrawLine(svg, [{ x: fromBbox.left, y: fromBbox.top + fromBbox.height / 2 }, { x: fromBbox.left - config.nodeSpacing / 2, y: fromBbox.top + fromBbox.height / 2 }, { x: fromBbox.left - config.nodeSpacing / 2, y: lineStart.y }, lineStart], color);
|
5727 | } else {
|
5728 | svgDrawLine(svg, [{
|
5729 | 'x': fromBbox.left,
|
5730 | 'y': fromBbox.top + fromBbox.height / 2
|
5731 | }, {
|
5732 | 'x': fromBbox.left - config.nodeSpacing / 2,
|
5733 | 'y': fromBbox.top + fromBbox.height / 2
|
5734 | }, {
|
5735 | 'x': fromBbox.left - config.nodeSpacing / 2,
|
5736 | 'y': toBbox.top + toBbox.height / 2
|
5737 | }, {
|
5738 | 'x': toBbox.left + toBbox.width,
|
5739 | 'y': toBbox.top + toBbox.height / 2
|
5740 | }], color);
|
5741 | }
|
5742 | break;
|
5743 | case 'BT':
|
5744 |
|
5745 |
|
5746 |
|
5747 |
|
5748 | if (toBbox.top - fromBbox.top > config.nodeSpacing) {
|
5749 | var _lineStart = { x: toBbox.left + toBbox.width / 2, y: fromBbox.top + fromBbox.height + config.nodeSpacing };
|
5750 | var _lineEnd = { x: toBbox.left + toBbox.width / 2, y: toBbox.top };
|
5751 | svgDrawLine(svg, [_lineStart, _lineEnd], color, 'linear');
|
5752 | svgDrawLine(svg, [{ x: fromBbox.left + fromBbox.width / 2, y: fromBbox.top + fromBbox.height }, { x: fromBbox.left + fromBbox.width / 2, y: fromBbox.top + fromBbox.height + config.nodeSpacing / 2 }, { x: toBbox.left + toBbox.width / 2, y: _lineStart.y - config.nodeSpacing / 2 }, _lineStart], color);
|
5753 | } else {
|
5754 | svgDrawLine(svg, [{
|
5755 | 'x': fromBbox.left + fromBbox.width / 2,
|
5756 | 'y': fromBbox.top + fromBbox.height
|
5757 | }, {
|
5758 | 'x': fromBbox.left + fromBbox.width / 2,
|
5759 | 'y': fromBbox.top + config.nodeSpacing / 2
|
5760 | }, {
|
5761 | 'x': toBbox.left + toBbox.width / 2,
|
5762 | 'y': toBbox.top - config.nodeSpacing / 2
|
5763 | }, {
|
5764 | 'x': toBbox.left + toBbox.width / 2,
|
5765 | 'y': toBbox.top
|
5766 | }], color);
|
5767 | }
|
5768 | break;
|
5769 | }
|
5770 | }
|
5771 |
|
5772 | function cloneNode(svg, selector) {
|
5773 | return svg.select(selector).node().cloneNode(true);
|
5774 | }
|
5775 |
|
5776 | function renderCommitHistory(svg, commitid, branches, direction) {
|
5777 | var commit = void 0;
|
5778 | var numCommits = Object.keys(allCommitsDict).length;
|
5779 | if (_lodash2.default.isString(commitid)) {
|
5780 | do {
|
5781 | commit = allCommitsDict[commitid];
|
5782 | _logger.logger.debug('in renderCommitHistory', commit.id, commit.seq);
|
5783 | if (svg.select('#node-' + commitid).size() > 0) {
|
5784 | return;
|
5785 | }
|
5786 | svg.append(function () {
|
5787 | return cloneNode(svg, '#def-commit');
|
5788 | }).attr('class', 'commit').attr('id', function () {
|
5789 | return 'node-' + commit.id;
|
5790 | }).attr('transform', function () {
|
5791 | switch (direction) {
|
5792 | case 'LR':
|
5793 | return 'translate(' + (commit.seq * config.nodeSpacing + config.leftMargin) + ', ' + branchNum * config.branchOffset + ')';
|
5794 | case 'BT':
|
5795 | return 'translate(' + (branchNum * config.branchOffset + config.leftMargin) + ', ' + (numCommits - commit.seq) * config.nodeSpacing + ')';
|
5796 | }
|
5797 | }).attr('fill', config.nodeFillColor).attr('stroke', config.nodeStrokeColor).attr('stroke-width', config.nodeStrokeWidth);
|
5798 |
|
5799 | var branch = _lodash2.default.find(branches, ['commit', commit]);
|
5800 | if (branch) {
|
5801 | _logger.logger.debug('found branch ', branch.name);
|
5802 | svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'branch-label').text(branch.name + ', ');
|
5803 | }
|
5804 | svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-id').text(commit.id);
|
5805 | if (commit.message !== '' && direction === 'BT') {
|
5806 | svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-msg').text(', ' + commit.message);
|
5807 | }
|
5808 | commitid = commit.parent;
|
5809 | } while (commitid && allCommitsDict[commitid]);
|
5810 | }
|
5811 |
|
5812 | if (_lodash2.default.isArray(commitid)) {
|
5813 | _logger.logger.debug('found merge commmit', commitid);
|
5814 | renderCommitHistory(svg, commitid[0], branches, direction);
|
5815 | branchNum++;
|
5816 | renderCommitHistory(svg, commitid[1], branches, direction);
|
5817 | branchNum--;
|
5818 | }
|
5819 | }
|
5820 |
|
5821 | function renderLines(svg, commit, direction, branchColor) {
|
5822 | branchColor = branchColor || 0;
|
5823 | while (commit.seq > 0 && !commit.lineDrawn) {
|
5824 | if (_lodash2.default.isString(commit.parent)) {
|
5825 | svgDrawLineForCommits(svg, commit.id, commit.parent, direction, branchColor);
|
5826 | commit.lineDrawn = true;
|
5827 | commit = allCommitsDict[commit.parent];
|
5828 | } else if (_lodash2.default.isArray(commit.parent)) {
|
5829 | svgDrawLineForCommits(svg, commit.id, commit.parent[0], direction, branchColor);
|
5830 | svgDrawLineForCommits(svg, commit.id, commit.parent[1], direction, branchColor + 1);
|
5831 | renderLines(svg, allCommitsDict[commit.parent[1]], direction, branchColor + 1);
|
5832 | commit.lineDrawn = true;
|
5833 | commit = allCommitsDict[commit.parent[0]];
|
5834 | }
|
5835 | }
|
5836 | }
|
5837 |
|
5838 | var draw = exports.draw = function draw(txt, id, ver) {
|
5839 | try {
|
5840 | var parser = _gitGraph2.default.parser;
|
5841 | parser.yy = _gitGraphAst2.default;
|
5842 |
|
5843 | _logger.logger.debug('in gitgraph renderer', txt, id, ver);
|
5844 |
|
5845 | parser.parse(txt + '\n');
|
5846 |
|
5847 | config = _lodash2.default.extend(config, apiConfig, _gitGraphAst2.default.getOptions());
|
5848 | _logger.logger.debug('effective options', config);
|
5849 | var direction = _gitGraphAst2.default.getDirection();
|
5850 | allCommitsDict = _gitGraphAst2.default.getCommits();
|
5851 | var branches = _gitGraphAst2.default.getBranchesAsObjArray();
|
5852 | if (direction === 'BT') {
|
5853 | config.nodeLabel.x = branches.length * config.branchOffset;
|
5854 | config.nodeLabel.width = '100%';
|
5855 | config.nodeLabel.y = -1 * 2 * config.nodeRadius;
|
5856 | }
|
5857 | var svg = d3.select('[id="' + id + '"]');
|
5858 | svgCreateDefs(svg);
|
5859 | branchNum = 1;
|
5860 | _lodash2.default.each(branches, function (v) {
|
5861 | renderCommitHistory(svg, v.commit.id, branches, direction);
|
5862 | renderLines(svg, v.commit, direction);
|
5863 | branchNum++;
|
5864 | });
|
5865 | svg.attr('height', function () {
|
5866 | if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing;
|
5867 | return (branches.length + 1) * config.branchOffset;
|
5868 | });
|
5869 | } catch (e) {
|
5870 | _logger.logger.error('Error while rendering gitgraph');
|
5871 | _logger.logger.error(e.message);
|
5872 | }
|
5873 | };
|
5874 |
|
5875 | exports.default = {
|
5876 | setConf: setConf,
|
5877 | draw: draw
|
5878 | };
|
5879 |
|
5880 | }),
|
5881 |
|
5882 | "./src/diagrams/git/parser/gitGraph.js":
|
5883 |
|
5884 |
|
5885 |
|
5886 |
|
5887 | (function(module, exports, __webpack_require__) {
|
5888 |
|
5889 | "use strict";
|
5890 | (function(process, module) {
|
5891 |
|
5892 |
|
5893 |
|
5894 |
|
5895 |
|
5896 |
|
5897 |
|
5898 |
|
5899 |
|
5900 |
|
5901 |
|
5902 |
|
5903 |
|
5904 |
|
5905 |
|
5906 |
|
5907 |
|
5908 |
|
5909 |
|
5910 |
|
5911 |
|
5912 |
|
5913 |
|
5914 |
|
5915 |
|
5916 |
|
5917 |
|
5918 |
|
5919 |
|
5920 |
|
5921 |
|
5922 |
|
5923 |
|
5924 |
|
5925 |
|
5926 |
|
5927 |
|
5928 |
|
5929 |
|
5930 |
|
5931 |
|
5932 |
|
5933 |
|
5934 |
|
5935 |
|
5936 |
|
5937 |
|
5938 |
|
5939 |
|
5940 |
|
5941 |
|
5942 |
|
5943 |
|
5944 |
|
5945 |
|
5946 |
|
5947 |
|
5948 |
|
5949 |
|
5950 |
|
5951 |
|
5952 |
|
5953 |
|
5954 |
|
5955 |
|
5956 |
|
5957 |
|
5958 |
|
5959 |
|
5960 |
|
5961 |
|
5962 |
|
5963 |
|
5964 |
|
5965 | var parser = function () {
|
5966 | var o = function o(k, v, _o, l) {
|
5967 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
5968 | },
|
5969 | $V0 = [2, 3],
|
5970 | $V1 = [1, 7],
|
5971 | $V2 = [7, 12, 15, 17, 19, 20, 21],
|
5972 | $V3 = [7, 11, 12, 15, 17, 19, 20, 21],
|
5973 | $V4 = [2, 20],
|
5974 | $V5 = [1, 32];
|
5975 | var parser = { trace: function trace() {},
|
5976 | yy: {},
|
5977 | symbols_: { "error": 2, "start": 3, "GG": 4, ":": 5, "document": 6, "EOF": 7, "DIR": 8, "options": 9, "body": 10, "OPT": 11, "NL": 12, "line": 13, "statement": 14, "COMMIT": 15, "commit_arg": 16, "BRANCH": 17, "ID": 18, "CHECKOUT": 19, "MERGE": 20, "RESET": 21, "reset_arg": 22, "STR": 23, "HEAD": 24, "reset_parents": 25, "CARET": 26, "$accept": 0, "$end": 1 },
|
5978 | terminals_: { 2: "error", 4: "GG", 5: ":", 7: "EOF", 8: "DIR", 11: "OPT", 12: "NL", 15: "COMMIT", 17: "BRANCH", 18: "ID", 19: "CHECKOUT", 20: "MERGE", 21: "RESET", 23: "STR", 24: "HEAD", 26: "CARET" },
|
5979 | productions_: [0, [3, 4], [3, 5], [6, 0], [6, 2], [9, 2], [9, 1], [10, 0], [10, 2], [13, 2], [13, 1], [14, 2], [14, 2], [14, 2], [14, 2], [14, 2], [16, 0], [16, 1], [22, 2], [22, 2], [25, 0], [25, 2]],
|
5980 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
5981 |
|
5982 |
|
5983 | var $0 = $$.length - 1;
|
5984 | switch (yystate) {
|
5985 | case 1:
|
5986 | return $$[$0 - 1];
|
5987 | break;
|
5988 | case 2:
|
5989 | yy.setDirection($$[$0 - 3]);return $$[$0 - 1];
|
5990 | break;
|
5991 | case 4:
|
5992 | yy.setOptions($$[$0 - 1]);this.$ = $$[$0];
|
5993 | break;
|
5994 | case 5:
|
5995 | $$[$0 - 1] += $$[$0];this.$ = $$[$0 - 1];
|
5996 | break;
|
5997 | case 7:
|
5998 | this.$ = [];
|
5999 | break;
|
6000 | case 8:
|
6001 | $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1];
|
6002 | break;
|
6003 | case 9:
|
6004 | this.$ = $$[$0 - 1];
|
6005 | break;
|
6006 | case 11:
|
6007 | yy.commit($$[$0]);
|
6008 | break;
|
6009 | case 12:
|
6010 | yy.branch($$[$0]);
|
6011 | break;
|
6012 | case 13:
|
6013 | yy.checkout($$[$0]);
|
6014 | break;
|
6015 | case 14:
|
6016 | yy.merge($$[$0]);
|
6017 | break;
|
6018 | case 15:
|
6019 | yy.reset($$[$0]);
|
6020 | break;
|
6021 | case 16:
|
6022 | this.$ = "";
|
6023 | break;
|
6024 | case 17:
|
6025 | this.$ = $$[$0];
|
6026 | break;
|
6027 | case 18:
|
6028 | this.$ = $$[$0 - 1] + ":" + $$[$0];
|
6029 | break;
|
6030 | case 19:
|
6031 | this.$ = $$[$0 - 1] + ":" + yy.count;yy.count = 0;
|
6032 | break;
|
6033 | case 20:
|
6034 | yy.count = 0;
|
6035 | break;
|
6036 | case 21:
|
6037 | yy.count += 1;
|
6038 | break;
|
6039 | }
|
6040 | },
|
6041 | table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3], 8: [1, 4] }, { 6: 5, 7: $V0, 9: 6, 12: $V1 }, { 5: [1, 8] }, { 7: [1, 9] }, o($V2, [2, 7], { 10: 10, 11: [1, 11] }), o($V3, [2, 6]), { 6: 12, 7: $V0, 9: 6, 12: $V1 }, { 1: [2, 1] }, { 7: [2, 4], 12: [1, 15], 13: 13, 14: 14, 15: [1, 16], 17: [1, 17], 19: [1, 18], 20: [1, 19], 21: [1, 20] }, o($V3, [2, 5]), { 7: [1, 21] }, o($V2, [2, 8]), { 12: [1, 22] }, o($V2, [2, 10]), { 12: [2, 16], 16: 23, 23: [1, 24] }, { 18: [1, 25] }, { 18: [1, 26] }, { 18: [1, 27] }, { 18: [1, 30], 22: 28, 24: [1, 29] }, { 1: [2, 2] }, o($V2, [2, 9]), { 12: [2, 11] }, { 12: [2, 17] }, { 12: [2, 12] }, { 12: [2, 13] }, { 12: [2, 14] }, { 12: [2, 15] }, { 12: $V4, 25: 31, 26: $V5 }, { 12: $V4, 25: 33, 26: $V5 }, { 12: [2, 18] }, { 12: $V4, 25: 34, 26: $V5 }, { 12: [2, 19] }, { 12: [2, 21] }],
|
6042 | defaultActions: { 9: [2, 1], 21: [2, 2], 23: [2, 11], 24: [2, 17], 25: [2, 12], 26: [2, 13], 27: [2, 14], 28: [2, 15], 31: [2, 18], 33: [2, 19], 34: [2, 21] },
|
6043 | parseError: function parseError(str, hash) {
|
6044 | if (hash.recoverable) {
|
6045 | this.trace(str);
|
6046 | } else {
|
6047 | var error = new Error(str);
|
6048 | error.hash = hash;
|
6049 | throw error;
|
6050 | }
|
6051 | },
|
6052 | parse: function parse(input) {
|
6053 | var self = this,
|
6054 | stack = [0],
|
6055 | tstack = [],
|
6056 | vstack = [null],
|
6057 | lstack = [],
|
6058 | table = this.table,
|
6059 | yytext = '',
|
6060 | yylineno = 0,
|
6061 | yyleng = 0,
|
6062 | recovering = 0,
|
6063 | TERROR = 2,
|
6064 | EOF = 1;
|
6065 | var args = lstack.slice.call(arguments, 1);
|
6066 | var lexer = Object.create(this.lexer);
|
6067 | var sharedState = { yy: {} };
|
6068 | for (var k in this.yy) {
|
6069 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
6070 | sharedState.yy[k] = this.yy[k];
|
6071 | }
|
6072 | }
|
6073 | lexer.setInput(input, sharedState.yy);
|
6074 | sharedState.yy.lexer = lexer;
|
6075 | sharedState.yy.parser = this;
|
6076 | if (typeof lexer.yylloc == 'undefined') {
|
6077 | lexer.yylloc = {};
|
6078 | }
|
6079 | var yyloc = lexer.yylloc;
|
6080 | lstack.push(yyloc);
|
6081 | var ranges = lexer.options && lexer.options.ranges;
|
6082 | if (typeof sharedState.yy.parseError === 'function') {
|
6083 | this.parseError = sharedState.yy.parseError;
|
6084 | } else {
|
6085 | this.parseError = Object.getPrototypeOf(this).parseError;
|
6086 | }
|
6087 | function popStack(n) {
|
6088 | stack.length = stack.length - 2 * n;
|
6089 | vstack.length = vstack.length - n;
|
6090 | lstack.length = lstack.length - n;
|
6091 | }
|
6092 | function lex() {
|
6093 | var token;
|
6094 | token = tstack.pop() || lexer.lex() || EOF;
|
6095 | if (typeof token !== 'number') {
|
6096 | if (token instanceof Array) {
|
6097 | tstack = token;
|
6098 | token = tstack.pop();
|
6099 | }
|
6100 | token = self.symbols_[token] || token;
|
6101 | }
|
6102 | return token;
|
6103 | }
|
6104 | var symbol,
|
6105 | preErrorSymbol,
|
6106 | state,
|
6107 | action,
|
6108 | a,
|
6109 | r,
|
6110 | yyval = {},
|
6111 | p,
|
6112 | len,
|
6113 | newState,
|
6114 | expected;
|
6115 | while (true) {
|
6116 | state = stack[stack.length - 1];
|
6117 | if (this.defaultActions[state]) {
|
6118 | action = this.defaultActions[state];
|
6119 | } else {
|
6120 | if (symbol === null || typeof symbol == 'undefined') {
|
6121 | symbol = lex();
|
6122 | }
|
6123 | action = table[state] && table[state][symbol];
|
6124 | }
|
6125 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
6126 | var errStr = '';
|
6127 | expected = [];
|
6128 | for (p in table[state]) {
|
6129 | if (this.terminals_[p] && p > TERROR) {
|
6130 | expected.push('\'' + this.terminals_[p] + '\'');
|
6131 | }
|
6132 | }
|
6133 | if (lexer.showPosition) {
|
6134 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
6135 | } else {
|
6136 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
6137 | }
|
6138 | this.parseError(errStr, {
|
6139 | text: lexer.match,
|
6140 | token: this.terminals_[symbol] || symbol,
|
6141 | line: lexer.yylineno,
|
6142 | loc: yyloc,
|
6143 | expected: expected
|
6144 | });
|
6145 | }
|
6146 | if (action[0] instanceof Array && action.length > 1) {
|
6147 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
6148 | }
|
6149 | switch (action[0]) {
|
6150 | case 1:
|
6151 | stack.push(symbol);
|
6152 | vstack.push(lexer.yytext);
|
6153 | lstack.push(lexer.yylloc);
|
6154 | stack.push(action[1]);
|
6155 | symbol = null;
|
6156 | if (!preErrorSymbol) {
|
6157 | yyleng = lexer.yyleng;
|
6158 | yytext = lexer.yytext;
|
6159 | yylineno = lexer.yylineno;
|
6160 | yyloc = lexer.yylloc;
|
6161 | if (recovering > 0) {
|
6162 | recovering--;
|
6163 | }
|
6164 | } else {
|
6165 | symbol = preErrorSymbol;
|
6166 | preErrorSymbol = null;
|
6167 | }
|
6168 | break;
|
6169 | case 2:
|
6170 | len = this.productions_[action[1]][1];
|
6171 | yyval.$ = vstack[vstack.length - len];
|
6172 | yyval._$ = {
|
6173 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
6174 | last_line: lstack[lstack.length - 1].last_line,
|
6175 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
6176 | last_column: lstack[lstack.length - 1].last_column
|
6177 | };
|
6178 | if (ranges) {
|
6179 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
6180 | }
|
6181 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
6182 | if (typeof r !== 'undefined') {
|
6183 | return r;
|
6184 | }
|
6185 | if (len) {
|
6186 | stack = stack.slice(0, -1 * len * 2);
|
6187 | vstack = vstack.slice(0, -1 * len);
|
6188 | lstack = lstack.slice(0, -1 * len);
|
6189 | }
|
6190 | stack.push(this.productions_[action[1]][0]);
|
6191 | vstack.push(yyval.$);
|
6192 | lstack.push(yyval._$);
|
6193 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
6194 | stack.push(newState);
|
6195 | break;
|
6196 | case 3:
|
6197 | return true;
|
6198 | }
|
6199 | }
|
6200 | return true;
|
6201 | } };
|
6202 |
|
6203 | var lexer = function () {
|
6204 | var lexer = {
|
6205 |
|
6206 | EOF: 1,
|
6207 |
|
6208 | parseError: function parseError(str, hash) {
|
6209 | if (this.yy.parser) {
|
6210 | this.yy.parser.parseError(str, hash);
|
6211 | } else {
|
6212 | throw new Error(str);
|
6213 | }
|
6214 | },
|
6215 |
|
6216 |
|
6217 | setInput: function setInput(input, yy) {
|
6218 | this.yy = yy || this.yy || {};
|
6219 | this._input = input;
|
6220 | this._more = this._backtrack = this.done = false;
|
6221 | this.yylineno = this.yyleng = 0;
|
6222 | this.yytext = this.matched = this.match = '';
|
6223 | this.conditionStack = ['INITIAL'];
|
6224 | this.yylloc = {
|
6225 | first_line: 1,
|
6226 | first_column: 0,
|
6227 | last_line: 1,
|
6228 | last_column: 0
|
6229 | };
|
6230 | if (this.options.ranges) {
|
6231 | this.yylloc.range = [0, 0];
|
6232 | }
|
6233 | this.offset = 0;
|
6234 | return this;
|
6235 | },
|
6236 |
|
6237 |
|
6238 | input: function input() {
|
6239 | var ch = this._input[0];
|
6240 | this.yytext += ch;
|
6241 | this.yyleng++;
|
6242 | this.offset++;
|
6243 | this.match += ch;
|
6244 | this.matched += ch;
|
6245 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
6246 | if (lines) {
|
6247 | this.yylineno++;
|
6248 | this.yylloc.last_line++;
|
6249 | } else {
|
6250 | this.yylloc.last_column++;
|
6251 | }
|
6252 | if (this.options.ranges) {
|
6253 | this.yylloc.range[1]++;
|
6254 | }
|
6255 |
|
6256 | this._input = this._input.slice(1);
|
6257 | return ch;
|
6258 | },
|
6259 |
|
6260 |
|
6261 | unput: function unput(ch) {
|
6262 | var len = ch.length;
|
6263 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
6264 |
|
6265 | this._input = ch + this._input;
|
6266 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
6267 |
|
6268 | this.offset -= len;
|
6269 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
6270 | this.match = this.match.substr(0, this.match.length - 1);
|
6271 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
6272 |
|
6273 | if (lines.length - 1) {
|
6274 | this.yylineno -= lines.length - 1;
|
6275 | }
|
6276 | var r = this.yylloc.range;
|
6277 |
|
6278 | this.yylloc = {
|
6279 | first_line: this.yylloc.first_line,
|
6280 | last_line: this.yylineno + 1,
|
6281 | first_column: this.yylloc.first_column,
|
6282 | last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
|
6283 | };
|
6284 |
|
6285 | if (this.options.ranges) {
|
6286 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
6287 | }
|
6288 | this.yyleng = this.yytext.length;
|
6289 | return this;
|
6290 | },
|
6291 |
|
6292 |
|
6293 | more: function more() {
|
6294 | this._more = true;
|
6295 | return this;
|
6296 | },
|
6297 |
|
6298 |
|
6299 | reject: function reject() {
|
6300 | if (this.options.backtrack_lexer) {
|
6301 | this._backtrack = true;
|
6302 | } else {
|
6303 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
|
6304 | text: "",
|
6305 | token: null,
|
6306 | line: this.yylineno
|
6307 | });
|
6308 | }
|
6309 | return this;
|
6310 | },
|
6311 |
|
6312 |
|
6313 | less: function less(n) {
|
6314 | this.unput(this.match.slice(n));
|
6315 | },
|
6316 |
|
6317 |
|
6318 | pastInput: function pastInput() {
|
6319 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
6320 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
6321 | },
|
6322 |
|
6323 |
|
6324 | upcomingInput: function upcomingInput() {
|
6325 | var next = this.match;
|
6326 | if (next.length < 20) {
|
6327 | next += this._input.substr(0, 20 - next.length);
|
6328 | }
|
6329 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
6330 | },
|
6331 |
|
6332 |
|
6333 | showPosition: function showPosition() {
|
6334 | var pre = this.pastInput();
|
6335 | var c = new Array(pre.length + 1).join("-");
|
6336 | return pre + this.upcomingInput() + "\n" + c + "^";
|
6337 | },
|
6338 |
|
6339 |
|
6340 | test_match: function test_match(match, indexed_rule) {
|
6341 | var token, lines, backup;
|
6342 |
|
6343 | if (this.options.backtrack_lexer) {
|
6344 |
|
6345 | backup = {
|
6346 | yylineno: this.yylineno,
|
6347 | yylloc: {
|
6348 | first_line: this.yylloc.first_line,
|
6349 | last_line: this.last_line,
|
6350 | first_column: this.yylloc.first_column,
|
6351 | last_column: this.yylloc.last_column
|
6352 | },
|
6353 | yytext: this.yytext,
|
6354 | match: this.match,
|
6355 | matches: this.matches,
|
6356 | matched: this.matched,
|
6357 | yyleng: this.yyleng,
|
6358 | offset: this.offset,
|
6359 | _more: this._more,
|
6360 | _input: this._input,
|
6361 | yy: this.yy,
|
6362 | conditionStack: this.conditionStack.slice(0),
|
6363 | done: this.done
|
6364 | };
|
6365 | if (this.options.ranges) {
|
6366 | backup.yylloc.range = this.yylloc.range.slice(0);
|
6367 | }
|
6368 | }
|
6369 |
|
6370 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
6371 | if (lines) {
|
6372 | this.yylineno += lines.length;
|
6373 | }
|
6374 | this.yylloc = {
|
6375 | first_line: this.yylloc.last_line,
|
6376 | last_line: this.yylineno + 1,
|
6377 | first_column: this.yylloc.last_column,
|
6378 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
6379 | };
|
6380 | this.yytext += match[0];
|
6381 | this.match += match[0];
|
6382 | this.matches = match;
|
6383 | this.yyleng = this.yytext.length;
|
6384 | if (this.options.ranges) {
|
6385 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
6386 | }
|
6387 | this._more = false;
|
6388 | this._backtrack = false;
|
6389 | this._input = this._input.slice(match[0].length);
|
6390 | this.matched += match[0];
|
6391 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
6392 | if (this.done && this._input) {
|
6393 | this.done = false;
|
6394 | }
|
6395 | if (token) {
|
6396 | return token;
|
6397 | } else if (this._backtrack) {
|
6398 |
|
6399 | for (var k in backup) {
|
6400 | this[k] = backup[k];
|
6401 | }
|
6402 | return false;
|
6403 | }
|
6404 | return false;
|
6405 | },
|
6406 |
|
6407 |
|
6408 | next: function next() {
|
6409 | if (this.done) {
|
6410 | return this.EOF;
|
6411 | }
|
6412 | if (!this._input) {
|
6413 | this.done = true;
|
6414 | }
|
6415 |
|
6416 | var token, match, tempMatch, index;
|
6417 | if (!this._more) {
|
6418 | this.yytext = '';
|
6419 | this.match = '';
|
6420 | }
|
6421 | var rules = this._currentRules();
|
6422 | for (var i = 0; i < rules.length; i++) {
|
6423 | tempMatch = this._input.match(this.rules[rules[i]]);
|
6424 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
6425 | match = tempMatch;
|
6426 | index = i;
|
6427 | if (this.options.backtrack_lexer) {
|
6428 | token = this.test_match(tempMatch, rules[i]);
|
6429 | if (token !== false) {
|
6430 | return token;
|
6431 | } else if (this._backtrack) {
|
6432 | match = false;
|
6433 | continue;
|
6434 | } else {
|
6435 |
|
6436 | return false;
|
6437 | }
|
6438 | } else if (!this.options.flex) {
|
6439 | break;
|
6440 | }
|
6441 | }
|
6442 | }
|
6443 | if (match) {
|
6444 | token = this.test_match(match, rules[index]);
|
6445 | if (token !== false) {
|
6446 | return token;
|
6447 | }
|
6448 |
|
6449 | return false;
|
6450 | }
|
6451 | if (this._input === "") {
|
6452 | return this.EOF;
|
6453 | } else {
|
6454 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
6455 | text: "",
|
6456 | token: null,
|
6457 | line: this.yylineno
|
6458 | });
|
6459 | }
|
6460 | },
|
6461 |
|
6462 |
|
6463 | lex: function lex() {
|
6464 | var r = this.next();
|
6465 | if (r) {
|
6466 | return r;
|
6467 | } else {
|
6468 | return this.lex();
|
6469 | }
|
6470 | },
|
6471 |
|
6472 |
|
6473 | begin: function begin(condition) {
|
6474 | this.conditionStack.push(condition);
|
6475 | },
|
6476 |
|
6477 |
|
6478 | popState: function popState() {
|
6479 | var n = this.conditionStack.length - 1;
|
6480 | if (n > 0) {
|
6481 | return this.conditionStack.pop();
|
6482 | } else {
|
6483 | return this.conditionStack[0];
|
6484 | }
|
6485 | },
|
6486 |
|
6487 |
|
6488 | _currentRules: function _currentRules() {
|
6489 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
6490 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
6491 | } else {
|
6492 | return this.conditions["INITIAL"].rules;
|
6493 | }
|
6494 | },
|
6495 |
|
6496 |
|
6497 | topState: function topState(n) {
|
6498 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
6499 | if (n >= 0) {
|
6500 | return this.conditionStack[n];
|
6501 | } else {
|
6502 | return "INITIAL";
|
6503 | }
|
6504 | },
|
6505 |
|
6506 |
|
6507 | pushState: function pushState(condition) {
|
6508 | this.begin(condition);
|
6509 | },
|
6510 |
|
6511 |
|
6512 | stateStackSize: function stateStackSize() {
|
6513 | return this.conditionStack.length;
|
6514 | },
|
6515 | options: { "case-insensitive": true },
|
6516 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
6517 | var YYSTATE = YY_START;
|
6518 | switch ($avoiding_name_collisions) {
|
6519 | case 0:
|
6520 | return 12;
|
6521 | break;
|
6522 | case 1:
|
6523 |
|
6524 | break;
|
6525 | case 2:
|
6526 |
|
6527 | break;
|
6528 | case 3:
|
6529 |
|
6530 | break;
|
6531 | case 4:
|
6532 | return 4;
|
6533 | break;
|
6534 | case 5:
|
6535 | return 15;
|
6536 | break;
|
6537 | case 6:
|
6538 | return 17;
|
6539 | break;
|
6540 | case 7:
|
6541 | return 20;
|
6542 | break;
|
6543 | case 8:
|
6544 | return 21;
|
6545 | break;
|
6546 | case 9:
|
6547 | return 19;
|
6548 | break;
|
6549 | case 10:
|
6550 | return 8;
|
6551 | break;
|
6552 | case 11:
|
6553 | return 8;
|
6554 | break;
|
6555 | case 12:
|
6556 | return 5;
|
6557 | break;
|
6558 | case 13:
|
6559 | return 26;
|
6560 | break;
|
6561 | case 14:
|
6562 | this.begin("options");
|
6563 | break;
|
6564 | case 15:
|
6565 | this.popState();
|
6566 | break;
|
6567 | case 16:
|
6568 | return 11;
|
6569 | break;
|
6570 | case 17:
|
6571 | this.begin("string");
|
6572 | break;
|
6573 | case 18:
|
6574 | this.popState();
|
6575 | break;
|
6576 | case 19:
|
6577 | return 23;
|
6578 | break;
|
6579 | case 20:
|
6580 | return 18;
|
6581 | break;
|
6582 | case 21:
|
6583 | return 7;
|
6584 | break;
|
6585 | }
|
6586 | },
|
6587 | rules: [/^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gitGraph\b)/i, /^(?:commit\b)/i, /^(?:branch\b)/i, /^(?:merge\b)/i, /^(?:reset\b)/i, /^(?:checkout\b)/i, /^(?:LR\b)/i, /^(?:BT\b)/i, /^(?::)/i, /^(?:\^)/i, /^(?:options\r?\n)/i, /^(?:end\r?\n)/i, /^(?:[^\n]+\r?\n)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[a-zA-Z][a-zA-Z0-9_]+)/i, /^(?:$)/i],
|
6588 | conditions: { "options": { "rules": [15, 16], "inclusive": false }, "string": { "rules": [18, 19], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21], "inclusive": true } }
|
6589 | };
|
6590 | return lexer;
|
6591 | }();
|
6592 | parser.lexer = lexer;
|
6593 | function Parser() {
|
6594 | this.yy = {};
|
6595 | }
|
6596 | Parser.prototype = parser;parser.Parser = Parser;
|
6597 | return new Parser();
|
6598 | }();
|
6599 |
|
6600 | if (true) {
|
6601 | exports.parser = parser;
|
6602 | exports.Parser = parser.Parser;
|
6603 | exports.parse = function () {
|
6604 | return parser.parse.apply(parser, arguments);
|
6605 | };
|
6606 | exports.main = function commonjsMain(args) {
|
6607 | if (!args[1]) {
|
6608 | console.log('Usage: ' + args[0] + ' FILE');
|
6609 | process.exit(1);
|
6610 | }
|
6611 | var source = __webpack_require__( "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__( "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
|
6612 | return exports.parser.parse(source);
|
6613 | };
|
6614 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
6615 | exports.main(process.argv.slice(1));
|
6616 | }
|
6617 | }
|
6618 | }.call(this, __webpack_require__( "./node_modules/process/browser.js"), __webpack_require__( "./node_modules/webpack/buildin/module.js")(module)))
|
6619 |
|
6620 | }),
|
6621 |
|
6622 | "./src/diagrams/sequence/parser/sequenceDiagram.js":
|
6623 |
|
6624 |
|
6625 |
|
6626 |
|
6627 | (function(module, exports, __webpack_require__) {
|
6628 |
|
6629 | "use strict";
|
6630 | (function(process, module) {
|
6631 |
|
6632 |
|
6633 |
|
6634 |
|
6635 |
|
6636 |
|
6637 |
|
6638 |
|
6639 |
|
6640 |
|
6641 |
|
6642 |
|
6643 |
|
6644 |
|
6645 |
|
6646 |
|
6647 |
|
6648 |
|
6649 |
|
6650 |
|
6651 |
|
6652 |
|
6653 |
|
6654 |
|
6655 |
|
6656 |
|
6657 |
|
6658 |
|
6659 |
|
6660 |
|
6661 |
|
6662 |
|
6663 |
|
6664 |
|
6665 |
|
6666 |
|
6667 |
|
6668 |
|
6669 |
|
6670 |
|
6671 |
|
6672 |
|
6673 |
|
6674 |
|
6675 |
|
6676 |
|
6677 |
|
6678 |
|
6679 |
|
6680 |
|
6681 |
|
6682 |
|
6683 |
|
6684 |
|
6685 |
|
6686 |
|
6687 |
|
6688 |
|
6689 |
|
6690 |
|
6691 |
|
6692 |
|
6693 |
|
6694 |
|
6695 |
|
6696 |
|
6697 |
|
6698 |
|
6699 |
|
6700 |
|
6701 |
|
6702 |
|
6703 |
|
6704 |
|
6705 | var parser = function () {
|
6706 | var o = function o(k, v, _o, l) {
|
6707 | for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {}return _o;
|
6708 | },
|
6709 | $V0 = [1, 2],
|
6710 | $V1 = [1, 3],
|
6711 | $V2 = [1, 4],
|
6712 | $V3 = [2, 4],
|
6713 | $V4 = [1, 9],
|
6714 | $V5 = [1, 11],
|
6715 | $V6 = [1, 12],
|
6716 | $V7 = [1, 14],
|
6717 | $V8 = [1, 15],
|
6718 | $V9 = [1, 17],
|
6719 | $Va = [1, 18],
|
6720 | $Vb = [1, 19],
|
6721 | $Vc = [1, 20],
|
6722 | $Vd = [1, 21],
|
6723 | $Ve = [1, 23],
|
6724 | $Vf = [1, 24],
|
6725 | $Vg = [1, 4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 27, 28, 29, 40],
|
6726 | $Vh = [1, 32],
|
6727 | $Vi = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 29, 40],
|
6728 | $Vj = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 28, 29, 40],
|
6729 | $Vk = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 27, 29, 40],
|
6730 | $Vl = [38, 39, 40];
|
6731 | var parser = { trace: function trace() {},
|
6732 | yy: {},
|
6733 | symbols_: { "error": 2, "start": 3, "SPACE": 4, "NL": 5, "SD": 6, "document": 7, "line": 8, "statement": 9, "participant": 10, "actor": 11, "AS": 12, "restOfLine": 13, "signal": 14, "activate": 15, "deactivate": 16, "note_statement": 17, "title": 18, "text2": 19, "loop": 20, "end": 21, "opt": 22, "alt": 23, "else_sections": 24, "par": 25, "par_sections": 26, "and": 27, "else": 28, "note": 29, "placement": 30, "over": 31, "actor_pair": 32, "spaceList": 33, ",": 34, "left_of": 35, "right_of": 36, "signaltype": 37, "+": 38, "-": 39, "ACTOR": 40, "SOLID_OPEN_ARROW": 41, "DOTTED_OPEN_ARROW": 42, "SOLID_ARROW": 43, "DOTTED_ARROW": 44, "SOLID_CROSS": 45, "DOTTED_CROSS": 46, "TXT": 47, "$accept": 0, "$end": 1 },
|
6734 | terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 10: "participant", 12: "AS", 13: "restOfLine", 15: "activate", 16: "deactivate", 18: "title", 20: "loop", 21: "end", 22: "opt", 23: "alt", 25: "par", 27: "and", 28: "else", 29: "note", 31: "over", 34: ",", 35: "left_of", 36: "right_of", 38: "+", 39: "-", 40: "ACTOR", 41: "SOLID_OPEN_ARROW", 42: "DOTTED_OPEN_ARROW", 43: "SOLID_ARROW", 44: "DOTTED_ARROW", 45: "SOLID_CROSS", 46: "DOTTED_CROSS", 47: "TXT" },
|
6735 | productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 5], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 3], [9, 4], [9, 4], [9, 4], [9, 4], [26, 1], [26, 4], [24, 1], [24, 4], [17, 4], [17, 4], [33, 2], [33, 1], [32, 3], [32, 1], [30, 1], [30, 1], [14, 5], [14, 5], [14, 4], [11, 1], [37, 1], [37, 1], [37, 1], [37, 1], [37, 1], [37, 1], [19, 1]],
|
6736 | performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
6737 |
|
6738 |
|
6739 | var $0 = $$.length - 1;
|
6740 | switch (yystate) {
|
6741 | case 3:
|
6742 | yy.apply($$[$0]);return $$[$0];
|
6743 | break;
|
6744 | case 4:
|
6745 | this.$ = [];
|
6746 | break;
|
6747 | case 5:
|
6748 | $$[$0 - 1].push($$[$0]);this.$ = $$[$0 - 1];
|
6749 | break;
|
6750 | case 6:case 7:
|
6751 | this.$ = $$[$0];
|
6752 | break;
|
6753 | case 8:
|
6754 | this.$ = [];
|
6755 | break;
|
6756 | case 9:
|
6757 | $$[$0 - 3].description = $$[$0 - 1];this.$ = $$[$0 - 3];
|
6758 | break;
|
6759 | case 10:
|
6760 | this.$ = $$[$0 - 1];
|
6761 | break;
|
6762 | case 12:
|
6763 | this.$ = { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] };
|
6764 | break;
|
6765 | case 13:
|
6766 | this.$ = { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1] };
|
6767 | break;
|
6768 | case 15:
|
6769 | this.$ = [{ type: 'setTitle', text: $$[$0 - 1] }];
|
6770 | break;
|
6771 | case 16:
|
6772 |
|
6773 | $$[$0 - 1].unshift({ type: 'loopStart', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_START });
|
6774 | $$[$0 - 1].push({ type: 'loopEnd', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END });
|
6775 | this.$ = $$[$0 - 1];
|
6776 | break;
|
6777 | case 17:
|
6778 |
|
6779 | $$[$0 - 1].unshift({ type: 'optStart', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_START });
|
6780 | $$[$0 - 1].push({ type: 'optEnd', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_END });
|
6781 | this.$ = $$[$0 - 1];
|
6782 | break;
|
6783 | case 18:
|
6784 |
|
6785 |
|
6786 | $$[$0 - 1].unshift({ type: 'altStart', altText: $$[$0 - 2], signalType: yy.LINETYPE.ALT_START });
|
6787 |
|
6788 |
|
6789 | $$[$0 - 1].push({ type: 'altEnd', signalType: yy.LINETYPE.ALT_END });
|
6790 | this.$ = $$[$0 - 1];
|
6791 | break;
|
6792 | case 19:
|
6793 |
|
6794 |
|
6795 | $$[$0 - 1].unshift({ type: 'parStart', parText: $$[$0 - 2], signalType: yy.LINETYPE.PAR_START });
|
6796 |
|
6797 |
|
6798 | $$[$0 - 1].push({ type: 'parEnd', signalType: yy.LINETYPE.PAR_END });
|
6799 | this.$ = $$[$0 - 1];
|
6800 | break;
|
6801 | case 21:
|
6802 | this.$ = $$[$0 - 3].concat([{ type: 'and', parText: $$[$0 - 1], signalType: yy.LINETYPE.PAR_AND }, $$[$0]]);
|
6803 | break;
|
6804 | case 23:
|
6805 | this.$ = $$[$0 - 3].concat([{ type: 'else', altText: $$[$0 - 1], signalType: yy.LINETYPE.ALT_ELSE }, $$[$0]]);
|
6806 | break;
|
6807 | case 24:
|
6808 |
|
6809 | this.$ = [$$[$0 - 1], { type: 'addNote', placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }];
|
6810 | break;
|
6811 | case 25:
|
6812 |
|
6813 |
|
6814 | $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2);
|
6815 | $$[$0 - 2][0] = $$[$0 - 2][0].actor;
|
6816 | $$[$0 - 2][1] = $$[$0 - 2][1].actor;
|
6817 | this.$ = [$$[$0 - 1], { type: 'addNote', placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }];
|
6818 | break;
|
6819 | case 28:
|
6820 | this.$ = [$$[$0 - 2], $$[$0]];
|
6821 | break;
|
6822 | case 29:
|
6823 | this.$ = $$[$0];
|
6824 | break;
|
6825 | case 30:
|
6826 | this.$ = yy.PLACEMENT.LEFTOF;
|
6827 | break;
|
6828 | case 31:
|
6829 | this.$ = yy.PLACEMENT.RIGHTOF;
|
6830 | break;
|
6831 | case 32:
|
6832 | this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }];
|
6833 | break;
|
6834 | case 33:
|
6835 | this.$ = [$$[$0 - 4], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4] }];
|
6836 | break;
|
6837 | case 34:
|
6838 | this.$ = [$$[$0 - 3], $$[$0 - 1], { type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }];
|
6839 | break;
|
6840 | case 35:
|
6841 | this.$ = { type: 'addActor', actor: $$[$0] };
|
6842 | break;
|
6843 | case 36:
|
6844 | this.$ = yy.LINETYPE.SOLID_OPEN;
|
6845 | break;
|
6846 | case 37:
|
6847 | this.$ = yy.LINETYPE.DOTTED_OPEN;
|
6848 | break;
|
6849 | case 38:
|
6850 | this.$ = yy.LINETYPE.SOLID;
|
6851 | break;
|
6852 | case 39:
|
6853 | this.$ = yy.LINETYPE.DOTTED;
|
6854 | break;
|
6855 | case 40:
|
6856 | this.$ = yy.LINETYPE.SOLID_CROSS;
|
6857 | break;
|
6858 | case 41:
|
6859 | this.$ = yy.LINETYPE.DOTTED_CROSS;
|
6860 | break;
|
6861 | case 42:
|
6862 | this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n");
|
6863 | break;
|
6864 | }
|
6865 | },
|
6866 | table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o([1, 4, 5, 10, 15, 16, 18, 20, 22, 23, 25, 29, 40], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 29: $Ve, 40: $Vf }, o($Vg, [2, 5]), { 9: 25, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 29: $Ve, 40: $Vf }, o($Vg, [2, 7]), o($Vg, [2, 8]), { 11: 26, 40: $Vf }, { 5: [1, 27] }, { 11: 28, 40: $Vf }, { 11: 29, 40: $Vf }, { 5: [1, 30] }, { 19: 31, 47: $Vh }, { 13: [1, 33] }, { 13: [1, 34] }, { 13: [1, 35] }, { 13: [1, 36] }, { 37: 37, 41: [1, 38], 42: [1, 39], 43: [1, 40], 44: [1, 41], 45: [1, 42], 46: [1, 43] }, { 30: 44, 31: [1, 45], 35: [1, 46], 36: [1, 47] }, o([5, 12, 34, 41, 42, 43, 44, 45, 46, 47], [2, 35]), o($Vg, [2, 6]), { 5: [1, 49], 12: [1, 48] }, o($Vg, [2, 11]), { 5: [1, 50] }, { 5: [1, 51] }, o($Vg, [2, 14]), { 5: [1, 52] }, { 5: [2, 42] }, o($Vi, $V3, { 7: 53 }), o($Vi, $V3, { 7: 54 }), o($Vj, $V3, { 24: 55, 7: 56 }), o($Vk, $V3, { 26: 57, 7: 58 }), { 11: 61, 38: [1, 59], 39: [1, 60], 40: $Vf }, o($Vl, [2, 36]), o($Vl, [2, 37]), o($Vl, [2, 38]), o($Vl, [2, 39]), o($Vl, [2, 40]), o($Vl, [2, 41]), { 11: 62, 40: $Vf }, { 11: 64, 32: 63, 40: $Vf }, { 40: [2, 30] }, { 40: [2, 31] }, { 13: [1, 65] }, o($Vg, [2, 10]), o($Vg, [2, 12]), o($Vg, [2, 13]), o($Vg, [2, 15]), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 66], 22: $Vb, 23: $Vc, 25: $Vd, 29: $Ve, 40: $Vf }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 67], 22: $Vb, 23: $Vc, 25: $Vd, 29: $Ve, 40: $Vf }, { 21: [1, 68] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [2, 22], 22: $Vb, 23: $Vc, 25: $Vd, 28: [1, 69], 29: $Ve, 40: $Vf }, { 21: [1, 70] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [2, 20], 22: $Vb, 23: $Vc, 25: $Vd, 27: [1, 71], 29: $Ve, 40: $Vf }, { 11: 72, 40: $Vf }, { 11: 73, 40: $Vf }, { 19: 74, 47: $Vh }, { 19: 75, 47: $Vh }, { 19: 76, 47: $Vh }, { 34: [1, 77], 47: [2, 29] }, { 5: [1, 78] }, o($Vg, [2, 16]), o($Vg, [2, 17]), o($Vg, [2, 18]), { 13: [1, 79] }, o($Vg, [2, 19]), { 13: [1, 80] }, { 19: 81, 47: $Vh }, { 19: 82, 47: $Vh }, { 5: [2, 34] }, { 5: [2, 24] }, { 5: [2, 25] }, { 11: 83, 40: $Vf }, o($Vg, [2, 9]), o($Vj, $V3, { 7: 56, 24: 84 }), o($Vk, $V3, { 7: 58, 26: 85 }), { 5: [2, 32] }, { 5: [2, 33] }, { 47: [2, 28] }, { 21: [2, 23] }, { 21: [2, 21] }],
|
6867 | defaultActions: { 5: [2, 1], 6: [2, 2], 32: [2, 42], 46: [2, 30], 47: [2, 31], 74: [2, 34], 75: [2, 24], 76: [2, 25], 81: [2, 32], 82: [2, 33], 83: [2, 28], 84: [2, 23], 85: [2, 21] },
|
6868 | parseError: function parseError(str, hash) {
|
6869 | if (hash.recoverable) {
|
6870 | this.trace(str);
|
6871 | } else {
|
6872 | var error = new Error(str);
|
6873 | error.hash = hash;
|
6874 | throw error;
|
6875 | }
|
6876 | },
|
6877 | parse: function parse(input) {
|
6878 | var self = this,
|
6879 | stack = [0],
|
6880 | tstack = [],
|
6881 | vstack = [null],
|
6882 | lstack = [],
|
6883 | table = this.table,
|
6884 | yytext = '',
|
6885 | yylineno = 0,
|
6886 | yyleng = 0,
|
6887 | recovering = 0,
|
6888 | TERROR = 2,
|
6889 | EOF = 1;
|
6890 | var args = lstack.slice.call(arguments, 1);
|
6891 | var lexer = Object.create(this.lexer);
|
6892 | var sharedState = { yy: {} };
|
6893 | for (var k in this.yy) {
|
6894 | if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
6895 | sharedState.yy[k] = this.yy[k];
|
6896 | }
|
6897 | }
|
6898 | lexer.setInput(input, sharedState.yy);
|
6899 | sharedState.yy.lexer = lexer;
|
6900 | sharedState.yy.parser = this;
|
6901 | if (typeof lexer.yylloc == 'undefined') {
|
6902 | lexer.yylloc = {};
|
6903 | }
|
6904 | var yyloc = lexer.yylloc;
|
6905 | lstack.push(yyloc);
|
6906 | var ranges = lexer.options && lexer.options.ranges;
|
6907 | if (typeof sharedState.yy.parseError === 'function') {
|
6908 | this.parseError = sharedState.yy.parseError;
|
6909 | } else {
|
6910 | this.parseError = Object.getPrototypeOf(this).parseError;
|
6911 | }
|
6912 | function popStack(n) {
|
6913 | stack.length = stack.length - 2 * n;
|
6914 | vstack.length = vstack.length - n;
|
6915 | lstack.length = lstack.length - n;
|
6916 | }
|
6917 | function lex() {
|
6918 | var token;
|
6919 | token = tstack.pop() || lexer.lex() || EOF;
|
6920 | if (typeof token !== 'number') {
|
6921 | if (token instanceof Array) {
|
6922 | tstack = token;
|
6923 | token = tstack.pop();
|
6924 | }
|
6925 | token = self.symbols_[token] || token;
|
6926 | }
|
6927 | return token;
|
6928 | }
|
6929 | var symbol,
|
6930 | preErrorSymbol,
|
6931 | state,
|
6932 | action,
|
6933 | a,
|
6934 | r,
|
6935 | yyval = {},
|
6936 | p,
|
6937 | len,
|
6938 | newState,
|
6939 | expected;
|
6940 | while (true) {
|
6941 | state = stack[stack.length - 1];
|
6942 | if (this.defaultActions[state]) {
|
6943 | action = this.defaultActions[state];
|
6944 | } else {
|
6945 | if (symbol === null || typeof symbol == 'undefined') {
|
6946 | symbol = lex();
|
6947 | }
|
6948 | action = table[state] && table[state][symbol];
|
6949 | }
|
6950 | if (typeof action === 'undefined' || !action.length || !action[0]) {
|
6951 | var errStr = '';
|
6952 | expected = [];
|
6953 | for (p in table[state]) {
|
6954 | if (this.terminals_[p] && p > TERROR) {
|
6955 | expected.push('\'' + this.terminals_[p] + '\'');
|
6956 | }
|
6957 | }
|
6958 | if (lexer.showPosition) {
|
6959 | errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
6960 | } else {
|
6961 | errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
6962 | }
|
6963 | this.parseError(errStr, {
|
6964 | text: lexer.match,
|
6965 | token: this.terminals_[symbol] || symbol,
|
6966 | line: lexer.yylineno,
|
6967 | loc: yyloc,
|
6968 | expected: expected
|
6969 | });
|
6970 | }
|
6971 | if (action[0] instanceof Array && action.length > 1) {
|
6972 | throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
6973 | }
|
6974 | switch (action[0]) {
|
6975 | case 1:
|
6976 | stack.push(symbol);
|
6977 | vstack.push(lexer.yytext);
|
6978 | lstack.push(lexer.yylloc);
|
6979 | stack.push(action[1]);
|
6980 | symbol = null;
|
6981 | if (!preErrorSymbol) {
|
6982 | yyleng = lexer.yyleng;
|
6983 | yytext = lexer.yytext;
|
6984 | yylineno = lexer.yylineno;
|
6985 | yyloc = lexer.yylloc;
|
6986 | if (recovering > 0) {
|
6987 | recovering--;
|
6988 | }
|
6989 | } else {
|
6990 | symbol = preErrorSymbol;
|
6991 | preErrorSymbol = null;
|
6992 | }
|
6993 | break;
|
6994 | case 2:
|
6995 | len = this.productions_[action[1]][1];
|
6996 | yyval.$ = vstack[vstack.length - len];
|
6997 | yyval._$ = {
|
6998 | first_line: lstack[lstack.length - (len || 1)].first_line,
|
6999 | last_line: lstack[lstack.length - 1].last_line,
|
7000 | first_column: lstack[lstack.length - (len || 1)].first_column,
|
7001 | last_column: lstack[lstack.length - 1].last_column
|
7002 | };
|
7003 | if (ranges) {
|
7004 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
7005 | }
|
7006 | r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
7007 | if (typeof r !== 'undefined') {
|
7008 | return r;
|
7009 | }
|
7010 | if (len) {
|
7011 | stack = stack.slice(0, -1 * len * 2);
|
7012 | vstack = vstack.slice(0, -1 * len);
|
7013 | lstack = lstack.slice(0, -1 * len);
|
7014 | }
|
7015 | stack.push(this.productions_[action[1]][0]);
|
7016 | vstack.push(yyval.$);
|
7017 | lstack.push(yyval._$);
|
7018 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
7019 | stack.push(newState);
|
7020 | break;
|
7021 | case 3:
|
7022 | return true;
|
7023 | }
|
7024 | }
|
7025 | return true;
|
7026 | } };
|
7027 |
|
7028 |
|
7029 | var lexer = function () {
|
7030 | var lexer = {
|
7031 |
|
7032 | EOF: 1,
|
7033 |
|
7034 | parseError: function parseError(str, hash) {
|
7035 | if (this.yy.parser) {
|
7036 | this.yy.parser.parseError(str, hash);
|
7037 | } else {
|
7038 | throw new Error(str);
|
7039 | }
|
7040 | },
|
7041 |
|
7042 |
|
7043 | setInput: function setInput(input, yy) {
|
7044 | this.yy = yy || this.yy || {};
|
7045 | this._input = input;
|
7046 | this._more = this._backtrack = this.done = false;
|
7047 | this.yylineno = this.yyleng = 0;
|
7048 | this.yytext = this.matched = this.match = '';
|
7049 | this.conditionStack = ['INITIAL'];
|
7050 | this.yylloc = {
|
7051 | first_line: 1,
|
7052 | first_column: 0,
|
7053 | last_line: 1,
|
7054 | last_column: 0
|
7055 | };
|
7056 | if (this.options.ranges) {
|
7057 | this.yylloc.range = [0, 0];
|
7058 | }
|
7059 | this.offset = 0;
|
7060 | return this;
|
7061 | },
|
7062 |
|
7063 |
|
7064 | input: function input() {
|
7065 | var ch = this._input[0];
|
7066 | this.yytext += ch;
|
7067 | this.yyleng++;
|
7068 | this.offset++;
|
7069 | this.match += ch;
|
7070 | this.matched += ch;
|
7071 | var lines = ch.match(/(?:\r\n?|\n).*/g);
|
7072 | if (lines) {
|
7073 | this.yylineno++;
|
7074 | this.yylloc.last_line++;
|
7075 | } else {
|
7076 | this.yylloc.last_column++;
|
7077 | }
|
7078 | if (this.options.ranges) {
|
7079 | this.yylloc.range[1]++;
|
7080 | }
|
7081 |
|
7082 | this._input = this._input.slice(1);
|
7083 | return ch;
|
7084 | },
|
7085 |
|
7086 |
|
7087 | unput: function unput(ch) {
|
7088 | var len = ch.length;
|
7089 | var lines = ch.split(/(?:\r\n?|\n)/g);
|
7090 |
|
7091 | this._input = ch + this._input;
|
7092 | this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
7093 |
|
7094 | this.offset -= len;
|
7095 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
7096 | this.match = this.match.substr(0, this.match.length - 1);
|
7097 | this.matched = this.matched.substr(0, this.matched.length - 1);
|
7098 |
|
7099 | if (lines.length - 1) {
|
7100 | this.yylineno -= lines.length - 1;
|
7101 | }
|
7102 | var r = this.yylloc.range;
|
7103 |
|
7104 | this.yylloc = {
|
7105 | first_line: this.yylloc.first_line,
|
7106 | last_line: this.yylineno + 1,
|
7107 | first_column: this.yylloc.first_column,
|
7108 | last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
|
7109 | };
|
7110 |
|
7111 | if (this.options.ranges) {
|
7112 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
7113 | }
|
7114 | this.yyleng = this.yytext.length;
|
7115 | return this;
|
7116 | },
|
7117 |
|
7118 |
|
7119 | more: function more() {
|
7120 | this._more = true;
|
7121 | return this;
|
7122 | },
|
7123 |
|
7124 |
|
7125 | reject: function reject() {
|
7126 | if (this.options.backtrack_lexer) {
|
7127 | this._backtrack = true;
|
7128 | } else {
|
7129 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
|
7130 | text: "",
|
7131 | token: null,
|
7132 | line: this.yylineno
|
7133 | });
|
7134 | }
|
7135 | return this;
|
7136 | },
|
7137 |
|
7138 |
|
7139 | less: function less(n) {
|
7140 | this.unput(this.match.slice(n));
|
7141 | },
|
7142 |
|
7143 |
|
7144 | pastInput: function pastInput() {
|
7145 | var past = this.matched.substr(0, this.matched.length - this.match.length);
|
7146 | return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
7147 | },
|
7148 |
|
7149 |
|
7150 | upcomingInput: function upcomingInput() {
|
7151 | var next = this.match;
|
7152 | if (next.length < 20) {
|
7153 | next += this._input.substr(0, 20 - next.length);
|
7154 | }
|
7155 | return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
7156 | },
|
7157 |
|
7158 |
|
7159 | showPosition: function showPosition() {
|
7160 | var pre = this.pastInput();
|
7161 | var c = new Array(pre.length + 1).join("-");
|
7162 | return pre + this.upcomingInput() + "\n" + c + "^";
|
7163 | },
|
7164 |
|
7165 |
|
7166 | test_match: function test_match(match, indexed_rule) {
|
7167 | var token, lines, backup;
|
7168 |
|
7169 | if (this.options.backtrack_lexer) {
|
7170 |
|
7171 | backup = {
|
7172 | yylineno: this.yylineno,
|
7173 | yylloc: {
|
7174 | first_line: this.yylloc.first_line,
|
7175 | last_line: this.last_line,
|
7176 | first_column: this.yylloc.first_column,
|
7177 | last_column: this.yylloc.last_column
|
7178 | },
|
7179 | yytext: this.yytext,
|
7180 | match: this.match,
|
7181 | matches: this.matches,
|
7182 | matched: this.matched,
|
7183 | yyleng: this.yyleng,
|
7184 | offset: this.offset,
|
7185 | _more: this._more,
|
7186 | _input: this._input,
|
7187 | yy: this.yy,
|
7188 | conditionStack: this.conditionStack.slice(0),
|
7189 | done: this.done
|
7190 | };
|
7191 | if (this.options.ranges) {
|
7192 | backup.yylloc.range = this.yylloc.range.slice(0);
|
7193 | }
|
7194 | }
|
7195 |
|
7196 | lines = match[0].match(/(?:\r\n?|\n).*/g);
|
7197 | if (lines) {
|
7198 | this.yylineno += lines.length;
|
7199 | }
|
7200 | this.yylloc = {
|
7201 | first_line: this.yylloc.last_line,
|
7202 | last_line: this.yylineno + 1,
|
7203 | first_column: this.yylloc.last_column,
|
7204 | last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
7205 | };
|
7206 | this.yytext += match[0];
|
7207 | this.match += match[0];
|
7208 | this.matches = match;
|
7209 | this.yyleng = this.yytext.length;
|
7210 | if (this.options.ranges) {
|
7211 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
7212 | }
|
7213 | this._more = false;
|
7214 | this._backtrack = false;
|
7215 | this._input = this._input.slice(match[0].length);
|
7216 | this.matched += match[0];
|
7217 | token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
7218 | if (this.done && this._input) {
|
7219 | this.done = false;
|
7220 | }
|
7221 | if (token) {
|
7222 | return token;
|
7223 | } else if (this._backtrack) {
|
7224 |
|
7225 | for (var k in backup) {
|
7226 | this[k] = backup[k];
|
7227 | }
|
7228 | return false;
|
7229 | }
|
7230 | return false;
|
7231 | },
|
7232 |
|
7233 |
|
7234 | next: function next() {
|
7235 | if (this.done) {
|
7236 | return this.EOF;
|
7237 | }
|
7238 | if (!this._input) {
|
7239 | this.done = true;
|
7240 | }
|
7241 |
|
7242 | var token, match, tempMatch, index;
|
7243 | if (!this._more) {
|
7244 | this.yytext = '';
|
7245 | this.match = '';
|
7246 | }
|
7247 | var rules = this._currentRules();
|
7248 | for (var i = 0; i < rules.length; i++) {
|
7249 | tempMatch = this._input.match(this.rules[rules[i]]);
|
7250 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
7251 | match = tempMatch;
|
7252 | index = i;
|
7253 | if (this.options.backtrack_lexer) {
|
7254 | token = this.test_match(tempMatch, rules[i]);
|
7255 | if (token !== false) {
|
7256 | return token;
|
7257 | } else if (this._backtrack) {
|
7258 | match = false;
|
7259 | continue;
|
7260 | } else {
|
7261 |
|
7262 | return false;
|
7263 | }
|
7264 | } else if (!this.options.flex) {
|
7265 | break;
|
7266 | }
|
7267 | }
|
7268 | }
|
7269 | if (match) {
|
7270 | token = this.test_match(match, rules[index]);
|
7271 | if (token !== false) {
|
7272 | return token;
|
7273 | }
|
7274 |
|
7275 | return false;
|
7276 | }
|
7277 | if (this._input === "") {
|
7278 | return this.EOF;
|
7279 | } else {
|
7280 | return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
7281 | text: "",
|
7282 | token: null,
|
7283 | line: this.yylineno
|
7284 | });
|
7285 | }
|
7286 | },
|
7287 |
|
7288 |
|
7289 | lex: function lex() {
|
7290 | var r = this.next();
|
7291 | if (r) {
|
7292 | return r;
|
7293 | } else {
|
7294 | return this.lex();
|
7295 | }
|
7296 | },
|
7297 |
|
7298 |
|
7299 | begin: function begin(condition) {
|
7300 | this.conditionStack.push(condition);
|
7301 | },
|
7302 |
|
7303 |
|
7304 | popState: function popState() {
|
7305 | var n = this.conditionStack.length - 1;
|
7306 | if (n > 0) {
|
7307 | return this.conditionStack.pop();
|
7308 | } else {
|
7309 | return this.conditionStack[0];
|
7310 | }
|
7311 | },
|
7312 |
|
7313 |
|
7314 | _currentRules: function _currentRules() {
|
7315 | if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
7316 | return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
7317 | } else {
|
7318 | return this.conditions["INITIAL"].rules;
|
7319 | }
|
7320 | },
|
7321 |
|
7322 |
|
7323 | topState: function topState(n) {
|
7324 | n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
7325 | if (n >= 0) {
|
7326 | return this.conditionStack[n];
|
7327 | } else {
|
7328 | return "INITIAL";
|
7329 | }
|
7330 | },
|
7331 |
|
7332 |
|
7333 | pushState: function pushState(condition) {
|
7334 | this.begin(condition);
|
7335 | },
|
7336 |
|
7337 |
|
7338 | stateStackSize: function stateStackSize() {
|
7339 | return this.conditionStack.length;
|
7340 | },
|
7341 | options: { "case-insensitive": true },
|
7342 | performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
7343 | var YYSTATE = YY_START;
|
7344 | switch ($avoiding_name_collisions) {
|
7345 | case 0:
|
7346 | return 5;
|
7347 | break;
|
7348 | case 1:
|
7349 |
|
7350 | break;
|
7351 | case 2:
|
7352 |
|
7353 | break;
|
7354 | case 3:
|
7355 |
|
7356 | break;
|
7357 | case 4:
|
7358 |
|
7359 | break;
|
7360 | case 5:
|
7361 | this.begin('ID');return 10;
|
7362 | break;
|
7363 | case 6:
|
7364 | this.begin('ALIAS');return 40;
|
7365 | break;
|
7366 | case 7:
|
7367 | this.popState();this.popState();this.begin('LINE');return 12;
|
7368 | break;
|
7369 | case 8:
|
7370 | this.popState();this.popState();return 5;
|
7371 | break;
|
7372 | case 9:
|
7373 | this.begin('LINE');return 20;
|
7374 | break;
|
7375 | case 10:
|
7376 | this.begin('LINE');return 22;
|
7377 | break;
|
7378 | case 11:
|
7379 | this.begin('LINE');return 23;
|
7380 | break;
|
7381 | case 12:
|
7382 | this.begin('LINE');return 28;
|
7383 | break;
|
7384 | case 13:
|
7385 | this.begin('LINE');return 25;
|
7386 | break;
|
7387 | case 14:
|
7388 | this.begin('LINE');return 27;
|
7389 | break;
|
7390 | case 15:
|
7391 | this.popState();return 13;
|
7392 | break;
|
7393 | case 16:
|
7394 | return 21;
|
7395 | break;
|
7396 | case 17:
|
7397 | return 35;
|
7398 | break;
|
7399 | case 18:
|
7400 | return 36;
|
7401 | break;
|
7402 | case 19:
|
7403 | return 31;
|
7404 | break;
|
7405 | case 20:
|
7406 | return 29;
|
7407 | break;
|
7408 | case 21:
|
7409 | this.begin('ID');return 15;
|
7410 | break;
|
7411 | case 22:
|
7412 | this.begin('ID');return 16;
|
7413 | break;
|
7414 | case 23:
|
7415 | return 18;
|
7416 | break;
|
7417 | case 24:
|
7418 | return 6;
|
7419 | break;
|
7420 | case 25:
|
7421 | return 34;
|
7422 | break;
|
7423 | case 26:
|
7424 | return 5;
|
7425 | break;
|
7426 | case 27:
|
7427 | yy_.yytext = yy_.yytext.trim();return 40;
|
7428 | break;
|
7429 | case 28:
|
7430 | return 43;
|
7431 | break;
|
7432 | case 29:
|
7433 | return 44;
|
7434 | break;
|
7435 | case 30:
|
7436 | return 41;
|
7437 | break;
|
7438 | case 31:
|
7439 | return 42;
|
7440 | break;
|
7441 | case 32:
|
7442 | return 45;
|
7443 | break;
|
7444 | case 33:
|
7445 | return 46;
|
7446 | break;
|
7447 | case 34:
|
7448 | return 47;
|
7449 | break;
|
7450 | case 35:
|
7451 | return 38;
|
7452 | break;
|
7453 | case 36:
|
7454 | return 39;
|
7455 | break;
|
7456 | case 37:
|
7457 | return 5;
|
7458 | break;
|
7459 | case 38:
|
7460 | return 'INVALID';
|
7461 | break;
|
7462 | }
|
7463 | },
|
7464 | rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:participant\b)/i, /^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:and\b)/i, /^(?:[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\b)/i, /^(?:sequenceDiagram\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?::[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
|
7465 | conditions: { "LINE": { "rules": [2, 3, 15], "inclusive": false }, "ALIAS": { "rules": [2, 3, 7, 8], "inclusive": false }, "ID": { "rules": [2, 3, 6], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 4, 5, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38], "inclusive": true } }
|
7466 | };
|
7467 | return lexer;
|
7468 | }();
|
7469 | parser.lexer = lexer;
|
7470 | function Parser() {
|
7471 | this.yy = {};
|
7472 | }
|
7473 | Parser.prototype = parser;parser.Parser = Parser;
|
7474 | return new Parser();
|
7475 | }();
|
7476 |
|
7477 | if (true) {
|
7478 | exports.parser = parser;
|
7479 | exports.Parser = parser.Parser;
|
7480 | exports.parse = function () {
|
7481 | return parser.parse.apply(parser, arguments);
|
7482 | };
|
7483 | exports.main = function commonjsMain(args) {
|
7484 | if (!args[1]) {
|
7485 | console.log('Usage: ' + args[0] + ' FILE');
|
7486 | process.exit(1);
|
7487 | }
|
7488 | var source = __webpack_require__( "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__( "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
|
7489 | return exports.parser.parse(source);
|
7490 | };
|
7491 | if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) {
|
7492 | exports.main(process.argv.slice(1));
|
7493 | }
|
7494 | }
|
7495 | }.call(this, __webpack_require__( "./node_modules/process/browser.js"), __webpack_require__( "./node_modules/webpack/buildin/module.js")(module)))
|
7496 |
|
7497 | }),
|
7498 |
|
7499 | "./src/diagrams/sequence/sequenceDb.js":
|
7500 |
|
7501 |
|
7502 |
|
7503 |
|
7504 | (function(module, exports, __webpack_require__) {
|
7505 |
|
7506 | "use strict";
|
7507 |
|
7508 |
|
7509 | Object.defineProperty(exports, "__esModule", {
|
7510 | value: true
|
7511 | });
|
7512 | exports.apply = exports.setTitle = exports.addNote = exports.PLACEMENT = exports.ARROWTYPE = exports.LINETYPE = exports.clear = exports.getTitle = exports.getActorKeys = exports.getActor = exports.getActors = exports.getMessages = exports.addSignal = exports.addMessage = exports.addActor = undefined;
|
7513 |
|
7514 | var _logger = __webpack_require__( "./src/logger.js");
|
7515 |
|
7516 | var actors = {};
|
7517 | var messages = [];
|
7518 | var notes = [];
|
7519 | var title = '';
|
7520 |
|
7521 | var addActor = exports.addActor = function addActor(id, name, description) {
|
7522 |
|
7523 | var old = actors[id];
|
7524 | if (old && name === old.name && description == null) return;
|
7525 |
|
7526 |
|
7527 | if (description == null) description = name;
|
7528 |
|
7529 | actors[id] = { name: name, description: description };
|
7530 | };
|
7531 |
|
7532 | var addMessage = exports.addMessage = function addMessage(idFrom, idTo, message, answer) {
|
7533 | messages.push({ from: idFrom, to: idTo, message: message, answer: answer });
|
7534 | };
|
7535 |
|
7536 | var addSignal = exports.addSignal = function addSignal(idFrom, idTo, message, messageType) {
|
7537 | _logger.logger.debug('Adding message from=' + idFrom + ' to=' + idTo + ' message=' + message + ' type=' + messageType);
|
7538 | messages.push({ from: idFrom, to: idTo, message: message, type: messageType });
|
7539 | };
|
7540 |
|
7541 | var getMessages = exports.getMessages = function getMessages() {
|
7542 | return messages;
|
7543 | };
|
7544 |
|
7545 | var getActors = exports.getActors = function getActors() {
|
7546 | return actors;
|
7547 | };
|
7548 | var getActor = exports.getActor = function getActor(id) {
|
7549 | return actors[id];
|
7550 | };
|
7551 | var getActorKeys = exports.getActorKeys = function getActorKeys() {
|
7552 | return Object.keys(actors);
|
7553 | };
|
7554 | var getTitle = exports.getTitle = function getTitle() {
|
7555 | return title;
|
7556 | };
|
7557 |
|
7558 | var clear = exports.clear = function clear() {
|
7559 | actors = {};
|
7560 | messages = [];
|
7561 | };
|
7562 |
|
7563 | var LINETYPE = exports.LINETYPE = {
|
7564 | SOLID: 0,
|
7565 | DOTTED: 1,
|
7566 | NOTE: 2,
|
7567 | SOLID_CROSS: 3,
|
7568 | DOTTED_CROSS: 4,
|
7569 | SOLID_OPEN: 5,
|
7570 | DOTTED_OPEN: 6,
|
7571 | LOOP_START: 10,
|
7572 | LOOP_END: 11,
|
7573 | ALT_START: 12,
|
7574 | ALT_ELSE: 13,
|
7575 | ALT_END: 14,
|
7576 | OPT_START: 15,
|
7577 | OPT_END: 16,
|
7578 | ACTIVE_START: 17,
|
7579 | ACTIVE_END: 18,
|
7580 | PAR_START: 19,
|
7581 | PAR_AND: 20,
|
7582 | PAR_END: 21
|
7583 | };
|
7584 |
|
7585 | var ARROWTYPE = exports.ARROWTYPE = {
|
7586 | FILLED: 0,
|
7587 | OPEN: 1
|
7588 | };
|
7589 |
|
7590 | var PLACEMENT = exports.PLACEMENT = {
|
7591 | LEFTOF: 0,
|
7592 | RIGHTOF: 1,
|
7593 | OVER: 2
|
7594 | };
|
7595 |
|
7596 | var addNote = exports.addNote = function addNote(actor, placement, message) {
|
7597 | var note = { actor: actor, placement: placement, message: message
|
7598 |
|
7599 |
|
7600 | };var actors = [].concat(actor, actor);
|
7601 |
|
7602 | notes.push(note);
|
7603 | messages.push({ from: actors[0], to: actors[1], message: message, type: LINETYPE.NOTE, placement: placement });
|
7604 | };
|
7605 |
|
7606 | var setTitle = exports.setTitle = function setTitle(titleText) {
|
7607 | title = titleText;
|
7608 | };
|
7609 |
|
7610 | var apply = exports.apply = function apply(param) {
|
7611 | if (param instanceof Array) {
|
7612 | param.forEach(function (item) {
|
7613 | apply(item);
|
7614 | });
|
7615 | } else {
|
7616 | switch (param.type) {
|
7617 | case 'addActor':
|
7618 | addActor(param.actor, param.actor, param.description);
|
7619 | break;
|
7620 | case 'activeStart':
|
7621 | addSignal(param.actor, undefined, undefined, param.signalType);
|
7622 | break;
|
7623 | case 'activeEnd':
|
7624 | addSignal(param.actor, undefined, undefined, param.signalType);
|
7625 | break;
|
7626 | case 'addNote':
|
7627 | addNote(param.actor, param.placement, param.text);
|
7628 | break;
|
7629 | case 'addMessage':
|
7630 | addSignal(param.from, param.to, param.msg, param.signalType);
|
7631 | break;
|
7632 | case 'loopStart':
|
7633 | addSignal(undefined, undefined, param.loopText, param.signalType);
|
7634 | break;
|
7635 | case 'loopEnd':
|
7636 | addSignal(undefined, undefined, undefined, param.signalType);
|
7637 | break;
|
7638 | case 'optStart':
|
7639 | addSignal(undefined, undefined, param.optText, param.signalType);
|
7640 | break;
|
7641 | case 'optEnd':
|
7642 | addSignal(undefined, undefined, undefined, param.signalType);
|
7643 | break;
|
7644 | case 'altStart':
|
7645 | addSignal(undefined, undefined, param.altText, param.signalType);
|
7646 | break;
|
7647 | case 'else':
|
7648 | addSignal(undefined, undefined, param.altText, param.signalType);
|
7649 | break;
|
7650 | case 'altEnd':
|
7651 | addSignal(undefined, undefined, undefined, param.signalType);
|
7652 | break;
|
7653 | case 'setTitle':
|
7654 | setTitle(param.text);
|
7655 | break;
|
7656 | case 'parStart':
|
7657 | addSignal(undefined, undefined, param.parText, param.signalType);
|
7658 | break;
|
7659 | case 'and':
|
7660 | addSignal(undefined, undefined, param.parText, param.signalType);
|
7661 | break;
|
7662 | case 'parEnd':
|
7663 | addSignal(undefined, undefined, undefined, param.signalType);
|
7664 | break;
|
7665 | }
|
7666 | }
|
7667 | };
|
7668 |
|
7669 | exports.default = {
|
7670 | addActor: addActor,
|
7671 | addMessage: addMessage,
|
7672 | addSignal: addSignal,
|
7673 | getMessages: getMessages,
|
7674 | getActors: getActors,
|
7675 | getActor: getActor,
|
7676 | getActorKeys: getActorKeys,
|
7677 | getTitle: getTitle,
|
7678 | clear: clear,
|
7679 | LINETYPE: LINETYPE,
|
7680 | ARROWTYPE: ARROWTYPE,
|
7681 | PLACEMENT: PLACEMENT,
|
7682 | addNote: addNote,
|
7683 | setTitle: setTitle,
|
7684 | apply: apply
|
7685 | };
|
7686 |
|
7687 | }),
|
7688 |
|
7689 | "./src/diagrams/sequence/sequenceRenderer.js":
|
7690 |
|
7691 |
|
7692 |
|
7693 |
|
7694 | (function(module, exports, __webpack_require__) {
|
7695 |
|
7696 | "use strict";
|
7697 |
|
7698 |
|
7699 | Object.defineProperty(exports, "__esModule", {
|
7700 | value: true
|
7701 | });
|
7702 | exports.draw = exports.setConf = exports.drawActors = exports.bounds = undefined;
|
7703 |
|
7704 | var _d = __webpack_require__( "d3");
|
7705 |
|
7706 | var d3 = _interopRequireWildcard(_d);
|
7707 |
|
7708 | var _svgDraw = __webpack_require__( "./src/diagrams/sequence/svgDraw.js");
|
7709 |
|
7710 | var _svgDraw2 = _interopRequireDefault(_svgDraw);
|
7711 |
|
7712 | var _logger = __webpack_require__( "./src/logger.js");
|
7713 |
|
7714 | var _sequenceDiagram = __webpack_require__( "./src/diagrams/sequence/parser/sequenceDiagram.js");
|
7715 |
|
7716 | var _sequenceDb = __webpack_require__( "./src/diagrams/sequence/sequenceDb.js");
|
7717 |
|
7718 | var _sequenceDb2 = _interopRequireDefault(_sequenceDb);
|
7719 |
|
7720 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
7721 |
|
7722 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
7723 |
|
7724 | _sequenceDiagram.parser.yy = _sequenceDb2.default;
|
7725 |
|
7726 | var conf = {
|
7727 |
|
7728 | diagramMarginX: 50,
|
7729 | diagramMarginY: 30,
|
7730 |
|
7731 | actorMargin: 50,
|
7732 |
|
7733 | width: 150,
|
7734 |
|
7735 | height: 65,
|
7736 |
|
7737 | boxMargin: 10,
|
7738 | boxTextMargin: 5,
|
7739 | noteMargin: 10,
|
7740 |
|
7741 | messageMargin: 35,
|
7742 |
|
7743 | mirrorActors: false,
|
7744 |
|
7745 |
|
7746 | bottomMarginAdj: 1,
|
7747 |
|
7748 |
|
7749 | activationWidth: 10,
|
7750 |
|
7751 |
|
7752 | textPlacement: 'tspan'
|
7753 | };
|
7754 |
|
7755 | var bounds = exports.bounds = {
|
7756 | data: {
|
7757 | startx: undefined,
|
7758 | stopx: undefined,
|
7759 | starty: undefined,
|
7760 | stopy: undefined
|
7761 | },
|
7762 | verticalPos: 0,
|
7763 |
|
7764 | sequenceItems: [],
|
7765 | activations: [],
|
7766 | init: function init() {
|
7767 | this.sequenceItems = [];
|
7768 | this.activations = [];
|
7769 | this.data = {
|
7770 | startx: undefined,
|
7771 | stopx: undefined,
|
7772 | starty: undefined,
|
7773 | stopy: undefined
|
7774 | };
|
7775 | this.verticalPos = 0;
|
7776 | },
|
7777 | updateVal: function updateVal(obj, key, val, fun) {
|
7778 | if (typeof obj[key] === 'undefined') {
|
7779 | obj[key] = val;
|
7780 | } else {
|
7781 | obj[key] = fun(val, obj[key]);
|
7782 | }
|
7783 | },
|
7784 | updateBounds: function updateBounds(startx, starty, stopx, stopy) {
|
7785 | var _self = this;
|
7786 | var cnt = 0;
|
7787 | function updateFn(type) {
|
7788 | return function updateItemBounds(item) {
|
7789 | cnt++;
|
7790 |
|
7791 | var n = _self.sequenceItems.length - cnt + 1;
|
7792 |
|
7793 | _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min);
|
7794 | _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max);
|
7795 |
|
7796 | _self.updateVal(bounds.data, 'startx', startx - n * conf.boxMargin, Math.min);
|
7797 | _self.updateVal(bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max);
|
7798 |
|
7799 | if (!(type === 'activation')) {
|
7800 | _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min);
|
7801 | _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max);
|
7802 |
|
7803 | _self.updateVal(bounds.data, 'starty', starty - n * conf.boxMargin, Math.min);
|
7804 | _self.updateVal(bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max);
|
7805 | }
|
7806 | };
|
7807 | }
|
7808 |
|
7809 | this.sequenceItems.forEach(updateFn());
|
7810 | this.activations.forEach(updateFn('activation'));
|
7811 | },
|
7812 | insert: function insert(startx, starty, stopx, stopy) {
|
7813 | var _startx = Math.min(startx, stopx);
|
7814 | var _stopx = Math.max(startx, stopx);
|
7815 | var _starty = Math.min(starty, stopy);
|
7816 | var _stopy = Math.max(starty, stopy);
|
7817 |
|
7818 | this.updateVal(bounds.data, 'startx', _startx, Math.min);
|
7819 | this.updateVal(bounds.data, 'starty', _starty, Math.min);
|
7820 | this.updateVal(bounds.data, 'stopx', _stopx, Math.max);
|
7821 | this.updateVal(bounds.data, 'stopy', _stopy, Math.max);
|
7822 |
|
7823 | this.updateBounds(_startx, _starty, _stopx, _stopy);
|
7824 | },
|
7825 | newActivation: function newActivation(message, diagram) {
|
7826 | var actorRect = _sequenceDiagram.parser.yy.getActors()[message.from.actor];
|
7827 | var stackedSize = actorActivations(message.from.actor).length;
|
7828 | var x = actorRect.x + conf.width / 2 + (stackedSize - 1) * conf.activationWidth / 2;
|
7829 | this.activations.push({
|
7830 | startx: x,
|
7831 | starty: this.verticalPos + 2,
|
7832 | stopx: x + conf.activationWidth,
|
7833 | stopy: undefined,
|
7834 | actor: message.from.actor,
|
7835 | anchored: _svgDraw2.default.anchorElement(diagram)
|
7836 | });
|
7837 | },
|
7838 | endActivation: function endActivation(message) {
|
7839 |
|
7840 | var lastActorActivationIdx = this.activations.map(function (activation) {
|
7841 | return activation.actor;
|
7842 | }).lastIndexOf(message.from.actor);
|
7843 | var activation = this.activations.splice(lastActorActivationIdx, 1)[0];
|
7844 | return activation;
|
7845 | },
|
7846 | newLoop: function newLoop(title) {
|
7847 | this.sequenceItems.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title });
|
7848 | },
|
7849 | endLoop: function endLoop() {
|
7850 | var loop = this.sequenceItems.pop();
|
7851 | return loop;
|
7852 | },
|
7853 | addSectionToLoop: function addSectionToLoop(message) {
|
7854 | var loop = this.sequenceItems.pop();
|
7855 | loop.sections = loop.sections || [];
|
7856 | loop.sectionTitles = loop.sectionTitles || [];
|
7857 | loop.sections.push(bounds.getVerticalPos());
|
7858 | loop.sectionTitles.push(message);
|
7859 | this.sequenceItems.push(loop);
|
7860 | },
|
7861 | bumpVerticalPos: function bumpVerticalPos(bump) {
|
7862 | this.verticalPos = this.verticalPos + bump;
|
7863 | this.data.stopy = this.verticalPos;
|
7864 | },
|
7865 | getVerticalPos: function getVerticalPos() {
|
7866 | return this.verticalPos;
|
7867 | },
|
7868 | getBounds: function getBounds() {
|
7869 | return this.data;
|
7870 | }
|
7871 | };
|
7872 |
|
7873 | var _drawLongText = function _drawLongText(text, x, y, g, width) {
|
7874 | var textHeight = 0;
|
7875 | var lines = text.split(/<br\/?>/ig);
|
7876 | var _iteratorNormalCompletion = true;
|
7877 | var _didIteratorError = false;
|
7878 | var _iteratorError = undefined;
|
7879 |
|
7880 | try {
|
7881 | for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
7882 | var line = _step.value;
|
7883 |
|
7884 | var textObj = _svgDraw2.default.getTextObj();
|
7885 | textObj.x = x;
|
7886 | textObj.y = y + textHeight;
|
7887 | textObj.textMargin = conf.noteMargin;
|
7888 | textObj.dy = '1em';
|
7889 | textObj.text = line;
|
7890 | textObj.class = 'noteText';
|
7891 | var textElem = _svgDraw2.default.drawText(g, textObj, width);
|
7892 | textHeight += (textElem._groups || textElem)[0][0].getBBox().height;
|
7893 | }
|
7894 | } catch (err) {
|
7895 | _didIteratorError = true;
|
7896 | _iteratorError = err;
|
7897 | } finally {
|
7898 | try {
|
7899 | if (!_iteratorNormalCompletion && _iterator.return) {
|
7900 | _iterator.return();
|
7901 | }
|
7902 | } finally {
|
7903 | if (_didIteratorError) {
|
7904 | throw _iteratorError;
|
7905 | }
|
7906 | }
|
7907 | }
|
7908 |
|
7909 | return textHeight;
|
7910 | };
|
7911 |
|
7912 |
|
7913 |
|
7914 |
|
7915 |
|
7916 |
|
7917 |
|
7918 | var drawNote = function drawNote(elem, startx, verticalPos, msg, forceWidth) {
|
7919 | var rect = _svgDraw2.default.getNoteRect();
|
7920 | rect.x = startx;
|
7921 | rect.y = verticalPos;
|
7922 | rect.width = forceWidth || conf.width;
|
7923 | rect.class = 'note';
|
7924 |
|
7925 | var g = elem.append('g');
|
7926 | var rectElem = _svgDraw2.default.drawRect(g, rect);
|
7927 |
|
7928 | var textHeight = _drawLongText(msg.message, startx - 4, verticalPos + 24, g, rect.width - conf.noteMargin);
|
7929 |
|
7930 | bounds.insert(startx, verticalPos, startx + rect.width, verticalPos + 2 * conf.noteMargin + textHeight);
|
7931 | rectElem.attr('height', textHeight + 2 * conf.noteMargin);
|
7932 | bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin);
|
7933 | };
|
7934 |
|
7935 |
|
7936 |
|
7937 |
|
7938 |
|
7939 |
|
7940 |
|
7941 |
|
7942 |
|
7943 |
|
7944 | var drawMessage = function drawMessage(elem, startx, stopx, verticalPos, msg) {
|
7945 | var g = elem.append('g');
|
7946 | var txtCenter = startx + (stopx - startx) / 2;
|
7947 |
|
7948 | var textElem = g.append('text')
|
7949 | .attr('x', txtCenter).attr('y', verticalPos - 7).style('text-anchor', 'middle').attr('class', 'messageText').text(msg.message);
|
7950 |
|
7951 | var textWidth = (textElem._groups || textElem)[0][0].getBBox().width;
|
7952 |
|
7953 | var line = void 0;
|
7954 | if (startx === stopx) {
|
7955 | line = g.append('path').attr('d', 'M ' + startx + ',' + verticalPos + ' C ' + (startx + 60) + ',' + (verticalPos - 10) + ' ' + (startx + 60) + ',' + (verticalPos + 30) + ' ' + startx + ',' + (verticalPos + 20));
|
7956 |
|
7957 | bounds.bumpVerticalPos(30);
|
7958 | var dx = Math.max(textWidth / 2, 100);
|
7959 | bounds.insert(startx - dx, bounds.getVerticalPos() - 10, stopx + dx, bounds.getVerticalPos());
|
7960 | } else {
|
7961 | line = g.append('line');
|
7962 | line.attr('x1', startx);
|
7963 | line.attr('y1', verticalPos);
|
7964 | line.attr('x2', stopx);
|
7965 | line.attr('y2', verticalPos);
|
7966 | bounds.insert(startx, bounds.getVerticalPos() - 10, stopx, bounds.getVerticalPos());
|
7967 | }
|
7968 |
|
7969 |
|
7970 | if (msg.type === _sequenceDiagram.parser.yy.LINETYPE.DOTTED || msg.type === _sequenceDiagram.parser.yy.LINETYPE.DOTTED_CROSS || msg.type === _sequenceDiagram.parser.yy.LINETYPE.DOTTED_OPEN) {
|
7971 | line.style('stroke-dasharray', '3, 3');
|
7972 | line.attr('class', 'messageLine1');
|
7973 | } else {
|
7974 | line.attr('class', 'messageLine0');
|
7975 | }
|
7976 |
|
7977 | var url = '';
|
7978 | if (conf.arrowMarkerAbsolute) {
|
7979 | url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
|
7980 | url = url.replace(/\(/g, '\\(');
|
7981 | url = url.replace(/\)/g, '\\)');
|
7982 | }
|
7983 |
|
7984 | line.attr('stroke-width', 2);
|
7985 | line.attr('stroke', 'black');
|
7986 | line.style('fill', 'none');
|
7987 | if (msg.type === _sequenceDiagram.parser.yy.LINETYPE.SOLID || msg.type === _sequenceDiagram.parser.yy.LINETYPE.DOTTED) {
|
7988 | line.attr('marker-end', 'url(' + url + '#arrowhead)');
|
7989 | }
|
7990 |
|
7991 | if (msg.type === _sequenceDiagram.parser.yy.LINETYPE.SOLID_CROSS || msg.type === _sequenceDiagram.parser.yy.LINETYPE.DOTTED_CROSS) {
|
7992 | line.attr('marker-end', 'url(' + url + '#crosshead)');
|
7993 | }
|
7994 | };
|
7995 |
|
7996 | var drawActors = exports.drawActors = function drawActors(diagram, actors, actorKeys, verticalPos) {
|
7997 |
|
7998 | for (var i = 0; i < actorKeys.length; i++) {
|
7999 | var key = actorKeys[i];
|
8000 |
|
8001 |
|
8002 | actors[key].x = i * conf.actorMargin + i * conf.width;
|
8003 | actors[key].y = verticalPos;
|
8004 | actors[key].width = conf.diagramMarginX;
|
8005 | actors[key].height = conf.diagramMarginY;
|
8006 |
|
8007 |
|
8008 | _svgDraw2.default.drawActor(diagram, actors[key].x, verticalPos, actors[key].description, conf);
|
8009 | bounds.insert(actors[key].x, verticalPos, actors[key].x + conf.width, conf.height);
|
8010 | }
|
8011 |
|
8012 |
|
8013 | bounds.bumpVerticalPos(conf.height);
|
8014 | };
|
8015 |
|
8016 | var setConf = exports.setConf = function setConf(cnf) {
|
8017 | var keys = Object.keys(cnf);
|
8018 |
|
8019 | keys.forEach(function (key) {
|
8020 | conf[key] = cnf[key];
|
8021 | });
|
8022 | };
|
8023 |
|
8024 | var actorActivations = function actorActivations(actor) {
|
8025 | return bounds.activations.filter(function (activation) {
|
8026 | return activation.actor === actor;
|
8027 | });
|
8028 | };
|
8029 |
|
8030 | var actorFlowVerticaBounds = function actorFlowVerticaBounds(actor) {
|
8031 |
|
8032 | var actors = _sequenceDiagram.parser.yy.getActors();
|
8033 | var activations = actorActivations(actor);
|
8034 |
|
8035 | var left = activations.reduce(function (acc, activation) {
|
8036 | return Math.min(acc, activation.startx);
|
8037 | }, actors[actor].x + conf.width / 2);
|
8038 | var right = activations.reduce(function (acc, activation) {
|
8039 | return Math.max(acc, activation.stopx);
|
8040 | }, actors[actor].x + conf.width / 2);
|
8041 | return [left, right];
|
8042 | };
|
8043 |
|
8044 |
|
8045 |
|
8046 |
|
8047 |
|
8048 |
|
8049 | var draw = exports.draw = function draw(text, id) {
|
8050 | _sequenceDiagram.parser.yy.clear();
|
8051 | _sequenceDiagram.parser.parse(text + '\n');
|
8052 |
|
8053 | bounds.init();
|
8054 | var diagram = d3.select('[id="' + id + '"]');
|
8055 |
|
8056 | var startx = void 0;
|
8057 | var stopx = void 0;
|
8058 | var forceWidth = void 0;
|
8059 |
|
8060 |
|
8061 | var actors = _sequenceDiagram.parser.yy.getActors();
|
8062 | var actorKeys = _sequenceDiagram.parser.yy.getActorKeys();
|
8063 | var messages = _sequenceDiagram.parser.yy.getMessages();
|
8064 | var title = _sequenceDiagram.parser.yy.getTitle();
|
8065 | drawActors(diagram, actors, actorKeys, 0);
|
8066 |
|
8067 |
|
8068 | _svgDraw2.default.insertArrowHead(diagram);
|
8069 | _svgDraw2.default.insertArrowCrossHead(diagram);
|
8070 |
|
8071 | function activeEnd(msg, verticalPos) {
|
8072 | var activationData = bounds.endActivation(msg);
|
8073 | if (activationData.starty + 18 > verticalPos) {
|
8074 | activationData.starty = verticalPos - 6;
|
8075 | verticalPos += 12;
|
8076 | }
|
8077 | _svgDraw2.default.drawActivation(diagram, activationData, verticalPos, conf);
|
8078 |
|
8079 | bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);
|
8080 | }
|
8081 |
|
8082 |
|
8083 |
|
8084 |
|
8085 | messages.forEach(function (msg) {
|
8086 | var loopData = void 0;
|
8087 | switch (msg.type) {
|
8088 | case _sequenceDiagram.parser.yy.LINETYPE.NOTE:
|
8089 | bounds.bumpVerticalPos(conf.boxMargin);
|
8090 |
|
8091 | startx = actors[msg.from].x;
|
8092 | stopx = actors[msg.to].x;
|
8093 |
|
8094 | if (msg.placement === _sequenceDiagram.parser.yy.PLACEMENT.RIGHTOF) {
|
8095 | drawNote(diagram, startx + (conf.width + conf.actorMargin) / 2, bounds.getVerticalPos(), msg);
|
8096 | } else if (msg.placement === _sequenceDiagram.parser.yy.PLACEMENT.LEFTOF) {
|
8097 | drawNote(diagram, startx - (conf.width + conf.actorMargin) / 2, bounds.getVerticalPos(), msg);
|
8098 | } else if (msg.to === msg.from) {
|
8099 |
|
8100 | drawNote(diagram, startx, bounds.getVerticalPos(), msg);
|
8101 | } else {
|
8102 |
|
8103 | forceWidth = Math.abs(startx - stopx) + conf.actorMargin;
|
8104 | drawNote(diagram, (startx + stopx + conf.width - forceWidth) / 2, bounds.getVerticalPos(), msg, forceWidth);
|
8105 | }
|
8106 | break;
|
8107 | case _sequenceDiagram.parser.yy.LINETYPE.ACTIVE_START:
|
8108 | bounds.newActivation(msg, diagram);
|
8109 | break;
|
8110 | case _sequenceDiagram.parser.yy.LINETYPE.ACTIVE_END:
|
8111 | activeEnd(msg, bounds.getVerticalPos());
|
8112 | break;
|
8113 | case _sequenceDiagram.parser.yy.LINETYPE.LOOP_START:
|
8114 | bounds.bumpVerticalPos(conf.boxMargin);
|
8115 | bounds.newLoop(msg.message);
|
8116 | bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
|
8117 | break;
|
8118 | case _sequenceDiagram.parser.yy.LINETYPE.LOOP_END:
|
8119 | loopData = bounds.endLoop();
|
8120 |
|
8121 | _svgDraw2.default.drawLoop(diagram, loopData, 'loop', conf);
|
8122 | bounds.bumpVerticalPos(conf.boxMargin);
|
8123 | break;
|
8124 | case _sequenceDiagram.parser.yy.LINETYPE.OPT_START:
|
8125 | bounds.bumpVerticalPos(conf.boxMargin);
|
8126 | bounds.newLoop(msg.message);
|
8127 | bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
|
8128 | break;
|
8129 | case _sequenceDiagram.parser.yy.LINETYPE.OPT_END:
|
8130 | loopData = bounds.endLoop();
|
8131 |
|
8132 | _svgDraw2.default.drawLoop(diagram, loopData, 'opt', conf);
|
8133 | bounds.bumpVerticalPos(conf.boxMargin);
|
8134 | break;
|
8135 | case _sequenceDiagram.parser.yy.LINETYPE.ALT_START:
|
8136 | bounds.bumpVerticalPos(conf.boxMargin);
|
8137 | bounds.newLoop(msg.message);
|
8138 | bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
|
8139 | break;
|
8140 | case _sequenceDiagram.parser.yy.LINETYPE.ALT_ELSE:
|
8141 | bounds.bumpVerticalPos(conf.boxMargin);
|
8142 | loopData = bounds.addSectionToLoop(msg.message);
|
8143 | bounds.bumpVerticalPos(conf.boxMargin);
|
8144 | break;
|
8145 | case _sequenceDiagram.parser.yy.LINETYPE.ALT_END:
|
8146 | loopData = bounds.endLoop();
|
8147 |
|
8148 | _svgDraw2.default.drawLoop(diagram, loopData, 'alt', conf);
|
8149 | bounds.bumpVerticalPos(conf.boxMargin);
|
8150 | break;
|
8151 | case _sequenceDiagram.parser.yy.LINETYPE.PAR_START:
|
8152 | bounds.bumpVerticalPos(conf.boxMargin);
|
8153 | bounds.newLoop(msg.message);
|
8154 | bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
|
8155 | break;
|
8156 | case _sequenceDiagram.parser.yy.LINETYPE.PAR_AND:
|
8157 | bounds.bumpVerticalPos(conf.boxMargin);
|
8158 | loopData = bounds.addSectionToLoop(msg.message);
|
8159 | bounds.bumpVerticalPos(conf.boxMargin);
|
8160 | break;
|
8161 | case _sequenceDiagram.parser.yy.LINETYPE.PAR_END:
|
8162 | loopData = bounds.endLoop();
|
8163 | _svgDraw2.default.drawLoop(diagram, loopData, 'par', conf);
|
8164 | bounds.bumpVerticalPos(conf.boxMargin);
|
8165 | break;
|
8166 | default:
|
8167 | try {
|
8168 |
|
8169 | bounds.bumpVerticalPos(conf.messageMargin);
|
8170 | var fromBounds = actorFlowVerticaBounds(msg.from);
|
8171 | var toBounds = actorFlowVerticaBounds(msg.to);
|
8172 | var fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0;
|
8173 | var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1;
|
8174 | startx = fromBounds[fromIdx];
|
8175 | stopx = toBounds[toIdx];
|
8176 |
|
8177 | var verticalPos = bounds.getVerticalPos();
|
8178 | drawMessage(diagram, startx, stopx, verticalPos, msg);
|
8179 | var allBounds = fromBounds.concat(toBounds);
|
8180 | bounds.insert(Math.min.apply(null, allBounds), verticalPos, Math.max.apply(null, allBounds), verticalPos);
|
8181 | } catch (e) {
|
8182 | _logger.logger.error('error while drawing message', e);
|
8183 | }
|
8184 | }
|
8185 | });
|
8186 |
|
8187 | if (conf.mirrorActors) {
|
8188 |
|
8189 | bounds.bumpVerticalPos(conf.boxMargin * 2);
|
8190 | drawActors(diagram, actors, actorKeys, bounds.getVerticalPos());
|
8191 | }
|
8192 |
|
8193 | var box = bounds.getBounds();
|
8194 |
|
8195 |
|
8196 | _logger.logger.debug('For line height fix Querying: #' + id + ' .actor-line');
|
8197 | var actorLines = d3.selectAll('#' + id + ' .actor-line');
|
8198 | actorLines.attr('y2', box.stopy);
|
8199 |
|
8200 | var height = box.stopy - box.starty + 2 * conf.diagramMarginY;
|
8201 | if (conf.mirrorActors) {
|
8202 | height = height - conf.boxMargin + conf.bottomMarginAdj;
|
8203 | }
|
8204 |
|
8205 | var width = box.stopx - box.startx + 2 * conf.diagramMarginX;
|
8206 |
|
8207 | if (title) {
|
8208 | diagram.append('text').text(title).attr('x', (box.stopx - box.startx) / 2 - 2 * conf.diagramMarginX).attr('y', -25);
|
8209 | }
|
8210 |
|
8211 | if (conf.useMaxWidth) {
|
8212 | diagram.attr('height', '100%');
|
8213 | diagram.attr('width', '100%');
|
8214 | diagram.attr('style', 'max-width:' + width + 'px;');
|
8215 | } else {
|
8216 | diagram.attr('height', height);
|
8217 | diagram.attr('width', width);
|
8218 | }
|
8219 | var extraVertForTitle = title ? 40 : 0;
|
8220 | diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + (conf.diagramMarginY + extraVertForTitle) + ' ' + width + ' ' + (height + extraVertForTitle));
|
8221 | };
|
8222 |
|
8223 | exports.default = {
|
8224 | bounds: bounds,
|
8225 | drawActors: drawActors,
|
8226 | setConf: setConf,
|
8227 | draw: draw
|
8228 | };
|
8229 |
|
8230 | }),
|
8231 |
|
8232 | "./src/diagrams/sequence/svgDraw.js":
|
8233 |
|
8234 |
|
8235 |
|
8236 |
|
8237 | (function(module, exports, __webpack_require__) {
|
8238 |
|
8239 | "use strict";
|
8240 |
|
8241 |
|
8242 | Object.defineProperty(exports, "__esModule", {
|
8243 | value: true
|
8244 | });
|
8245 | var drawRect = exports.drawRect = function drawRect(elem, rectData) {
|
8246 | var rectElem = elem.append('rect');
|
8247 | rectElem.attr('x', rectData.x);
|
8248 | rectElem.attr('y', rectData.y);
|
8249 | rectElem.attr('fill', rectData.fill);
|
8250 | rectElem.attr('stroke', rectData.stroke);
|
8251 | rectElem.attr('width', rectData.width);
|
8252 | rectElem.attr('height', rectData.height);
|
8253 | rectElem.attr('rx', rectData.rx);
|
8254 | rectElem.attr('ry', rectData.ry);
|
8255 |
|
8256 | if (typeof rectData.class !== 'undefined') {
|
8257 | rectElem.attr('class', rectData.class);
|
8258 | }
|
8259 |
|
8260 | return rectElem;
|
8261 | };
|
8262 |
|
8263 | var drawText = exports.drawText = function drawText(elem, textData, width) {
|
8264 |
|
8265 | var nText = textData.text.replace(/<br\/?>/ig, ' ');
|
8266 |
|
8267 | var textElem = elem.append('text');
|
8268 | textElem.attr('x', textData.x);
|
8269 | textElem.attr('y', textData.y);
|
8270 | textElem.style('text-anchor', textData.anchor);
|
8271 | textElem.attr('fill', textData.fill);
|
8272 | if (typeof textData.class !== 'undefined') {
|
8273 | textElem.attr('class', textData.class);
|
8274 | }
|
8275 |
|
8276 | var span = textElem.append('tspan');
|
8277 | span.attr('x', textData.x + textData.textMargin * 2);
|
8278 | span.attr('fill', textData.fill);
|
8279 | span.text(nText);
|
8280 |
|
8281 | return textElem;
|
8282 | };
|
8283 |
|
8284 | var drawLabel = exports.drawLabel = function drawLabel(elem, txtObject) {
|
8285 | function genPoints(x, y, width, height, cut) {
|
8286 | return x + ',' + y + ' ' + (x + width) + ',' + y + ' ' + (x + width) + ',' + (y + height - cut) + ' ' + (x + width - cut * 1.2) + ',' + (y + height) + ' ' + x + ',' + (y + height);
|
8287 | }
|
8288 | var polygon = elem.append('polygon');
|
8289 | polygon.attr('points', genPoints(txtObject.x, txtObject.y, 50, 20, 7));
|
8290 | polygon.attr('class', 'labelBox');
|
8291 |
|
8292 | txtObject.y = txtObject.y + txtObject.labelMargin;
|
8293 | txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
|
8294 | drawText(elem, txtObject);
|
8295 | };
|
8296 |
|
8297 | var actorCnt = -1;
|
8298 |
|
8299 |
|
8300 |
|
8301 |
|
8302 |
|
8303 |
|
8304 | var drawActor = exports.drawActor = function drawActor(elem, left, verticalPos, description, conf) {
|
8305 | var center = left + conf.width / 2;
|
8306 | var g = elem.append('g');
|
8307 | if (verticalPos === 0) {
|
8308 | actorCnt++;
|
8309 | g.append('line').attr('id', 'actor' + actorCnt).attr('x1', center).attr('y1', 5).attr('x2', center).attr('y2', 2000).attr('class', 'actor-line').attr('stroke-width', '0.5px').attr('stroke', '#999');
|
8310 | }
|
8311 |
|
8312 | var rect = getNoteRect();
|
8313 | rect.x = left;
|
8314 | rect.y = verticalPos;
|
8315 | rect.fill = '#eaeaea';
|
8316 | rect.width = conf.width;
|
8317 | rect.height = conf.height;
|
8318 | rect.class = 'actor';
|
8319 | rect.rx = 3;
|
8320 | rect.ry = 3;
|
8321 | drawRect(g, rect);
|
8322 |
|
8323 | _drawTextCandidateFunc(conf)(description, g, rect.x, rect.y, rect.width, rect.height, { 'class': 'actor' });
|
8324 | };
|
8325 |
|
8326 | var anchorElement = exports.anchorElement = function anchorElement(elem) {
|
8327 | return elem.append('g');
|
8328 | };
|
8329 |
|
8330 |
|
8331 |
|
8332 |
|
8333 |
|
8334 |
|
8335 | var drawActivation = exports.drawActivation = function drawActivation(elem, bounds, verticalPos) {
|
8336 | var rect = getNoteRect();
|
8337 | var g = bounds.anchored;
|
8338 | rect.x = bounds.startx;
|
8339 | rect.y = bounds.starty;
|
8340 | rect.fill = '#f4f4f4';
|
8341 | rect.width = bounds.stopx - bounds.startx;
|
8342 | rect.height = verticalPos - bounds.starty;
|
8343 | drawRect(g, rect);
|
8344 | };
|
8345 |
|
8346 |
|
8347 |
|
8348 |
|
8349 |
|
8350 |
|
8351 |
|
8352 | var drawLoop = exports.drawLoop = function drawLoop(elem, bounds, labelText, conf) {
|
8353 | var g = elem.append('g');
|
8354 | var drawLoopLine = function drawLoopLine(startx, starty, stopx, stopy) {
|
8355 | return g.append('line').attr('x1', startx).attr('y1', starty).attr('x2', stopx).attr('y2', stopy).attr('class', 'loopLine');
|
8356 | };
|
8357 | drawLoopLine(bounds.startx, bounds.starty, bounds.stopx, bounds.starty);
|
8358 | drawLoopLine(bounds.stopx, bounds.starty, bounds.stopx, bounds.stopy);
|
8359 | drawLoopLine(bounds.startx, bounds.stopy, bounds.stopx, bounds.stopy);
|
8360 | drawLoopLine(bounds.startx, bounds.starty, bounds.startx, bounds.stopy);
|
8361 | if (typeof bounds.sections !== 'undefined') {
|
8362 | bounds.sections.forEach(function (item) {
|
8363 | drawLoopLine(bounds.startx, item, bounds.stopx, item).style('stroke-dasharray', '3, 3');
|
8364 | });
|
8365 | }
|
8366 |
|
8367 | var txt = getTextObj();
|
8368 | txt.text = labelText;
|
8369 | txt.x = bounds.startx;
|
8370 | txt.y = bounds.starty;
|
8371 | txt.labelMargin = 1.5 * 10;
|
8372 | txt.class = 'labelText';
|
8373 |
|
8374 | drawLabel(g, txt);
|
8375 |
|
8376 | txt = getTextObj();
|
8377 | txt.text = '[ ' + bounds.title + ' ]';
|
8378 | txt.x = bounds.startx + (bounds.stopx - bounds.startx) / 2;
|
8379 | txt.y = bounds.starty + 1.5 * conf.boxMargin;
|
8380 | txt.anchor = 'middle';
|
8381 | txt.class = 'loopText';
|
8382 |
|
8383 | drawText(g, txt);
|
8384 |
|
8385 | if (typeof bounds.sectionTitles !== 'undefined') {
|
8386 | bounds.sectionTitles.forEach(function (item, idx) {
|
8387 | if (item !== '') {
|
8388 | txt.text = '[ ' + item + ' ]';
|
8389 | txt.y = bounds.sections[idx] + 1.5 * conf.boxMargin;
|
8390 | drawText(g, txt);
|
8391 | }
|
8392 | });
|
8393 | }
|
8394 | };
|
8395 |
|
8396 |
|
8397 |
|
8398 |
|
8399 | var insertArrowHead = exports.insertArrowHead = function insertArrowHead(elem) {
|
8400 | elem.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 5).attr('refY', 2).attr('markerWidth', 6).attr('markerHeight', 4).attr('orient', 'auto').append('path').attr('d', 'M 0,0 V 4 L6,2 Z');
|
8401 | };
|
8402 |
|
8403 |
|
8404 |
|
8405 | var insertArrowCrossHead = exports.insertArrowCrossHead = function insertArrowCrossHead(elem) {
|
8406 | var defs = elem.append('defs');
|
8407 | var marker = defs.append('marker').attr('id', 'crosshead').attr('markerWidth', 15).attr('markerHeight', 8).attr('orient', 'auto').attr('refX', 16).attr('refY', 4);
|
8408 |
|
8409 |
|
8410 | marker.append('path').attr('fill', 'black').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 9,2 V 6 L16,4 Z');
|
8411 |
|
8412 |
|
8413 | marker.append('path').attr('fill', 'none').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 0,1 L 6,7 M 6,1 L 0,7');
|
8414 |
|
8415 | };
|
8416 |
|
8417 | var getTextObj = exports.getTextObj = function getTextObj() {
|
8418 | var txt = {
|
8419 | x: 0,
|
8420 | y: 0,
|
8421 | 'fill': 'black',
|
8422 | 'text-anchor': 'start',
|
8423 | style: '#666',
|
8424 | width: 100,
|
8425 | height: 100,
|
8426 | textMargin: 0,
|
8427 | rx: 0,
|
8428 | ry: 0
|
8429 | };
|
8430 | return txt;
|
8431 | };
|
8432 |
|
8433 | var getNoteRect = exports.getNoteRect = function getNoteRect() {
|
8434 | var rect = {
|
8435 | x: 0,
|
8436 | y: 0,
|
8437 | fill: '#EDF2AE',
|
8438 | stroke: '#666',
|
8439 | width: 100,
|
8440 | anchor: 'start',
|
8441 | height: 100,
|
8442 | rx: 0,
|
8443 | ry: 0
|
8444 | };
|
8445 | return rect;
|
8446 | };
|
8447 |
|
8448 | var _drawTextCandidateFunc = function () {
|
8449 | function byText(content, g, x, y, width, height, textAttrs) {
|
8450 | var text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('text-anchor', 'middle').text(content);
|
8451 | _setTextAttrs(text, textAttrs);
|
8452 | }
|
8453 |
|
8454 | function byTspan(content, g, x, y, width, height, textAttrs) {
|
8455 | var text = g.append('text').attr('x', x + width / 2).attr('y', y).style('text-anchor', 'middle');
|
8456 | text.append('tspan').attr('x', x + width / 2).attr('dy', '0').text(content);
|
8457 |
|
8458 | text.attr('y', y + height / 2.0).attr('dominant-baseline', 'central').attr('alignment-baseline', 'central');
|
8459 |
|
8460 | _setTextAttrs(text, textAttrs);
|
8461 | }
|
8462 |
|
8463 | function byFo(content, g, x, y, width, height, textAttrs) {
|
8464 | var s = g.append('switch');
|
8465 | var f = s.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height);
|
8466 |
|
8467 | var text = f.append('div').style('display', 'table').style('height', '100%').style('width', '100%');
|
8468 |
|
8469 | text.append('div').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle').text(content);
|
8470 |
|
8471 | byTspan(content, s, x, y, width, height, textAttrs);
|
8472 | _setTextAttrs(text, textAttrs);
|
8473 | }
|
8474 |
|
8475 | function _setTextAttrs(toText, fromTextAttrsDict) {
|
8476 | for (var key in fromTextAttrsDict) {
|
8477 | if (fromTextAttrsDict.hasOwnProperty(key)) {
|
8478 | toText.attr(key, fromTextAttrsDict[key]);
|
8479 | }
|
8480 | }
|
8481 | }
|
8482 |
|
8483 | return function (conf) {
|
8484 | return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;
|
8485 | };
|
8486 | }();
|
8487 |
|
8488 | exports.default = {
|
8489 | drawRect: drawRect,
|
8490 | drawText: drawText,
|
8491 | drawLabel: drawLabel,
|
8492 | drawActor: drawActor,
|
8493 | anchorElement: anchorElement,
|
8494 | drawActivation: drawActivation,
|
8495 | drawLoop: drawLoop,
|
8496 | insertArrowHead: insertArrowHead,
|
8497 | insertArrowCrossHead: insertArrowCrossHead,
|
8498 | getTextObj: getTextObj,
|
8499 | getNoteRect: getNoteRect
|
8500 | };
|
8501 |
|
8502 | }),
|
8503 |
|
8504 | "./src/logger.js":
|
8505 |
|
8506 |
|
8507 |
|
8508 |
|
8509 | (function(module, exports, __webpack_require__) {
|
8510 |
|
8511 | "use strict";
|
8512 |
|
8513 |
|
8514 | Object.defineProperty(exports, "__esModule", {
|
8515 | value: true
|
8516 | });
|
8517 | exports.setLogLevel = exports.logger = exports.LEVELS = undefined;
|
8518 |
|
8519 | var _moment = __webpack_require__( "moment");
|
8520 |
|
8521 | var _moment2 = _interopRequireDefault(_moment);
|
8522 |
|
8523 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8524 |
|
8525 | var LEVELS = exports.LEVELS = {
|
8526 | debug: 1,
|
8527 | info: 2,
|
8528 | warn: 3,
|
8529 | error: 4,
|
8530 | fatal: 5
|
8531 | };
|
8532 |
|
8533 | var logger = exports.logger = {
|
8534 | debug: function debug() {},
|
8535 | info: function info() {},
|
8536 | warn: function warn() {},
|
8537 | error: function error() {},
|
8538 | fatal: function fatal() {}
|
8539 | };
|
8540 |
|
8541 | var setLogLevel = exports.setLogLevel = function setLogLevel(level) {
|
8542 | logger.debug = function () {};
|
8543 | logger.info = function () {};
|
8544 | logger.warn = function () {};
|
8545 | logger.error = function () {};
|
8546 | logger.fatal = function () {};
|
8547 | if (level <= LEVELS.fatal) {
|
8548 | logger.fatal = console.log.bind(console, '\x1b[35m', format('FATAL'));
|
8549 | }
|
8550 | if (level <= LEVELS.error) {
|
8551 | logger.error = console.log.bind(console, '\x1b[31m', format('ERROR'));
|
8552 | }
|
8553 | if (level <= LEVELS.warn) {
|
8554 | logger.warn = console.log.bind(console, '\x1B[33m', format('WARN'));
|
8555 | }
|
8556 | if (level <= LEVELS.info) {
|
8557 | logger.info = console.log.bind(console, '\x1b[34m', format('INFO'));
|
8558 | }
|
8559 | if (level <= LEVELS.debug) {
|
8560 | logger.debug = console.log.bind(console, '\x1b[32m', format('DEBUG'));
|
8561 | }
|
8562 | };
|
8563 |
|
8564 | var format = function format(level) {
|
8565 | var time = (0, _moment2.default)().format('HH:mm:ss.SSS');
|
8566 | return time + ' : ' + level + ' : ';
|
8567 | };
|
8568 |
|
8569 | }),
|
8570 |
|
8571 | "./src/mermaid.js":
|
8572 |
|
8573 |
|
8574 |
|
8575 |
|
8576 | (function(module, exports, __webpack_require__) {
|
8577 |
|
8578 | "use strict";
|
8579 |
|
8580 |
|
8581 | Object.defineProperty(exports, "__esModule", {
|
8582 | value: true
|
8583 | });
|
8584 |
|
8585 | var _he = __webpack_require__( "he");
|
8586 |
|
8587 | var _he2 = _interopRequireDefault(_he);
|
8588 |
|
8589 | var _mermaidAPI = __webpack_require__( "./src/mermaidAPI.js");
|
8590 |
|
8591 | var _mermaidAPI2 = _interopRequireDefault(_mermaidAPI);
|
8592 |
|
8593 | var _logger = __webpack_require__( "./src/logger.js");
|
8594 |
|
8595 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8596 |
|
8597 |
|
8598 |
|
8599 |
|
8600 |
|
8601 |
|
8602 |
|
8603 |
|
8604 |
|
8605 |
|
8606 |
|
8607 |
|
8608 |
|
8609 |
|
8610 |
|
8611 |
|
8612 |
|
8613 |
|
8614 |
|
8615 |
|
8616 |
|
8617 |
|
8618 | var init = function init() {
|
8619 | var conf = _mermaidAPI2.default.getConfig();
|
8620 | _logger.logger.debug('Starting rendering diagrams');
|
8621 | var nodes = void 0;
|
8622 | if (arguments.length >= 2) {
|
8623 |
|
8624 | if (typeof arguments[0] !== 'undefined') {
|
8625 | mermaid.sequenceConfig = arguments[0];
|
8626 | }
|
8627 |
|
8628 | nodes = arguments[1];
|
8629 | } else {
|
8630 | nodes = arguments[0];
|
8631 | }
|
8632 |
|
8633 |
|
8634 | var callback = void 0;
|
8635 | if (typeof arguments[arguments.length - 1] === 'function') {
|
8636 | callback = arguments[arguments.length - 1];
|
8637 | _logger.logger.debug('Callback function found');
|
8638 | } else {
|
8639 | if (typeof conf.mermaid !== 'undefined') {
|
8640 | if (typeof conf.mermaid.callback === 'function') {
|
8641 | callback = conf.mermaid.callback;
|
8642 | _logger.logger.debug('Callback function found');
|
8643 | } else {
|
8644 | _logger.logger.debug('No Callback function found');
|
8645 | }
|
8646 | }
|
8647 | }
|
8648 | nodes = nodes === undefined ? document.querySelectorAll('.mermaid') : typeof nodes === 'string' ? document.querySelectorAll(nodes) : nodes instanceof window.Node ? [nodes] : nodes;
|
8649 |
|
8650 | _logger.logger.debug('Start On Load before: ' + mermaid.startOnLoad);
|
8651 | if (typeof mermaid.startOnLoad !== 'undefined') {
|
8652 | _logger.logger.debug('Start On Load inner: ' + mermaid.startOnLoad);
|
8653 | _mermaidAPI2.default.initialize({ startOnLoad: mermaid.startOnLoad });
|
8654 | }
|
8655 |
|
8656 | if (typeof mermaid.ganttConfig !== 'undefined') {
|
8657 | _mermaidAPI2.default.initialize({ gantt: mermaid.ganttConfig });
|
8658 | }
|
8659 |
|
8660 | var txt = void 0;
|
8661 |
|
8662 | var _loop = function _loop(i) {
|
8663 | var element = nodes[i];
|
8664 |
|
8665 |
|
8666 | if (!element.getAttribute('data-processed')) {
|
8667 | element.setAttribute('data-processed', true);
|
8668 | } else {
|
8669 | return 'continue';
|
8670 | }
|
8671 |
|
8672 | var id = 'mermaid-' + Date.now();
|
8673 |
|
8674 |
|
8675 | txt = element.innerHTML;
|
8676 |
|
8677 |
|
8678 | txt = _he2.default.decode(txt).trim().replace(/<br>/ig, '<br/>');
|
8679 |
|
8680 | _mermaidAPI2.default.render(id, txt, function (svgCode, bindFunctions) {
|
8681 | element.innerHTML = svgCode;
|
8682 | if (typeof callback !== 'undefined') {
|
8683 | callback(id);
|
8684 | }
|
8685 | bindFunctions(element);
|
8686 | }, element);
|
8687 | };
|
8688 |
|
8689 | for (var i = 0; i < nodes.length; i++) {
|
8690 | var _ret = _loop(i);
|
8691 |
|
8692 | if (_ret === 'continue') continue;
|
8693 | }
|
8694 | }; |
8695 |
|
8696 |
|
8697 |
|
8698 |
|
8699 |
|
8700 | var initialize = function initialize(config) {
|
8701 | _logger.logger.debug('Initializing mermaid');
|
8702 | if (typeof config.mermaid !== 'undefined') {
|
8703 | if (typeof config.mermaid.startOnLoad !== 'undefined') {
|
8704 | mermaid.startOnLoad = config.mermaid.startOnLoad;
|
8705 | }
|
8706 | if (typeof config.mermaid.htmlLabels !== 'undefined') {
|
8707 | mermaid.htmlLabels = config.mermaid.htmlLabels;
|
8708 | }
|
8709 | }
|
8710 | _mermaidAPI2.default.initialize(config);
|
8711 | };
|
8712 |
|
8713 |
|
8714 |
|
8715 |
|
8716 |
|
8717 |
|
8718 | var contentLoaded = function contentLoaded() {
|
8719 | var config = void 0;
|
8720 |
|
8721 | if (mermaid.startOnLoad) {
|
8722 |
|
8723 | config = _mermaidAPI2.default.getConfig();
|
8724 | if (config.startOnLoad) {
|
8725 | mermaid.init();
|
8726 | }
|
8727 | } else {
|
8728 | if (typeof mermaid.startOnLoad === 'undefined') {
|
8729 | _logger.logger.debug('In start, no config');
|
8730 | config = _mermaidAPI2.default.getConfig();
|
8731 | if (config.startOnLoad) {
|
8732 | mermaid.init();
|
8733 | }
|
8734 | }
|
8735 | }
|
8736 | };
|
8737 |
|
8738 | if (typeof document !== 'undefined') {
|
8739 | |
8740 |
|
8741 |
|
8742 | window.addEventListener('load', function () {
|
8743 | contentLoaded();
|
8744 | }, false);
|
8745 | }
|
8746 |
|
8747 | var mermaid = {
|
8748 | startOnLoad: true,
|
8749 | htmlLabels: true,
|
8750 |
|
8751 | mermaidAPI: _mermaidAPI2.default,
|
8752 | parse: _mermaidAPI2.default.parse,
|
8753 | render: _mermaidAPI2.default.render,
|
8754 |
|
8755 | init: init,
|
8756 | initialize: initialize,
|
8757 |
|
8758 | contentLoaded: contentLoaded
|
8759 | };
|
8760 |
|
8761 | exports.default = mermaid;
|
8762 |
|
8763 | }),
|
8764 |
|
8765 | "./src/mermaidAPI.js":
|
8766 |
|
8767 |
|
8768 |
|
8769 |
|
8770 | (function(module, exports, __webpack_require__) {
|
8771 |
|
8772 | "use strict";
|
8773 |
|
8774 |
|
8775 | Object.defineProperty(exports, "__esModule", {
|
8776 | value: true
|
8777 | });
|
8778 | exports.decodeEntities = exports.encodeEntities = undefined;
|
8779 |
|
8780 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; |
8781 |
|
8782 |
|
8783 |
|
8784 |
|
8785 |
|
8786 |
|
8787 |
|
8788 |
|
8789 |
|
8790 |
|
8791 |
|
8792 |
|
8793 |
|
8794 |
|
8795 | var _d = __webpack_require__( "d3");
|
8796 |
|
8797 | var d3 = _interopRequireWildcard(_d);
|
8798 |
|
8799 | var _scopeCss = __webpack_require__( "scope-css");
|
8800 |
|
8801 | var _scopeCss2 = _interopRequireDefault(_scopeCss);
|
8802 |
|
8803 | var _logger = __webpack_require__( "./src/logger.js");
|
8804 |
|
8805 | var _utils = __webpack_require__( "./src/utils.js");
|
8806 |
|
8807 | var _utils2 = _interopRequireDefault(_utils);
|
8808 |
|
8809 | var _flowRenderer = __webpack_require__( "./src/diagrams/flowchart/flowRenderer.js");
|
8810 |
|
8811 | var _flowRenderer2 = _interopRequireDefault(_flowRenderer);
|
8812 |
|
8813 | var _flow = __webpack_require__( "./src/diagrams/flowchart/parser/flow.js");
|
8814 |
|
8815 | var _flow2 = _interopRequireDefault(_flow);
|
8816 |
|
8817 | var _flowDb = __webpack_require__( "./src/diagrams/flowchart/flowDb.js");
|
8818 |
|
8819 | var _flowDb2 = _interopRequireDefault(_flowDb);
|
8820 |
|
8821 | var _sequenceRenderer = __webpack_require__( "./src/diagrams/sequence/sequenceRenderer.js");
|
8822 |
|
8823 | var _sequenceRenderer2 = _interopRequireDefault(_sequenceRenderer);
|
8824 |
|
8825 | var _sequenceDiagram = __webpack_require__( "./src/diagrams/sequence/parser/sequenceDiagram.js");
|
8826 |
|
8827 | var _sequenceDiagram2 = _interopRequireDefault(_sequenceDiagram);
|
8828 |
|
8829 | var _sequenceDb = __webpack_require__( "./src/diagrams/sequence/sequenceDb.js");
|
8830 |
|
8831 | var _sequenceDb2 = _interopRequireDefault(_sequenceDb);
|
8832 |
|
8833 | var _ganttRenderer = __webpack_require__( "./src/diagrams/gantt/ganttRenderer.js");
|
8834 |
|
8835 | var _ganttRenderer2 = _interopRequireDefault(_ganttRenderer);
|
8836 |
|
8837 | var _gantt = __webpack_require__( "./src/diagrams/gantt/parser/gantt.js");
|
8838 |
|
8839 | var _gantt2 = _interopRequireDefault(_gantt);
|
8840 |
|
8841 | var _ganttDb = __webpack_require__( "./src/diagrams/gantt/ganttDb.js");
|
8842 |
|
8843 | var _ganttDb2 = _interopRequireDefault(_ganttDb);
|
8844 |
|
8845 | var _classRenderer = __webpack_require__( "./src/diagrams/class/classRenderer.js");
|
8846 |
|
8847 | var _classRenderer2 = _interopRequireDefault(_classRenderer);
|
8848 |
|
8849 | var _classDiagram = __webpack_require__( "./src/diagrams/class/parser/classDiagram.js");
|
8850 |
|
8851 | var _classDiagram2 = _interopRequireDefault(_classDiagram);
|
8852 |
|
8853 | var _classDb = __webpack_require__( "./src/diagrams/class/classDb.js");
|
8854 |
|
8855 | var _classDb2 = _interopRequireDefault(_classDb);
|
8856 |
|
8857 | var _gitGraphRenderer = __webpack_require__( "./src/diagrams/git/gitGraphRenderer.js");
|
8858 |
|
8859 | var _gitGraphRenderer2 = _interopRequireDefault(_gitGraphRenderer);
|
8860 |
|
8861 | var _gitGraph = __webpack_require__( "./src/diagrams/git/parser/gitGraph.js");
|
8862 |
|
8863 | var _gitGraph2 = _interopRequireDefault(_gitGraph);
|
8864 |
|
8865 | var _gitGraphAst = __webpack_require__( "./src/diagrams/git/gitGraphAst.js");
|
8866 |
|
8867 | var _gitGraphAst2 = _interopRequireDefault(_gitGraphAst);
|
8868 |
|
8869 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8870 |
|
8871 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
8872 |
|
8873 | var themes = {};
|
8874 | var _arr = ['default', 'forest', 'dark', 'neutral'];
|
8875 | for (var _i = 0; _i < _arr.length; _i++) {
|
8876 | var themeName = _arr[_i];
|
8877 | themes[themeName] = __webpack_require__("./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$")("./" + themeName + '/index.scss');
|
8878 | }
|
8879 |
|
8880 |
|
8881 |
|
8882 |
|
8883 |
|
8884 |
|
8885 |
|
8886 |
|
8887 |
|
8888 |
|
8889 |
|
8890 |
|
8891 | var config = {
|
8892 | theme: 'default',
|
8893 | themeCSS: undefined,
|
8894 |
|
8895 | |
8896 |
|
8897 |
|
8898 |
|
8899 |
|
8900 |
|
8901 |
|
8902 |
|
8903 | logLevel: 5,
|
8904 |
|
8905 | |
8906 |
|
8907 |
|
8908 | startOnLoad: true,
|
8909 |
|
8910 | |
8911 |
|
8912 |
|
8913 |
|
8914 | arrowMarkerAbsolute: false,
|
8915 |
|
8916 | |
8917 |
|
8918 |
|
8919 |
|
8920 | flowchart: {
|
8921 | |
8922 |
|
8923 |
|
8924 |
|
8925 | htmlLabels: true,
|
8926 |
|
8927 | curve: 'linear'
|
8928 | },
|
8929 |
|
8930 | |
8931 |
|
8932 |
|
8933 |
|
8934 | sequence: {
|
8935 |
|
8936 | |
8937 |
|
8938 |
|
8939 | diagramMarginX: 50,
|
8940 |
|
8941 | |
8942 |
|
8943 |
|
8944 | diagramMarginY: 10,
|
8945 |
|
8946 | |
8947 |
|
8948 |
|
8949 | actorMargin: 50,
|
8950 |
|
8951 | |
8952 |
|
8953 |
|
8954 | width: 150,
|
8955 |
|
8956 | |
8957 |
|
8958 |
|
8959 | height: 65,
|
8960 |
|
8961 | |
8962 |
|
8963 |
|
8964 | boxMargin: 10,
|
8965 |
|
8966 | |
8967 |
|
8968 |
|
8969 | boxTextMargin: 5,
|
8970 |
|
8971 | |
8972 |
|
8973 |
|
8974 | noteMargin: 10,
|
8975 |
|
8976 | |
8977 |
|
8978 |
|
8979 | messageMargin: 35,
|
8980 |
|
8981 | |
8982 |
|
8983 |
|
8984 | mirrorActors: true,
|
8985 |
|
8986 | |
8987 |
|
8988 |
|
8989 |
|
8990 | bottomMarginAdj: 1,
|
8991 |
|
8992 | |
8993 |
|
8994 |
|
8995 |
|
8996 | useMaxWidth: true
|
8997 | },
|
8998 |
|
8999 | |
9000 |
|
9001 |
|
9002 | gantt: {
|
9003 | |
9004 |
|
9005 |
|
9006 | titleTopMargin: 25,
|
9007 |
|
9008 | |
9009 |
|
9010 |
|
9011 | barHeight: 20,
|
9012 |
|
9013 | |
9014 |
|
9015 |
|
9016 | barGap: 4,
|
9017 |
|
9018 | |
9019 |
|
9020 |
|
9021 | topPadding: 50,
|
9022 |
|
9023 | |
9024 |
|
9025 |
|
9026 | leftPadding: 75,
|
9027 |
|
9028 | |
9029 |
|
9030 |
|
9031 | gridLineStartPadding: 35,
|
9032 |
|
9033 | |
9034 |
|
9035 |
|
9036 | fontSize: 11,
|
9037 |
|
9038 | |
9039 |
|
9040 |
|
9041 | fontFamily: '"Open-Sans", "sans-serif"',
|
9042 |
|
9043 | |
9044 |
|
9045 |
|
9046 | numberSectionStyles: 4,
|
9047 |
|
9048 | |
9049 |
|
9050 |
|
9051 | axisFormat: '%Y-%m-%d'
|
9052 | },
|
9053 | class: {},
|
9054 | git: {}
|
9055 | };
|
9056 |
|
9057 | (0, _logger.setLogLevel)(config.logLevel);
|
9058 |
|
9059 | function parse(text) {
|
9060 | var graphType = _utils2.default.detectType(text);
|
9061 | var parser = void 0;
|
9062 |
|
9063 | switch (graphType) {
|
9064 | case 'git':
|
9065 | parser = _gitGraph2.default;
|
9066 | parser.parser.yy = _gitGraphAst2.default;
|
9067 | break;
|
9068 | case 'flowchart':
|
9069 | parser = _flow2.default;
|
9070 | parser.parser.yy = _flowDb2.default;
|
9071 | break;
|
9072 | case 'sequence':
|
9073 | parser = _sequenceDiagram2.default;
|
9074 | parser.parser.yy = _sequenceDb2.default;
|
9075 | break;
|
9076 | case 'gantt':
|
9077 | parser = _gantt2.default;
|
9078 | parser.parser.yy = _ganttDb2.default;
|
9079 | break;
|
9080 | case 'class':
|
9081 | parser = _classDiagram2.default;
|
9082 | parser.parser.yy = _classDb2.default;
|
9083 | break;
|
9084 | }
|
9085 |
|
9086 | parser.parser.yy.parseError = function (str, hash) {
|
9087 | var error = { str: str, hash: hash };
|
9088 | throw error;
|
9089 | };
|
9090 |
|
9091 | parser.parse(text);
|
9092 | }
|
9093 |
|
9094 | var encodeEntities = exports.encodeEntities = function encodeEntities(text) {
|
9095 | var txt = text;
|
9096 |
|
9097 | txt = txt.replace(/style.*:\S*#.*;/g, function (s) {
|
9098 | var innerTxt = s.substring(0, s.length - 1);
|
9099 | return innerTxt;
|
9100 | });
|
9101 | txt = txt.replace(/classDef.*:\S*#.*;/g, function (s) {
|
9102 | var innerTxt = s.substring(0, s.length - 1);
|
9103 | return innerTxt;
|
9104 | });
|
9105 |
|
9106 | txt = txt.replace(/#\w+;/g, function (s) {
|
9107 | var innerTxt = s.substring(1, s.length - 1);
|
9108 |
|
9109 | var isInt = /^\+?\d+$/.test(innerTxt);
|
9110 | if (isInt) {
|
9111 | return 'fl°°' + innerTxt + '¶ß';
|
9112 | } else {
|
9113 | return 'fl°' + innerTxt + '¶ß';
|
9114 | }
|
9115 | });
|
9116 |
|
9117 | return txt;
|
9118 | };
|
9119 |
|
9120 | var decodeEntities = exports.decodeEntities = function decodeEntities(text) {
|
9121 | var txt = text;
|
9122 |
|
9123 | txt = txt.replace(/fl°°/g, function () {
|
9124 | return '&#';
|
9125 | });
|
9126 | txt = txt.replace(/fl°/g, function () {
|
9127 | return '&';
|
9128 | });
|
9129 | txt = txt.replace(/¶ß/g, function () {
|
9130 | return ';';
|
9131 | });
|
9132 |
|
9133 | return txt;
|
9134 | };
|
9135 |
|
9136 |
|
9137 |
|
9138 |
|
9139 |
|
9140 |
|
9141 |
|
9142 |
|
9143 |
|
9144 |
|
9145 |
|
9146 |
|
9147 |
|
9148 |
|
9149 |
|
9150 |
|
9151 |
|
9152 |
|
9153 |
|
9154 |
|
9155 |
|
9156 |
|
9157 |
|
9158 | var render = function render(id, txt, cb, container) {
|
9159 | if (typeof container !== 'undefined') {
|
9160 | container.innerHTML = '';
|
9161 |
|
9162 | d3.select(container).append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');
|
9163 | } else {
|
9164 | var _element = document.querySelector('#' + 'd' + id);
|
9165 | if (_element) {
|
9166 | _element.innerHTML = '';
|
9167 | }
|
9168 |
|
9169 | d3.select('body').append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');
|
9170 | }
|
9171 |
|
9172 | window.txt = txt;
|
9173 | txt = encodeEntities(txt);
|
9174 |
|
9175 | var element = d3.select('#d' + id).node();
|
9176 | var graphType = _utils2.default.detectType(txt);
|
9177 |
|
9178 |
|
9179 | var svg = element.firstChild;
|
9180 | var firstChild = svg.firstChild;
|
9181 |
|
9182 |
|
9183 | var style = themes[config.theme];
|
9184 | if (style === undefined) {
|
9185 | style = '';
|
9186 | }
|
9187 |
|
9188 |
|
9189 | if (config.themeCSS !== undefined) {
|
9190 | style += '\n' + config.themeCSS;
|
9191 | }
|
9192 |
|
9193 |
|
9194 | if (graphType === 'flowchart') {
|
9195 | var classes = _flowRenderer2.default.getClasses(txt);
|
9196 | for (var className in classes) {
|
9197 | style += '\n.' + className + ' > * { ' + classes[className].styles.join(' !important; ') + ' !important; }';
|
9198 | }
|
9199 | }
|
9200 |
|
9201 | var style1 = document.createElement('style');
|
9202 | style1.innerHTML = (0, _scopeCss2.default)(style, '#' + id);
|
9203 | svg.insertBefore(style1, firstChild);
|
9204 |
|
9205 | var style2 = document.createElement('style');
|
9206 | var cs = window.getComputedStyle(svg);
|
9207 | style2.innerHTML = '#' + id + ' {\n color: ' + cs.color + ';\n font: ' + cs.font + ';\n }';
|
9208 | svg.insertBefore(style2, firstChild);
|
9209 |
|
9210 | switch (graphType) {
|
9211 | case 'git':
|
9212 | config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
9213 | _gitGraphRenderer2.default.setConf(config.git);
|
9214 | _gitGraphRenderer2.default.draw(txt, id, false);
|
9215 | break;
|
9216 | case 'flowchart':
|
9217 | config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
9218 | _flowRenderer2.default.setConf(config.flowchart);
|
9219 | _flowRenderer2.default.draw(txt, id, false);
|
9220 | break;
|
9221 | case 'sequence':
|
9222 | config.sequence.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
9223 | if (config.sequenceDiagram) {
|
9224 |
|
9225 | _sequenceRenderer2.default.setConf(Object.assign(config.sequence, config.sequenceDiagram));
|
9226 | console.error('`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.');
|
9227 | } else {
|
9228 | _sequenceRenderer2.default.setConf(config.sequence);
|
9229 | }
|
9230 | _sequenceRenderer2.default.draw(txt, id);
|
9231 | break;
|
9232 | case 'gantt':
|
9233 | config.gantt.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
9234 | _ganttRenderer2.default.setConf(config.gantt);
|
9235 | _ganttRenderer2.default.draw(txt, id);
|
9236 | break;
|
9237 | case 'class':
|
9238 | config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
9239 | _classRenderer2.default.setConf(config.class);
|
9240 | _classRenderer2.default.draw(txt, id);
|
9241 | break;
|
9242 | }
|
9243 |
|
9244 | d3.select('[id="' + id + '"]').selectAll('foreignobject > *').attr('xmlns', 'http://www.w3.org/1999/xhtml');
|
9245 |
|
9246 | var url = '';
|
9247 | if (config.arrowMarkerAbsolute) {
|
9248 | url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
|
9249 | url = url.replace(/\(/g, '\\(');
|
9250 | url = url.replace(/\)/g, '\\)');
|
9251 | }
|
9252 |
|
9253 |
|
9254 | var svgCode = d3.select('#d' + id).node().innerHTML.replace(/url\(#arrowhead/g, 'url(' + url + '#arrowhead', 'g');
|
9255 |
|
9256 | svgCode = decodeEntities(svgCode);
|
9257 |
|
9258 | if (typeof cb !== 'undefined') {
|
9259 | cb(svgCode, _flowDb2.default.bindFunctions);
|
9260 | } else {
|
9261 | _logger.logger.warn('CB = undefined!');
|
9262 | }
|
9263 |
|
9264 | var node = d3.select('#d' + id).node();
|
9265 | if (node !== null && typeof node.remove === 'function') {
|
9266 | d3.select('#d' + id).node().remove();
|
9267 | }
|
9268 |
|
9269 | return svgCode;
|
9270 | };
|
9271 |
|
9272 | var setConf = function setConf(cnf) {
|
9273 |
|
9274 | var lvl1Keys = Object.keys(cnf);
|
9275 | for (var i = 0; i < lvl1Keys.length; i++) {
|
9276 | if (_typeof(cnf[lvl1Keys[i]]) === 'object' && cnf[lvl1Keys[i]] != null) {
|
9277 | var lvl2Keys = Object.keys(cnf[lvl1Keys[i]]);
|
9278 |
|
9279 | for (var j = 0; j < lvl2Keys.length; j++) {
|
9280 | _logger.logger.debug('Setting conf ', lvl1Keys[i], '-', lvl2Keys[j]);
|
9281 | if (typeof config[lvl1Keys[i]] === 'undefined') {
|
9282 | config[lvl1Keys[i]] = {};
|
9283 | }
|
9284 | _logger.logger.debug('Setting config: ' + lvl1Keys[i] + ' ' + lvl2Keys[j] + ' to ' + cnf[lvl1Keys[i]][lvl2Keys[j]]);
|
9285 | config[lvl1Keys[i]][lvl2Keys[j]] = cnf[lvl1Keys[i]][lvl2Keys[j]];
|
9286 | }
|
9287 | } else {
|
9288 | config[lvl1Keys[i]] = cnf[lvl1Keys[i]];
|
9289 | }
|
9290 | }
|
9291 | };
|
9292 |
|
9293 | function initialize(options) {
|
9294 | _logger.logger.debug('Initializing mermaidAPI');
|
9295 |
|
9296 | if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {
|
9297 | setConf(options);
|
9298 | }
|
9299 | (0, _logger.setLogLevel)(config.logLevel);
|
9300 | }
|
9301 |
|
9302 | function getConfig() {
|
9303 | return config;
|
9304 | }
|
9305 |
|
9306 | var mermaidAPI = {
|
9307 | render: render,
|
9308 | parse: parse,
|
9309 | initialize: initialize,
|
9310 | getConfig: getConfig
|
9311 | };
|
9312 |
|
9313 | exports.default = mermaidAPI;
|
9314 |
|
9315 | }),
|
9316 |
|
9317 | "./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$":
|
9318 |
|
9319 |
|
9320 |
|
9321 |
|
9322 | (function(module, exports, __webpack_require__) {
|
9323 |
|
9324 | var map = {
|
9325 | "./dark/index.scss": "./src/themes/dark/index.scss",
|
9326 | "./default/index.scss": "./src/themes/default/index.scss",
|
9327 | "./forest/index.scss": "./src/themes/forest/index.scss",
|
9328 | "./neutral/index.scss": "./src/themes/neutral/index.scss"
|
9329 | };
|
9330 |
|
9331 |
|
9332 | function webpackContext(req) {
|
9333 | var id = webpackContextResolve(req);
|
9334 | var module = __webpack_require__(id);
|
9335 | return module;
|
9336 | }
|
9337 | function webpackContextResolve(req) {
|
9338 | var id = map[req];
|
9339 | if(!(id + 1)) {
|
9340 | var e = new Error('Cannot find module "' + req + '".');
|
9341 | e.code = 'MODULE_NOT_FOUND';
|
9342 | throw e;
|
9343 | }
|
9344 | return id;
|
9345 | }
|
9346 | webpackContext.keys = function webpackContextKeys() {
|
9347 | return Object.keys(map);
|
9348 | };
|
9349 | webpackContext.resolve = webpackContextResolve;
|
9350 | module.exports = webpackContext;
|
9351 | webpackContext.id = "./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$";
|
9352 |
|
9353 | }),
|
9354 |
|
9355 | "./src/themes/dark/index.scss":
|
9356 |
|
9357 |
|
9358 |
|
9359 |
|
9360 | (function(module, exports, __webpack_require__) {
|
9361 |
|
9362 |
|
9363 |
|
9364 |
|
9365 | var styles = __webpack_require__( "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/dark/index.scss");
|
9366 |
|
9367 | if (typeof styles === 'string') {
|
9368 |
|
9369 | module.exports = styles;
|
9370 | } else {
|
9371 |
|
9372 | module.exports = styles.toString();
|
9373 | }
|
9374 |
|
9375 | }),
|
9376 |
|
9377 | "./src/themes/default/index.scss":
|
9378 |
|
9379 |
|
9380 |
|
9381 |
|
9382 | (function(module, exports, __webpack_require__) {
|
9383 |
|
9384 |
|
9385 |
|
9386 |
|
9387 | var styles = __webpack_require__( "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/default/index.scss");
|
9388 |
|
9389 | if (typeof styles === 'string') {
|
9390 |
|
9391 | module.exports = styles;
|
9392 | } else {
|
9393 |
|
9394 | module.exports = styles.toString();
|
9395 | }
|
9396 |
|
9397 | }),
|
9398 |
|
9399 | "./src/themes/forest/index.scss":
|
9400 |
|
9401 |
|
9402 |
|
9403 |
|
9404 | (function(module, exports, __webpack_require__) {
|
9405 |
|
9406 |
|
9407 |
|
9408 |
|
9409 | var styles = __webpack_require__( "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/forest/index.scss");
|
9410 |
|
9411 | if (typeof styles === 'string') {
|
9412 |
|
9413 | module.exports = styles;
|
9414 | } else {
|
9415 |
|
9416 | module.exports = styles.toString();
|
9417 | }
|
9418 |
|
9419 | }),
|
9420 |
|
9421 | "./src/themes/neutral/index.scss":
|
9422 |
|
9423 |
|
9424 |
|
9425 |
|
9426 | (function(module, exports, __webpack_require__) {
|
9427 |
|
9428 |
|
9429 |
|
9430 |
|
9431 | var styles = __webpack_require__( "./node_modules/css-loader/index.js!./node_modules/sass-loader/lib/loader.js!./src/themes/neutral/index.scss");
|
9432 |
|
9433 | if (typeof styles === 'string') {
|
9434 |
|
9435 | module.exports = styles;
|
9436 | } else {
|
9437 |
|
9438 | module.exports = styles.toString();
|
9439 | }
|
9440 |
|
9441 | }),
|
9442 |
|
9443 | "./src/utils.js":
|
9444 |
|
9445 |
|
9446 |
|
9447 |
|
9448 | (function(module, exports, __webpack_require__) {
|
9449 |
|
9450 | "use strict";
|
9451 |
|
9452 |
|
9453 | Object.defineProperty(exports, "__esModule", {
|
9454 | value: true
|
9455 | });
|
9456 | exports.interpolateToCurve = exports.isSubstringInArray = exports.detectType = undefined;
|
9457 |
|
9458 | var _d = __webpack_require__( "d3");
|
9459 |
|
9460 | var d3 = _interopRequireWildcard(_d);
|
9461 |
|
9462 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
9463 |
|
9464 |
|
9465 |
|
9466 |
|
9467 |
|
9468 |
|
9469 |
|
9470 |
|
9471 |
|
9472 |
|
9473 |
|
9474 |
|
9475 |
|
9476 |
|
9477 |
|
9478 |
|
9479 |
|
9480 |
|
9481 | var detectType = exports.detectType = function detectType(text) {
|
9482 | text = text.replace(/^\s*%%.*\n/g, '\n');
|
9483 | if (text.match(/^\s*sequenceDiagram/)) {
|
9484 | return 'sequence';
|
9485 | }
|
9486 |
|
9487 | if (text.match(/^\s*gantt/)) {
|
9488 | return 'gantt';
|
9489 | }
|
9490 |
|
9491 | if (text.match(/^\s*classDiagram/)) {
|
9492 | return 'class';
|
9493 | }
|
9494 |
|
9495 | if (text.match(/^\s*gitGraph/)) {
|
9496 | return 'git';
|
9497 | }
|
9498 | return 'flowchart';
|
9499 | };
|
9500 |
|
9501 |
|
9502 |
|
9503 |
|
9504 |
|
9505 |
|
9506 |
|
9507 |
|
9508 | var isSubstringInArray = exports.isSubstringInArray = function isSubstringInArray(str, arr) {
|
9509 | for (var i = 0; i < arr.length; i++) {
|
9510 | if (arr[i].match(str)) return i;
|
9511 | }
|
9512 | return -1;
|
9513 | };
|
9514 |
|
9515 | var interpolateToCurve = exports.interpolateToCurve = function interpolateToCurve(interpolate, defaultCurve) {
|
9516 | if (!interpolate) {
|
9517 | return defaultCurve;
|
9518 | }
|
9519 | var curveName = 'curve' + (interpolate.charAt(0).toUpperCase() + interpolate.slice(1));
|
9520 | return d3[curveName] || defaultCurve;
|
9521 | };
|
9522 |
|
9523 | exports.default = {
|
9524 | detectType: detectType,
|
9525 | isSubstringInArray: isSubstringInArray,
|
9526 | interpolateToCurve: interpolateToCurve
|
9527 | };
|
9528 |
|
9529 | }),
|
9530 |
|
9531 | "d3":
|
9532 |
|
9533 |
|
9534 |
|
9535 |
|
9536 | (function(module, exports) {
|
9537 |
|
9538 | module.exports = require("d3");
|
9539 |
|
9540 | }),
|
9541 |
|
9542 | "dagre-d3-renderer":
|
9543 |
|
9544 |
|
9545 |
|
9546 |
|
9547 | (function(module, exports) {
|
9548 |
|
9549 | module.exports = require("dagre-d3-renderer");
|
9550 |
|
9551 | }),
|
9552 |
|
9553 | "dagre-layout":
|
9554 |
|
9555 |
|
9556 |
|
9557 |
|
9558 | (function(module, exports) {
|
9559 |
|
9560 | module.exports = require("dagre-layout");
|
9561 |
|
9562 | }),
|
9563 |
|
9564 | "graphlibrary":
|
9565 |
|
9566 |
|
9567 |
|
9568 |
|
9569 | (function(module, exports) {
|
9570 |
|
9571 | module.exports = require("graphlibrary");
|
9572 |
|
9573 | }),
|
9574 |
|
9575 | "he":
|
9576 |
|
9577 |
|
9578 |
|
9579 |
|
9580 | (function(module, exports) {
|
9581 |
|
9582 | module.exports = require("he");
|
9583 |
|
9584 | }),
|
9585 |
|
9586 | "lodash":
|
9587 |
|
9588 |
|
9589 |
|
9590 |
|
9591 | (function(module, exports) {
|
9592 |
|
9593 | module.exports = require("lodash");
|
9594 |
|
9595 | }),
|
9596 |
|
9597 | "moment":
|
9598 |
|
9599 |
|
9600 |
|
9601 |
|
9602 | (function(module, exports) {
|
9603 |
|
9604 | module.exports = require("moment");
|
9605 |
|
9606 | }),
|
9607 |
|
9608 | "scope-css":
|
9609 |
|
9610 |
|
9611 |
|
9612 |
|
9613 | (function(module, exports) {
|
9614 |
|
9615 | module.exports = require("scope-css");
|
9616 |
|
9617 | })
|
9618 |
|
9619 | })["default"];
|
9620 | });
|
9621 |
|
\ | No newline at end of file |