Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ quartodoc:
- fa_icon_repeat
- gt_fa_rank_change
- gt_fa_rating
- gt_fmt_img_circle
- img_header

- title: Utilities
Expand Down
5 changes: 5 additions & 0 deletions docs/examples/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ addEventListener('resize', setTableWidths);
[gt_fa_rating](./with-code.html#gt_fa_rating){.embed-hover-overlay}
:::

:::{.masonry-item style="--width: 304;"}
{{< embed with-code.qmd#gt_fmt_img_circle >}}
[gt_fmt_img_circle](./with-code.html#gt_fmt_img_circle){.embed-hover-overlay}
:::

:::{.masonry-item style="--width: 355;"}
{{< embed with-code.qmd#img_header >}}
[img_header](./with-code.html#img_header){.embed-hover-overlay}
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/with-code.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,29 @@ gt.pipe(gte.gt_fa_rating, columns="rating", name="star")
```
{{< include ./_show-last.qmd >}}

### [gt_fmt_img_circle](https://posit-dev.github.io/gt-extras/reference/gt_fmt_img_circle.html){title="Click for reference"}
```{python}
# | label: gt_fmt_img_circle
import polars as pl
from great_tables import GT
import gt_extras as gte

rich_avatar = "https://avatars.githubusercontent.com/u/5612024?v=4"
michael_avatar = "https://avatars.githubusercontent.com/u/2574498?v=4"
jules_avatar = "https://avatars.githubusercontent.com/u/54960783?v=4"


df = pl.DataFrame({"@machow": [michael_avatar], "@rich-iannone": [rich_avatar], "@juleswg23": [jules_avatar]})

(
GT(df)
.cols_align("center")
.opt_stylize(color="green", style=6)
.pipe(gte.gt_fmt_img_circle, height=80)
)
```
{{< include ./_show-last.qmd >}}

### [img_header](https://posit-dev.github.io/gt-extras/reference/img_header.html){title="Click for reference"}
```{python}
# | label: img_header
Expand Down
3 changes: 2 additions & 1 deletion gt_extras/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .formatting import fmt_pct_extra, gt_duplicate_column, gt_two_column_layout
from .html import gt_merge_stack, with_hyperlink, with_tooltip
from .icons import fa_icon_repeat, gt_fa_rank_change, gt_fa_rating
from .images import add_text_img, img_header
from .images import add_text_img, gt_fmt_img_circle, img_header
from .plotting import (
gt_plt_bar,
gt_plt_bar_pct,
Expand Down Expand Up @@ -68,6 +68,7 @@
"gt_two_column_layout",
"add_text_img",
"img_header",
"gt_fmt_img_circle",
"gt_add_divider",
"gt_plt_summary",
]
Loading
Loading