Skip to content

Commit

Permalink
chore: update examples [CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Actions Bot committed May 8, 2022
1 parent 55d099e commit b6899b8
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 0 deletions.
Binary file added examples/compiled/interactive_geo_earthquakes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/compiled/interactive_geo_earthquakes.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
157 changes: 157 additions & 0 deletions examples/compiled/interactive_geo_earthquakes.vg.json
@@ -0,0 +1,157 @@
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"background": "white",
"padding": 5,
"width": 300,
"height": 300,
"data": [
{"name": "source_0", "values": [{"type": "Sphere"}]},
{
"name": "world",
"url": "data/world-110m.json",
"format": {"type": "topojson", "feature": "countries"}
},
{
"name": "earthquakes",
"url": "data/earthquakes.json",
"format": {"type": "json", "property": "features", "parse": {}},
"transform": [
{
"type": "formula",
"expr": "datum[\"properties\"] && datum[\"properties\"][\"mag\"]",
"as": "properties.mag"
},
{
"type": "formula",
"expr": "datum.geometry.coordinates[0]",
"as": "longitude"
},
{
"type": "formula",
"expr": "datum.geometry.coordinates[1]",
"as": "latitude"
},
{
"type": "filter",
"expr": "(rotate0 * -1) - 90 < datum.longitude && datum.longitude < (rotate0 * -1) + 90 && (rotate1 * -1) - 90 < datum.latitude && datum.latitude < (rotate1 * -1) + 90"
},
{
"type": "geojson",
"fields": ["longitude", "latitude"],
"signal": "layer_2_geojson_0"
},
{
"type": "geopoint",
"projection": "projection",
"fields": ["longitude", "latitude"],
"as": ["layer_2_x", "layer_2_y"]
},
{
"type": "filter",
"expr": "isValid(datum[\"properties.mag\"]) && isFinite(+datum[\"properties.mag\"])"
}
]
}
],
"projections": [
{
"name": "projection",
"size": {"signal": "[width, height]"},
"fit": {"signal": "[data('source_0'), data('world'), layer_2_geojson_0]"},
"type": "orthographic",
"rotate": [{"signal": "rotate0"}, {"signal": "rotate1"}, 0]
}
],
"signals": [
{
"name": "rotate0",
"value": 100,
"bind": {"input": "range", "min": -180, "max": 180, "step": 1}
},
{
"name": "rotate1",
"value": 0,
"bind": {"input": "range", "min": -180, "max": 180, "step": 1}
},
{
"name": "earthquakeSize",
"value": 6,
"bind": {"input": "range", "min": 0, "max": 12, "step": 1}
}
],
"marks": [
{
"name": "layer_0_marks",
"type": "shape",
"style": ["geoshape"],
"from": {"data": "source_0"},
"encode": {
"update": {
"fill": {"value": "aliceblue"},
"ariaRoleDescription": {"value": "geoshape"}
}
},
"transform": [{"type": "geoshape", "projection": "projection"}]
},
{
"name": "layer_1_marks",
"type": "shape",
"style": ["geoshape"],
"from": {"data": "world"},
"encode": {
"update": {
"fill": {"value": "mintcream"},
"stroke": {"value": "black"},
"ariaRoleDescription": {"value": "geoshape"}
}
},
"transform": [{"type": "geoshape", "projection": "projection"}]
},
{
"name": "layer_2_marks",
"type": "symbol",
"style": ["circle"],
"from": {"data": "earthquakes"},
"encode": {
"update": {
"opacity": {"value": 0.25},
"fill": {"value": "red"},
"ariaRoleDescription": {"value": "circle"},
"description": {
"signal": "\"longitude: \" + (format(datum[\"longitude\"], \"\")) + \"; latitude: \" + (format(datum[\"latitude\"], \"\")) + \"; properties.mag: \" + (format(datum[\"properties.mag\"], \"\"))"
},
"x": {"field": "layer_2_x"},
"y": {"field": "layer_2_y"},
"size": {"scale": "size", "field": "properties\\.mag"},
"shape": {"value": "circle"}
}
}
}
],
"scales": [
{
"name": "size",
"type": "pow",
"domain": {"data": "earthquakes", "field": "properties\\.mag"},
"range": [0, 1000],
"exponent": {"signal": "12-earthquakeSize"},
"zero": true
}
],
"legends": [
{
"size": "size",
"symbolType": "circle",
"title": "properties.mag",
"encode": {
"symbols": {
"update": {
"fill": {"value": "red"},
"opacity": {"value": 0.25},
"stroke": {"value": "transparent"}
}
}
}
}
]
}
@@ -0,0 +1,77 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": 300,
"height": 300,
"params": [
{
"name": "rotate0",
"value": 100,
"bind": {"input": "range", "min": -180, "max": 180, "step": 1}
},
{
"name": "rotate1",
"value": 0,
"bind": {"input": "range", "min": -180, "max": 180, "step": 1}
},
{
"name": "earthquakeSize",
"value": 6,
"bind": {"input": "range", "min": 0, "max": 12, "step": 1}
}
],
"layer": [
{
"data": {"sphere": true},
"mark": {"type": "geoshape", "fill": "aliceblue"},
"projection": {
"type": "orthographic",
"rotate": [{"signal": "rotate0"}, {"signal": "rotate1"}, 0]
}
},
{
"data": {
"name": "world",
"url": "data/world-110m.json",
"format": {"type": "topojson", "feature": "countries"}
},
"mark": {"type": "geoshape", "fill": "mintcream", "stroke": "black"},
"projection": {
"type": "orthographic",
"rotate": [{"signal": "rotate0"}, {"signal": "rotate1"}, 0]
}
},
{
"data": {
"name": "earthquakes",
"url": "data/earthquakes.json",
"format": {"type": "json", "property": "features"}
},
"mark": {"type": "circle", "color": "red", "opacity": 0.25},
"encoding": {
"longitude": {"field": "longitude", "type": "quantitative"},
"latitude": {"field": "latitude", "type": "quantitative"},
"size": {
"field": "properties.mag",
"type": "quantitative",
"scale": {
"type": "pow",
"range": [0, 1000],
"exponent": {"expr": "12-earthquakeSize"}
}
}
},
"transform": [
{"calculate": "datum.geometry.coordinates[0]", "as": "longitude"},
{"calculate": "datum.geometry.coordinates[1]", "as": "latitude"},
{
"filter": "(rotate0 * -1) - 90 < datum.longitude && datum.longitude < (rotate0 * -1) + 90 && (rotate1 * -1) - 90 < datum.latitude && datum.latitude < (rotate1 * -1) + 90"
}
],
"projection": {
"type": "orthographic",
"rotate": [{"signal": "rotate0"}, {"signal": "rotate1"}, 0]
}
}
],
"config": {}
}

0 comments on commit b6899b8

Please sign in to comment.