nicolaskruchten / pivottable

Open-source Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop.
https://pivottable.js.org/
MIT License
4.35k stars 1.08k forks source link

Does pivottable handle objects with attributes that contain arrays? #1301

Closed felesterio closed 2 years ago

felesterio commented 2 years ago

Per, https://pivottable.js.org/examples/simple_ui.html Consider:

    $(function(){
        $("#output").pivotUI(
            [
                {color: "blue", shape: "trapezoid", parent_shapes: ["quadrilateral"] },
                {color: "red", shape: "square", parent_shapes: ["quadrilateral", "rectangle", "rhomboid"] }
            ],
            {
                rows: ["color"],
                cols: ["shape"]
            }
        );
     });

With pivottable version 2.23.0, the parent_shapes field turns into a string field that concatenates the values into one string. Thus, the only values to filter on in the pivottable is: "quadrilateral" and "quadrilateral,rectangle,rhomboid". Is it possible that pivottable parse these values individually for filtering? For example, I can filter on "quadrilateral" and I get back both rows? Or, I can filter on "rectangle" and only the second row shows up?

Is there a feature for this?

felesterio commented 2 years ago

Oops. Similar to the description to the above, https://github.com/nicolaskruchten/pivottable/issues/1172 indicates this is not possible.