KeboolaAppData-class: This is the configuration component library for managing app...

Description Fields Methods

Description

This is the configuration component library for managing app data loading / saving

Fields

session
client

Storage API client.

db

Redshift driver connection.

bucket

Bucket Id.

runId

Run Id

lastSaveValue

TODO

lastTable

TODO

maxMemory

TODO

sourceData

TODO

memoryUsage

TODO

loadList

TODO

allLoaded

TODO

Methods

checkTables(tables)

Checks the table list to see if maximum application memory will be exceeded by retrieving the data

Parameters

  • tables List of tables to load from SAPI.

Return Value

If memory exceeded - a list of table metadata for each requested table, else NULL.

dataModalButton(dataToSave)

Method for the config button that opens the save data modal dialog

Parameters

  • dataToSave the name of the data.frame that will be saved to sapi.

Return Value

list(keboolaModalButton)

getCleanData(types, cleanData)

Apply column types detected by LG to a data frame.

Parameters

  • types Data frame with contents of table with LG datatypes (this table is usually named 'VAI__1' in SAPI).

  • cleanData A data frame with actual data, its columns are expected to be listed as rows in the types table.

Return Value

data.frame supplied in cleanData parameter with applied data types.

getConvertedDataType(type, mode)

Convert LG type definition to an R data type.

Parameters

  • type LG data type string ('integer', 'datetime', etc.).

  • mode LG variable mode ('continuous', 'discrete').

Return Value

R data type name.

getDescription(appTitle, customElements, desc = NULL)

Method returns HTML content for a descriptor.

Parameters

  • appTitle Title of the app.

  • customElements Callback for printing custom elements, signature: function(elementId, content) function should return a single HTML element. Pass NULL to ignore custom elements.

  • desc Descriptor contents. If NULL, then getDescriptor will be used.

Return Value

TODO

getDescriptor()

Get results descriptor from SAPI

Return Value

Nested list of elements.

getRecipeTables(options)

TODO

Parameters

  • options List of options to pass on to the loadTables method.

Return Value

List of tables. each element has required name, and optional reducible.

initialize(sapiClient, appConfig, dbConnection, maxMemory = 5e+08, session = getDefaultReactiveDomain())

Constructor.

Parameters

  • sapiClient Storage API client.

  • bucketId Bucket where config table is stored.

  • run_id The runId of the data to load.

  • dbConnection An established database connection.

  • maxMemory Maximum sourceData memory allocation.

loadTable(prettyName, table)

Internal method to retrieve table data from Redshift

Parameters

  • prettyName Table name to be used in labels throughout the app.

  • table Name of table in SAPI.

Return Value

data.frame with table data.

loadTables(tables, options = list(cleanData = FALSE, description = FALSE))

Load tables from SAPI.

Parameters

  • tables List of tables key as R variable, value as table name (without bucket).

  • options List with items: cleanData boolean TRUE to compute datatypes of cleanData table description boolean TRUE to include descriptor in returned dataSet.

Return Value

List of data indexed by variable name given in tables argument keys.

previewData(tableMeta)

Offers a limited view of sample data

Parameters

  • tableMeta The table object returned from SAPI

Return Value

reactive construct. updated DOM is stored in session$output

problemTablesUI(problemTables)

Creates and returns a UI for the user to reduce the amount of data being loaded to 'hopefully' under the memory limit

Parameters

  • problemTables A list of reducible tables that the UI will display as tabbed editors

Return Value

A tabset panel with one tab per reducible table

processSection(section, level, customElements)

Internal method that returns HTML content for the given section node.

Parameters

  • section Node of the descriptor.

  • level Heading level (1 = h2, 2 = h3).

  • customElements Callback for processing custom elements.

Return Value

List of HTML elements.

saveDataFormUI(dataToSave)

Get the UI elements for the data saving form

Return Value

List of html elements that make up the form.

saveResultUI(dataToSave)

This method attempts to save the data.frame given by dataToSave, and returns a UI element which alerts to the success or failure of the operation

Parameters

  • dataToSave the name of the data.frame that will be saved to SAPI

Return Value

The success or failure alert dom element

setMemoryUsage(tableMeta)

TODO

Parameters

  • tableMeta TODO

Return Value

TODO

tableEditor(tableMeta)

TODO

Parameters

  • tableMeta TODO

Return Value

TODO


keboola/shiny-lib documentation built on May 20, 2019, 8:34 a.m.