techniq / techniq/layerchart

[Arc] Clippath and Gradient for canvas

Open
#830 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
41
Avg merge
2d 19h
Merged PRs (30d)
16

Description

Gauge Example

canvas layer does not to clip or show gradient.

Image

I think it's 2 fold... 1 issue is similar to what we recently added GeoClipPath as supporting the clip snippet for ClipPath is a little tricky for Canvas...

{#snippet clip()} {/snippet}

we might need to ArcClipPath (although I hate to keep adding a ClipPath for every shape :)). Might be a way to hook into the rendering call of Arc and bubble up to ClipPath...
also, gradients in Canvas are a little tricky as they don't have the concept of objectBoundingBox and gets tricky to great "relative" gradients (not just global) - https://github.com/techniq/layerchart/blob/next/packages/layerchart/src/lib/components/LinearGradient.svelte#L163-L171

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Arc gauge example and the canvas rendering path, then compare the clipping approach discussed for GeoClipPath with the ClipPath snippet shown here. Read packages/layerchart/src/lib/components/LinearGradient.svelte at the referenced lines to understand the existing relative-gradient behavior. Done means the Arc canvas layer clips correctly and displays gradients in the gauge example.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.