-
Notifications
You must be signed in to change notification settings - Fork 102
Closed
Labels
Description
Prework
- Read and agree to the code of conduct and contributing guidelines.
- If there is already a relevant issue, whether open or closed, comment on the existing thread instead of posting a new issue.
Description
great_tables.loc.spanner_labels
does not work for levels above the lowest level
Reproducible example
from great_tables import GT, exibble, loc, style
gt = (
GT(exibble.loc[[0, 1], ["char", "fctr", "row"]])
.tab_spanner("spanner1_level0", ["fctr"], level=0)
.tab_spanner("spanner2_level0", ["char"], level=0)
.tab_spanner("spanner_level1", ["char", "fctr"], level=1)
)
color1 = "#a6cee3"
color2 = "#b15928"
(
gt.tab_style(style.fill(color1), loc.spanner_labels(ids=["spanner1_level0"]))
.tab_style(style.fill(color2), loc.spanner_labels(ids=["spanner2_level0"]))
.tab_style(style.fill(color2), loc.spanner_labels(ids=["spanner_level1"]))
)
- Post a minimal reproducible example (MRE) so the maintainer can troubleshoot the problems you identify. A reproducible example is:
- Runnable: post enough code and data so any onlooker can create the error on their own computer.
- Minimal: reduce runtime wherever possible and remove complicated details that are irrelevant to the issue at hand.
- Readable: format your code according to the Style Guide for Python Code.
Expected result
spanner_level1 should be filled with same color as spanner2_level0, but is not filled at all.
Development environment
- Operating System: Linux
- great_tables Version: 0.17.0