Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for clearing selection #4720

Merged
merged 41 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7989028
added clear transform to files
Mar 11, 2019
958360c
added test suite and modified clear to not occur on default - must fl…
Mar 13, 2019
5821af8
adding single type support
Mar 15, 2019
ef5f6b8
adding test cases for single + interval clearing
Mar 15, 2019
dd06819
[Travis] Update examples (build: 22361)
Mar 15, 2019
de29ed0
Clear transform default doubleclick clears selected data and brush, w…
Mar 21, 2019
0c3d122
adding test cases for clear.ts and updating other test files to turn …
Mar 21, 2019
1505a1e
added clear transform to files
Mar 11, 2019
7249a10
added test suite and modified clear to not occur on default - must fl…
Mar 13, 2019
3cba482
adding single type support
Mar 15, 2019
d49d694
adding test cases for single + interval clearing
Mar 15, 2019
20eba3f
[Travis] Update examples (build: 22361)
Mar 15, 2019
cd6362a
Clear transform default doubleclick clears selected data and brush, w…
Mar 21, 2019
94027a9
adding test cases for clear.ts and updating other test files to turn …
Mar 21, 2019
f1f08d7
Merge branch 'ajl/clear' of https://github.com/vega/vega-lite into aj…
Mar 21, 2019
cb15c08
[Travis] Update schema (build: 22402)
Mar 21, 2019
2e8b2b5
[Travis] Update examples (build: 22402)
Mar 21, 2019
c9ab937
migrated clear to conditional config, and interval type clear now onl…
Apr 2, 2019
70b4ea3
Merge branch 'ajl/clear' of https://github.com/vega/vega-lite into aj…
Apr 2, 2019
e6335a1
adding clear transform documentation
Apr 2, 2019
d505802
Merge branch 'master' into ajl/clear
Apr 2, 2019
30857fe
[Travis] Update schema (build: 22802)
Apr 2, 2019
2ea1ead
[Travis] Update examples (build: 22802)
Apr 2, 2019
73777ca
simplified code a little
Apr 3, 2019
97ae4e3
Merge branch 'ajl/clear' of https://github.com/vega/vega-lite into aj…
Apr 3, 2019
ae4f8ae
clearing selection and panning/zooming, also updated docs and tests
Apr 3, 2019
3cdba25
[Travis] Update examples (build: 22820)
Apr 3, 2019
f0804b2
significantly refactored clear code
Apr 5, 2019
77aa146
Merge branch 'ajl/clear' of https://github.com/vega/vega-lite into aj…
Apr 5, 2019
d105409
updating TSDocs and Vega-lite docs
Apr 5, 2019
937aa9f
[Travis] Update examples (build: 22858)
Apr 5, 2019
1a3ec0c
Minor fixes to clear logic/style to minimize signal additions.
arvind Apr 5, 2019
053f24b
Append clear to top-level signals to account for input bindings.
arvind Apr 5, 2019
519a2b6
Refine documentation on selection clearing.
arvind Apr 5, 2019
6b81dd2
Selection clearing should account for toggling.
arvind Apr 5, 2019
b99ef92
[Travis] Update schema (build: 22868)
Apr 5, 2019
f6e9a88
[Travis] Update examples (build: 22868)
Apr 5, 2019
9455fb8
Fix backticks
kanitw Apr 6, 2019
e51e6ce
Rename `selection_clear_heatmap` to `selection_heatmap` as it doesn't…
kanitw Apr 6, 2019
165d8ca
Refactor selection_heatmap example + add it to the gallery
kanitw Apr 6, 2019
dd9d82e
[Travis] Update examples (build: 22876)
Apr 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions build/vega-lite-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6463,6 +6463,17 @@
],
"type": "string"
},
"clear": {
"anyOf": [
{
"$ref": "#/definitions/EventStream"
},
{
"type": "boolean"
}
],
"description": "Controls clearing selections. Can be `true`, `false`, or an [EventStream](https://vega.github.io/vega/docs/event-streams/).\n\n__Default value:__ `true`, which corresponds to `dblclick` (i.e.\nuser doubleclick clears current selection).\n\nSee the [TODO: clear] documentation for more information."
},
"empty": {
"description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.",
"enum": [
Expand Down Expand Up @@ -6537,6 +6548,17 @@
],
"type": "string"
},
"clear": {
"anyOf": [
{
"$ref": "#/definitions/EventStream"
},
{
"type": "boolean"
}
],
"description": "Controls clearing selections. Can be `true`, `false`, or an [EventStream](https://vega.github.io/vega/docs/event-streams/).\n\n__Default value:__ `true`, which corresponds to `dblclick` (i.e.\nuser doubleclick clears current selection).\n\nSee the [TODO: clear] documentation for more information."
},
"empty": {
"description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.",
"enum": [
Expand Down Expand Up @@ -8474,6 +8496,17 @@
"MultiSelection": {
"additionalProperties": false,
"properties": {
"clear": {
"anyOf": [
{
"$ref": "#/definitions/EventStream"
},
{
"type": "boolean"
}
],
"description": "Controls clearing selections. Can be `true`, `false`, or an [EventStream](https://vega.github.io/vega/docs/event-streams/).\n\n__Default value:__ `true`, which corresponds to `dblclick` (i.e.\nuser doubleclick clears current selection).\n\nSee the [TODO: clear] documentation for more information."
},
"empty": {
"description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.",
"enum": [
Expand Down Expand Up @@ -8544,6 +8577,17 @@
"MultiSelectionConfig": {
"additionalProperties": false,
"properties": {
"clear": {
"anyOf": [
{
"$ref": "#/definitions/EventStream"
},
{
"type": "boolean"
}
],
"description": "Controls clearing selections. Can be `true`, `false`, or an [EventStream](https://vega.github.io/vega/docs/event-streams/).\n\n__Default value:__ `true`, which corresponds to `dblclick` (i.e.\nuser doubleclick clears current selection).\n\nSee the [TODO: clear] documentation for more information."
},
"empty": {
"description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.",
"enum": [
Expand Down Expand Up @@ -10287,6 +10331,17 @@
],
"description": "Establish a two-way binding between a single selection and input elements\n(also known as dynamic query widgets). A binding takes the form of\nVega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)\nor can be a mapping between projected field/encodings and binding definitions.\n\nSee the [bind transform](https://vega.github.io/vega-lite/docs/bind.html) documentation for more information."
},
"clear": {
"anyOf": [
{
"$ref": "#/definitions/EventStream"
},
{
"type": "boolean"
}
],
"description": "Controls clearing selections. Can be `true`, `false`, or an [EventStream](https://vega.github.io/vega/docs/event-streams/).\n\n__Default value:__ `true`, which corresponds to `dblclick` (i.e.\nuser doubleclick clears current selection).\n\nSee the [TODO: clear] documentation for more information."
},
"empty": {
"description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.",
"enum": [
Expand Down Expand Up @@ -10354,6 +10409,17 @@
],
"description": "Establish a two-way binding between a single selection and input elements\n(also known as dynamic query widgets). A binding takes the form of\nVega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)\nor can be a mapping between projected field/encodings and binding definitions.\n\nSee the [bind transform](https://vega.github.io/vega-lite/docs/bind.html) documentation for more information."
},
"clear": {
"anyOf": [
{
"$ref": "#/definitions/EventStream"
},
{
"type": "boolean"
}
],
"description": "Controls clearing selections. Can be `true`, `false`, or an [EventStream](https://vega.github.io/vega/docs/event-streams/).\n\n__Default value:__ `true`, which corresponds to `dblclick` (i.e.\nuser doubleclick clears current selection).\n\nSee the [TODO: clear] documentation for more information."
},
"empty": {
"description": "By default, all data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.",
"enum": [
Expand Down
12 changes: 12 additions & 0 deletions examples/compiled/brush_table.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@
{
"events": {"signal": "brush_zoom_delta"},
"update": "clampRange(zoomLinear(brush_x, brush_zoom_anchor.x, brush_zoom_delta), 0, concat_0_width)"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "[0, 0]"
}
]
},
Expand Down Expand Up @@ -191,6 +195,10 @@
{
"events": {"signal": "brush_zoom_delta"},
"update": "clampRange(zoomLinear(brush_y, brush_zoom_anchor.y, brush_zoom_delta), 0, concat_0_height)"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "[0, 0]"
}
]
},
Expand Down Expand Up @@ -221,6 +229,10 @@
{"signal": "brush_Horsepower || brush_Miles_per_Gallon"}
],
"update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"concat_0\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "null"
}
]
},
Expand Down
6 changes: 4 additions & 2 deletions examples/compiled/circle_bubble_health_income.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
{
"events": {"signal": "view_zoom_delta"},
"update": "zoomLog(domain(\"x\"), view_zoom_anchor.x, view_zoom_delta)"
}
},
{"events": [{"source": "scope", "type": "dblclick"}], "update": "null"}
]
},
{
Expand All @@ -52,7 +53,8 @@
{
"events": {"signal": "view_zoom_delta"},
"update": "zoomLinear(domain(\"y\"), view_zoom_anchor.y, view_zoom_delta)"
}
},
{"events": [{"source": "scope", "type": "dblclick"}], "update": "null"}
]
},
{
Expand Down
4 changes: 4 additions & 0 deletions examples/compiled/concat_bar_layer_circle.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@
"events": [{"source": "scope", "type": "click"}],
"update": "datum && item().mark.marktype !== 'group' ? {unit: \"concat_1\", fields: pts_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)[\"Major_Genre\"]]} : null",
"force": true
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "null"
}
]
},
Expand Down
8 changes: 8 additions & 0 deletions examples/compiled/concat_hover.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
"events": [{"source": "scope", "type": "mouseover"}],
"update": "datum && item().mark.marktype !== 'group' ? {unit: \"concat_0\", fields: hover_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)[\"_vgsid_\"]]} : null",
"force": true
},
{
"events": [{"source": "scope", "type": "mouseout"}],
"update": "null"
}
]
},
Expand Down Expand Up @@ -170,6 +174,10 @@
"events": [{"source": "scope", "type": "mouseover"}],
"update": "datum && item().mark.marktype !== 'group' ? {unit: \"concat_1\", fields: hover_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)[\"_vgsid_\"]]} : null",
"force": true
},
{
"events": [{"source": "scope", "type": "mouseout"}],
"update": "null"
}
]
},
Expand Down
8 changes: 8 additions & 0 deletions examples/compiled/concat_hover_filter.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
"events": [{"source": "scope", "type": "mouseover"}],
"update": "datum && item().mark.marktype !== 'group' ? {unit: \"concat_0_layer_0\", fields: hover_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)[\"_vgsid_\"]]} : null",
"force": true
},
{
"events": [{"source": "scope", "type": "mouseout"}],
"update": "null"
}
]
},
Expand Down Expand Up @@ -208,6 +212,10 @@
"events": [{"source": "scope", "type": "mouseover"}],
"update": "datum && item().mark.marktype !== 'group' ? {unit: \"concat_1_layer_0\", fields: hover_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)[\"_vgsid_\"]]} : null",
"force": true
},
{
"events": [{"source": "scope", "type": "mouseout"}],
"update": "null"
}
]
},
Expand Down
7 changes: 6 additions & 1 deletion examples/compiled/interactive_area_brush.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
{
"events": {"signal": "brush_zoom_delta"},
"update": "clampRange(zoomLinear(brush_x, brush_zoom_anchor.x, brush_zoom_delta), 0, width)"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "[0, 0]"
}
]
},
Expand Down Expand Up @@ -133,7 +137,8 @@
{
"events": [{"signal": "brush_yearmonth_date"}],
"update": "brush_yearmonth_date ? {unit: \"layer_0\", fields: brush_tuple_fields, values: [brush_yearmonth_date]} : null"
}
},
{"events": [{"source": "scope", "type": "dblclick"}], "update": "null"}
]
},
{
Expand Down
9 changes: 6 additions & 3 deletions examples/compiled/interactive_bar_select_highlight.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"events": [{"source": "scope", "type": "mouseover"}],
"update": "datum && item().mark.marktype !== 'group' ? {unit: \"\", fields: highlight_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)[\"_vgsid_\"]]} : null",
"force": true
}
},
{"events": [{"source": "scope", "type": "mouseout"}], "update": "null"}
]
},
{
Expand All @@ -74,7 +75,8 @@
"events": [{"source": "scope", "type": "click"}],
"update": "datum && item().mark.marktype !== 'group' ? {unit: \"\", fields: select_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)[\"_vgsid_\"]]} : null",
"force": true
}
},
{"events": [{"source": "scope", "type": "dblclick"}], "update": "null"}
]
},
{
Expand All @@ -88,7 +90,8 @@
{
"events": [{"source": "scope", "type": "click"}],
"update": "event.shiftKey"
}
},
{"events": [{"source": "scope", "type": "dblclick"}], "update": "null"}
]
},
{
Expand Down
11 changes: 10 additions & 1 deletion examples/compiled/interactive_brush.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
{
"events": {"signal": "brush_zoom_delta"},
"update": "clampRange(zoomLinear(brush_x, brush_zoom_anchor.x, brush_zoom_delta), 0, width)"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "[0, 0]"
}
]
},
Expand Down Expand Up @@ -128,6 +132,10 @@
{
"events": {"signal": "brush_zoom_delta"},
"update": "clampRange(zoomLinear(brush_y, brush_zoom_anchor.y, brush_zoom_delta), 0, height)"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "[0, 0]"
}
]
},
Expand Down Expand Up @@ -158,7 +166,8 @@
{
"events": [{"signal": "brush_Horsepower || brush_Miles_per_Gallon"}],
"update": "brush_Horsepower && brush_Miles_per_Gallon ? {unit: \"\", fields: brush_tuple_fields, values: [brush_Horsepower,brush_Miles_per_Gallon]} : null"
}
},
{"events": [{"source": "scope", "type": "dblclick"}], "update": "null"}
]
},
{
Expand Down
4 changes: 4 additions & 0 deletions examples/compiled/interactive_concat_layer.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@
"events": [{"source": "scope", "type": "click"}],
"update": "datum && item().mark.marktype !== 'group' ? {unit: \"concat_1\", fields: pts_tuple_fields, values: [(item().isVoronoi ? datum.datum : datum)[\"Major_Genre\"]]} : null",
"force": true
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "null"
}
]
},
Expand Down
28 changes: 28 additions & 0 deletions examples/compiled/interactive_dashboard_europe_pop.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@
{
"events": {"signal": "brush_zoom_delta"},
"update": "clampRange(zoomLinear(brush_y, brush_zoom_anchor.y, brush_zoom_delta), 0, concat_0_height)"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "[0, 0]"
}
]
},
Expand Down Expand Up @@ -437,6 +441,10 @@
{
"events": [{"signal": "brush_Country"}],
"update": "brush_Country ? {unit: \"concat_0\", fields: brush_tuple_fields, values: [brush_Country]} : null"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "null"
}
]
},
Expand Down Expand Up @@ -719,6 +727,10 @@
{
"events": {"signal": "brush_zoom_delta"},
"update": "clampRange(zoomLinear(brush_y, brush_zoom_anchor.y, brush_zoom_delta), 0, concat_1_height)"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "[0, 0]"
}
]
},
Expand Down Expand Up @@ -747,6 +759,10 @@
{
"events": [{"signal": "brush_Country"}],
"update": "brush_Country ? {unit: \"concat_1\", fields: brush_tuple_fields, values: [brush_Country]} : null"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "null"
}
]
},
Expand Down Expand Up @@ -1032,6 +1048,10 @@
{
"events": {"signal": "brush_zoom_delta"},
"update": "clampRange(zoomLinear(brush_x, brush_zoom_anchor.x, brush_zoom_delta), 0, concat_2_width)"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "[0, 0]"
}
]
},
Expand Down Expand Up @@ -1087,6 +1107,10 @@
{
"events": {"signal": "brush_zoom_delta"},
"update": "clampRange(zoomLinear(brush_y, brush_zoom_anchor.y, brush_zoom_delta), 0, concat_2_height)"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "[0, 0]"
}
]
},
Expand Down Expand Up @@ -1119,6 +1143,10 @@
}
],
"update": "brush_Population_ages_65_and_above_of_total && brush_Population_ages_15_64_of_total ? {unit: \"concat_2\", fields: brush_tuple_fields, values: [brush_Population_ages_65_and_above_of_total,brush_Population_ages_15_64_of_total]} : null"
},
{
"events": [{"source": "scope", "type": "dblclick"}],
"update": "null"
}
]
},
Expand Down
Loading