Class RevealView

Used to create a new instance of the RevealView class. The main class used to render a dashboard in your application, it also allows the editing of existing dashboards or the creation from scratch.

Index

Constructors

Properties

Accessors

Methods

Constructors

  • Instantiates a new RevealView component and renders it in the specified target element.

    Parameters

    • target: string | Element

      Either a CSS selector string to find the DOM element, or a direct reference to the DOM element where the RevealView should be rendered. Exception is thrown if the element is not found or not present in the DOM.

    Returns RevealView

Properties

categoryGroupingSeparator: string | null = null

This property allows customization of the grouping separator that appears between the category and field name. The default character used is "/" (forward slash).

revealView.categoryGroupingSeparator = " - ";
defaultChartType: RVChartType = RVChartType.ColumnChart

This property allows the customization of the default visualization when a new visualization is created.

revealView.defaultChartType = RVChartType.ColumnChart;
defaultCustomChartType: string | null = null
onAssetRequested: ((args: RVAssetRequestedArgs) => RVAssetResult) | null = null

Event called when a datasource icon is needed. Using it, is the way to show your own icon for specific icon for datasources instead of the default ones. If this handler is not set, the default icons are used.

onConfigureCredentials:
    | (
        (
            dataSource: RVDashboardDataSource,
            callback: (success: boolean) => void,
        ) => void
    )
    | null = null

This event is triggered when Reveal is requesting credentials for a given data source. This is optional, as you can specify server side credentials for all your data sources, but if you don't know in advance credentials your users should use (for example if you want your users to enter their own credentials to the database) you can use this approach. Please note how credentials are requested and stored is something you need to do in your application, this event indicates credentials are needed, once the user entered credentials (or cancelled the flow) you must call the callback function received as a parameter, the function receives a boolean parameter that indicates if Reveal should try again (true) or the prompt was cancelled (false).

onDashboardChanged: ((args: DashboardChangedEventArgs) => void) | null = null

Event triggered when the dashboard property is set to a new instance of an RVDashboard. The event handler receives one argument:

  • args: An instance of DashboardChangedEventArgs which contains the old and new dashboards.

Remarks: If the dashboard property is set to null, a new dashboard is created automatically with a title "New Dashboard".

Example usage:

revealView.onDashboardChanged = function (args: DashboardChangedEventArgs) {
console.log('Dashboard has changed.');
console.log('Old Dashboard:', args.oldValue);
console.log('New Dashboard:', args.newValue);
};
onDashboardSelectorRequested:
    | ((args: DashboardSelectorRequestedEventArgs) => void)
    | null = null
onDataSourceSelectionDialogShowing:
    | ((args: DataSourceSelectionEventArgs) => void)
    | null = null

Event called when the list of data sources is about to be displayed, this is the way to show your own UI for the list of data sources instead of the default UI. If this handler is not installed Reveal will use the default dialog for selecting a data source.

onDataSourcesRequested:
    | (
        (
            callback: (datasources: RevealDataSources) => void,
            trigger: RVDataSourcesRequestedTriggerType,
        ) => void
    )
    | null = null

This event is triggered whenever the end user clicks on the 'Add visualization' button. You can create custom datasources to replace the default/existing ones. The argument is a callback function you're supposed to call and pass your custom collection of datasources which the end user will see.

revealView.onDataSourcesRequested = function (callback, trigger) {
if(trigger == RVDataSourcesRequestedTriggerType.Visualization){
var inMemoryDSI = new RVInMemoryDataSourceItem("employees");
inMemoryDSI.title = "My InMemory Title";
inMemoryDSI.description ="My InMemory Description";

var sqlDs = new RVSqlServerDataSource();
sqlDs.title = "Clients";
sqlDs.id = "SqlDataSource1";
sqlDs.host = "db.mycompany.local";
sqlDs.port = 1433;
sqlDs.database = "Invoices";

callback(new RevealDataSources([sqlDs], [inMemoryDSI], true));
}
};
onDateFilterMenuOpening: ((args: DateFilterMenuOpeningEventArgs) => void) | null = null
onEditModeEntered: ((args: EditModeEnteredArgs) => void) | null = null
onEditModeExited: ((args: EditModeExitedArgs) => void) | null = null
onFieldsInitializing: ((args: FieldsInitializingEventArgs) => void) | null = null

This event is triggered when entering the visualization editor after selecting your data source. With this event you can customize the list of fields shown in the editor by removing, renaming, or reordering fields.

revealView.onFieldsInitializing = function (args) {
var editedFields = args.fields;
// a example of how you can delete fields
// list of field names to be deleted
var exclude = ["Date", "Budget", "CTR", "Avg.CPC", "Avg. CPC", "Traffic"];
// deleted the fields
editedFields = editedFields.filter(f => !exclude.some(e => e == f.name));
//change name to show to Spend field to Spent
var fieldToChange = editedFields.find(f => f.name == "Spend");
if (fieldToChange) { fieldToChange.label = "Spent"; }
//change order
args.useCustomSort = true; //when set to true the fields are displayed in the same order as in args.fields
// if you want to re order only the first two positions
var newOrder = ["Organic %", "Spend"]; // change the order for the first two position,

//for this example spend will be in the first position and Organic in the second position,
//the rest of the fields will be kept in the order they had in args fields
newOrder.forEach(function (field) {
var moveFiled = editedFields.find(function (f) {
return f.name === field;
});
if (editedFields.indexOf(moveFiled) !== -1) {
editedFields.splice(editedFields.indexOf(moveFiled), 1);
editedFields.unshift(moveFiled);
}
});
args.fields = editedFields
}
onFilterValueChanged: ((args: FilterValueChangedEventArgs) => void) | null = null
onImageExported: ((image: Element) => void) | null = null

This event is triggered whenever the end user clicks the 'Export Image' button in the 'Export Image' popup after annotating the screenshot (optional).

Note: This feature relies on server-side image rendering, so you will need to enable in your .NET Core or Java Reveal server component.

revealView.onImageExported = function (img) {
console.log(img);
};
onLinkedDashboardProviderAsync:
    | (
        (dashboardId: string, linkTitle: string | null) => Promise<RVDashboard>
    )
    | null = null

Will be called when a linked dashboard is needed either if the user tries to follow a dashboard link or tries to create a dashboard link while editing.

Note: This callback is expected to return a Promise of an RVDashboard.

revealView.onLinkedDashboardProviderAsync = function (dashboardId, linkTitle) {
return RVDashboard.loadDashboardAsync(dashboardId);
};
onMaximizedVisualizationChanged: (() => void) | null = null

This event is triggered when the end user maximizes or minimizes a visualization. If the action is maximizing, the visualization the title of the maximized visualization can be retrieved via the maximizedVisualization property of the revealView object.

revealView.onMaximizedVisualizationChanged = function () {
maximizedVisualization = revealView.maximizedVisualization;
msg = "";
if (maximizedVisualization != null) {
msg = maximizedVisualization.title;
} else {
msg = "no current maximized visualization";
}
console.log("Maximized visualization changed! " + msg);
};
onMenuOpening:
    | (
        (
            visualization: RVVisualization | null,
            args: MenuOpeningEventArgs,
        ) => void
    )
    | null = null

This event is triggered when the overflow is clicked on the dashboard or visualization to expose the menu. Using this event, you can customize what is shown in that menu.

revealView.onMenuOpening = function (visualization, args) {
for (var i = 0; i < args.menuItems.length; i++)
{
if (i == 2)
{
args.menuItems[i].isHidden = true;
}
if (args.menuItems[i].title === "Edit")
{
args.menuItems[i].title = "Edit Mode";
}
}

var icon = new RVImage("https://svgsilh.com/png-512/1088490.png", "Icon");
args.menuItems.push(new RVMenuItem("Cool Menu Item", icon, () => { alert('Example'); }));
}
onSave: ((rv: RevealView, saveEvent: DashboardSaveEventArgs) => void) | null = null

This event is triggered when the end user clicks 'Save' or 'Save As'. However, if this event is set in RevealView then the callback server side (SaveDashboardAsync) will not be called, and the application will handle how the dashboard is saved, for example by implementing its own controller server side.

revealView.onSave = function (rv, saveEvent) {
if (saveEvent.saveAs) {
var newName = prompt("Save as", dashboardId);
if (!newName) return;
saveEvent.serializeWithNewName(newName,
function (b) {
saveDashboard(newName, b, saveEvent);
});
} else {
saveEvent.serialize(
function (b) {
saveDashboard(dashboardId, b, saveEvent);
});
}
};
onTooltipShowing: ((args: TooltipShowingEventArgs) => void) | null = null

Event fired when the user hover over a visualization and a tooltip is about to show up.

  • 
    
  • revealView.onTooltipShowing = function (args) { *{
  • var vizTitle = args.Visualization.Title;
  • if(vizTitle == "noNeedForTooltipsHere")
  • {
  •    args.Cancel = true;
    
  • } *} *```
onUrlLinkRequested: ((args: UrlLinkRequestedArgs) => string | null) | null = null

Will be called when a url is needed if the user tries to follow a dashboard link. If this method is not provided, the link defined in the dashboard will be used. Note: This callback is expected to return the modified url. If the return value is null or empty, then the navigation is cancelled.

revealView.onUrlLinkRequested = function (args) {
return args.url + "&modfiedUrl=true";
};
onVisualizationDataLoading:
    | ((args: VisualizationDataLoadingEventArgs) => void)
    | null = null

This event triggered when a visualization is about to request data, the event can be canceled if showing data for the visualization is not allowed. Using the args parameter you could cancel the data request by setting args.cancel to true and set the message to be displayed to the end user by setting cancel.errorMessage. See VisualizationDataLoadingEventArgs.

JavaScript:

revealView.onVisualizationDataLoading = function (args) {
if(!hasAccess(args.visualization)){
args.cancel = true;
args.errorMessage = "You don't have access to this data";
}
};

TypeScript:

    revealView.onVisualizationDataLoading = (args:Reveal.VisualizationDataLoadingEventArgs) => 
{
if(!hasAccess(args.visualization)){
args.cancel = true;
args.errorMessage = "You don't have access to this data";
}
}
onVisualizationDataPointClicked:
    | (
        (visualization: RVVisualization, cell: RVCell, row: RVCell[]) => void
    )
    | null = null

This event is triggered whenever the end user clicks on a data point over a maximized visualization and not in edit mode.

revealView.onVisualizationDataPointClicked = function (visualization, cell, row) {
console.log("Visualization Data Point Clicked");
console.log(visualization.title);
console.log(cell.columnLabel);
console.log(cell.value);
console.log(cell.formattedValue);
console.log("First cell in the row has label:" + row[0].columnLabel)
}
onVisualizationEditorClosed:
    | ((args: VisualizationEditorClosedEventArgs) => void)
    | null = null

Event triggered when the visualization editor is closed. Using the args parameter you could check if this is a brand new visualization or the user edited an existing one. The isCancelled flag can be used to determine whether the changes were applied or discarded. The isCancelled is true when the later is true.

revealView.onVisualizationEditorClosed = function (args) {
if(args.isNewVisualization == false) {
}
};
onVisualizationEditorClosing:
    | ((args: VisualizationEditorClosingArgs) => void)
    | null = null

This event is triggered when the end user clicks on cancel("x") button upon editing/creating a visualization. Using the args parameter you could check if this is a brand new visualization or the user is editing an existing one. You could also cancel the process of exiting edit mode by setting args.cancel to true.

revealView.onVisualizationEditorClosing = function (args) {
if(args.isNewVisualization == false){ //the user is editing
args.resetVisualization = true; //puts the widget to the state when it was when the user started editing it
}
};
onVisualizationEditorOpened:
    | ((args: VisualizationEditorOpenedEventArgs) => void)
    | null = null

Event triggered when the visualization editor is opened. Using the args parameter you could check if this is a brand new visualization or the user is editing an existing one.

revealView.onVisualizationEditorOpened = function (args) {
if(args.isNewVisualization == false) { //the user is editing an existing visualization
}
};
onVisualizationEditorOpening:
    | ((args: VisualizationEditorOpeningArgs) => void)
    | null = null

This event is triggered whenever the end user is trying to open the editor for a visualization. Using the args parameter you could check if this is a brand new visualization or the user is trying to edit an existing one. You could also cancel the process of entering the editor by setting args.cancel to true.

  revealView.onVisualizationEditorOpening = function (args) {
if(args.isNewVisualization == false){
//the user is trying to edit an existing visualization
args.cancel = true; //prevent it
}
};
onVisualizationSeriesColorAssigning:
    | (
        (
            visualization: RVVisualization,
            defaultColor: string,
            fieldName: string | null,
            categoryName: string | null,
        ) => string
    )
    | null = null

This event is triggered when the chart visualization loads and is in the process of creating each series. With this event you can customize the color used for the series.

revealView.onVisualizationSeriesColorAssigning = function (visualization, defaultColor, fieldName, categoryName) {
console.log("Visualization is creating a series");
console.log(visualization.title);
console.log(fieldName);
console.log(categoryName);
return defaultColor;
}
getCurrentTheme: () => RevealTheme = ...

Returns the currently applied theme.

This method is deprecated. Use RevealSdkSettings.theme property to get/set current theme.

Accessors

  • get canAddCalculatedFields(): boolean

    A flag indicating if new (calculated) fields can be added to the list of fields.

    Returns boolean

    true
    
  • set canAddCalculatedFields(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get canAddDashboardFilter(): boolean

    A flag that indicates if the end user will be allowed to create dashboard filters.

    Returns boolean

    true
    
  • set canAddDashboardFilter(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get canAddDateFilter(): boolean

    A flag that indicates if the end user will be allowed to create date filter.

    Returns boolean

    true
    
  • set canAddDateFilter(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get canAddPostCalculatedFields(): boolean

    A flag indicating if the f(x) option in numeric values sections (like "Values") should be displayed or not.

    Returns boolean

    true
    
  • set canAddPostCalculatedFields(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get canAddVisualization(): boolean

    A flag that indicates if new visualizations can be added when the dashboard is edited.

    Returns boolean

    true
    
  • set canAddVisualization(canAddVisualization: boolean): void

    Parameters

    • canAddVisualization: boolean

    Returns void

  • get canChangeVisualizationBackgroundColor(): boolean

    A flag indicating if the end-user can change the background color for a given visualization in the visualization editor (under Settings tab), if enabled the list of colors specified via RevealTheme.backgroundColors will be displayed as a suggested palette, but the user can also use an advanced mode to select any color. In the future, this property will be removed and the background color setting will be automatically visible in the visualization editor settings.

    Returns boolean

    true
    
  • set canChangeVisualizationBackgroundColor(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get canCopyVisualization(): boolean

    A flag that indicates if the "Copy" option is available in the menu for a visualization.

    Returns boolean

    true
    
  • set canCopyVisualization(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get canDuplicateVisualization(): boolean

    A flag that indicates if the "Duplicate" option is available in the menu for a visualization.

    Returns boolean

    true
    
  • set canDuplicateVisualization(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get canEdit(): boolean

    A flag indicating if the user can switch to edit mode or not.

    Returns boolean

    true
    
  • set canEdit(canEdit: boolean): void

    Parameters

    • canEdit: boolean

    Returns void

  • get canMaximizeVisualization(): boolean

    A flag that indicates if the maximize visualization would be visible and the user would be able to maximize visualizations.

    Returns boolean

    true
    
  • set canMaximizeVisualization(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get canSaveAs(): boolean

    A flag indicating if the user can 'Save as' the dashboard.

    Returns boolean

    true
    
  • set canSaveAs(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get chartTypes(): RVChartTypeItem[]

    The list of available chart types for the end user to select from. Please note this only affects the list of visualizations to pick from, if a given dashboard is using a visualization not listed here, that visualization will be used anyway. The list is initially populated with all supported visualization types, so you can just remove the ones you would like to get excluded. Please note that RVChartType.Pivot and RVChartType.Image are used as the initial chart type for a new visualization (depending on the source selected) regardless if those types are not included in this list.

    Returns RVChartTypeItem[]

  • set chartTypes(v: RVChartTypeItem[]): void

    Parameters

    Returns void

  • get crosshairsEnabled(): boolean

    A flag indicating if crosshairs are displayed for charts.

    Returns boolean

    false
    
  • set crosshairsEnabled(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • set exportMode(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get hoverTooltipsEnabled(): boolean

    A flag indicating if tooltips are displayed on hover for chart visualizations.

    Returns boolean

    true
    
  • set hoverTooltipsEnabled(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get interactiveFilteringEnabled(): boolean

    A flag indicating if interactive filtering is enabled.

    Returns boolean

    false
    
  • set interactiveFilteringEnabled(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get isPreviewDataInVisualizationEditorEnabled(): boolean

    In Dashboard Editor, indicates if a small set of data should be displayed as tooltip when moving the mouse over a field.

    Returns boolean

  • set isPreviewDataInVisualizationEditorEnabled(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get serverSideSave(): boolean

    A flag indicating if server side saving is enabled.

    Returns boolean

    true
    
  • set serverSideSave(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showBreadcrumb(): boolean

    Gets the visibility status of the drill down breadcrumb.

    Returns boolean

    • true if the breadcrumb is visible, false otherwise. Default is true.
  • set showBreadcrumb(v: boolean): void

    Sets the visibility of the drill down breadcrumb.

    Parameters

    • v: boolean

      If true, the breadcrumb will be shown; if false, it will be hidden.

    Returns void

  • get showBreadcrumbDashboardTitle(): boolean

    Gets the visibility status of the dashboard title in the breadcrumb when the visualization is maximized.

    Returns boolean

    • true if the dashboard title in the breadcrumb is visible when maximized, false otherwise. Default is false.
  • set showBreadcrumbDashboardTitle(v: boolean): void

    Sets the visibility of the Dashboard title in the breadcrumb when the visualization is maximized.

    Parameters

    • v: boolean

      If true, the Dashboard title in the breadcrumb will be shown when maximized; if false, it will be hidden.

    Returns void

  • get showCancel(): boolean

    A flag indicating if the cancel button should be displayed or not.

    Returns boolean

    true
    
  • set showCancel(showCancel: boolean): void

    Parameters

    • showCancel: boolean

    Returns void

  • get showChangeDataSource(): boolean

    A flag that indicates if the "Change data source" button should be displayed or not.

    Returns boolean

    true
    
  • set showChangeDataSource(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showChangeVisualization(): boolean

    A flag indicating if the button to change visualization should be available or not, this button is used to switch to another visualization type (for example from Bar to Column chart) without entering edit mode.

    Returns boolean

    true
    
  • set showChangeVisualization(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showDataBlending(): boolean

    A flag indicating if the button "Add fields from another data source" (in the visualization editor) should be available or not.

    Returns boolean

    true
    
  • set showDataBlending(showDataBlending: boolean): void

    Parameters

    • showDataBlending: boolean

    Returns void

  • get showDataSourceSelectionDialogSearch(): boolean

    A flag indicating if the data source selection dialog (displayed when creating a new visualization) includes a search box on top to search for data sources.

    Returns boolean

    false
    
  • set showDataSourceSelectionDialogSearch(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showDateFilterMenu(): boolean

    A flag indicating whether to display the dropdown for date filters

    Returns boolean

    true
    
  • set showDateFilterMenu(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showDescription(): boolean

    A flag indicating if the Dashboard's description should be displayed.

    Returns boolean

    true
    
  • set showDescription(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showEditDataSource(): boolean

    A flag that indicates if the edit button for a datasource in the visualization editor should be displayed or not.

    Returns boolean

    false
    
  • set showEditDataSource(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showExportImage(): boolean

    A flag indicating if the export image action is available or not.

    Returns boolean

    true
    
  • set showExportImage(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showExportToCsv(): boolean

    A flag indicating if the export to CSV action is available or not.

    Returns boolean

    true
    
  • set showExportToCsv(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showExportToExcel(): boolean

    A flag indicating if the export to Excel action is available or not.

    Returns boolean

    true
    
  • set showExportToExcel(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showExportToPDF(): boolean

    A flag indicating if the export to PDF action is available or not.

    Returns boolean

    true
    
  • set showExportToPDF(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showExportToPowerPoint(): boolean

    A flag indicating if the export to PowerPoint action is available or not.

    Returns boolean

    false
    
  • set showExportToPowerPoint(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showFilters(): boolean

    A flag that allows the dashboard filters panel to be hidden. This is useful if you want to limit the selected values for the filters to the initial selection specified in the dashboard object. Once the RevealView is created and rendered you can use RVDashboard.filters or RVDashboard.dateFilter to change the selection for a given filter, so you can keep the selected values synced with your app.

    Returns boolean

    true
    
  • set showFilters(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showHeader(): boolean

    A flag that indicates if dashboard header will be rendered. Please note that if you hide the header bar UI controls to save, save as, export wont be available for the end user.

    Returns boolean

    true
    
  • set showHeader(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showMachineLearningModelsIntegration(): boolean

    A flag indicating if the button "Add fields from a Machine Learning model" (in the visualization editor) should be available or not.

    Returns boolean

    false
    
  • set showMachineLearningModelsIntegration(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showMenu(): boolean

    A flag that indicates if the menu (containing Refresh, Export, etc.) should be displayed or not.

    Returns boolean

    true
    
  • set showMenu(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showRefresh(): boolean

    A flag that indicates if the Refresh action should be available or not.

    Returns boolean

    true
    
  • set showRefresh(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showSave(): boolean

    A flag indicating if the save button should be displayed or not.

    Returns boolean

    true
    
  • set showSave(showSave: boolean): void

    Parameters

    • showSave: boolean

    Returns void

  • get showStatisticalFunctions(): boolean

    A flag indicating if the menu to apply statistical functions (forecasting, etc.) is available or not.

    Returns boolean

    true
    
  • set showStatisticalFunctions(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showTitle(): boolean

    A flag indicating if the Dashboard's title should be displayed.

    Returns boolean

    true
    
  • set showTitle(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get showToolbar(): boolean

    Gets the visibility of the chart toolbar.

    Returns boolean

    • Returns true if the toolbar is visible on hover; false otherwise. Default is false.
  • set showToolbar(v: boolean): void

    Sets the visibility of the chart toolbar.

    Parameters

    • v: boolean

      If true, the chart's toolbar will be shown; if false, it will be hidden.

    Returns void

  • get showVisualizationFilters(): boolean

    A flag that allows the visualization filters panel to be hidden. This is useful if you want to limit the selected values for the filters to the initial selection. Once the RevealView is created and rendered you can use RVVisualizationFilter.filters to change the selection for a given filter, so you can keep the selected values synced with your app.

    Returns boolean

    true
    
  • set showVisualizationFilters(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get singleVisualizationMode(): boolean

    Single visualization mode is used to show a single visualization at a time. You can control the initial visualization to maximize using the maximizedVisualization property. If no initial visualization is configured to be maximized the first one will be maximized initially. You can use maximizedVisualization to change the maximized one once the dashboard is visible.

    Returns boolean

    true
    
  • set singleVisualizationMode(v: boolean): void

    Parameters

    • v: boolean

    Returns void

  • get startInEditMode(): boolean

    A flag indicating the view should start in edit mode instead of the default view mode.

    Returns boolean

    false
    
  • set startInEditMode(startInEditMode: boolean): void

    Parameters

    • startInEditMode: boolean

    Returns void

  • get startWithNewVisualization(): boolean

    A flag indicating the new visualization dialog should be displayed automatically when this view is presented. This setting requires startInEditMode set to true.

    Returns boolean

    false
    
  • set startWithNewVisualization(v: boolean): void

    Parameters

    • v: boolean

    Returns void

Methods

  • Returns void

  • Parameters

    • applyChanges: boolean

    Returns boolean

  • Returns ((dashboardId: string, linkTitle: string | null) => Promise<RVDashboard>) | null

  • Used to maximize a visualization once the Reveal View was initialized and rendered. It might be used to sync the currently displayed visualization with a feature in the containing app, like displaying 'Sales by Country' along a Sales report.

    Parameters

    • visualization: RVVisualization

      the visualization to be maximized, an object obtained from the dashboard with methods like visualizations()[index] or getVisualizationByTitle(title).

      You could find the visualization you want to maximize using getById or getByTitle methods like:

      let viz = dashboard.visualizations.getByTitle("MyVizTitle")
      let viz = dashboard.visualizations.getById("TargetVizId")

    Returns boolean

    true if the given visualization was found in the dashboard and maximized properly, false otherwise.

  • Used to restore the currently maximized visualization to the original state, so the whole dashboard is visible.

    Returns boolean

    true if there was a maximized visualization, which was minimized, false otherwise.

  • Method used to programmatically refresh the dashboard data, equivalent to execute the 'Refresh' action in the dashboard menu.

    Returns void

  • Makes sure the current theme specified in RevealSdkSettings.theme is applied. This involves re-loading of the currently displayed dashboard, so any state like pending edits, maximized visualization, filters selection changes will be reset and lost.

    Returns void

  • Serializes the current dashboard to a byte array

    Returns Promise<Uint8Array<ArrayBufferLike>>

  • Serializes the current dashboard to a byte array

    Parameters

    • name: string

    Returns Promise<Uint8Array<ArrayBufferLike>>

  • Serializes the current dashboard to a byte array

    Parameters

    • callback: (data: Uint8Array) => void
    • errorCallback: (error: any) => void

    Returns void

  • Parameters

    • name: string

    Returns Promise<Uint8Array<ArrayBufferLike>>

    Serializes the current dashboard in an '.rdash' format to a byte array, the title of the dashboard is changed to match the specified name.

    Please use the serialize method, as this method will be removed in a future release.

  • Parameters

    • name: string
    • callback: (data: Uint8Array) => void
    • errorCallback: (error: any) => void

    Returns void

    Serializes the current dashboard in an '.rdash' format to a byte array, the title of the dashboard is changed to match the specified name.

    Please use the serialize method, as this method will be removed in a future release.

  • Set the background color for the given visualization, color is specified in hex format, like "#ffffff".

    Parameters

    Returns void

  • Creates a screenshot of the revealView.

    Note: This feature relies on server-side image rendering so you will need to enable in your .NET Core or Java Reveal server component.

    Returns Promise<Element | null>

  • Creates a screenshot of the revealView.

    Note: This feature relies on server-side image rendering so you will need to enable in your .NET Core or Java Reveal server component.

    Parameters

    • gotImageCallback: (el: Element | null) => void

      A callback that will be invoked when the image is ready. The image will be passed as a param to the callback.

      revealView.toImage(function (img) {
      img.removeAttribute("style");
      body.innerHTML = "";
      body.appendChild(img);
      });

    Returns void

  • This method is used to indicate the size of the container has changed and RevealView must re-layout its contents.

    Returns void

  • Returns a new RevealView(selector). This is the recommended way to create a RevealView: it waits for any in-flight locale activation (started by RevealSdkSettings.overrideLocale or by the automatic browser-locale detection) to finish before constructing the view, so the correct locale strings are in place when the dashboard first renders.

    Note: the wait never rejects — if a locale fails to load or is superseded by a newer activation request, the method still resolves (using whatever locale is active at that point) rather than throwing.

    Parameters

    • target: string | Element

      Either a CSS selector string to find the DOM element, or a direct reference to the DOM element where the RevealView should be rendered. Exception is thrown if the element is not found or not present in the DOM.

    • Optionaldashboard: string | RVDashboard

      Optional dashboard to assign to the RevealView after it is created. Can be either an RVDashboard object or a string representing a dashboard ID/path to load.

    Returns Promise<RevealView>

    A Promise that resolves to the initialized RevealView instance once any in-flight locale activation has settled.

  • This method calls RevealUtility.loadDashboardFromContainer that loads a dashboard from the Blob object with the contents of an .rdash file.

    Parameters

    • b: Blob
    • selector: string

    Returns Promise<RevealView>

  • This method calls RevealUtility.loadDashboardFromContainer that loads a dashboard from the Blob object with the contents of an .rdash file.

    Parameters

    • b: Blob
    • selector: string
    • successCallback: (revealView: RevealView) => void
    • errorCallback: any

    Returns void

  • Overrides built in Reveal Theme settings. This method will not affect RevealView instances already rendered.

    Parameters

    Returns void

    This method is deprecated. Use RevealSdkSettings.theme property to get/set current theme.