Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide select and selectAll extension functions for RootElement #309

Open
twyatt opened this issue Dec 15, 2023 · 0 comments
Open

Provide select and selectAll extension functions for RootElement #309

twyatt opened this issue Dec 15, 2023 · 0 comments

Comments

@twyatt
Copy link
Member

twyatt commented Dec 15, 2023

It is idiomatic in D3 to perform selections on DOM and/or SVG elements, e.g.:

d3.select("tr")
    .selectAll("td")

In the above example, D3 users perform selections directly on UI/visual elements. It seems reasonable/convenient to provide an API that allows Krayon users to be able to perform selections directly from the RootElement, e.g.:

val root = RootElement()
root.selectAll(LineElement) // or: root.select(..)

This removes the ceremonious need to use asSelection, e.g.:

val root = RootElement()
root.asSelection()
    .selectAll(LineElement)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant