R/ui_modulo_indicadores.R

Defines functions indicadoresUI

indicadoresUI = function(id) {
  tagList(
    fluidRow(
      shinydashboard::tabBox(
        height = "auto",
        width = 12,
        title = "",
        tabPanel(
          title = "Cargar datos",
          fluidRow(
            colInput(
              colwidth = 4,
              inputFun = selectInput,
              inputId = NS(id, "indicador"),
              label = "Seleccionar indicador",
              choices = c("Media", "Proporcion", "Total", "Razon")
            ),
            colInput(
              colwidth = 4,
              inputFun = selectInput,
              inputId = NS(id, "dominios"),
              label = "Dominios de estimacion",
              choices = NULL,
              multiple = TRUE
            ),
            # Add field button
            column(
              width = 1,
              offset = 3,
              shinyWidgets::actionBttn(
                inputId = NS(id, "btn_agregar_indicador"),
                label = NULL,
                style = "material-circle",
                color = "primary",
                icon = shiny::icon("plus")
              )
            )
          ),
          tags$div(
            id = NS(id, "univariado"),
            fluidRow(
              colInput(
                colwidth = 4,
                inputFun = selectInput,
                inputId = NS(id, "variable"),
                label = "Variable",
                choices = NULL
              ),
              column(
                width = 4,
                tags$div(
                  style = "margin-top:32px",
                  checkboxInput(
                    inputId = NS(id, "total_categorias"),
                    label = "Total en las categorias",
                    value = TRUE
                  )
                )
              )
            )
          ),
          shinyjs::hidden(
            tags$div(
              id = NS(id, "razon"),
              fluidRow(
                colInput(
                  colwidth = 4,
                  inputFun = selectInput,
                  inputId = NS(id, "variable_num"),
                  label = "Variable numerador",
                  choices = NULL
                ),
                colInput(
                  colwidth = 4,
                  inputFun = selectInput,
                  inputId = NS(id, "variable_den"),
                  label = "Variable denominador",
                  choices = NULL
                )
              )
            )
          )
        )
      )
    )
  )
}
tomicapretto/cemrepboot documentation built on Dec. 31, 2020, 8:43 a.m.