mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 08:50:13 +02:00
Use static reference for relationType in StateDB
This commit is contained in:
@@ -412,16 +412,15 @@ export const drawState = function (elem, stateDef) {
|
||||
|
||||
let edgeCount = 0;
|
||||
export const drawEdge = function (elem, path, relation) {
|
||||
const stateDb = new StateDB();
|
||||
const getRelationType = function (type) {
|
||||
switch (type) {
|
||||
case stateDb.relationType.AGGREGATION:
|
||||
case StateDB.relationType.AGGREGATION:
|
||||
return 'aggregation';
|
||||
case stateDb.relationType.EXTENSION:
|
||||
case StateDB.relationType.EXTENSION:
|
||||
return 'extension';
|
||||
case stateDb.relationType.COMPOSITION:
|
||||
case StateDB.relationType.COMPOSITION:
|
||||
return 'composition';
|
||||
case stateDb.relationType.DEPENDENCY:
|
||||
case StateDB.relationType.DEPENDENCY:
|
||||
return 'dependency';
|
||||
}
|
||||
};
|
||||
@@ -460,7 +459,7 @@ export const drawEdge = function (elem, path, relation) {
|
||||
|
||||
svgPath.attr(
|
||||
'marker-end',
|
||||
'url(' + url + '#' + getRelationType(stateDb.relationType.DEPENDENCY) + 'End' + ')'
|
||||
'url(' + url + '#' + getRelationType(StateDB.relationType.DEPENDENCY) + 'End' + ')'
|
||||
);
|
||||
|
||||
if (relation.title !== undefined) {
|
||||
|
Reference in New Issue
Block a user