Stacked bars: round the whole column (scope: 'stack')
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- data-visualization
Hướng nghiên cứu
Start with the barY mark's radius handling and SceneRect cornerRadii, then trace how stack and group layouts determine each segment's geometry. The issue describes the required cases: thin exposed segments, negative and diverging stacks, barX, reversed scales, grouped columns, motion, and per-segment hit areas and focus. Done means the stack keeps a consistent rounded outline as its height and segment values change; the issue does not identify specific files or tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
A stacked column should read as one rounded bar. With the per-rect corner radii from #28, we round the outer end of the outermost segment and keep the inner seams square. That works as long as the outermost segment is at least as tall as the radius.
When the outermost segment is thin, the column loses its rounded end. The radius is scaled to fit the rect, the same way CSS does it. So a 2px segment gets 2px corners, and the larger segment below it stays square. Real data hits this all the time: in a revenue-per-category stack, the smallest category on top is often only one or two pixels tall in most columns.
Current behavior
barY(segments, {
x: 'week',
y: 'revenue',
z: 'category',
layout: stack({ order }),
// Per row: top-left/top-right on the outermost visible segment,
// bottom corners on the innermost one, 0 on the seams.
radius: stackedRadius,
})
- Outermost segment ≥ radius: the column is rounded.
- Outermost segment < radius: its corners shrink to its height, and the column looks square.
radius only receives the row, not pixel geometry. Even when it gets a pixel-aware resolver, a SceneRect with cornerRadii can't draw the right shape:
- The thin top segment would need a horizontal strip cut from the rounded column, with curved left and right edges.
- The segment below would need the rest of the curve.
Group clip is a plain ChartBounds rectangle, so we can't clip a column's segments to one rounded rect either.
Desired behavior
An option that rounds the whole stack instead of each segment. Every segment is drawn as its part of one rounded column, so the column's outline is always the same rounded rect, however the total is split.
- A segment that lies entirely within
radiuspx of an exposed end gets part of the curve. - Inner seams stay straight.
- It works for negative and diverging stacks (each exposed end is rounded), for
barX, and for reversed scales, like the{ end }form. - It works with
group()+ stack (paired columns) as well as a plain stack. - Motion: segments animate with the stack, and the curve follows the changing column height.
- Hit areas and focus stay per segment.
Possible API shapes, building on the existing forms:
radius: { end: 6, scope: 'stack' } // round the exposed end(s) of the stack
radius: { all: 6, scope: 'stack' } // also round the baseline end
Another option is a rounded group clip (SceneGroup.clip accepting corner radii), which a custom mark could use per column. A scope option on the bar mark would be the more natural API, though.
Prior art
Highcharts has exactly this: borderRadius: { radius, scope: 'stack' | 'point', where: 'end' | 'all' }. From its API docs:
The value
stackmeans the rounding will apply to the full stack, so that only points close to the top or bottom will receive rounding.
Internally it computes the rounding against the stack's total box and not against each point's box (borderRadius.scope === 'stack' in the column series).
Our workaround today
We resolve a corner tuple per row, from the same rows the mark draws and in stack order. It skips zero and null segments so a missing category doesn't hold the rounding away from the visible end. That covers seams and missing values, but it can't fix the thin-end case above. The only alternatives we found change the data (a minimum segment height) or depend on wrapping barY's scene output, which we'd rather not maintain.
Version: @tanstack/charts 1.0.0, SVG renderer with motion().
Related: #28
- Ngôn ngữ chính
- TypeScript
- Star
- 870
- Fork
- 57
- Merge trung bình
- 11 giờ 58 phút
- Pull request đã merge (30 ngày)
- 18
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/charts
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`Có thể đã có người làm @getdownandcode đã nhận 37 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TanStack/charts#211 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add reverse options to waffleY and waffleXCó thể đã có người làm @tannerlinsley đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/charts
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
fb55/htmlparser2#2579 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue needs-review
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add Module DB RulesĐang mởdocumentation public
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
midnightntwrk/umbradb#65 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/channels kind/bug priority/medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nanocoai/nanoclaw#4501 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Docker images: plain X.Y.Z tag (e.g. 7.2.3) is never updated after the initial release buildĐang mởneeds verification
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 13 ngày