mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-15 02:04:08 +01:00
#448 Fix for root nodes without children
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mermaid-js/mermaid-mindmap",
|
"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.",
|
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||||
"main": "dist/mermaid-mindmap.core.mjs",
|
"main": "dist/mermaid-mindmap.core.mjs",
|
||||||
"module": "dist/mermaid-mindmap.core.mjs",
|
"module": "dist/mermaid-mindmap.core.mjs",
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function drawNodes(svg, mindmap, section, conf) {
|
|||||||
* @param cy
|
* @param cy
|
||||||
*/
|
*/
|
||||||
function drawEdges(edgesEl, cy) {
|
function drawEdges(edgesEl, cy) {
|
||||||
cy.edges().map((edge, id) => {
|
cy?.edges().map((edge, id) => {
|
||||||
const data = edge.data();
|
const data = edge.data();
|
||||||
if (edge[0]._private.bodyBounds) {
|
if (edge[0]._private.bodyBounds) {
|
||||||
const bounds = edge[0]._private.rscratch;
|
const bounds = edge[0]._private.rscratch;
|
||||||
@@ -100,9 +100,10 @@ function addNodes(mindmap, cy, conf, level) {
|
|||||||
*/
|
*/
|
||||||
function layoutMindmap(node, conf) {
|
function layoutMindmap(node, conf) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
if (node.children.length === 0) {
|
// if (node.children.length === 0) {
|
||||||
return node;
|
// resolve(node);
|
||||||
}
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
// Add temporary render element
|
// Add temporary render element
|
||||||
const renderEl = select('body').append('div').attr('id', 'cy').attr('style', 'display:none');
|
const renderEl = select('body').append('div').attr('id', 'cy').attr('style', 'display:none');
|
||||||
|
|||||||
Reference in New Issue
Block a user