Browse Source

Removed depricated dynamic entree, allow any smooth curve style for hierarchical layout.

flowchartTest
Alex de Mulder 9 years ago
parent
commit
229c22bc9b
5 changed files with 21516 additions and 21485 deletions
  1. +1
    -0
      HISTORY.md
  2. +21491
    -21476
      dist/vis.js
  3. +5
    -2
      lib/network/modules/EdgesHandler.js
  4. +19
    -6
      lib/network/modules/LayoutEngine.js
  5. +0
    -1
      lib/network/modules/ManipulationSystem.js

+ 1
- 0
HISTORY.md View File

@ -17,6 +17,7 @@ http://visjs.org
- Added getNodesInCluster method.
- Renamed editNodeMode to editNode, editNodeMode now give a deprication log message.
- Added multiselect to the docs.
- Removed depricated dynamic entree, allow any smooth curve style for hierarchical layout.
### Graph2d & Timeline

+ 21491
- 21476
dist/vis.js
File diff suppressed because it is too large
View File


+ 5
- 2
lib/network/modules/EdgesHandler.js View File

@ -95,6 +95,9 @@ class EdgesHandler {
bindEventListeners() {
// this allows external modules to force all dynamic curves to turn static.
this.body.emitter.on("_forceDisableDynamicCurves", (type) => {
if (type === 'dynamic') {
type = 'continuous';
}
let emitChange = false;
for (let edgeId in this.body.edges) {
if (this.body.edges.hasOwnProperty(edgeId)) {
@ -106,12 +109,12 @@ class EdgesHandler {
if (edgeData !== undefined) {
let edgeOptions = edgeData.smooth;
if (edgeOptions !== undefined) {
if (edgeOptions.enabled === true && edgeOptions.dynamic === true) {
if (edgeOptions.enabled === true && edgeOptions.type === 'dynamic') {
if (type === undefined) {
edge.setOptions({smooth: false});
}
else {
edge.setOptions({smooth: {dynamic: false, type: type}});
edge.setOptions({smooth: {type: type}});
}
emitChange = true;
}

+ 19
- 6
lib/network/modules/LayoutEngine.js View File

@ -100,21 +100,34 @@ class LayoutEngine {
// disable smooth curves if nothing is defined. If smooth curves have been turned on, turn them into static smooth curves.
if (allOptions.edges === undefined) {
this.optionsBackup.edges = {smooth:true, dynamic:true};
this.optionsBackup.edges = {smooth:{enabled:true, type:'dynamic'}};
allOptions.edges = {smooth: false};
}
else if (allOptions.edges.smooth === undefined) {
this.optionsBackup.edges = {smooth:true, dynamic:true};
this.optionsBackup.edges = {smooth:{enabled:true, type:'dynamic'}};
allOptions.edges.smooth = false;
}
else {
if (typeof allOptions.edges.smooth === 'boolean') {
this.optionsBackup.edges = {smooth:allOptions.edges.smooth, dynamic:true};
allOptions.edges.smooth = {enabled: allOptions.edges.smooth, dynamic: false, type:type}
this.optionsBackup.edges = {smooth:allOptions.edges.smooth};
allOptions.edges.smooth = {enabled: allOptions.edges.smooth, type:type}
}
else {
this.optionsBackup.edges = {smooth: allOptions.edges.smooth.enabled === undefined ? true : allOptions.edges.smooth.enabled, dynamic:true};
allOptions.edges.smooth = {enabled: allOptions.edges.smooth.enabled === undefined ? true : allOptions.edges.smooth.enabled, dynamic: false, type:type}
// allow custom types except for dynamic
if (allOptions.edges.smooth.type !== undefined && allOptions.edges.smooth.type !== 'dynamic') {
type = allOptions.edges.smooth.type;
}
this.optionsBackup.edges = {
smooth: allOptions.edges.smooth.enabled === undefined ? true : allOptions.edges.smooth.enabled,
type:allOptions.edges.smooth.type === undefined ? 'dynamic' : allOptions.edges.smooth.type,
roundness: allOptions.edges.smooth.roundness === undefined ? 0.5 : allOptions.edges.smooth.roundness
};
allOptions.edges.smooth = {
enabled: allOptions.edges.smooth.enabled === undefined ? true : allOptions.edges.smooth.enabled,
type:type,
roundness: allOptions.edges.smooth.roundness === undefined ? 0.5 : allOptions.edges.smooth.roundness
}
}
}

+ 0
- 1
lib/network/modules/ManipulationSystem.js View File

@ -946,7 +946,6 @@ class ManipulationSystem {
physics: false,
smooth: {
enabled: true,
dynamic: false,
type: 'continuous',
roundness: 0.5
}

Loading…
Cancel
Save