Format tip pair as a single value when the two values are equal?
@Fil ci sta già lavorando.
Dal 15/8/2024.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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}).
- Lingua principale
- HTML
- Stelle
- 5.4k
- Fork
- 246
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di observablehq/plot
-
[Types] Wrong recursion in Mark’s _tip_ optionForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
observablehq/plot#2459 · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
observablehq/plot#2453 ·
-
Inconsistent type definition of _scale_._transform_Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
observablehq/plot#2451 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
observablehq/plot#2447 · 2 commenti ·
-
Channel documentation with a section describing zForse di nuovo libera @LeonxLJX l’ha presa 37 giorni fa e non c’è nessuna pull request aperta. Apertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
observablehq/plot#1533 · 3 commenti · 1 reazione ·