All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.Join.kt Maven / Gradle / Ivy

The newest version!
package com.juul.krayon.selection

import com.juul.krayon.element.Element
import com.juul.krayon.element.ElementBuilder

/** See analogous [d3 function](https://github.com/d3/d3-selection#selection_join). */
public fun  UpdateSelection.join(
    builder: ElementBuilder,
): Selection = join { append(builder) }

/** See analogous [d3 function](https://github.com/d3/d3-selection#selection_join). */
public inline fun  UpdateSelection.join(
    crossinline onUpdate: Selection.() -> Selection = { this },
    crossinline onExit: Selection.() -> Unit = { remove() },
    crossinline onEnter: EnterSelection.() -> Selection,
): Selection {
    val enter = enter.onEnter()
    val update = onUpdate()
    exit.onExit()
    return enter.merge(update).order()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy