>library(flipPictographs)
>value <- NULL
>if (formDataSource == "Type or paste value") {
   # ParseUserEnteredTable has extra parsing for '$', ',', '%', etc 
   value <- flipTransformations::ParseUserEnteredTable(as.matrix(formInputText))[1,1] 
} else if (formDataSource == "Use an existing R output") {
   value <- formInputR[1]
} else if (formDataSource == "Table") {
    value <- flipTables::SelectEntry(formInputTable, formTableRow, formTableColumn, return.single.value = TRUE)
} else {
    value <- SummarizeVariable(formInputVariable, type = formDataSource, category = get0("formCategory"),
                weights = QPopulationWeight, subset = QFilter) 
}
>
>ci <- 1
>fill.color <- NA
>while (is.na(fill.color))
{
    thres.str <- get0(paste0("formThres", ci), ifnotfound = "")
    thres.val <- suppressWarnings(as.numeric(thres.str))

    if (thres.str  == "" && ci == 1)
        fill.color <- get0("formColor0", ifnotfound = "transparent")
    else if (thres.str == "")
        fill.color <- get0(paste0("formColor", ci - 1))
    else if (is.na(thres.val))
    {
        warning("Threshold ", ci, " is not numeric. Using default fill color.")
        fill.color <- formColor0
    }
    else if (value <= thres.val)
        fill.color <- get0(paste0("formColor", ci - 1))
    else
        ci <- ci + 1
}
>
>numberWidget.4 <- VisualizeNumber(value,
    display = formDisplay,
    total.icons = if (exists("formTotalIcons")) as.numeric(formTotalIcons) else NA, 
    maximum.value = if (exists("formDenominator")) as.numeric(formDenominator) else NA, 
    minimum.value = if (exists("formMinimumValue")) as.numeric(formMinimumValue) else 0.0, 
    scale = if (exists("formScale")) as.numeric(formScale) else 1, 
    layout = get0("formLayout", ifnotfound = NA), 
    number.rows = get0("formIconRows", ifnotfound = NA),
    number.cols = get0("formIconCols", ifnotfound = NA), 
    width.height.ratio = if (exists("formWHRatio") && !is.na(as.numeric(formWHRatio))) as.numeric(formWHRatio) else QOutputSizeWidth/QOutputSizeHeight, 
    image = if (isTRUE(get0("formIcon") == "(Custom icon)")) formCustomUrl else formIcon,
    base.image = get0("formCustomBaseUrl", ifnotfound = ""),
    is.custom.url = isTRUE(get0("formIcon") == "(Custom icon)"),
    hide.base.image = get0("formHideBase", ifnotfound = FALSE),
    auto.size = formAutosize,
    icon.width = formIconWidth,
    base.color = get0("formBaseColor", ifnotfound = "#000000"),
    hole.size = get0("formHoleSize"),
    tick.show = get0("formTickShow", ifnotfound = FALSE),
    tick.outside = !isTRUE(get0("formTickInside")),
    tick.number.type = get0("formTickNumType", ifnotfound = "Number"),
    tick.decimals = get0("formTickDigits"),
    tick.prefix = get0("formTickPrefix"),
    tick.suffix = get0("formTickSuffix"),
    tick.font.size = get0("formTickFontSize"),
    tick.font.family = get0("formTickFontFamily"),
    tick.font.color = get0("formTickFontColor"),
    pad.row = get0("formPadRow", ifnotfound = 0.0),
    pad.col = get0("formPadCol", ifnotfound = 0.0), 
    fill.direction = get0("formFillDirection"),
    fill.color = fill.color,
    fill.opacity = get0("formFillOpacity", ifnotfound = 1.0),
    label.data.number.type = get0("dLabNumType", ifnotfound = "Number"),
    label.data.decimals = get0("dLabDigits"),
    label.data.position = get0("dLabPos"),
    label.data.prefix = get0("dLabPrefix"),
    label.data.suffix = get0("dLabSuffix"),
    label.data.valign = get0("dLabVAlign", ifnotfound = "Middle"),
    label.data.halign = get0("dLabHAlign"),
    label.data.pad = get0("dLabPad", ifnotfound = 0.0),
    label.data.xpad  = get0("dLabXPad", ifnotfound = 0.0), 
    label.data.font.family = get0("dLabFont"),
    label.data.font.color = get0("dLabColor"),
    label.data.font.size = get0("dLabSize"),
    label.data.font.weight = get0("dLabWeight"),                                            
    text.above = get0("formTextAbove"),
    text.above.outside = !isTRUE(get0("formTextAboveInside")),
    text.above.halign = get0("formTextAboveHAlign"),
    text.above.pad = get0("formTextAbovePad", ifnotfound = 0.0),
    text.above.xpad = get0("formTextAboveXPad", ifnotfound = 0.0),
    text.above.font.family = get0("formTextAboveFont"),
    text.above.font.color = get0("formTextAboveColor"),
    text.above.font.size = get0("formTextAboveSize"),
    text.above.font.weight = get0("formTextAboveWeight"),
    text.below = get0("formTextBelow"),
    text.below.outside = !isTRUE(get0("formTextBelowInside")),
    text.below.halign = get0("formTextBelowHAlign"),
    text.below.pad = get0("formTextBelowPad", ifnotfound = 0.0),
    text.below.xpad = get0("formTextBelowXPad", ifnotfound = 0.0),                                                  
    text.below.font.family = get0("formTextBelowFont"),
    text.below.font.color = get0("formTextBelowColor"),
    text.below.font.size = get0("formTextBelowSize"),
    text.below.font.weight = get0("formTextBelowWeight"),
    border.color = get0("formBorderColor"),
    border.opacity = get0("formBorderOpacity", ifnotfound = 1.0),
    border.width = get0("formBorderWidth", ifnotfound = 0.0),
    background.color = get0("formBgColor"),
    background.opacity = if (formTransparent) 0.0 else get0("formBgOpacity", ifnotfound = 1.0),
    margin.left = formMarginLeft,
    margin.right = formMarginRight,
    margin.top = formMarginTop,
    margin.bottom = formMarginBottom)
Started:Fri Oct 26 2018 06:07:06 GMT+0000 (Coordinated Universal Time)
Finished:Fri Oct 26 2018 06:07:07 GMT+0000 (Coordinated Universal Time)
Total time:1.88s
Time executing code:1.83s
Other overhead on R server:1.62s
Time spent transferring data:0.04s
Data sent to R server:7KB
Data received from R server:17.6KB