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

commonMain.Merge.kt Maven / Gradle / Ivy

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

import com.juul.krayon.element.Element

/** See analogous [d3 function](https://github.com/d3/d3-selection#selection_merge). */
public fun  Selection.merge(
    other: Selection,
): Selection = Selection(
    groups.mapIndexed { groupIndex, group ->
        Group(
            group.parent,
            group.nodes.mapIndexed { nodeIndex, node ->
                node ?: other.groups[groupIndex].nodes[nodeIndex]
            },
        )
    },
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy