From e526fbf86a5a28c9f5a31b3a2bef1a9e9b898dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Redzy=C5=84ski?= Date: Tue, 23 Aug 2022 17:21:27 +0200 Subject: [PATCH 1/2] examples: update interactive earthquakes map --- .../specs/interactive_geo_earthquakes.vl.json | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/specs/interactive_geo_earthquakes.vl.json b/examples/specs/interactive_geo_earthquakes.vl.json index 353f0d333b..b39cfda15f 100644 --- a/examples/specs/interactive_geo_earthquakes.vl.json +++ b/examples/specs/interactive_geo_earthquakes.vl.json @@ -4,16 +4,11 @@ "height": 300, "projection": { "type": "orthographic", - "rotate": {"expr": "[rotate0, rotate1, 0]"} + "rotate": {"expr": "[rotate, 0, 0]"} }, "params": [ { - "name": "rotate0", - "value": 0, - "bind": {"input": "range", "min": -90, "max": 90, "step": 1} - }, - { - "name": "rotate1", + "name": "rotate", "value": 0, "bind": {"input": "range", "min": -90, "max": 90, "step": 1} }, @@ -46,7 +41,7 @@ {"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" + "filter": "(rotate * -1) - 90 < datum.longitude && datum.longitude < (rotate * -1) + 90" }, {"calculate": "datum.properties.mag", "as": "magnitude"} ], @@ -64,8 +59,8 @@ "range": [0, {"expr": "pow(earthquakeSize, 3)"}] } }, - "tooltip": [{"field": "magnitude"}] + "tooltip": [{"field": "magnitude"}, {"field": "longitude"}, {"field": "latitude"}] } } ] -} \ No newline at end of file +} From d46c80ab026389cb11ca76488a599055455de52d Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Tue, 23 Aug 2022 15:58:06 +0000 Subject: [PATCH 2/2] chore: update examples [CI] --- .../interactive_geo_earthquakes.vg.json | 13 ++++-------- ...ractive_geo_earthquakes_normalized.vl.json | 21 +++++++++---------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/examples/compiled/interactive_geo_earthquakes.vg.json b/examples/compiled/interactive_geo_earthquakes.vg.json index 24d9a2785a..5e5d0ca1a5 100644 --- a/examples/compiled/interactive_geo_earthquakes.vg.json +++ b/examples/compiled/interactive_geo_earthquakes.vg.json @@ -28,7 +28,7 @@ }, { "type": "filter", - "expr": "(rotate0 * -1) - 90 < datum.longitude && datum.longitude < (rotate0 * -1) + 90 && (rotate1 * -1) - 90 < datum.latitude && datum.latitude < (rotate1 * -1) + 90" + "expr": "(rotate * -1) - 90 < datum.longitude && datum.longitude < (rotate * -1) + 90" }, {"type": "formula", "expr": "datum.properties.mag", "as": "magnitude"}, { @@ -55,17 +55,12 @@ "size": {"signal": "[width, height]"}, "fit": {"signal": "[data('source_0'), data('world'), layer_2_geojson_0]"}, "type": "orthographic", - "rotate": {"signal": "[rotate0, rotate1, 0]"} + "rotate": {"signal": "[rotate, 0, 0]"} } ], "signals": [ { - "name": "rotate0", - "value": 0, - "bind": {"input": "range", "min": -90, "max": 90, "step": 1} - }, - { - "name": "rotate1", + "name": "rotate", "value": 0, "bind": {"input": "range", "min": -90, "max": 90, "step": 1} }, @@ -113,7 +108,7 @@ "opacity": {"value": 0.25}, "fill": {"value": "red"}, "tooltip": { - "signal": "{\"magnitude\": isValid(datum[\"magnitude\"]) ? datum[\"magnitude\"] : \"\"+datum[\"magnitude\"]}" + "signal": "{\"magnitude\": isValid(datum[\"magnitude\"]) ? datum[\"magnitude\"] : \"\"+datum[\"magnitude\"], \"longitude\": isValid(datum[\"longitude\"]) ? datum[\"longitude\"] : \"\"+datum[\"longitude\"], \"latitude\": isValid(datum[\"latitude\"]) ? datum[\"latitude\"] : \"\"+datum[\"latitude\"]}" }, "ariaRoleDescription": {"value": "circle"}, "description": { diff --git a/examples/specs/normalized/interactive_geo_earthquakes_normalized.vl.json b/examples/specs/normalized/interactive_geo_earthquakes_normalized.vl.json index c89a4f247b..38430f107b 100644 --- a/examples/specs/normalized/interactive_geo_earthquakes_normalized.vl.json +++ b/examples/specs/normalized/interactive_geo_earthquakes_normalized.vl.json @@ -4,12 +4,7 @@ "height": 300, "params": [ { - "name": "rotate0", - "value": 0, - "bind": {"input": "range", "min": -90, "max": 90, "step": 1} - }, - { - "name": "rotate1", + "name": "rotate", "value": 0, "bind": {"input": "range", "min": -90, "max": 90, "step": 1} }, @@ -25,7 +20,7 @@ "mark": {"type": "geoshape", "fill": "aliceblue"}, "projection": { "type": "orthographic", - "rotate": {"expr": "[rotate0, rotate1, 0]"} + "rotate": {"expr": "[rotate, 0, 0]"} } }, { @@ -37,7 +32,7 @@ "mark": {"type": "geoshape", "fill": "mintcream", "stroke": "black"}, "projection": { "type": "orthographic", - "rotate": {"expr": "[rotate0, rotate1, 0]"} + "rotate": {"expr": "[rotate, 0, 0]"} } }, { @@ -60,19 +55,23 @@ "range": [0, {"expr": "pow(earthquakeSize, 3)"}] } }, - "tooltip": [{"field": "magnitude"}] + "tooltip": [ + {"field": "magnitude"}, + {"field": "longitude"}, + {"field": "latitude"} + ] }, "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" + "filter": "(rotate * -1) - 90 < datum.longitude && datum.longitude < (rotate * -1) + 90" }, {"calculate": "datum.properties.mag", "as": "magnitude"} ], "projection": { "type": "orthographic", - "rotate": {"expr": "[rotate0, rotate1, 0]"} + "rotate": {"expr": "[rotate, 0, 0]"} } } ]