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

Combination of compact & excludeSummaryFromExport props breaks CSV Export #87

Open
Smoothsmith opened this issue Feb 6, 2020 · 0 comments

Comments

@Smoothsmith
Copy link

Smoothsmith commented Feb 6, 2020

If you enable both of these props, then any rows that get compacted are treated as totals and get excluded from the CSV Export.

I can resolve it by making these changes in the library code (Did it directly in my node-modules for the moment):
if(self.compact && numSubDimensions == 1) {
subRow.includeInExport = true;
} //Inside subRows.forEach before the row is pushed.
https://github.com/davidguttman/node-dataframe/blob/27b1cc62255ac971d53f51f65670e6f072c2cc23/index.js#L106

Then I can check '|| row.includeInExport' prop on this line:

if (excludeSummary && (row._level < maxLevel)) return

But this requires 2 custom forks and feels messy.

(Apologies if I should just be doing a pull request or similar, I'm not quite sure of the right approach, and there's likely more elegant ways to make the same fix, so I thought I'd raise an issue instead).

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

No branches or pull requests

1 participant