Comment by stevage
2 days ago
I tried D3 a few times, with some success, but eventually abandoned it. The mental model it requires is so different from other charting libraries it seems too difficult for my brain to grasp for any period of time.
Also, I've come to really dislike libraries that use this kind of `a.b().c()` chained form:
boxplotContainer
.append("line")
.attr("x1", xScale(gender) - boxplotWidth/2)
.attr("x2", xScale(gender) + boxplotWidth/2)
I find it hard to reason about. What is the return value of boxplotContainer.append("line")? How do I debug it? What values can I inspect?
That, and I really never got comfortable with the `.enter()` and `.exit()` and `.join()` concepts. It's so abstract.
> What is the return value of boxplotContainer.append("line")? How do I debug it?
I don’t know D3, but usually in these chaining approaches it would be something like:
Where debug() might be pipe() or some variation that lets you provide a callable where you can inspect the data (or drop into an interactive REPL, or whatever).