tkonopka / chsk

Library for dynamic data visualization and story-telling with React
https://tkonopka.github.io/chsk/
MIT License
3 stars 1 forks source link

[Feature request] Conditional styling of dendrogram clusters #6

Open kalaivaniraju opened 5 months ago

kalaivaniraju commented 5 months ago

Hello,

Thanks for the amazing work, especially on the dendrograms that can accept R-like output data.

Please can I request a feature or a hack to set the colours (strokes, leafnodes and/or labels) of the clusters differently in a dendrogram? Desired output:

Screenshot 2024-04-23 at 17 07 06

Is there a way to achieve this kind of conditional formatting/styling of strokes/leafnodes/labels in the current framework?

tkonopka commented 5 months ago

Hi @kalaivaniraju. Thanks for checking out chsk. The dendrogram in the image is quite complex so it would take some effort to replicate that. You may be able to achieve parts of that with DendrogramTree and DendrogramLeafLabels. For example, to get the colors on the clusters, you could draw one DendrogramTree to display the entire tree in a base color, and then overlay separate DendrogramTree components for each of the clusters in different colors. Splitting the complete tree into clusters would be a manual step at the moment, though. Hope this helps!