{ "$schema": "https://vega.github.io/schema/vega/v5.json", "background": "white", "padding": 5, "width": 600, "height": 200, "style": "cell", "data": [ { "name": "point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_store", "transform": [{"type": "collect", "sort": {"field": "_vgsid_"}}] }, { "name": "movies", "url": "https://raw.githubusercontent.com/vega/vega-datasets/next/data/movies.json", "format": {"type": "json", "parse": {"Release Date": "date"}}, "transform": [ {"type": "identifier", "as": "_vgsid_"}, { "field": "Release Date", "type": "timeunit", "units": ["year", "month"], "as": ["yearmonth_Release Date", "yearmonth_Release Date_end"] }, { "type": "filter", "expr": "isValid(datum[\"US Gross\"]) && isFinite(+datum[\"US Gross\"])" } ] } ], "signals": [ { "name": "unit", "value": {}, "on": [ {"events": "mousemove", "update": "isTuple(group()) ? group() : unit"} ] }, { "name": "point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606", "update": "vlSelectionResolve(\"point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_store\", \"union\", true, true)" }, { "name": "point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_tuple", "on": [ { "events": [{"source": "scope", "type": "mouseover"}], "update": "datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0 ? {unit: \"layer_0_layer_1\", _vgsid_: (item().isVoronoi ? datum.datum : datum)[\"_vgsid_\"]} : null", "force": true }, {"events": [{"source": "view", "type": "dblclick"}], "update": "null"} ] }, { "name": "point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_toggle", "value": false, "on": [ { "events": [{"source": "scope", "type": "mouseover"}], "update": "event.shiftKey" }, {"events": [{"source": "view", "type": "dblclick"}], "update": "false"} ] }, { "name": "point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_modify", "on": [ { "events": { "signal": "point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_tuple" }, "update": "modify(\"point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_store\", point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_toggle ? null : point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_tuple, point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_toggle ? null : true, point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_toggle ? point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_tuple : null)" } ] } ], "marks": [ { "name": "layer_0_layer_0_marks", "type": "symbol", "clip": true, "style": ["point"], "interactive": false, "from": {"data": "movies"}, "encode": { "update": { "opacity": {"value": 1}, "fill": {"value": "#4c78a8"}, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"Release Date (year-month): \" + (timeFormat(datum[\"yearmonth_Release Date\"], timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; US Gross: \" + (format(datum[\"US Gross\"], \"\"))" }, "x": {"scale": "x", "field": "yearmonth_Release Date"}, "y": {"scale": "y", "field": "US Gross"} } } }, { "name": "layer_0_layer_1_marks", "type": "symbol", "clip": true, "style": ["point"], "interactive": true, "from": {"data": "movies"}, "encode": { "update": { "opacity": [ { "test": "length(data(\"point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_store\")) && vlSelectionIdTest(\"point_hover_d28fecf5_2bde_4843_8a5d_16847fc9e606_store\", datum)", "value": 1 }, {"value": 0} ], "fill": {"value": "#4c78a8"}, "tooltip": { "signal": "{\"Release Date (year-month)\": timeFormat(datum[\"yearmonth_Release Date\"], timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})), \"US Gross\": format(datum[\"US Gross\"], \"\")}" }, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"Release Date (year-month): \" + (timeFormat(datum[\"yearmonth_Release Date\"], timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; US Gross: \" + (format(datum[\"US Gross\"], \"\"))" }, "x": {"scale": "x", "field": "yearmonth_Release Date"}, "y": {"scale": "y", "field": "US Gross"}, "size": {"value": 100} } } } ], "scales": [ { "name": "x", "type": "point", "domain": { "data": "movies", "field": "yearmonth_Release Date", "sort": true }, "range": [0, {"signal": "width"}], "padding": 0.5 }, { "name": "y", "type": "linear", "domain": {"data": "movies", "field": "US Gross"}, "range": [{"signal": "height"}, 0], "nice": true, "zero": true } ], "axes": [ { "scale": "x", "orient": "bottom", "grid": true, "gridScale": "y", "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "y", "orient": "left", "grid": true, "gridScale": "x", "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": "Release Date (year-month)", "labels": true, "ticks": true, "format": { "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" }, "formatType": "time", "labelOverlap": true, "zindex": 0 }, { "scale": "y", "orient": "left", "grid": false, "title": "US Gross", "labels": true, "ticks": true, "labelOverlap": true, "tickCount": {"signal": "ceil(height/40)"}, "zindex": 0 } ], "config": { "range": {"ramp": {"scheme": "yellowgreenblue"}}, "axis": {"domain": false}, "legend": {"orient": "right"} }, "usermeta": {"selectionConfigs": {}} }