#448 Fix for root nodes without children
This commit is contained in:
parent
bed95c77a9
commit
59cf085af5
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@mermaid-js/mermaid-mindmap",
|
||||
"version": "9.2.0-rc2",
|
||||
"version": "9.2.0-rc3",
|
||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||
"main": "dist/mermaid-mindmap.core.mjs",
|
||||
"module": "dist/mermaid-mindmap.core.mjs",
|
||||
|
|
|
@ -34,7 +34,7 @@ function drawNodes(svg, mindmap, section, conf) {
|
|||
* @param cy
|
||||
*/
|
||||
function drawEdges(edgesEl, cy) {
|
||||
cy.edges().map((edge, id) => {
|
||||
cy?.edges().map((edge, id) => {
|
||||
const data = edge.data();
|
||||
if (edge[0]._private.bodyBounds) {
|
||||
const bounds = edge[0]._private.rscratch;
|
||||
|
@ -100,9 +100,10 @@ function addNodes(mindmap, cy, conf, level) {
|
|||
*/
|
||||
function layoutMindmap(node, conf) {
|
||||
return new Promise((resolve) => {
|
||||
if (node.children.length === 0) {
|
||||
return node;
|
||||
}
|
||||
// if (node.children.length === 0) {
|
||||
// resolve(node);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// Add temporary render element
|
||||
const renderEl = select('body').append('div').attr('id', 'cy').attr('style', 'display:none');
|
||||
|
|
Loading…
Reference in New Issue