rstudio / rstudio/flexdashboard
leaflet doesn't shown with R markdown
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 848
- Forks
- 298
- PR merge metrics
- No merged PRs in 30d
Description
I have a leaflet on a flexdashboard. It doesn't show with R markdown html when it is not the 1st tab or it is one of the elements (2 rows, each row has 2 columns) on the page.
It does show if it is on the 1st tab or it is the only element (1 row 1 column). It shows well on the console.
dygraph has a similar situation. It doesn't show.
fyi, It throws error in both R Studio and Chrome regardless it shows or not. So I am not sure if it is related.
Consider using 'dppx' units instead of 'dpi', as in CSS 'dpi' means dots-per-CSS-inch, not dots-per-physical-inch, so does not correspond to the actual 'dpi' of a screen. In media query expression: (min-resolution: 144dpi) :41263/rmd_output/2/:1
123
ReferenceError: Can't find variable: iii
Please help.
mp=map("world", "China", fill=TRUE, plot=FALSE)
leaflet(data=mp, options=leafletOptions(minZoom = 4, maxZoom = 4))%>%
addTiles()%>%
addPolygons(fillColor = topo.colors(10, alpha = NULL), stroke=FALSE)%>%
addMarkers(city$longitude, city$latitude, popup=htmlEscape(as.character(city$net_sale_s)), clusterOptions = markerClusterOptions())
++++++++++++++++
gts<-ts(growth$net_sale_s, start=c(2014, 1), frequency = 1)
pts<-ts(growth$oper_profit_s, start=c(2014, 1), frequency = 1)
rts<-ts(growth$grs_profit_r, start=c(2014, 1), frequency = 1)
dygraph( cbind(gts, pts, rts), elementId = "growth", width="500", height="400") %>%
dyAxis("y", label="金额(万元)") %>%
dyAxis("y2", label = "毛利率(%)") %>%
dySeries("gts", label="销售额") %>%
dySeries("pts", label="营业利润") %>%
dySeries("rts", label="毛利率", axis='y2')
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the provided R Markdown flexdashboard example with leaflet and dygraph, comparing the first-tab or single-element layout with the hidden-tab and multi-column layouts. Check whether the reported browser errors occur in both cases; done means both widgets render correctly in the affected layouts without the reported errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, r
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100