{ "$schema": "https://vega.github.io/schema/vega/v5.json", "background": "white", "padding": 5, "data": [ { "name": "source_0", "url": "data/movies.json", "format": {"type": "json"}, "transform": [ { "type": "extent", "field": "Rotten Tomatoes Rating", "signal": "concat_1_concat_1_bin_maxbins_10_Rotten_Tomatoes_Rating_extent" }, { "type": "bin", "field": "Rotten Tomatoes Rating", "as": [ "bin_maxbins_10_Rotten Tomatoes Rating", "bin_maxbins_10_Rotten Tomatoes Rating_end" ], "signal": "concat_1_concat_1_bin_maxbins_10_Rotten_Tomatoes_Rating_bins", "extent": { "signal": "concat_1_concat_1_bin_maxbins_10_Rotten_Tomatoes_Rating_extent" }, "maxbins": 10 }, { "type": "extent", "field": "IMDB Rating", "signal": "concat_0_bin_maxbins_10_IMDB_Rating_extent" }, { "type": "bin", "field": "IMDB Rating", "as": [ "bin_maxbins_10_IMDB Rating", "bin_maxbins_10_IMDB Rating_end" ], "signal": "concat_0_bin_maxbins_10_IMDB_Rating_bins", "extent": {"signal": "concat_0_bin_maxbins_10_IMDB_Rating_extent"}, "maxbins": 10 } ] }, { "name": "data_0", "source": "source_0", "transform": [ { "type": "aggregate", "groupby": [ "bin_maxbins_10_Rotten Tomatoes Rating", "bin_maxbins_10_Rotten Tomatoes Rating_end" ], "ops": ["count"], "fields": [null], "as": ["__count"] }, { "type": "filter", "expr": "isValid(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) && isFinite(+datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"])" } ] }, { "name": "data_1", "source": "source_0", "transform": [ { "type": "aggregate", "groupby": [ "bin_maxbins_10_IMDB Rating", "bin_maxbins_10_IMDB Rating_end" ], "ops": ["count"], "fields": [null], "as": ["__count"] }, { "type": "filter", "expr": "isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) && isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"])" } ] }, { "name": "data_2", "source": "source_0", "transform": [ { "type": "aggregate", "groupby": [ "bin_maxbins_10_IMDB Rating", "bin_maxbins_10_IMDB Rating_end", "bin_maxbins_10_Rotten Tomatoes Rating", "bin_maxbins_10_Rotten Tomatoes Rating_end" ], "ops": ["count"], "fields": [null], "as": ["__count"] }, { "type": "filter", "expr": "isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) && isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) && isValid(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) && isFinite(+datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"])" } ] } ], "signals": [ {"name": "concat_0_width", "value": 200}, {"name": "concat_0_height", "value": 60}, {"name": "concat_1_height", "value": 200}, {"name": "concat_1_concat_0_width", "value": 200}, {"name": "concat_1_concat_1_width", "value": 60} ], "layout": {"padding": 15, "columns": 1, "bounds": "flush", "align": "each"}, "marks": [ { "type": "group", "name": "concat_0_group", "style": "cell", "encode": { "update": { "width": {"signal": "concat_0_width"}, "height": {"signal": "concat_0_height"} } }, "marks": [ { "name": "concat_0_marks", "type": "rect", "style": ["bar"], "from": {"data": "data_1"}, "encode": { "update": { "fill": {"value": "#4c78a8"}, "ariaRoleDescription": {"value": "bar"}, "description": { "signal": "\"IMDB Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_IMDB Rating\"], \"\") + \" – \" + format(datum[\"bin_maxbins_10_IMDB Rating_end\"], \"\")) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))" }, "x2": { "scale": "concat_0_x", "field": "bin_maxbins_10_IMDB Rating", "offset": 1 }, "x": { "scale": "concat_0_x", "field": "bin_maxbins_10_IMDB Rating_end" }, "y": {"scale": "concat_0_y", "field": "__count"}, "y2": {"scale": "concat_0_y", "value": 0} } } } ], "axes": [ { "scale": "concat_0_y", "orient": "left", "gridScale": "concat_0_x", "grid": true, "tickCount": {"signal": "ceil(concat_0_height/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "concat_0_y", "orient": "left", "grid": false, "labelOverlap": true, "tickCount": {"signal": "ceil(concat_0_height/40)"}, "zindex": 0 } ] }, { "type": "group", "name": "concat_1_group", "layout": {"padding": 15, "bounds": "flush", "align": "each"}, "marks": [ { "type": "group", "name": "concat_1_concat_0_group", "style": "cell", "encode": { "update": { "width": {"signal": "concat_1_concat_0_width"}, "height": {"signal": "concat_1_height"} } }, "marks": [ { "name": "concat_1_concat_0_marks", "type": "rect", "style": ["rect"], "from": {"data": "data_2"}, "encode": { "update": { "fill": {"scale": "color", "field": "__count"}, "description": { "signal": "\"IMDB Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_IMDB Rating\"], \"\") + \" – \" + format(datum[\"bin_maxbins_10_IMDB Rating_end\"], \"\")) + \"; Rotten Tomatoes Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"], \"\") + \" – \" + format(datum[\"bin_maxbins_10_Rotten Tomatoes Rating_end\"], \"\")) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))" }, "x2": { "scale": "concat_1_concat_0_x", "field": "bin_maxbins_10_IMDB Rating", "offset": 0.5 }, "x": { "scale": "concat_1_concat_0_x", "field": "bin_maxbins_10_IMDB Rating_end", "offset": 0.5 }, "y2": { "scale": "concat_1_concat_0_y", "field": "bin_maxbins_10_Rotten Tomatoes Rating", "offset": 0.5 }, "y": { "scale": "concat_1_concat_0_y", "field": "bin_maxbins_10_Rotten Tomatoes Rating_end", "offset": 0.5 } } } } ], "axes": [ { "scale": "concat_1_concat_0_x", "orient": "bottom", "grid": false, "title": "IMDB Rating (binned)", "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(concat_1_concat_0_width/10)"}, "zindex": 1 }, { "scale": "concat_1_concat_0_y", "orient": "left", "grid": false, "title": "Rotten Tomatoes Rating (binned)", "labelOverlap": true, "tickCount": {"signal": "ceil(concat_1_height/10)"}, "zindex": 1 } ] }, { "type": "group", "name": "concat_1_concat_1_group", "style": "cell", "encode": { "update": { "width": {"signal": "concat_1_concat_1_width"}, "height": {"signal": "concat_1_height"} } }, "marks": [ { "name": "concat_1_concat_1_marks", "type": "rect", "style": ["bar"], "from": {"data": "data_0"}, "encode": { "update": { "fill": {"value": "#4c78a8"}, "ariaRoleDescription": {"value": "bar"}, "description": { "signal": "\"Count of Records: \" + (format(datum[\"__count\"], \"\")) + \"; Rotten Tomatoes Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_Rotten Tomatoes Rating\"], \"\") + \" – \" + format(datum[\"bin_maxbins_10_Rotten Tomatoes Rating_end\"], \"\"))" }, "x": {"scale": "concat_1_concat_1_x", "field": "__count"}, "x2": {"scale": "concat_1_concat_1_x", "value": 0}, "y2": { "scale": "concat_1_concat_1_y", "field": "bin_maxbins_10_Rotten Tomatoes Rating" }, "y": { "scale": "concat_1_concat_1_y", "field": "bin_maxbins_10_Rotten Tomatoes Rating_end", "offset": 1 } } } } ], "axes": [ { "scale": "concat_1_concat_1_x", "orient": "bottom", "gridScale": "concat_1_concat_1_y", "grid": true, "tickCount": {"signal": "ceil(concat_1_concat_1_width/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "concat_1_concat_1_x", "orient": "bottom", "grid": false, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(concat_1_concat_1_width/40)"}, "zindex": 0 } ] } ] } ], "scales": [ { "name": "color", "type": "linear", "domain": {"data": "data_2", "field": "__count"}, "range": "heatmap", "interpolate": "hcl", "zero": false }, { "name": "concat_0_x", "type": "linear", "domain": { "signal": "[concat_0_bin_maxbins_10_IMDB_Rating_bins.start, concat_0_bin_maxbins_10_IMDB_Rating_bins.stop]" }, "range": [0, {"signal": "concat_0_width"}], "bins": {"signal": "concat_0_bin_maxbins_10_IMDB_Rating_bins"}, "zero": false }, { "name": "concat_0_y", "type": "linear", "domain": [0, 1000], "range": [{"signal": "concat_0_height"}, 0], "zero": true }, { "name": "concat_1_concat_0_x", "type": "linear", "domain": { "signal": "[concat_0_bin_maxbins_10_IMDB_Rating_bins.start, concat_0_bin_maxbins_10_IMDB_Rating_bins.stop]" }, "range": [0, {"signal": "concat_1_concat_0_width"}], "bins": {"signal": "concat_0_bin_maxbins_10_IMDB_Rating_bins"}, "zero": false }, { "name": "concat_1_concat_0_y", "type": "linear", "domain": { "signal": "[concat_1_concat_1_bin_maxbins_10_Rotten_Tomatoes_Rating_bins.start, concat_1_concat_1_bin_maxbins_10_Rotten_Tomatoes_Rating_bins.stop]" }, "range": [{"signal": "concat_1_height"}, 0], "bins": { "signal": "concat_1_concat_1_bin_maxbins_10_Rotten_Tomatoes_Rating_bins" }, "zero": false }, { "name": "concat_1_concat_1_x", "type": "linear", "domain": [0, 1000], "range": [0, {"signal": "concat_1_concat_1_width"}], "zero": true }, { "name": "concat_1_concat_1_y", "type": "linear", "domain": { "signal": "[concat_1_concat_1_bin_maxbins_10_Rotten_Tomatoes_Rating_bins.start, concat_1_concat_1_bin_maxbins_10_Rotten_Tomatoes_Rating_bins.stop]" }, "range": [{"signal": "concat_1_height"}, 0], "bins": { "signal": "concat_1_concat_1_bin_maxbins_10_Rotten_Tomatoes_Rating_bins" }, "zero": false } ], "legends": [ { "fill": "color", "gradientLength": {"signal": "clamp(concat_1_height, 64, 200)"}, "title": "Count of Records" } ], "config": {"style": {"cell": {"stroke": "transparent"}}} }