{ "$schema": "https://vega.github.io/schema/vega/v5.json", "background": "white", "padding": 5, "height": 20, "style": "cell", "data": [ { "name": "source_0", "values": [ {"a": "C", "b": 2}, {"a": "C", "b": 7}, {"a": "C", "b": 4}, {"a": "D", "b": 1}, {"a": "D", "b": 2}, {"a": "D", "b": 6}, {"a": "E", "b": 8}, {"a": "E", "b": 4}, {"a": "E", "b": 7} ] } ], "signals": [ {"name": "x_step", "value": 20}, { "name": "width", "update": "bandspace(domain('x').length, 1, 0.5) * x_step" } ], "marks": [ { "name": "marks", "type": "symbol", "style": ["point"], "from": {"data": "source_0"}, "encode": { "update": { "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"value": "#4c78a8"}, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"a: \" + (isValid(datum[\"a\"]) ? datum[\"a\"] : \"\"+datum[\"a\"])" }, "x": {"scale": "x", "field": "a"}, "y": {"signal": "height", "mult": 0.5} } } } ], "scales": [ { "name": "x", "type": "point", "domain": {"data": "source_0", "field": "a", "sort": true}, "range": {"step": {"signal": "x_step"}}, "padding": 0.5 } ], "axes": [ { "scale": "x", "orient": "bottom", "grid": false, "title": "a", "labelAlign": "right", "labelAngle": 270, "labelBaseline": "middle", "zindex": 0 } ] }