From ed96a677247ea9372d3c90f9d99a38077a7c1d63 Mon Sep 17 00:00:00 2001 From: Lucki2g Date: Mon, 13 Oct 2025 16:31:16 +0200 Subject: [PATCH 1/4] chore: removed textwrap from infocard --- Website/components/shared/elements/InfoCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Website/components/shared/elements/InfoCard.tsx b/Website/components/shared/elements/InfoCard.tsx index 8001dba..6e7c28c 100644 --- a/Website/components/shared/elements/InfoCard.tsx +++ b/Website/components/shared/elements/InfoCard.tsx @@ -46,7 +46,7 @@ export const InfoCard = ({ return ( - + {title} From 690ae861e7c2593639cd6e2237a556e08e2fdcd7 Mon Sep 17 00:00:00 2001 From: Lucki2g Date: Mon, 13 Oct 2025 16:44:34 +0200 Subject: [PATCH 2/4] feat: additional pie charts with feature and attribute distributions --- .../overview/InsightsOverviewView.tsx | 141 +++++++++++++++++- 1 file changed, 139 insertions(+), 2 deletions(-) diff --git a/Website/components/insightsview/overview/InsightsOverviewView.tsx b/Website/components/insightsview/overview/InsightsOverviewView.tsx index 2a33af7..2e98f13 100644 --- a/Website/components/insightsview/overview/InsightsOverviewView.tsx +++ b/Website/components/insightsview/overview/InsightsOverviewView.tsx @@ -4,6 +4,7 @@ import { ComponentIcon, InfoIcon, ProcessesIcon, SolutionIcon, WarningIcon } fro import { generateLiquidCheeseSVG } from "@/lib/svgart"; import { Box, Grid, Paper, Stack, Tooltip, Typography, useTheme } from "@mui/material"; import { ResponsiveBar } from "@nivo/bar"; +import { ResponsivePie } from "@nivo/pie"; import { useMemo } from "react"; interface InsightsOverviewViewProps { @@ -66,6 +67,42 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => { ]; }, [groups]); + const entityFeaturesData = useMemo(() => { + const allEntities = groups.flatMap(group => group.Entities); + + const auditEnabled = allEntities.filter(entity => entity.IsAuditEnabled).length; + const auditDisabled = allEntities.filter(entity => !entity.IsAuditEnabled).length; + const activities = allEntities.filter(entity => entity.IsActivity).length; + const notesEnabled = allEntities.filter(entity => entity.IsNotesEnabled).length; + const notesDisabled = allEntities.filter(entity => !entity.IsNotesEnabled).length; + + return [ + { id: 'Audit Enabled', label: 'Audit Enabled', value: auditEnabled }, + { id: 'Audit Disabled', label: 'Audit Disabled', value: auditDisabled }, + { id: 'Activities', label: 'Activities', value: activities }, + { id: 'Notes Enabled', label: 'Notes Enabled', value: notesEnabled }, + { id: 'Notes Disabled', label: 'Notes Disabled', value: notesDisabled }, + ].filter(item => item.value > 0); // Only show categories with values + }, [groups, theme.palette]); + + const attributeTypeData = useMemo(() => { + const allEntities = groups.flatMap(group => group.Entities); + const allAttributes = allEntities.flatMap(entity => entity.Attributes); + + // Count attribute types + const attributeTypeCounts = allAttributes.reduce((acc, attr) => { + const type = attr.AttributeType; + acc[type] = (acc[type] || 0) + 1; + return acc; + }, {} as Record); + + return Object.entries(attributeTypeCounts).map(([type, count], index) => ({ + id: type.replace('Attribute', ''), + label: type.replace('Attribute', ''), + value: count + })); + }, [groups, theme.palette]); + return ( @@ -180,7 +217,7 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => { layout="vertical" valueScale={{ type: 'linear' }} indexScale={{ type: 'band', round: true }} - colors={[theme.palette.primary.main, theme.palette.secondary.main]} + colors={{ scheme: "blues" }} borderRadius={4} borderWidth={1} borderColor={{ from: 'color', modifiers: [['darker', 0.2]] }} @@ -189,7 +226,7 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => { enableLabel={true} labelSkipWidth={12} labelSkipHeight={12} - labelTextColor={{ from: 'color', modifiers: [['brighter', 3]] }} + labelTextColor={{ from: 'color', modifiers: [['darker', 3]] }} legends={[ { dataFrom: 'keys', @@ -314,6 +351,106 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => { /> + + + + + + Entity Features Distribution + + + + + + + + + + + Attribute Types Distribution + + + + + ) From 25cfc2642d730852b8b862150d8ff1d074355b42 Mon Sep 17 00:00:00 2001 From: Lucki2g Date: Mon, 13 Oct 2025 16:49:13 +0200 Subject: [PATCH 3/4] fix: dont skip labels for small pie bits --- .../components/insightsview/overview/InsightsOverviewView.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Website/components/insightsview/overview/InsightsOverviewView.tsx b/Website/components/insightsview/overview/InsightsOverviewView.tsx index 2e98f13..886ca9a 100644 --- a/Website/components/insightsview/overview/InsightsOverviewView.tsx +++ b/Website/components/insightsview/overview/InsightsOverviewView.tsx @@ -96,7 +96,7 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => { return acc; }, {} as Record); - return Object.entries(attributeTypeCounts).map(([type, count], index) => ({ + return Object.entries(attributeTypeCounts).map(([type, count]) => ({ id: type.replace('Attribute', ''), label: type.replace('Attribute', ''), value: count @@ -374,7 +374,6 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => { ['darker', 0.2] ] }} - arcLinkLabelsSkipAngle={10} arcLinkLabelsTextColor={theme.palette.text.primary} arcLinkLabelsThickness={2} arcLinkLabelsColor={{ from: 'color' }} @@ -424,7 +423,6 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => { ['darker', 0.2] ] }} - arcLinkLabelsSkipAngle={10} arcLinkLabelsTextColor={theme.palette.text.primary} arcLinkLabelsThickness={2} arcLinkLabelsColor={{ from: 'color' }} From 9b1aff86ae185e59d1d20c67583cbaf008d778c2 Mon Sep 17 00:00:00 2001 From: Lucki2g Date: Mon, 13 Oct 2025 16:52:33 +0200 Subject: [PATCH 4/4] chore: removed unnes memo dependency --- .../components/insightsview/overview/InsightsOverviewView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Website/components/insightsview/overview/InsightsOverviewView.tsx b/Website/components/insightsview/overview/InsightsOverviewView.tsx index 886ca9a..01d4dc9 100644 --- a/Website/components/insightsview/overview/InsightsOverviewView.tsx +++ b/Website/components/insightsview/overview/InsightsOverviewView.tsx @@ -83,7 +83,7 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => { { id: 'Notes Enabled', label: 'Notes Enabled', value: notesEnabled }, { id: 'Notes Disabled', label: 'Notes Disabled', value: notesDisabled }, ].filter(item => item.value > 0); // Only show categories with values - }, [groups, theme.palette]); + }, [groups]); const attributeTypeData = useMemo(() => { const allEntities = groups.flatMap(group => group.Entities);