3 ms·
Hi Mike! Great open source work. I've used d3 on many projects and, perhaps interesting to some, have used it often not as a charting library, but as a view/ev
by zschuessler 11y ago
Hi Mike!
Great open source work. I've used d3 on many projects and, perhaps interesting to some, have used it often not as a charting library, but as a view/event model for DOM manipulation with advanced UI requirements (think dc.js and crossfiltering). This is after noticing that d3 works with large data sets very quickly - even those directly adding, removing, and editing DOM nodes & data.
My question for you is, broadly, where the speed of DOM manipulation comes from. Typically DOM interactions are very expensive in terms of execution time. I searched the docs and very briefly the source code to no avail.
Cheers, and thanks for open sourcing your work. It has been invaluable to my projects.
- mbostock 11y agoThe speed comes from doing less. :) Selections are designed so that you only modify the parts of the DOM that need to be updated, and don’t waste effort touching parts that are unchanged. The downside is that it can be more work for you, since D3 (unlike, say, React) relies on you to tell it what needs updating, rather than computing it automatically. But in my experience that trade-off is often worth it.
- zschuessler 11y agoOne more question from a lady at the airport listening g to me talk about d3 and some back story: You've had the opportunity to monetize d3 in the beginning, yet didn't (paid model). When it garnered reputation, you didn't implement freemium or other cost-free models. (Ads, consulting, enterprise, etc) At all stages you didn't monetize even when it'd be deemed fine. Why?
- megalodon 11y agoI don't know why, but as a student developer I really appreciate not bloating it with ads or freemium or whatever. I am of the opinion that scientific tools are best developed non-profit and open-source.