Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opt_interactive() makes tab_footnote() footnote marks disappear #1905

Open
xx02al opened this issue Oct 14, 2024 · 2 comments
Open

opt_interactive() makes tab_footnote() footnote marks disappear #1905

xx02al opened this issue Oct 14, 2024 · 2 comments
Assignees

Comments

@xx02al
Copy link

xx02al commented Oct 14, 2024

when using opt_interactive(), tab_footnote() footnote marks disappear

gt_base <- iris |>
  gt::gt() |>
  gt::tab_footnote(
    footnote = "a footnote",
    locations = gt::cells_body(
      columns = Sepal.Length, 
      rows = Sepal.Length > 5
    ),
    placement = "right"
  )

# works
gt_base

# footnote marks disappear
gt_base |> 
  gt::opt_interactive()
@olivroy
Copy link
Collaborator

olivroy commented Oct 15, 2024

This is because we don't fully build the table for performance.

We'll see how we address this, but as a workaround, you can use the following.

gt_base <- iris |>
    gt::gt() |>
    gt::tab_footnote(
        footnote = "a footnote",
        locations = gt::cells_body(
            columns = Sepal.Length, 
            rows = Sepal.Length > 5
        ),
        placement = "right"
    )

# works
gt_base

# footnote appears
gt_base |> 
    gt::opt_interactive() |> fmt_number(Sepal.Length)

image

@xx02al
Copy link
Author

xx02al commented Oct 15, 2024

this workaround works as long as columns is numeric, i.e., this workaround has very limited applicability. taking the above example, using e.g., columns = c(Sepal.Length, Species) illustrates it would be valuable to have a proper solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants