Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
r2d3 visual does not resize automatically

I have been able to get an r2d3 visual to resize the width automatically but nothing is working in terms of resizing the height e.g. when changing to a bigger screen.

tagList(
    
  mainPanel(width="100%",
            tags$div(
              id = "result-block",
            d3Output(ns("d3Plot")
                     ,width = "100%" ,height = "750px"
                     ))
            ,actionButton("go", "Take a screenshot")
        )
  ) #End of tagList
}
    
#' r2d3 Server Functions
#'
#' @noRd 

mod_r2d3_server <- function(id){
  moduleServer( id, function(input, output, session){
    ns <- session$ns
 
    nodes <- read.csv("inst/app/data/NodesNew.csv")
    edges <- read.csv("inst/app/data/Edges.csv")
    map_list <- list(nodes = nodes,links = edges)
    data <- toJSON(map_list)
    
    #Send that json from the session to our javascript
    session$sendCustomMessage(type="jsondata",data)
    
    
    
    plotInput <- function(){
      data<-data
      r2d3(css="inst/app/data/net.css", data=data, script = "inst/app/www/net.js", d3_version = "4",sizingPolicy(padding = 0, browser.fill = TRUE,viewer.fill=TRUE))
    }
      
    output$d3Plot<-renderD3({
      
      print(plotInput())
    
    })
    
})
}

How can I get it to resize automatically? r2d3 is supposed to handle this automatically from everything I've read but it does not work for me. Would appreciate any help with this!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!