我splitLayout在Shiny R应用程序中使用它来创建一个两面板的结构,该结构的左侧为图(一个googleVis gVisGeoChart对象),右侧为HTML。
这是有问题的代码的模型:
splitLayout(
htmlOutput("mychart"), #This winds up rendering properly to the left side of the window
div(
h1("A descriptive heading"),
p("Here's some text that takes more than one line on the screen. I want it to wrap, but it just keeps going to the right out of view in its container.")
) #This text will not wrap to the right side of the splitLayout frame
)
Run Code Online (Sandbox Code Playgroud)
p()命令中的文本不会换成由splitLayout创建的页面的可见(1/2)。取而代之的是,它一直指向(不可见的)右侧,要求用户滚动查看所有内容。这不是理想的行为(坦率地说,我很难想象它的情况)。
如何确保文本正确包装到splitLayout区域?