whytheq whytheq - 19 days ago 6
JSON Question

How to delete Greenland from my d3 visual

I have this adapted d3 geography visual:

https://plnkr.co/edit/BnCRYzCH3TGEP5ypTGGu?p=preview

I would like to delete Greenland from the map and thought that commenting out the following in the

foobar.json
file would suffice:

// , { "type": "MultiPolygon", "id": 86, "arcs": [
// [
// [503]
// ],
// [
// [504]
// ],
// [
// [505]
// ],
// [
// [506]
// ],
// [
// [507]
// ],
// [
// [508]
// ],
// [
// [509]
// ],
// [
// [510]
// ],
// [
// [511]
// ]
// ],
// "properties": { "admin": "Greenland", "id": "GRL" } }


This adjustment breaks the complete visual - how do I delete Greenland?

Answer

This is easier:

svg.select("#code_GRL").remove();

Here is your updated plunker: https://plnkr.co/edit/yPgYLSSvtyDh6rW5vPyS?p=preview

Comments