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

324
Visualizações
React's Plotly.js uirevision does not work

Plotly has the option to zoom in on the chart by dragging the box.

Each time the react component is re-rendered, Persist user changes is initialized.

In Plotly options, there is option about it. "uirevision in Plotly.react in JavaScript"

I've already applied it, but there's no change.

Here is my code

const GraphContainer = styled(Plot)`
  width: 100%;
  height: 300px;
`;

.....

return (
  <>
    <GraphContainer
      data={[
        {
          x: graphData.power.x,
          y: graphData.power.y,
          name: 'Graph',
          line: {
            color: theme.colors.chart.single[1],
          },
        },
      ]}
      layout={{
        xaxis: {
          type: 'date',
          range: [
            '2021-10-21 00:00:00',
            '2021-10-21 23:59:00',
          ],
        },
        yaxis: {
          tickformat: ',.0f',
          ticksuffix: 'kW',
        },
        uirevision: 'true',
      }}
      config={{ responsive: true, displayModeBar: false }}
    />
  </>
);

Another thing what I did:

In Link, there is explanation "user interaction will mutate layout and set autorange to false, so we need to reset it to true". According to documents, I've setting the layout object to state, uirevision: 'true', yaxis and xaxis's autorange set to true, but not work.

Someone help me please. Thank you.

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