Skip to content

Commit f357132

Browse files
authored
Merge pull request #136 from posit-dev/feat-gt-plt-summary
feat: `gt_plt_summary()`
2 parents 9e30a51 + 1c152cb commit f357132

File tree

7 files changed

+1445
-0
lines changed

7 files changed

+1445
-0
lines changed

docs/_quarto.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ quartodoc:
5353
- gt_plt_conf_int
5454
- gt_plt_dot
5555
- gt_plt_dumbbell
56+
- gt_plt_summary
5657
- gt_plt_winloss
5758

5859
- title: Colors

docs/examples/index.qmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ addEventListener('resize', setTableWidths);
158158
[gt_plt_dumbbell](./with-code.html#gt_plt_dumbbell){.embed-hover-overlay}
159159
:::
160160

161+
:::{.masonry-item style="--width: 521;"}
162+
{{< embed with-code.qmd#gt_plt_summary >}}
163+
[gt_plt_summary](./with-code.html#gt_plt_summary){.embed-hover-overlay}
164+
:::
165+
161166
:::{.masonry-item style="--width: 167;"}
162167
{{< embed with-code.qmd#gt_plt_winloss >}}
163168
[gt_plt_winloss](./with-code.html#gt_plt_winloss){.embed-hover-overlay}

docs/examples/with-code.qmd

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Examples With Code
33
jupyter: python3
44
echo: false
5+
collapse-level: 3
56
---
67
<style>
78

@@ -228,6 +229,37 @@ gt.pipe(
228229
```
229230
{{< include ./_show-last.qmd >}}
230231

232+
### [gt_plt_summary](https://posit-dev.github.io/gt-extras/reference/gt_plt_summary.html){title="Click for reference"}
233+
```{python}
234+
# | label: gt_plt_summary
235+
import polars as pl
236+
from great_tables import GT
237+
import gt_extras as gte
238+
from datetime import datetime
239+
240+
df = pl.DataFrame({
241+
"Date": [
242+
datetime(2024, 1, 1),
243+
datetime(2024, 1, 2),
244+
datetime(2024, 1, 7),
245+
datetime(2024, 1, 8),
246+
datetime(2024, 1, 13),
247+
datetime(2024, 1, 16),
248+
datetime(2024, 1, 20),
249+
datetime(2024, 1, 22),
250+
datetime(2024, 2, 1),
251+
] * 5,
252+
"Value": [10, 15, 20, None, 25, 18, 22, 30, 40] * 5,
253+
"Category": ["A", "B", "C", "A", "B", "C", "D", None, None] * 5,
254+
"Boolean": [True, False, True] * 15,
255+
"Status": ["Active", "Inactive", None] * 15,
256+
})
257+
258+
gte.gt_plt_summary(df)
259+
```
260+
{{< include ./_show-last.qmd >}}
261+
262+
231263
### [gt_plt_winloss](https://posit-dev.github.io/gt-extras/reference/gt_plt_winloss.html){title="Click for reference"}
232264
```{python}
233265
# | label: gt_plt_winloss

gt_extras/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
gt_plt_winloss,
2222
)
2323
from .styling import gt_add_divider
24+
from .summary import gt_plt_summary
2425
from .themes import (
2526
gt_theme_538,
2627
gt_theme_dark,
@@ -66,4 +67,5 @@
6667
"add_text_img",
6768
"img_header",
6869
"gt_add_divider",
70+
"gt_plt_summary",
6971
]

0 commit comments

Comments
 (0)