diff --git a/Website/components/insightsview/overview/InsightsOverviewView.tsx b/Website/components/insightsview/overview/InsightsOverviewView.tsx index 2a33af7..01d4dc9 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]); + + 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]) => ({ + 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,104 @@ const InsightsOverviewView = ({ }: InsightsOverviewViewProps) => { /> + + + + + + Entity Features Distribution + + + + + + + + + + + Attribute Types Distribution + + + + + ) 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}