Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

202
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda