|
|
@ -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 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|