Skip to content

Commit cbe8cde

Browse files
shoyerpre-commit-ci[bot]claude
authored
Improve HTML reprs (#10816)
* Less vertical whitespace in HTML reprs * ensure consistent line-height in google colab * Refactor DataTree HTML repr * Collapsable DataTree nodes * more formatting * Tweaks * Add tests and truncation for many child nodes * add missing DataTree.xindexes into repr * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add whats-new entry for DataTree HTML repr improvements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix ruff PERF401: use list.extend instead of append in loop 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Adjust style per review * Use browser default focus outline style 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9725441 commit cbe8cde

File tree

5 files changed

+443
-156
lines changed

5 files changed

+443
-156
lines changed

doc/whats-new.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ v2025.12.1 (unreleased)
1414
New Features
1515
~~~~~~~~~~~~
1616

17+
- Improved :py:class:`DataTree` HTML representation: groups are now collapsible
18+
with item counts shown in labels, large trees are automatically truncated
19+
using ``display_max_children`` and ``display_max_html_elements`` options,
20+
and the Indexes section is now displayed (matching the text repr) (:pull:`10816`).
21+
By `Stephan Hoyer <https://github.com/shoyer>`_.
1722
- :py:meth:`Dataset.set_xindex` and :py:meth:`DataArray.set_xindex`
1823
automatically replace any existing index being set instead of erroring
1924
or needing needing to call :py:meth:`drop_indexes` first (:pull:`11008`).

0 commit comments

Comments
 (0)