From 7164eaa8b15dbb920d7f6098d89ec67c513cf828 Mon Sep 17 00:00:00 2001 From: Ashish Jain Date: Thu, 27 Aug 2020 20:14:26 +0200 Subject: [PATCH] Allow Generics support for Class Title definition --- src/dagre-wrapper/nodes.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dagre-wrapper/nodes.js b/src/dagre-wrapper/nodes.js index c20c4f146..ceab8f400 100644 --- a/src/dagre-wrapper/nodes.js +++ b/src/dagre-wrapper/nodes.js @@ -588,9 +588,14 @@ const class_box = (parent, node) => { maxWidth += interfaceBBox.width; } + let classTitleString = node.classData.id; + + if (node.classData.type !== undefined && node.classData.type !== '') { + classTitleString += '<' + node.classData.type + '>'; + } const classTitleLabel = labelContainer .node() - .appendChild(createLabel(node.labelText, node.labelStyle, true, true)); + .appendChild(createLabel(classTitleString, node.labelStyle, true, true)); let classTitleBBox = classTitleLabel.getBBox(); if (getConfig().flowchart.htmlLabels) { const div = classTitleLabel.children[0];