You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] Resources: <mask> and non-rectangular (path) clips #216
An SVG <mask> with maskUnits="userSpaceOnUse" used as an edge fade on a live (rolling) line chart. It fades the line, its fill and the tip marker together, so a stroke gradient with opacity stops in gradients cannot replace it. We render it beside the chart svg and reference it by id, the same seam as patterns. packages/charts-core/src has no mask handling.
The only path <clipPath> is private to the arc enter sweep (motion.ts:1653-1663). No scene node carries a path clip or mask.
Example: a highlight pulse that must be clipped to a non-rectangular silhouette (an isometric bar's front face, side face and lid). A rectangular clip lights the neighbouring faces.
Ask
Allow clip to be a rect or a path ({ path: string, fillRule?: 'nonzero' | 'evenodd' }), rendered as the <clipPath> child in SVG and a Path2D clip on canvas, with the path's bounds used for hit testing. For masks, a declared masks resource next to gradients (scoped by idPrefix), or the same generic resource slot that PR #166 adds for <pattern>.
Thanks @toomingos, both gaps are still present on 9d806998.
I checked two details that matter for the implementation:
A path's bounds can narrow the focus search, but they cannot be the final hit test. In Chromium, Firefox and WebKit, triangle and hole fixtures have fully transparent pixels that are still inside those bounds. Both fill rules and translated groups need to be carried through interaction geometry, not just SVG and Canvas painting.
A group mask is different from changing each child's opacity. With a half-opacity mask, two overlapping opaque shapes stay at alpha 128 in the overlap. Applying half-opacity separately gives alpha 191 or 192 there. The native Canvas isolation control matches the group mask, but that is only a feasibility check, not an implemented Charts renderer. Alpha and luminance masks also differ: the black half-opacity mask leaves alpha 128 in alpha mode and alpha 0 in luminance mode.
The existing Native adapter also only emits rectangular clips. So this needs a shared coordinate/fill-rule contract, renderer coverage, and an explicit mask mode and interaction policy. I have not added a raw markup resource slot or changed the public API. Keeping this open, with path clips and masks tracked as separate implementation pieces.
Activity
tannerlinsley commentedon Oct 16, 2026
Thanks @toomingos, both gaps are still present on
9d806998.I checked two details that matter for the implementation:
The existing Native adapter also only emits rectangular clips. So this needs a shared coordinate/fill-rule contract, renderer coverage, and an explicit mask mode and interaction policy. I have not added a raw markup resource slot or changed the public API. Keeping this open, with path clips and masks tracked as separate implementation pieces.