Prevent multiple selectize/dynamic color brushes from being rendered in shiny#1936
Merged
Prevent multiple selectize/dynamic color brushes from being rendered in shiny#1936
Conversation
…ing rendered in shiny
e9a6898 to
74e1781
Compare
|
Hello, The new update did prevent multilple selectize/dynamic color from being rendered in shiny and it works for me but the select box is not accessible. I have attached an example. I can not type any entry. How to keep the selectize actif? Thanks library(shiny)
library(plotly)
library(ggplot2)
mtcars$brand = rownames(mtcars)
# Define UI
ui <- fluidPage(
# Application title
titlePanel("Testing highlight with shiny"),
#
sidebarLayout(
sidebarPanel(
selectInput("xid", "xcol", choices=colnames(mtcars), selected = "cyl"),
selectInput("yid", "ycol", choices=colnames(mtcars), selected = "mpg"),
),
# Show a plot of the generated distribution
mainPanel(
plotlyOutput("distPlot")
)
)
)
# Define server
server <- function(input, output) {
output$distPlot <- renderPlotly({
mtcars2 <- highlight_key(mtcars, ~brand, "Select brand")
gg <- ggplot(mtcars2, aes_string(x=input$xid, y=input$yid)) + geom_point()
## ggplotly(gg)
highlight(
suppressWarnings(ggplotly(gg)),
on = "plotly_click",
selectize = TRUE,
dynamic = TRUE,
persistent = FALSE
)
})
}
# Run the application
shinyApp(ui = ui, server = server) |
cpsievert
added a commit
that referenced
this pull request
Apr 15, 2021
Collaborator
Author
|
Thanks @cpsievert , I can now type an entry but there is still a small box (another non actif select) |
sthagen
added a commit
to sthagen/plotly-plotly.R
that referenced
this pull request
May 13, 2021
Follow up to plotly#1936: hash the selectize id so it can be used as an HTM…
|
Hi Carson, The latest committed version works fine for me. However if you subset or filter the original data the highlighted_key did not change/refresh. The list on the select box is still the original one. Here attached a reproducible example. So how to change the list of brand names to the half as the data change to half? and refresh the list? Thanks, FE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #1584