2017-06-26 7 views
1

私は、光沢のあるアプリケーションでplotlyOutputのサイズを変更しようとしていますが、高さパラメータを変更すると、今日R 3.4にアップデートして光沢をつけてプロットした後、プロットサイズに影響しないように見えます(plotly_4.7.0、ggplot2_2.2.1 .9000、shiny_1.0.3)私は、プロットのサイズがウィンドウのサイズを変更するときに動的に変化しないことに気付きました。私はplotlyoutputの高さを使ってプロットのサイズを直接変更しようとしましたが、plotlyオブジェクトから$ layout $ heightプロパティを変更しましたが、プロットのサイズには何の影響も与えないようです。 サンプルコードです。plotlyOutputオブジェクトのサイズ変更

ui<-fluidPage(
mainPanel(
tabsetPanel(
    tabPanel("tab", 
      selectInput("plot","Plot type",c("Box plot"="box","Inidividual cells"="cell","Violin plot"="violin"),"violin"), 
      plotlyOutput('Barplot',height = "100px") 
      ) 
    ) 
) 
) 

server<- function(input,output,session){ 
output$Barplot <- renderPlotly({ 
bp <- ggplot(mtcars,aes(x=cyl,y=mpg,colour=cyl))+geom_point() 
bp<-plotly_build(bp) 
bp$layout$width= 100 
bp 
}) 
} 
shinyApp(server=server,ui=ui) 

答えて

0

plotlyOutput('Barplot') 

bp <- ggplot(mtcars,aes(x=cyl,y=mpg,colour=cyl))+geom_point() 
ggplotly(bp, height=800) %>% layout(autosize=FALSE) 
+0

を試してみてくださいそれは細かい動作しますが、高さ値のdoesntを変更すると、それが動作する私にとってプロット –

+0

@JorgeKageyama上の任意の効果を持っているように思われます。 'plotlyOutput'から' height = "100px"を削除しましたか? –

+0

私はそれがアップデートと関係していると思います –

関連する問題