{ "$schema": "https://vega.github.io/schema/vega/v5.json", "background": "white", "padding": 5, "width": 300, "data": [ { "name": "source_0", "values": [ { "mean_price": 166, "replicate": 0 }, { "mean_price": 169, "replicate": 1 } ], "format": { "type": "json" }, "transform": [ { "type": "extent", "field": "mean_price", "signal": "concat_0_bin_maxbins_20_mean_price_extent" }, { "type": "bin", "field": "mean_price", "as": [ "bin_maxbins_20_mean_price", "bin_maxbins_20_mean_price_end" ], "signal": "concat_0_bin_maxbins_20_mean_price_bins", "extent": { "signal": "concat_0_bin_maxbins_20_mean_price_extent" }, "maxbins": 20 }, { "type": "aggregate", "groupby": [ "bin_maxbins_20_mean_price", "bin_maxbins_20_mean_price_end" ], "ops": [ "count" ], "fields": [ null ], "as": [ "__count" ] }, { "type": "filter", "expr": "isValid(datum[\"bin_maxbins_20_mean_price\"]) && isFinite(+datum[\"bin_maxbins_20_mean_price\"])" } ] }, { "name": "source_1", "values": [ { "mean_price": 166, "replicate": 0 }, { "mean_price": 169, "replicate": 1 } ], "format": { "type": "json" }, "transform": [ { "type": "extent", "field": "mean_price", "signal": "concat_1_layer_0_bin_maxbins_20_mean_price_extent" }, { "type": "bin", "field": "mean_price", "as": [ "bin_maxbins_20_mean_price", "bin_maxbins_20_mean_price_end" ], "signal": "concat_1_layer_0_bin_maxbins_20_mean_price_bins", "extent": { "signal": "concat_1_layer_0_bin_maxbins_20_mean_price_extent" }, "maxbins": 20 }, { "type": "aggregate", "groupby": [ "bin_maxbins_20_mean_price", "bin_maxbins_20_mean_price_end" ], "ops": [ "count" ], "fields": [ null ], "as": [ "__count" ] }, { "type": "filter", "expr": "isValid(datum[\"bin_maxbins_20_mean_price\"]) && isFinite(+datum[\"bin_maxbins_20_mean_price\"])" } ] }, { "name": "source_2", "values": [ { "mean_price": 166, "replicate": 0 }, { "mean_price": 169, "replicate": 1 } ], "format": { "type": "json" }, "transform": [ { "type": "filter", "expr": "isValid(datum[\"mean_price\"]) && isFinite(+datum[\"mean_price\"])" } ] } ], "signals": [ { "name": "childHeight", "value": 300 } ], "layout": { "padding": 20, "columns": 1, "bounds": "full", "align": "each" }, "marks": [ { "type": "group", "name": "concat_0_group", "style": "cell", "encode": { "update": { "width": { "signal": "width" }, "height": { "signal": "childHeight" } } }, "marks": [ { "name": "concat_0_marks", "type": "rect", "style": [ "bar" ], "from": { "data": "source_0" }, "encode": { "update": { "fill": { "value": "#4c78a8" }, "ariaRoleDescription": { "value": "bar" }, "description": { "signal": "\"mean_price (binned): \" + (!isValid(datum[\"bin_maxbins_20_mean_price\"]) || !isFinite(+datum[\"bin_maxbins_20_mean_price\"]) ? \"null\" : format(datum[\"bin_maxbins_20_mean_price\"], \"\") + \" \u2013 \" + format(datum[\"bin_maxbins_20_mean_price_end\"], \"\")) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))" }, "x2": { "scale": "x", "field": "bin_maxbins_20_mean_price", "offset": { "signal": "0.5 + (abs(scale(\"x\", datum[\"bin_maxbins_20_mean_price_end\"]) - scale(\"x\", datum[\"bin_maxbins_20_mean_price\"])) < 0.25 ? -0.5 * (0.25 - (abs(scale(\"x\", datum[\"bin_maxbins_20_mean_price_end\"]) - scale(\"x\", datum[\"bin_maxbins_20_mean_price\"])))) : 0.5)" } }, "x": { "scale": "x", "field": "bin_maxbins_20_mean_price_end", "offset": { "signal": "0.5 + (abs(scale(\"x\", datum[\"bin_maxbins_20_mean_price_end\"]) - scale(\"x\", datum[\"bin_maxbins_20_mean_price\"])) < 0.25 ? 0.5 * (0.25 - (abs(scale(\"x\", datum[\"bin_maxbins_20_mean_price_end\"]) - scale(\"x\", datum[\"bin_maxbins_20_mean_price\"])))) : -0.5)" } }, "y": { "scale": "concat_0_y", "field": "__count" }, "y2": { "scale": "concat_0_y", "value": 0 } } } } ], "axes": [ { "scale": "concat_0_y", "orient": "left", "gridScale": "x", "grid": true, "tickCount": { "signal": "ceil(childHeight/40)" }, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "x", "orient": "bottom", "grid": false, "title": "mean_price (binned)", "labelFlush": true, "labelOverlap": true, "tickCount": { "signal": "ceil(width/10)" }, "zindex": 0 }, { "scale": "concat_0_y", "orient": "left", "grid": false, "title": "Count of Records", "labelOverlap": true, "tickCount": { "signal": "ceil(childHeight/40)" }, "zindex": 0 } ] }, { "type": "group", "name": "concat_1_group", "style": "cell", "encode": { "update": { "width": { "signal": "width" }, "height": { "signal": "childHeight" } } }, "marks": [ { "name": "concat_1_layer_0_marks", "type": "rect", "style": [ "bar" ], "from": { "data": "source_1" }, "encode": { "update": { "fill": { "value": "#4c78a8" }, "ariaRoleDescription": { "value": "bar" }, "description": { "signal": "\"mean_price (binned): \" + (!isValid(datum[\"bin_maxbins_20_mean_price\"]) || !isFinite(+datum[\"bin_maxbins_20_mean_price\"]) ? \"null\" : format(datum[\"bin_maxbins_20_mean_price\"], \"\") + \" \u2013 \" + format(datum[\"bin_maxbins_20_mean_price_end\"], \"\")) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))" }, "x2": { "scale": "x", "field": "bin_maxbins_20_mean_price", "offset": { "signal": "0.5 + (abs(scale(\"x\", datum[\"bin_maxbins_20_mean_price_end\"]) - scale(\"x\", datum[\"bin_maxbins_20_mean_price\"])) < 0.25 ? -0.5 * (0.25 - (abs(scale(\"x\", datum[\"bin_maxbins_20_mean_price_end\"]) - scale(\"x\", datum[\"bin_maxbins_20_mean_price\"])))) : 0.5)" } }, "x": { "scale": "x", "field": "bin_maxbins_20_mean_price_end", "offset": { "signal": "0.5 + (abs(scale(\"x\", datum[\"bin_maxbins_20_mean_price_end\"]) - scale(\"x\", datum[\"bin_maxbins_20_mean_price\"])) < 0.25 ? 0.5 * (0.25 - (abs(scale(\"x\", datum[\"bin_maxbins_20_mean_price_end\"]) - scale(\"x\", datum[\"bin_maxbins_20_mean_price\"])))) : -0.5)" } }, "y": { "scale": "concat_1_y", "field": "__count" }, "y2": { "scale": "concat_1_y", "value": 0 } } } }, { "name": "concat_1_layer_1_marks", "type": "rule", "style": [ "rule" ], "from": { "data": "source_2" }, "encode": { "update": { "stroke": { "value": "black" }, "description": { "signal": "\"mean_price: \" + (format(datum[\"mean_price\"], \"\"))" }, "x": { "scale": "x", "field": "mean_price" }, "y": { "value": 0 }, "y2": { "field": { "group": "height" } } } } } ], "axes": [ { "scale": "concat_1_y", "orient": "left", "gridScale": "x", "grid": true, "tickCount": { "signal": "ceil(childHeight/40)" }, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "x", "orient": "bottom", "grid": false, "title": "mean_price (binned), mean_price", "labelFlush": true, "labelOverlap": true, "tickCount": { "signal": "ceil(width/10)" }, "zindex": 0 }, { "scale": "concat_1_y", "orient": "left", "grid": false, "title": "Count of Records", "labelOverlap": true, "tickCount": { "signal": "ceil(childHeight/40)" }, "zindex": 0 } ] } ], "scales": [ { "name": "x", "type": "linear", "domain": { "fields": [ { "signal": "[concat_0_bin_maxbins_20_mean_price_bins.start, concat_0_bin_maxbins_20_mean_price_bins.stop]" }, { "signal": "[concat_1_layer_0_bin_maxbins_20_mean_price_bins.start, concat_1_layer_0_bin_maxbins_20_mean_price_bins.stop]" }, { "data": "source_2", "field": "mean_price" } ] }, "range": [ 0, { "signal": "width" } ], "bins": { "signal": "concat_0_bin_maxbins_20_mean_price_bins" }, "nice": true, "zero": false }, { "name": "concat_0_y", "type": "linear", "domain": { "data": "source_0", "field": "__count" }, "range": [ { "signal": "childHeight" }, 0 ], "nice": true, "zero": true }, { "name": "concat_1_y", "type": "linear", "domain": { "data": "source_1", "field": "__count" }, "range": [ { "signal": "childHeight" }, 0 ], "nice": true, "zero": true } ] }