- mcdDot += '"' + name + '" [shape="diamond", style="filled", color="lightgrey", label="' + name + '"';
- if (a.weak)
- mcdDot += ', peripheries=2';
- mcdDot += '];\n';
+ if (mcdStyle == "bubble")
+ {
+ mcdDot += '"' + name + '" [shape="diamond", style="filled", color="lightgrey", label="' + name + '"';
+ if (a.weak)
+ mcdDot += ', peripheries=2';
+ mcdDot += '];\n';
+ if (!!a.attributes)
+ {
+ a.attributes.forEach( attr => {
+ let label = (attr.isKey ? '#' : '') + attr.name;
+ mcdDot += '"' + name + '_' + attr.name + '" [shape=ellipse, label="' + label + '"];\n';
+ let attrName = name + '_' + attr.name;
+ if (Math.random() < 0.5)
+ mcdDot += '"' + attrName + '" -- "' + name + '";\n';
+ else
+ mcdDot += '"' + name + '" -- "' + attrName + '";\n';
+ });
+ }
+ }
+ else
+ {
+ let label = name;
+ if (!!a.attributes)
+ {
+ a.attributes.forEach( attr => {
+ let attrLabel = (attr.isKey ? '#' : '') + attr.name;
+ label += '\\n<' + attrLabel + '>';
+ });
+ }
+ mcdDot += '"' + name + '" [color="lightgrey", label="' + label + '"';
+ if (a.weak)
+ mcdDot += ', peripheries=2';
+ mcdDot += '];\n';
+ }