-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Allow to sort the values of the dimensions used in a groupby operation #6471
Comments
Ideally, this would need to be supported for both Supporting sorting specific dimensions only is probably out of scope, at least that's not what I'm requesting here :) |
I would not be opposed to have these just sorted by default. Though, this need to be updated in Panel, example of code: diff --git a/panel/pane/holoviews.py b/panel/pane/holoviews.py
index a10fae643..e3a10aaa5 100644
--- a/panel/pane/holoviews.py
+++ b/panel/pane/holoviews.py
@@ -635,7 +635,11 @@ class HoloViews(Pane):
vals = dim.values or values.get(dim, None)
if vals is not None:
vals = list(unique_iterator(vals))
+ with suppress(Exception):
+ vals = sorted(vals)
dim_values[dim.name] = vals
if widgets_type == 'scrubber':
if not vals: |
Hm that'd work but I'm not sure how HoloViews would then let users toggle the sorting behavior. When I looked at it, I thought about updating holoviews/holoviews/core/data/__init__.py Lines 993 to 994 in d586f3f
I didn't look much into the holoviews/holoviews/core/data/pandas.py Lines 258 to 268 in d586f3f
|
Noticed while modernizing NYC Buildings (holoviz-topics/examples#386), it would be nice to be able to declare whether to sort or not the values of the dimensions used in a
groupby
operation.Order is
ACB
, I'd like to sort toABC
.The text was updated successfully, but these errors were encountered: