|
5 | 5 | * |
6 | 6 | * The two badges take the ride-start marker's shape (`.bus-icon-circle`: a white disc in a |
7 | 7 | * coloured rim, the same in both themes), so the things that bookend or interrupt a ride read as |
8 | | - * one family and the arrows stay the only bare shapes on the map. Only the rim colour separates |
9 | | - * them: the ride-end badge keeps the primary rim, while the standing badge takes the slow arrows' |
10 | | - * red, because a parked bus is a speed reading and the end of a ride is not. |
| 8 | + * one family. Only the rim colour separates them — the standing badge takes the slow arrows' red, |
| 9 | + * the ride-end badge keeps the primary rim. |
11 | 10 | * |
12 | 11 | * They live apart from `MapContent` so the legend can render them without pulling Leaflet in, |
13 | 12 | * and so both renderings — Leaflet's HTML string and the legend's element — come off one set of |
@@ -61,23 +60,17 @@ export const STANDING_LABEL = '0' |
61 | 60 | /** How the arrow grows across the bands, as a factor of the glyph: evenly spaced, so adding a |
62 | 61 | * band re-spaces the ramp instead of squeezing it in at one end. The top of the range keeps the |
63 | 62 | * fastest arrow inside the viewBox's inscribed circle, so no bearing clips a corner off it. The |
64 | | - * bottom is a legibility floor rather than a ramp choice: the ramp would happily start lower, |
65 | | - * but at 0.46 the slowest arrow came out ~8px across and was lost among the pings either side. */ |
| 63 | + * bottom is a legibility floor, not a ramp choice: at 0.46 the slowest arrow was ~8px across and |
| 64 | + * lost among the pings either side of it. */ |
66 | 65 | const BAND_SCALE_MIN = 0.62 |
67 | 66 | const BAND_SCALE_MAX = 0.96 |
68 | 67 | const bandScale = (band: number) => |
69 | 68 | BAND_SCALE_MIN + ((BAND_SCALE_MAX - BAND_SCALE_MIN) * band) / (SPEED_BANDS.length - 1) |
70 | 69 |
|
71 | 70 | /** |
72 | 71 | * Size alone can't carry six bands at ~14px, so colour splits the ramp in two and the size then |
73 | | - * places an arrow within its half. The slow half is red — what a bad result is painted |
74 | | - * everywhere else in the app — and the fast half stays the map's default ink. |
75 | | - * |
76 | | - * Colour rather than fill, because size runs against the point of the map here: a bus stuck in |
77 | | - * traffic is the ping worth finding and also the one drawn smallest, and stacking it on top |
78 | | - * ({@link bearingZIndex}) only stops it being covered, it does not make it easier to spot. |
79 | | - * Colour is the one channel that doesn't shrink with the arrow. |
80 | | - * |
| 72 | + * places an arrow within its half. Colour rather than fill because it is the one channel that |
| 73 | + * doesn't shrink with the arrow, and the slow half — the pings worth finding — is the small end. |
81 | 74 | * The colours live in `map.scss`; the markup carries geometry alone. |
82 | 75 | */ |
83 | 76 | const bandClass = (band: number) => |
@@ -123,10 +116,8 @@ export const arrowSvgMarkup = (deg: number, band: number) => |
123 | 116 | `<path class="${bandClass(band)}" d="${ARROW_PATH}" transform="${bandTransform(deg, band)}"/>` + |
124 | 117 | `</svg>` |
125 | 118 |
|
126 | | -/** The standing badge's rim wears the slow ramp's red, so a parked bus reads as part of the same |
127 | | - * family as the crawling arrows. The ride-end badge keeps the plain rim — it bookends the ride |
128 | | - * rather than reporting a speed — which is why this is a modifier and not a change to |
129 | | - * `.ping-badge`. Named here so the legend's element and Leaflet's markup can't drift apart. */ |
| 119 | +/** A modifier rather than a change to `.ping-badge`, which the ride-end badge shares. Named so |
| 120 | + * the legend's element and Leaflet's markup can't drift apart. */ |
130 | 121 | const STANDING_DISC_CLASS = 'ping-badge ping-badge--standing' |
131 | 122 |
|
132 | 123 | const discMarkup = ( |
|
0 commit comments