In DXR, a mark consists of a Unity prefab and a mark script: a Unity prefab is a template of a game object that can be easily instantiated in a scene, and its properties can be programmatically mapped to data using Unity's scripting language described/implemented in a mark script. To add new marks in addition to the built-in marks of DXR, the designer can create custom marks using one of two ways: 1) creating a custom prefab with generic mark script, or 2) creating a custom prefab with a custom mark script, both with examples below. Detailed instructions on how to create custom marks can be found in the Custom Marks and Channels tutorial. Here, we show examples of built-in custom marks: pinetree, and radialbar.
This type of custom mark consists of a custom prefab that uses the generic mark script - thus only supports generic visual channels described in the Encoding documentation.
This particular custom mark's prefab has a pivot point positioned at the bottom or base of the object, i.e., if the height is adjusted, the object gets scaled up with a pivot point at local (0,0,0) coordinates and spatial bounds of ([0, width], [0, height], [0, depth]) unlike prefabs with pivot points in the center which usually get new bounds of ([0, width], [-height/2, height/2], [0, depth]), e.g., the generic cube and sphere visual marks. Because of this pivot point behavior, we have to add the yoffsetpct channel which translates the mark instances -100% of their height - this offsets the translation of the mark instances to the same height position via the y channel (we need this to have the y-axis displayed). This type of adjustment is only usually needed for barchart type visualizations.
This type of custom mark consists of both a custom prefab and a custom mark script that extends the generic mark script - thus supports generic visual channels described in the Encoding documentation in addition to custom channels.
This example was adapted from https://github.com/Dandarawy/Unity3D-Globe. With the custom radialbar mark, the visualization below can now be easily reused to visualize different data sets, and can also be more intuitively modified, e.g., color map reconfigured, via the vis specs below, instead of low-level programming. You can check out the custom mark script here that implements the radialbar's custom channels:
Check out the detailed instructions on how to create custom marks and channels in the Custom Marks and Channels page.