{ "$schema": "https://vega.github.io/schema/vega/v5.json", "background": "white", "padding": 5, "width": 200, "data": [ { "name": "source_0", "values": [ { "measure": "Open Exploration", "mean": 1.813, "lo": 1.255, "hi": 2.37, "study": "PoleStar vs Voyager" }, { "measure": "Focused Question Answering", "mean": -1.688, "lo": -2.325, "hi": -1.05, "study": "PoleStar vs Voyager" }, { "measure": "Open Exploration", "mean": 2.1875, "lo": 1.665, "hi": 2.71, "study": "PoleStar vs Voyager 2" }, { "measure": "Focused Question Answering", "mean": -0.0625, "lo": -0.474, "hi": 0.349, "study": "PoleStar vs Voyager 2" } ] }, { "name": "source_1", "values": [ {"from": -0.25, "to": -2.9, "label": "PoleStar"}, {"from": 0.25, "to": 2.9, "label": "Voyager / Voyager 2"} ] }, { "name": "data_1", "source": "source_0", "transform": [ { "type": "filter", "expr": "isValid(datum[\"lo\"]) && isFinite(+datum[\"lo\"])" } ] }, { "name": "data_2", "source": "source_0", "transform": [ { "type": "filter", "expr": "isValid(datum[\"mean\"]) && isFinite(+datum[\"mean\"])" } ] }, { "name": "data_4", "source": "source_1", "transform": [ { "type": "filter", "expr": "isValid(datum[\"from\"]) && isFinite(+datum[\"from\"])" } ] }, { "name": "data_5", "source": "source_1", "transform": [ { "type": "filter", "expr": "isValid(datum[\"to\"]) && isFinite(+datum[\"to\"])" } ] }, { "name": "data_6", "source": "source_1", "transform": [ {"type": "filter", "expr": "datum.label === 'PoleStar'"}, { "type": "filter", "expr": "isValid(datum[\"from\"]) && isFinite(+datum[\"from\"])" } ] }, { "name": "data_7", "source": "source_1", "transform": [ {"type": "filter", "expr": "datum.label !== 'PoleStar'"}, { "type": "filter", "expr": "isValid(datum[\"from\"]) && isFinite(+datum[\"from\"])" } ] } ], "signals": [ {"name": "concat_0_y_step", "value": 20}, { "name": "concat_0_height", "update": "bandspace(domain('concat_0_y').length, 0, 0) * concat_0_y_step" }, {"name": "concat_1_height", "value": 20} ], "layout": {"padding": 10, "columns": 1, "bounds": "full", "align": "each"}, "marks": [ { "type": "group", "name": "concat_0_group", "title": {"text": "Mean of Subject Ratings (95% CIs)", "frame": "bounds"}, "style": "cell", "encode": { "update": { "width": {"signal": "width"}, "height": {"signal": "concat_0_height"} } }, "marks": [ { "name": "concat_0_layer_0_marks", "type": "rule", "style": ["rule"], "from": {"data": "data_1"}, "encode": { "update": { "stroke": {"value": "black"}, "description": { "signal": "\"lo: \" + (format(datum[\"lo\"], \"\")) + \"; study: \" + (isValid(datum[\"study\"]) ? datum[\"study\"] : \"\"+datum[\"study\"]) + \"; hi: \" + (format(datum[\"hi\"], \"\"))" }, "x": {"scale": "concat_0_x", "field": "lo"}, "x2": {"scale": "concat_0_x", "field": "hi"}, "y": {"scale": "concat_0_y", "field": "study", "band": 0.5} } } }, { "name": "concat_0_layer_1_marks", "type": "symbol", "style": ["circle"], "from": {"data": "data_2"}, "encode": { "update": { "opacity": {"value": 1}, "stroke": {"value": "black"}, "fill": {"scale": "color", "field": "measure"}, "ariaRoleDescription": {"value": "circle"}, "description": { "signal": "\"mean: \" + (format(datum[\"mean\"], \"\")) + \"; study: \" + (isValid(datum[\"study\"]) ? datum[\"study\"] : \"\"+datum[\"study\"]) + \"; measure: \" + (isValid(datum[\"measure\"]) ? datum[\"measure\"] : \"\"+datum[\"measure\"])" }, "x": {"scale": "concat_0_x", "field": "mean"}, "y": {"scale": "concat_0_y", "field": "study", "band": 0.5}, "shape": {"value": "circle"} } } } ], "axes": [ { "scale": "concat_0_x", "orient": "bottom", "gridDash": [3, 3], "gridScale": "concat_0_y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, "encode": { "grid": { "update": { "stroke": [ {"test": "datum.value === 0", "value": "#666"}, {"value": "#CCC"} ] } } }, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "concat_0_x", "orient": "bottom", "grid": false, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, "zindex": 0 }, { "scale": "concat_0_y", "orient": "left", "grid": false, "domain": false, "labelPadding": 5, "ticks": false, "zindex": 0 } ] }, { "type": "group", "name": "concat_1_group", "style": "cell", "encode": { "update": { "width": {"signal": "width"}, "height": {"signal": "concat_1_height"} } }, "marks": [ { "name": "concat_1_layer_0_marks", "type": "rule", "style": ["rule"], "from": {"data": "data_4"}, "encode": { "update": { "stroke": {"value": "black"}, "description": { "signal": "\"from: \" + (format(datum[\"from\"], \"\")) + \"; to: \" + (format(datum[\"to\"], \"\"))" }, "x": {"scale": "concat_1_x", "field": "from"}, "x2": {"scale": "concat_1_x", "field": "to"}, "y": {"signal": "concat_1_height", "mult": 0.5} } } }, { "name": "concat_1_layer_1_marks", "type": "symbol", "style": ["point"], "from": {"data": "data_5"}, "encode": { "update": { "opacity": {"value": 0.7}, "fill": {"value": "black"}, "size": {"value": 60}, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"to: \" + (format(datum[\"to\"], \"\"))" }, "x": {"scale": "concat_1_x", "field": "to"}, "y": {"signal": "concat_1_height", "mult": 0.5}, "shape": [ {"test": "datum.to > 0", "value": "triangle-right"}, {"value": "triangle-left"} ] } } }, { "name": "concat_1_layer_2_marks", "type": "text", "style": ["text", "arrow-label"], "from": {"data": "data_6"}, "encode": { "update": { "align": {"value": "right"}, "text": {"value": ["Polestar", "More Valuable"]}, "fill": {"value": "black"}, "description": { "signal": "\"from: \" + (format(datum[\"from\"], \"\"))" }, "x": {"scale": "concat_1_x", "field": "from"}, "y": {"signal": "concat_1_height", "mult": 0.5}, "baseline": {"value": "middle"} } } }, { "name": "concat_1_layer_3_marks", "type": "text", "style": ["text", "arrow-label"], "from": {"data": "data_7"}, "encode": { "update": { "align": {"value": "left"}, "text": {"value": ["Voyager / Voyager 2", "More Valuable"]}, "fill": {"value": "black"}, "description": { "signal": "\"from: \" + (format(datum[\"from\"], \"\"))" }, "x": {"scale": "concat_1_x", "field": "from"}, "y": {"signal": "concat_1_height", "mult": 0.5}, "baseline": {"value": "middle"} } } } ] } ], "scales": [ { "name": "color", "type": "ordinal", "domain": {"data": "data_2", "field": "measure", "sort": true}, "range": ["black", "white"] }, { "name": "concat_0_x", "type": "linear", "domain": [-3, 3], "range": [0, {"signal": "width"}], "zero": true }, { "name": "concat_0_y", "type": "band", "domain": { "fields": [ {"data": "data_1", "field": "study"}, {"data": "data_2", "field": "study"} ], "sort": true }, "range": {"step": {"signal": "concat_0_y_step"}}, "paddingInner": 0, "paddingOuter": 0 }, { "name": "concat_1_x", "type": "linear", "domain": { "fields": [ {"data": "data_4", "field": "from"}, {"data": "data_4", "field": "to"}, {"data": "data_5", "field": "to"}, {"data": "data_6", "field": "from"}, {"data": "data_7", "field": "from"} ] }, "range": [0, {"signal": "width"}], "zero": false, "nice": true } ], "config": { "style": { "arrow-label": {"dy": 12, "fontSize": 9.5}, "arrow-label2": {"dy": 24, "fontSize": 9.5}, "cell": {"stroke": "transparent"}, "group-title": {"fontSize": 12} } } }