// ER diagram description parser
class ErDiags
{
- constructor(description, callDot)
+ constructor(description, output)
{
this.entities = { };
this.inheritances = [ ];
this.tables = { };
this.mcdParsing(description);
this.mldParsing();
- this.callDot = !!callDot;
- if (this.callDot)
+ this.output = output;
+ if (output == "graph")
{
// Cache SVG graphs returned by server (in addition to server cache = good perfs)
this.mcdGraph = "";
name: attr.name,
type: attr.type,
isKey: attr.isKey,
- qualifiers: attr.qualifiers,
};
if (!!attr.qualifiers && !!attr.qualifiers.match(/references/i))
{
Object.assign(newField, {ref: attr.qualifiers.match(/references ([^\s]+)/i)[1]});
- attr.qualifiers = attr.qualifiers.replace(/references [^\s]+/i, "");
+ newField.qualifiers = attr.qualifiers.replace(/references [^\s]+/i, "");
}
newTable.push(newField);
});
});
});
mcdDot += '}';
- if (this.callDot)
+ if (this.output == "graph")
{
// Draw graph in element
ErDiags.AjaxGet(mcdDot, graphSvg => {
});
mldDot += links + '\n';
mldDot += '}';
- if (this.callDot)
+ if (this.output == "graph")
{
ErDiags.AjaxGet(mldDot, graphSvg => {
this.mldGraph = graphSvg;