-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'vega:main' into grip-handles
- Loading branch information
Showing
13 changed files
with
1,440 additions
and
5 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,122 changes: 1,122 additions & 0 deletions
1,122
examples/compiled/interactive_crossfilter.vg.json
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
{ | ||
"$schema": "https://vega.github.io/schema/vega/v5.json", | ||
"background": "white", | ||
"padding": 5, | ||
"width": 200, | ||
"height": 200, | ||
"style": "cell", | ||
"data": [ | ||
{ | ||
"name": "param_122_store", | ||
"transform": [{"type": "collect", "sort": {"field": "_vgsid_"}}] | ||
}, | ||
{ | ||
"name": "source_0", | ||
"url": "https://cdn.jsdelivr.net/npm/[email protected]/data/cars.json", | ||
"format": {"type": "json"}, | ||
"transform": [ | ||
{"type": "identifier", "as": "_vgsid_"}, | ||
{ | ||
"type": "filter", | ||
"expr": "isValid(datum[\"Horsepower\"]) && isFinite(+datum[\"Horsepower\"]) && isValid(datum[\"Miles_per_Gallon\"]) && isFinite(+datum[\"Miles_per_Gallon\"])" | ||
} | ||
] | ||
} | ||
], | ||
"signals": [ | ||
{ | ||
"name": "unit", | ||
"value": {}, | ||
"on": [ | ||
{"events": "pointermove", "update": "isTuple(group()) ? group() : unit"} | ||
] | ||
}, | ||
{ | ||
"name": "param_122", | ||
"update": "vlSelectionResolve(\"param_122_store\", \"union\", true, true)" | ||
}, | ||
{ | ||
"name": "param_122_tuple", | ||
"on": [ | ||
{ | ||
"events": [{"source": "scope", "type": "pointerover"}], | ||
"update": "datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0 ? {unit: \"\", _vgsid_: (item().isVoronoi ? datum.datum : datum)[\"_vgsid_\"]} : null", | ||
"force": true | ||
}, | ||
{"events": [{"source": "view", "type": "dblclick"}], "update": "null"} | ||
] | ||
}, | ||
{ | ||
"name": "param_122_toggle", | ||
"value": false, | ||
"on": [ | ||
{ | ||
"events": [{"source": "scope", "type": "pointerover"}], | ||
"update": "event.shiftKey" | ||
}, | ||
{"events": [{"source": "view", "type": "dblclick"}], "update": "false"} | ||
] | ||
}, | ||
{ | ||
"name": "param_122_modify", | ||
"on": [ | ||
{ | ||
"events": {"signal": "param_122_tuple"}, | ||
"update": "modify(\"param_122_store\", param_122_toggle ? null : param_122_tuple, param_122_toggle ? null : true, param_122_toggle ? param_122_tuple : null)" | ||
} | ||
] | ||
} | ||
], | ||
"marks": [ | ||
{ | ||
"name": "marks", | ||
"type": "symbol", | ||
"style": ["circle"], | ||
"interactive": true, | ||
"from": {"data": "source_0"}, | ||
"encode": { | ||
"update": { | ||
"opacity": {"value": 1}, | ||
"fill": [ | ||
{ | ||
"test": "length(data(\"param_122_store\")) && vlSelectionIdTest(\"param_122_store\", datum)", | ||
"value": "coral" | ||
}, | ||
{"value": "grey"} | ||
], | ||
"zindex": [ | ||
{ | ||
"test": "length(data(\"param_122_store\")) && vlSelectionIdTest(\"param_122_store\", datum)", | ||
"value": 1 | ||
}, | ||
{"value": 0} | ||
], | ||
"ariaRoleDescription": {"value": "circle"}, | ||
"description": { | ||
"signal": "\"Horsepower: \" + (format(datum[\"Horsepower\"], \"\")) + \"; Miles_per_Gallon: \" + (format(datum[\"Miles_per_Gallon\"], \"\"))" | ||
}, | ||
"x": {"scale": "x", "field": "Horsepower"}, | ||
"y": {"scale": "y", "field": "Miles_per_Gallon"}, | ||
"size": [ | ||
{ | ||
"test": "length(data(\"param_122_store\")) && vlSelectionIdTest(\"param_122_store\", datum)", | ||
"value": 400 | ||
}, | ||
{"value": 100} | ||
], | ||
"shape": {"value": "circle"} | ||
} | ||
} | ||
} | ||
], | ||
"scales": [ | ||
{ | ||
"name": "x", | ||
"type": "linear", | ||
"domain": {"data": "source_0", "field": "Horsepower"}, | ||
"range": [0, {"signal": "width"}], | ||
"nice": true, | ||
"zero": true | ||
}, | ||
{ | ||
"name": "y", | ||
"type": "linear", | ||
"domain": {"data": "source_0", "field": "Miles_per_Gallon"}, | ||
"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": "Horsepower", | ||
"labelFlush": true, | ||
"labelOverlap": true, | ||
"tickCount": {"signal": "ceil(width/40)"}, | ||
"zindex": 0 | ||
}, | ||
{ | ||
"scale": "y", | ||
"orient": "left", | ||
"grid": false, | ||
"title": "Miles_per_Gallon", | ||
"labelOverlap": true, | ||
"tickCount": {"signal": "ceil(height/40)"}, | ||
"zindex": 0 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | ||
"data": { | ||
"url": "data/flights-2k.json", | ||
"format": {"parse": {"date": "date"}} | ||
}, | ||
"transform": [{"calculate": "hours(datum.date)", "as": "time"}], | ||
"repeat": {"column": ["distance", "delay", "time"]}, | ||
"spec": { | ||
"layer": [{ | ||
"params": [{ | ||
"name": "brush", | ||
"select": {"type": "interval", "encodings": ["x"]} | ||
}], | ||
"transform": [{"filter": {"param": "brush"}}], | ||
"mark": "bar", | ||
"encoding": { | ||
"x": { | ||
"field": {"repeat": "column"}, | ||
"bin": {"maxbins": 20} | ||
}, | ||
"y": {"aggregate": "count", "axis": null} | ||
} | ||
}] | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
examples/specs/normalized/interactive_crossfilter_normalized.vl.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"data": { | ||
"url": "data/flights-2k.json", | ||
"format": {"parse": {"date": "date"}} | ||
}, | ||
"align": "all", | ||
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | ||
"transform": [{"calculate": "hours(datum.date)", "as": "time"}], | ||
"columns": 3, | ||
"concat": [ | ||
{ | ||
"layer": [ | ||
{ | ||
"params": [ | ||
{ | ||
"name": "brush", | ||
"select": {"type": "interval", "encodings": ["x"]} | ||
} | ||
], | ||
"mark": "bar", | ||
"encoding": { | ||
"x": {"field": "distance", "bin": {"maxbins": 20}}, | ||
"y": {"aggregate": "count", "axis": null} | ||
}, | ||
"transform": [{"filter": {"param": "brush"}}] | ||
} | ||
], | ||
"name": "child__column_distance" | ||
}, | ||
{ | ||
"layer": [ | ||
{ | ||
"params": [ | ||
{ | ||
"name": "brush", | ||
"select": {"type": "interval", "encodings": ["x"]} | ||
} | ||
], | ||
"mark": "bar", | ||
"encoding": { | ||
"x": {"field": "delay", "bin": {"maxbins": 20}}, | ||
"y": {"aggregate": "count", "axis": null} | ||
}, | ||
"transform": [{"filter": {"param": "brush"}}] | ||
} | ||
], | ||
"name": "child__column_delay" | ||
}, | ||
{ | ||
"layer": [ | ||
{ | ||
"params": [ | ||
{ | ||
"name": "brush", | ||
"select": {"type": "interval", "encodings": ["x"]} | ||
} | ||
], | ||
"mark": "bar", | ||
"encoding": { | ||
"x": {"field": "time", "bin": {"maxbins": 20}}, | ||
"y": {"aggregate": "count", "axis": null} | ||
}, | ||
"transform": [{"filter": {"param": "brush"}}] | ||
} | ||
], | ||
"name": "child__column_time" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | ||
"data": { | ||
"url": "https://cdn.jsdelivr.net/npm/[email protected]/data/cars.json" | ||
}, | ||
"mark": {"type": "circle", "opacity": 1}, | ||
"encoding": { | ||
"color": { | ||
"condition": {"param": "param_122", "value": "coral", "empty": false}, | ||
"value": "grey" | ||
}, | ||
"order": { | ||
"condition": {"param": "param_122", "value": 1, "empty": false}, | ||
"value": 0 | ||
}, | ||
"size": { | ||
"condition": {"param": "param_122", "value": 400, "empty": false}, | ||
"value": 100 | ||
}, | ||
"x": {"field": "Horsepower", "type": "quantitative"}, | ||
"y": {"field": "Miles_per_Gallon", "type": "quantitative"} | ||
}, | ||
"params": [ | ||
{"name": "param_122", "select": {"type": "point", "on": "pointerover"}} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters