Package-level declarations

Types

Link copied to clipboard
class Arguments<D, T>

Wrapper around d3's standard argument order. This helps serve as syntax sugar for their style of overloading, where you often don't use the arguments at all, or only bind the first one or two.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class ExitSelection<E : Element, D>(groups: List<Group<E, D>>) : Selection<E, D>
Link copied to clipboard
data class Group<E : Element, D>(val parent: Element?, val nodes: List<E?>)
Link copied to clipboard
open class Selection<E : Element, D>(val groups: List<Group<E, D>>)
Link copied to clipboard
class UpdateSelection<E : Element, D>(groups: List<Group<E, D>>, val enter: EnterSelection<D>, val exit: ExitSelection<E, D>) : Selection<E, D>

Functions

Link copied to clipboard
inline fun <E1 : Element, E2 : Element, D> Selection<E1, D>.append(crossinline value: E1.(Arguments<D, E1?>) -> E2): Selection<E2, D>

See analogous d3 function.

Link copied to clipboard
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.

Link copied to clipboard
fun <E : Element, D1, D2> Selection<E, D1>.data(value: (index: Int, group: Group<E, D1>) -> List<D2>): UpdateSelection<E, D2>
fun <E : Element, D1, D2> Selection<E, D1>.data(value: List<D2>): UpdateSelection<E, D2>

See analogous d3 function.

Link copied to clipboard
inline fun <E : Element, D, S : Selection<E, D>> S.each(crossinline action: E.(Arguments<D, E?>) -> Unit): S

See analogous d3 function.

Link copied to clipboard
inline fun <E : Element, D> Selection<E, D>.filter(crossinline filter: E.(Arguments<D, E?>) -> Boolean): Selection<E, D>
Link copied to clipboard
fun <E1 : Element, E2 : Element, D> Selection<E1, D>.insert(builder: ElementBuilder<E2>, before: ElementSelector<*>): Selection<E2, D>
inline fun <E1 : Element, E2 : Element, D> Selection<E1, D>.insert(crossinline value: E1.(Arguments<D, E1?>) -> E2, before: ElementSelector<*>): Selection<E2, D>

See analogous d3 function.

Link copied to clipboard
inline fun <E : Element, D> UpdateSelection<E, D>.join(crossinline onUpdate: Selection<E, D>.() -> Selection<E, D> = { this }, crossinline onExit: Selection<E, D>.() -> Unit = { remove() }, crossinline onEnter: EnterSelection<D>.() -> Selection<E, D>): Selection<E, D>

See analogous d3 function.

Link copied to clipboard
fun <E : Element, D1, D2> Selection<E, D1>.keyedData(value: (index: Int, group: Group<E, D1>) -> List<D2>, key: Element?.(Arguments<Any?, Any?>) -> Any?): UpdateSelection<E, D2>
fun <E : Element, D1, D2> Selection<E, D1>.keyedData(value: List<D2>, key: Element?.(Arguments<Any?, Any?>) -> Any?): UpdateSelection<E, D2>

See analogous d3 function.

Link copied to clipboard
fun <E : Element, D> Selection<E, D>.merge(other: Selection<E, D>): Selection<E, D>

See analogous d3 function.

Link copied to clipboard
fun <E : Element, D, S : Selection<E, D>> S.order(): S

See analogous d3 function.

Link copied to clipboard
fun <E : Element, D, S : Selection<E, D>> S.remove(): S

See analogous d3 function.

Link copied to clipboard
inline fun <E1 : Element, E2 : Element> E1.select(crossinline select: E1.(Arguments<Nothing?, E1?>) -> E2?): Selection<E2, Nothing?>

Syntax sugar for calling asSelection followed by select.

inline fun <E1 : Element, E2 : Element, D> Selection<E1, D>.select(crossinline select: E1.(Arguments<D, E1?>) -> E2?): Selection<E2, D>

See analogous d3 function.

Link copied to clipboard
inline fun <E1 : Element, E2 : Element> E1.selectAll(crossinline select: E1.(Arguments<Nothing?, E1?>) -> Sequence<E2>): Selection<E2, Nothing?>

Syntax sugar for calling asSelection followed by selectAll.

inline fun <E1 : Element, E2 : Element, D> Selection<E1, D>.selectAll(crossinline select: E1.(Arguments<D, E1?>) -> Sequence<E2>): Selection<E2, D>

See analogous d3 function.