Skip to content
Snippets Groups Projects
Commit a1174ae1 authored by Elora-V's avatar Elora-V
Browse files

default spacing factor

parent 3949fada
No related branches found
No related tags found
No related merge requests found
Pipeline #272151 passed
......@@ -272,7 +272,7 @@ watchEffect(
() => {
// Update spacing based on the new style object (mean of all possible size)
if(props.networkStyle){
const newSpacing=defaultSpacing(props.networkStyle);
const newSpacing=defaultSpacing(props.networkStyle,3);
if(newSpacing.horizontal && newSpacing.vertical){
defaultParameters.spacePixelHorizontalUser=newSpacing.horizontal;
defaultParameters.spacePixelVerticalUser=newSpacing.vertical;
......
......@@ -54,7 +54,7 @@ function getKeyFromValue(object:{[key:string|number]:number|string},value:number
//___________________ Node spacing __________________________
// get default spacing
export function defaultSpacing(networkStyle:GraphStyleProperties):{horizontal:number,vertical:number}{
export function defaultSpacing(networkStyle:GraphStyleProperties,factor:number=1):{horizontal:number,vertical:number}{
let meanHeigth=0;
let nHeigth=0;
let meanWidth=0;
......@@ -72,7 +72,7 @@ export function defaultSpacing(networkStyle:GraphStyleProperties):{horizontal:nu
});
if(nHeigth==0) nHeigth=1
if(nWidth==0) nWidth=1
return {horizontal:meanWidth/nWidth,vertical:meanHeigth/nHeigth};
return {horizontal:meanWidth/nWidth*factor,vertical:meanHeigth/nHeigth*factor};
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment