unipept / unipept-visualizations

Visualisations used by Unipept, packaged for easy reuse in other projects.
MIT License
18 stars 6 forks source link

Fix `ColorProvider` option is only called for the root level #150

Closed pverscha closed 8 months ago

pverscha commented 8 months ago

The TreeView visualization supports a custom ColorProvider function that allows third-party users to configure the color's that are assigned to each node. Because of a bug, this function was only called for each node at the first two levels. This PR proposes a new fix, that is also backwards compatible, in which users need to specify until which depth in the tree this function needs to be computed.

I introduced a new option ColorProviderLevels that is now also taken into account during the visualization of the provided data and that allows to create treeviews like these:

image