Repository navigation
Add treemaps - #854
Add treemaps#854cvanelteren wants to merge 8 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
I'm afraid I won't have any extra time over the next three days. If you're in a hurry, feel free to merge. If anything comes up later, we can open an issue. |
|
@gepcel there is no rush; I can leave this open. |
| def treemap( | ||
| self, | ||
| sizes: "TreemapInput", | ||
| labels: Sequence[Any] | str | None = None, |
There was a problem hiding this comment.
Is there an example that labels is a str?
There was a problem hiding this comment.
it was intended to be the column, or entry selected from data like this
data = {"amount": [2, 3, 4], "name": ["A", "B", "C"]}
ax.treemap("amount", labels="name", data=data
There was a problem hiding this comment.
but I agree that it may be a bit confusing. It is currently also overloaded and used differently across plot and raincloud.
There was a problem hiding this comment.
Need to think about this, we may need to align the other in raincloud too such that it is more consistent, what do you think?
There was a problem hiding this comment.
I'm fine with what it is now, better if there's a explanation, or examp;le. And yes, it'll be better if data, styles are handled in a consistent way.
gepcel
left a comment
There was a problem hiding this comment.
I left some comments. Mostly about colors. I tried some codes snippets for example:
# %%
fig,ax=pplt.subplot()
ax.treemap({"a":2,"b":3}, colors=['r', 'g'])
# %%
fig,ax=pplt.subplot()
ax.treemap({"GroupA":{"a":2,"b":3},"GroupB":{"c":4,"d":5}}, colors = ["#3c8d87", "#5286b0", "#69a4b7", "#af8a55"])
# %%
fig,ax=pplt.subplot()
ax.treemap({"GroupA":{"a":2,"b":3},"GroupB":{"c":4,"d":5}}, colors = ["#3c8d87", "#5286b0"])
Closes #458 by adding
ax.treemap()for flat and nested dictionaries, pandas Series, and DataFrame columns viadata=df. No additional dependencies are required.Tile areas represent values. Nested dictionaries create labeled groups with related colors. Explicit colors, colormaps, colorbars, value labels, and artist styling are supported.