Here, take a look at my stuff!
- ๐ I'm working on Opifex
- ๐น I'm on YouTube
- ๐ฅ๏ธ I have a mildly interesting website
- โจ I have a dull shiny server
- ๐ I'm on Github Sponsor
- ๐ I wrote JavaScript for R
Social
Tech
Awesome notifications for shiny
License: Other
Here, take a look at my stuff!
Social
Tech
Hi John,
I am loving the package and find it really useful!
Is there any plan to submit the package to CRAN? I find installing packages from CRAN is a lot easier than from GitHub in cases of automated builds.
Is there anything that I could help you with?
Thanks
First and foremost, thank you very much for this awesome addition to the Coene-verse.
I found that there is something odd that happens when embedding an HTML document that contains equations inside a modal. Even though {awn}
does not seem to support Mathjax at this point, I managed to display my equations inside a modal using the fairly recent katex package. However, there's a JavaScript comment, which appears at the bottom of the modal. The JS comment does NOT appear when the HTML file is rendered outside the modal. I suspect that the odd thing that happens may be due to {awn}
and {katex}
having some sort of clash. Here is a picture that shows the issue.
And now, the mandatory minimal reproducible example, which contains 2 files: document.Rmd
(which is knit to an HTML document) and app.R
document.Rmd
---
title: "Help file"
output:
html_document:
number_sections: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(katex)
```
## Linear regression
The matrix formula of the OLS estimator is:
```{r}
tex1 <- "\\frac{1}{\\Bigl(\\sqrt{\\phi \\sqrt{5}}-\\phi\\Bigr) e^{\\frac{2}{5} \\pi}} \\equiv 1+\\frac{e^{-2\\pi}} {1+\\frac{e^{-4\\pi}} {1+\\frac{e^{-6\\pi}} {1+\\frac{e^{-8\\pi}} {1+\\cdots} } } }"
katex_html(tex1, include_css = TRUE, output = "html")
```
$$
y_t = \alpha + \beta x_t + \varepsilon_t
$$
app.R
library(awn)
library(shiny)
ui <- fluidPage(
useAwn(),
actionButton("show", "Show"),
actionButton("show2", "Show")
)
server <- function(input, output, session) {
observeEvent(input$show, {
modal(
h1(shiny::HTML("Hello <b>{awn}</b>!"))
)
})
observeEvent(input$show2, {
modal(
shiny::includeHTML("www/document.html")
)
})
}
shinyApp(ui, server)
First off, thank you for this great package which has allowed me to easily create popup modals in my Shiny app!
My question is about how to make the popup modal scrollable when there is a lot of content in the popup? I've used the code from your example to try and illustrate this:
library(awn)
library(shiny)
ui <- fluidPage(
useAwn(),
actionButton("show", "Show")
)
server <- function(input, output, session) {
observeEvent(input$show, {
modal(
div(
h1("Hello {awn}!"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
h1("More headings"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
h1("More headings"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through"),
p("Some text that I would like to scroll through")
)
)
})
}
shinyApp(ui, server)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.