【问题标题】:Deneb Vega Lite Map not displayingDeneb Vega Lite 地图不显示
【发布时间】:2022-08-10 04:24:39
【问题描述】:

我在 PowerBI 中使用 deneb 可视化,我正在尝试创建澳大利亚地图,下面的 json 代码没有出现任何错误,但我的地图没有显示。有谁知道我做错了什么?

{
  \"$schema\": \"https://vega.github.io/schema/vega-lite/v5.json\",
  \"width\": 500,
  \"height\": 300,
  \"layer\": [
    {
      \"transform\": [
        {\"filter\": \"isValid(datum.id)\"},
        {
          \"lookup\": \"id\",
          \"from\": {
            \"data\": {
              \"url\": \"https://raw.githubusercontent.com/cartdeco/Australia-json-data/master/aus25fgd_r.topojson\",
              \"format\": {
                \"type\": \"topojson\"
              }
            },
            \"key\": \"id\"
          },
          \"as\": \"geo\"
        }
      ],
      \"projection\": {
        \"type\": \"mercator\"
      },
      \"mark\": {
        \"type\": \"geoshape\",
        \"fill\": \"lightgray\",
        \"stroke\": \"white\"
      }
    },
    {
      \"data\": {\"name\": \"Electorate\"},
      \"projection\": {
        \"type\": \"mercator\"
      },
      \"mark\": \"circle\",
      \"encoding\": {
        \"longitude\": {
          \"field\": \"Long\",
          \"type\": \"quantitative\"
        },
        \"latitude\": {
          \"field\": \"Lat\",
          \"type\": \"quantitative\"
        },
        \"size\": {\"value\": 10},
        \"color\": {\"value\": \"steelblue\"}
      }
    }
  ]
}

这是我正在使用的数据https://www.matthewproctor.com/australian_postcodes

任何帮助,将不胜感激。

干杯,

克里斯

    标签: json powerbi vega-lite deneb


    【解决方案1】:

    看起来您正在尝试从远程 URL 加载地图图层。因为 AppSource 中的 Deneb 是经过认证的,所以不允许从外部 URL 加载数据。您可以使用可从 GitHub 存储库下载的独立版本解决此问题 - documentation here

    【讨论】:

    • 好吧,我当然不知道。感谢您的回复!
    猜你喜欢
    • 1970-01-01
    • 2021-03-23
    • 1970-01-01
    • 2019-05-29
    • 2020-03-19
    • 2020-04-22
    • 2021-05-28
    • 2021-09-27
    • 2019-06-02
    相关资源
    最近更新 更多