Metric editor
How users create and edit metrics in Analytical Designer, who can do it, and how your application keeps its data fresh afterwards.
Analytical Designer includes the metric editor of GoodData Cloud. Users create and change metrics, written in MAQL, while they build a visualization. They don’t have to leave Analytical Designer or your application. The editor comes with the AnalyticalDesigner component, both standalone and when the Dashboard component opens it, and needs no setup.
Where it appears
- Create metric at the top of the catalog opens the editor for a new metric. The button is disabled while the workspace has no data.
- The details of a metric in the catalog have an Edit button, or a View button when the user can’t edit the metric.
The editor opens as a panel over Analytical Designer. It keeps each metric in its own tab, so the user can work on several metrics at once. The user can minimize the panel and go back to the visualization. If the user leaves Analytical Designer with unsaved metric changes, Analytical Designer asks for confirmation first.
Who can create and edit metrics
The rules follow the enableMetricPermissions setting of the workspace:
enableMetricPermissions off | enableMetricPermissions on | |
|---|---|---|
| Create a metric | Users with the workspace MANAGE permission | Users with the canCreateMetric workspace permission |
| Edit a metric | Users with the workspace MANAGE permission | Users with MANAGE, or with EDIT on that metric |
Everyone else opens metrics read-only, through View.
What changes for your application
A saved or deleted metric changes data that your application may have cached:
AnalyticalDesignercallscacheReset.resetAllbefore it reloads its own data, and emits themetricsChangedevent. PasscacheResetwhen your backend caches, and usemetricsChangedinonEventto refresh the rest of your application. See Keep a shared cache fresh.- In the Dashboard component, the same moment emits
GDC.DASH/EVT.INSIGHT_EDITOR.CACHE_RESET_REQUESTEDwith the scope"all". See Keep a caching backend fresh.
The MAQL editor runs part of its work in a web worker. The worker ships bundled with the package, so it needs no bundler configuration.
Related
React to what the user does in Analytical Designer with the typed onEvent callback, and drive it with commands through apiRef.
Install @gooddata/sdk-ui-analytical-designer, load its styles, and render Analytical Designer on your backend in a React application.
Let users explore, edit, and create visualizations in Analytical Designer on top of the Dashboard component with the enableInsightEditing option.