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

implement .data for dataTable #651

Open
gordonwoodhull opened this issue Jul 22, 2014 · 10 comments
Open

implement .data for dataTable #651

gordonwoodhull opened this issue Jul 22, 2014 · 10 comments
Milestone

Comments

@gordonwoodhull
Copy link
Contributor

The data table reads data differently from the other charts: instead of reading group.all() it reads dimension.top(_size). Thus it's never been hooked up to the base chart's .data() and there is no way to customize how the data is read from the chart.

Suggest that we make this difference explicit: let it override .data with a method that takes a dimension and returns the top records, and have nestEntries call this instead of doing this itself. Then the input data can be preprocessed in the same way it is supposed to work for other charts (notwithstanding #584).

@gordonwoodhull
Copy link
Contributor Author

E.g. simply showing the bottom N rows instead of the top would be nicely supported this way.

@namtab00
Copy link

I'd also like to suggest allowing deeper control on the tags the dataTable chart generates..

In 2.0.0-alpha.2 (and I suspect in earlier realeases also) it generates a tbody with nested tr's.

This means it's impossibile to have fixed headers (thead > th) with a scrolling, fixed height tbody (CSS doesn't allow specifying overflow-y: scroll on tbody).

It should at least generate a full table tag, as to allow a separate table with a thead only for table headers... If reccomended I'll put this on a different issue.

@gordonwoodhull
Copy link
Contributor Author

@namtab00, we actually have an open PR for column headers; would you please give it a try and offer comments? It's #668.

I guess that's not exactly what you're asking, but that would be the place to start.

@gordonwoodhull
Copy link
Contributor Author

@namtab00, I merged #668. I guess it doesn't really help with what you're asking for, but maybe you could open another ticket with your request so it doesn't get lost? It really doesn't have to do with the issue in this ticket.

@sleidig
Copy link

sleidig commented Mar 31, 2015

Is there any patch or workaround for the current beta to display top/bottom n rows in a dataTable? Or something I can contribute to get this functionality in?

@gordonwoodhull
Copy link
Contributor Author

What feature are you looking for, @sebastian-leidig? The issue listed here is rather obscure and displaying the top/bottom N rows is supported as far as I know. Just use .size and .order

https://github.com/dc-js/dc.js/blob/master/web/docs/api-latest.md#data-table-widget

@sleidig
Copy link

sleidig commented Mar 31, 2015

Thanks, that is indeed exactly what I need. Somehow I didn't notice the .size function but instead saw some answer on StackOverflow referencing .data.

@ozer85
Copy link

ozer85 commented Nov 26, 2015

Is there any update on this? I'm trying to exclude rows from a data table that contain a given value, but as I understand it this isn't currently possible in dc.js because neither the fake group method nor the .data() method for removing records work with a data table.

Thanks for the awesome library.

@rrajeevan
Copy link

Hi @gordonwoodhull, not sure if this is related but is there a way you can gray out the rows that aren't part of the current group? We do this in all other charts: rowChart, bubbleChart etc. Thanks for the awesome library, btw!

@gordonwoodhull
Copy link
Contributor Author

Hi @rrajeevan, this issue is not related so probably not the best place. You could open a new issue, but as I explained on your SO question I actually don't see a good way to implement this based on the crossfilter API.

And actually it's not really the same as the other charts you mention, because crossfilter groups do not observe their own dimensions, so it's easy to create a chart that only greys out the unfiltered part when that chart is the source of the current filtering. What you're asking for is a chart that observes the filtered and unfiltered data for all other charts (and does not have its own filter). That's a more complicated interface.

I hope that the SO question generates some discussion; I added the crossfilter tag to it because that's really the level this problem is on.

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

No branches or pull requests

5 participants