You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
multiple selectize/dynamic color brushes rendered in shiny #1584
Hi Carson, I've come across the same issue. I'd prefer to stick with the highlight approach vs. event_data if possible. I find that the plots appear fine in my app, unless I change the value of a dateRangeInput upstream, causing the app to filter the data and reload. My code is below:
I am also having this issue with Plotly in R. When I "highlight" and set "selectize = TRUE" I get a second box with a vertical scroll bar. I would really like to remove this box. Any thoughts? Maybe it is because my data set is very large (scatter plot with >40,000 points). Sorry I can't share more than the image at this point as the data is proprietary. Thanks in advance!
@AFoudree, I had the same problem -- the same vertical-scroll-bar artifact when I added a selectize dropdown menu to a scatterplot. Curiously, the problem appeared only when I used type = "scattergl"; it didn't appear with type = "scatter". (I know that switching to type = "scatter" may not work for you. 40,000 points in a plot seems like a lot.)
@jbullock35 Thanks for the comment. I cannot believe I missed the notification on this in my inbox. I will play with the scatter type and get back to you shortly. Thanks for the advice!
Activity
PsychlytxTD commentedon Nov 13, 2019
Hi Carson, I've come across the same issue. I'd prefer to stick with the highlight approach vs. event_data if possible. I find that the plots appear fine in my app, unless I change the value of a dateRangeInput upstream, causing the app to filter the data and reload. My code is below:
`all_cases_by_measure<- reactive({
by_measure_nested<- nested_data() %>% dplyr::mutate(data = purrr::map(data, ~ dplyr::mutate(., timepoint = 1:length(.x$date))))
by_measure<- tidyr::unnest(by_measure_nested)
by_measure<- dplyr::mutate(by_measure, timepoint = paste("Time", timepoint))
by_measure<- by_measure %>% tidyr::unite("Client", first_name, last_name, birth_date, sep = " ")
by_measure<- by_measure %>% dplyr::group_by(subscale, timepoint) %>% dplyr::mutate(mean_score = round(mean(score, na.rm = TRUE), 2)) %>% dplyr::ungroup()
by_measure$subscale<- gsub("_", "-", by_measure$subscale)
by_measure %>%
group_by(subscale) %>%
dplyr::do(
p = highlight_key(., ~Client, group = "Select A Client") %>%
plot_ly(type = 'scatter', mode = 'lines', showlegend = FALSE) %>%
add_lines(x = ~timepoint, y = ~ mean_score, text = ~paste("Mean Score:", mean_score),
line = list(width = 3, dash = 'dash'),
marker = list(symbol ="diamond-open"),
mode = 'lines+markers', hoverinfo = "text") %>%
group_by(Client) %>%
add_trace(
x = ~timepoint, y = ~score, text = ~paste("Client:", Client, "
",
"Assessment Date:", date, "
",
"Score:", score, "
",
"Change Since Previous:", sprintf("%+3.1f", change_all)
),
mode = 'lines+markers', hoverinfo = "text") %>%
layout(xaxis = list(tickangle = 45)) %>%
add_annotations(
text = ~unique(subscale),
x = 0.5, y = 1,
xref = "paper", yref = "paper",
xanchor = "center", yanchor = "bottom",
showarrow = FALSE
)
) %>%
subplot(
nrows = (NROW(.)/2) + 1,
shareY = FALSE, shareX = FALSE, titleY = FALSE
) %>% highlight(
dynamic = TRUE,
selectize = TRUE,
color = "red"
)
})
output$plot_all_cases_by_measure<- plotly::renderPlotly({
req(all_cases_by_measure())
})`
Solomon-0xGuardian commentedon Apr 29, 2020
I am also having this issue with Plotly in R. When I "highlight" and set "selectize = TRUE" I get a second box with a vertical scroll bar. I would really like to remove this box. Any thoughts? Maybe it is because my data set is very large (scatter plot with >40,000 points). Sorry I can't share more than the image at this point as the data is proprietary. Thanks in advance!
jbullock35 commentedon May 15, 2020
@AFoudree, I had the same problem -- the same vertical-scroll-bar artifact when I added a selectize dropdown menu to a scatterplot. Curiously, the problem appeared only when I used
type = "scattergl"; it didn't appear withtype = "scatter". (I know that switching totype = "scatter"may not work for you. 40,000 points in a plot seems like a lot.)Solomon-0xGuardian commentedon Jul 3, 2020
@jbullock35 Thanks for the comment. I cannot believe I missed the notification on this in my inbox. I will play with the scatter type and get back to you shortly. Thanks for the advice!
Solomon-0xGuardian commentedon Jul 8, 2020
@jbullock35 I was finally able to remove the second vertical-scroll-bar artifact! I found a solution in stack overflow (Mar 8th, 2020). It looks like the problem may be occurring because the highlight-selectize widget does not work well with shiny dashboards. The fix involves embedding java script to manually remove the scroll-bar-artifact. This solution was presented by StéphaneLaurent and can be found here: https://stackoverflow.com/questions/60583349/why-does-shiny-app-add-a-spurious-widget-to-a-plotly-graph-using-highlight-funct/62795535#62795535
Thanks again for your helpful ideas!
Close #1584: Prevent multiple selectize/dynamic color brushes from be…
Close #1584: Prevent multiple selectize/dynamic color brushes from be…
Prevent multiple selectize/dynamic color brushes from being rendered …