4 ms·
D3 has an unnecessarily non-intuitive API design, and I think that kills it for a lot of people. For example, why must a data join be performed like `selection
by pphysch 2y ago
D3 has an unnecessarily non-intuitive API design, and I think that kills it for a lot of people.
For example, why must a data join be performed like `selection.data(array).join(element-type)` instead of something like `selection.join(element-type, array)`. Looking from a pure API-design perspective, not getting bogged down in the technical details.
Lazy eval method chaining is a natural fit for applying+branching large amounts of HTML/CSS state updates but I feel that the designers took it a bit too far with the core D3 operations.
- hantusk 2y agoI don't think it was for the technical fit or performance reasons, but more a philosophy about everything starts with data, and graphics are just visualizations anchored to the data points (or a functionally derived property of the data points). That also means the d3-* libraries compose really well, since the data is the common binding, and not some conceptual class or custom element.