#1143 Adding support in grammar for multiple nodes in dependency declarations

This commit is contained in:
Knut Sveidqvist
2019-12-15 18:10:52 +01:00
parent 26fac9507e
commit 6598b1b10d
4 changed files with 29 additions and 18 deletions

View File

@@ -102,7 +102,7 @@ export const addVertex = function(_id, text, type, style, classes) {
* @param type
* @param linktext
*/
export const addLink = function(_start, _end, type, linktext) {
export const addSingleLink = function(_start, _end, type, linktext) {
let start = _start;
let end = _end;
if (start[0].match(/\d/)) start = MERMAID_DOM_ID_PREFIX + start;
@@ -127,6 +127,14 @@ export const addLink = function(_start, _end, type, linktext) {
}
edges.push(edge);
};
export const addLink = function(_start, _end, type, linktext) {
let i, j;
for (i = 0; i < _start.length; i++) {
for (j = 0; j < _end.length; j++) {
addSingleLink(_start[i], _end[j], type, linktext);
}
}
};
/**
* Updates a link's line interpolation algorithm
@@ -490,6 +498,7 @@ export const indexNodes = function() {
};
export const getSubGraphs = function() {
console.warn(subGraphs);
return subGraphs;
};