我的主面板中有Shiny Dashboard
的几个图表,我想知道如何扩展主面板底部的空白区域?我该如何修改ui.R
来执行此操作?
dashboardBody(
tabItems(
tabItem("dashboard",
mainPanel(
showOutput("plot3", "Nvd3"),
showOutput("plot4", "Nvd3")
)),
答案 0 :(得分:3)
你能尝试用div包裹你showOutput
吗?
tags$div(
style="margin-bottom:50px;",
showOutput("plot4", "Nvd3")
)
答案 1 :(得分:3)
我遇到了同样的问题。将所有内容放入fluidRow()
为我修复...
答案 2 :(得分:1)
使用CSS,在你的ui.R文件中添加:
import WatchConnectivity
protocol DataSourceChangedDelegate {
func dataSourceDidUpdate(dataSource: DataSource)
}
class WatchSessionManager: NSObject, WCSessionDelegate {
static let sharedManager = WatchSessionManager()
private override init() {
super.init()
}
private var dataSourceChangedDelegates = [DataSourceChangedDelegate]()
private let session: WCSession = WCSession.defaultSession()
func startSession() {
session.delegate = self
session.activateSession()
}
func addDataSourceChangedDelegate<T where T: DataSourceChangedDelegate, T: Equatable>(delegate: T) {
dataSourceChangedDelegates.append(delegate)
}
func removeDataSourceChangedDelegate<T where T: DataSourceChangedDelegate, T: Equatable>(delegate: T) {
for (index, indexDelegate) in dataSourceChangedDelegates.enumerate() {
if let indexDelegate = indexDelegate as? T where indexDelegate == delegate {
dataSourceChangedDelegates.removeAtIndex(index)
break
}
}
}
}
// MARK: Application Context
// use when your app needs only the latest information
// if the data was not sent, it will be replaced
extension WatchSessionManager {
// Receiver
func session(session: WCSession, didReceiveApplicationContext applicationContext: [String : AnyObject]) {
dispatch_async(dispatch_get_main_queue()) { [weak self] in
self?.dataSourceChangedDelegates.forEach { $0.dataSourceDidUpdate(DataSource(data: applicationContext))}
}
}
}
答案 3 :(得分:0)
我遇到了同样的问题,根据提示 Jthorpe ,我从我的脚本中删除了所有mainPanel
。我一个接一个地有六个图,它工作正常。
答案 4 :(得分:0)
对于Shiny中的垂直空格,可以使用headerPanel("")