Browse Source

added code example for clustering

css_transitions
Alex de Mulder 10 years ago
parent
commit
fea3517180
2 changed files with 24 additions and 1 deletions
  1. +22
    -1
      docs/graph.html
  2. +2
    -0
      examples/timeline/01_basic.html

+ 22
- 1
docs/graph.html View File

@ -1142,6 +1142,27 @@ var nodes = [
<pre class="prettyprint"> <pre class="prettyprint">
// These variables must be defined in an options object named clustering. // These variables must be defined in an options object named clustering.
// If a variable is not supplied, the default value is used.
var options = {
clustering: {
enabled: false,
initialMaxNumberOfNodes: 100,
absoluteMaxNumberOfNodes:500,
reduceToMaxNumberOfNodes:300,
chainThreshold: 0.4,
clusterEdgeThreshold: 20,
sectorThreshold: 50,
screenSizeThreshold: 0.2,
fontSizeMultiplier: 4.0,
forceAmplification: 0.6,
distanceAmplification: 0.2,
edgeGrowth: 11,
clusterSizeWidthFactor: 10,
clusterSizeHeightFactor: 10,
clusterSizeRadiusFactor: 10,
activeAreaBoxSize: 100
}
}
</pre> </pre>
<table> <table>
@ -1279,7 +1300,7 @@ var options: {
initiallyVisible: true, initiallyVisible: true,
enableToggling: true, enableToggling: true,
iconPath: this._getIconURL() // automatic loading of the default icons iconPath: this._getIconURL() // automatic loading of the default icons
},
}
} }
</pre> </pre>

+ 2
- 0
examples/timeline/01_basic.html View File

@ -7,6 +7,8 @@
body, html { body, html {
font-family: sans-serif; font-family: sans-serif;
} }
</style> </style>
<script src="../../dist/vis.js"></script> <script src="../../dist/vis.js"></script>

Loading…
Cancel
Save