Embedding inside SAS Visual Analytics¶
Data Controller can be embedded inside a SAS Visual Analytics report as a data-driven content (DDC) object. This unlocks scenarios where a user can safely modify the values in an underlying SAS table, and have the visualisation updated- all from inside the same report.
URL¶
Open the editor as a DDC by appending ?embed=va to the editor route:
`https://yourserver/DC/#/editor/<library>/<table>?embed=va`
The ?embed= parameter accepts three values:
| Value | Behaviour |
|---|---|
true |
Chrome (header, back button, sub-nav) is hidden. Editor functions normally. |
va |
Same chrome-hiding as true, plus editor becomes "VA-aware" - any report filters are captured, and columns can be displayed / hidden using the Edit Report interface. Filter button is disabled (use VA filters instead) |
false (or omitted) |
Standard interactive UI. |
How VA drives the editor¶
VA pushes a JSON payload to the iframe via window.postMessage whenever the selected rows change. Data Controller listens for these messages and:
- Resolves each VA
parameterto a DC column by matching on column label. - Builds a filter (using existing Filter machinery) over the selected values.
- Hides any VA columns marked as
brushso the grid stays focused on the user-editable columns (except primary key cols which are always shown)
If VA sends an empty / unmatched message the editor falls back to the unfiltered view but stays in VA mode.
More logic available in `va-messaging.service.ts'.
Filter Modes¶
When running in embed=va mode, the editor provides two filter modes, controlled by the Auto-apply checkbox:
- Live (default) - the editor updates automatically as you select rows in the VA report, so the data you see always matches your current selection.
- Confirm - filter changes are held until you click the Apply button. This is useful when editing, where an automatic reload would discard unsaved changes.
A status indicator shows whether a filter change is pending, loading, or idle. In edit mode, a pending filter is held until you leave edit mode, so your unsaved edits are never lost.
Configuration in VA¶
In the VA Report Designer, add a Data-Driven Content object and set the URL to the editor route shown above. Be sure that any report level filters have their corresponding parameters added to the DDC object itself.
Debugging¶
The following snippet can be used in console to dump the values being provided to DC from VA:
console.log(JSON.stringify(window.__vaLastMessage?.data, null, 2))