3 ms·
Presumably, gp has forgotten. > I wish I could give that author the credit they deserved.
by infogulch 6y ago
Presumably, gp has forgotten.
> I wish I could give that author the credit they deserved.
- summitsummit 6y agoyes, i gathered as much. they showed enough desire to give credit and enough interest and skill in the matter that i find it hopeful they could find it again if they sought it out.
- atonse 6y agoSorry I don't even remember what it looked like. But the guide from @wattenberger is in the same vain. It might have been it :-) My overall point is that if you are struggling with d3, take a step back and really try to understand the conceptual building blocks. It'll make a world of difference.
- siddboots 6y agoThese two posts by the creator, Mike Bostock, sound similar to what the gp described. https://bost.ocks.org/mike/join/ https://bost.ocks.org/mike/join/ https://observablehq.com/@d3/selection-join https://observablehq.com/@d3/selection-join
- jcheng 6y agoThat first one is what did it for me, years ago—IMHO it’s not even worth trying to form a mental model of d3 until after you’ve read that.
- tonto 6y agoThe data join thing is interesting. I'd be curious about other future opportunities for d3 to sync up more with react. Posts like this [0] show that d3 can "just generate the path" and then at that point you can use different renderers like React e.g. return <path d={line(data)}/>. It is more limited doing it this way but more ties into the react model would be wonderful https://observablehq.com/@d3/d3-line https://observablehq.com/@d3/d3-line
- jwilber 6y agoI don’t have any public codebase examples at hand, but what we’ve done at work also works quite well: basically we implement our D3 charts as a class with methods corresponding to desired lifecycle events. We then create a Component wrapper around said class and call the methods during their corresponding lifecycle events. (Idk how confusing or not that was but I wish I had a repo to share to make it clearer). There’s also a book I read while ago from Swizec Teller on d3 + react integration[0]. It may be dated by now as it’s been some time since I last read it, but it’s worth looking into! [0] https://leanpub.com/reactd3jses6 https://leanpub.com/reactd3jses6