Skip to content

Allow Custom Indexes to define HTML repr for managed coords #11018

@ianhi

Description

@ianhi

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:

Image

which is lower signal to noise than the equivalent pandas repr:

Image

or in the case of layered intervals annotating a dimension (https://ianhuntisaak.com/xarray-linked-indexes/) the coords can really get out of hand

Image

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions