Learn R Programming

linkeR (version 0.1.2)

detect_component_type: Detect Component Type Based on Output ID Patterns

Description

detect_component_type is an internal function that attempts to automatically determine the type of 'shiny' output component based on common naming patterns in the component ID. This function uses simple heuristics to classify components as either "leaflet" (for maps) or "datatable" (for tables), with "datatable" as the default fallback.

Usage

detect_component_type(component_id, data_reactive)

Value

Character string indicating the detected component type:

  • "leaflet" - for IDs containing "map" or "leaflet"

  • "datatable" - for IDs containing "table" or "dt", or as default

Arguments

component_id

Character string. The ID of the output component to classify.

data_reactive

Reactive data object (currently unused in the function logic).

Details

The function uses case-insensitive pattern matching on the component ID:

  • IDs containing "map" or "leaflet" are classified as "leaflet"

  • IDs containing "table" or "dt" are classified as "datatable"

  • All other IDs default to "datatable" with a warning message