vegalite ({
"hconcat" : [{
"width": 400,"height": 400,
"data": {
"values": _.map (linkage_by_mutationOmicron)
},
"transform" : [
{"calculate" : "datum.OR>1?datum.OR:1/datum.OR", "as" : "OR2"}
],
"selection": {
"view": {"type": "interval", "bind": "scales"}
},
"mark": "circle",
"encoding": {
"y": {
"field": "SNP1",
"type": "nominal",
"scale" : {"domain" : sorterOmicron},
"axis" : {"labelFontSize" : 14, title : ""}
},
"x": {
"field": "SNP2",
"type": "nominal",
"scale" : {"domain" : sorterOmicron},
"axis" : {"labelFontSize" : 14, title : ""}
},
"size": {"field": "OR2","type": "quantitative", "legend" : {"orient" : "top", "title" : "OR"}},
"color": {"condition": {"test": "datum['OR'] < 1", "value": "steelblue"}, "value": "firebrick"}
}},
{
"width": 40,"height": 400,
"data": {
"values": _.map (linkage_by_mutationOmicron)
},
"selection": {
"view": {"type": "interval", "bind": "scales"}
},
"mark": "circle",
"encoding": {
"y": {
"field": "SNP1",
"type": "nominal",
"scale" : {"domain" : sorterOmicron},
"axis" : {"labelFontSize" : 0, title : ""}
},
"size": {"field": "f1","type": "quantitative", "title" : "Global Frequency", "legend" : {"orient" : "right"}, "scale" : {"type": "log"}},
"color": {"value": "black"}
}}
],
"resolve": {"scale": {"size": "independent"}}
})