livebook-dev / kino_vega_lite

Vega-Lite (graphics) integration for Livebook
Apache License 2.0
26 stars 8 forks source link

Add topojson/geodata support #34

Closed josevalim closed 1 year ago

josevalim commented 1 year ago

For example:

Vl.new(width: 500, height: 300)
|> Vl.config(projection: [type: :mercator, center: [10.4515, 51.1657]])
|> Vl.data_from_url("https://raw.githubusercontent.com/deldersveld/topojson/master/countries/germany/germany-regions.json",
  format: [type: :topojson, feature: "DEU_adm2"])
|> VL.layers([
  VL.new()
  |> VL.mark(:geoshape, fill: "lightgray", stroke: "white"),
  VL.new()
  |> Vl.encode_field(:longitude, "longitude", type: :quantitative)
  |> VL.encode_field(:latitude, "latitude", type: :quantitative)
  |> VL.mark(:circle)
])

Extracted from:

https://snapshots.nextjournal.com/clerk-demo/build/f8112d44fa742cd0913dcbd370919eca249cbcd9/notebooks/semantic.html