From ec37f79d1da92263c9900f2169e19d5a8dff54a2 Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Tue, 17 Oct 2023 10:50:45 -0700 Subject: [PATCH] docs(examples): split crossfilter example into filter/highlight --- .../specs/interactive_crossfilter.vl.json | 26 +++++++++++++++++++ site/_data/examples.json | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 examples/specs/interactive_crossfilter.vl.json diff --git a/examples/specs/interactive_crossfilter.vl.json b/examples/specs/interactive_crossfilter.vl.json new file mode 100644 index 0000000000..dd6f563ea6 --- /dev/null +++ b/examples/specs/interactive_crossfilter.vl.json @@ -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} + } + }] + } +} diff --git a/site/_data/examples.json b/site/_data/examples.json index a1fab1f006..d914990101 100644 --- a/site/_data/examples.json +++ b/site/_data/examples.json @@ -911,9 +911,13 @@ "name": "interactive_overview_detail", "title": "Overview and Detail" }, + { + "name": "interactive_crossfilter", + "title": "Crossfilter (Filter)" + }, { "name": "interactive_layered_crossfilter", - "title": "Crossfilter" + "title": "Crossfilter (Highlight)" }, { "name": "interactive_splom",