diff --git a/lib/network/modules/LayoutEngine.js b/lib/network/modules/LayoutEngine.js index 7dc04b7e..ccee1a43 100644 --- a/lib/network/modules/LayoutEngine.js +++ b/lib/network/modules/LayoutEngine.js @@ -561,13 +561,32 @@ class LayoutEngine { if (positionDefined < 0.5 * indices.length) { let MAX_LEVELS = 10; let level = 0; - let clusterThreshold = 150; - // Performance enhancement, during clustering edges need only be simple straight lines. + let clusterThreshold = 150; // TODO add this to options + + // + // Define the options for the hidden cluster nodes // These options don't propagate outside the clustering phase. + // + // Some options are explicitly disabled, because they may be set in group or default node options. + // The clusters are never displayed, so most explicit settings here serve as performance optimizations. + // + // The explicit setting of 'shape' is to avoid `shape: 'image'`; images are not passed to the hidden + // cluster nodes, leading to an exception on creation. + // + // All settings here are performance related, except when noted otherwise. + // let clusterOptions = { + clusterNodeProperties:{ + shape: 'ellipse', // Bugfix: avoid type 'image', no images supplied + label: '', // avoid label handling + group: '', // avoid group handling + font: {multi: false}, // avoid font propagation + }, clusterEdgeProperties:{ + label: '', // avoid label handling + font: {multi: false}, // avoid font propagation smooth: { - enabled: false + enabled: false // avoid drawing penalty for complex edges } } }; diff --git a/lib/network/modules/components/shared/Label.js b/lib/network/modules/components/shared/Label.js index 7a98af32..ab17918a 100644 --- a/lib/network/modules/components/shared/Label.js +++ b/lib/network/modules/components/shared/Label.js @@ -64,7 +64,7 @@ class Label { this.initFontOptions(options.font); - if (options.label !== undefined) { + if (options.label !== undefined && options.label !== null && options.label !== '') { this.labelDirty = true; }