Module

x/vega_lite/examples/compiled/isotype_bar_chart.vg.json

A concise grammar of interactive graphics, built on Vega.
Latest
File
{ "$schema": "https://vega.github.io/schema/vega/v5.json", "background": "white", "padding": 5, "data": [ { "name": "source_0", "values": [ {"country": "Great Britain", "animal": "cattle", "col": 3}, {"country": "Great Britain", "animal": "cattle", "col": 2}, {"country": "Great Britain", "animal": "cattle", "col": 1}, {"country": "Great Britain", "animal": "pigs", "col": 2}, {"country": "Great Britain", "animal": "pigs", "col": 1}, {"country": "Great Britain", "animal": "sheep", "col": 10}, {"country": "Great Britain", "animal": "sheep", "col": 9}, {"country": "Great Britain", "animal": "sheep", "col": 8}, {"country": "Great Britain", "animal": "sheep", "col": 7}, {"country": "Great Britain", "animal": "sheep", "col": 6}, {"country": "Great Britain", "animal": "sheep", "col": 5}, {"country": "Great Britain", "animal": "sheep", "col": 4}, {"country": "Great Britain", "animal": "sheep", "col": 3}, {"country": "Great Britain", "animal": "sheep", "col": 2}, {"country": "Great Britain", "animal": "sheep", "col": 1}, {"country": "United States", "animal": "cattle", "col": 9}, {"country": "United States", "animal": "cattle", "col": 8}, {"country": "United States", "animal": "cattle", "col": 7}, {"country": "United States", "animal": "cattle", "col": 6}, {"country": "United States", "animal": "cattle", "col": 5}, {"country": "United States", "animal": "cattle", "col": 4}, {"country": "United States", "animal": "cattle", "col": 3}, {"country": "United States", "animal": "cattle", "col": 2}, {"country": "United States", "animal": "cattle", "col": 1}, {"country": "United States", "animal": "pigs", "col": 6}, {"country": "United States", "animal": "pigs", "col": 5}, {"country": "United States", "animal": "pigs", "col": 4}, {"country": "United States", "animal": "pigs", "col": 3}, {"country": "United States", "animal": "pigs", "col": 2}, {"country": "United States", "animal": "pigs", "col": 1}, {"country": "United States", "animal": "sheep", "col": 7}, {"country": "United States", "animal": "sheep", "col": 6}, {"country": "United States", "animal": "sheep", "col": 5}, {"country": "United States", "animal": "sheep", "col": 4}, {"country": "United States", "animal": "sheep", "col": 3}, {"country": "United States", "animal": "sheep", "col": 2}, {"country": "United States", "animal": "sheep", "col": 1} ] }, { "name": "row_domain", "source": "source_0", "transform": [{"type": "aggregate", "groupby": ["country"]}] } ], "signals": [ {"name": "child_width", "value": 800}, {"name": "child_height", "value": 200} ], "layout": {"padding": 20, "columns": 1, "bounds": "full", "align": "all"}, "marks": [ { "name": "row_header", "type": "group", "role": "row-header", "from": {"data": "row_domain"}, "sort": {"field": "datum[\"country\"]", "order": "ascending"}, "title": { "text": { "signal": "isValid(parent[\"country\"]) ? parent[\"country\"] : \"\"+parent[\"country\"]" }, "orient": "left", "style": "guide-label", "frame": "group", "offset": 10 }, "encode": {"update": {"height": {"signal": "child_height"}}} }, { "name": "cell", "type": "group", "style": "cell", "from": { "facet": {"name": "facet", "data": "source_0", "groupby": ["country"]} }, "sort": {"field": ["datum[\"country\"]"], "order": ["ascending"]}, "encode": { "update": { "width": {"signal": "child_width"}, "height": {"signal": "child_height"} } }, "marks": [ { "name": "child_marks", "type": "symbol", "style": ["point"], "from": {"data": "facet"}, "encode": { "update": { "opacity": {"value": 1}, "fill": {"scale": "color", "field": "animal"}, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"col: \" + (isValid(datum[\"col\"]) ? datum[\"col\"] : \"\"+datum[\"col\"]) + \"; animal: \" + (isValid(datum[\"animal\"]) ? datum[\"animal\"] : \"\"+datum[\"animal\"])" }, "x": {"scale": "x", "field": "col"}, "y": {"scale": "y", "field": "animal"}, "size": {"value": 200}, "shape": {"scale": "shape", "field": "animal"} } } } ] } ], "scales": [ { "name": "x", "type": "point", "domain": {"data": "source_0", "field": "col", "sort": true}, "range": [0, {"signal": "child_width"}], "padding": 0.5 }, { "name": "y", "type": "point", "domain": {"data": "source_0", "field": "animal", "sort": true}, "range": [0, {"signal": "child_height"}], "padding": 0.5 }, { "name": "color", "type": "ordinal", "domain": ["person", "cattle", "pigs", "sheep"], "range": [ "rgb(162,160,152)", "rgb(194,81,64)", "rgb(93,93,93)", "rgb(91,131,149)" ] }, { "name": "shape",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