Namespace: table

firefly.util. table

Table utilities.

Source:

Methods


<static> cloneRequest(request, params)

create a deep clone of the given request.

create a deep clone of the given request. tbl_id is removed from the cloned request.

Parameters:
Name Type Description
request TableRequest

the original request to clone

params Object

additional parameters to add to the cloned request

Source:
Returns:
Type
TableRequest

<static> doFetchTable(tableRequest [, hlRowIdx])

tableRequest will be sent to the server as a json string.

tableRequest will be sent to the server as a json string.

Parameters:
Name Type Argument Description
tableRequest TableRequest

is a table request params object

hlRowIdx number <optional>

set the highlightedRow. default to startIdx.

Source:
Returns:
Type
Promise.<TableModel>

<static> doFetchTable(tableRequest [, hlRowIdx])

tableRequest will be sent to the server as a json string.

tableRequest will be sent to the server as a json string.

Parameters:
Name Type Argument Description
tableRequest TableRequest

is a table request params object

hlRowIdx number <optional>

set the highlightedRow. default to startIdx.

Source:
Returns:
Type
Promise.<TableModel>

<static> findGroupByTblId(tbl_id)

returns the table group name given a tbl_id.

returns the table group name given a tbl_id. it will return undefined if the given tbl_id is not in a group.

Parameters:
Name Type Description
tbl_id string

table id

Source:
Returns:
Type
TableGroup

<static> getActiveTableId(tbl_group)

return the tbl_id of the active table for the given group.

return the tbl_id of the active table for the given group.

Parameters:
Name Type Description
tbl_group string

group name; defaults to 'main' if not given.

Source:
Returns:
Type
string

<static> getAllColumns(tableModel)

returns all columns of the given table including hidden ones.

Parameters:
Name Type Description
tableModel TableModel
Source:
Returns:
Type
Array.<TableColumn>

<static> getCellValue(tableModel, rowIdx, colName)

Parameters:
Name Type Description
tableModel TableModel
rowIdx number
colName string
Source:
Returns:
Type
string

<static> getColumn(tableModel, ID)

returns column information for the given ID.

returns column information for the given ID.

Parameters:
Name Type Description
tableModel TableModel
ID string
Source:
Returns:
Type
TableColumn

<static> getColumn(tableModel, colName)

returns column information for the given name.

returns column information for the given name.

Parameters:
Name Type Description
tableModel TableModel
colName string
Source:
Returns:
Type
TableColumn

<static> getColumnIdx(tableModel, colName)

Returns the column index with the given name; otherwise, -1.

Returns the column index with the given name; otherwise, -1.

Parameters:
Name Type Description
tableModel TableModel
colName string
Source:
Returns:
Type
number

<static> getColumns(tableModel, type)

returns the non-hidden columns of the given table. If type is given, it will only return columns that match type.

Parameters:
Name Type Description
tableModel TableModel
type COL_TYPE

one of predefined COL_TYPE. defaults to 'ALL'.

Source:
Returns:
Type
Array.<TableColumn>

<static> getColumnValues(tableModel, colName)

returns an array of all the values for a column

.

returns an array of all the values for a column

Parameters:
Name Type Description
tableModel TableModel
colName string
Source:
Returns:
Type
Array.<Object>

<static> getRowValues(tableModel, rowIdx)

returns an array of all the values for a row

.

returns an array of all the values for a row

Parameters:
Name Type Description
tableModel TableModel
rowIdx number
Source:
Returns:
Type
Array.<Object>

<static> getSelectedData(tbl_id, columnNames)

returns an array of all the values for a columns

.

returns an array of all the values for a columns

Parameters:
Name Type Description
tbl_id string
columnNames Array.<string>

defaults to all columns

Source:
Returns:
Type
Promise.<TableModel>

<static> getTableGroup(tbl_group)

returns the table group information

.

returns the table group information

Parameters:
Name Type Description
tbl_group string

the group name to look for

Source:
Returns:
Type
TableGroup

<static> getTableSourceUrl(tbl_ui_id, params)

returns the url to download a snapshot of the current table data.

returns the url to download a snapshot of the current table data.

Parameters:
Name Type Description
tbl_ui_id string

UI id of the table

params object

supplement parameter setting such as the information for workspace

Source:
Returns:
Type
string

<static> getTableUiByTblId(tbl_id)

returns the first table working state for the given tbl_id

.

returns the first table working state for the given tbl_id

Parameters:
Name Type Description
tbl_id string
Source:
Returns:
Type
Object

<static> getTblById(tbl_id)

returns the table model with the given tbl_id

.

returns the table model with the given tbl_id

Parameters:
Name Type Description
tbl_id
Source:
Returns:
Type
TableModel

<static> getTblIdsByGroup(tbl_group_id)

returns an array of tbl_id for the given tbl_group_id

.

returns an array of tbl_id for the given tbl_group_id

Parameters:
Name Type Description
tbl_group_id string

table group name. defaults to 'main' if not given

Source:
Returns:

array of tbl_id

Type
Array.<String>

<static> getTblInfo(tableModel, aPageSize)

collects all available table information given the tableModel.

collects all available table information given the tableModel.

Parameters:
Name Type Description
tableModel TableModel
aPageSize number

use this pageSize instead of the one in the request.

Source:
Returns:
Type
Object

<static> getTblInfoById(tbl_id, aPageSize)

collects all available table information given the tbl_id

.

collects all available table information given the tbl_id

Parameters:
Name Type Description
tbl_id string
aPageSize number

use this pageSize instead of the one in the request.

Source:
Returns:
Type
Object

<static> getTblRowAsObj(tableModel [, rowIdx])

Return the row data as an object keyed by the column name

.

Return the row data as an object keyed by the column name

Parameters:
Name Type Argument Description
tableModel TableModel
rowIdx Number <optional>

= the index of the row to return, default to highlighted row

Source:
Returns:

the values of the row keyed by the column name

Type
Object.<String, String>

<static> makeFileRequest( [title], source [, alt_source] [, options])

Creates a table request for tabular data from a file or url.

Creates a table request for tabular data from a file or url. Source of file may be from a url or an absolute path on the server.

Parameters:
Name Type Argument Description
title string <optional>

title to display with this table.

source string

required; location of the ipac table. url or file path.

alt_source string <optional>

use this if source does not exists.

options TableRequest <optional>

more options. see TableRequest for details.

Source:
Returns:
Type
TableRequest

<static> makeIrsaCatalogRequest(title, project, catalog, params [, options])

creates the request to query IRSA catalogs.

creates the request to query IRSA catalogs.

Parameters:
Name Type Argument Description
title string

title to be displayed with this table result

project string
catalog string

the catalog name to search

params ConeParams | BoxParams | ElipParams

one of 'Cone','Eliptical','Box','Polygon','Table','AllSky'.

options TableRequest <optional>
Source:
Returns:
Type
TableRequest

<static> makeIrsaWorkspaceRequest(source [, title] [, options])

Creates a table request for tabular data from IRSA workspace.

Creates a table request for tabular data from IRSA workspace. Source should be an IRSA workspace path. i.e value returned from WorkspaceViewer

Parameters:
Name Type Argument Description
source string

required; IRSA workspace path.

title string <optional>

title to display with this table.

options TableRequest <optional>

more options. see TableRequest for details.

Source:
Returns:
Type
TableRequest

<static> makeTableFunctionRequest(searchRequest, id [, title] [, params] [, options])

create a request which will perform a function on the given searchRequest

.

create a request which will perform a function on the given searchRequest

Parameters:
Name Type Argument Description
searchRequest TableRequest

required. the table's request this function should operate on

id string

required. SearchProcessor ID.

title string <optional>

title to display with this table.

params object <optional>

the parameters to include with this request.

options TableRequest <optional>

more options. see TableRequest for details.

Source:
Returns:
Type
TableRequest

<static> makeTblRequest(id [, title] [, params] [, options])

Creates a table request object for the given id.

Creates a table request object for the given id.

Parameters:
Name Type Argument Description
id string

required. SearchProcessor ID.

title string <optional>

title to display with this table.

params object <optional>

the parameters to include with this request.

options TableRequest <optional>

more options. see TableRequest for details.

Source:
Returns:
Type
TableRequest

<static> onTableLoad(tbl_id)

return a promise of a tableModel for the given tbl_id.

return a promise of a tableModel for the given tbl_id.

Parameters:
Name Type Description
tbl_id string

the table ID to watch for.

Source:
Returns:
Type
Promise.<TableModel>

<static> smartMerge(target, source)

This function merges the source object into the target object by traversing and comparing every like path.

This function merges the source object into the target object by traversing and comparing every like path. If a value was merged at any data node in the data graph, the node and all of its parent nodes will be shallow cloned and returned. Otherwise, the target's value will be returned.

Parameters:
Name Type Description
target Object
source Object
Source:
Returns:
Type
Object

<static> sortTableData(tableData, columns, sortInfoStr)

sort table data in-place.

sort table data in-place.

Parameters:
Name Type Description
tableData TableData
columns Array.<TableColumn>
sortInfoStr string
Source:
Returns:
Type
TableData

<static> uniqueTblId()

create a unique table id (tbl_id)

.

create a unique table id (tbl_id)

Source:
Returns:
Type
string

<static> uniqueTblUiId()

create a unique table UI id (tbl_ui_id)

.

create a unique table UI id (tbl_ui_id)

Source:
Returns:
Type
string