Skip to content
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

Add filtering information to the data table #697

Closed
wants to merge 1 commit into from
Closed

Add filtering information to the data table #697

wants to merge 1 commit into from

Conversation

npmiller
Copy link

@npmiller npmiller commented Sep 9, 2014

Add the information if a line of the table is filtered or not. This info is stored in a CSS class .selected or .deselected. This allows us to display filtered data on the table as well.

This info is stored in a CSS class .selected or .deselected
@gordonwoodhull
Copy link
Contributor

Okay, I'm confused. This looks like a good idea, but I tried testing it, crossfilter's dimension.top actually does observe the filters on the same dimension - which is inconsistent with group.top and totally caught me off guard.

This method intersects the crossfilter's current filters, returning only records that satisfy every active filter (including this dimension's filter).

https://github.com/square/crossfilter/wiki/API-Reference#dimension_top

https://github.com/square/crossfilter/blob/master/src/crossfilter.js#L309

Given this, how are you using this mod?

@npmiller
Copy link
Author

npmiller commented Dec 3, 2014

Here's what we are doing with our modified version of dc.js:
http://loganalysis.github.io/analytics-js/
You can see the table with this mod at the bottom of the middle pan, if you filter something on the dimension shown on the table, it gets highlighted in the table.

@gordonwoodhull
Copy link
Contributor

That's impressive!

I only poked around for a little while but it looks like you are using the 'trick' of passing a group as a dimension to the dataTable?

I guess this is one of those cases that works sort of by accident because of the loose coupling between dc.js and crossfilter. We don't have a test for it yet. I guess it wouldn't work if there were built-in support for filtering on tables, because groups have no .filter function.

Perhaps this case should be officially supported.

@npmiller
Copy link
Author

npmiller commented Dec 3, 2014

Ok, I see what you mean. And you're right we are lucky it works.

We have a function listening for filtering events on the charts in order to synchronize the charts of the same dimension. So when we filter on the table, the filter is also applied to the other charts of the same dimension (at least one wordcloud), and so the crossfilter dimension is also filtered.

So yeah, it wouldn't work in dc where this synchronization behavior between charts of the same dimension does not exists.

@gordonwoodhull
Copy link
Contributor

Ah, that is great to hear, thank you.

I am planning to implement something much like that because currently filtering on composite charts does not work right, since the chart gets out of sync with itself. It's the only feature I plan to implement for 2.0; the rest are (a lot of!) bug fixes and reviewing these PRs.

It is very interesting that the feature in this PR works by the combination of the "group-table trick" and by linking to another chart which actually does the filtering on its own reference to the dimension.

I will think on this some more and schedule this PR for 2.1. Although I'm pretty sure it is safe now, I just want to think it through... And see if I can learn anything else from your "linking" implementation, if you don't mind.

Thanks again.

@gordonwoodhull gordonwoodhull added this to the v2.1 milestone Dec 3, 2014
@gordonwoodhull
Copy link
Contributor

I think this will be relevant with the fix for #681 and a constellation of other problems which is in the sync-filter branch. Linking this to those to merge at the same time, and add a test for the group-as-dimension trick that makes this one work.

@vmantese
Copy link

http://loganalysis.github.io/analytics-js/ is down.
npmiller do you mind reposting that? Does anyone have an example of what was on that site?

@npmiller
Copy link
Author

@vmantese ah, sorry, the url changed, use this one:
https://loganalysis.github.io/analytics.js/

@vmantese
Copy link

@npmiller Beautiful.

@vmantese
Copy link

Can we close this?

@gordonwoodhull
Copy link
Contributor

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants