Builds one table, with its columns, for lineage diagrams rendered by
lineage_flow(). Use this together with create_column_edge() when you
want full control over the diagram instead of extracting lineage
automatically.
Arguments
- table_name
Name shown in the node header. Also used as the node id, so it must be unique within a diagram.
- columns
Character vector of column names listed in the node. Each column gets connection handles that edges can attach to.
- x, y
Position of the node on the canvas, in pixels. Nodes remain draggable, so these only set the starting layout.
- table_type
One of
"source"(blue),"transform"(orange), or"target"(green). The colors follow the conventions used by tools like dbt and SQLMesh.
Value
A node list ready to pass to lineage_flow()
See also
extract_lineage() to build nodes and edges automatically
Other manual lineage builders:
create_column_edge(),
lineage_example()
Examples
create_table_node(
table_name = "customers",
columns = c("id", "name", "email"),
table_type = "source"
)
#> $id
#> [1] "customers"
#>
#> $type
#> [1] "tableNode"
#>
#> $data
#> $data$label
#> [1] "customers"
#>
#> $data$columns
#> [1] "id" "name" "email"
#>
#> $data$tableType
#> [1] "source"
#>
#> $data$colors
#> $data$colors$bg
#> [1] "#f0f7ff"
#>
#> $data$colors$border
#> [1] "#3b82f6"
#>
#> $data$colors$header
#> [1] "#1d4ed8"
#>
#>
#>
#> $position
#> $position$x
#> [1] 0
#>
#> $position$y
#> [1] 0
#>
#>
#> $draggable
#> [1] TRUE
#>
#> $sourcePosition
#> [1] "right"
#>
#> $targetPosition
#> [1] "left"
#>