R Shiny Plotly Animated Bubble chart - bubbles missing hover tag present

Hello, I am looking to get some assistance as to why some of my bubbles in my chart may be appearing and others are not, however the hover tags are still present where the bubbles should be.


Some of the bubbles appear to be rendering?

This is my server code if it helps

server ← function(input, output) {
output$animatedBubbleChart ← renderPlotly({
# Reactively filter data based on user input
reactive_data ← reactive({
# Determine filtering based on the user selection in the UI
if (input$circleRep == “disease_group”) {
# Filter to include only entries where ‘disease’ is NA (general disease groups)
filtered_data ← combined_data1 %>%
filter(is.na(disease))
} else if (input$circleRep == “disease”) {
# Filter to include only entries where ‘disease’ is NOT NA (specific diseases)
filtered_data ← combined_data1 %>%
filter(!is.na(disease))
} else {
# Default behavior (if applicable), or handle other selections if needed
filtered_data ← combined_data1
}

  # Preprocess data to include a custom hover text string
  filtered_data <- filtered_data %>%
    mutate(
      custom_hover = paste(
        "<b>", get(input$circleRep), " (", get(input$bubbleColor), ")</b><br>",
        input$xVar, ": ", get(input$xVar), "<br>",
        input$yVar, ": ", get(input$yVar), "<br>",
        input$bubbleSize, ": ", get(input$bubbleSize)
      )
    )
  
  filtered_data
})

# Plotting the data with custom hover text
p <- plot_ly(data = reactive_data(),
             x = ~get(input$xVar), 
             y = ~get(input$yVar),
             size = ~get(input$bubbleSize),  # Used for visual representation
             color = ~get(input$bubbleColor),
             text = ~custom_hover,  # Use the enhanced hover text
             key = ~get(input$circleRep),
             frame = ~get(input$animationVar), 
             ids = ~get(input$circleRep),
             type = 'scatter', 
             mode = 'markers',
             marker = list(sizemode = 'diameter', opacity = 0.5),
             hoverinfo = 'text',
             hovertemplate = "%{text}<extra></extra>") %>%
  layout(title = "Interactive Animated Bubble Chart",
         xaxis = list(title = input$xVar, tickformat = ','),  # Formatting ticks with comma
         yaxis = list(title = input$yVar, tickformat = ','),  # Formatting ticks with comma
         showlegend = TRUE, hovermode = "closest")

return(p)

})
}

Appreciate any help!