Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

129
Vistas
Plotly react. The annotation disappears after changing border color

I have a plotly graph with several annotations with an extra UUID parameter. I also have a list of these annotations and what I want is that the annotation I select on the list changes its border color. The function I'm using to change the border color is the following:

const annotations = [
  {...},
  {...}
]
const selectAnnotation = (id)=> {
        const dummyAnnotations = clone(annotations)
        dummyAnnotations.forEach((note) => {
          if (note.id===id){
            note.bordercolor = 'red'
          } else {
            note.bordercolor = 'white'
          }
        })

        setAnnotations(dummyAnnotations)
    }

<h2>Annotations:</h2>
{annotations.map((note)=>
     <li key={note.id}>
          <button 
              className='button'
              onClick = {()=>selectAnnotation(note.id)}
          >
              {note.text}&nbsp;
          </button>                       
     </li>
)}

However, when I click an annotation on the list, the corresponding one on the graph disappears, only to appear again when I change the graph size manually. Here are some screenshots:

Plot before selecting any note

Plot before selecting any note

Plot after selecting one-note

Plot after selecting one note

Plot after resizing the window, now the note is back and with new border color

Plot after resizing the window, now the note is back and with new border color

Any ideas about what's going on? Thanks!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda