title: How do I control bar colors in plot_ly with reactive data in shiny
body: <p>I am creating an R shiny dashboard and data is being filtered. Reactive data is processed. When different selections are made, the colors in the bar chart change and aren't consistent. The colors signify Good, Neutral, Bad, and not available so the order matters. Full shiny app is at: <a href="https://stoltzmaniac.shinyapps.io/medicare_data/" rel="nofollow noreferrer">https://stoltzmaniac.shinyapps.io/medicare_data/</a> and the code is at: <a href="https://github.com/stoltzmaniac/Medicare/tree/master/shinyApp" rel="nofollow noreferrer">https://github.com/stoltzmaniac/Medicare/tree/master/shinyApp</a> (both server.R and ui.R) Plotly portion looks like:  </p>
  
  <pre><code>plot_ly(df_filtered, x = ~Score, y = ~Hospital.Name, 
          type = "bar", color = ~Compared.to.National, colors = FORMAT_CHART_COLOR_LIST, 
          hoverinfo = 'text', text = ~paste('State: ', State, 
                                            '&lt;br&gt; City: ', City,
                                            '&lt;br&gt; Score: ', Score))
  </code></pre>