Attempting to resize a plotOutput using Shiny R.
The plot in question can be viewed https://i.sstatic.net/fgzag.png
This is the code snippet:
#In ui:
fluidRow(
column(width = 12,
h4("Diagrama Persistencia"),
plotOutput("Diagrama")
)
)
#In server
output$Diagrama <- renderPlot({
F_PlotDiag(Diag = isolate(values$data), tipoPlot = input$radioPlot, tamEjeNom = input$sliderTamEjeNom)
}, height = input$sliderHeight, width = input$sliderWidth)
We need to adjust the height and width parameters. This adjustment is necessary within an observeEvent context.
By scaling down, the entire plot does not fit on the screen. The reduced dimensions result in an inaccurate representation like this:
https://i.sstatic.net/sUZY2.png
However, upon downloading the FIRST image and viewing it separately, the output appears as expected unlike the second scaled version: https://i.sstatic.net/sHrkg.png
Is there a method to display the complete plot in the browser by adjusting its scale? Essentially, achieving a similar view to that of a downloaded image.
Lacking CSS expertise, logical solutions are limited, but attempts have been made in modifying the HTML as follows:
https://i.sstatic.net/2Ow5U.png
tags$style(type="text/css", ".shiny-bound-output { transform: 'scale(.5)' }")
tags$style(type="text/css", ".shiny-plot-output { transform: 'scale(.5)' }")
tags$style(type="text/css", "#Diagrama { height: 20px }")
Unfortunately, these attempts have yielded no successful outcome.