Build Vega-Lite Charts with Rel

Posted October 18, 2021 by Mary McGrath ‐ 1 min read

Rel now has convenience relations that make building interactive charts easier.

We are excited to announce enhanced Rel language support for Vega-Lite in the RAI Console.

Rel now provides high-level utilities for common chart types, including bar charts, line charts, and scatter charts. We have added convenience relations making it much easier to build these interactive charts from your data.

We have two Rel visualization libraries: the Vega Visualization Library and the Vega-Lite Visualization Library. The Vega-Lite library includes templates and utilities to help you plot your own bar, line, scatter, and custom charts.

As an example, the following code can be run in a RAI Notebook to display a simple bar chart:

def data:letter = {(1, "A"); (2, "B"); (3, "C")}
def data:number = {(1, 24); (2, 67); (3, 43)}

def chart = vegalite:bar[:letter, :number, {:data, data}]
def output = vegalite:plot[chart]

This will display as below:

For more information about the new convenience relations for Vega-Lite, refer to our Data Visualization (Vega-Lite) guide.