sisl / D3Trees.jl

Flexible interactive visualization for large trees in Julia using D3.js
Other
39 stars 7 forks source link

Specifying attributes as functions #3

Closed zsunberg closed 7 years ago

zsunberg commented 7 years ago

@mykelk had the idea of specifying the attributes of each node as a function, i.e.

f(i) = isodd(i) ? "fill:blue" : "fill:red"
D3Tree(children, style=f)

I don't think this is necessary right now because it's easy enough to do

D3Tree(children, style=[f(i) for i in 1:length(children)])

but we could add it if people want it. I just want to maintain as little code as possible.

mykelk commented 7 years ago

Yeah, that's fine.