{ "$schema": "https://vega.github.io/schema/vega/v5.json", "background": "white", "padding": 5, "data": [ {"name": "source_0", "url": "data/cars.json", "format": {"type": "json"}}, { "name": "data_0", "source": "source_0", "transform": [ { "type": "filter", "expr": "isValid(datum[\"Horsepower\"]) && isFinite(+datum[\"Horsepower\"]) && isValid(datum[\"Displacement\"]) && isFinite(+datum[\"Displacement\"])" } ] }, { "name": "data_1", "source": "source_0", "transform": [ { "type": "filter", "expr": "isValid(datum[\"Miles_per_Gallon\"]) && isFinite(+datum[\"Miles_per_Gallon\"]) && isValid(datum[\"Displacement\"]) && isFinite(+datum[\"Displacement\"])" } ] }, { "name": "data_2", "source": "source_0", "transform": [ { "type": "filter", "expr": "isValid(datum[\"Horsepower\"]) && isFinite(+datum[\"Horsepower\"]) && isValid(datum[\"Miles_per_Gallon\"]) && isFinite(+datum[\"Miles_per_Gallon\"])" } ] }, { "name": "data_3", "source": "source_0", "transform": [ { "type": "filter", "expr": "isValid(datum[\"Miles_per_Gallon\"]) && isFinite(+datum[\"Miles_per_Gallon\"])" } ] } ], "signals": [ {"name": "childWidth", "value": 200}, {"name": "childHeight", "value": 200} ], "layout": {"padding": 20, "columns": 2, "bounds": "full", "align": "all"}, "marks": [ { "type": "group", "name": "child__row_Displacementcolumn_Horsepower_group", "style": "cell", "encode": { "update": { "width": {"signal": "childWidth"}, "height": {"signal": "childHeight"} } }, "marks": [ { "name": "child__row_Displacementcolumn_Horsepower_marks", "type": "symbol", "style": ["point"], "from": {"data": "data_0"}, "encode": { "update": { "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"scale": "color", "field": "Origin"}, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"Horsepower: \" + (format(datum[\"Horsepower\"], \"\")) + \"; Displacement: \" + (format(datum[\"Displacement\"], \"\")) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"])" }, "x": { "scale": "child__row_Displacementcolumn_Horsepower_x", "field": "Horsepower" }, "y": { "scale": "child__row_Displacementcolumn_Horsepower_y", "field": "Displacement" } } } } ], "axes": [ { "scale": "child__row_Displacementcolumn_Horsepower_x", "orient": "bottom", "gridScale": "child__row_Displacementcolumn_Horsepower_y", "grid": true, "tickCount": {"signal": "ceil(childWidth/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "child__row_Displacementcolumn_Horsepower_y", "orient": "left", "gridScale": "child__row_Displacementcolumn_Horsepower_x", "grid": true, "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "child__row_Displacementcolumn_Horsepower_x", "orient": "bottom", "grid": false, "title": "Horsepower", "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(childWidth/40)"}, "zindex": 0 }, { "scale": "child__row_Displacementcolumn_Horsepower_y", "orient": "left", "grid": false, "title": "Displacement", "labelOverlap": true, "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] }, { "type": "group", "name": "child__row_Displacementcolumn_Miles_per_Gallon_group", "style": "cell", "encode": { "update": { "width": {"signal": "childWidth"}, "height": {"signal": "childHeight"} } }, "marks": [ { "name": "child__row_Displacementcolumn_Miles_per_Gallon_marks", "type": "symbol", "style": ["point"], "from": {"data": "data_1"}, "encode": { "update": { "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"scale": "color", "field": "Origin"}, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"Miles_per_Gallon: \" + (format(datum[\"Miles_per_Gallon\"], \"\")) + \"; Displacement: \" + (format(datum[\"Displacement\"], \"\")) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"])" }, "x": { "scale": "child__row_Displacementcolumn_Miles_per_Gallon_x", "field": "Miles_per_Gallon" }, "y": { "scale": "child__row_Displacementcolumn_Miles_per_Gallon_y", "field": "Displacement" } } } } ], "axes": [ { "scale": "child__row_Displacementcolumn_Miles_per_Gallon_x", "orient": "bottom", "gridScale": "child__row_Displacementcolumn_Miles_per_Gallon_y", "grid": true, "tickCount": {"signal": "ceil(childWidth/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "child__row_Displacementcolumn_Miles_per_Gallon_y", "orient": "left", "gridScale": "child__row_Displacementcolumn_Miles_per_Gallon_x", "grid": true, "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "child__row_Displacementcolumn_Miles_per_Gallon_x", "orient": "bottom", "grid": false, "title": "Miles_per_Gallon", "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(childWidth/40)"}, "zindex": 0 }, { "scale": "child__row_Displacementcolumn_Miles_per_Gallon_y", "orient": "left", "grid": false, "title": "Displacement", "labelOverlap": true, "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] }, { "type": "group", "name": "child__row_Miles_per_Galloncolumn_Horsepower_group", "style": "cell", "encode": { "update": { "width": {"signal": "childWidth"}, "height": {"signal": "childHeight"} } }, "marks": [ { "name": "child__row_Miles_per_Galloncolumn_Horsepower_marks", "type": "symbol", "style": ["point"], "from": {"data": "data_2"}, "encode": { "update": { "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"scale": "color", "field": "Origin"}, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"Horsepower: \" + (format(datum[\"Horsepower\"], \"\")) + \"; Miles_per_Gallon: \" + (format(datum[\"Miles_per_Gallon\"], \"\")) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"])" }, "x": { "scale": "child__row_Miles_per_Galloncolumn_Horsepower_x", "field": "Horsepower" }, "y": { "scale": "child__row_Miles_per_Galloncolumn_Horsepower_y", "field": "Miles_per_Gallon" } } } } ], "axes": [ { "scale": "child__row_Miles_per_Galloncolumn_Horsepower_x", "orient": "bottom", "gridScale": "child__row_Miles_per_Galloncolumn_Horsepower_y", "grid": true, "tickCount": {"signal": "ceil(childWidth/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "child__row_Miles_per_Galloncolumn_Horsepower_y", "orient": "left", "gridScale": "child__row_Miles_per_Galloncolumn_Horsepower_x", "grid": true, "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "child__row_Miles_per_Galloncolumn_Horsepower_x", "orient": "bottom", "grid": false, "title": "Horsepower", "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(childWidth/40)"}, "zindex": 0 }, { "scale": "child__row_Miles_per_Galloncolumn_Horsepower_y", "orient": "left", "grid": false, "title": "Miles_per_Gallon", "labelOverlap": true, "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] }, { "type": "group", "name": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_group", "style": "cell", "encode": { "update": { "width": {"signal": "childWidth"}, "height": {"signal": "childHeight"} } }, "marks": [ { "name": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_marks", "type": "symbol", "style": ["point"], "from": {"data": "data_3"}, "encode": { "update": { "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"scale": "color", "field": "Origin"}, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"Miles_per_Gallon: \" + (format(datum[\"Miles_per_Gallon\"], \"\")) + \"; Origin: \" + (isValid(datum[\"Origin\"]) ? datum[\"Origin\"] : \"\"+datum[\"Origin\"])" }, "x": { "scale": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_x", "field": "Miles_per_Gallon" }, "y": { "scale": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_y", "field": "Miles_per_Gallon" } } } } ], "axes": [ { "scale": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_x", "orient": "bottom", "gridScale": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_y", "grid": true, "tickCount": {"signal": "ceil(childWidth/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_y", "orient": "left", "gridScale": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_x", "grid": true, "tickCount": {"signal": "ceil(childHeight/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_x", "orient": "bottom", "grid": false, "title": "Miles_per_Gallon", "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(childWidth/40)"}, "zindex": 0 }, { "scale": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_y", "orient": "left", "grid": false, "title": "Miles_per_Gallon", "labelOverlap": true, "tickCount": {"signal": "ceil(childHeight/40)"}, "zindex": 0 } ] } ], "scales": [ { "name": "color", "type": "ordinal", "domain": { "fields": [ {"data": "data_0", "field": "Origin"}, {"data": "data_1", "field": "Origin"}, {"data": "data_2", "field": "Origin"}, {"data": "data_3", "field": "Origin"} ], "sort": true }, "range": "category" }, { "name": "child__row_Displacementcolumn_Horsepower_x", "type": "linear", "domain": {"data": "data_0", "field": "Horsepower"}, "range": [0, {"signal": "childWidth"}], "nice": true, "zero": true }, { "name": "child__row_Displacementcolumn_Horsepower_y", "type": "linear", "domain": {"data": "data_0", "field": "Displacement"}, "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "child__row_Displacementcolumn_Miles_per_Gallon_x", "type": "linear", "domain": {"data": "data_1", "field": "Miles_per_Gallon"}, "range": [0, {"signal": "childWidth"}], "nice": true, "zero": true }, { "name": "child__row_Displacementcolumn_Miles_per_Gallon_y", "type": "linear", "domain": {"data": "data_1", "field": "Displacement"}, "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "child__row_Miles_per_Galloncolumn_Horsepower_x", "type": "linear", "domain": {"data": "data_2", "field": "Horsepower"}, "range": [0, {"signal": "childWidth"}], "nice": true, "zero": true }, { "name": "child__row_Miles_per_Galloncolumn_Horsepower_y", "type": "linear", "domain": {"data": "data_2", "field": "Miles_per_Gallon"}, "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true }, { "name": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_x", "type": "linear", "domain": {"data": "data_3", "field": "Miles_per_Gallon"}, "range": [0, {"signal": "childWidth"}], "nice": true, "zero": true }, { "name": "child__row_Miles_per_Galloncolumn_Miles_per_Gallon_y", "type": "linear", "domain": {"data": "data_3", "field": "Miles_per_Gallon"}, "range": [{"signal": "childHeight"}, 0], "nice": true, "zero": true } ], "legends": [ { "stroke": "color", "symbolType": "circle", "title": "Origin", "encode": { "symbols": { "update": { "fill": {"value": "transparent"}, "opacity": {"value": 0.7} } } } } ] }