plotly / plotly.py

The interactive graphing library for Python :sparkles: This project now includes Plotly Express!
https://plotly.com/python/
MIT License
16.03k stars 2.54k forks source link

add `truncate_mode` for Dendrogram #3598

Open lpinilla opened 2 years ago

lpinilla commented 2 years ago

Hi!

How are you?

I would like to propose a change for the _dendrogram.py file to be able to use truncate_mode parameter from scipy.

From their documentation, the trucate_mode is an optional parameter which can be used to condense the figure, making it more easy to read when you have a large dataset.

This should be as easy as adding the parameter to the create_dendrogram(), which will in turn pass it to scipy's sch.dendrogram()

Thank you for your time.

alimanfoo commented 1 year ago

I would also find it very useful for the parameters count_sort and distance_sort to be exposed in the plotly create_dendrogram() function. Again it should be as simple as passing these parameters through to scipy's dendrogram() function.

Happy to work up a PR if there is interest.

cc @sanjaynagi

lpinilla commented 1 year ago

PR has been started but failed due to automatic checks.

Here is the code I've made that allows the use of the dendrogram. I've been using it personally and works and here is the PR