Comments (6)
The htmlDependency is the right approach, I would think. Can you show me what you tried?
from shiny.
I tried some variations of this:
map$dependencies <- c(map$dependencies,
leafletSearchDependencies(),
list(htmltools::htmlDependency(
"googlesearchapi", "0.0.1",
src = c(href = url),
script = "js?v=3",
all_files = FALSE
)))
from shiny.
actually, that seems to works and the error must be somewhere else..
The script tag with the URL + APIKEY gets appended add the end of the head-tag.
Thank you for your time!
from shiny.
I did some further testing and downloaded the Javascript into www/google.js
that you get with this URL:
https://maps.googleapis.com/maps/api/js?v=3&key=API_KEY
This worked and the HTML head looked like this:
When using htmlDependency
(I tried different orders)
map$dependencies <- c(
list(htmltools::htmlDependency(
"googlesearchapi", "0.0.1",
src = c(href = url),
script = "",
all_files = TRUE
)),
map$dependencies,
leafletSearchDependencies()
)
and the head-tag looks like this:
I am not sure how I can control the order of the scripts or why not all google JS files get downloaded..
This is maybe more a question for htmltools
or?
from shiny.
Can you try installing shiny 1.7.5.1? That will tell us if the async related changes to renderContent are causing this (I’m almost certain they are).
from shiny.
Still no success with shiny 1.7.5.1. (Also no luck with 1.7.4)
The html head looks identical to the one above (using htmlDependency
).
Somehow the scripts log.js
and geocoder.js
are not included.
My session info
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
setting value
version R version 4.3.1 (2023-06-16 ucrt)
os Windows 11 x64 (build 22631)
system x86_64, mingw32
ui RStudio
language (EN)
collate German_Austria.utf8
ctype German_Austria.utf8
tz Europe/Vienna
date 2024-03-11
rstudio 2023.06.0+421 Mountain Hydrangea (desktop)
pandoc 3.1.1 @ C:\\PROGRA~1\\RStudio\\RESOUR~1\\app\\bin\\quarto\\bin\\tools\\pandoc.exe
─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
package * version date (UTC) lib source
bslib 0.5.1 2023-08-11 [1] CRAN (R 4.3.1)
cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.1)
cli 3.6.1 2023-03-23 [1] CRAN (R 4.3.1)
crosstalk 1.2.0 2021-11-04 [1] CRAN (R 4.3.1)
digest 0.6.33 2023-07-07 [1] CRAN (R 4.3.1)
ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.3.1)
fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.1)
htmltools 0.5.6 2023-08-10 [1] CRAN (R 4.3.1)
htmlwidgets 1.6.2 2023-03-17 [1] CRAN (R 4.3.1)
httpuv 1.6.11 2023-05-11 [1] CRAN (R 4.3.1)
jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.3.1)
jsonlite 1.8.7 2023-06-29 [1] CRAN (R 4.3.1)
later 1.3.1 2023-05-02 [1] CRAN (R 4.3.1)
leaflet * 2.2.0 2023-08-31 [1] CRAN (R 4.3.1)
leaflet.extras * 1.0.0 2024-03-11 [1] local
leaflet.providers 1.13.0 2023-08-10 [1] CRAN (R 4.3.1)
lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.3.1)
magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.1)
memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.1)
mime 0.12 2021-09-28 [1] CRAN (R 4.3.0)
promises 1.2.1 2023-08-10 [1] CRAN (R 4.3.1)
R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.1)
Rcpp 1.0.11 2023-07-06 [1] CRAN (R 4.3.1)
rlang 1.1.1 2023-04-28 [1] CRAN (R 4.3.1)
rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.1)
sass 0.4.7 2023-07-15 [1] CRAN (R 4.3.1)
sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.1)
shiny * 1.7.5.1 2023-10-14 [1] CRAN (R 4.3.1)
withr 2.5.1 2023-09-26 [1] CRAN (R 4.3.1)
xtable 1.8-4 2019-04-21 [1] CRAN (R 4.3.1)
from shiny.
Related Issues (20)
- shiny.autoreload does not work when runApp is given shinyApp result or a list HOT 1
- selectInput not working anymore within renderDataTable in 1.8.0 HOT 2
- Reactive selectizeInput box fail to update correctly in Shiny 1.8.0, first value of previous allowed choices are kept HOT 2
- Update jQuery version to 3.7.1
- 'make' not found HOT 3
- Use req() in checkFunction ReactivePoll HOT 5
- v1.8.0: Unable to highlight multiple selected values at once in selectInput/selectizeInput HOT 1
- How to use `Shiny.bindAll` for a DT table? HOT 8
- Why updateDateInput() nor dateRangeInput() don't have the datesdisabled parameter enabled? HOT 1
- Error in init.ts when using library(jsTreeR) HOT 3
- Shiny server not supporting http range requests. This disables seekbars for locally (www folder) hosted media files. HOT 2
- `accordion_insert_panel` on restored bookmarks does not work with a module HOT 3
- Nginx configuration
- When the withProgress is closed, the program still runs in the background. HOT 3
- Update bundled DataTable.js; deprecate `dataTableOutput()` HOT 4
- In TS code, convert `Shiny` from `interface` to `class`
- Update ionRangeSlider to use CSS variables in a Bootstrap 5 context
- Update input - HTML in label
- After upgrading to R 4.3.3 and Shiny 1.8.0 on ubuntu, I am not able to run shiny. Error in is.call(funBody[[idx]]) && as.character(funBody[[idx]][[1]]) == : 'length = 3' in coercion to 'logical(1)' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shiny.