Pete Vilter and Mary McGrath
11 November 2021
less than a minute read
We are excited to announce that you can now use Graphviz to visualize directed and undirected graphs in RAI notebooks. Just provide node and edge relations, and the notebook will render the graph.
You can use attributes to determine the style and layout of the graph. Subgraphs allow finer grained control.
A module containing the following:
:node
: a unary relation of identifiers (usually strings or integers) to use as node ids.:edge
: a binary relation of edges as (from
, to
) pairs of node ids.Here is an example, using a small family tree to generate a graph. We have defined the nodes and edges as below.
def nodes = "grandparent"
def edges = {
("grandparent", "parent A");
("grandparent", "parent B");
}
module attributes
def node = "fontname", "Helvetica"
end
module subgraphs["parents"]
def node = {"parent A"; "parent B"}
def edge = "parent B", "child"
module attribute
def node = {("color", "lightgrey"); ("style", "filled")}
def graph = "bgcolor", "lightblue"
end
end
module subgraphs["children"]
def parent = "parents"
def node = "child"
end
module graph
def node = nodes
def edge = edges
def attribute = attributes
def subgraph = subgraphs
end
def output = graphviz[graph]
When run in the RAI notebook, the following graph is generated:
Please refer to our Visualization Library (display) for further information.
We are excited to announce worksheets, a new interface for submitting Rel queries. Worksheets allow you to develop blocks of Rel code and run them against a database. They can be shared with other users using their URLs.
Read MoreWe are excited to announce the support of varargs in Rel. You can use varargs to write more general code that works for multiple arities. Varargs can be useful when writing generic relations for common utilities.
Read MoreValue types help distinguish between different kinds of values, even though the underlying representation may be identical. Value types can be used to define other value types.
Read More