{ "$schema": "https://vega.github.io/schema/vega/v5.json", "background": "white", "padding": 5, "width": 20, "height": 200, "style": "cell", "data": [ { "name": "source_0", "url": "data/barley.json", "format": {"type": "json"}, "transform": [ { "type": "aggregate", "groupby": [], "ops": ["mean", "mean", "stderr"], "fields": ["yield", "yield", "yield"], "as": ["mean_yield", "center_yield", "extent_yield"] } ] }, { "name": "data_0", "source": "source_0", "transform": [ { "type": "filter", "expr": "isValid(datum[\"mean_yield\"]) && isFinite(+datum[\"mean_yield\"])" } ] }, { "name": "data_1", "source": "source_0", "transform": [ { "type": "formula", "expr": "datum[\"center_yield\"] + datum[\"extent_yield\"]", "as": "upper_yield" }, { "type": "formula", "expr": "datum[\"center_yield\"] - datum[\"extent_yield\"]", "as": "lower_yield" }, { "type": "filter", "expr": "isValid(datum[\"lower_yield\"]) && isFinite(+datum[\"lower_yield\"])" } ] } ], "marks": [ { "name": "layer_0_marks", "type": "rule", "style": ["rule", "errorbar-rule"], "from": {"data": "data_1"}, "encode": { "update": { "ariaRoleDescription": {"value": "errorbar"}, "stroke": {"value": "black"}, "tooltip": { "signal": "{\"Mean of yield\": format(datum[\"center_yield\"], \"\"), \"Mean + stderr of yield\": format(datum[\"upper_yield\"], \"\"), \"Mean - stderr of yield\": format(datum[\"lower_yield\"], \"\")}" }, "description": { "signal": "\"yield: \" + (format(datum[\"lower_yield\"], \"\")) + \"; upper_yield: \" + (format(datum[\"upper_yield\"], \"\")) + \"; Mean of yield: \" + (format(datum[\"center_yield\"], \"\")) + \"; Mean + stderr of yield: \" + (format(datum[\"upper_yield\"], \"\")) + \"; Mean - stderr of yield: \" + (format(datum[\"lower_yield\"], \"\"))" }, "x": {"signal": "width", "mult": 0.5}, "y": {"scale": "y", "field": "lower_yield"}, "y2": {"scale": "y", "field": "upper_yield"} } } }, { "name": "layer_1_marks", "type": "symbol", "style": ["point"], "from": {"data": "data_0"}, "encode": { "update": { "fill": {"value": "black"}, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"Mean of yield: \" + (format(datum[\"mean_yield\"], \"\"))" }, "x": {"signal": "width", "mult": 0.5}, "y": {"scale": "y", "field": "mean_yield"} } } } ], "scales": [ { "name": "y", "type": "linear", "domain": { "fields": [ {"data": "data_1", "field": "lower_yield"}, {"data": "data_1", "field": "upper_yield"}, {"data": "data_0", "field": "mean_yield"} ] }, "range": [{"signal": "height"}, 0], "zero": false, "nice": true } ], "axes": [ { "scale": "y", "orient": "left", "grid": true, "tickCount": {"signal": "ceil(height/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "y", "orient": "left", "grid": false, "title": "yield", "labelOverlap": true, "tickCount": {"signal": "ceil(height/40)"}, "zindex": 0 } ] }