X-Git-Url: https://git.auder.net/img/bundles/framework/images/logo_symfony.png?a=blobdiff_plain;f=parser.js;h=ea0841a40dd6fabe9db4dd11ca411e8b0caa0642;hb=a2d8ba728c576049b6f0d602b27f62c2e1f737a2;hp=6caf0a9f5a3f0dfdc4f153a5d8e4ffd54dba02df;hpb=006d95a3942660083d2c957afea5338c2de8642d;p=erdiag.git
diff --git a/parser.js b/parser.js
index 6caf0a9..ea0841a 100644
--- a/parser.js
+++ b/parser.js
@@ -202,7 +202,7 @@ class ErDiags
mcdDot += '];\n';
if (!!this.entities[name].attributes)
{
- _.shuffle(this.entities[name].attributes).forEach( a => {
+ this.entities[name].attributes.forEach( a => {
let label = (a.isKey ? '#' : '') + a.name;
let attrName = name + '_' + a.name;
mcdDot += '"' + attrName + '" [shape=ellipse, label="' + label + '"];\n';
@@ -226,7 +226,7 @@ class ErDiags
mcdDot += '
' + name + ' |
\n';
if (!!this.entities[name].attributes)
{
- _.shuffle(this.entities[name].attributes).forEach( a => {
+ this.entities[name].attributes.forEach( a => {
let label = (a.isKey ? '' : '') + a.name + (a.isKey ? '' : '');
mcdDot += '' + label + ' |
\n';
});
@@ -239,6 +239,10 @@ class ErDiags
});
// Inheritances:
_.shuffle(this.inheritances).forEach( i => {
+ // TODO: node shape = triangle fill yellow. See
+ // https://merise.developpez.com/faq/?page=MCD#CIF-ou-dependance-fonctionnelle-de-A-a-Z
+ // https://merise.developpez.com/faq/?page=MLD#Comment-transformer-un-MCD-en-MLD
+ // https://www.developpez.net/forums/d1088964/general-developpement/alm/modelisation/structure-agregation-l-association-d-association/
_.shuffle(i.children).forEach( c => {
if (Math.random() < 0.5)
mcdDot += '"' + c + '":name -- "' + i.parent;
@@ -266,7 +270,7 @@ class ErDiags
});
if (!!a.attributes)
{
- _.shuffle(a.attributes).forEach( attr => {
+ a.attributes.forEach( attr => {
let label = (attr.isKey ? '#' : '') + attr.name;
mcdDot += '"' + name + '_' + attr.name + '" [shape=ellipse, label="' + label + '"];\n';
let attrName = name + '_' + attr.name;