Author DataPrism custom visuals with AI
The Studio for a custom visual has an AI author that writes and repairs the visual beside you, and previews the result on its own data. Use it to start a visual from a description, or to fix one that a check has flagged. The editing surfaces around it are described on The custom visual Studio.
Ask the AI to write your visual
- Open the tile in the DataPrism visual studio with the AI panel open; the AI edits the visual from there.
- Describe what the visual should do: the fields to show, the look, and anything to avoid.
- Let the turn run. While it works, the editor is read-only and shows AI is editing; review the change when the turn finishes.
- Review each change in the editor. Nothing is saved for you: the visual is held in your browser until you press Save.
What the AI works with
- The same file tree you edit:
visual.html, visual.css, visual.js, options.json and the assets/ folder.
- Two tiers. Template draws with HTML and CSS and runs no JavaScript; HTML + JS is an ES module written against the visual SDK.
- It picks the tier from what the visual must do. Ribbons, maps, 3D views, charts and word clouds need HTML + JS and its libraries; simpler cards and lists can stay a Template.
- It declares the visual's data roles and binds the tile's fields to them: up to 16 roles, each with up to 8 fields (Custom visual options, data and limits).
- HTML + JS visuals draw with a fixed set of twelve libraries at pinned versions; the list and the import names are on Custom visual SDK.
- Every write runs the same checks and size caps as code written by hand. A write that breaks a rule changes nothing and says why.
- It does not add fields, upload or delete asset files, publish or save the visual, or run SQL.
How a turn works
- It reads first: the visual's files, the fields bound to it and a profile of their values.
- If the request leaves a choice open, it asks before it writes.
- The first draft goes in as one batch: source, bindings, options and interactions together.
- It reads its own result report, then repairs: at most three rounds, one cause and one patch per round.
- It previews and runs the checks before it reports the work done, and re-checks what the checks flagged.
- It does not leave a broken tile. If it cannot finish, it restores the last working version or names the checkpoint you can revert to.
- Each step appears in the chat as its own card; Building custom visuals with the assistant explains what the cards say.
Operations, previews and limits
- One turn makes at most 60 operations, and reads count as operations.
- The ready examples the AI can start from are free of the budget. They cover card grids, flow ribbons, waffles, paged cards, KPI strips, geo maps and skyline views.
- A preview renders at tile, wide or narrow size.
- A preview draws one of three datasets: your live rows, an empty dataset, or a hostile dataset of awkward values, to see how the code copes.
- A finished render can be attached to the conversation as a JPEG up to 1024 pixels on its long edge.
- A studio call and a preview each have a 20-second deadline; a run that misses it reports a timeout instead of a result.
- Saved viewer state is capped at 16 KB; the remaining size caps are on Custom visual options, data and limits.
- Exports are deterministic: the visual paints the same frame twice for the capture, and its export hooks let the code hand over its own picture and pages within a 5-second budget.
What a refusal says
When an edit cannot go through, the AI says why and nothing changes. These are the refusals you may meet.
- The studio is not connected. "the visual studio is not connected, so this custom visual cannot be edited right now. Tell the author to open the tile in the DataPrism visual studio with the AI panel open, then ask them to try again." Open the tile in the studio with the AI panel open, and ask again.
- A permission is missing. The refusal names Use DataPrism AI and Author DataPrism Custom Visuals. Ask an administrator to add what is missing to your role; see Who can do what in DataPrism.
- Custom visuals are off for the deployment. "DataPrism Custom Visuals is disabled on this deployment." Ask an administrator to enable custom visuals.
- The operation cap is reached. The turn stops, sums up what is left to do, and asks you to continue in a new message.
- A credential prompt is refused. "DataPrism never asks for credentials inside a report tile, and a custom visual may not imitate one". Build the tile without the sign-in or password shape.
Embeds and allowed hosts
- A custom visual loads images, opens links and embeds players only from hosts on the Sandbox Allowed Hosts list. Its own code has no network, so everything it loads goes through the app and that list.
- A refused embed shows Embed blocked on the tile.
- An administrator keeps the list under Admin > System Configuration > Security; the patterns and rules are on Sandbox, network and the allowlist.
Questions, answered
What decides whether the AI writes a Template or an HTML + JS visual?
What the visual has to do. Ribbons, maps, 3D views, charts and word clouds need code, so they become HTML + JS; simpler cards and lists can stay a Template with no JavaScript.
How many roles and fields can the AI set up?
Up to 16 data roles, each taking up to 8 fields. It declares the roles and binds the tile's fields to them; the caps and the role rules are on Custom visual options, data and limits.
How much can the AI change in one message?
At most 60 operations, and reads count too; the ready examples are free. When the cap is reached the turn stops and asks you to continue, so split a large rework across a few messages.
Why does the AI say the visual studio is not connected?
The work happens through the studio, and the tile's studio is not connected to the AI panel right now. Open the tile in the DataPrism visual studio with the AI panel open, then ask again.
Can the AI author work when custom visuals are switched off?
No. The studio refuses with "DataPrism Custom Visuals is disabled on this deployment." Custom visuals are off for the whole deployment; ask an administrator to enable them. Other switched-off messages a tile can show are in Troubleshooting custom visuals.
Why did the AI refuse to copy a sign-in form?
The studio declines tiles that imitate a credential prompt: "DataPrism never asks for credentials inside a report tile, and a custom visual may not imitate one". Design the tile without the sign-in or password shape.
Does the AI save my visual for me?
No. Nothing is saved for you: the visual is held in your browser until you press Save. The flow around that is on The custom visual Studio.
What happens if the AI cannot make the visual work?
It does not leave the tile broken. It restores the last working version, or names the checkpoint you can revert to, and tells you what is left.
Do the ready examples count against the operation limit?
No. The examples the AI can start from are free of the 60-operation budget, and they cover card grids, flow ribbons, waffles, paged cards, KPI strips, geo maps and skyline views.
Why did a preview stop before it finished?
A studio call and a preview each have a 20-second deadline. A run that cannot finish in time reports a timeout instead of a result; ask again.