<legend id='ug1h0'><style id='ug1h0'><dir id='ug1h0'><q id='ug1h0'></q></dir></style></legend>
  • <i id='ug1h0'><tr id='ug1h0'><dt id='ug1h0'><q id='ug1h0'><span id='ug1h0'><b id='ug1h0'><form id='ug1h0'><ins id='ug1h0'></ins><ul id='ug1h0'></ul><sub id='ug1h0'></sub></form><legend id='ug1h0'></legend><bdo id='ug1h0'><pre id='ug1h0'><center id='ug1h0'></center></pre></bdo></b><th id='ug1h0'></th></span></q></dt></tr></i><div id='ug1h0'><tfoot id='ug1h0'></tfoot><dl id='ug1h0'><fieldset id='ug1h0'></fieldset></dl></div>

    • <bdo id='ug1h0'></bdo><ul id='ug1h0'></ul>
  • <tfoot id='ug1h0'></tfoot>

    1. <small id='ug1h0'></small><noframes id='ug1h0'>

        如何更改 rmarkdown 单元格中的 css &amp;闪亮的

        时间:2023-08-08

          <bdo id='bVDjf'></bdo><ul id='bVDjf'></ul>

            <tfoot id='bVDjf'></tfoot>

                <tbody id='bVDjf'></tbody>
              • <i id='bVDjf'><tr id='bVDjf'><dt id='bVDjf'><q id='bVDjf'><span id='bVDjf'><b id='bVDjf'><form id='bVDjf'><ins id='bVDjf'></ins><ul id='bVDjf'></ul><sub id='bVDjf'></sub></form><legend id='bVDjf'></legend><bdo id='bVDjf'><pre id='bVDjf'><center id='bVDjf'></center></pre></bdo></b><th id='bVDjf'></th></span></q></dt></tr></i><div id='bVDjf'><tfoot id='bVDjf'></tfoot><dl id='bVDjf'><fieldset id='bVDjf'></fieldset></dl></div>

              • <legend id='bVDjf'><style id='bVDjf'><dir id='bVDjf'><q id='bVDjf'></q></dir></style></legend>

              • <small id='bVDjf'></small><noframes id='bVDjf'>

                1. 本文介绍了如何更改 rmarkdown 单元格中的 css &amp;闪亮的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我在 r 中相对较新,并创建 传单图 我需要 白色背景 而不是 灰色>.

                  I am relatively new in r and creating leaflet plot for which I need a white background instead of grey.

                  我遇到了同样的 SO 帖子:blank, 传单地图的白色背景 &试过了:

                  I came across this SO post for same: blank, white background for leaflet map & tried:

                  剧情代码:

                  daily_leaflet_plt <- ind_states %>% leaflet(options = leafletOptions(zoomControl = FALSE,
                                                                  dragging = FALSE,
                                                                  minZoom = 3,
                                                                  style = list(
                                                                    "background-color" = "white"
                                                                  )
                                                                  )) %>%
                            
                            addPolygons(
                                        label = label_daily,
                                        labelOptions = labelOptions(
                                          opacity = .6,
                                          style = list(
                                              "color" = "white",
                                              "background-color" = "black",
                                              "font-size" = "15px",
                                              "border-color" = "rgba(0,0,0,0.5)"
                                          )
                                        ),
                                        stroke = TRUE,
                                        color = "white",
                                        dashArray = "3",
                                        weight = .2,
                                        smoothFactor = .5,
                                        opacity = 1,
                                        fillOpacity = 0.5,
                                        fillColor = ~ pal_daily(Daily_confirmed),
                                        highlightOptions = highlightOptions(weight = .5,
                                                                            fillOpacity = 1,
                                                                            bringToFront = TRUE)) %>%
                  
                            addLegend(position = "bottomleft",
                                      pal = pal_daily,
                                      values = ~ ind_states$Daily_confirmed,
                                      title = "Daily Confirmed Cases",
                                      opacity = 0.7)
                  

                  按照 SO 帖子的 css:

                  ```{r results="daily_leaflet_plt"}
                  cat("
                  <style>
                  .leaflet-container {
                      background: #FFF;
                  }
                  </style>
                  ")
                  ```
                  

                  但这不起作用,如何在 rmarkdown & 中的传单 plt 中获得白色背景空间闪亮,最终我将在闪亮中使用它.

                  But this doesn't work, How can I get white background space in leaflet plt in rmarkdown & shiny as eventually I will be using this in shiny.

                  我也在另一篇 SO 帖子中提出了这一点,该帖子的措辞不同 &仍未得到答复:如何更改r中多边形形状周围的传单地图颜色?

                  I have also raised this in another SO post which is phrased differently & remains unanswered: How to change color of leaflet map around the polygon shape in r?

                  推荐答案

                  我认为您的 CSS 选择器是正确的,但我个人认为以典型的 Shiny 方式指定它更容易,即,

                  I think your CSS selector is correct, but I'd personally find it easier to just specify that in the typical Shiny way, i.e.,

                  library(shiny)
                  library(leaflet)
                  
                  ui <- fluidPage(
                      tags$head(tags$style(HTML(".leaflet-container {background: none;}")))
                      leafletOutput("map")
                  )
                  
                  server <- function(input, output, session) {
                      output$map <- renderLeaflet({
                          leaflet(quakes) %>%
                              addTiles()
                       })
                  }
                  
                  shinyApp(ui, server)
                  

                  对于 R markdown,您可以像嵌入 R 代码块一样嵌入 CSS 代码块,例如,

                  For R markdown, you can embed a CSS code chunk as you would an R code chunk, e.g.,

                  ```{css, echo = FALSE}
                  .leaflet-container {
                      background: none;
                  }
                  ```
                  
                  
                  ```{r}
                  library(leaflet)
                  
                  leaflet(quakes) %>%
                      addTiles()
                  ```
                  

                  这篇关于如何更改 rmarkdown 单元格中的 css &amp;闪亮的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Web 上的等距矩形地图 下一篇:Leaflet.contextmenu 回调

                  相关文章

                  最新文章

                  <i id='PWtOJ'><tr id='PWtOJ'><dt id='PWtOJ'><q id='PWtOJ'><span id='PWtOJ'><b id='PWtOJ'><form id='PWtOJ'><ins id='PWtOJ'></ins><ul id='PWtOJ'></ul><sub id='PWtOJ'></sub></form><legend id='PWtOJ'></legend><bdo id='PWtOJ'><pre id='PWtOJ'><center id='PWtOJ'></center></pre></bdo></b><th id='PWtOJ'></th></span></q></dt></tr></i><div id='PWtOJ'><tfoot id='PWtOJ'></tfoot><dl id='PWtOJ'><fieldset id='PWtOJ'></fieldset></dl></div>

                      <small id='PWtOJ'></small><noframes id='PWtOJ'>

                      <legend id='PWtOJ'><style id='PWtOJ'><dir id='PWtOJ'><q id='PWtOJ'></q></dir></style></legend>

                      <tfoot id='PWtOJ'></tfoot>
                        <bdo id='PWtOJ'></bdo><ul id='PWtOJ'></ul>