Giter VIP home page Giter VIP logo

awn's Introduction

awn's People

Contributors

etiennebacher avatar johncoene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

awn's Issues

Planning on CRAN submission?

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

Issue with embedded HTML documents containing equations

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.

awn-katex-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)

How to make popup modal scrollable

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.