crossfilter examples

4,119 views
Skip to first unread message

Aaron

unread,
Jun 25, 2012, 3:10:54 PM6/25/12
to d3...@googlegroups.com
Are there examples of crossfilter in addition to the flight information one?

thanks
a

Pablo Navarro

unread,
Jul 19, 2012, 4:55:54 PM7/19/12
to d3...@googlegroups.com
I found this example http://jsfiddle.net/iros/wc8ba/3/ quite useful. Good luck!

timelyportfolio

unread,
Jul 23, 2012, 3:43:32 PM7/23/12
to d3...@googlegroups.com
maybe this if you have not seen  http://nickqizhu.github.com/dc.js/ 

Irene Ros

unread,
Jul 23, 2012, 3:49:12 PM7/23/12
to d3...@googlegroups.com
What are you trying to do Aaron? I can try and help (aforementioned fiddle is one of mine.)
Thanks,
-- Irene

Aaron

unread,
Jul 26, 2012, 10:44:18 AM7/26/12
to d3...@googlegroups.com


On Monday, July 23, 2012 3:49:12 PM UTC-4, iros wrote:
What are you trying to do Aaron? I can try and help (aforementioned fiddle is one of mine.)
Thanks,
-- Irene

Thanks for the offer Irene! I have made a web app that uses crossfilter to filter a large dataset. This post originally was written because I did not know how to dynamically construct dimensions and groups, but I have that working. Now there are a few challenges that I am facing. The first is that I would like to remove dimensions. The second is that the brush on my histograms dont always work on the edges. 

Thanks! 

Daniel Feusse

unread,
Sep 19, 2012, 9:30:28 PM9/19/12
to d3...@googlegroups.com
Hi All,

I am working through the crossfilter example, trying to add a filter, and am having difficulties. The example posted by timelyportfolio is great, yet uses dc.js and I'm newer to d3 and it's proving hard for me to mesh with the flight example which is entirely D3 with the dc.js/d3 example. More specifically, to keep it as simple as possible, I am trying to add a donut chart much like in the example posted by timelyportfolio to the flight example to be able to filter by a nominal scale. For example, it could be N, S, E, W. After I can achieve this, I can move forward to my project, but am stuck. 

My progress so far is I have tried to add four dimensions and groups to the code. One dimension looks similar to: 'west = flight.dimension(function(d) {return $.inArray("w", d.region); }) and a group looks like: wests = west.group().

Have now tried multiple ways to cleanly mesh a donut chart into the code and am having troubles getting it to run. Any help would be much appreciated. Thanks so much.

Jonathan Sedar

unread,
Jun 19, 2013, 5:55:29 PM6/19/13
to d3...@googlegroups.com
Hi all - I'm looking to use dc.js in my projects and having major issues getting the damn thing to work. I found this thread and have tried to run the example http://jsfiddle.net/iros/wc8ba/3/ with no luck - it isn't returning any results to me.

Just to make sure, I've created my own simpler version http://jsfiddle.net/jonsedar/STU92/4/ which isn't working either!

Could someone please enlighten me?

Cheers, Jon

Christophe Viau

unread,
Jun 19, 2013, 5:59:27 PM6/19/13
to d3...@googlegroups.com
First, you are trying to use dc.js and crossfilter as external resources in jsfiddle, but you are linking to their github page (i.e., https://github.com/NickQiZhu/dc.js/blob/master/dc.js)
Chris
--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jonathan Sedar

unread,
Jun 19, 2013, 6:10:03 PM6/19/13
to d3...@googlegroups.com
Good point - I've just updated to the raw files, which seem to lead to the right file at least: https://raw.github.com/jonsedar/dc.js/master/dc.js and https://raw.github.com/jonsedar/crossfilter/master/crossfilter.js (I forked the master repos this evening so will be up to date)

Just reset the latest version to be base version too - apologies this is my first time using JSfiddle.

Still no joy - when I run locally and example the console, I get an error "Uncaught TypeError: Cannot set property '__group_index__' of null" at dc.js:2428.

I thought the group() might not be working correctly, but the console logs

console.log(paymentsByTotal.top(10));
console.log(paymentGroupsByTotal.top(10));

... both look okay.


Thanks, Jon

Jonathan Sedar

unread,
Jun 19, 2013, 6:25:57 PM6/19/13
to d3...@googlegroups.com
Aha! As a dirty hack I simply chucked the dc.js and crossfilt.js onto my static S3 bucket and served them from...

And it seems to work :)

Which means at least my code's not completely wrong, but perhaps more annoyingly, something's wrong with my setup. Back to the drawing board....

Thanks all the same! Jon

Tad Vinci

unread,
Dec 22, 2013, 5:53:52 PM12/22/13
to d3...@googlegroups.com
I've written a tutorial for crossfilter and dc.js here which might be of help. The examples for dc.js are all in jsfiddle:
Part 1: http://www.codeproject.com/Articles/693841/Making-Dashboards-with-Dc-js-Part-1-Using-Crossfil
Part 2: http://www.codeproject.com/Articles/697043/Making-Dashboards-with-Dc-js-Part-2-Graphing

Curran

unread,
Sep 2, 2014, 2:04:25 PM9/2/14
to d3...@googlegroups.com
Hello,

I'm wondering, is there any way to specify an inclusive range with crossfilter's filterRange? I'm passing the intervals defined by a D3 brush into filterRange, but the implementation provides an exclusive range, so not all marks are selected when they should be. The code I am working with is this linked views example. The points along the top border should be selected but are not.

Possible solutions I have considered include:
  • Modifying the brushed interval to be slightly larger than it actually is (e.g. adding 0.01), but this feels like an ugly hack.
  • Implementing an inclusive range filter using filterFunction. This would work, but I imagine it would not perform as well as filterRange, as filterRange is probably heavily optimized based on the nature of range filtering.
Any thoughts? Has anyone come across this issue before? Thank you very much.

Best regards,
Curran

Ethan Jewett

unread,
Sep 3, 2014, 9:40:49 AM9/3/14
to d3...@googlegroups.com
Hi Curran,

Actually, filterRange should be inclusive of the beginning of the range but not the end. Which totally doesn't help you :-)

In my experience, I just use filterFunction when I need to do something like this. It's not as fast (I believe that you're right and filterRange is optimized), but it's still quite fast.

Regards,
Ethan


--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Curran Kelleher

unread,
Sep 3, 2014, 4:19:18 PM9/3/14
to d3...@googlegroups.com
Hi Ethan,

Thank you for your response. I ended up solving the problem by adding a small number to the brush extent only when the brush is at the maximum extent of the scale. The linked views example now works correctly.

Best,
Curran


--
You received this message because you are subscribed to a topic in the Google Groups "d3-js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/d3-js/17EecffFu8Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to d3-js+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages