More text positions and per-text styling to the bar texts of BitResourceTimeline
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Summary
A BitResourceTimelineAllocation can label its bar only on four sides (TextAbove, TextBelow, TextStart, TextEnd), always centered above/below the bar, and always in the timeline's bar-label color and font. Scheduling UIs often need more than that: a flight number at the start of the bar and its status at the end, a gate under one corner, a warning in red, a code in bold.
Proposal
Replace the four string properties of BitResourceTimelineAllocation with one Texts property of a new BitResourceTimelineBarTexts type, which has a property per position:
TopStart,TopCenter,TopEnd: above the bar, aligned with its start edge, centered on it, or aligned with its end edgeBottomStart,BottomCenter,BottomEnd: the same below the barStart,End: beside the bar, on its center line (whereTextStart/TextEndare drawn today)
Each position is a new BitResourceTimelineBarText that carries what customizes the text:
Text: the valueColor: a CSS color (falls back to the bar-label color)Font: a CSS font shorthand (falls back toOptions.BarLabelFontor the theme's font)OffsetX/OffsetY: pixels to move the text from where its position puts it
A string converts to a BitResourceTimelineBarText implicitly, so the common case stays short:
new BitResourceTimelineAllocation
{
Id = "BA117",
ResourceId = "A1",
StartTime = start,
EndTime = end,
Texts = new()
{
TopStart = "BA117",
TopEnd = new() { Text = "On time", Color = "#2f9e44", Font = "600 11px sans-serif" },
BottomStart = new() { Text = "London", Color = "#868e96" },
BottomEnd = new() { Text = "T5", OffsetX = -4 },
},
}
All three renderers (Canvas, Svg, Html) draw each text in its own color and font. Its own font is also used to measure it, so the room kept for it (and the stacking of the bars) follows its size. With StickyBarLabels, texts aligned with an edge stay in view the same way the centered ones do, and still leave the view with their bar. CollapseMatchingEdgeLabels keeps working on End / Start.
Name conflict
The component already has a Texts parameter (BitResourceTimelineTexts) for its own words: its accessible name, loading text and announcements. To keep the two apart, rename it to Strings (BitResourceTimelineStrings), on the component and on BitResourceTimelineParams.
Breaking changes
The component has only shipped in 11.0.0 prereleases, so this breaks prerelease users only:
| Before | After |
|---|---|
TextAbove = "x" |
Texts = new() { TopCenter = "x" } |
TextBelow = "x" |
Texts = new() { BottomCenter = "x" } |
TextStart = "x" |
Texts = new() { Start = "x" } |
TextEnd = "x" |
Texts = new() { End = "x" } |
<BitResourceTimeline Texts="..." /> |
<BitResourceTimeline Strings="..." /> |
BitResourceTimelineTexts |
BitResourceTimelineStrings |
These go into BreakingChanges.md and the breaking-change analyzer (BITBC001 / BITBC002). The Boilerplate's Workbench (ExtrasSection) uses the old names and needs updating separately.
- Ngôn ngữ chính
- C#
- Star
- 1.4k
- Fork
- 264
- Merge trung bình
- 8 giờ 5 phút
- Pull request đã merge (30 ngày)
- 595
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 bitfoundation/bitplatform
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bitfoundation/bitplatform#15455 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
bitfoundation/bitplatform#15051 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bit Boilerplate and bit CLI move to bitfoundation/bitfabricCó thể đã có người làm @yasmoradi đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
bitfoundation/bitplatform#15454 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Deprecated and obsolete SCSS features used in BlazorUI projectsCó thể đã có người làm @msynk đã nhận 2 ngày trước. Đang mởarea / BlazorUI
bitfoundation/bitplatform#15433 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`Bit.BlazorUI.Icons`: GitHub and WhatsApp brand glyphsCó thể đã có người làm @msynk đã nhận 4 ngày trước. Đang mởarea / BlazorUI
bitfoundation/bitplatform#15400 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bitfoundation/bitplatform
Issue tương tự
-
area-CodeGen-coreclr untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
dotnet/runtime#138181 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-area-label
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:identity type:bug
Độ 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 1 ngày
-
bug 🐞
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
valkey-io/valkey-glide#7849 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-Asset area-GameStudio area-Samples bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày