|
5 | 5 | import ZoomsPanel from './lib/ZoomsPanel.svelte'; |
6 | 6 | import { prepareAnthromesData } from './lib/dataAdapter.js'; |
7 | 7 |
|
| 8 | + const LEGEND_CATEGORIES = [ |
| 9 | + { name: 'Dense Settlements', codes: [11, 12] }, |
| 10 | + { name: 'Villages', codes: [21, 22, 23, 24] }, |
| 11 | + { name: 'Croplands', codes: [31, 32, 33, 34] }, |
| 12 | + { name: 'Rangelands', codes: [41, 42, 43] }, |
| 13 | + { name: 'Cultured', codes: [51, 52, 53, 54] }, |
| 14 | + { name: 'Wildlands', codes: [61, 62, 63] }, |
| 15 | + ]; |
| 16 | +
|
8 | 17 | // State |
9 | 18 | let loading = $state(true); |
10 | 19 | let error = $state(null); |
|
383 | 392 | {#if openPanel === 'info'} |
384 | 393 | <div class="info-body"> |
385 | 394 | <p><strong><u>More than 65% of terrestrial nature</u></strong> has been shaped, in very different ways, by people.</p> |
386 | | - <p><strong>Anthromes</strong> are defined as the ecological patterns shaped by human habitation.</p> |
| 395 | + <p><strong>Anthromes</strong> are defined as the global ecological patterns shaped by direct human interactions with ecosystems.</p> |
387 | 396 | <p>Visualized here is the <strong>Anthromes Dataset</strong>. It is a "hindcast," a model built from global population and land use data showing change over <u>12,025 years</u>.</p> |
388 | 397 | <p>As global population increases, and urbanization accelerates, <strong>biodiversity shrinks.</strong></p> |
389 | 398 | <p><u>Preserving "cultured" and "wild" lands</u> is key to preserving biodiversity.</p> |
390 | 399 |
|
391 | | - <div class="info-swatches" aria-label="Anthrome color swatches"> |
392 | | - {#each orderedCodes as code} |
393 | | - <div class="swatch-pill"> |
394 | | - <span class="swatch-pill__color" style={`background: ${colorMapping[code]}`}></span> |
395 | | - <span class="swatch-pill__label">{labelMapping[code]}</span> |
| 400 | + <div class="legend-section"> |
| 401 | + <div class="legend-category-name">Legend</div> |
| 402 | + <div class="legend-body"> |
| 403 | + <div class="legend-axis" aria-hidden="true"> |
| 404 | + <span class="legend-axis-label">more intensive anthromes</span> |
396 | 405 | </div> |
397 | | - {/each} |
| 406 | + <div class="info-swatches" aria-label="Anthrome color swatches"> |
| 407 | + {#each LEGEND_CATEGORIES as category} |
| 408 | + <div class="legend-category-name">{category.name}</div> |
| 409 | + {#each category.codes as code} |
| 410 | + <div class="swatch-pill"> |
| 411 | + <span class="swatch-pill__color" style={`background: ${colorMapping[code]}`}></span> |
| 412 | + <span class="swatch-pill__label">{labelMapping[code]}</span> |
| 413 | + </div> |
| 414 | + {/each} |
| 415 | + {/each} |
| 416 | + </div> |
| 417 | + </div> |
398 | 418 | </div> |
399 | 419 |
|
400 | 420 | <div class="info-citations"> |
401 | 421 | <div class="info-citations-title">Citations</div> |
402 | | - <p>This project was completed by Laura Kurgan, Dan Miller and Adam Vosburgh at The Center for Spatial Research, Columbia University Graduate School of Architecture Planning and Preservation. This project is open-source, and the repository is located <a href="https://github.com/CenterForSpatialResearch/twosides" target="_blank" rel="noopener">here</a>.</p> |
403 | 422 | <p>Ellis, E.C., N. Gauthier, K. Klein Goldewijk, R. Bliege Bird, N. Boivin, S. Diaz, D. Fuller, J. Gill, J. Kaplan, N. Kingston, H. Locke, C. McMichael, D. Ranco, T. Rick, M.R. Shaw, L. Stephens, J.C. Svenning, and J.E.M. Watson. 2021. "People have shaped most of terrestrial nature for at least 12,000 years." <em>Proceedings of the National Academy of Sciences</em> 118(17): e2023483118. <a href="https://doi.org/10.1073/pnas.2023483118" target="_blank" rel="noopener">https://doi.org/10.1073/pnas.2023483118</a></p> |
404 | 423 | <p>Klein Goldewijk, K. 2025. History Database of the Global Environment (HYDE 3.5). Utrecht University. <a href="https://public.yoda.uu.nl/geo/UU01/F45D44.html" target="_blank" rel="noopener">https://public.yoda.uu.nl/geo/UU01/F45D44.html</a></p> |
| 424 | + <p>This project was completed by Laura Kurgan, Dan Miller and Adam Vosburgh at The Center for Spatial Research, Columbia University Graduate School of Architecture Planning and Preservation. This project is open-source, and the repository is located <a href="https://github.com/CenterForSpatialResearch/twosides" target="_blank" rel="noopener">here</a>.</p> |
405 | 425 | </div> |
406 | 426 | </div> |
407 | 427 | {#if showBarChart && barChartData?.length} |
|
411 | 431 | </div> |
412 | 432 | {/if} |
413 | 433 | {:else if openPanel === 'anthromes'} |
414 | | - <p class="overlay-desc">Select anthrome classes; click or drag to choose a range.</p> |
| 434 | + <div class="overlay-desc"> |
| 435 | + <p>Select anthrome classes below to filter the visualization; click or drag to choose a range.</p> |
| 436 | + <p>Anthromes are patterns of direct human interactions with ecosystems, also known as "human biomes."</p> |
| 437 | + </div> |
415 | 438 | <div class="overlay-actions"> |
416 | 439 | <button class="btn" onclick={handleSelectAll}>Select All</button> |
417 | 440 | <button class="btn" onclick={handleClear}>Clear</button> |
|
969 | 992 |
|
970 | 993 | /* Views panel uses the full middle row */ |
971 | 994 | .filter-overlay.views-open { |
972 | | - padding: 8px 10px; |
| 995 | + padding: 12px 14px; |
973 | 996 | height: 100%; |
974 | 997 | max-height: 100%; |
975 | 998 | } |
|
979 | 1002 | align-items: center; |
980 | 1003 | justify-content: space-between; |
981 | 1004 | gap: 8px; |
982 | | - margin-bottom: 8px; |
| 1005 | + margin-bottom: 10px; |
983 | 1006 | } |
984 | 1007 |
|
985 | 1008 | .overlay-title { |
|
1100 | 1123 | } |
1101 | 1124 |
|
1102 | 1125 | .overlay-desc { |
1103 | | - margin: 6px 0 10px; |
| 1126 | + margin: 0 0 10px; |
1104 | 1127 | font-size: 11px; |
1105 | 1128 | color: var(--muted); |
1106 | 1129 | line-height: 1.4; |
1107 | 1130 | } |
1108 | 1131 |
|
| 1132 | + .overlay-desc p { |
| 1133 | + margin: 0; |
| 1134 | + } |
| 1135 | +
|
| 1136 | + .overlay-desc p + p { |
| 1137 | + margin-top: 8px; |
| 1138 | + } |
| 1139 | +
|
1109 | 1140 | .info-body { |
1110 | 1141 | display: grid; |
1111 | 1142 | gap: 10px; |
|
1122 | 1153 | padding-top: 6px; |
1123 | 1154 | } |
1124 | 1155 |
|
| 1156 | + .legend-section { |
| 1157 | + display: flex; |
| 1158 | + flex-direction: column; |
| 1159 | + gap: 4px; |
| 1160 | + } |
| 1161 | +
|
| 1162 | + .legend-body { |
| 1163 | + display: flex; |
| 1164 | + gap: 30px; |
| 1165 | + align-items: stretch; |
| 1166 | + } |
| 1167 | +
|
| 1168 | + /* Axis: vertical arrow + label spanning full legend height */ |
| 1169 | + .legend-axis { |
| 1170 | + position: relative; |
| 1171 | + width: 16px; |
| 1172 | + flex-shrink: 0; |
| 1173 | + } |
| 1174 | +
|
| 1175 | + /* Line and arrowhead sit on the right edge of the axis column */ |
| 1176 | + .legend-axis::before { |
| 1177 | + content: ''; |
| 1178 | + position: absolute; |
| 1179 | + left: 20px; |
| 1180 | + top: 6px; |
| 1181 | + bottom: 0; |
| 1182 | + width: 1px; |
| 1183 | + background: rgba(255,255,255,0.3); |
| 1184 | + } |
| 1185 | +
|
| 1186 | + .legend-axis::after { |
| 1187 | + content: ''; |
| 1188 | + position: absolute; |
| 1189 | + left: 20px; |
| 1190 | + top: 1px; |
| 1191 | + transform: translateX(-50%); |
| 1192 | + width: 0; |
| 1193 | + height: 0; |
| 1194 | + border-left: 3px solid transparent; |
| 1195 | + border-right: 3px solid transparent; |
| 1196 | + border-bottom: 5px solid rgba(255,255,255,0.3); |
| 1197 | + } |
| 1198 | +
|
| 1199 | + /* Text spans only the top half so its center sits near Urban */ |
| 1200 | + .legend-axis-label { |
| 1201 | + position: absolute; |
| 1202 | + top: 12px; |
| 1203 | + bottom: 50%; |
| 1204 | + left: 5px; |
| 1205 | + right: 0; |
| 1206 | + display: flex; |
| 1207 | + align-items: center; |
| 1208 | + justify-content: center; |
| 1209 | + writing-mode: vertical-rl; |
| 1210 | + transform: rotate(180deg); |
| 1211 | + font-size: 9px; |
| 1212 | + text-transform: uppercase; |
| 1213 | + letter-spacing: 0.06em; |
| 1214 | + color: rgba(255,255,255,0.35); |
| 1215 | + white-space: nowrap; |
| 1216 | + pointer-events: none; |
| 1217 | + user-select: none; |
| 1218 | + } |
| 1219 | +
|
1125 | 1220 | .info-swatches { |
| 1221 | + flex: 1; |
| 1222 | + min-width: 0; |
1126 | 1223 | display: grid; |
1127 | 1224 | grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); |
1128 | | - gap: 8px; |
1129 | | - margin-top: 4px; |
| 1225 | + gap: 4px 8px; |
| 1226 | + } |
| 1227 | +
|
| 1228 | + .legend-category-name { |
| 1229 | + grid-column: 1 / -1; |
| 1230 | + font-size: 10px; |
| 1231 | + font-weight: 700; |
| 1232 | + text-transform: uppercase; |
| 1233 | + letter-spacing: 0.08em; |
| 1234 | + color: var(--muted); |
| 1235 | + margin-top: 8px; |
| 1236 | + } |
| 1237 | +
|
| 1238 | + .legend-category-name:first-child { |
| 1239 | + margin-top: 0; |
1130 | 1240 | } |
1131 | 1241 |
|
1132 | 1242 | .swatch-pill { |
|
0 commit comments