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

198
Views
Better camera controls with 3d plots with Plotly.js

I'm trying to make a Plotly.js window that covers the entire available window. In order to do this, I am adding a listener to resize the window, and animating the resize. When I do this, the camera changes all of its parameters to reset to its original location, ignoring what the user may have done to rotate and zoom.

Any suggestions on how to make this less jaring? I can't find any way to see how the camera is adjusted per the user, which would allow me to manually figure things out if it came to that, but... This is effectively the code I am working with currently.

window.addEventListener("resize",Refresh)

function resize(data) {
    var size = {
        width: window.innerWidth || document.body.clientWidth,
        height: window.innerHeight || document.body.clientHeight
    }
    newLayout = {width:size.width * 0.99, height:size.height * 0.90, }
    Plotly.animate('solarPlot', {layout:newLayout},
        {transition: {duration:100, easing:'cubic-in-out'}, 
        frame:{duration:100},})
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The answer was elsewhere. The initial plot should be created using Plotly.newPlot. I was using Plotly.react, which will create a plot the first time, but it will change cameras when things are changed.

about 4 years ago · Juan Pablo Isaza Report
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!