index: number
isActive: boolean
isHidden: boolean
name: string
Inherited from Story.sheetType
url: string
Empty promise that resolves when the annotation is complete.
The following example shows how you might call this method using a MarkInfo object.
const markCollection = await worksheet.getSelectedMarksAsync();
const markToAnnotate = marksCollection.data[0].marksInfo[0];
await worksheet.annotateMarkAsync(markToAnnotate, 'Manufacturing line #2 shutdown triggered');
Unique identifier for newly inserted context menu item.
The field name that the filter is applied on.
The field name that the filter is applied on.
The field name that the filter is applied on.
The field name that the filter is applied on.
The following example shows how to apply a relative date filter from a worksheet.
worksheet.applyRelativeDateFilterAsync(
'Order Date',
{
anchorDate: new Date(Date.UTC(2022, 4, 13)),
periodType: PeriodType.Years,
rangeType: DateRangeType.LastN,
rangeN: 1,
}
);
Inherited from Story.changeSizeAsync
The field to clear filter on.
Empty promise that resolves when the selection has been cleared.
The following example assumes that you have some marks already selected in the worksheet. After it has run, you should have no marks selected, and you should see the console message. Use await
only inside an Async function
let vizActiveSheet = viz.workbook.activeSheet;
if (vizActiveSheet.sheetType === "worksheet") {
await vizActiveSheet.clearSelectedMarksAsync();
console.log('Your marks selection has been cleared!');
}
A list annotations in the worksheet.
The following example shows how you might call this method.
let annotations = await worksheet.getAnnotationsAsync();
console.log(annotations);
The primary data source and all of the secondary data sources for this worksheet. By convention the first data source in the array is the primary.
The following example shows how you might find a specific data source of a worksheet, using the getDataSourcesAsync()
method. You could then call the getLogicalTablesAsync()
method to get the logical tables in the data source, and then use the either the DataSource
or the Worksheet
to get the underlying table data.
Use await
only inside an Async function
let vizActiveSheet = viz.workbook.activeSheet;
if (vizActiveSheet.sheetType === "worksheet") {
let dataSources = await vizActiveSheet.getDataSourcesAsync();
console.log(dataSources[0].name);
let dataSource = dataSources.find(datasource => datasource.name === "Sample - Superstore");
}
A promise that resolves to the collection of filters used in this worksheet.
The marks that are selected.
Use await
only inside an Async function
let vizActiveSheet = viz.workbook.activeSheet;
if (vizActiveSheet.sheetType === "worksheet") {
let selectedMarks = await vizActiveSheet.getSelectedMarksAsync();
const dataTableName = selectedMarks.data[0];
}
The array of columns that describe the data in the worksheet.
A data table containing the summary data for the worksheet.
A data table reader to access the summary data for the worksheet.
Example showing the methods to get and use the summary data reader for all rows in a worksheet. Use await
only inside an Async function
let vizActiveSheet = viz.workbook.activeSheet;
if (vizActiveSheet.sheetType === "worksheet") {
const dataTableReader = await vizActiveSheet.getSummaryDataReaderAsync();
for (let currentPage = 0; currentPage < dataTableReader.pageCount; currentPage++) {
const dataTablePage = await dataTableReader.getPageAsync(currentPage);
}
await dataTableReader.releaseAsync();
}
A data table containing the underlying data for the worksheet.
You can use the GetUnderlyingDataOptions.maxRows
property to request the number of rows of data to return. If unspecified (maxRows == '0'), the call to getUnderlyingDataAsync
requests all rows in the data source. Note that the maximum number of rows returned from the getUnderlyingDataAsync()
method is limited to 10,000 rows. You can use the DataTable
property, isTotalRowCountLimited
, to test whether there is more data. A value of true indicates that the calling function requested more rows than the limit (10,000) and the underlying data source contains more rows than can be returned.
In the following example, the getUnderlyingDataAsync()
method is used to get the underlying data for a specific column in a workbook. Use await
only inside an Async function
let vizActiveSheet = viz.workbook.activeSheet;
if (vizActiveSheet.sheetType === "worksheet") {
let dataTable = await vizActiveSheet.getUnderlyingDataAsync();
let field = dataTable.columns.find(column => column.fieldName === "Sales");
let list = [];
for (let row of dataTable.data) {
list.push(row[field.index].value);
}
let values = list.filter((el, i, arr) => arr.indexOf(el) === i);
console.log(values);
}
A data table containing the underlying data for the given logical table id
You can use the getUnderlyingDataOptions.maxRows
property to request the number of rows of data to return. If unspecified (maxRows == '0'), the call to getUnderlyingTableDataAsync
requests all rows in the logical table. Note that the maximum number of rows returned from the getUnderlyingTableDataAsync()
method is limited to 10,000 rows. You can use the DataTable
property, isTotalRowCountLimited
, to test whether there is more data. A value of true indicates that the calling function requested more rows than the limit (10,000) and the underlying data source contains more rows than can be returned.
A data table reader to access the underlying data for the given logical table id.
The following example shows getting the first page of underlying data. Use await
only inside an Async function
let vizActiveSheet = viz.workbook.activeSheet;
if (vizActiveSheet.sheetType === "worksheet") {
const underlyingTablesData = await vizActiveSheet.getUnderlyingTablesAsync();
const logicalTableId = underlyingTablesData[0].id;
const dataTableReader = await vizActiveSheet.getUnderlyingTableDataReaderAsync(logicalTableId);
const page = await dataTableReader.getPageAsync(0);
await dataTableReader.releaseAsync();
}
An array of logical tables corresponding to the measures referenced by the worksheet. Use await
only inside an Async function
let vizActiveSheet = viz.workbook.activeSheet;
if (vizActiveSheet.sheetType === "worksheet") {
let underlyingTablesData = await vizActiveSheet.getUnderlyingTablesAsync();
let logicalTableId = underlyingTablesData[0].id;
let underlyingTableDataForId = await vizActiveSheet.getUnderlyingTableDataAsync(logicalTableId);
}
Promise containing the VisualSpecification
Empty promise that resolves when the annotation is removed.
The following example shows how you might call this method using an annotation object.
for (const annotation of annotations) {
await worksheet.removeAnnotationAsync(annotation);
}
Empty promise that resolves when the selection is complete.
The following example shows how you might call this method using state names as the SelectionCriteria
. The SelectionUpdateType
is replace (SelectionUpdateType.Replace
), so these values replace the marks that are currently selected.
worksheet.selectMarksByValueAsync([{
fieldName: 'State',
value: ['Texas', 'Washington', 'California']
}], SelectionUpdateType.Replace );
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4