Skip to content

Commit

Permalink
Merge pull request #1510 from jplag/report-viewar/max-cluster-members
Browse files Browse the repository at this point in the history
Dont show cluster  graphs on too many members
  • Loading branch information
sebinside authored Jan 29, 2024
2 parents ba44b83 + 17c966d commit 757820d
Showing 1 changed file with 33 additions and 20 deletions.
53 changes: 33 additions & 20 deletions report-viewer/src/views/ClusterView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,39 @@
<Container
class="flex max-h-0 min-h-full flex-1 flex-col overflow-hidden print:max-h-none print:min-h-0 print:flex-none"
>
<OptionsSelectorComponent
:labels="clusterVisualizationOptions"
@selectionChanged="
(index) => (selectedClusterVisualization = index == 0 ? 'Graph' : 'Radar')
"
title="Cluster Visualization:"
class="mb-3"
v-if="canShowRadarChart"
/>
<ClusterRadarChart
v-if="selectedClusterVisualization == 'Radar'"
:cluster="clusterListElement"
class="flex-grow"
/>
<ClusterGraph
v-if="selectedClusterVisualization == 'Graph'"
:cluster="clusterListElement"
class="flex-grow print:max-h-full print:max-w-full print:flex-grow-0"
@line-hovered="(value) => (highlightedElement = value)"
/>
<div
class="flex max-h-full flex-col overflow-hidden print:flex-none"
v-if="cluster.members.length < 35"
>
<OptionsSelectorComponent
:labels="clusterVisualizationOptions"
@selectionChanged="
(index) => (selectedClusterVisualization = index == 0 ? 'Graph' : 'Radar')
"
title="Cluster Visualization:"
class="mb-3"
v-if="canShowRadarChart"
/>
<ClusterRadarChart
v-if="selectedClusterVisualization == 'Radar'"
:cluster="clusterListElement"
class="flex-grow"
/>
<ClusterGraph
v-if="selectedClusterVisualization == 'Graph'"
:cluster="clusterListElement"
class="flex-grow print:max-h-full print:max-w-full print:flex-grow-0"
@line-hovered="(value) => (highlightedElement = value)"
/>
</div>
<div v-else class="mx-auto space-y-5">
<p class="text-center font-bold text-error">
The cluster has too many members to be displayed as a graph or radar chart.
</p>
<p class="text-center font-bold text-gray-500 dark:text-gray-400">
Consider whether this is an actual cluster or a false positive.
</p>
</div>
</Container>
<Container class="flex max-h-0 min-h-full w-1/3 flex-col space-y-2 print:hidden">
<ComparisonsTable
Expand Down

0 comments on commit 757820d

Please sign in to comment.