Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal count by classification pie chart #2816

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

PhilippMa
Copy link
Contributor

Summary of changes

Added a pie chart showing signal count by classification in the project statistics popup.

Context and reason for change

Users should be able to get a quick overview of the classifications present in their signals.

How can the changes be tested

Open a .opossum file containing classifications and check the project statistics popup

closes #2802

@PhilippMa PhilippMa linked an issue Feb 26, 2025 that may be closed by this pull request
@abraemer abraemer self-assigned this Feb 27, 2025
Comment on lines 75 to 77
[PieChartCriticalityNames.HighCriticality]: OpossumColors.orange,
[PieChartCriticalityNames.MediumCriticality]: OpossumColors.mediumOrange,
[PieChartCriticalityNames.NoCriticality]: OpossumColors.darkBlue,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether it would make sense to have this mapping from Criticality to color once in like shared-styles.ts and then reuse it both for the icons and for the pie chart. Conceptually these are the same thing.
Then you could also get rid of the enum PieChartCriticalityNames and convert the strings to text in test.ts

@@ -24,16 +24,6 @@ export enum ButtonText {
Delete = 'Delete',
}

export enum ProjectStatisticsPopupTitle {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that you got rid of this enum :)
Maybe we can make the PieChartCriticalityNames also obsolete (see other comment)

@@ -141,6 +158,17 @@ function getLicenseDataFromVariants(

const variantCriticality = attributions[attributionId].criticality;

const variantClassification = attributions[attributionId].classification;
Copy link
Contributor

@abraemer abraemer Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency check to see whether I understand these Pie charts:
Generally we aggregate all unresolved attributions and group them by some normalized license name ("stripped license name"). Then for each pie chart, we group them further by some value:

  • most frequent licenses: no further grouping, just direct counts of how often a "stripped license" appears
  • criticality: each "stripped license" gets assigned the highest criticality found on any of its corresponding attributions
  • classification: same as criticality, goes by max classification
  • incomplete attributions: works directly on attributions (not licenses)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's also my understanding here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pie chart for signals by classification
2 participants