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

127
Views
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
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!