简体   繁体   English

Google Vis和闪亮的加载图

[英]Google Vis and shiny loading charts

I have made a page in shiny that has a side and main panel. 我制作了一个有侧边和主面板的闪亮页面。 The side panel lets you chose the dataset and the main panel has some text on top and then a googlevis chart followed by some text at the bottom. 侧面板让您选择数据集,主面板的顶部带有一些文本,然后是googlevis图表,底部带有一些文本。

Every time the dataset is changed and the chart reloads, it dissapears for a bit while its loading making the text at the bottom move up the page until the chart finally displays again. 每次更改数据集并重新加载图表时,它都会在加载过程中消失一些,使底部的文本在页面上移,直到最终再次显示图表。 Then the text moves back to the bottom. 然后,文本移回底部。

My question is, is there a way to have a placeholder while the chart is loading so you dont get that ugly text moving while the chart loads? 我的问题是,有没有一种方法可以在图表加载时使用占位符,以便在图表加载时不会让难看的文本移动? Or is there a way to split up the main panel so the chart can reload without bothering the text below? 还是有一种方法可以拆分主面板,以便重新加载图表而不会打扰下面的文本?

Shiny provides a good introduction to laying out your shiny app http://shiny.rstudio.com/articles/layout-guide.html Shiny为布局您的闪亮应用程序提供了很好的介绍, 网址为http://shiny.rstudio.com/articles/layout-guide.html

You might be looking to use something like the grid format where you can divide the main screen into a grid cells (big surprise there, huh) and place different content in each cell. 您可能正在使用网格格式之类的东西,您可以将主屏幕划分为一个网格单元格(这很令人惊讶),并在每个单元格中放置不同的内容。

From the layout guide, it looks like this is implemented through the fluidRow() function, within which you specify each column() and its characteristics. 从布局指南看来,这似乎是通过fluidRow()函数实现的,您可以在其中指定每个column()及其特征。

mainPanel(
           fluidRow(
             column(12,
                    p("THIS FLUID ROW TAKES UP THE ENTIRE WIDTH OF THE PAGE"),
                    br(),
                    br(),
                    br())),
           hr(),
           fluidRow(
             column(4,
                    p("THIS FLUID ROW IS DIVIDED INTO THREE COLUMNS, EACH 1/3RD OF THE PAGE WIDTH"),
                    img(src = "bigorb.png", height = 72, width = 72)),
             column(4,
                    p("THIS IS THE SECOND COLUMN"),
                    img(src = "bigorb.png", height = 72, width = 72)),
             column(4,
                    p("THIS IS THE THIRD COLUMN"),
                    img(src = "bigorb.png", height = 72, width = 72))
             )

)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM