enabled:false// (Boolean) | global on/off switch for clustering.
//
//initialMaxNodes: 100, // (# nodes) | if the initial amount of nodes is larger than this, we cluster until the total number is less than this threshold.
//clusterThreshold:500, // (# nodes) | during calculate forces, we check if the total number of nodes is larger than this. If it is, cluster until reduced to reduceToNodes
//reduceToNodes:300, // (# nodes) | during calculate forces, we check if the total number of nodes is larger than clusterThreshold. If it is, cluster until reduced to this
//chainThreshold: 0.4, // (% of all drawn nodes)| maximum percentage of allowed chainnodes (long strings of connected nodes) within all nodes. (lower means less chains).
//clusterEdgeThreshold: 20, // (px) | edge length threshold. if smaller, this node is clustered.
//sectorThreshold: 100, // (# nodes in cluster) | cluster size threshold. If larger, expanding in own sector.
//screenSizeThreshold: 0.2, // (% of canvas) | relative size threshold. If the width or height of a clusternode takes up this much of the screen, decluster node.
//fontSizeMultiplier: 4.0, // (px PNiC) | how much the cluster font size grows per node in cluster (in px).
//maxFontSize: 1000,
//forceAmplification: 0.1, // (multiplier PNiC) | factor of increase fo the repulsion force of a cluster (per node in cluster).
//distanceAmplification: 0.1, // (multiplier PNiC) | factor how much the repulsion distance of a cluster increases (per node in cluster).
//edgeGrowth: 20, // (px PNiC) | amount of clusterSize connected to the edge is multiplied with this and added to edgeLength.
//nodeScaling: {width: 1, // (px PNiC) | growth of the width per node in cluster.
// height: 1, // (px PNiC) | growth of the height per node in cluster.
// radius: 1}, // (px PNiC) | growth of the radius per node in cluster.
//maxNodeSizeIncrements: 600, // (# increments) | max growth of the width per node in cluster.
//activeAreaBoxSize: 80, // (px) | box area around the curser where clusters are popped open.
//clusterLevelDifference: 2, // used for normalization of the cluster levels
//clusterByZoom: true // enable clustering through zooming in and out
@ -45,7 +45,6 @@ function Network (container, data, options) {
this.renderRefreshRate=60;// hz (fps)
this.renderTimestep=1000/this.renderRefreshRate;// ms -- saves calculation later on
this.renderTime=0;// measured time it takes to render a frame
this.physicsTime=0;// measured time it takes to render a frame
this.runDoubleSpeed=false;
this.physicsDiscreteStepsize=0.50;// discrete stepsize of the simulation
@ -167,32 +166,6 @@ function Network (container, data, options) {
},
clustering:{// Per Node in Cluster = PNiC
enabled:false// (Boolean) | global on/off switch for clustering.
//
//initialMaxNodes: 100, // (# nodes) | if the initial amount of nodes is larger than this, we cluster until the total number is less than this threshold.
//clusterThreshold:500, // (# nodes) | during calculate forces, we check if the total number of nodes is larger than this. If it is, cluster until reduced to reduceToNodes
//reduceToNodes:300, // (# nodes) | during calculate forces, we check if the total number of nodes is larger than clusterThreshold. If it is, cluster until reduced to this
//chainThreshold: 0.4, // (% of all drawn nodes)| maximum percentage of allowed chainnodes (long strings of connected nodes) within all nodes. (lower means less chains).
//clusterEdgeThreshold: 20, // (px) | edge length threshold. if smaller, this node is clustered.
//sectorThreshold: 100, // (# nodes in cluster) | cluster size threshold. If larger, expanding in own sector.
//screenSizeThreshold: 0.2, // (% of canvas) | relative size threshold. If the width or height of a clusternode takes up this much of the screen, decluster node.
//fontSizeMultiplier: 4.0, // (px PNiC) | how much the cluster font size grows per node in cluster (in px).
//maxFontSize: 1000,
//forceAmplification: 0.1, // (multiplier PNiC) | factor of increase fo the repulsion force of a cluster (per node in cluster).
//distanceAmplification: 0.1, // (multiplier PNiC) | factor how much the repulsion distance of a cluster increases (per node in cluster).
//edgeGrowth: 20, // (px PNiC) | amount of clusterSize connected to the edge is multiplied with this and added to edgeLength.
//nodeScaling: {width: 1, // (px PNiC) | growth of the width per node in cluster.
// height: 1, // (px PNiC) | growth of the height per node in cluster.
// radius: 1}, // (px PNiC) | growth of the radius per node in cluster.
//maxNodeSizeIncrements: 600, // (# increments) | max growth of the width per node in cluster.
//activeAreaBoxSize: 80, // (px) | box area around the curser where clusters are popped open.
//clusterLevelDifference: 2, // used for normalization of the cluster levels
//clusterByZoom: true // enable clustering through zooming in and out
},
navigation:{
enabled:false
@ -224,6 +197,7 @@ function Network (container, data, options) {
minVelocity:0.1,// px/s
stabilize:true,// stabilize before displaying the network
stabilizationIterations:1000,// maximum number of iteration to stabilize
stabilizationStepsize:100,
zoomExtentOnStabilize:true,
locale:'en',
locales:locales,
@ -322,9 +296,7 @@ function Network (container, data, options) {
this.canvasTopLeft={"x":0,"y":0};// coordinates of the top left of the canvas. they will be set during _redraw.
this.canvasBottomRight={"x":0,"y":0};// coordinates of the bottom right of the canvas. they will be set during _redraw
this.pointerPosition={"x":0,"y":0};// coordinates of the bottom right of the canvas. they will be set during _redraw
this.areaCenter={};// object with x and y elements used for determining the center of the zoom action
this.scale=1;// defining the global scale variable in the constructor
this.previousScale=this.scale;// this is used to check if the zoom operation is zooming in or out
// datasets or dataviews
this.nodesData=null;// A DataSet or DataView
@ -365,10 +337,9 @@ function Network (container, data, options) {
this.timer=undefined;// Scheduling function. Is definded in this.start();
// load data (the disable start variable will be the same as the enabled clustering)