Skip to content

Combination of compact & excludeSummaryFromExport props breaks CSV Export #87

Open
@Smoothsmith

Description

@Smoothsmith

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions