Allow Custom Indexes to define HTML repr for managed coords
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
Is your feature request related to a problem?
When a complicated index is attached to a dataset it can potentially fill up the coords field with lots of extra low value information. For example for the builtin multiindex the xarray version looks like this:
which is lower signal to noise than the equivalent pandas repr:
or in the case of layered intervals annotating a dimension (https://ianhuntisaak.com/xarray-linked-indexes/) the coords can really get out of hand
Describe the solution you'd like
Allow Indexes to override the default html repr for any coords that they manage. The dataset repr can compose itself out of the reprs for coords from coords, so the would be in charge of returing the html +/- css for those coords
I think the built in multindex could be a nice example use case of this.
Describe alternatives you've considered
No response
Additional context
No response
cc @benbovy @keewis @dcherian
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how Dataset reprs compose HTML for managed coordinates, then compare the existing xarray and pandas MultiIndex representations. The issue's target is an Index-level HTML repr that the Dataset can compose for its managed coords; done means custom indexes can reduce excessive coordinate output while preserving useful information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas, python
- Domain
- data, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100