Skip to content

Commit

Permalink
implement option 3: light box components in front of the coord names
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis committed Oct 26, 2022
1 parent 9b90f8b commit 2cec070
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion xarray/core/formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,18 @@ def summarize_index(
if max_width is None:
max_width = OPTIONS["display_width"]

def prefix(index, length):
if index == 0 and length == 1:
return " "
elif index == 0:
return "┌"
elif index >= length - 1:
return "└"
else:
return "│"

preformatted = [
pretty_print(f" {'-' if index == 0 else ' '} {name} ", col_width)
pretty_print(f" {prefix(index, len(names))} {name} ", col_width)
for index, name in enumerate(names)
]

Expand Down

0 comments on commit 2cec070

Please sign in to comment.