Skip to content

[Feature] motion(): configurable enter start state (scale about the centre, arc seeds for partitions) #214

Open

Description

@toomingos

Version: @tanstack/charts 1.1.0 (57774e1). Split from #193 (comment section D) and #194 (section C) so it can be closed on its own.

A mark cannot choose how its elements enter: generic marks only fade, and sunburst sectors only take their start shape from an ancestor. Both asks are the same API, an enter start state per element.

Generic marks: the only enter is an opacity fade (from #193 D)

When a keyed rect, dot or text gets an enter track, addEnterMotionTrack ends in a single opacity attribute tween from 0 to the target (motion.ts:2596-2635). ChartMotionTiming carries only delay, transition and path (types.ts:872-877), so a mark cannot ask for another shape of enter.

Example: radial gauge notches (areaX/rect marks) that should grow from scale 0 about each notch's own centre, with a per-notch delay. With the built-in tracks the only options are a fade or nothing. The workaround is scoped CSS keyframes keyed on data-ts-key, which depend on renderer-owned DOM and have to be aligned with the motion clock by hand.

Partition marks: enter/exit seeds cannot be supplied (from #194 C)

Ask

  • Generic marks: an enter option on motion() (or on the mark's motion) with from: { opacity?, scale? } and origin: 'center' | 'start', applied per element with the existing per-datum delay. Or a documented per-element enter transform.
  • Partition marks: enter: { from(node) } and exit: { to(node) }, returning [startAngle, endAngle, innerRadius, outerRadius].

Read from source, not run.

Related: #193 (missing enter tracks), #194 (arc motion).

Activity

  1. tannerlinsley commented on Oct 16, 2026

    @tannerlinsley
    Member

    Thanks @toomingos. I tested the two parts separately in private prototypes:

    • Rectangles can grow from their centre using the existing x/y/width/height tracks, including per-element delay, interruption and reduced motion.
    • Partition seeds can use the existing semantic path tracks. Mixed seeded and default sectors need separate routing through the initial sweep clip. The prototype preserves the default sectors' paint while applying the authored seeds, including nested sectors.

    These checks ran in Chromium, Firefox and WebKit. This is not shipped support or a proposed public API yet. The mixed partition prototype adds 0.119 decimal kB gzip to full motion versus its entrance-track prerequisite, so it is not within the current budget.

    There is also an interaction contract to finish: presentation points carry live centres but not live shape bounds. In the entrance-track prototype, a 20px-radius custom dot with a 1px focus threshold is selectable at its centre during the transition but not 10px from its centre until the transition settles. The same fixture on current main selects the painted dot at that offset, so this is a prerequisite/prototype gap, not a newly confirmed main regression. Returning exits also depend on #233, which is still under review.

    Keeping this open. The remaining work is the opt-in capability and typed seed contract, shape-aware interaction during motion, and integration within the bundle budget. No CSS workaround or renderer-owned attribute API has been adopted.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions