@@ -36,13 +48,20 @@
years={[2015, 2016, 2017, 2018, 2019]}
on:change={(e) => (currentYear = e.detail.year)}>
+
+ {#each taiwanCity as city (city)}
+
+ {/each}
+
{#key currentYear}
{
- currentCity = e.detail;
- tooltipStatus = 'opened';
- offset.set(120);
+ openTooltip(e.detail);
}}
color={(d) => {
const selected = currentData.find((c) => c['縣市'] === d);
diff --git a/src/TaiwanMap.svelte b/src/TaiwanMap.svelte
index 25a8a3e..90c3f66 100644
--- a/src/TaiwanMap.svelte
+++ b/src/TaiwanMap.svelte
@@ -5,6 +5,7 @@
import toPair from "./utils/toPair";
import polygonCentroid from "./utils/centroid";
import hover from "./utils/useHover";
+ import viewport from "./store/viewport";
export let color;
export let transform;
let current = "";
@@ -75,7 +76,7 @@
}
-