pydata / pydata/xarray

Collapsible attributes in _repr_html_

Open
#4,398 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic-html-repr
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? Please describe.

I have a situation where I write a long list to the .attrs, which results in too long an output:
image ....

Describe the solution you'd like

Can the attribute output be changed to be displayed in the same way as the other variables? (collapsed to one line)

Describe alternatives you've considered

Perhaps I am misusing the attributes and this kind of data should instead be a data variable? (though I would not like that since this information is intended as metadata)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the repr_html entry point and compare how attributes are rendered with the existing variable display. Reproduce the long .attrs example, then verify that attribute output is collapsed to one line while remaining expandable and that the HTML representation still renders correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.