Universal Data Model

Blueprints and exporters are a very powerful technology allowing you to define, manipulate, and generate nearly any textual output. However, the primary reason for technology like this is the code generation, converting designs and design data into production-ready code.

Supernova gives you the ability to tap into a vast pool of information about every processed design, down to the last atomic element, down to the last code property - and you access all of it through the Universal Data Model (UDM).

This is how Universal Data Model works and communicates with the rest of the Studio:

Data flow describing how data get transformed into UDM, and how exporter uses them

Model construction

The data model is one unified description of the design and all additional data available in Supernova (including computed data). The data model is created in the following way:

  1. Design from a design tool is processed and converted into an intermediate form

  2. The intermediate form is refined - optimizations are run on top of the raw data to understand the purpose behind each design element, and to clean it from any design data that have no informational value. This can be hidden layers, extraneous groups, wrong labels and so on

  3. The intermediate form is converted into stable Universal Data Model

Once the design was converted into the stable UDM, it is ready to be used in the exporters. Exporters can access all data obtained from this import chain, such as project screens, screen components, animations, localizations, and much, much more.

Universal Data Model shields you from the differences coming from the design editors. For example, Sketch and Figma data models are vastly different, with different concepts and different usage patterns. Supernova unifies those models into one that is much closer to what you expect in the development world.

Accessing the Data

In terms of exporters, Universal Data Model describes exactly one, currently opened project. This means that you can run the exporter and produce a certain output, then open another save file, and produce a completely different output - using the same exporter. There are 2 main sources of data available:

  1. Stored data, which are either provided by the user or as the initial information obtained by importing the design file. This is everything from screens to components to animations to navigation connections and any other piece of information you'll find in the editor interface

  2. Computed data, which are created on the fly when requested. Exporters and blueprints have the entire Supernova computing engine available, so you can request to compute a valid flexbox layout, compute unique names, get dynamic assets and so on

Universal Data Model is read-only. Exporters can temporarily change or obtain some information (such as layout) using computing functions, but the underlying model will not change, therefore it stays the same for any other exporter running afterward. UDM can only be changed through operations inside the editor.

You access UDM and all stored procedures using functions. All functions can be invoked from every blueprint, without limitations.

Model Objects and Functions

This documentation provides a description of all objects and all functions you can use within blueprints. Select which one you are interested in to explore more.