{ "$schema": "https://vega.github.io/schema/vega/v5.json", "background": "white", "padding": 5, "width": 200, "height": 200, "style": "cell", "data": [ {"name": "source_0", "url": "data/movies.json", "format": {"type": "json"}} ], "marks": [ { "name": "marks", "type": "symbol", "style": ["point"], "from": {"data": "source_0"}, "encode": { "update": { "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": [ { "test": "datum['IMDB Rating'] === null || datum['Rotten Tomatoes Rating'] === null", "value": "#aaa" }, {"value": "#4c78a8"} ], "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"IMDB Rating: \" + (format(datum[\"IMDB Rating\"], \"\")) + \"; Rotten Tomatoes Rating: \" + (format(datum[\"Rotten Tomatoes Rating\"], \"\"))" }, "x": [ { "test": "!isValid(datum[\"IMDB Rating\"]) || !isFinite(+datum[\"IMDB Rating\"])", "value": 0 }, {"scale": "x", "field": "IMDB Rating"} ], "y": [ { "test": "!isValid(datum[\"Rotten Tomatoes Rating\"]) || !isFinite(+datum[\"Rotten Tomatoes Rating\"])", "field": {"group": "height"} }, {"scale": "y", "field": "Rotten Tomatoes Rating"} ] } } } ], "scales": [ { "name": "x", "type": "linear", "domain": {"data": "source_0", "field": "IMDB Rating"}, "range": [0, {"signal": "width"}], "nice": true, "zero": true }, { "name": "y", "type": "linear", "domain": {"data": "source_0", "field": "Rotten Tomatoes Rating"}, "range": [{"signal": "height"}, 0], "nice": true, "zero": true } ], "axes": [ { "scale": "x", "orient": "bottom", "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "y", "orient": "left", "gridScale": "x", "grid": true, "tickCount": {"signal": "ceil(height/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "x", "orient": "bottom", "grid": false, "title": "IMDB Rating", "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, "zindex": 0 }, { "scale": "y", "orient": "left", "grid": false, "title": "Rotten Tomatoes Rating", "labelOverlap": true, "tickCount": {"signal": "ceil(height/40)"}, "zindex": 0 } ] }