|
54 | 54 | function showTooltip(event, country) { |
55 | 55 | const iso3 = worldAtlasIdToIso3[String(country.id).padStart(3, '0')]; |
56 | 56 | const count = countByIso[iso3] || 0; |
57 | | - if (!iso3 || count === 0) return; |
| 57 | + if (!iso3) return; |
58 | 58 | window.dispatchEvent( |
59 | 59 | new CustomEvent('darts:tooltip', { |
60 | 60 | detail: { |
|
196 | 196 | </script> |
197 | 197 |
|
198 | 198 | <figure class="globe-figure" aria-label="Orthographic globe showing credited works by artist country"> |
199 | | - <svg viewBox={`0 0 ${width} ${height}`}> |
200 | | - <title>Orthographic globe of credited works by artist country</title> |
| 199 | + <svg |
| 200 | + viewBox={`0 0 ${width} ${height}`} |
| 201 | + class:dragging |
| 202 | + role="application" |
| 203 | + aria-label="Drag anywhere on the globe to rotate it" |
| 204 | + onpointerdown={onPointerDown} |
| 205 | + onpointermove={onPointerMove} |
| 206 | + onpointerup={onPointerUp} |
| 207 | + onpointercancel={onPointerUp} |
| 208 | + > |
201 | 209 | <defs> |
202 | 210 | <filter id="globe-rim" x="-20%" y="-20%" width="140%" height="140%"> |
203 | 211 | <feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur" /> |
|
210 | 218 | </defs> |
211 | 219 | <circle class="sphere" cx={width / 2} cy={height / 2} r="350" filter="url(#globe-rim)" /> |
212 | 220 | <path class="graticule" d={graticulePath} /> |
213 | | - <g |
214 | | - class="countries" |
215 | | - class:dragging |
216 | | - role="application" |
217 | | - aria-label="Drag to rotate the globe" |
218 | | - onpointerdown={onPointerDown} |
219 | | - onpointermove={onPointerMove} |
220 | | - onpointerup={onPointerUp} |
221 | | - onpointercancel={onPointerUp} |
222 | | - > |
| 221 | + <g class="countries"> |
223 | 222 | {#each countries as country, index} |
224 | 223 | {@const iso3 = worldAtlasIdToIso3[String(country.id).padStart(3, '0')]} |
225 | 224 | <path |
|
0 commit comments