tweak
This commit is contained in:
parent
427bb9b231
commit
530589bbc0
|
@ -81,6 +81,19 @@ function findDistancesForAllElements({nodes, links}){
|
||||||
return distances
|
return distances
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function abridgeArrayAndDisplay(array){
|
||||||
|
let newArray
|
||||||
|
if(array.length > 10){
|
||||||
|
newArray = array.slice(0,10)
|
||||||
|
newArray[11] = "..."
|
||||||
|
}else{
|
||||||
|
newArray=array
|
||||||
|
}
|
||||||
|
let formatForDisplay= newArray.map(d => formatLargeOrSmall(d))
|
||||||
|
let result = JSON.stringify(formatForDisplay, null, 2).replaceAll(`"`, "")
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
export function CreateTableWithDistances({isListOrdered, orderedList, listOfElements, links}){
|
export function CreateTableWithDistances({isListOrdered, orderedList, listOfElements, links}){
|
||||||
if(!isListOrdered || orderedList.length < listOfElements.length){
|
if(!isListOrdered || orderedList.length < listOfElements.length){
|
||||||
return (<div>{""}</div>)
|
return (<div>{""}</div>)
|
||||||
|
@ -110,7 +123,7 @@ export function CreateTableWithDistances({isListOrdered, orderedList, listOfElem
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td className="">{row.name}</td>
|
<td className="">{row.name}</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td className="">{JSON.stringify(row.distances.map(d => formatLargeOrSmall(d)), null, 2).replaceAll(`"`, "")}</td>
|
<td className="">{abridgeArrayAndDisplay(row.distances)}</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td className="">{formatLargeOrSmall(avg(row.distances))}</td>
|
<td className="">{formatLargeOrSmall(avg(row.distances))}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user