{
  "$schema": "https://vega.github.io/schema/vega/v6.json",
  "width": 432,
  "height": 240,
  "autosize": "none",
  "signals": [
    {
      "name": "type",
      "value": "mercator",
      "bind": {
        "input": "select",
        "options": [
          "albers",
          "albersUsa",
          "azimuthalEqualArea",
          "azimuthalEquidistant",
          "conicConformal",
          "conicEqualArea",
          "conicEquidistant",
          "equirectangular",
          "gnomonic",
          "mercator",
          "orthographic",
          "stereographic",
          "transverseMercator"
        ],
        "name": "Тип проекции",
        "labels": [
          "Альберса (albers)",
          "Альберса для США (albersUsa)",
          "Азимутальная равновеликая (azimuthalEqualArea)",
          "Азимутальная равнопромежуточная (azimuthalEquidistant)",
          "Коническая равноугольная (conicConformal)",
          "Коническая равновеликая (conicEqualArea)",
          "Коническая равнопромежуточная (conicEquidistant)",
          "Равнопромежуточная цилиндрическая (equirectangular)",
          "Гномоническая (gnomonic)",
          "Меркатора (mercator)",
          "Ортографическая (orthographic)",
          "Стереографическая (stereographic)",
          "Поперечная Меркатора (transverseMercator)"
        ]
      }
    },
    {
      "name": "step",
      "value": 30,
      "bind": {
        "input": "range",
        "min": 5,
        "max": 45,
        "step": 1,
        "name": "Шаг сетки"
      }
    },
    {
      "name": "scale",
      "value": 72,
      "bind": {
        "input": "range",
        "min": 50,
        "max": 1000,
        "step": 1,
        "name": "Масштаб"
      }
    },
    {
      "name": "rotate0",
      "value": 0,
      "bind": {
        "input": "range",
        "min": -180,
        "max": 180,
        "step": 1,
        "name": "Поворот по долготе"
      }
    },
    {
      "name": "rotate1",
      "value": 0,
      "bind": {
        "input": "range",
        "min": -90,
        "max": 90,
        "step": 1,
        "name": "Поворот по широте"
      }
    },
    {
      "name": "rotate2",
      "value": 0,
      "bind": {
        "input": "range",
        "min": -180,
        "max": 180,
        "step": 1,
        "name": "Поворот вокруг оси"
      }
    },
    {
      "name": "center0",
      "value": 0,
      "bind": {
        "input": "range",
        "min": -180,
        "max": 180,
        "step": 1,
        "name": "Долгота центра"
      }
    },
    {
      "name": "center1",
      "value": 0,
      "bind": {
        "input": "range",
        "min": -90,
        "max": 90,
        "step": 1,
        "name": "Широта центра"
      }
    },
    {
      "name": "translate0",
      "update": "width / 2"
    },
    {
      "name": "translate1",
      "update": "height / 2"
    }
  ],
  "projections": [
    {
      "name": "projection",
      "type": {
        "signal": "type"
      },
      "scale": {
        "signal": "scale"
      },
      "rotate": [
        {
          "signal": "rotate0"
        },
        {
          "signal": "rotate1"
        },
        {
          "signal": "rotate2"
        }
      ],
      "center": [
        {
          "signal": "center0"
        },
        {
          "signal": "center1"
        }
      ],
      "translate": [
        {
          "signal": "translate0"
        },
        {
          "signal": "translate1"
        }
      ]
    }
  ],
  "data": [
    {
      "name": "world",
      "url": "data/world-110m.json",
      "format": {
        "type": "topojson",
        "feature": "countries"
      },
      "transform": [
        {
          "type": "filter",
          "expr": "type !== 'albersUsa' || datum.id === 840"
        }
      ]
    },
    {
      "name": "graticule",
      "transform": [
        {
          "type": "graticule",
          "step": [
            {
              "signal": "step"
            },
            {
              "signal": "step"
            }
          ]
        }
      ]
    }
  ],
  "marks": [
    {
      "type": "shape",
      "from": {
        "data": "graticule"
      },
      "encode": {
        "update": {
          "strokeWidth": {
            "value": 1
          },
          "stroke": {
            "value": "#ddd"
          },
          "fill": {
            "value": null
          }
        }
      },
      "transform": [
        {
          "type": "geoshape",
          "projection": "projection"
        }
      ]
    },
    {
      "type": "shape",
      "from": {
        "data": "world"
      },
      "encode": {
        "update": {
          "strokeWidth": {
            "value": 0.5
          },
          "stroke": {
            "value": "#bbb"
          },
          "fill": {
            "value": "#000"
          },
          "zindex": {
            "value": 0
          }
        },
        "hover": {
          "strokeWidth": {
            "value": 1
          },
          "stroke": {
            "value": "firebrick"
          },
          "zindex": {
            "value": 1
          }
        }
      },
      "transform": [
        {
          "type": "geoshape",
          "projection": "projection"
        }
      ]
    }
  ]
}
