{ "$schema": "https://vega.github.io/schema/vega/v5.json", "background": "white", "padding": 5, "width": 500, "height": 300, "data": [ { "name": "source_1", "url": "data/unemployment.tsv", "format": {"type": "tsv"} }, { "name": "source_0", "url": "data/us-10m.json", "format": {"type": "topojson", "feature": "counties"}, "transform": [ { "type": "lookup", "from": "source_1", "key": "id", "fields": ["id"], "values": ["rate"] }, { "type": "filter", "expr": "isValid(datum[\"rate\"]) && isFinite(+datum[\"rate\"])" } ] } ], "projections": [ { "name": "projection", "size": {"signal": "[width, height]"}, "fit": {"signal": "data('source_0')"}, "type": "albersUsa" } ], "marks": [ { "name": "marks", "type": "shape", "style": ["geoshape"], "from": {"data": "source_0"}, "encode": { "update": { "fill": {"scale": "color", "field": "rate"}, "ariaRoleDescription": {"value": "geoshape"}, "description": { "signal": "\"rate: \" + (format(datum[\"rate\"], \"\"))" } } }, "transform": [{"type": "geoshape", "projection": "projection"}] } ], "scales": [ { "name": "color", "type": "linear", "domain": {"data": "source_0", "field": "rate"}, "range": "heatmap", "interpolate": "hcl", "zero": false } ], "legends": [ { "fill": "color", "gradientLength": {"signal": "clamp(height, 64, 200)"}, "title": "rate" } ] }