finos / perspective

A data visualization and analytics component, especially well-suited for large and/or streaming datasets.
https://perspective.finos.org/
Apache License 2.0
7.72k stars 1.05k forks source link

Allow same column to be selected multiple times in y-axis selections #2576

Closed mhkeller closed 3 months ago

mhkeller commented 3 months ago

Feature Request

Description of Problem:

Currently when doing aggregate functions, I can't compare different aggregate functions on the same column such as mean and median.

Potential Solutions:

This would be remedied if I could add the same column to the Y Axis selection multiple times.

For example, using this data of student exams, I want to group by exam_subject and create a bar chart showing avg and median exam_score in each group. Once I select exam_score once, though, I can't select it again.

Screenshot 2024-03-21 at 10 46 52

texodus commented 3 months ago

You can duplicate a column in Perspective by giving it an alias:

viewer.restore({
    columns: ["My Column", "My Column 2"],
    expressions: {
        "My Column 2": "\"My Column\""
    }
});

We're going to add quick-duplicate action buttons to the columns settings bar at some point, but they will just perform this action.

(Moving to discussions)