Format tip pair as a single value when the two values are equal?
@Fil đang làm issue này rồi.
Từ ngày 15/8/2024.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
By default when formatting pairs (y1, y2), we display ${format(a)}—${format(b)}. It does not feel terribly useful to repeat the value when a and b end up being formatted identically.
If for example you're showing a tip on an interval that is [3.1—3.2] with an integer format, showing "3" (read as "somewhere around 3 something") is as informative and slightly better than "3—3" ("between 3 something and 3 something").
This does not happen often, since hopefully the format discriminates between values, but when it happens we would be as happy with showing ${format(a)} alone.
I tried to think of a case where on the opposite, one might want to show a repetition; for example on a calendar where you want to show an interval that goes "from Sunday to Sunday", as "Sun—Sun". In that case, you would have to create a specific channel since the automatic tip format would now show "Sun" only.
This enhancement would incidentally help with the waffle tips (#2132), but is not necessary for them, and should be discussed on its own merits.
(Note: does not apply when the value is the difference — i.e. hint: {length: true}).
- Ngôn ngữ chính
- HTML
- Star
- 5.4k
- Fork
- 246
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 observablehq/plot
-
[Types] Wrong recursion in Mark’s _tip_ optionCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
observablehq/plot#2459 · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
observablehq/plot#2453 ·
-
Inconsistent type definition of _scale_._transform_Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
observablehq/plot#2451 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
observablehq/plot#2447 · 2 bình luận ·
-
Channel documentation with a section describing zCó thể làm lại được @LeonxLJX đã nhận 37 ngày trước và không có pull request nào đang mở. Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
observablehq/plot#1533 · 3 bình luận · 1 reaction ·