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
I've been trying to use your package to highlight some text based on data in a data frame. I want to build a shiny app where the user can select the text entry they want to look at and the text is automatically highlighted based on the information in another column. When I don't include the option to change the displayed text the highlighting works well, however when I include the filtering option the text doesn't get marked anymore. Here is some example code and data:
This doesn't work:
library(tidyverse)
library(shiny)
library(marker)
data <- read_delim("Marker_package_example_data.csv")
ui <- fluidPage(
tabPanel(title = "Text",
sidebarPanel(
selectInput("Name_selector", "Select a Name", choices = data$Name, selected = data$Name[1])
),
mainPanel(useMarker(),
tags$head(
tags$style(
".red{background-color:#FFB8C3;}.blue{background-color:#6ECFEA;}"
)
),
p(id = "test", textOutput("marked_data"))#This is what is causing at least part of the problem
)
Hello,
I've been trying to use your package to highlight some text based on data in a data frame. I want to build a shiny app where the user can select the text entry they want to look at and the text is automatically highlighted based on the information in another column. When I don't include the option to change the displayed text the highlighting works well, however when I include the filtering option the text doesn't get marked anymore. Here is some example code and data:
Marker_package_example_data.csv
This works:
library(tidyverse)
library(shiny)
library(marker)
data <- read_delim("Marker package example data.csv")
lorem <- data$Text[1]
ui <- fluidPage(
)
)
server <- function(input, output){
marker <- marker$new("#test")
observe(marker$
unmark()$
mark(data$Origin[1], className = "blue"))
observe(marker$
unmark()$
mark(data$Name[1], className = "red"))
}
shinyApp(ui, server)
This doesn't work:
library(tidyverse)
library(shiny)
library(marker)
data <- read_delim("Marker_package_example_data.csv")
ui <- fluidPage(
tabPanel(title = "Text",
sidebarPanel(
selectInput("Name_selector", "Select a Name", choices = data$Name, selected = data$Name[1])
),
mainPanel(useMarker(),
tags$head(
tags$style(
".red{background-color:#FFB8C3;}.blue{background-color:#6ECFEA;}"
)
),
p(id = "test", textOutput("marked_data"))#This is what is causing at least part of the problem
)
)
)
server <- function(input, output){
Reactive_data <- reactive(
data%>%
filter(Name == input$Name_selector)
)
output$marked_data <- renderText({
Reactive_data()$Text
})
marker <- marker$new("#test")
observe(marker$
unmark()$
mark(Reactive_data()$Origin, className = "blue"))
observe(marker$
unmark()$
mark(Reactive_data()$Name, className = "red"))
}
shinyApp(ui, server)
The text was updated successfully, but these errors were encountered: