Loading the documentation…

The custom visual Studio

The Studio is the editing environment for one custom visual tile, or for one visual in the library. It holds the visual's files, previews your code on the tile's rows, and applies it to the report you have open. For what a custom visual is and how it is shared, see Custom visuals and the visual library.

Open the Studio

You need edit access to the report and the Author DataPrism Custom Visuals permission. Without it, Edit code is not offered. See Who can do what in DataPrism.

  1. Open the report that holds the tile.
  2. Choose Edit code from the tile menu. A tile that has no code yet offers Open studio on its placeholder instead.

The Studio opens beside the report, in the same tab. While it loads it reads Loading report and Loading studio. It works while the report is open: leave the report and it minimises itself; reopen the report to keep editing.

Files, tiers and libraries

The left panel is the file tree of one visual.

Edit and preview code

Apply, and save the report

Apply (Ctrl+Enter) commits your code to the tile in the report you have open. It is available when your code differs from what the tile holds, or when the tile has no saved code yet, and it waits while an AI turn runs.

Applied code changes the open report only. Other people keep seeing the last saved version until the report is saved; the Studio does not save the report for you. When an apply is refused, the tile keeps its last applied code and the Studio shows the reason.

Publish to the library

Publish to library in the Studio header sends the tile's code to the organisation's visual library. When there is something to publish, it applies your edits and saves the report first. A tile that is not in the library yet becomes a new library visual; a tile that is already pinned to one publishes its code as that visual's next version. The choices and permissions are on Visual library.

Close the Studio safely

With edits you have not applied, closing asks first. The dialog reads Unsaved changes: "Apply them to the tile, or close and lose them." Choose Apply & Close to apply and close, or Close Anyway to close without applying.

Code that was still in the editor when the Studio went away is kept as a draft for that tile: for example, if you leave the report without closing the Studio, the next time you open the Studio a banner offers "Restore unsaved visual code from <time>?" with Restore and Dismiss. The offer appears only when the draft differs from the code on the tile, and Dismiss drops it.

Note

The draft holds code you had not applied. The tile keeps the last code you applied, and the report keeps the last version you saved.

When your applied code is on the tile and the report itself is unsaved, closing asks Save the report now?: "Saving writes a new report version; closing without saving keeps the changes in this tab only." Choose Save & Close or Close Without Saving.

Version history

History opens Version history, the code versions recorded by the report's saves; its tooltip reads "Version history - view and restore this visual's applied code". Every report save that applied this visual's code adds a version, so Apply alone does not.

For report versions themselves, see Build a report.

Edit a library visual and save it to the library

A library visual opens in the same Studio as a tile, with the same editor, Preview and AI panel.

  1. Open the visual library (DataPrism > Visuals) and select the visual you want to change.
  2. Select Edit code. The button appears for people who hold Author DataPrism Custom Visuals and either own the visual or hold Manage DataPrism Organization Visuals. See Who can do what in DataPrism.
  3. The Studio opens over the library, titled with the visual's name and the version it starts from, such as Sales wall - v3.

Use the AI panel

Attach report assets

  1. In edit mode, open the tile's Studio (Edit code), and select assets/ in the file tree. The number beside assets/ counts the report's files; the Visual assets dialog opens.
  2. Drop files onto the dialog, or click to pick them. The upload area reads Drop files here, or click to pick them and switches to Uploading.... Files upload one at a time, and one failed file reports Asset not uploaded without stopping the rest.
  3. Reference an asset in markup or CSS as asset://file-name, or by file name in a uni.assets call; see Custom visual SDK.

Diagnostics

In the Code view, Diagnostics opens the last runtime report for your code; its tooltip reads "Last runtime report: errors, console, violations, findings". The drawer lists each phase of the run and whether it finished, the errors with their positions, content the sandbox blocked, the code findings and the console output. When the last run had errors, the button carries an error badge.

What a custom visual tile shows

Read the tile's diagnostics drawer

Questions, answered

Why does the Studio ask me to open the report?

The Studio works beside the report it belongs to, in the same tab. When the report is not open, it shows "This visual belongs to a report that is not open. Open the report to keep editing it." with an Open report action that takes you to it. If the tile itself is gone from the report, it shows "This tile is no longer in the report, so there is nothing to edit here."; use Close to dismiss it.

Why is Apply greyed out in the Studio?

Two reasons. There is nothing new to apply: your code matches what the tile holds and the tile already has saved code. Or an AI turn is running, and Apply, Undo and Redo wait until it finishes.

What does "Tile changed" mean?

The tile's saved code changed for a file you were editing, so the Studio cannot merge them silently. Reload from tile takes the tile's version of that file; Keep mine keeps your edit.

I closed the Studio with edits I had not applied. Are they lost?

Your applied code is safe: the tile keeps the last version you applied. For the rest, the close dialog asks first (Apply & Close applies the edits and closes; Close Anyway closes without applying), and code that was still in the editor when the Studio went away is kept as a draft for that tile. Open its Studio again and a banner offers "Restore unsaved visual code from <time>?" with Restore and Dismiss; Dismiss drops the draft.

Closing the Studio asked me to save the report. Why?

The tile holds code you applied this session, and the report itself has unsaved changes. The dialog Save the report now? says "Saving writes a new report version; closing without saving keeps the changes in this tab only." Choose Save & Close or Close Without Saving.

Why does History say "No versions yet"?

A version is recorded only when the report is saved with the visual's code applied; Apply alone does not create one. Save the report after Apply, and the version appears here. For how report versions work in general, see Build a report.

Why does the Preview say "Changes not previewed"?

You changed the code since the Preview last ran it, and the Preview does not redraw on every keystroke. Click Run in the Preview bar, or press Ctrl+Enter while the Preview has focus, to see your edits; Apply also updates it.

How do I open the Studio for a library visual?

Open the visual from the visual library (DataPrism > Visuals) and select Edit code. You need Author DataPrism Custom Visuals, and you must own the visual or hold Manage DataPrism Organization Visuals; if the button is not there, ask an administrator. See Who can do what in DataPrism.

Does Save to library publish the visual?

Yes, when you hold Manage DataPrism Organization Visuals: the new version becomes the library head, and when report tiles use the visual you choose whether they move to it. Without that permission the version is saved as a draft for a publisher to publish. With nothing new to save, the button is disabled and its tooltip reads No changes to save yet. See Visual library.

The tile says "Paused to keep the page responsive". What does that mean?

The report paused this visual to stay responsive, and shows a faded snapshot of its last rendered state. Select Activate to run it again.

Why can I not open the tile's diagnostics drawer?

It opens only in edit mode, on a report you can edit. Switch the report into edit mode first; if you cannot, ask an administrator for edit access.

Why does my report warn about a large asset?

A file above 2 MB is marked large, because every frame that references it downloads its own copy. The dialog also warns when the report's files would pass the 8.0 MB a visual may transfer. Compress or remove the files you do not need.