rveciana - mapping-with-svelte-color-scale

Mapping with Svelte: color scale

Open raw page in new tab

Second example of a map drawn with Svelte and the d3 projections. More than one path is created and colored using the d3-scale library.

Check this blog post from Geoexamples for more explanations.

To test it, clone the standard svelte template by

npx degit sveltejs/template svelte-app cd svelte-app

And copy the App.svelte file into the src directory.

<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />

    <title>Svelte app</title>

    <link rel="stylesheet" href="bundle.css" />

    <script defer src="bundle.js"></script>