Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
<script>
import { geoAlbers, geoPath, geoAlbersUsa, } from "d3-geo";
import { onMount } from "svelte";
import * as topojson from 'topojson-client';
import { draw } from 'svelte/transition';
const path = geoPath().projection(null);
let deps = [];
let mesh;

onMount(async () => {
const france = await fetch('https://gist.githubusercontent.com/Fralacticus/b6584c5865607300b2b5a0559ae47cbb/raw/8287c28f9a3eab4e3d1aa5f7e6181f064957c9de/deptopo.json'
).then(d => d.json());
console.log({ france });
deps = topojson.feature(france, france.objects.dep).features;
console.log({ deps });
mesh = topojson.mesh(france, france.objects.dep, (a, b) => a !== b);
});
</script>


<svg viewBox="0 0 10000000 10000000">
<g stroke="black" stroke-width="1000px" fill="none">
{#each deps as feature, i}
<path d={path(feature)} />
{/each}
</g>
</svg>
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */