Questions tagged [htmltools]
htmltools is an R package that contains tools for generating HTML output directly from R.
htmltools
82
questions
0
votes
0
answers
27
views
How to have a ReactShinyInput inside a ReactShinyWidget?
I have just started playing with the reactR package in the hope of having React elements usable with Shiny R.
I have got project with the scaffoldReactWidget function setup and working quite nicely so ...
0
votes
1
answer
31
views
appendContent can't be used in a Shiny render call
The funciton addSearchGoogle from leaflet.extras is throwing this error in a Shiny-app:
Warning in renderWidget(instance) : Ignoring appended content;
appendContent can't be used in a Shiny render ...
0
votes
1
answer
51
views
Saving svg generated in shiny
I am trying to save an .svg that I generate inside a shiny app using htmltools (MRE below). This requires adding the svg namespace to the svg tag with xmlns:xlink="http://www.w3.org/1999/xlink&...
0
votes
1
answer
69
views
How to write/share an html document created in R using crosstalk and leaflet
I've created a filterable map using crosstalk and leaflet in R, and I'd like to share this with coworkers as a standalone document:
library(leaflet)
library(htmltools)
library(htmlwidgets)
#example ...
0
votes
1
answer
51
views
Print single charts via loop with highcharter in rmarkdown
I would like to print single charts created in a for loop as tabbed content using the packages rmarkdown and highcharter.
So far i have only succeeded in displaying all the graphics in one tab.
The ...
1
vote
1
answer
88
views
Why my Html function in R is not working:?
This is my code:
card_function <- function(title,paragraph,tags){
div(
class = "card",
div(class = "header"),
div(
class = "info",
p(class = &...
0
votes
0
answers
879
views
Updated htmltools doesn't install anyway
In Rmarkdown my problem is
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'htmltools' 0.5.6 is already loaded, but >= 0.5.7 is required
Calls: ... ...
1
vote
1
answer
54
views
Grandchildren elements are not rendered, using R htmltools::tagList to generate HTML for paged pdf
I am trying to create a paged pdf report in R, using pagedown together with htmltools::tagList. Each page in the report is supposed to bring together field survey results, mainly images ande tables, ...
1
vote
2
answers
89
views
Insert image (file or R object) into existing html file from R script
I include two ggplotly() graphics in a html file, eg.
library(ggplot2)
library(plotly)
library(htmltools)
g1 <- ggplot(data=data.frame(x=1:10, y=1:10)) +
geom_point(aes(x=x, y=y))
g2 <- ...
0
votes
1
answer
179
views
R Shiny Add Icon To tag$button
I'm trying to render a table in R Shiny that has a name, file, or url with a download button column that opens a new tab based on the data in the row. I'm unable to have the htmltools tag show an icon ...
1
vote
0
answers
175
views
How can I correctly resize all plotly plots encapsulated in a javascript tab?
I am new to handling html objects from R and I am having an issue while trying to create html tabs from named lists (the target document is html pages obtained from RMarkdown). Long story short, while ...
0
votes
1
answer
78
views
Shiny reactable list object in tags$button on click
So I have a situation where I would like to use an object in a tag$button(). This is to work around the fact that the columns may change.
It works on the first click and then stops working and the ...
0
votes
1
answer
128
views
How to load a local HTML file in R with htmltools?
I'm having a hard time loading a local HTML file. I tried with xml2 and it gives an empty file.
With htmltools and its function includeHTML I get an error message.
library(htmltools)
rawHTML<-...
0
votes
1
answer
126
views
ggVennDiagram in lagList in R MarkDown
I am trying to embed Venn Diagrams to my report made in R MarkDown. I have dinamic number of graphs so I generate them by for loop. I know that R MarkDown has "problem" with loops but I find ...
1
vote
2
answers
121
views
Subscript in R DT's footer with withTags()
I'm trying to add a superscript to a DataTables footer in a Shiny app (similar as here to the rownames/body).
library(shiny)
library(DT)
ui <- fluidPage(dataTableOutput("table"))
server ...
0
votes
1
answer
331
views
How to evaluate a list of cards in bslib::layout_column_wrap?
I am trying to display a list of cards in a 2d grid using the function bslib::layout_column_wrap(). However, I get a 1d grid with the cards positioned in one column instead of multiple columns. See a ...
3
votes
1
answer
417
views
How to display a SVG image in shiny
I would like to display in my web application an SVG image that I have hosted in the images folder. First I tried to display it with a tag but it didn't work:
ui <- fluidPage(
tags$img(src = &...
0
votes
1
answer
234
views
Can't seem to install the "devtools" package
I need to install Devtools so i can download the 0.5.4 htmltools package from github, almost every package i try to install gives an error stating that the htmltools version i have is 0.5.2 but the ...
0
votes
1
answer
221
views
R - markdown how to print list of dataframes to "Tabbed sections"
According bookdown documentation in 3.3, there is functionality to hide chunks in to the tabs. https://bookdown.org/yihui/rmarkdown/html-document.html
I occasionally use it, but I can't figure out how ...
0
votes
0
answers
159
views
How to link to CSS with htmltools?
I understand htmltools can be used to link to a JavaScript file:
htmltools::tags$script(src = "https://unpkg.com/mapbox-gl-leaflet/leaflet-mapbox-gl.js")
But how would I link to a CSS file, ...
0
votes
1
answer
365
views
How do I attach a CSS dependency to my Shiny app with htmlDependency() and tagList() from htmltools
I'm trying to attach a custom css stylesheet to style my shiny app. However I haven't had much success. I know that there is many ways to do it, but according to chapter 4 of Outstanding UI with Shiny ...
1
vote
1
answer
576
views
How to add an icon in front of specific column name of reactable
R Gurus,
I am struggling with a unique problem with adding an icon in front of certain column names in a reactable.
library(htmltools)
library(dplyr)
library(tippy)
data <- as_tibble(mtcars[1:6, ],...
0
votes
0
answers
434
views
reduce file size of exported leaflet html by linking several layers to the same data (json) instead of keeping the information separately
Generating leaflet html's easily results in a 50-75 MB file (depending on the number of layers). However, they can be zipped to reduce the file size by factors. So i guess there is lots of repetitive ...
0
votes
1
answer
294
views
How to generate simple html table using Shiny and R without using renderTable function?
I'm really new to R/Shiny, I'm working on a project and I'm having a problem.
Indeed, according to what I learned on the documentation, the renderTable function makes it possible to generate a ...
1
vote
1
answer
301
views
Shiny Leaflet Slow with HTML Labels
I'm building a shiny app with a leaflet map that updates based on user selection. When I got to working on the labels for shiny, I noticed my performance dropped upon hitting my action button to ...
0
votes
1
answer
398
views
Change column header color
I have a Shiny app that displays a DT table. I would like to be able to change the color of the column headers (not the column header text color) from black to something else say #34a8eb. I tried the ...
1
vote
0
answers
87
views
Add dependencies of shinydashboardplus in shiny
Below is the code for shiny app that I am using.
shiny::shinyApp(fluidPage(
# Give the page a title
titlePanel("Telephones by region"),
# Generate a row with a sidebar
...
2
votes
1
answer
299
views
How to use htmltools::attachDependencies?
Here is an example of how I "manually" add a HTML dependency to a datatable. This works fine. When I try with attachDependencies, the dependency is not attached.
library(DT)
library(...
3
votes
1
answer
504
views
How to to insert R (interactive or not) graphics in the tooltips of a ggiraph?
I'd like ultimately to insert R (interactive or not) graphics in the tooltips of a ggiraph.
Using an iframe as I successfully did before with leaflet, it would look like this:
library(ggplot2)
library(...
1
vote
1
answer
405
views
Print HTML formatted text in Jupyter with R from the list of citations of loaded packages
I have a R variable containing some html content inside, for exemple :
myvar = "<h3>Section Title</h3>"
I would like to print it not as <h3>Section Title</h3> but as ...