mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-08 06:44:12 +01:00
fix: display annotation text for all stereotypes while preserving styling
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
@@ -36,24 +36,13 @@ export async function textHelper<T extends SVGGraphicsElement>(
|
||||
|
||||
annotationGroup = shapeSvg.insert('g').attr('class', 'annotation-group text');
|
||||
if (node.annotations.length > 0) {
|
||||
const annotation = node.annotations[0].toLowerCase();
|
||||
let isSupported = false;
|
||||
switch (annotation) {
|
||||
case 'interface':
|
||||
case 'abstract':
|
||||
case 'enumeration':
|
||||
isSupported = true;
|
||||
break;
|
||||
}
|
||||
if (!isSupported) {
|
||||
await addText(
|
||||
annotationGroup,
|
||||
{ text: `«${node.annotations[0]}»` } as unknown as ClassMember,
|
||||
0,
|
||||
[]
|
||||
);
|
||||
annotationGroup.style('opacity', '1');
|
||||
}
|
||||
await addText(
|
||||
annotationGroup,
|
||||
{ text: `«${node.annotations[0]}»` } as unknown as ClassMember,
|
||||
0,
|
||||
[]
|
||||
);
|
||||
annotationGroup.style('opacity', '1');
|
||||
const annotationGroupBBox = annotationGroup.node()!.getBBox();
|
||||
annotationGroupHeight = annotationGroupBBox.height;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user