mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-09 15:24:13 +01:00
Fix elements not showing up if they were involved in a relation
This commit is contained in:
@@ -188,6 +188,7 @@ const getData = () => {
|
|||||||
const node = element as unknown as Node;
|
const node = element as unknown as Node;
|
||||||
node.shape = 'requirementBox';
|
node.shape = 'requirementBox';
|
||||||
node.look = config.look;
|
node.look = config.look;
|
||||||
|
node.id = element.name;
|
||||||
|
|
||||||
nodes.push(node);
|
nodes.push(node);
|
||||||
}
|
}
|
||||||
@@ -197,8 +198,8 @@ const getData = () => {
|
|||||||
const isContains = relation.type === Relationships.CONTAINS;
|
const isContains = relation.type === Relationships.CONTAINS;
|
||||||
const edge: Edge = {
|
const edge: Edge = {
|
||||||
id: `${relation.src}-${relation.dst}-${counter}`,
|
id: `${relation.src}-${relation.dst}-${counter}`,
|
||||||
start: requirements.get(relation.src)?.id,
|
start: requirements.get(relation.src)?.id ?? elements.get(relation.src)?.name,
|
||||||
end: requirements.get(relation.dst)?.id,
|
end: requirements.get(relation.dst)?.id ?? elements.get(relation.dst)?.name,
|
||||||
label: `<<${relation.type}>>`,
|
label: `<<${relation.type}>>`,
|
||||||
classes: 'relationshipLine',
|
classes: 'relationshipLine',
|
||||||
style: ['fill:none', isContains ? '' : 'stroke-dasharray: 10,7'],
|
style: ['fill:none', isContains ? '' : 'stroke-dasharray: 10,7'],
|
||||||
|
|||||||
Reference in New Issue
Block a user