mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 00:40:22 +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;
|
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) {
|
||||||
|
Reference in New Issue
Block a user