0

I'm an absolute beginner when it comes to d3 + svelte and I'm trying to render a map of Indian districts in d3 in svelte framework. The json I'm accessing is from here. I'm trying to render the districts in geoMercator projection. I'm guessing the problem lies with the projection function

$: projection = geoMercator().fitSize([width, height], geojson);
    $: pathGenerator = geoPath(projection);
  
    let districts = [];
    $: if (geojson) districts = geojson.features.map(feature => {
      return {
        ...feature,
        path: pathGenerator(feature)
      };
    });

the rendering is done here

{#each districts as district}
        <!-- svelte-ignore a11y-no-static-element-interactions -->
        <path
          d={district.path}
        />
{/each}

But all I see on the browser is black box, which on inspection is the svg container under which I'm rendering the {#each} block. I only want to render the map of India before I move on to joining data and interactivity.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.