4 ms·
see my post a couple down https://news.ycombinator.com/item?id=7868603 https://news.ycombinator.com/item?id=7868603 dc.js marries crossfilter.js with d3.js --
by zenocon 12y ago
see my post a couple down https://news.ycombinator.com/item?id=7868603 https://news.ycombinator.com/item?id=7868603
dc.js marries crossfilter.js with d3.js -- that's it in a nutshell.
crossfilter allows you to group and filter your data in-memory very quickly, and potentially for a LOT of data
See http://bl.ocks.org/milroc/7032589 http://bl.ocks.org/milroc/7032589 for a good intro to crossfilter (launch the demo on slide #39 -- loads 36M flight records).
you likely already know what d3 does. dc.js makes it easy to generate dashboards where the user can interact with the charts (e.g. filter by Q1, Q2...see the NASDAQ example at https://dc-js.github.io/dc.js/ https://dc-js.github.io/dc.js/)
- peterchon 12y agoI guess there in lies my question - d3 makes it easy to marry the data to a dom, making it easy to add interactivity. So, i guess why would I chose to use Dc rather than to use d3 with crossfilter.js?
- awjr 12y agoDc provides a set of tools for very quick delivery of a set of charts married to a crossfilter. Most importantly it allows those charts to interact based on filters applied in one chart being reflected across all other charts. Of note Dc generates d3 charts...so you can manipulate them to your hearts content. In my case, part of the tabbing functionality (context switch) is to destroy any in memory crossfilters AND hunt through the DOM for any d3 svg elements and delete them to aid browser performance.
- zenocon 12y agoConsider this example: https://square.github.io/crossfilter/#charts https://square.github.io/crossfilter/#charts and this example https://dc-js.github.io/dc.js/#yearly-bubble-chart https://dc-js.github.io/dc.js/#yearly-bubble-chart -- sure, you could probably do this without dc.js and crossfilter.js but it would be _a lot_ of work, and likely not re-usable. If you don't need interactive charts that you can drill-down into, don't use it. If you do, this is the best of breed right now for this kind of thing. dc.js doesn't abstract away the d3 api -- you can still use it to your hearts content, but it sure makes these kinds of examples really easy to spin up with minimal code.
- magicalist 12y agoI think you're missing the parent's point, at least in your first sentence. They said they could just use d3 and crossfilter instead of dc.js (which is exactly what your first example is doing, no dc.js there). Your second paragraph appears to be the answer to their question, however. dc.js looks like it provides higher level constructs, so you're joining data to a bar chart, not data to a series of rectangles that you need to then make into a bar chart. That's great for people that don't have the time or inclination to learn d3, and since it sounds like you can still get access to the full d3 API, it sounds like it could be useful to people that do know d3, as it would give them good starting points for a bunch of types of graphs that they could then tweak at will.