Module

x/vega_lite/examples/compiled/area_cumulative_freq.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, "width": 200, "height": 200, "style": "cell", "data": [ { "name": "source_0", "url": "data/movies.json", "format": {"type": "json", "parse": {"IMDB Rating": "number"}}, "transform": [ { "type": "window", "params": [null], "as": ["Cumulative Count"], "ops": ["count"], "fields": ["count"], "sort": {"field": ["IMDB Rating"], "order": ["ascending"]}, "frame": [null, 0] } ] } ], "marks": [ { "name": "marks", "type": "area", "style": ["area"], "sort": {"field": "datum[\"IMDB Rating\"]"}, "from": {"data": "source_0"}, "encode": { "update": { "orient": {"value": "vertical"}, "fill": {"value": "#4c78a8"}, "description": { "signal": "\"IMDB Rating: \" + (format(datum[\"IMDB Rating\"], \"\")) + \"; Cumulative Count: \" + (format(datum[\"Cumulative Count\"], \"\"))" }, "x": {"scale": "x", "field": "IMDB Rating"}, "y": {"scale": "y", "field": "Cumulative Count"}, "y2": {"scale": "y", "value": 0}, "defined": { "signal": "isValid(datum[\"IMDB Rating\"]) && isFinite(+datum[\"IMDB Rating\"]) && isValid(datum[\"Cumulative Count\"]) && isFinite(+datum[\"Cumulative Count\"])" } } } } ], "scales": [ { "name": "x", "type": "linear", "domain": {"data": "source_0", "field": "IMDB Rating"}, "range": [0, {"signal": "width"}], "nice": true, "zero": false }, { "name": "y", "type": "linear", "domain": {"data": "source_0", "field": "Cumulative Count"}, "range": [{"signal": "height"}, 0], "nice": true, "zero": true } ], "axes": [ { "scale": "x", "orient": "bottom", "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "y", "orient": "left", "gridScale": "x", "grid": true, "tickCount": {"signal": "ceil(height/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "x", "orient": "bottom", "grid": false, "title": "IMDB Rating", "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, "zindex": 0 }, { "scale": "y", "orient": "left", "grid": false, "title": "Cumulative Count", "labelOverlap": true, "tickCount": {"signal": "ceil(height/40)"}, "zindex": 0 } ]}