Dashboard component
Embed a saved dashboard with Dashboard, read its state through selectors, dispatch commands, handle events, configure behavior, and access its store externally.
alpha
or beta level can have breaking changes in future releases.The Dashboard component renders dashboards created and saved in GoodData Cloud or GoodData.CN.
The Dashboard component:
- Allows you to embed a dashboard natively in React (similarly to InsightView for visualizations)
- Provides mechanisms to allow you to integrate it with the rest of your application
- Allows you to customize the way the dashboard is rendered: you can alter the layout and change the way particular widgets are rendered
To customize the alert and scheduled email dialogs the dashboard opens — replace them, override one region, decorate the data they read, or compose them from blocks — see Customize the alert and scheduled email dialogs.
The Dashboard component is built using an architecture resembling the Model-View-Controller pattern:
The Model part is implemented with Redux and Redux-Saga. The Model part exposes rich APIs: selectors to get data from the component’s state, events to describe changes, interactions with the dashboard, and commands to trigger changes.
The View and Controller parts are implemented using React components and hooks. The top-level Dashboard component also has rich APIs: props to specify a dashboard to render, configuration for rendering, customization of almost all view components used on a dashboard, and integration with the eventing.
Basic usage
import "@gooddata/sdk-ui-dashboard/styles/css/main.css";
import { Dashboard } from "@gooddata/sdk-ui-dashboard";
import { idRef } from "@gooddata/sdk-model";
const dashboardRef = idRef("<dashboard-identifier>");
export const EmbeddedReactDashboard = () => {
return <Dashboard dashboard={dashboardRef} />;
};
Selectors
To obtain the values of the current state of the Dashboard component, use the useDashboardSelector hook with a relevant selector passed to
it (all dashboard selectors start with the select prefix). The selectors have a cache, so the reference equality of
the returned value should remain the same (unless the value itself changed), which is useful to avoid unnecessary React re-renders.
import { useDashboardSelector, selectInsights } from "@gooddata/sdk-ui-dashboard";
const CustomDashboardWidget = () => {
// Example of how to obtain all visualizations stored on the dashboard
const visualizations = useDashboardSelector(selectInsights);
return <pre>{JSON.stringify(visualizations, null, 2)}</pre>;
};
All selectors are listed in the API reference.
For the selectors plugins use most, parameterized selectors, and reading state from event handlers, see useDashboardSelector.
Commands
Commands are Redux actions that you can dispatch to the Dashboard component to initiate a change of the rendered dashboard.
To dispatch a command, use the useDispatchDashboardCommand hook.
As the Dashboard component handles a command, it emits one or more events describing what has happened.
Typically, at least one event describing the accomplished result will be emitted.
The events emitted during command handling will be sent to all handlers added for the respective event type. To allow for request-response semantics, each command can specify a custom correlation ID that will be included in all events emitted during the command processing.
import { idRef, newPositiveAttributeFilter } from "@gooddata/sdk-model";
import { changeFilterContextSelectionByParams, useDispatchDashboardCommand } from "@gooddata/sdk-ui-dashboard";
const updatedFilters = [newPositiveAttributeFilter(idRef("<label-id>", "displayForm"), { values: ["West"] })];
export const CustomDashboardWidget = () => {
const changeFiltersSelection = useDispatchDashboardCommand(changeFilterContextSelectionByParams);
const correlationId = "triggeredByCustomDashboardWidget";
return (
<button
onClick={() =>
changeFiltersSelection({ filters: updatedFilters, resetOthers: false, correlationId })
}
>
Change filters
</button>
);
};
All commands
Every published command, sorted by command type so the commands of one area sit together. “Create with” lists
the functions that build the command; pass one of them to useDispatchDashboardCommand. The list is generated
from the SDK with each build. The DashboardCommands
union in the API reference is the same set as a type, plus the @alpha commands this page leaves out.
| Command | Create with | Description |
|---|---|---|
ICreateAlert BetaGDC.DASH/CMD.ALERT.CREATE | createAlert() | Creates alert. |
ISaveAlert BetaGDC.DASH/CMD.ALERT.SAVE | saveAlert() | Saves alert. |
ISetDashboardAttributeFilterSelectionType AlphaGDC.DASH/CMD.ATTRIBUTE_FILTER_CONFIG.SET_AVAILABLE_MODE | setDashboardAttributeFilterSelectionType() | Command for changing attribute filter available mode. |
ISetDashboardAttributeFilterConfigDisplayAsLabel AlphaGDC.DASH/CMD.ATTRIBUTE_FILTER_CONFIG.SET_DISPLAY_AS_LABEL | setDashboardAttributeFilterConfigDisplayAsLabel() | Command for changing attribute filter mode. |
ISetAttributeFilterLimitingItems AlphaGDC.DASH/CMD.ATTRIBUTE_FILTER_CONFIG.SET_LIMITING_ITEMS | setAttributeFilterLimitingItems() | Command for changing of attribute filter limiting items. |
ISetDashboardAttributeFilterConfigMode AlphaGDC.DASH/CMD.ATTRIBUTE_FILTER_CONFIG.SET_MODE | setDashboardAttributeFilterConfigMode() | Command for changing attribute filter mode. |
IAttributeHierarchyModified BetaGDC.DASH/CMD.ATTRIBUTE_HIERARCHY_MODIFIED | attributeHierarchyModified() | Creates the AttributeHierarchyModified command , dispatching this command will result on reset of catalog. |
IInitializeAutomations BetaGDC.DASH/CMD.AUTOMATIONS.INITIALIZE | initializeAutomations() | Initialize dashboard automations by loading essential data such as notification channels. |
IRefreshAutomations BetaGDC.DASH/CMD.AUTOMATIONS.REFRESH | refreshAutomations() | Refresh the current dashboard’s automation data. |
IChangeDashboardDefinition AlphaGDC.DASH/CMD.CHANGE_DEFINITION | changeDashboardDefinition() | Command for updating the dashboard definition in-place without re-initializing the dashboard component. |
IChangeDashboardDensity AlphaGDC.DASH/CMD.CHANGE_DENSITY | changeDashboardDensity() | Creates the ChangeDashboardDensity command. |
IChangeIgnoreExecutionTimestamp AlphaGDC.DASH/CMD.CHANGE_IGNORE_EXECUTION_TIMESTAMP | changeIgnoreExecutionTimestamp() | Command for changing the ignore logic of execution timestamp. |
IChangeRenderMode BetaGDC.DASH/CMD.CHANGE_RENDER_MODE | cancelEditRenderMode(), changeRenderMode(), switchToEditRenderMode() | Creates the ChangeRenderMode command for cancel edit mode. |
IChangeDashboardTimezoneOverride AlphaGDC.DASH/CMD.CHANGE_TIMEZONE_OVERRIDE | changeDashboardTimezoneOverride() | Creates the ChangeDashboardTimezoneOverride command. |
ISetDashboardDateFilterConfigMode AlphaGDC.DASH/CMD.DATE_FILTER_CONFIG.SET_MODE | setDashboardDateFilterConfigMode() | A command that set the mode of a date filter configuration in a dashboard. |
ISetDateFilterConfigTitle BetaGDC.DASH/CMD.DATE_FILTER_CONFIG.SET_TITLE | setDateFilterConfigTitle() | Command for changing date filter title. |
ISetDashboardDateFilterWithDimensionConfigMode AlphaGDC.DASH/CMD.DATE_FILTER_WITH_DIMENSION_CONFIG.SET_MODE | setDashboardDateFilterWithDimensionConfigMode() | Command for changing date filter mode. |
IDeleteDashboard BetaGDC.DASH/CMD.DELETE | deleteDashboard() | Creates the DeleteDashboard command. |
IDrill AlphaGDC.DASH/CMD.DRILL | drill() | Creates the IDrill command. |
IAddDrillTargets AlphaGDC.DASH/CMD.DRILL_TARGETS.ADD | addDrillTargets() | Add widget drill targets |
ICrossFiltering BetaGDC.DASH/CMD.DRILL.CROSS_FILTERING | crossFiltering() | Creates the ICrossFiltering command. |
IDrillDown AlphaGDC.DASH/CMD.DRILL.DRILL_DOWN | drillDown() | Creates the IDrillDown command. |
IDrillToAttributeUrl AlphaGDC.DASH/CMD.DRILL.DRILL_TO_ATTRIBUTE_URL | drillToAttributeUrl() | Creates the IDrillToAttributeUrl command. |
IDrillToCustomUrl AlphaGDC.DASH/CMD.DRILL.DRILL_TO_CUSTOM_URL | drillToCustomUrl() | Creates the IDrillToCustomUrl command. |
IDrillToDashboard AlphaGDC.DASH/CMD.DRILL.DRILL_TO_DASHBOARD | drillToDashboard() | Creates the IDrillToDashboard command. |
IDrillToInsight AlphaGDC.DASH/CMD.DRILL.DRILL_TO_INSIGHT | drillToInsight() | Creates the IDrillToInsight command. |
IDrillToLegacyDashboard AlphaGDC.DASH/CMD.DRILL.DRILL_TO_LEGACY_DASHBOARD | drillToLegacyDashboard() | Creates the IDrillToLegacyDashboard command. |
IChangeDrillableItems AlphaGDC.DASH/CMD.DRILL.DRILLABLE_ITEMS.CHANGE | changeDrillableItems() | Creates the IChangeDrillableItems command. |
IKeyDriverAnalysis BetaGDC.DASH/CMD.DRILL.KEY_DRIVER_ANALYSIS | keyDriverAnalysis() | Creates the IKeyDriverAnalysis command. |
ITriggerEvent BetaGDC.DASH/CMD.EVENT.TRIGGER | triggerEvent() | Triggers an event. |
IUpsertExecutionResult BetaGDC.DASH/CMD.EXECUTION_RESULT.UPSERT | setExecutionResultData(), setExecutionResultError(), setExecutionResultErrorWithResult(), setExecutionResultLoading() | Triggers an event. |
IExportDashboardToExcel BetaGDC.DASH/CMD.EXPORT.EXCEL | exportDashboardToExcel() | Creates the IExportDashboardToExcel command. |
IExportDashboardToPdf BetaGDC.DASH/CMD.EXPORT.PDF | exportDashboardToPdf() | Creates the IExportDashboardToPdf command. |
IExportDashboardToPdfPresentation BetaGDC.DASH/CMD.EXPORT.PDF_PRESENTATION | exportDashboardToPdfPresentation() | Creates the IExportDashboardToPdfPresentation command. |
IExportDashboardToPptPresentation BetaGDC.DASH/CMD.EXPORT.PPT_PRESENTATION | exportDashboardToPptPresentation() | Creates the IExportDashboardToPptPresentation command. |
IApplyFilterContextWorkingSelection AlphaGDC.DASH/CMD.FILTER_CONTEXT.APPLY_WORKING_SELECTION | applyFilterContextWorkingSelection() | Command for applying all working filters and working parameter values staged for application. |
ReplaceAttributeFilterItemSelectionGDC.DASH/CMD.FILTER_CONTEXT.ATTRIBUTE_FILTER_ITEM.REPLACE_SELECTION | applyAttributeFilter() | Command for replacing an attribute filter item’s selection. |
IAddAttributeFilter BetaGDC.DASH/CMD.FILTER_CONTEXT.ATTRIBUTE_FILTER.ADD | addAttributeFilter() | Creates the AddAttributeFilter command. |
ChangeAttributeFilterSelectionGDC.DASH/CMD.FILTER_CONTEXT.ATTRIBUTE_FILTER.CHANGE_SELECTION | applyAttributeFilter(), changeAttributeFilterSelection(), changeWorkingAttributeFilterSelection(), resetAttributeFilterSelection() | Command for attribute filter selection change. |
IMoveAttributeFilter BetaGDC.DASH/CMD.FILTER_CONTEXT.ATTRIBUTE_FILTER.MOVE | moveAttributeFilter() | Creates the MoveAttributeFilter command. |
IRemoveAttributeFilters BetaGDC.DASH/CMD.FILTER_CONTEXT.ATTRIBUTE_FILTER.REMOVE | removeAttributeFilter(), removeAttributeFilters() | Creates the RemoveAttributeFilters command. |
ISetAttributeFilterDependentDateFilters BetaGDC.DASH/CMD.FILTER_CONTEXT.ATTRIBUTE_FILTER.SET_DEPENDENT_DATE_FILTERS | setAttributeFilterDependentDateFilters() | Creates the SetAttributeFilterDependentDateFilters command. |
ISetAttributeFilterDisplayForm BetaGDC.DASH/CMD.FILTER_CONTEXT.ATTRIBUTE_FILTER.SET_DISPLAY_FORM | setAttributeFilterDisplayForm() | Creates the ISetAttributeFilterDisplayForm command. |
ISetAttributeFilterParents BetaGDC.DASH/CMD.FILTER_CONTEXT.ATTRIBUTE_FILTER.SET_PARENTS | setAttributeFilterParents() | Creates the SetAttributeFilterParents command. |
ISetAttributeFilterSelectionMode BetaGDC.DASH/CMD.FILTER_CONTEXT.ATTRIBUTE_FILTER.SET_SELECTION_MODE | setAttributeFilterSelectionMode() | Creates the ISetAttributeFilterSelectionMode command. |
ISetAttributeFilterTitle BetaGDC.DASH/CMD.FILTER_CONTEXT.ATTRIBUTE_FILTER.SET_TITLE | setAttributeFilterTitle() | Command for changing attribute filter title. |
ChangeFilterContextSelectionGDC.DASH/CMD.FILTER_CONTEXT.CHANGE_SELECTION | changeFilterContextSelection(), changeFilterContextSelectionByParams() | Command for changing multiple filters at once. |
IAddDateFilter AlphaGDC.DASH/CMD.FILTER_CONTEXT.DATE_FILTER.ADD | addDateFilter() | Creates the AddDateFilter command. |
ChangeDateFilterSelectionGDC.DASH/CMD.FILTER_CONTEXT.DATE_FILTER.CHANGE_SELECTION | applyDateFilter(), changeDateFilterSelection(), clearDateFilterSelection() | Command for date filter selection change. |
IMoveDateFilter BetaGDC.DASH/CMD.FILTER_CONTEXT.DATE_FILTER.MOVE | moveDateFilter() | Creates the MoveDateFilter command. |
IRemoveDateFilters BetaGDC.DASH/CMD.FILTER_CONTEXT.DATE_FILTER.REMOVE | removeDateFilter() | Creates the RemoveDateFilters command. |
IApplyFilterView AlphaGDC.DASH/CMD.FILTER_CONTEXT.FILTER_VIEW.APPLY | applyFilterView() | Command for application of a saved filter view. |
ISetFilterViewAsDefault AlphaGDC.DASH/CMD.FILTER_CONTEXT.FILTER_VIEW.CHANGE_DEFAULT_STATUS | setFilterViewAsDefault() | Command for setting a saved filter view as a default one or removing the default status from it. |
IDeleteFilterView AlphaGDC.DASH/CMD.FILTER_CONTEXT.FILTER_VIEW.DELETE | deleteFilterView() | Command for deletion of a saved filter view. |
IReloadFilterViews AlphaGDC.DASH/CMD.FILTER_CONTEXT.FILTER_VIEW.RELOAD | reloadFilterViews() | Command for refreshing of the cache with saved filter views from persistent storage. |
ISaveFilterView AlphaGDC.DASH/CMD.FILTER_CONTEXT.FILTER_VIEW.SAVE | saveFilterView() | Command for snapshotting current filter context and saving it as a filter view. |
IAddMeasureValueFilter AlphaGDC.DASH/CMD.FILTER_CONTEXT.MEASURE_VALUE_FILTER.ADD | addMeasureValueFilter() | Command for adding a new dashboard measure value filter. |
IChangeMeasureValueFilterCondition AlphaGDC.DASH/CMD.FILTER_CONTEXT.MEASURE_VALUE_FILTER.CHANGE_CONDITION | changeMeasureValueFilterCondition(), changeWorkingMeasureValueFilterCondition() | Command for changing the condition definition of an existing measure value filter. |
IMoveMeasureValueFilter AlphaGDC.DASH/CMD.FILTER_CONTEXT.MEASURE_VALUE_FILTER.MOVE | moveMeasureValueFilter() | Command for moving a measure value filter. |
IRemoveMeasureValueFilters AlphaGDC.DASH/CMD.FILTER_CONTEXT.MEASURE_VALUE_FILTER.REMOVE | removeMeasureValueFilter(), removeMeasureValueFilters() | Command for removing one or more measure value filters in a single batch. |
ISetMeasureValueFilterDimensionality AlphaGDC.DASH/CMD.FILTER_CONTEXT.MEASURE_VALUE_FILTER.SET_DIMENSIONALITY | setMeasureValueFilterDimensionality() | Command for changing the dashboard-level dimensionality of an existing measure value filter. |
ISetMeasureValueFilterTitle AlphaGDC.DASH/CMD.FILTER_CONTEXT.MEASURE_VALUE_FILTER.SET_TITLE | setMeasureValueFilterTitle() | Command for changing measure value filter title. |
IResetFilterContextWorkingSelection AlphaGDC.DASH/CMD.FILTER_CONTEXT.RESET_WORKING_SELECTION | resetFilterContextWorkingSelection() | Command for resetting all working filters and working parameter values. |
IRemoveRestrictedFilters BetaGDC.DASH/CMD.FILTER_CONTEXT.RESTRICTED_FILTERS.REMOVE | removeRestrictedFilters() | Removes the filters the active tab’s filter bar reports as not applied. |
IAddTextAttributeFilter BetaGDC.DASH/CMD.FILTER_CONTEXT.TEXT_ATTRIBUTE_FILTER.ADD | addTextAttributeFilter() | Creates the AddTextAttributeFilter command. |
IAddSectionItems BetaGDC.DASH/CMD.FLUID_LAYOUT.ADD_ITEMS | addNestedLayoutSectionItem(), addSectionItem() | Creates the AddSectionItems command. |
IAddLayoutSection BetaGDC.DASH/CMD.FLUID_LAYOUT.ADD_SECTION | addLayoutSection(), addNestedLayoutSection() | Creates the AddLayoutSection command. |
ChangeLayoutSectionHeaderGDC.DASH/CMD.FLUID_LAYOUT.CHANGE_SECTION_HEADER | changeLayoutSectionHeader(), changeNestedLayoutSectionHeader() | Creates the ChangeLayoutSectionHeader command. |
IMoveSectionItem BetaGDC.DASH/CMD.FLUID_LAYOUT.MOVE_ITEM | moveNestedLayoutSectionItem(), moveNestedLayoutSectionItemAndRemoveOriginalSectionIfEmpty(), moveSectionItem(), moveSectionItemAndRemoveOriginalSectionIfEmpty() | Creates the MoveSectionItem command. |
IMoveSectionItemToNewSection BetaGDC.DASH/CMD.FLUID_LAYOUT.MOVE_ITEM_TO_NEW_SECTION | moveNestedLayoutSectionItemToNewSection(), moveNestedLayoutSectionItemToNewSectionAndRemoveOriginalSectionIfEmpty(), moveSectionItemToNewSection(), moveSectionItemToNewSectionAndRemoveOriginalSectionIfEmpty() | Creates the MoveSectionItemToNewSection command. |
IMoveLayoutSection BetaGDC.DASH/CMD.FLUID_LAYOUT.MOVE_SECTION | moveLayoutSection(), moveNestedLayoutSection() | Creates the MoveLayoutSection command. |
IRemoveSectionItem BetaGDC.DASH/CMD.FLUID_LAYOUT.REMOVE_ITEM | eagerRemoveNestedLayoutSectionItem(), eagerRemoveSectionItem(), removeNestedLayoutSectionItem(), removeSectionItem() | Creates the RemoveSectionItem configured to do eager remove of item. |
IRemoveSectionItemByWidgetRef BetaGDC.DASH/CMD.FLUID_LAYOUT.REMOVE_ITEM_BY_WIDGET_REF | eagerRemoveSectionItemByWidgetRef(), removeSectionItemByWidgetRef() | Creates the RemoveSectionItemByWidgetRef configured to do eager remove of item. |
IRemoveLayoutSection BetaGDC.DASH/CMD.FLUID_LAYOUT.REMOVE_SECTION | removeLayoutSection(), removeNestedLayoutSection() | Creates the RemoveLayoutSection command. |
IReplaceSectionItem BetaGDC.DASH/CMD.FLUID_LAYOUT.REPLACE_ITEM | replaceNestedLayoutSectionItem(), replaceSectionItem() | Creates the ReplaceSectionItem command. |
IResizeHeight BetaGDC.DASH/CMD.FLUID_LAYOUT.RESIZE_HEIGHT | resizeHeight(), resizeNestedLayoutItemsHeight() | Creates the ResizeHeight command. |
IResizeWidth BetaGDC.DASH/CMD.FLUID_LAYOUT.RESIZE_WIDTH | resizeNestedLayoutItemWidth(), resizeWidth() | Creates the ResizeWidth command. |
IUndoLayoutChanges BetaGDC.DASH/CMD.FLUID_LAYOUT.UNDO | revertLastLayoutChange(), undoLayoutChanges() | A convenience function to create UndoLayoutChanges command that will revert the very last command and toss it out of history. |
InitializeDashboardGDC.DASH/CMD.INITIALIZE | initializeDashboard() | Loads dashboard from analytical backend. |
IAddDrillDownForInsightWidget AlphaGDC.DASH/CMD.INSIGHT_WIDGET.ADD_DRILL_DOWN | addDrillDownForInsightWidget() | Creates the AddDrillDownForInsightWidget command. |
ChangeInsightWidgetVisConfigurationGDC.DASH/CMD.INSIGHT_WIDGET.CHANGE_CONFIGURATION | changeInsightWidgetVisConfiguration() | Creates the ChangeInsightWidgetVisConfiguration command. |
IChangeInsightWidgetDescription BetaGDC.DASH/CMD.INSIGHT_WIDGET.CHANGE_DESCRIPTION | changeInsightWidgetDescription() | Creates the ChangeInsightWidgetDescription command. |
IChangeInsightWidgetFilterSettings BetaGDC.DASH/CMD.INSIGHT_WIDGET.CHANGE_FILTER_SETTINGS | disableInsightWidgetDateFilter(), enableInsightWidgetDateFilter(), ignoreDateFilterOnInsightWidget(), ignoreFilterOnInsightWidget(), replaceInsightWidgetFilterSettings(), replaceInsightWidgetIgnoredFilters(), unignoreDateFilterOnInsightWidget(), unignoreFilterOnInsightWidget() | Creates the ChangeInsightWidgetFilterSettings command for IFilterOpDisableDateFilter operation. |
IChangeInsightWidgetHeader BetaGDC.DASH/CMD.INSIGHT_WIDGET.CHANGE_HEADER | changeInsightWidgetHeader() | Creates the ChangeInsightWidgetHeader command. |
IChangeInsightWidgetIgnoreCrossFiltering AlphaGDC.DASH/CMD.INSIGHT_WIDGET.CHANGE_IGNORE_CROSS_FILTERING | changeInsightWidgetIgnoreCrossFiltering() | Creates the ChangeInsightWidgetCrossFiltering command. |
IChangeInsightWidgetInsight BetaGDC.DASH/CMD.INSIGHT_WIDGET.CHANGE_INSIGHT | changeInsightWidgetInsight() | XXX: don’t think this is needed right away. |
IChangeInsightWidgetVisProperties BetaGDC.DASH/CMD.INSIGHT_WIDGET.CHANGE_PROPERTIES | changeInsightWidgetVisProperties() | Creates the ChangeInsightWidgetVisProperties command. |
IExportInsightWidget BetaGDC.DASH/CMD.INSIGHT_WIDGET.EXPORT | exportInsightWidget() | Creates the ExportInsightWidget command. |
IExportImageInsightWidget AlphaGDC.DASH/CMD.INSIGHT_WIDGET.EXPORT_IMAGE | exportImageInsightWidget() | Creates the ExportImageInsightWidget command. |
IExportRawInsightWidget AlphaGDC.DASH/CMD.INSIGHT_WIDGET.EXPORT_RAW | exportRawInsightWidget() | Creates the ExportRawInsightWidget command. |
IExportSlidesInsightWidget AlphaGDC.DASH/CMD.INSIGHT_WIDGET.EXPORT_SLIDES | exportSlidesInsightWidget() | Creates the ExportSlidesInsightWidget command. |
IModifyDrillDownForInsightWidget AlphaGDC.DASH/CMD.INSIGHT_WIDGET.MODIFY_DRILL_DOWN | modifyDrillDownForInsightWidget() | Creates the ModifyDrillDownForInsightWidget command. |
IModifyDrillsForInsightWidget BetaGDC.DASH/CMD.INSIGHT_WIDGET.MODIFY_DRILLS | modifyDrillsForInsightWidget() | Creates the ModifyDrillsForInsightWidget command. |
IRefreshInsightWidget BetaGDC.DASH/CMD.INSIGHT_WIDGET.REFRESH | refreshInsightWidget() | Creates the RefreshInsightWidget command. |
IRemoveDrillDownForInsightWidget AlphaGDC.DASH/CMD.INSIGHT_WIDGET.REMOVE_DRILL_DOWN | removeDrillDownForInsightWidget() | Creates the RemoveDrillDownForInsightWidget command. |
IRemoveDrillToUrlForInsightWidget AlphaGDC.DASH/CMD.INSIGHT_WIDGET.REMOVE_DRILL_TO_URL | removeDrillToUrlForInsightWidget() | Creates the RemoveDrillToUrlForInsightWidget command. |
IRemoveDrillsForInsightWidget BetaGDC.DASH/CMD.INSIGHT_WIDGET.REMOVE_DRILLS | removeDrillsForInsightWidget() | Creates the RemoveDrillsForInsightWidget command. |
IDeleteInsight AlphaGDC.DASH/CMD.INSIGHT.DELETE | deleteInsight() | Creates the DeleteInsight command. |
IChangeKpiWidgetComparison BetaGDC.DASH/CMD.KPI_WIDGET.CHANGE_COMPARISON | changeKpiWidgetComparison() | Creates the ChangeKpiWidgetComparison command. |
IChangeKpiWidgetConfiguration BetaGDC.DASH/CMD.KPI_WIDGET.CHANGE_CONFIGURATION | changeKpiWidgetConfiguration() | Creates the ChangeKpiWidgetConfiguration command. |
IChangeKpiWidgetDescription BetaGDC.DASH/CMD.KPI_WIDGET.CHANGE_DESCRIPTION | changeKpiWidgetDescription() | Creates the ChangeKpiWidgetDescription command. |
IChangeKpiWidgetFilterSettings BetaGDC.DASH/CMD.KPI_WIDGET.CHANGE_FILTER_SETTINGS | disableKpiWidgetDateFilter(), enableKpiWidgetDateFilter(), ignoreFilterOnKpiWidget(), replaceKpiWidgetFilterSettings(), replaceKpiWidgetIgnoredFilters(), unignoreFilterOnKpiWidget() | Creates the ChangeKpiWidgetFilterSettings command for IFilterOpDisableDateFilter operation. |
IChangeKpiWidgetHeader BetaGDC.DASH/CMD.KPI_WIDGET.CHANGE_HEADER | changeKpiWidgetHeader() | Creates the ChangeKpiWidgetHeader command. |
IChangeKpiWidgetMeasure BetaGDC.DASH/CMD.KPI_WIDGET.CHANGE_MEASURE | changeKpiWidgetMeasure() | Creates the ChangeKpiWidgetMeasure command. |
IRefreshKpiWidget BetaGDC.DASH/CMD.KPI_WIDGET.REFRESH | refreshKpiWidget() | Creates the RefreshKpiWidget command. |
IRemoveDrillForKpiWidget BetaGDC.DASH/CMD.KPI_WIDGET.REMOVE_DRILL | removeDrillForKpiWidget() | Creates the RemoveDrillForKpiWidget command. |
ISetDrillForKpiWidget BetaGDC.DASH/CMD.KPI_WIDGET.SET_DRILL | setDrillForKpiWidget() | Creates the SetDrillForKpiWidget command. |
ISetDashboardMeasureValueFilterConfigMode AlphaGDC.DASH/CMD.MEASURE_VALUE_FILTER_CONFIG.SET_MODE | setDashboardMeasureValueFilterConfigMode() | Command for changing measure value filter mode. |
IRequestOpenDensityDialog AlphaGDC.DASH/CMD.OPEN_DENSITY_DIALOG | requestOpenDensityDialog() | Creates the RequestOpenDensityDialog command. |
IRenameDashboard BetaGDC.DASH/CMD.RENAME | renameDashboard() | Creates the RenameDashboard command. |
RequestAsyncRenderGDC.DASH/CMD.RENDER.ASYNC.REQUEST | requestAsyncRender() | Notify the dashboard about asynchronous rendering (eg when the component needs to load some asynchronous data to be rendered) of the component. |
ResolveAsyncRenderGDC.DASH/CMD.RENDER.ASYNC.RESOLVE | resolveAsyncRender() | Notify the dashboard about resolved asynchronous rendering of the component. |
IResetDashboard BetaGDC.DASH/CMD.RESET | resetDashboard() | Creates the ResetDashboard command. |
IChangeRichTextWidgetContent BetaGDC.DASH/CMD.RICH_TEXT_WIDGET.CHANGE_CONTENT | changeRichTextWidgetContent() | Creates the ChangeRichTextWidgetContent command. |
IChangeRichTextWidgetFilterSettings BetaGDC.DASH/CMD.RICH_TEXT_WIDGET.CHANGE_FILTER_SETTINGS | disableRichTextWidgetDateFilter(), enableRichTextWidgetDateFilter(), ignoreDateFilterOnRichTextWidget(), ignoreFilterOnRichTextWidget(), unignoreDateFilterOnRichTextWidget(), unignoreFilterOnRichTextWidget() | Creates the ChangeRichTextWidgetFilterSettings command for IFilterOpDisableDateFilter operation. |
ISaveDashboard BetaGDC.DASH/CMD.SAVE | saveDashboard() | Creates the SaveDashboard command. |
SaveDashboardAsGDC.DASH/CMD.SAVEAS | saveDashboardAs() | Creates the SaveDashboardAs command. |
ICreateScheduledEmail BetaGDC.DASH/CMD.SCHEDULED_EMAIL.CREATE | createScheduledEmail() | Creates scheduled email. |
ISaveScheduledEmail BetaGDC.DASH/CMD.SCHEDULED_EMAIL.SAVE | saveScheduledEmail() | Saves scheduled email. |
IChangeSharing BetaGDC.DASH/CMD.SHARING.CHANGE | changeSharing() | Creates the ChangeSharing command. |
ISetShowWidgetAsTable BetaGDC.DASH/CMD.SHOW_WIDGET_AS_TABLE.SET | setShowWidgetAsTable() | Command to set a widget to show as table. |
ICreateDashboardTab AlphaGDC.DASH/CMD.TAB.CREATE | createDashboardTab() | Command to create a new dashboard tab. |
IDeleteDashboardTab AlphaGDC.DASH/CMD.TAB.DELETE | deleteDashboardTab() | Command to delete a dashboard tab. |
IRenameDashboardTab AlphaGDC.DASH/CMD.TAB.RENAME | renameDashboardTab() | Command to rename a dashboard tab. |
ICancelRenamingDashboardTab AlphaGDC.DASH/CMD.TAB.RENAME_MODE.CANCEL | cancelRenamingDashboardTab() | Command to cancel renaming mode for a tab. |
IStartRenamingDashboardTab AlphaGDC.DASH/CMD.TAB.RENAME_MODE.START | startRenamingDashboardTab() | Command to start renaming mode for a tab. |
IRepositionDashboardTab AlphaGDC.DASH/CMD.TAB.REPOSITION | repositionDashboardTab() | Command to reposition a dashboard tab. |
ISwitchDashboardTab AlphaGDC.DASH/CMD.TAB.SWITCH | switchDashboardTab() | Command to switch to a different dashboard tab. |
IAddVisualizationToVisualizationSwitcherWidgetContent BetaGDC.DASH/CMD.VISUALIZATION_SWITCHER_WIDGET.ADD_VISUALIZATION | addVisualizationToSwitcherWidgetContent() | Creates the AddVisualizationToSwitcherWidgetContent command. |
IChangeVisualizationSwitcherActiveVisualization BetaGDC.DASH/CMD.VISUALIZATION_SWITCHER_WIDGET.CHANGE_ACTIVE_VISUALIZATION | changeVisualizationSwitcherActiveVisualization() | Creates the ChangeVisualizationSwitcherActiveVisualization command. |
IUpdateVisualizationsFromVisualizationSwitcherWidgetContent BetaGDC.DASH/CMD.VISUALIZATION_SWITCHER_WIDGET.UPDATE_VISUALIZATIONS | updateVisualizationsFromSwitcherWidgetContent() | Creates the ChangeVisualizationsFromVisualizationSwitcherWidgetContent command. |
For the events, see All events.
Events
Events inform you about what happened in the Dashboard component (for example, the filters changed).
This example listens to every event, including custom events. To listen to the built-in dashboard events only, use anyDashboardEventHandler.
import "@gooddata/sdk-ui-dashboard/styles/css/main.css";
import { Dashboard, anyEventHandler } from "@gooddata/sdk-ui-dashboard";
import { idRef } from "@gooddata/sdk-model";
const dashboardRef = idRef("<dashboard-identifier>");
export const EmbeddedReactDashboard = () => {
return (
<Dashboard
dashboard={dashboardRef}
eventHandlers={[
anyEventHandler((e) => {
console.log("Dashboard event fired:", e);
}),
]}
/>
);
};
To react to one kind of event with a typed guard, read state inside a handler, or match a command to the event it produces, see Handle dashboard events. All events are listed in the API reference.
Configuration
Configuration of a dashboard can influence the available features, look-and-feel, and behavior of the dashboard. To
specify the configuration, use the config prop.
All configuration properties are optional. For most of them, the Dashboard component retrieves the values from the Analytical Backend. The most common ones:
| Name | Type | Description |
|---|---|---|
locale | ILocale | The locale of the dashboard. Defaults to the locale set for the current user. For other languages, see the full list of available localizations. |
separators | ISeparators | The number separators used by the charts on the dashboard. |
mapboxToken | string | The map access token used by geo pushpin charts. |
isReadOnly | boolean | If true, the dashboard is embedded in read-only mode, which disables any user interaction that would alter backend state (creating or changing alerts, creating scheduled emails, and so on). Defaults to false. |
All configuration options are in DashboardConfig.
Access the state of the Dashboard component from outside the component
To access the state of the Dashboard component, use the SingleDashboardStoreAccessor class. This class provides the following functions that enable access to the Dashboard component state:
getDashboardSelect()returns adashboardSelectobject for the current dashboard.getDashboardDispatch()returns adashboardDispatchobject for the current dashboard.getOnChangeHandler()returns a function that can be used as theonStateChangecallback for the current dashboard.clearAccessor()removes the accessor from thestoreaccessor object.isAccessorInitialized()returnstrueif the accessor is available for the current dashboard; otherwise, returnsfalse.
To access more than one dashboard store object, use the DashboardStoreAccessorRepository class. This class uses a map where the value is a DashboardStoreAccessor for a single dashboard and the key is the dashboard’s ObjRef.
getAccessorsForDashboard(dashboard)returns an accessor object for a specific dashboard.getDashboardSelectForDashboard(dashboard)returns adashboardSelectobject for a specific dashboard.getDashboardDispatchForDashboard(dashboard)returns adashboardDispatchobject for a specific dashboard.getOnChangeHandlerForDashboard(dashboard)returns a function that can be used as theonStateChangecallback.clearAccessorForDashboard(dashboard)removes accessors from a specific dashboard.clearAllAccessors()removes all accessors from the repository.isAccessorInitializedForDashboard(dashboard)returnstrueif the accessor is available for a specific dashboard; otherwise, returnsfalse.
For more information, check the example.
If the default implementation of the DashboardStoreAccessorRepository class does not cover your specific scenario, you can use DashboardStoreAccessor to implement your own accessor repository.
Props
| Prop | Type | Required | Description | Inherited from |
|---|---|---|---|---|
children | ReactElement | ((dashboard: any) => ReactElement) | No | — | — |
additionalReduxContext | Context<ReactReduxContextValue | null> | No | Pass instance of ReactReduxContext where the dashboard component’s store should be saved. | IDashboardExtensionProps |
AlertingDialogComponent | CustomAlertingDialogComponent | No | (Alpha) Specify component to use for rendering the alerting dialog. | IDashboardCustomComponentProps |
AlertingDialogContextDecoratorComponent | CustomAlertingDialogContextDecoratorComponent | No | (Alpha) Specify component to decorate the data the alerting dialog reads. Rendered between the dialog’s data context and its state model; see CustomAlertingDialogContextDecoratorComponent for the contract and an example. | IDashboardCustomComponentProps |
AlertingManagementDialogComponent | CustomAlertingManagementDialogComponent | No | (Alpha) Specify component to use for rendering the alerting management dialog. | IDashboardCustomComponentProps |
AlertingManagementDialogContextDecoratorComponent | CustomAlertingManagementDialogContextDecoratorComponent | No | (Alpha) Specify component to decorate the data the alerting management dialog reads. Rendered between the connector-provided management dialog context and the resolved management dialog component; see CustomAlertingManagementDialogContextDecoratorComponent for the contract and an example. | IDashboardCustomComponentProps |
AutomationsContextDecoratorComponent | CustomAutomationsContextDecoratorComponent | No | (Alpha) Specify component to decorate the data the automation dialogs’ shared context carries. Rendered once per dialog tree, directly inside each connector-provided automations context; see CustomAutomationsContextDecoratorComponent for the contract and an example. | IDashboardCustomComponentProps |
backend | IAnalyticalBackend | No | Analytical backend from which the dashboard obtains data to render. | IDashboardBaseProps |
ButtonBarComponent | CustomButtonBarComponent | No | (Alpha) Specify component to use for rendering the button bar. | IDashboardCustomComponentProps |
config | DashboardConfig | No | Configuration that can be used to modify dashboard features, capabilities and behavior. | IDashboardBaseProps |
customizationFns | DashboardModelCustomizationFns | No | Specify customization functions. | IDashboardCustomizationProps |
dashboard | string | ObjRef | IDashboard | No | Specify dashboard to render; you can specify the dashboard either by reference (ObjRef) or by value (of type IDashboard). | IDashboardBaseProps |
DashboardAttributeFilterComponentProvider | OptionalAttributeFilterComponentProvider | No | (Alpha) Specify custom component to use for rendering all attribute filters or a factory function to customize the component per different attribute filter. | IDashboardCustomComponentProps |
DashboardContentComponentProvider | OptionalDashboardContentComponentProvider | No | (Alpha) Specify function to obtain custom component to use for extend rendering of dashboard content. | IDashboardCustomComponentProps |
DashboardDateFilterComponentProvider | OptionalDateFilterComponentProvider | No | (Alpha) Specify component to use for rendering the date filters. | IDashboardCustomComponentProps |
DashboardFilterGroupComponentProvider | OptionalFilterGroupComponentProvider | No | (Alpha) Specify custom component to use for rendering all filter groups or a factory function to customize the component per different filter group. - If not provided, the default implementation DefaultDashboardFilterGroup will be used. - If factory function is provided and it returns undefined, then the default implementation DefaultDashboardFilterGroup. This is useful if you want to customize just one particular filter group and keep all other filter groups the same. - If you want to customize each filter in a filter group, use this provider and customize DefaultDashboardFilterGroup in it. It accepts some customization props fro deeper component. | IDashboardCustomComponentProps |
DashboardLayoutComponentProvider | OptionalDashboardLayoutComponentProvider | No | Specify function to obtain custom component to use for rendering a dashboard layout (nested). | IDashboardCustomComponentProps |
DashboardMeasureValueFilterComponentProvider | OptionalMeasureValueFilterComponentProvider | No | (Alpha) Specify component to use for rendering the measure value filters. | IDashboardCustomComponentProps |
disableThemeLoading | boolean | No | When true, disables the loading of the workspace theme and creation of a ThemeProvider (if there is none already present in the parent scope). | IDashboardThemingProps |
DrillDialogExportDropdownComponentProvider | OptionalDrillDialogExportDropdownComponentProvider | No | (Alpha) Specify the component rendered as drill dialog export dropdown. | IDashboardCustomComponentProps |
ErrorComponent | ComponentType<IErrorProps> | No | (Alpha) Component to render if embedding fails. | IDashboardCustomComponentProps |
eventHandlers | DashboardEventHandler[] | No | Specify event handlers to register at the dashboard creation time. | IDashboardEventing |
FilterBarComponent | CustomFilterBarComponent | No | (Alpha) Specify component to use for rendering the filter bar. | IDashboardCustomComponentProps |
filterContextRef | ObjRef | No | Specify reference to a filter context that should be used instead of the default, built-in filter context. | IDashboardBaseProps |
initialTabId | string | No | (Alpha) Explicitly specify which tab should be opened first when the dashboard is rendered. | IDashboardBaseProps |
InsightBodyComponentProvider | OptionalInsightBodyComponentProvider | No | (Alpha) Specify function to obtain custom component to use for rendering an insight body (i.e. the insight itself) in the DefaultDashboardInsight. | IDashboardCustomComponentProps |
InsightComponentProvider | OptionalInsightComponentProvider | No | Specify function to obtain custom component to use for rendering an insight. | IDashboardCustomComponentProps |
InsightMenuButtonComponentProvider | OptionalInsightMenuButtonComponentProvider | No | (Alpha) Specify function to obtain custom component to use for rendering an insight menu button. | IDashboardCustomComponentProps |
InsightMenuComponentProvider | OptionalInsightMenuComponentProvider | No | (Alpha) Specify function to obtain custom component to use for rendering an insight menu. | IDashboardCustomComponentProps |
insightMenuItemsProvider | InsightMenuItemsProvider | No | (Alpha) Provide custom provider to change items rendered in insight menus. | IDashboardCustomizationProps |
keyboardNavigation | KeyboardNavigationConfig | No | Specify tab index and addressable id for the dashboard components used by keyboard navigation | IDashboardBaseProps |
LayoutComponent | CustomDashboardLayoutComponent | No | (Alpha) Specify component to use for rendering the layout. | IDashboardCustomComponentProps |
LoadingComponent | ComponentType<ILoadingProps> | No | (Alpha) Component to render while the dashboard or a widget is loading. | IDashboardCustomComponentProps |
MenuButtonComponent | CustomMenuButtonComponent | No | (Alpha) Specify component to use for rendering the menu button. | IDashboardCustomComponentProps |
menuButtonConfig | IMenuButtonConfiguration | No | (Alpha) Provide custom configuration for the Menu button. | IDashboardCustomizationProps |
onEventingInitialized | (registerEventHandler: (handler: DashboardEventHandler) => void, unregisterEventHandler: (handler: DashboardEventHandler) => void) => void | No | Specify callback that will be called when the dashboard eventing subsystem initializes and it is possible to register new or unregister existing event handlers. | IDashboardEventing |
onStateChange | (state: DashboardState, dispatch: DashboardDispatch) => void | No | Specify callback that will be called each time the state changes. | IDashboardEventing |
permissions | IWorkspacePermissions | No | Specify permissions to use when determining availability of the different features of the dashboard component. | IDashboardBaseProps |
RestrictedFiltersPlaceholderComponentProvider | OptionalRestrictedFiltersPlaceholderComponentProvider | No | (Alpha) Specify function to obtain a custom component reporting the filters the current user is not allowed to see. | IDashboardCustomComponentProps |
RestrictedPlaceholderComponentProvider | OptionalRestrictedPlaceholderComponentProvider | No | (Alpha) Specify function to obtain a custom component standing in for an insight widget the current user is not allowed to see. | IDashboardCustomComponentProps |
RichTextComponentProvider | OptionalRichTextComponentProvider | No | Specify function to obtain custom component to use for rendering a rich text. | IDashboardCustomComponentProps |
RichTextMenuComponentProvider | OptionalRichTextMenuComponentProvider | No | (Alpha) Specify function to obtain custom component to use for rendering an rich text menu. | IDashboardCustomComponentProps |
richTextMenuItemsProvider | RichTextMenuItemsProvider | No | (Alpha) Provide custom provider to change items rendered in rich text menus. | IDashboardCustomizationProps |
SaveAsDialogComponent | CustomSaveAsDialogComponent | No | (Alpha) Specify component to use for rendering the save as dialog. | IDashboardCustomComponentProps |
ScheduledEmailDialogComponent | CustomScheduledEmailDialogComponent | No | (Alpha) Specify component to use for rendering the scheduled email dialog. | IDashboardCustomComponentProps |
ScheduledEmailDialogContextDecoratorComponent | CustomScheduledEmailDialogContextDecoratorComponent | No | (Alpha) Specify component to decorate the data the scheduled email dialog reads. Rendered between the dialog’s data context and its state model; see CustomScheduledEmailDialogContextDecoratorComponent for the contract and an example. | IDashboardCustomComponentProps |
ScheduledEmailManagementDialogComponent | CustomScheduledEmailManagementDialogComponent | No | (Alpha) Specify component to use for rendering the scheduled email management dialog. | IDashboardCustomComponentProps |
ScheduledEmailManagementDialogContextDecoratorComponent | CustomScheduledEmailManagementDialogContextDecoratorComponent | No | (Alpha) Specify component to decorate the data the scheduled email management dialog reads. Rendered between the connector-provided management dialog context and the resolved management dialog component; see CustomScheduledEmailManagementDialogContextDecoratorComponent for the contract and an example. | IDashboardCustomComponentProps |
ShareDialogComponent | CustomShareDialogComponent | No | (Alpha) Specify component to use for rendering the share dialog. | IDashboardCustomComponentProps |
ShowAsTableButtonComponentProvider | OptionalShowAsTableButtonComponentProvider | No | (Alpha) Specify the component rendered as show as table button. | IDashboardCustomComponentProps |
SidebarComponent | CustomSidebarComponent | No | (Alpha) Specify component to use for rendering the sidebar. | IDashboardCustomComponentProps |
theme | ITheme | No | Theme to use. | IDashboardThemingProps |
themeModifier | (theme: ITheme) => ITheme | No | If provided it is called with loaded theme to allow its modification according to the app needs. | IDashboardThemingProps |
TitleComponent | CustomTitleComponent | No | (Alpha) Specify component to use for rendering the title. | IDashboardCustomComponentProps |
TopBarComponent | CustomTopBarComponent | No | (Alpha) Specify component to use for rendering the top bar. | IDashboardCustomComponentProps |
VisualizationSwitcherComponentProvider | OptionalVisualizationSwitcherComponentProvider | No | Specify function to obtain custom component to use for rendering a visualization switcher. | IDashboardCustomComponentProps |
VisualizationSwitcherToolbarComponentProvider | OptionalVisualizationSwitcherToolbarComponentProvider | No | Specify function to obtain custom component to use for rendering a visualization switcher toolbar. | IDashboardCustomComponentProps |
WidgetComponentProvider | OptionalWidgetComponentProvider | No | Specify function to obtain custom component to use for rendering a widget. | IDashboardCustomComponentProps |
widgetsOverlayFn | WidgetsOverlayFn | No | (Alpha) Provide settings for widgets overlay | IDashboardWidgetsOverlayProps |
workspace | string | No | Identifier of analytical workspace, from which the dashboard obtains data to render. | IDashboardBaseProps |
Related
Choose among a built-in dashboard embedded through an iframe, the Dashboard component, and a custom dashboard by comparing their integration, customization, and implementation trade-offs.
Register typed handlers for Dashboard component events, read state and dispatch commands from a handler, and match commands to events.
Read Dashboard component state with useDashboardSelector and the select* selectors, from components, event handlers, and outside code.
Choose which layer of a dashboard widget to replace (the widget, the visualization, or its body) and how drills flow through custom renderers.
Configure backend response caching with withCaching, including execution result expiration, cache limits, and the recommended defaults.