This is the configuration component library for managing app data loading / saving
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
checkTables(tables)
Checks the table list to see if maximum application memory will be exceeded by retrieving the data
tables
List of tables to load from SAPI.
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
dataToSave
the name of the data.frame that will be saved to sapi.
list(keboolaModalButton)
getCleanData(types, cleanData)
Apply column types detected by LG to a data frame.
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.
data.frame supplied in cleanData parameter with applied data types.
getConvertedDataType(type, mode)
Convert LG type definition to an R data type.
type
LG data type string ('integer', 'datetime', etc.).
mode
LG variable mode ('continuous', 'discrete').
R data type name.
getDescription(appTitle, customElements, desc = NULL)
Method returns HTML content for a descriptor.
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.
TODO
getDescriptor()
Get results descriptor from SAPI
Nested list of elements.
getRecipeTables(options)
TODO
options
List of options to pass on to the loadTables method.
List of tables. each element has required name, and optional reducible.
initialize(sapiClient, appConfig, dbConnection, maxMemory = 5e+08,
session = getDefaultReactiveDomain())
Constructor.
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
prettyName
Table name to be used in labels throughout the app.
table
Name of table in SAPI.
data.frame with table data.
loadTables(tables, options = list(cleanData = FALSE, description = FALSE))
Load tables from SAPI.
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.
List of data indexed by variable name given in tables argument keys.
previewData(tableMeta)
Offers a limited view of sample data
tableMeta
The table object returned from SAPI
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
problemTables
A list of reducible tables that the UI will display as tabbed editors
A tabset panel with one tab per reducible table
processSection(section, level, customElements)
Internal method that returns HTML content for the given section node.
section
Node of the descriptor.
level
Heading level (1 = h2, 2 = h3).
customElements
Callback for processing custom elements.
List of HTML elements.
saveDataFormUI(dataToSave)
Get the UI elements for the data saving form
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
dataToSave
the name of the data.frame that will be saved to SAPI
The success or failure alert dom element
setMemoryUsage(tableMeta)
TODO
tableMeta
TODO
TODO
tableEditor(tableMeta)
TODO
tableMeta
TODO
TODO
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.