Skip to content

Commit 237d189

Browse files
committed
Fix build after moving us-capitals.csv file
1 parent f489400 commit 237d189

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/layerchart/src/routes/docs/examples/GeoPointPreProjected/+page.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
import GeoPoint from '$lib/components/GeoPoint.svelte';
1212
import Text from '$lib/components/Text.svelte';
1313
14-
import capitals from '../_data/geo/us-state-capitals.csv';
15-
1614
export let data;
15+
1716
const states = feature(data.geojson, data.geojson.objects.states);
1817
</script>
1918

@@ -60,7 +59,7 @@
6059
<text y={120}>{projection.translate()}</text>
6160
</GeoContext>
6261
<g class="points">
63-
{#each capitals as capital}
62+
{#each data.stateCaptitals as capital}
6463
<GeoPoint lat={capital.latitude} long={capital.longitude}>
6564
<circle r="2" fill="red" />
6665
<Text y="-6" value={capital.description} textAnchor="middle" class="text-[8px]" />

packages/layerchart/src/routes/docs/examples/GeoPointPreProjected/+page.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { autoType, csvParse } from 'd3-dsv';
12
import pageSource from './+page.svelte?raw';
23

34
export async function load({ fetch }) {
@@ -7,6 +8,9 @@ export async function load({ fetch }) {
78
geojson: await fetch('https://cdn.jsdelivr.net/npm/us-atlas@3/states-albers-10m.json').then(
89
(r) => r.json()
910
),
11+
stateCaptitals: await fetch('/data/examples/geo/us-state-capitals.csv').then(async (r) =>
12+
csvParse(await r.text(), autoType)
13+
),
1014
meta: {
1115
pageSource,
1216
},

0 commit comments

Comments
 (0)