-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filterMultiple #5
Comments
+1: This is essential for working with qualitative dimensions. Perhaps that should be a first-class concept: a dimension with a low cardinality and weakly ordered values. |
Related: Allow records to have multiple values for a single dimension, such as labels or tags. Related: Allow independent filters on the same dimension. These could be intersected or unioned. |
That would be awesome! I have a dataset with a multi-valued field, and managed to make it filter on this field by generating a new record for each value in the field for each original record (thus making it ~10x larger). Then I used a custom reduce function to ensure the counts and summations were only on unique records (keyed by a unique ID per original record). I think this uniqueness checking hurt the performance quite a bit though so it would be great to do this efficiently internally. Something like this might work: t.dimension.multiple(function(d) { return d.multipleValues; }); Independent filters on the same dimension with union and intersection would solve my filterMultiple question; let me know if I can help with anything. |
Any updates on this? I need it! Very urgent :) In terms of the API, why not allowing value accessing functions returning arrays? var countries = crossfilter([
{name: "USA", languages: ["Spanish", "English", "Chinese", "French"]},
{name: "Canada", languages: ["French", "English"]}
]);
countriesByLanguage = countries.dimension(function(d) {return d.languages });
countriesByLanguage.filter('English');
countriesByLanguage.top(Infinity) // => [USA, Canada] FYI: I'm currently stripping down Data.js, in order to make it fast and to remove unneeded complexity. I'm going to drop the Data.Hash datastructures in favor of native Javascript primitives (arrays, objects). At the end of the day it should no longer be a Data Manipulation Library, but a Data Representation Library, letting users use Crossfilter for the sake of filtering. |
Can someone more familiar with the codebase comment on the feasibility of doing this? |
+1, agree with wjbuys above. The lib is fantastic, but it really need support multiple values for being used in most real-world cases dealing with qualitative dimension. |
Update CONTRIBUTING.md
As discussed in #151 an active fork is being developed in a new Crossfilter Organization. Please take further discussion there (if you haven't already) where it should be warmly welcomed by the new maintainers. Cheers! |
It would be great to filter on multiple values at once i.e. analogous to SQL's IN (…). I guess it makes implementation a bit more complicated because you're no longer just looking for a single range at a time. Alternatively, I guess I could create one dimension for each possible value, and then compute the union afterwards (but instantiating so many dimensions might be expensive?).
In case you haven't guessed yet, I'm seeing how easy it is to implement multi-faceted drilldown. :)
The text was updated successfully, but these errors were encountered: