mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-26 10:49:38 +02:00
Merge branch 'release_9.2.0_buggfixes' into sidv/TSMindmap
* release_9.2.0_buggfixes: Color fix for default nodes in mindmap, line uses inv color
This commit is contained in:
@@ -259,7 +259,7 @@ export const drawNode = function (elem, node, fullSection, conf) {
|
||||
// if (typeof node.x !== 'undefined' && typeof node.y !== 'undefined') {
|
||||
// nodeElem.attr('transform', 'translate(' + node.x + ',' + node.y + ')');
|
||||
// }
|
||||
db.setElementForId(node.id, nodeElem);
|
||||
setElementById(node.id, nodeElem);
|
||||
return node.height;
|
||||
};
|
||||
|
||||
@@ -286,7 +286,7 @@ export const drawEdge = function drawEdge(edgesElem, mindmap, parent, depth, ful
|
||||
};
|
||||
|
||||
export const positionNode = function (node) {
|
||||
const nodeElem = db.getElementById(node.id);
|
||||
const nodeElem = getElementById(node.id);
|
||||
|
||||
const x = node.x || 0;
|
||||
const y = node.y || 0;
|
||||
@@ -294,4 +294,18 @@ export const positionNode = function (node) {
|
||||
nodeElem.attr('transform', 'translate(' + x + ',' + y + ')');
|
||||
};
|
||||
|
||||
let elements = {};
|
||||
|
||||
const setElementById = (id, element) => {
|
||||
elements[id] = element;
|
||||
};
|
||||
|
||||
export const getElementById = (id) => {
|
||||
return elements[id];
|
||||
};
|
||||
|
||||
export const clearElementRefs = () => {
|
||||
elements = {};
|
||||
};
|
||||
|
||||
export default { drawNode, positionNode, drawEdge };
|
||||
|
Reference in New Issue
Block a user