let entity = { attributes: this.parseAttributes(lines, start+1, end) };
if (lines[start].charAt(1) == '[')
entity.weak = true;
let entity = { attributes: this.parseAttributes(lines, start+1, end) };
if (lines[start].charAt(1) == '[')
entity.weak = true;
case '{': //association
// Association = { [name], [attributes], [weak], entities: ArrayOf entity indices }
let relationship = { };
case '{': //association
// Association = { [name], [attributes], [weak], entities: ArrayOf entity indices }
let relationship = { };
if (this.entities[name].weak)
mcdDot += ', peripheries=2';
mcdDot += '];\n';
if (this.entities[name].weak)
mcdDot += ', peripheries=2';
mcdDot += '];\n';
_.shuffle(this.entities[name].attributes).forEach( a => {
let label = (a.isKey ? '#' : '') + a.name;
let attrName = name + '_' + a.name;
_.shuffle(this.entities[name].attributes).forEach( a => {
let label = (a.isKey ? '#' : '') + a.name;
let attrName = name + '_' + a.name;
if (this.entities[name].weak)
{
mcdDot += '<table port="name" BORDER="1" ALIGN="LEFT" CELLPADDING="0" CELLSPACING="3" CELLBORDER="0">' +
if (this.entities[name].weak)
{
mcdDot += '<table port="name" BORDER="1" ALIGN="LEFT" CELLPADDING="0" CELLSPACING="3" CELLBORDER="0">' +
mcdDot += '<tr><td BGCOLOR="#ae7d4e" BORDER="0"><font COLOR="#FFFFFF">' + name + '</font></td></tr>\n';
if (!!this.entities[name].attributes)
{
mcdDot += '<tr><td BGCOLOR="#ae7d4e" BORDER="0"><font COLOR="#FFFFFF">' + name + '</font></td></tr>\n';
if (!!this.entities[name].attributes)
{
let label = (a.isKey ? '<u>' : '') + a.name + (a.isKey ? '</u>' : '');
mcdDot += '<tr><td BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" >' + label + '</font></td></tr>\n';
});
let label = (a.isKey ? '<u>' : '') + a.name + (a.isKey ? '</u>' : '');
mcdDot += '<tr><td BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" >' + label + '</font></td></tr>\n';
});
- mcdDot += i.parent + ':name -- ' + c;
- mcdDot += ':name [dir="forward", arrowhead="vee", style="dashed"];\n';
+ mcdDot += '"' + i.parent + '":name -- "' + c;
+ mcdDot += '":name [dir="forward", arrowhead="vee", style="dashed"];\n';
- mcdDot += name + '[shape="diamond", style="filled", color="lightgrey", label="' + (!!a.name ? a.name : '') + '"';
+ mcdDot += '"' + name + '" [shape="diamond", style="filled", color="lightgrey", label="' + name + '"';
if (a.weak)
mcdDot += ', peripheries=2';
mcdDot += '];\n';
_.shuffle(a.entities).forEach( e => {
if (Math.random() < 0.5)
if (a.weak)
mcdDot += ', peripheries=2';
mcdDot += '];\n';
_.shuffle(a.entities).forEach( e => {
if (Math.random() < 0.5)
mcdDot += '[label="' + ErDiags.CARDINAL[e.card] + '"];\n';
});
if (!!a.attributes)
{
_.shuffle(a.attributes).forEach( attr => {
let label = (attr.isKey ? '#' : '') + attr.name;
mcdDot += '[label="' + ErDiags.CARDINAL[e.card] + '"];\n';
});
if (!!a.attributes)
{
_.shuffle(a.attributes).forEach( attr => {
let label = (attr.isKey ? '#' : '') + attr.name;