Use static reference for relationType in StateDB

This commit is contained in:
saurabhg772244
2025-01-22 19:17:38 +05:30
parent 1c45df4567
commit 61f3fc5ede

View File

@@ -412,16 +412,15 @@ export const drawState = function (elem, stateDef) {
let edgeCount = 0; let edgeCount = 0;
export const drawEdge = function (elem, path, relation) { export const drawEdge = function (elem, path, relation) {
const stateDb = new StateDB();
const getRelationType = function (type) { const getRelationType = function (type) {
switch (type) { switch (type) {
case stateDb.relationType.AGGREGATION: case StateDB.relationType.AGGREGATION:
return 'aggregation'; return 'aggregation';
case stateDb.relationType.EXTENSION: case StateDB.relationType.EXTENSION:
return 'extension'; return 'extension';
case stateDb.relationType.COMPOSITION: case StateDB.relationType.COMPOSITION:
return 'composition'; return 'composition';
case stateDb.relationType.DEPENDENCY: case StateDB.relationType.DEPENDENCY:
return 'dependency'; return 'dependency';
} }
}; };
@@ -460,7 +459,7 @@ export const drawEdge = function (elem, path, relation) {
svgPath.attr( svgPath.attr(
'marker-end', 'marker-end',
'url(' + url + '#' + getRelationType(stateDb.relationType.DEPENDENCY) + 'End' + ')' 'url(' + url + '#' + getRelationType(StateDB.relationType.DEPENDENCY) + 'End' + ')'
); );
if (relation.title !== undefined) { if (relation.title !== undefined) {