https://kotlinlang.org logo
Title
m

mbonnin

03/15/2021, 10:43 AM
Hi 👋 Is it possible to build a Tree representation with data2viz? Looking at the source, it looks like
TreeLayout
is what I want to use to position my nodes. I guess I'll have to do the drawing myself? Is there anything in the library to draw connectors ?
p

pmariac

03/15/2021, 2:26 PM
Hello Martin, that's right, you should use TreeLayout to build your tree, then iterate over your nodes to draw basic shapes. If you want some Bézier curves, the LinkBuilder in the io.data2viz.shape module is what you're looking for.
Check this sketch for example : https://play.data2viz.io/sketches/wJwZBY/view/
😍 1
m

mbonnin

03/15/2021, 4:55 PM
Thanks !
👍 1
For what it's worth, I'm not able to login with github on that page. I clicked "View" -> "Editor" to see the code but haven't been able to hit the "fork" button
p

pmariac

03/15/2021, 4:59 PM
thanks for notifying, we're updating the play website and some bugs are still to be fixed, we'll check this ASAP.
m

mbonnin

03/15/2021, 4:59 PM
Is there a matching github repo somewhere?
(the ability to edit in the browser is pretty cool!)
g

gaetan

03/15/2021, 5:05 PM