Skip to content

Add pievisible pipe #473

Closed
Closed

Description

@AngelaZhang915

What happened?

Pie charts with many segments need a computed Other slice that updates when users toggle visibility in Options. selectattr:'visible' only filters rows — it can’t aggregate hidden segments into a single Other slice.

Use case: a pie chart with primary segments shown individually and secondary segments collapsed into Other by default; toggling a segment in Options promotes it and shrinks Other.

Expected: chart_segments | pievisible returns visible slices plus one Other slice summing hidden values (30 above). When MX is toggled visible, MX appears as its own slice and Other drops to 10. When everything is visible, Other is omitted.

Actual: no built-in pipe for this — authors must precompute slices in Python or hand-roll aggregation in expressions.

Proposed approach (comment on the issue if filing before the PR):

Add a pievisible pipe in renderer/src/expression.ts that:

takes segments with label, value, visible, and group (primary / secondary)
returns {label, value} slices for visible rows
aggregates hidden rows into a single Other slice

Example Code

Version Information

0.0.1.dev584+5cb520a

Activity

  1. added
    bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.
    on Jun 23, 2026
  2. added
    enhancementImprovement to existing functionality or new capabilities.
    rendererRelated to the TypeScript/React renderer.
    and removed
    bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.
    on Jun 23, 2026
  3. jlowin commented on Oct 26, 2026

    @jlowin
    Member

    Implemented by #548, now merged. PieChart supports aggregate_below for a fraction-of-total cutoff and aggregate_except for a reactive selection list. Both preserve the total by combining the remaining rows into Other, using the chart’s existing field names. Angela Zhang is credited as a co-author for the original #471 proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement to existing functionality or new capabilities.rendererRelated to the TypeScript/React renderer.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions