asSelection

fun <E : Element> E.asSelection(parent: Element? = this.parent): Selection<E, Nothing?>

Constructs a selection with a single group containing this element. If no explicit parent is provided for the group, then this element's parent is used.


fun <E : Element> List<E>.asSelection(parent: Element? = this.firstOrNull()?.parent): Selection<E, Nothing?>

Constructs a selection with a single group containing these elements. If no explicit parent is provided for the group, then the first element's parent is used.