christophergandrud / networkD3

D3 JavaScript Network Graphs from R
http://christophergandrud.github.io/networkD3
650 stars 269 forks source link

Fixed legend (#192) #211

Closed sirallen closed 7 years ago

sirallen commented 7 years ago

Addressed issue #192

cjyetman commented 7 years ago

Thanks! Just looking at the change, I imagine it works.

It’s not immediately clear why d3.select(el).select('svg') is different than svg, so maybe we can give the legend its own SVG group and name it appropriately.

sirallen commented 7 years ago

I think it's because you have (line 100)

svg = svg
    .append("g").attr("class","zoom-layer")
    .append("g")

So svg subsequently points to the group within the zoom layer.

cjyetman commented 7 years ago

Yes, just pointing out that we should probably do that better so it’s clear later on.