Skip to content

SVG Information

Info

New in Atfinity 18.

Definition

SVG is an information type whose value is a picture, drawn from a template that reads the values of the instance it belongs to and of its case. Use it for what reads better as a picture than as a value, such as a risk gauge, a family tree or the progress of an onboarding.

Atfinity draws and stores the picture itself, like the value of a calculated information, so no user, rule or API call can set it, and RuLa can neither read nor assign it. Since no document can hold it, it is drawn only for an instance where a rule requires it with Require Information. Drawing Pictures with SVG Information explains the template.

Where it is shown

A case shows the picture at its field, at the size the template declares, scaled down to fit but never up. With Keep Aspect Ratio switched off, it no longer shrinks evenly: in a case it is squeezed to the width of its field, and in an SVG widget it is stretched to fill the widget. An instance page shows it in its detail view, and an instance tree page in an SVG widget.

It cannot be shown in the End User Wizard, on a document, as a column or filter of a page, or in any other widget, and it is not searchable. Once an information is live, its type cannot be changed to or from SVG.

Example

A risk score badge for a person, red from a score of 70:

<svg xmlns="http://www.w3.org/2000/svg" width="120" height="40">
  <rect width="120" height="40" rx="8" fill="{{ '#dc2626' if (self.risk_score.value or 0) >= 70 else '#16a34a' }}"/>
  <text x="60" y="26" text-anchor="middle" fill="#ffffff">Risk {{ self.risk_score }}</text>
</svg>