Skip to content

Conversation

texodus
Copy link
Member

@texodus texodus commented Sep 1, 2025

This PR refactors <perspective-viewer> to move some engine configuration from compile-time to run-time (via an elaborated Client::get_features call), which in the future may make it easier to implement alternative engines. Perspective enables all features by default and there is no public API to disable them, so this change is mostly UX transparent (except as noted):

  • Aggregates function names and filter operators have been moved to Client::get_features.

  • Table::validate_expressions has been gated behind the expressions feature, as has the expression UI.

  • "filter", "sort", "split_by" and "group_by" UI have been conditioned on Client::get_features named after their config property names.

  • Real-time notifications have been conditioned on the on_update feature.

  • Minor breaking change - the format of Client::get_features has been changed. However, only new keys have been added ("aggregates", "filter_ops" and "on_update" and "sort")and I suspect this method to be rarely (if ever) used outside of perspective-viewer itself.

  • Minor breaking change - the config format for multi-argument aggregates weighted mean, max by and min by has been changed, old:

     const view = await table.view({
        group_by: ["z"],
        aggregates: { x: ["weighted mean", "y"] },
        columns: ["x"],
    });

    New:

     const view = await table.view({
        group_by: ["z"],
        aggregates: { x: ["weighted mean", ["y"]] },
        columns: ["x"],
    });

    This is necessary to allow 3+ parameter aggregates.

@texodus texodus added internal Internal refactoring and code quality improvement breaking labels Sep 1, 2025
@texodus texodus changed the title Better features support Better features support Sep 1, 2025
Signed-off-by: Andrew Stein <[email protected]>
@texodus texodus marked this pull request as ready for review September 1, 2025 03:08
@texodus texodus merged commit d6f8420 into master Sep 1, 2025
14 checks passed
@texodus texodus deleted the granular-features branch September 1, 2025 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking internal Internal refactoring and code quality improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant