When setting groupby=..., the values of the dimensions displayed in the select widgets are not sorted by default. The workarounds are:
- pre-process the data to sort it
- set
dynamic=False (default is True): HoloViews will internally instantiate a HoloMap (DynamicMap when dynamic=False) which sorts the values by default (MultiDimensionalMapping.sort is True by default).
When it comes to displaying large datasets, 1. is annoying and 2. is usually not available as setting dynamic=False on a rasterized/datashaded plot is mostly pointless.
Should hvPlot's default behavior be to sort the dimension values (requires holoviz/holoviews#6471)? If so, should we let users disable this? (keywords are easy to add but also come with some drawbacks).
import hvplot.pandas
import pandas as pd
N = 12
df = pd.DataFrame({
'cat1': ['A', 'A', 'A', 'A', 'C', 'C', 'C', 'C', 'B', 'B', 'B', 'B'],
'cat2': ['y', 'y', 'x', 'x', 'y', 'y', 'x', 'x','y', 'y', 'x', 'x'],
'x' : range(N),
'y' : range(N),
})
df.hvplot.scatter('x', 'y', groupby=['cat1', 'cat2'])

When setting
groupby=..., the values of the dimensions displayed in the select widgets are not sorted by default. The workarounds are:dynamic=False(default isTrue): HoloViews will internally instantiate a HoloMap (DynamicMap whendynamic=False) which sorts the values by default (MultiDimensionalMapping.sortisTrueby default).When it comes to displaying large datasets, 1. is annoying and 2. is usually not available as setting
dynamic=Falseon a rasterized/datashaded plot is mostly pointless.Should hvPlot's default behavior be to sort the dimension values (requires holoviz/holoviews#6471)? If so, should we let users disable this? (keywords are easy to add but also come with some drawbacks).