[Feature] `fillOpacity` and `strokeOpacity` as per-datum channels, and `fill` on `rect`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- data-visualization
Research direction
Start with the channel definitions in packages/charts-core/src/rect.ts, bar.ts and dot.ts, then trace how marks pass visual channels into rendering and motion updates. Compare rect with barY and barX to identify the relevant types and tests. Done when per datum fillOpacity and strokeOpacity work on all four marks and rect accepts a per datum fill channel.
Written by the indexing model from the issue text.
Description
Version: @tanstack/charts 1.5.0 (b236dae).
A mark cannot draw its data at different opacities.
fillOpacityandstrokeOpacityare numbers onrect,barY,barXanddot(rect.ts:48, bar.ts:70, dot.ts:52).fillis aVisualChannelon bars but a constant onrect(bar.ts:69, rect.ts:47).- Mark
statestake a per-datumfillOpacity, but wait while data motion is active (motion.md:77), so they never apply in a chart that updates on every frame.
Use case: dimming the marks outside a range while the range is dragged.
The workaround is one mark for each datum:
marks: rows.map((row) =>
rect([row], { id: `bar-${row.key}`, x1: 'x1', x2: 'x2', y1: 'y1', y2: 'y2', key: 'key', fillOpacity: row.opacity }),
)
The opacity tweens, but each update costs up to twice as much. Median synchronous host.update under motion(), headless Chromium 153, values changing and nothing else:
| Bars | One mark | One mark for each bar |
|---|---|---|
| 48 | 1.8 ms | 2.4 ms |
| 192 | 7.1 ms | 13.1 ms |
| 768 | 57.4 ms | 116.4 ms |
Ask
fillOpacityasVisualChannel<TDatum, number>onrect,barY,barXanddot, andstrokeOpacitylikewise.fillasVisualChannel<TDatum, string>onrect, as bars have.
- Dominant language
- TypeScript
- Stars
- 870
- Forks
- 57
- Avg merge
- 11h 58m
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TanStack/charts
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`Possibly taken @getdownandcode claimed this 37 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
TanStack/charts#211 · 1 comment ·
Maintainers usually reply within 1 day
-
Add reverse options to waffleY and waffleXPossibly taken @tannerlinsley claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
inference/go type/feature
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
anomalyco/opencode#65148 · 1 comment ·
Maintainers usually reply within 1 day
-
truapi-release
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
paritytech/product-sdk#529 ·
Maintainers usually reply within 1 day
-
Add: Mansudae TVOpenapproved check:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
devlikeapro/waha#2369 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigbluebutton/bigbluebutton#26638 · 1 comment ·
Maintainers usually reply within 1 day