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

Added ability to slice data-grid results for pagination; fix data-grid docs #946

Closed
wants to merge 1 commit into from

Conversation

calvino
Copy link
Contributor

@calvino calvino commented Jun 10, 2015

There was no way to create pagination for datagrid results with the current API. This was a huge feature request as grid items are based on html and with large datasets dc.js would be rendering a huge number of DOM nodes that were not relevant to the user. Using .top() to filter was not enough as most users expect to be able to see the next available page.

Because of this limitation I added the ability to specify a slicing range. I am slicing the entries array to achieve this. With the beginSlice and endSlice attributes it is fairly simple to implement pagination using datagrids. Updating these parameters and then redrawing the graph also for very simple and efficient pagination, eliminating the need to draw possible hundreds of thousands of DOM nodes.

I also added a comment that notes the difference between how dataGrid uses .group() versus the other charts. DataGrid actually wants a keying function, not a crossfilter function. This was very confusing to myself and other developers, so I explicitly call out this discrepancy in the documentation.

@gordonwoodhull gordonwoodhull added this to the v2.0 milestone Aug 5, 2015
gordonwoodhull added a commit that referenced this pull request Aug 5, 2015
@gordonwoodhull
Copy link
Contributor

Thanks @calvino! Merged for 2.0 beta 16.

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.

2 participants