Skip to content

Commit

Permalink
docs: use .tab_stub() in examples, mention GT() args in guide
Browse files Browse the repository at this point in the history
  • Loading branch information
machow committed Jun 5, 2024
1 parent 754ccd7 commit 0426c83
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/examples/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ islands_mini = (
)
(
GT(islands_mini, rowname_col="name")
GT(islands_mini)
.tab_header(
title="Large Landmasses of the World",
subtitle="The top ten largest are presented"
)
.tab_stub(rowname_col="name")
.tab_source_note(source_note="Source: The World Almanac and Book of Facts, 1975, page 406.")
.tab_source_note(
source_note=md("Reference: McNeil, D. R. (1977) *Interactive Data Analysis*. Wiley.")
Expand Down Expand Up @@ -108,9 +109,10 @@ wide_pops = (
)
(
GT(wide_pops, rowname_col="country_name", groupname_col="region")
GT(wide_pops)
.tab_header(title="Populations of Oceania's Countries in 2000, 2010, and 2020")
.tab_spanner(label="Total Population", columns=cs.all())
.tab_stub(rowname_col="country_name", groupname_col="region")
.fmt_integer()
)
```
Expand Down
10 changes: 10 additions & 0 deletions docs/get-started/basic-stub.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ island_groups = islands.head(10).assign(group = ["subregion"] * 2 + ["country"]
.tab_stubhead(label="landmass")
)
```

## GT convenience arguments

Rather than using the `GT.tab_stub()` method, the `GT(rowname_col=..., groupname_col=...)` arguments
provide a quick way to specify row names and groups.


```{python}
GT(island_groups, rowname_col="name", groupname_col="group")
```

0 comments on commit 0426c83

Please sign in to comment.