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

Grouping (subtotals) #1088

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

jjagielka
Copy link

Added grouping of data with minimal changes in the main code. If new options are not activated code behaves as nothing is changed. With or without new options code passes all Jasmin tests.

Changes:

  • option grouping causes the insertion of group columns and rows like subtotal
  • option rowGroupBefore and colGroupBefore controls whether grouping is before or after the data cells. Default to rowGroupBefore true and colGroupBefore false
  • option rendererOptions.table.compactLayout turns the rows headers in to hierarchical structure. This option works only if grouping is set and defaults to true.

New example pivot() with grouping and compact layout added to examples/index.html
Also few styling entries added to pivot.css to control grouping rendering.

@nicolaskruchten
Copy link
Owner

Thanks for this PR!

A few questions:

  1. How is this different from Subtotal.js?
  2. Does this have any applicability other than for a table-like renderer, i.e. graphs?

@jjagielka
Copy link
Author

jjagielka commented Feb 24, 2019 via email

@nicolaskruchten
Copy link
Owner

OK, thanks for those answers. I'm hesitant to merge these changes into the main library as that means I will have to maintain them for the next few years, so I'll need to think about it a bit.

One other possibility... It looks like the changes you've made are in PivotData and the TableRenderer which is good, because both of those are injectable into PivotTable.js via parameters (dataClass and aggregator) without me merging this in, so you could do something similar to Subtotal.js and host your own repo with just those two components and the documentation for using them instead of the defaults if you like...

@nicolaskruchten
Copy link
Owner

nicolaskruchten commented Feb 25, 2019

This is basically how things started with Subtotal.js btw, after I added the dataClass parameter specifically for this use-case ;)

See: #506

@jjagielka
Copy link
Author

Rows and columns folding.
Now you can fold/expand rows and columns in all combinations: rows (above or below) and cols (before or after) the child data.
You can as well fold/expand whole levels (subtotal can only fold levels, cannot expand them).

As for your comment about dataClass, yes that's possible to make a subclass of PivotData and override those few methods changed, but you can't do that for pivotTableRenderer.

@kuklei
Copy link

kuklei commented Dec 3, 2019

Will this ever make it into the next release?

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.

3 participants