Component Options
Turn on the v2 embed design
Give an embedded dashboard the v2 cards, filters and menus with two attributes.
Add ui-version="v2" and embed-flags to <dbn-dashboard>. Both are needed.
<dbn-dashboard
token="GUEST_TOKEN"
dashboard-id="DASHBOARD_ID"
ui-version="v2"
embed-flags='{"embed_ui_v2_master":true}'
></dbn-dashboard>ui-version="v2"loads the v2 styles and design tokens. Alone, it does not change the look of any part.embed-flagspicks the parts that get the v2 look.embed_ui_v2_master: trueturns on all of them.- A flag without
ui-version="v2"changes nothing. ui-versiondefaults tolegacy.
<dbn-metric> has no ui-version. The v2 design is for <dbn-dashboard> only.
Turn on one part at a time
Leave out embed_ui_v2_master and name the parts you want:
<dbn-dashboard
token="GUEST_TOKEN"
dashboard-id="DASHBOARD_ID"
ui-version="v2"
embed-flags='{"embed_ui_v2_filters":true}'
></dbn-dashboard>| Flag | Turns on |
|---|---|
embed_ui_v2_master | Every part below |
embed_ui_v2_primitives | Buttons, inputs and other shared parts |
embed_ui_v2_metric_cards | The metric card design |
embed_ui_v2_filters | The filter bar design. Always turns on embed_ui_v2_primitives too. |
embed_ui_v2_charts_chrome | Chart toolbar and menus |
embed_ui_v2_create_metric | The create metric flow |
embed_multi_hop_joins | More than one join in the embedded metric builder. Not part of embed_ui_v2_master. Works with both designs. |
Drill into any field (enable-adhoc-drill) and cross filtering (enable-cross-filter) live on the v2 card. They need embed_ui_v2_metric_cards. See Drill and cross-filter switches.
The names in the Embed dialog
The Embed dialog in Databrain prints these attributes for you.
| Dialog setting | Choices | Attributes it prints |
|---|---|---|
| Appearance | Don’t specify, Use saved theme, Light, Dark, System | color-scheme, and theme-name for a saved theme. Works with both designs. |
| Design | Current, v2 (beta) | v2 (beta) adds ui-version="v2", embed-flags='{"embed_ui_v2_master":true}', enable-adhoc-drill="true" and enable-cross-filter="true". Dashboard snippets only. |
The v2 chart engine
The chart engine draws the chart marks. It is a separate switch from the design. An embed uses the current chart engine until it opts in.
Any of these turns on the v2 chart engine:
| Switch | Where |
|---|---|
ui-version="v2" | On a <dbn-dashboard> |
data-dbn-ui="v2" | On the element or a parent element |
?dbnCharts=v2 | In the page URL |
data-dbn-ui="v2" changes the chart engine only. It does not give you the v2 cards, filters or menus. Use ui-version and embed-flags for that.
The URL switch is saved in localStorage (@dbn:chartsV2) and stays for later visits:
| Value | Result |
|---|---|
?dbnCharts=v2 | v2 chart engine |
?dbnCharts=v1 | Current chart engine. Wins over every other switch, including ui-version="v2". |
?dbnCharts=auto | Clears the saved value. The attributes decide again. |
The engine choice is page wide. When one v2 embed is on a page, every embed on that page draws with the v2 chart engine.
If something goes wrong
- The look did not change. Check that both
ui-version="v2"andembed-flagsare on the element. - A snippet has
data-dbn-ui="v2"but the old look. That snippet is from an older Databrain build. Addui-versionandembed-flags. - Charts stay on the old engine after you add
ui-version. A savedv1wins. Open the page once with?dbnCharts=auto.
Next: Set dashboard options.