fix: Fixed annoying display bug

This commit is contained in:
NunoSempere 2021-11-26 14:31:30 +00:00
parent fcc28c19aa
commit a15965c9ba

View File

@ -83,13 +83,15 @@ function findDistancesForAllElements({nodes, links}){
function abridgeArrayAndDisplay(array){ function abridgeArrayAndDisplay(array){
let newArray let newArray
let formatForDisplay
if(array.length > 10){ if(array.length > 10){
newArray = array.slice(0,10) newArray = array.slice(0,9)
newArray[11] = "..." formatForDisplay= newArray.map(d => formatLargeOrSmall(d))
formatForDisplay[9] = "..."
}else{ }else{
newArray=array newArray=array
formatForDisplay= newArray.map(d => formatLargeOrSmall(d))
} }
let formatForDisplay= newArray.map(d => formatLargeOrSmall(d))
let result = JSON.stringify(formatForDisplay, null, 2).replaceAll(`"`, "") let result = JSON.stringify(formatForDisplay, null, 2).replaceAll(`"`, "")
return result return result
} }