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

Dynamic Title example doesn't work #11506

Open
makiz1999 opened this issue Nov 22, 2024 · 6 comments
Open

Dynamic Title example doesn't work #11506

makiz1999 opened this issue Nov 22, 2024 · 6 comments
Assignees
Labels
documentation Doc improvements & quarto-web needs-repro Issues that are blocked until reporter provides an adequate reproduction

Comments

@makiz1999
Copy link

What would you like to do?

Report an issue on quarto.org

Description

This example doesn't work with R

Image

Output:
Image

@makiz1999 makiz1999 added the documentation Doc improvements & quarto-web label Nov 22, 2024
@mcanouil
Copy link
Collaborator

@makiz1999 Thanks. Could you point to where this is? Screenshots are not helpful to search/find resources.

@makiz1999
Copy link
Author

@makiz1999 Thanks. Could you point to where this is? Screenshots are not helpful to search/find resources.

Yeah, here is the link: https://quarto.org/docs/dashboards/data-display.html#dynamic-titles

@cderv
Copy link
Collaborator

cderv commented Nov 22, 2024

It is from https://quarto.org/docs/dashboards/data-display.html#dynamic-titles

I'll look into this

@cderv cderv self-assigned this Nov 22, 2024
@cderv
Copy link
Collaborator

cderv commented Nov 22, 2024

@makiz1999 are you using this in format: dashboard ?

This will only work in this format, and it works for me it seems

---
title: Test
format: dashboard
keep-md: true
---

```{r}
library(leaflet)

lat <- 48
long <- 350

cat("title=", "World Map at", lat, long)

leaflet() |> addTiles() |> 
  setView(long, lat, zoom = 2)
```

The card correctly get the title
Image

This is specific feature of Dashboard format to set a title to a Card output

@cderv cderv added the needs-repro Issues that are blocked until reporter provides an adequate reproduction label Nov 22, 2024
@makiz1999
Copy link
Author

makiz1999 commented Nov 22, 2024

@makiz1999 are you using this in format: dashboard ?

This will only work in this format, and it works for me it seems


title: Test
format: dashboard
keep-md: true

library(leaflet)

lat <- 48
long <- 350

cat("title=", "World Map at", lat, long)

leaflet() |> addTiles() |> 
  setView(long, lat, zoom = 2)

The card correctly get the title Image

This is specific feature of Dashboard format to set a title to a Card output

Hi, thank you. I missed one element in my code.

Do you know by chance if it's possible to dynamically change the title using a reactive component? In other words, the title would reflect user input from the dropdown selector.

Screenshot below shows the idea

Image

@cderv
Copy link
Collaborator

cderv commented Nov 22, 2024

I don't think this is possible because the feature is used by quarto render and it is only rendered once.

any shiny reactive can't be used in there.

Maybe there is a way to use some raw HTML that shiny understand, but this is not easy.

So unfortunately with this syntax, I don't think this can be done. I need to think about how this could be done in a dashboard. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Doc improvements & quarto-web needs-repro Issues that are blocked until reporter provides an adequate reproduction
Projects
None yet
Development

No branches or pull requests

3 participants