Variables

Variables are values that can be set globally for a given layout – most commonly via the sidebar's Variables menu. They’re prefixed with a $, for easy reference – e.g. $my_global_var – and can be set to any valid string, number, or boolean value.

variables menu

Leverage variables to quickly switch between subsets of your data. Certain panels can update or read variables from within the layout. For example, the 3D and Variable Slider panels have built-in ways to quickly update variables with user interactions. Panels that support message path syntax – like Raw Messages, Plot, and State Transitions – can reference variables to dynamically decide what to visualize.

Example workflow:

  • Create a $my_ID variable in the Variables menu, and set its value to 101
  • Type /my_objects.objects[:]{id==$my_ID} in a Raw Messages panel to inspect the object whose id field equals 101
  • Add /my_objects.objects[:]{id==$my_ID}.velocity as a y-axis value in a Plot panel to plot that same object's velocity

Keyboard shortcuts

  • / – Quickly update numeric variable values