Skip to content

[Bug]: The filter panel feature does not work well when data/vars have special characters #570

@vedhav

Description

@vedhav

What happened?

The namespace creation function for the data and column names can be more robust. Right now the special characters are stripped from the name space which might not be ideal.

library(teal)

app <- init(
  within(teal_data(), {
    iris <- iris
    iris[["Species!"]] <- iris$Species
    iris[["Species!@#$%^&*_-+={[()]}:;,<>./?"]] <- iris$Species
  }),
  modules(
    example_module("Module 1"),
    example_module("Module 2"),
    modules(
      label = "Nested modules",
      example_module("Module 3"),
      example_module("Module 4"),
      modules(
        label = "Sub nested modules",
        example_module("Module 5"),
        example_module("Module 6")
      )
    )
  ),
  filter = teal_slices(
    teal_slice(dataname = "iris", varname = "Species", multiple = FALSE),
    teal_slice(dataname = "iris", varname = "Species!", multiple = TRUE),
    teal_slice(dataname = "iris", varname = "Species!@#$%^&*_-+={[()]}:;,<>./?", multiple = TRUE),
    teal_slice(dataname = "iris", varname = "Sepal.Length", multiple = TRUE)
  )
)

shinyApp(app$ui, app$server)

sessionInfo()

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcore

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions