Live data from Hacker News

Dc.js – Dimensional Charting JavaScript Library

dc-js.github.io

31–40 of 40 posts

Re: Dc.js – Dimensional Charting JavaScript Library

#31
post #27
post #20

Earlier quoted context omitted.

One reason: Not everyone has access to those services within the firewall, so it's nice to have this as an option.

Just curious why this would be downvoted. I was trying to be helpful.

I think people downvoted you because you've misunderstood the question. Just trying to be helpful is not enough ;)

(since the GP asked for both google charts and d3.js, the firewall answer was irrelevant)

Re: Dc.js – Dimensional Charting JavaScript Library

#33
post #21

Could anyone explain the benefit of using Dc.js vs google charts API or d3.js? Crossfilter seems really cool - but since it's another library, what is it that Dc is offering?

see my post a couple down 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 for a good intro to crossfilter (launch the demo on slide #39 -- loads 36M flight records). you likely already know what d3 does. dc…

I 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?

Re: Dc.js – Dimensional Charting JavaScript Library

#34
post #3

I posted this as I've spent the last month with this library and it has made the creation of a multi tab dashboard a breeze. Once you get your head around http://square.github.io/crossfilter/ and the manipulations you can do with groups, dc.js really makes rendering the data very simple. 1.7 has just been released and 2.0 is 'around the corner'. It's a fantastic library and massive kudos to the people working on it.…

Can you explain what you found were the advantages of it over just using crossfilter and d3? It's not immediately apparent from the page. Is it that it wraps some of the complexities of d3 so you don't have to deal with them?

dc.js is the 'glue' that holds d3 and crossfilter together. So I can create a crossfilter, generate multiple dimensions, group those dimensions, then render multiple charts.

Applying a filter to one chart (e.g. clicking on Saturday) then get's reflected in the display of all the other charts.

Note you can also override the group().reduce() function if your data is a lot more complex.

In fact I went a bit crazy and had one set of reduce() functions create me the struct array I needed from which to create another crossfilter and apply that to a subset of charts.

I'm hopeful that, based on conversations in the dc group, crossfilter will just become the default data engine and this will be replaceable, but crossfilter is very powerful.

I'll be honest here and state that I don't have a deep knowledge of D3. dc.js had me producing a 'limited' set of charts within days.

What I have noticed is that the linechart really does not like you pushing too many data points to it. (I have 24 temperature min/max/avg points over a day for 8 sensors going back a year) however I think this may be a browser SVG limitation (6 other charts on the page). In this case, on a dashboard, this type of chart is nonsensical for what I am doing anyway (decision taken 30minutes ago).

Re: Dc.js – Dimensional Charting JavaScript Library

#35
post #29

Could anyone explain the benefit of using Dc.js vs google charts API or d3.js? Crossfilter seems really cool - but since it's another library, what is it that Dc is offering?

Google Charts API is an external resource, and you're limited to the capabilities of that API, whereas d3.js lets you do just about anything you'd want to do with SVG/Canvas & javascript including animations and interactions. The benefits of crossfilter or dc.js over plain d3.js is the layer of abstraction making it easier to use.

I never understood why the external resource is such a concern for devs - most of your application will be online with online access. Google is not making a call out to send data, but to retrieve what it needs to render the different chart formats, it saves time.

Re: Dc.js – Dimensional Charting JavaScript Library

#37
post #21

Earlier quoted context omitted.

see my post a couple down 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 for a good intro to crossfilter (launch the demo on slide #39 -- loads 36M flight records). you likely already know what d3 does. dc…

I 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?

Dc 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.

Re: Dc.js – Dimensional Charting JavaScript Library

#38
post #29

Earlier quoted context omitted.

Google Charts API is an external resource, and you're limited to the capabilities of that API, whereas d3.js lets you do just about anything you'd want to do with SVG/Canvas & javascript including animations and interactions. The benefits of crossfilter or dc.js over plain d3.js is the layer of abstraction making it easier to use.

I never understood why the external resource is such a concern for devs - most of your application will be online with online access. Google is not making a call out to send data, but to retrieve what it needs to render the different chart formats, it saves time.

Well, it's all fun and games with various APIs and remotely-hosted solutions, until those solutions start breaking and changing. For example, for awhile the news world loved making apps (simple infographics, interactives, etc) that used tabletop.js, which in turn pulled data from a google doc (spreadsheet, etc, which made it easier for text changes: programmers could program and editors could edit.)

Then, bugs surfaced after google altered login procedures. What should have been a simple JSONP call was replaced with a broken login page being returned instead of JSONP, that is: only if you hadn't logged into your google account for awhile. People who've never logged in or were logged into a google service were fine. Then they started throttling connections - per computer, per account, random without announcing it, etc. Debugging these things was frustrating.

So, in other words, a convenient feature becomes a liability very quickly.

Re: Dc.js – Dimensional Charting JavaScript Library

#39
post #21

Earlier quoted context omitted.

see my post a couple down 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 for a good intro to crossfilter (launch the demo on slide #39 -- loads 36M flight records). you likely already know what d3 does. dc…

I 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?

Consider this example: https://square.github.io/crossfilter/#charts and this example 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.

Re: Dc.js – Dimensional Charting JavaScript Library

#40
post #39

Earlier quoted context omitted.

I 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?

Consider this example: https://square.github.io/crossfilter/#charts and this example 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.j…

I 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.

Post reply on HN