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

Colorize dendrogram #48

Merged
merged 53 commits into from
Nov 13, 2023
Merged

Colorize dendrogram #48

merged 53 commits into from
Nov 13, 2023

Conversation

stefanhahmann
Copy link
Collaborator

@stefanhahmann stefanhahmann commented Nov 2, 2023

Adds colorizing the dendrogram with the same colors that are used for the tag sets

Resolves #49

@stefanhahmann stefanhahmann self-assigned this Nov 3, 2023
@stefanhahmann stefanhahmann force-pushed the colorize_dendrogram branch 2 times, most recently from 3e53573 to 3c92578 Compare November 7, 2023 13:06
Copy link
Collaborator

@maarzt maarzt left a comment

Choose a reason for hiding this comment

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

Nice functionality. I tested the "cluster lineage tree" plugin and it works as expected.
The test coverage is impressive. Which gives me confidence that the code will run reliably.

The code quality is goof. But I see one mayor point for improvement. This PR adds new methods to the "Classification" class. The class became a bit unorganized. I think restructuring it would be valuable.

Regarding javadoc & comments: There are sometimes concepts or surprises in the code. That are nowhere described, for example:

  • The class ID in the Classification class, what does it refer to.
  • We no the the "WeightedLinkageStrategy" class is named wrongly. And therefor we decided extend the class. This should be described in the commet.
  • That a class is a copy of a class from another repository.
  • There are tests that only test a side effect "CustomizedClusterComponentTest"

Please add, one sentence of javadoc to each class in the repository. One sentence that describes the purpose of class.

There is a small problem the color of the 4th class is always black. This is due to the use of the glasby lookup table and the fact that the first 5 colors in there are "outliers colors". I would suggest to exclude the first five colors.

* Extends existing ClusterComponent with a Color specific to it
* The color is set before the paint method of super class ClusterComponent is called
…lasses

* classified objects are stored in an (ordered) list instead of a set
* a mapping between cluster objects and cluster ids is added
…from class id to colors and a separate mapping from Cluster to color
…n ordered list of classifications consisting of a set of classified objects and a Cluster object belonging to it
…f, leafmapping

* Use the new DendrogramView constructor in ClusterRootNodesController
…lebar

* Painting the cutoff line and adapting the scalebar is now completely done in the DendrogramPanel
* The private variable children of the parent class ClusterComponent is initialized in CustomizedClusterComponent constructor by calling super.getChildren()
* Make field CLUSTER_LINE_COLOR package protected so that there is an assumption that can be tested
…structor of CustomizedClusterComponent.

This is sufficient, since the constructor is the only public method that uses T.
…needs a cluster object and a classification object as parameters
This includes:

- omit the obscure "leaf name" variable -> the leave mapping is now performed already in the ClusterUtils methods
- omit any cluster ids
- renamed `algorithmResult` to `rootCluster`, since this is a more appropriate name
… for List to Set

* List is not required, since ordering is not relevant
Copy link

sonarcloud bot commented Nov 13, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

91.9% 91.9% Coverage
0.0% 0.0% Duplication

@stefanhahmann
Copy link
Collaborator Author

Nice functionality. I tested the "cluster lineage tree" plugin and it works as expected. The test coverage is impressive. Which gives me confidence that the code will run reliably.

The code quality is goof. But I see one mayor point for improvement. This PR adds new methods to the "Classification" class. The class became a bit unorganized. I think restructuring it would be valuable.

Regarding javadoc & comments: There are sometimes concepts or surprises in the code. That are nowhere described, for example:

* The class ID in the Classification class, what does it refer to.

* We no the the "WeightedLinkageStrategy" class is named wrongly. And therefor we decided extend the class. This should be described in the commet.

* That a class is a copy of a class from another repository.

* There are  tests that only test a side effect "CustomizedClusterComponentTest"

Please add, one sentence of javadoc to each class in the repository. One sentence that describes the purpose of class.

There is a small problem the color of the 4th class is always black. This is due to the use of the glasby lookup table and the fact that the first 5 colors in there are "outliers colors". I would suggest to exclude the first five colors.

Thanks for the review.

I did the following steps:

  • restructured the Classification class so that the IDs are no longer needed
  • Added a comment explaining that WeightedLinkageStrategy was overridden, because it is wrong
  • Added comments to the copied (or rather re-implemented classes)
  • Explained that CustomizedClusterComponentTest has only limited testing value
  • Added a javadoc to each new class
  • Skipped the first five colors of the Glasbey color pallette.

@stefanhahmann stefanhahmann merged commit fc4fa9f into master Nov 13, 2023
4 checks passed
@stefanhahmann stefanhahmann deleted the colorize_dendrogram branch November 13, 2023 15:17
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.

Reuse color of tagsets in dendrogram view
2 participants