mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-30 02:14:15 +01:00
fix: Reimplement notes in namespaces for classRenderer-v3 (#5880)
This commit is contained in:
@@ -126,7 +126,7 @@ export const lookUpDomId = function (_id: string): string {
|
|||||||
export const clear = function () {
|
export const clear = function () {
|
||||||
relations = [];
|
relations = [];
|
||||||
classes = new Map();
|
classes = new Map();
|
||||||
notes = [];
|
notes = new Map<string, ClassNote>();
|
||||||
interfaces = [];
|
interfaces = [];
|
||||||
functions = [];
|
functions = [];
|
||||||
functions.push(setupToolTips);
|
functions.push(setupToolTips);
|
||||||
@@ -629,9 +629,7 @@ export const getData = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let cnt = 0;
|
for (const note of notes.values()) {
|
||||||
for (const note of notes) {
|
|
||||||
cnt++;
|
|
||||||
const noteNode: Node = {
|
const noteNode: Node = {
|
||||||
id: note.id,
|
id: note.id,
|
||||||
label: note.text,
|
label: note.text,
|
||||||
@@ -645,14 +643,15 @@ export const getData = () => {
|
|||||||
`stroke: ${config.themeVariables.noteBorderColor}`,
|
`stroke: ${config.themeVariables.noteBorderColor}`,
|
||||||
],
|
],
|
||||||
look: config.look,
|
look: config.look,
|
||||||
|
parentId: note.parent,
|
||||||
};
|
};
|
||||||
nodes.push(noteNode);
|
nodes.push(noteNode);
|
||||||
|
|
||||||
const noteClassId = classes.get(note.class)?.id ?? '';
|
const noteClassId = classes.get(note.class)?.id;
|
||||||
|
|
||||||
if (noteClassId) {
|
if (noteClassId) {
|
||||||
const edge: Edge = {
|
const edge: Edge = {
|
||||||
id: `edgeNote${cnt}`,
|
id: `edgeNote${note.index}`,
|
||||||
start: note.id,
|
start: note.id,
|
||||||
end: noteClassId,
|
end: noteClassId,
|
||||||
type: 'normal',
|
type: 'normal',
|
||||||
@@ -682,7 +681,7 @@ export const getData = () => {
|
|||||||
nodes.push(interfaceNode);
|
nodes.push(interfaceNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
cnt = 0;
|
let cnt = 0;
|
||||||
for (const classRelation of relations) {
|
for (const classRelation of relations) {
|
||||||
cnt++;
|
cnt++;
|
||||||
const edge: Edge = {
|
const edge: Edge = {
|
||||||
|
|||||||
Reference in New Issue
Block a user