Skip to content

Commit

Permalink
extract calculation of max possible comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr0nox committed Nov 27, 2023
1 parent 1274539 commit d1854d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions report-viewer/src/views/ClusterView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
<Container class="flex max-h-0 min-h-full w-1/3 flex-col space-y-2">
<h2>Comparisons of Cluster Members:</h2>
<ComparisonsTable :topComparisons="comparisons" class="min-h-0 flex-1">
<template
#footer
v-if="comparisons.length < cluster.members.length ** 2 / 2 - cluster.members.length"
>
<template #footer v-if="comparisons.length < maxAmountOfComparisonsInCluster">
<p class="w-full pt-1 text-center font-bold">
Not all comparisons inside the cluster are shown. To see more, re-run JPlag with a
higher maximum number argument.
Expand Down Expand Up @@ -104,4 +101,9 @@ const clusterListElement: Ref<ClusterListElement> = computed(() => {
strength: props.cluster.strength
}
})
/** The amount of comparisons if every single one was included */
const maxAmountOfComparisonsInCluster = computed(() => {
return props.cluster.members.length ** 2 / 2 - props.cluster.members.length
})
</script>

0 comments on commit d1854d1

Please sign in to comment.