私は小さなシャイニーアプリケーションを構築していmainPanel
ますtabsetPanel
. タブがなく、rChart のみを表示する場合は問題ありませんが、rChart がタブに含まれている場合、タブは常にチャートよりも短く、スクロールバーが表示されます。
重要な部分に焦点を当てるために、以下のコードを省略記号で省略しました。
ui.R:
shinyUI(pageWithSidebar(
headerPanel("..."),
sidebarPanel(...),
mainPanel(
tabsetPanel(
tabPanel("Plot",
div(id = "myplot",
includeCSS("rickshaw.css"),
showOutput("plot", "rickshaw"))
),
tabPanel("Raw Data", tableOutput("table"))
)
)
)) # end shinyUI
サーバー.R:
# some preprocessing up here
shinyServer(function(input, output) {
# generate checkbox options from preprocessed data
output$modelSelection <- renderUI({...})
# make the rickshaw rChart
output$plot <- renderChart2({
chart <- Rickshaw$new()
chart$layer(value ~ datetime, group = "variable", data = select.frame, type="area")
chart$set(width = 600,
height = 400,
slider = TRUE)
return(chart)
})
# make the raw output
output$table <- renderTable({...})
})
whererickshaw.css
とthis github bugrenderChart2
から来て、インタラクティブ性を有効にします。
したがって、問題はchart$set
DOES の高さは機能しますが、実際のタブは常にわずかに短く、スクロール バーが強制的に表示されることです (ただし、 の場合も同様ですslider=FALSE
)。
過去にタブ付きの ggplot で同様の問題がありましたplotOutput
が、 のオプションではない高さの引数を渡すことで修正されましたshowOutput
。
これらの 修正は明らかに morris.js で機能することがわかりましたが、適切に適用することができませんでした。
人力車とタブ付きパネルで成功した人は他にいますか? 私は使用rCharts_0.4.2
しshiny_0.8.0
ていますR version 3.0.2 (2013-09-25)